=============================================================================== 4000ab88 : int IMFS_chown( const rtems_filesystem_location_info_t *loc, uid_t owner, gid_t group ) { 4000ab88: 9d e3 bf 98 save %sp, -104, %sp IMFS_jnode_t *jnode; #if defined(RTEMS_POSIX_API) uid_t st_uid; #endif jnode = (IMFS_jnode_t *) loc->node_access; 4000ab8c: fa 06 20 08 ld [ %i0 + 8 ], %i5 #endif jnode->st_uid = owner; jnode->st_gid = group; IMFS_update_ctime( jnode ); 4000ab90: 90 07 bf f8 add %fp, -8, %o0 if ( ( st_uid != jnode->st_uid ) && ( st_uid != 0 ) ) rtems_set_errno_and_return_minus_one( EPERM ); #endif jnode->st_uid = owner; 4000ab94: f2 37 60 3c sth %i1, [ %i5 + 0x3c ] jnode->st_gid = group; 4000ab98: f4 37 60 3e sth %i2, [ %i5 + 0x3e ] IMFS_update_ctime( jnode ); 4000ab9c: 7f ff e1 36 call 40003074 4000aba0: 92 10 20 00 clr %o1 4000aba4: c2 07 bf f8 ld [ %fp + -8 ], %g1 4000aba8: c2 27 60 48 st %g1, [ %i5 + 0x48 ] return 0; } 4000abac: 81 c7 e0 08 ret 4000abb0: 91 e8 20 00 restore %g0, 0, %o0 =============================================================================== 4000505c : */ static void IMFS_dump_directory( IMFS_jnode_t *the_directory, int level ) { 4000505c: 9d e3 bf a0 save %sp, -96, %sp the_node = the_node->next ) { the_jnode = (IMFS_jnode_t *) the_node; for ( i=0 ; i<=level ; i++ ) fprintf(stdout, "...." ); 40005060: 35 10 00 86 sethi %hi(0x40021800), %i2 40005064: 39 10 00 8d sethi %hi(0x40023400), %i4 case IMFS_FIFO: fprintf(stdout, " FIFO not printed\n" ); return; default: fprintf(stdout, " bad type %d\n", IMFS_type( the_jnode ) ); 40005068: 21 10 00 86 sethi %hi(0x40021800), %l0 return; } puts(""); 4000506c: 23 10 00 86 sethi %hi(0x40021800), %l1 case IMFS_SYM_LINK: fprintf(stdout, " links not printed\n" ); return; case IMFS_FIFO: fprintf(stdout, " FIFO not printed\n" ); 40005070: 25 10 00 86 sethi %hi(0x40021800), %l2 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_First( Chain_Control *the_chain ) { return _Chain_Head( the_chain )->next; 40005074: fa 06 20 50 ld [ %i0 + 0x50 ], %i5 the_node = the_node->next ) { the_jnode = (IMFS_jnode_t *) the_node; for ( i=0 ; i<=level ; i++ ) fprintf(stdout, "...." ); 40005078: b4 16 a2 a0 or %i2, 0x2a0, %i2 4000507c: b8 17 23 68 or %i4, 0x368, %i4 case IMFS_FIFO: fprintf(stdout, " FIFO not printed\n" ); return; default: fprintf(stdout, " bad type %d\n", IMFS_type( the_jnode ) ); 40005080: a0 14 23 10 or %l0, 0x310, %l0 return; } puts(""); 40005084: a2 14 61 90 or %l1, 0x190, %l1 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 ); 40005088: 10 80 00 4d b 400051bc 4000508c: a4 14 a2 f8 or %l2, 0x2f8, %l2 the_node = the_node->next ) { the_jnode = (IMFS_jnode_t *) the_node; for ( i=0 ; i<=level ; i++ ) fprintf(stdout, "...." ); 40005090: 90 10 00 1a mov %i2, %o0 40005094: 40 00 34 15 call 400120e8 40005098: b6 06 e0 01 inc %i3 4000509c: 10 80 00 03 b 400050a8 400050a0: c2 07 00 00 ld [ %i4 ], %g1 400050a4: c2 07 00 00 ld [ %i4 ], %g1 !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++ ) 400050a8: 80 a6 c0 19 cmp %i3, %i1 400050ac: 04 bf ff f9 ble 40005090 400050b0: d2 00 60 08 ld [ %g1 + 8 ], %o1 IMFS_jnode_t *the_jnode ) { IMFS_assert( the_jnode ); fprintf(stdout, "%s", the_jnode->name ); 400050b4: 40 00 34 0d call 400120e8 400050b8: 90 07 60 0c add %i5, 0xc, %o0 rtems_chain_extract_unprotected( &node->Node ); } static inline IMFS_jnode_types_t IMFS_type( const IMFS_jnode_t *node ) { return node->control->imfs_type; 400050bc: c2 07 60 4c ld [ %i5 + 0x4c ], %g1 400050c0: d4 00 40 00 ld [ %g1 ], %o2 switch( IMFS_type( the_jnode ) ) { 400050c4: 80 a2 a0 06 cmp %o2, 6 400050c8: 38 80 00 2d bgu,a 4000517c <== NEVER TAKEN 400050cc: c2 07 00 00 ld [ %i4 ], %g1 <== NOT EXECUTED 400050d0: 95 2a a0 02 sll %o2, 2, %o2 400050d4: 03 10 00 14 sethi %hi(0x40005000), %g1 400050d8: 82 10 60 40 or %g1, 0x40, %g1 ! 40005040 400050dc: c2 00 40 0a ld [ %g1 + %o2 ], %g1 400050e0: 81 c0 40 00 jmp %g1 400050e4: 01 00 00 00 nop case IMFS_DIRECTORY: fprintf(stdout, "/" ); 400050e8: c2 07 00 00 ld [ %i4 ], %g1 400050ec: 90 10 20 2f mov 0x2f, %o0 400050f0: 40 00 33 ca call 40012018 400050f4: d2 00 60 08 ld [ %g1 + 8 ], %o1 400050f8: 30 80 00 26 b,a 40005190 break; case IMFS_DEVICE: fprintf(stdout, " (device %" PRId32 ", %" PRId32 ")", 400050fc: c2 07 00 00 ld [ %i4 ], %g1 40005100: 13 10 00 86 sethi %hi(0x40021800), %o1 40005104: d0 00 60 08 ld [ %g1 + 8 ], %o0 40005108: 92 12 62 a8 or %o1, 0x2a8, %o1 4000510c: 10 80 00 08 b 4000512c 40005110: d4 1f 60 50 ldd [ %i5 + 0x50 ], %o2 the_jnode->info.device.major, the_jnode->info.device.minor ); break; case IMFS_LINEAR_FILE: fprintf(stdout, " (file %" PRId32 " %p)", 40005114: c2 07 00 00 ld [ %i4 ], %g1 40005118: d4 07 60 54 ld [ %i5 + 0x54 ], %o2 4000511c: d0 00 60 08 ld [ %g1 + 8 ], %o0 40005120: d6 07 60 58 ld [ %i5 + 0x58 ], %o3 40005124: 13 10 00 86 sethi %hi(0x40021800), %o1 40005128: 92 12 62 c0 or %o1, 0x2c0, %o1 ! 40021ac0 <__FUNCTION__.6150+0x278> 4000512c: 40 00 33 9f call 40011fa8 40005130: 01 00 00 00 nop 40005134: 30 80 00 17 b,a 40005190 the_jnode->info.file.indirect, the_jnode->info.file.doubly_indirect, the_jnode->info.file.triply_indirect ); #else fprintf(stdout, " (file %" PRId32 ")", 40005138: c2 07 00 00 ld [ %i4 ], %g1 4000513c: d4 07 60 54 ld [ %i5 + 0x54 ], %o2 40005140: d0 00 60 08 ld [ %g1 + 8 ], %o0 40005144: 13 10 00 86 sethi %hi(0x40021800), %o1 40005148: 40 00 33 98 call 40011fa8 4000514c: 92 12 62 d0 or %o1, 0x2d0, %o1 ! 40021ad0 <__FUNCTION__.6150+0x288> 40005150: 30 80 00 10 b,a 40005190 case IMFS_HARD_LINK: fprintf(stdout, " links not printed\n" ); return; case IMFS_SYM_LINK: fprintf(stdout, " links not printed\n" ); 40005154: 11 10 00 86 sethi %hi(0x40021800), %o0 40005158: c2 07 00 00 ld [ %i4 ], %g1 4000515c: 10 80 00 04 b 4000516c 40005160: 90 12 22 e0 or %o0, 0x2e0, %o0 return; case IMFS_FIFO: fprintf(stdout, " FIFO not printed\n" ); 40005164: c2 07 00 00 ld [ %i4 ], %g1 40005168: 90 10 00 12 mov %l2, %o0 4000516c: 40 00 33 df call 400120e8 40005170: d2 00 60 08 ld [ %g1 + 8 ], %o1 } static inline bool IMFS_is_directory( const IMFS_jnode_t *node ) { return node->control->imfs_type == IMFS_DIRECTORY; 40005174: 10 80 00 0a b 4000519c 40005178: c2 07 60 4c ld [ %i5 + 0x4c ], %g1 return; default: fprintf(stdout, " bad type %d\n", IMFS_type( the_jnode ) ); 4000517c: 92 10 00 10 mov %l0, %o1 <== NOT EXECUTED 40005180: 40 00 33 8a call 40011fa8 <== NOT EXECUTED 40005184: d0 00 60 08 ld [ %g1 + 8 ], %o0 <== NOT EXECUTED 40005188: 10 80 00 05 b 4000519c <== NOT EXECUTED 4000518c: c2 07 60 4c ld [ %i5 + 0x4c ], %g1 <== NOT EXECUTED return; } puts(""); 40005190: 40 00 3a bd call 40013c84 40005194: 90 10 00 11 mov %l1, %o0 40005198: c2 07 60 4c ld [ %i5 + 0x4c ], %g1 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 ) ) 4000519c: c2 00 40 00 ld [ %g1 ], %g1 400051a0: 80 a0 60 00 cmp %g1, 0 400051a4: 32 80 00 06 bne,a 400051bc 400051a8: fa 07 40 00 ld [ %i5 ], %i5 IMFS_dump_directory( the_jnode, level + 1 ); 400051ac: 90 10 00 1d mov %i5, %o0 400051b0: 7f ff ff ab call 4000505c 400051b4: 92 06 60 01 add %i1, 1, %o1 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 ) { 400051b8: fa 07 40 00 ld [ %i5 ], %i5 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 )); 400051bc: 82 06 20 54 add %i0, 0x54, %g1 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 ); 400051c0: 80 a7 40 01 cmp %i5, %g1 400051c4: 12 bf ff b8 bne 400050a4 400051c8: b6 10 20 00 clr %i3 fprintf(stdout, "...." ); IMFS_print_jnode( the_jnode ); if ( IMFS_is_directory( the_jnode ) ) IMFS_dump_directory( the_jnode, level + 1 ); } } 400051cc: 81 c7 e0 08 ret 400051d0: 81 e8 00 00 restore =============================================================================== 4000ace4 : rtems_filesystem_eval_path_context_t *ctx, void *arg, const char *token, size_t tokenlen ) { 4000ace4: 9d e3 bf a0 save %sp, -96, %sp 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; 4000ace8: f8 06 20 20 ld [ %i0 + 0x20 ], %i4 bool access_ok = rtems_filesystem_eval_path_check_access( 4000acec: 90 10 00 18 mov %i0, %o0 4000acf0: d4 07 20 30 ld [ %i4 + 0x30 ], %o2 4000acf4: d6 17 20 3c lduh [ %i4 + 0x3c ], %o3 4000acf8: d8 17 20 3e lduh [ %i4 + 0x3e ], %o4 4000acfc: 40 00 02 dc call 4000b86c 4000ad00: 92 10 20 01 mov 1, %o1 dir->st_mode, dir->st_uid, dir->st_gid ); if ( access_ok ) { 4000ad04: 80 8a 20 ff btst 0xff, %o0 4000ad08: 12 80 00 04 bne 4000ad18 4000ad0c: 80 a6 e0 01 cmp %i3, 1 void *arg, const char *token, size_t tokenlen ) { rtems_filesystem_eval_path_generic_status status = 4000ad10: 81 c7 e0 08 ret 4000ad14: 91 e8 20 01 restore %g0, 1, %o0 static inline bool rtems_filesystem_is_current_directory( const char *token, size_t tokenlen ) { return tokenlen == 1 && token [0] == '.'; 4000ad18: 12 80 00 06 bne 4000ad30 4000ad1c: 82 10 20 00 clr %g1 4000ad20: c2 4e 80 00 ldsb [ %i2 ], %g1 4000ad24: 82 18 60 2e xor %g1, 0x2e, %g1 4000ad28: 80 a0 00 01 cmp %g0, %g1 4000ad2c: 82 60 3f ff subx %g0, -1, %g1 IMFS_jnode_t *dir, const char *token, size_t tokenlen ) { if ( rtems_filesystem_is_current_directory( token, tokenlen ) ) { 4000ad30: 80 a0 60 00 cmp %g1, 0 4000ad34: 12 80 00 2b bne 4000ade0 4000ad38: 80 a6 e0 02 cmp %i3, 2 static inline bool rtems_filesystem_is_parent_directory( const char *token, size_t tokenlen ) { return tokenlen == 2 && token [0] == '.' && token [1] == '.'; 4000ad3c: 12 80 00 0b bne 4000ad68 4000ad40: 80 a0 60 00 cmp %g1, 0 4000ad44: c4 4e 80 00 ldsb [ %i2 ], %g2 4000ad48: 80 a0 a0 2e cmp %g2, 0x2e 4000ad4c: 12 80 00 07 bne 4000ad68 4000ad50: 80 a0 60 00 cmp %g1, 0 4000ad54: c2 4e a0 01 ldsb [ %i2 + 1 ], %g1 4000ad58: 82 18 60 2e xor %g1, 0x2e, %g1 4000ad5c: 80 a0 00 01 cmp %g0, %g1 4000ad60: 82 60 3f ff subx %g0, -1, %g1 return dir; } else { if ( rtems_filesystem_is_parent_directory( token, tokenlen ) ) { 4000ad64: 80 a0 60 00 cmp %g1, 0 4000ad68: 22 80 00 04 be,a 4000ad78 4000ad6c: fa 07 20 50 ld [ %i4 + 0x50 ], %i5 return dir->Parent; 4000ad70: 10 80 00 17 b 4000adcc 4000ad74: fa 07 20 08 ld [ %i4 + 8 ], %i5 } 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 ); 4000ad78: 10 80 00 10 b 4000adb8 4000ad7c: b2 07 20 54 add %i4, 0x54, %i1 while ( current != tail ) { IMFS_jnode_t *entry = (IMFS_jnode_t *) current; bool match = strncmp( entry->name, token, tokenlen ) == 0 4000ad80: 92 10 00 1a mov %i2, %o1 4000ad84: 40 00 11 8b call 4000f3b0 4000ad88: 94 10 00 1b mov %i3, %o2 && entry->name [tokenlen] == '\0'; 4000ad8c: 80 a2 20 00 cmp %o0, 0 4000ad90: 12 80 00 06 bne 4000ada8 4000ad94: 82 10 20 00 clr %g1 4000ad98: 82 07 40 1b add %i5, %i3, %g1 4000ad9c: c2 48 60 0c ldsb [ %g1 + 0xc ], %g1 4000ada0: 80 a0 00 01 cmp %g0, %g1 4000ada4: 82 60 3f ff subx %g0, -1, %g1 if ( match ) { 4000ada8: 80 a0 60 00 cmp %g1, 0 4000adac: 12 80 00 09 bne 4000add0 4000adb0: 80 a7 60 00 cmp %i5, 0 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Next( Chain_Node *the_node ) { return the_node->next; 4000adb4: fa 07 40 00 ld [ %i5 ], %i5 } 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 ) { 4000adb8: 80 a7 40 19 cmp %i5, %i1 4000adbc: 12 bf ff f1 bne 4000ad80 4000adc0: 90 07 60 0c add %i5, 0xc, %o0 rtems_filesystem_eval_path_restart( ctx, fs_root_ptr ); } } } } else { status = RTEMS_FILESYSTEM_EVAL_PATH_GENERIC_NO_ENTRY; 4000adc4: 81 c7 e0 08 ret 4000adc8: 91 e8 20 02 restore %g0, 2, %o0 ); if ( access_ok ) { IMFS_jnode_t *entry = IMFS_search_in_directory( dir, token, tokenlen ); if ( entry != NULL ) { 4000adcc: 80 a7 60 00 cmp %i5, 0 4000add0: 32 80 00 06 bne,a 4000ade8 4000add4: c2 06 20 04 ld [ %i0 + 4 ], %g1 rtems_filesystem_eval_path_restart( ctx, fs_root_ptr ); } } } } else { status = RTEMS_FILESYSTEM_EVAL_PATH_GENERIC_NO_ENTRY; 4000add8: 81 c7 e0 08 ret 4000addc: 91 e8 20 02 restore %g0, 2, %o0 IMFS_jnode_t *dir, const char *token, size_t tokenlen ) { if ( rtems_filesystem_is_current_directory( token, tokenlen ) ) { 4000ade0: ba 10 00 1c mov %i4, %i5 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 ); 4000ade4: c2 06 20 04 ld [ %i0 + 4 ], %g1 static inline int rtems_filesystem_eval_path_get_flags( const rtems_filesystem_eval_path_context_t *ctx ) { return ctx->flags; 4000ade8: c6 06 20 10 ld [ %i0 + 0x10 ], %g3 4000adec: 80 a0 00 01 cmp %g0, %g1 rtems_chain_extract_unprotected( &node->Node ); } static inline IMFS_jnode_types_t IMFS_type( const IMFS_jnode_t *node ) { return node->control->imfs_type; 4000adf0: c2 07 60 4c ld [ %i5 + 0x4c ], %g1 4000adf4: 84 60 3f ff subx %g0, -1, %g2 4000adf8: c2 00 40 00 ld [ %g1 ], %g1 static inline void rtems_filesystem_eval_path_clear_token( rtems_filesystem_eval_path_context_t *ctx ) { ctx->tokenlen = 0; 4000adfc: c0 26 20 0c clr [ %i0 + 0xc ] 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)) { 4000ae00: 80 a0 60 02 cmp %g1, 2 4000ae04: 12 80 00 0a bne 4000ae2c 4000ae08: 88 10 00 02 mov %g2, %g4 4000ae0c: 80 a0 a0 00 cmp %g2, 0 4000ae10: 22 80 00 2b be,a 4000aebc 4000ae14: fa 07 60 50 ld [ %i5 + 0x50 ], %i5 4000ae18: 80 88 e0 08 btst 8, %g3 4000ae1c: 22 80 00 29 be,a 4000aec0 4000ae20: c2 17 20 34 lduh [ %i4 + 0x34 ], %g1 entry = entry->info.hard_link.link_node; 4000ae24: 10 80 00 26 b 4000aebc 4000ae28: fa 07 60 50 ld [ %i5 + 0x50 ], %i5 } if ( type == IMFS_SYM_LINK && (follow_sym_link || !terminal)) { 4000ae2c: 80 a0 60 03 cmp %g1, 3 4000ae30: 12 80 00 10 bne 4000ae70 4000ae34: 80 a0 60 00 cmp %g1, 0 4000ae38: 80 a0 a0 00 cmp %g2, 0 4000ae3c: 02 80 00 04 be 4000ae4c 4000ae40: 80 88 e0 10 btst 0x10, %g3 4000ae44: 22 80 00 1f be,a 4000aec0 4000ae48: c2 17 20 34 lduh [ %i4 + 0x34 ], %g1 const char *target = entry->info.sym_link.name; 4000ae4c: fa 07 60 50 ld [ %i5 + 0x50 ], %i5 rtems_filesystem_eval_path_recursive( ctx, target, strlen( target ) ); 4000ae50: 40 00 11 26 call 4000f2e8 4000ae54: 90 10 00 1d mov %i5, %o0 4000ae58: 92 10 00 1d mov %i5, %o1 4000ae5c: 94 10 00 08 mov %o0, %o2 4000ae60: 7f ff e5 1e call 400042d8 4000ae64: 90 10 00 18 mov %i0, %o0 void *arg, const char *token, size_t tokenlen ) { rtems_filesystem_eval_path_generic_status status = 4000ae68: 81 c7 e0 08 ret 4000ae6c: 91 e8 20 01 restore %g0, 1, %o0 IMFS_jnode_types_t type ) { rtems_filesystem_global_location_t **fs_root_ptr = NULL; if ( type == IMFS_DIRECTORY ) { 4000ae70: 32 80 00 14 bne,a 4000aec0 4000ae74: c2 17 20 34 lduh [ %i4 + 0x34 ], %g1 if ( node->info.directory.mt_fs != NULL ) { 4000ae78: d2 07 60 5c ld [ %i5 + 0x5c ], %o1 4000ae7c: 80 a2 60 00 cmp %o1, 0 4000ae80: 02 80 00 0f be 4000aebc 4000ae84: 90 10 00 18 mov %i0, %o0 if ( !terminal ) { status = RTEMS_FILESYSTEM_EVAL_PATH_GENERIC_CONTINUE; } } else { access_ok = rtems_filesystem_eval_path_check_access( 4000ae88: d4 07 60 30 ld [ %i5 + 0x30 ], %o2 4000ae8c: d6 17 60 3c lduh [ %i5 + 0x3c ], %o3 4000ae90: d8 17 60 3e lduh [ %i5 + 0x3e ], %o4 { 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; 4000ae94: b8 02 60 24 add %o1, 0x24, %i4 if ( !terminal ) { status = RTEMS_FILESYSTEM_EVAL_PATH_GENERIC_CONTINUE; } } else { access_ok = rtems_filesystem_eval_path_check_access( 4000ae98: 40 00 02 75 call 4000b86c 4000ae9c: 92 10 20 01 mov 1, %o1 RTEMS_FS_PERMS_EXEC, entry->st_mode, entry->st_uid, entry->st_gid ); if ( access_ok ) { 4000aea0: 80 8a 20 ff btst 0xff, %o0 4000aea4: 02 80 00 04 be 4000aeb4 <== NEVER TAKEN 4000aea8: 90 10 00 18 mov %i0, %o0 rtems_filesystem_eval_path_restart( ctx, fs_root_ptr ); 4000aeac: 7f ff e4 f2 call 40004274 4000aeb0: 92 10 00 1c mov %i4, %o1 void *arg, const char *token, size_t tokenlen ) { rtems_filesystem_eval_path_generic_status status = 4000aeb4: 81 c7 e0 08 ret 4000aeb8: 91 e8 20 01 restore %g0, 1, %o0 } else { rtems_filesystem_global_location_t **fs_root_ptr = IMFS_is_mount_point( entry, type ); if ( fs_root_ptr == NULL ) { --dir->reference_count; 4000aebc: c2 17 20 34 lduh [ %i4 + 0x34 ], %g1 4000aec0: 82 00 7f ff add %g1, -1, %g1 4000aec4: c2 37 20 34 sth %g1, [ %i4 + 0x34 ] ++entry->reference_count; 4000aec8: c2 17 60 34 lduh [ %i5 + 0x34 ], %g1 4000aecc: 82 00 60 01 inc %g1 4000aed0: c2 37 60 34 sth %g1, [ %i5 + 0x34 ] 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; 4000aed4: c2 07 60 4c ld [ %i5 + 0x4c ], %g1 currentloc->node_access = entry; 4000aed8: fa 26 20 20 st %i5, [ %i0 + 0x20 ] 4000aedc: c2 00 60 04 ld [ %g1 + 4 ], %g1 4000aee0: c2 26 20 28 st %g1, [ %i0 + 0x28 ] void *arg, const char *token, size_t tokenlen ) { rtems_filesystem_eval_path_generic_status status = 4000aee4: b0 09 20 ff and %g4, 0xff, %i0 status = RTEMS_FILESYSTEM_EVAL_PATH_GENERIC_NO_ENTRY; } } return status; } 4000aee8: 81 c7 e0 08 ret 4000aeec: 81 e8 00 00 restore =============================================================================== 40003118 : static ssize_t IMFS_fifo_write( rtems_libio_t *iop, const void *buffer, size_t count ) { 40003118: 9d e3 bf 98 save %sp, -104, %sp IMFS_jnode_t *jnode = iop->pathinfo.node_access; 4000311c: fa 06 20 1c ld [ %i0 + 0x1c ], %i5 int err = pipe_write(JNODE2PIPE(jnode), buffer, count, iop); 40003120: 96 10 00 18 mov %i0, %o3 40003124: d0 07 60 50 ld [ %i5 + 0x50 ], %o0 40003128: 92 10 00 19 mov %i1, %o1 4000312c: 40 00 28 a2 call 4000d3b4 40003130: 94 10 00 1a mov %i2, %o2 if (err > 0) { 40003134: b0 92 20 00 orcc %o0, 0, %i0 40003138: 04 80 00 09 ble 4000315c 4000313c: 90 07 bf f8 add %fp, -8, %o0 IMFS_mtime_ctime_update(jnode); 40003140: 40 00 03 82 call 40003f48 40003144: 92 10 20 00 clr %o1 40003148: c2 07 bf f8 ld [ %fp + -8 ], %g1 4000314c: c2 27 60 44 st %g1, [ %i5 + 0x44 ] 40003150: c2 27 60 48 st %g1, [ %i5 + 0x48 ] 40003154: 81 c7 e0 08 ret 40003158: 81 e8 00 00 restore } IMFS_FIFO_RETURN(err); 4000315c: 80 a6 20 00 cmp %i0, 0 40003160: 02 80 00 06 be 40003178 <== NEVER TAKEN 40003164: 01 00 00 00 nop 40003168: 40 00 30 2e call 4000f220 <__errno> 4000316c: b0 20 00 18 neg %i0 40003170: f0 22 00 00 st %i0, [ %o0 ] 40003174: b0 10 3f ff mov -1, %i0 } 40003178: 81 c7 e0 08 ret 4000317c: 81 e8 00 00 restore =============================================================================== 4000af40 : ((IMFS_jnode_t *)( rtems_chain_head( jnode_get_control( jnode ) )->next)) void IMFS_fsunmount( rtems_filesystem_mount_table_entry_t *temp_mt_entry ) { 4000af40: 9d e3 bf 88 save %sp, -120, %sp /* * Traverse tree that starts at the mt_fs_root and deallocate memory * associated memory space */ loc = temp_mt_entry->mt_fs_root->location; 4000af44: f6 06 20 24 ld [ %i0 + 0x24 ], %i3 4000af48: b8 07 bf e8 add %fp, -24, %i4 4000af4c: 92 10 00 1b mov %i3, %o1 4000af50: 90 10 00 1c mov %i4, %o0 4000af54: 40 00 0d af call 4000e610 4000af58: 94 10 20 18 mov 0x18, %o2 jnode = (IMFS_jnode_t *)loc.node_access; 4000af5c: fa 07 bf f0 ld [ %fp + -16 ], %i5 /* * Set this to null to indicate that it is being unmounted. */ temp_mt_entry->mt_fs_root->location.node_access = NULL; 4000af60: c0 26 e0 08 clr [ %i3 + 8 ] 4000af64: b6 10 00 1c mov %i4, %i3 4000af68: c2 07 60 4c ld [ %i5 + 0x4c ], %g1 do { next = jnode->Parent; 4000af6c: f8 07 60 08 ld [ %i5 + 8 ], %i4 4000af70: c4 00 60 04 ld [ %g1 + 4 ], %g2 loc.node_access = (void *)jnode; IMFS_Set_handlers( &loc ); if ( !IMFS_is_directory( jnode ) || jnode_has_no_children( jnode ) ) { 4000af74: c2 00 40 00 ld [ %g1 ], %g1 temp_mt_entry->mt_fs_root->location.node_access = NULL; do { next = jnode->Parent; loc.node_access = (void *)jnode; 4000af78: fa 27 bf f0 st %i5, [ %fp + -16 ] IMFS_Set_handlers( &loc ); if ( !IMFS_is_directory( jnode ) || jnode_has_no_children( jnode ) ) { 4000af7c: 80 a0 60 00 cmp %g1, 0 4000af80: 12 80 00 07 bne 4000af9c 4000af84: c4 27 bf f8 st %g2, [ %fp + -8 ] 4000af88: c4 07 60 50 ld [ %i5 + 0x50 ], %g2 RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( const Chain_Control *the_chain ) { return _Chain_Immutable_first( the_chain ) == _Chain_Immutable_tail( the_chain ); 4000af8c: 82 07 60 54 add %i5, 0x54, %g1 4000af90: 80 a0 80 01 cmp %g2, %g1 4000af94: 32 80 00 10 bne,a 4000afd4 4000af98: c2 07 60 4c ld [ %i5 + 0x4c ], %g1 result = IMFS_rmnod( NULL, &loc ); 4000af9c: 90 10 20 00 clr %o0 4000afa0: 7f ff de ab call 40002a4c 4000afa4: 92 10 00 1b mov %i3, %o1 if ( result != 0 ) 4000afa8: 80 a2 20 00 cmp %o0, 0 4000afac: 02 80 00 04 be 4000afbc <== ALWAYS TAKEN 4000afb0: 11 37 ab 6f sethi %hi(0xdeadbc00), %o0 rtems_fatal_error_occurred( 0xdeadbeef ); 4000afb4: 7f ff f1 ca call 400076dc <== NOT EXECUTED 4000afb8: 90 12 22 ef or %o0, 0x2ef, %o0 ! deadbeef <== NOT EXECUTED IMFS_node_destroy( jnode ); 4000afbc: 7f ff dd d2 call 40002704 4000afc0: 90 10 00 1d mov %i5, %o0 jnode = next; } if ( jnode != NULL ) { 4000afc4: 80 a7 20 00 cmp %i4, 0 4000afc8: 02 80 00 0e be 4000b000 4000afcc: ba 10 00 1c mov %i4, %i5 return node->control->imfs_type; } static inline bool IMFS_is_directory( const IMFS_jnode_t *node ) { return node->control->imfs_type == IMFS_DIRECTORY; 4000afd0: c2 07 60 4c ld [ %i5 + 0x4c ], %g1 if ( IMFS_is_directory( jnode ) ) { 4000afd4: c2 00 40 00 ld [ %g1 ], %g1 4000afd8: 80 a0 60 00 cmp %g1, 0 4000afdc: 32 bf ff e4 bne,a 4000af6c <== NEVER TAKEN 4000afe0: c2 07 60 4c ld [ %i5 + 0x4c ], %g1 <== NOT EXECUTED */ RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_first( const Chain_Control *the_chain ) { return _Chain_Immutable_head( the_chain )->next; 4000afe4: c2 07 60 50 ld [ %i5 + 0x50 ], %g1 RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( const Chain_Control *the_chain ) { return _Chain_Immutable_first( the_chain ) == _Chain_Immutable_tail( the_chain ); 4000afe8: 84 07 60 54 add %i5, 0x54, %g2 if ( jnode_has_children( jnode ) ) 4000afec: 80 a0 40 02 cmp %g1, %g2 4000aff0: 02 bf ff de be 4000af68 4000aff4: 80 a0 60 00 cmp %g1, 0 jnode = jnode_get_first_child( jnode ); } } } while (jnode != NULL); 4000aff8: 12 bf ff dc bne 4000af68 <== ALWAYS TAKEN 4000affc: ba 10 00 01 mov %g1, %i5 4000b000: 81 c7 e0 08 ret 4000b004: 81 e8 00 00 restore =============================================================================== 400025f8 : 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] ) { 400025f8: 9d e3 bf a0 save %sp, -96, %sp static int imfs_instance; int rv = 0; IMFS_fs_info_t *fs_info = calloc( 1, sizeof( *fs_info ) ); 400025fc: 90 10 20 01 mov 1, %o0 40002600: 40 00 01 c0 call 40002d00 40002604: 92 10 20 24 mov 0x24, %o1 if ( fs_info != NULL ) { 40002608: ba 92 20 00 orcc %o0, 0, %i5 4000260c: 02 80 00 24 be 4000269c 40002610: 03 10 00 72 sethi %hi(0x4001c800), %g1 IMFS_jnode_t *root_node; fs_info->instance = imfs_instance++; 40002614: c4 00 60 9c ld [ %g1 + 0x9c ], %g2 ! 4001c89c memcpy( 40002618: 92 10 00 1a mov %i2, %o1 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++; 4000261c: c4 27 40 00 st %g2, [ %i5 ] 40002620: 84 00 a0 01 inc %g2 memcpy( 40002624: 94 10 20 1c mov 0x1c, %o2 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++; 40002628: c4 20 60 9c st %g2, [ %g1 + 0x9c ] memcpy( 4000262c: 40 00 2f f9 call 4000e610 40002630: 90 07 60 08 add %i5, 8, %o0 fs_info->node_controls, node_controls, sizeof( fs_info->node_controls ) ); root_node = IMFS_allocate_node( 40002634: d2 07 60 08 ld [ %i5 + 8 ], %o1 40002638: 90 10 00 1d mov %i5, %o0 4000263c: 15 10 00 6a sethi %hi(0x4001a800), %o2 40002640: 96 10 20 00 clr %o3 40002644: 94 12 a0 30 or %o2, 0x30, %o2 40002648: 19 00 00 10 sethi %hi(0x4000), %o4 4000264c: 9a 10 20 00 clr %o5 40002650: 40 00 21 59 call 4000abb4 40002654: 98 13 21 ed or %o4, 0x1ed, %o4 "", 0, (S_IFDIR | 0755), NULL ); if ( root_node != NULL ) { 40002658: 80 a2 20 00 cmp %o0, 0 4000265c: 02 80 00 10 be 4000269c <== NEVER TAKEN 40002660: 03 10 00 6c sethi %hi(0x4001b000), %g1 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; 40002664: c4 02 20 4c ld [ %o0 + 0x4c ], %g2 mt_entry->fs_info = fs_info; mt_entry->ops = op_table; mt_entry->pathconf_limits_and_options = &IMFS_LIMITS_AND_OPTIONS; 40002668: 82 10 61 f4 or %g1, 0x1f4, %g1 4000266c: c4 00 a0 04 ld [ %g2 + 4 ], %g2 40002670: c2 26 20 2c st %g1, [ %i0 + 0x2c ] mt_entry->mt_fs_root->location.node_access = root_node; 40002674: c2 06 20 24 ld [ %i0 + 0x24 ], %g1 0, (S_IFDIR | 0755), NULL ); if ( root_node != NULL ) { mt_entry->fs_info = fs_info; 40002678: fa 26 20 08 st %i5, [ %i0 + 8 ] mt_entry->ops = op_table; 4000267c: f2 26 20 0c st %i1, [ %i0 + 0xc ] 40002680: c4 20 60 10 st %g2, [ %g1 + 0x10 ] mt_entry->pathconf_limits_and_options = &IMFS_LIMITS_AND_OPTIONS; mt_entry->mt_fs_root->location.node_access = root_node; 40002684: d0 20 60 08 st %o0, [ %g1 + 8 ] errno = ENOMEM; rv = -1; } if ( rv == 0 ) { IMFS_determine_bytes_per_block( 40002688: 86 10 20 06 mov 6, %g3 4000268c: 03 10 00 70 sethi %hi(0x4001c000), %g1 int bit_mask; /* * check, whether requested bytes per block is valid */ for (bit_mask = 16; !is_valid && (bit_mask <= 512); bit_mask <<= 1) { 40002690: 84 10 20 10 mov 0x10, %g2 errno = ENOMEM; rv = -1; } if ( rv == 0 ) { IMFS_determine_bytes_per_block( 40002694: 10 80 00 08 b 400026b4 40002698: c2 00 62 20 ld [ %g1 + 0x220 ], %g1 } else { errno = ENOMEM; rv = -1; } } else { errno = ENOMEM; 4000269c: 40 00 2d 8c call 4000dccc <__errno> 400026a0: b0 10 3f ff mov -1, %i0 400026a4: 82 10 20 0c mov 0xc, %g1 400026a8: c2 22 00 00 st %g1, [ %o0 ] 400026ac: 81 c7 e0 08 ret 400026b0: 81 e8 00 00 restore /* * 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) { 400026b4: 80 a0 80 01 cmp %g2, %g1 400026b8: 22 80 00 09 be,a 400026dc 400026bc: 05 10 00 72 sethi %hi(0x4001c800), %g2 is_valid = true; break; } if(bit_mask > requested_bytes_per_block) 400026c0: 34 80 00 06 bg,a 400026d8 400026c4: 82 10 20 80 mov 0x80, %g1 int bit_mask; /* * check, whether requested bytes per block is valid */ for (bit_mask = 16; !is_valid && (bit_mask <= 512); bit_mask <<= 1) { 400026c8: 86 80 ff ff addcc %g3, -1, %g3 400026cc: 12 bf ff fa bne 400026b4 <== ALWAYS TAKEN 400026d0: 85 28 a0 01 sll %g2, 1, %g2 if(bit_mask > requested_bytes_per_block) break; } *dest_bytes_per_block = ((is_valid) ? requested_bytes_per_block : default_bytes_per_block); 400026d4: 82 10 20 80 mov 0x80, %g1 <== NOT EXECUTED break; } if(bit_mask > requested_bytes_per_block) break; } *dest_bytes_per_block = ((is_valid) 400026d8: 05 10 00 72 sethi %hi(0x4001c800), %g2 400026dc: c2 20 a0 98 st %g1, [ %g2 + 0x98 ] ! 4001c898 400026e0: b0 10 20 00 clr %i0 IMFS_MEMFILE_DEFAULT_BYTES_PER_BLOCK ); } return rv; } 400026e4: 81 c7 e0 08 ret 400026e8: 81 e8 00 00 restore =============================================================================== 400042c4 : const char *path, mode_t mode, const IMFS_node_control *node_control, void *context ) { 400042c4: 9d e3 bf 48 save %sp, -184, %sp int rv = 0; mode &= ~rtems_filesystem_umask; 400042c8: 03 10 00 63 sethi %hi(0x40018c00), %g1 400042cc: c2 00 62 98 ld [ %g1 + 0x298 ], %g1 ! 40018e98 switch (mode & S_IFMT) { 400042d0: 05 00 00 08 sethi %hi(0x2000), %g2 void *context ) { int rv = 0; mode &= ~rtems_filesystem_umask; 400042d4: c2 00 60 08 ld [ %g1 + 8 ], %g1 400042d8: b2 2e 40 01 andn %i1, %g1, %i1 switch (mode & S_IFMT) { 400042dc: 03 00 00 3c sethi %hi(0xf000), %g1 400042e0: 82 0e 40 01 and %i1, %g1, %g1 400042e4: 80 a0 40 02 cmp %g1, %g2 400042e8: 22 80 00 3a be,a 400043d0 400042ec: c2 06 80 00 ld [ %i2 ], %g1 400042f0: 38 80 00 04 bgu,a 40004300 <== ALWAYS TAKEN 400042f4: 05 00 00 18 sethi %hi(0x6000), %g2 400042f8: 10 80 00 05 b 4000430c <== NOT EXECUTED 400042fc: 05 00 00 04 sethi %hi(0x1000), %g2 <== NOT EXECUTED 40004300: 80 a0 40 02 cmp %g1, %g2 40004304: 02 80 00 32 be 400043cc 40004308: 05 00 00 20 sethi %hi(0x8000), %g2 4000430c: 80 a0 40 02 cmp %g1, %g2 40004310: 22 80 00 30 be,a 400043d0 <== NEVER TAKEN 40004314: c2 06 80 00 ld [ %i2 ], %g1 <== NOT EXECUTED 40004318: 30 80 00 27 b,a 400043b4 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 = 4000431c: 94 10 20 78 mov 0x78, %o2 40004320: 40 00 07 4e call 40006058 40004324: 90 07 bf c8 add %fp, -56, %o0 rtems_filesystem_eval_path_start( &ctx, path, eval_flags ); if ( IMFS_is_imfs_instance( currentloc ) ) { 40004328: 7f ff ff d5 call 4000427c 4000432c: ba 10 00 08 mov %o0, %i5 40004330: 80 8a 20 ff btst 0xff, %o0 40004334: 02 80 00 19 be 40004398 40004338: 90 07 bf c8 add %fp, -56, %o0 IMFS_types_union info; IMFS_jnode_t *new_node; info.generic.context = context; new_node = IMFS_create_node_with_control( 4000433c: d4 1f bf d0 ldd [ %fp + -48 ], %o2 if ( IMFS_is_imfs_instance( currentloc ) ) { IMFS_types_union info; IMFS_jnode_t *new_node; info.generic.context = context; 40004340: f6 27 bf b0 st %i3, [ %fp + -80 ] new_node = IMFS_create_node_with_control( 40004344: 90 10 00 1d mov %i5, %o0 40004348: 92 10 00 1a mov %i2, %o1 4000434c: 98 10 00 19 mov %i1, %o4 40004350: 9a 07 bf b0 add %fp, -80, %o5 40004354: 40 00 2c 05 call 4000f368 40004358: b0 10 3f ff mov -1, %i0 rtems_filesystem_eval_path_get_tokenlen( &ctx ), mode, &info ); if ( new_node != NULL ) { 4000435c: 80 a2 20 00 cmp %o0, 0 40004360: 02 80 00 11 be 400043a4 40004364: 92 10 20 00 clr %o1 IMFS_jnode_t *parent = currentloc->node_access; 40004368: fa 07 60 08 ld [ %i5 + 8 ], %i5 IMFS_update_ctime( parent ); 4000436c: 40 00 02 08 call 40004b8c 40004370: 90 07 bf a8 add %fp, -88, %o0 40004374: c2 07 bf a8 ld [ %fp + -88 ], %g1 IMFS_update_mtime( parent ); 40004378: 90 07 bf a8 add %fp, -88, %o0 ); if ( new_node != NULL ) { IMFS_jnode_t *parent = currentloc->node_access; IMFS_update_ctime( parent ); 4000437c: c2 27 60 48 st %g1, [ %i5 + 0x48 ] IMFS_update_mtime( parent ); 40004380: 40 00 02 03 call 40004b8c 40004384: 92 10 20 00 clr %o1 40004388: c2 07 bf a8 ld [ %fp + -88 ], %g1 4000438c: b0 10 20 00 clr %i0 40004390: 10 80 00 05 b 400043a4 40004394: c2 27 60 44 st %g1, [ %i5 + 0x44 ] } else { rv = -1; } } else { rtems_filesystem_eval_path_error( &ctx, ENOTSUP ); 40004398: 92 10 20 86 mov 0x86, %o1 4000439c: 40 00 06 99 call 40005e00 400043a0: b0 10 3f ff mov -1, %i0 rv = -1; } rtems_filesystem_eval_path_cleanup( &ctx ); 400043a4: 40 00 07 69 call 40006148 400043a8: 90 07 bf c8 add %fp, -56, %o0 400043ac: 81 c7 e0 08 ret 400043b0: 81 e8 00 00 restore } else { errno = EINVAL; 400043b4: 40 00 38 a4 call 40012644 <__errno> 400043b8: b0 10 3f ff mov -1, %i0 400043bc: 82 10 20 16 mov 0x16, %g1 400043c0: c2 22 00 00 st %g1, [ %o0 ] 400043c4: 81 c7 e0 08 ret 400043c8: 81 e8 00 00 restore rv = -1; break; } if ( rv == 0 ) { if ( node_control->imfs_type == IMFS_GENERIC ) { 400043cc: c2 06 80 00 ld [ %i2 ], %g1 400043d0: 80 a0 60 07 cmp %g1, 7 400043d4: 02 bf ff d2 be 4000431c 400043d8: 92 10 00 18 mov %i0, %o1 400043dc: 30 bf ff f6 b,a 400043b4 =============================================================================== 4000cce8 : */ MEMFILE_STATIC int IMFS_memfile_addblock( IMFS_jnode_t *the_jnode, unsigned int block ) { 4000cce8: 9d e3 bf a0 save %sp, -96, %sp IMFS_assert( IMFS_type( the_jnode ) == IMFS_MEMORY_FILE ); /* * Obtain the pointer for the specified block number */ block_entry_ptr = IMFS_memfile_get_block_pointer( the_jnode, block, 1 ); 4000ccec: 94 10 20 01 mov 1, %o2 4000ccf0: 90 10 00 18 mov %i0, %o0 4000ccf4: 7f ff fe d7 call 4000c850 4000ccf8: 92 10 00 19 mov %i1, %o1 if ( *block_entry_ptr ) 4000ccfc: c2 02 00 00 ld [ %o0 ], %g1 IMFS_assert( IMFS_type( the_jnode ) == IMFS_MEMORY_FILE ); /* * Obtain the pointer for the specified block number */ block_entry_ptr = IMFS_memfile_get_block_pointer( the_jnode, block, 1 ); 4000cd00: ba 10 00 08 mov %o0, %i5 if ( *block_entry_ptr ) 4000cd04: 80 a0 60 00 cmp %g1, 0 4000cd08: 12 80 00 08 bne 4000cd28 4000cd0c: b0 10 20 00 clr %i0 return 0; /* * There is no memory for this block number so allocate it. */ memory = memfile_alloc_block(); 4000cd10: 7f ff fe c3 call 4000c81c 4000cd14: 01 00 00 00 nop if ( !memory ) 4000cd18: 80 a2 20 00 cmp %o0, 0 4000cd1c: 22 80 00 03 be,a 4000cd28 <== NEVER TAKEN 4000cd20: b0 10 20 01 mov 1, %i0 <== NOT EXECUTED return 1; *block_entry_ptr = memory; 4000cd24: d0 27 40 00 st %o0, [ %i5 ] return 0; 4000cd28: 81 c7 e0 08 ret 4000cd2c: 81 e8 00 00 restore =============================================================================== 4000cefc : MEMFILE_STATIC int IMFS_memfile_extend( IMFS_jnode_t *the_jnode, bool zero_fill, off_t new_length ) { 4000cefc: 9d e3 bf 98 save %sp, -104, %sp IMFS_assert( IMFS_type( the_jnode ) == IMFS_MEMORY_FILE ); /* * Verify new file size is supported */ if ( new_length >= IMFS_MEMFILE_MAXIMUM_SIZE ) 4000cf00: 03 10 00 72 sethi %hi(0x4001c800), %g1 4000cf04: fa 00 60 98 ld [ %g1 + 0x98 ], %i5 ! 4001c898 4000cf08: b9 37 60 02 srl %i5, 2, %i4 4000cf0c: 92 10 00 1c mov %i4, %o1 4000cf10: 40 00 27 a4 call 40016da0 <.umul> 4000cf14: 90 07 20 01 add %i4, 1, %o0 4000cf18: 92 10 00 1c mov %i4, %o1 4000cf1c: 40 00 27 a1 call 40016da0 <.umul> 4000cf20: 90 02 20 01 inc %o0 4000cf24: 92 10 00 1d mov %i5, %o1 4000cf28: 40 00 27 9e call 40016da0 <.umul> 4000cf2c: 90 02 3f ff add %o0, -1, %o0 4000cf30: 82 10 20 00 clr %g1 4000cf34: 80 a0 40 1a cmp %g1, %i2 4000cf38: 34 80 00 0b bg,a 4000cf64 <== NEVER TAKEN 4000cf3c: f8 06 20 50 ld [ %i0 + 0x50 ], %i4 <== NOT EXECUTED 4000cf40: 80 a0 40 1a cmp %g1, %i2 4000cf44: 12 80 00 04 bne 4000cf54 <== NEVER TAKEN 4000cf48: 80 a2 00 1b cmp %o0, %i3 4000cf4c: 38 80 00 06 bgu,a 4000cf64 4000cf50: f8 06 20 50 ld [ %i0 + 0x50 ], %i4 rtems_set_errno_and_return_minus_one( EFBIG ); 4000cf54: 40 00 03 5e call 4000dccc <__errno> 4000cf58: 01 00 00 00 nop 4000cf5c: 10 80 00 3c b 4000d04c 4000cf60: 82 10 20 1b mov 0x1b, %g1 ! 1b /* * Verify new file size is actually larger than current size */ if ( new_length <= the_jnode->info.file.size ) 4000cf64: 80 a6 80 1c cmp %i2, %i4 4000cf68: 14 80 00 07 bg 4000cf84 <== NEVER TAKEN 4000cf6c: e0 06 20 54 ld [ %i0 + 0x54 ], %l0 4000cf70: 80 a6 80 1c cmp %i2, %i4 4000cf74: 12 80 00 48 bne 4000d094 <== NEVER TAKEN 4000cf78: 80 a6 c0 10 cmp %i3, %l0 4000cf7c: 08 80 00 46 bleu 4000d094 <== NEVER TAKEN 4000cf80: 01 00 00 00 nop return 0; /* * Calculate the number of range of blocks to allocate */ new_blocks = new_length / IMFS_MEMFILE_BYTES_PER_BLOCK; 4000cf84: a3 3f 60 1f sra %i5, 0x1f, %l1 4000cf88: 96 10 00 1d mov %i5, %o3 4000cf8c: 94 10 00 11 mov %l1, %o2 4000cf90: 90 10 00 1a mov %i2, %o0 4000cf94: 40 00 29 15 call 400173e8 <__divdi3> 4000cf98: 92 10 00 1b mov %i3, %o1 old_blocks = the_jnode->info.file.size / IMFS_MEMFILE_BYTES_PER_BLOCK; 4000cf9c: 94 10 00 11 mov %l1, %o2 4000cfa0: 90 10 00 1c mov %i4, %o0 4000cfa4: 96 10 00 1d mov %i5, %o3 return 0; /* * Calculate the number of range of blocks to allocate */ new_blocks = new_length / IMFS_MEMFILE_BYTES_PER_BLOCK; 4000cfa8: a4 10 00 09 mov %o1, %l2 old_blocks = the_jnode->info.file.size / IMFS_MEMFILE_BYTES_PER_BLOCK; 4000cfac: 40 00 29 0f call 400173e8 <__divdi3> 4000cfb0: 92 10 00 10 mov %l0, %o1 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++ ) { 4000cfb4: a2 10 20 00 clr %l1 /* * 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; 4000cfb8: 90 10 00 09 mov %o1, %o0 /* * 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; 4000cfbc: b8 10 00 09 mov %o1, %i4 * 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; 4000cfc0: 27 10 00 72 sethi %hi(0x4001c800), %l3 /* * 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; 4000cfc4: 40 00 27 77 call 40016da0 <.umul> 4000cfc8: 92 10 00 1d mov %i5, %o1 /* * Now allocate each of those blocks. */ for ( block=old_blocks ; block<=new_blocks ; block++ ) { 4000cfcc: 10 80 00 23 b 4000d058 4000cfd0: a0 24 00 08 sub %l0, %o0, %l0 if ( !IMFS_memfile_addblock( the_jnode, block ) ) { 4000cfd4: 7f ff ff 45 call 4000cce8 4000cfd8: 92 10 00 1d mov %i5, %o1 4000cfdc: 80 a2 20 00 cmp %o0, 0 4000cfe0: 12 80 00 15 bne 4000d034 <== NEVER TAKEN 4000cfe4: 80 a6 60 00 cmp %i1, 0 if ( zero_fill ) { 4000cfe8: 22 80 00 1c be,a 4000d058 4000cfec: a2 04 60 01 inc %l1 size_t count = IMFS_MEMFILE_BYTES_PER_BLOCK - offset; 4000cff0: e8 04 e0 98 ld [ %l3 + 0x98 ], %l4 block_p *block_ptr = 4000cff4: 92 10 00 1d mov %i5, %o1 4000cff8: 94 10 20 00 clr %o2 4000cffc: 7f ff fe 15 call 4000c850 4000d000: 90 10 00 18 mov %i0, %o0 IMFS_memfile_get_block_pointer( the_jnode, block, 0 ); memset( &(*block_ptr) [offset], 0, count); 4000d004: d0 02 00 00 ld [ %o0 ], %o0 * 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; 4000d008: a8 25 00 10 sub %l4, %l0, %l4 block_p *block_ptr = IMFS_memfile_get_block_pointer( the_jnode, block, 0 ); memset( &(*block_ptr) [offset], 0, count); 4000d00c: 90 02 00 10 add %o0, %l0, %o0 4000d010: 92 10 20 00 clr %o1 4000d014: 94 10 00 14 mov %l4, %o2 4000d018: 40 00 05 bb call 4000e704 4000d01c: a0 10 20 00 clr %l0 4000d020: 10 80 00 0e b 4000d058 4000d024: a2 04 60 01 inc %l1 offset = 0; } } else { for ( ; block>=old_blocks ; block-- ) { IMFS_memfile_remove_block( the_jnode, block ); 4000d028: 90 10 00 18 mov %i0, %o0 <== NOT EXECUTED 4000d02c: 7f ff ff a8 call 4000cecc <== NOT EXECUTED 4000d030: ba 07 7f ff add %i5, -1, %i5 <== NOT EXECUTED memset( &(*block_ptr) [offset], 0, count); offset = 0; } } else { for ( ; block>=old_blocks ; block-- ) { 4000d034: 80 a7 40 1c cmp %i5, %i4 <== NOT EXECUTED 4000d038: 1a bf ff fc bcc 4000d028 <== NOT EXECUTED 4000d03c: 92 10 00 1d mov %i5, %o1 <== NOT EXECUTED IMFS_memfile_remove_block( the_jnode, block ); } rtems_set_errno_and_return_minus_one( ENOSPC ); 4000d040: 40 00 03 23 call 4000dccc <__errno> <== NOT EXECUTED 4000d044: 01 00 00 00 nop <== NOT EXECUTED 4000d048: 82 10 20 1c mov 0x1c, %g1 ! 1c <== NOT EXECUTED 4000d04c: c2 22 00 00 st %g1, [ %o0 ] 4000d050: 81 c7 e0 08 ret 4000d054: 91 e8 3f ff restore %g0, -1, %o0 * * This routine insures that the in-memory file is of the length * specified. If necessary, it will allocate memory blocks to * extend the file. */ MEMFILE_STATIC int IMFS_memfile_extend( 4000d058: ba 04 40 1c add %l1, %i4, %i5 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++ ) { 4000d05c: 80 a7 40 12 cmp %i5, %l2 4000d060: 08 bf ff dd bleu 4000cfd4 4000d064: 90 10 00 18 mov %i0, %o0 /* * Set the new length of the file. */ the_jnode->info.file.size = new_length; IMFS_update_ctime(the_jnode); 4000d068: 92 10 20 00 clr %o1 } /* * Set the new length of the file. */ the_jnode->info.file.size = new_length; 4000d06c: f4 3e 20 50 std %i2, [ %i0 + 0x50 ] IMFS_update_ctime(the_jnode); 4000d070: 7f ff d8 01 call 40003074 4000d074: 90 07 bf f8 add %fp, -8, %o0 4000d078: c2 07 bf f8 ld [ %fp + -8 ], %g1 IMFS_update_mtime(the_jnode); 4000d07c: 90 07 bf f8 add %fp, -8, %o0 /* * Set the new length of the file. */ the_jnode->info.file.size = new_length; IMFS_update_ctime(the_jnode); 4000d080: c2 26 20 48 st %g1, [ %i0 + 0x48 ] IMFS_update_mtime(the_jnode); 4000d084: 7f ff d7 fc call 40003074 4000d088: 92 10 20 00 clr %o1 4000d08c: c2 07 bf f8 ld [ %fp + -8 ], %g1 4000d090: c2 26 20 44 st %g1, [ %i0 + 0x44 ] return 0; } 4000d094: 81 c7 e0 08 ret 4000d098: 91 e8 20 00 restore %g0, 0, %o0 =============================================================================== 4000c850 : #endif IMFS_jnode_t *the_jnode, unsigned int block, int malloc_it ) { 4000c850: 9d e3 bf a0 save %sp, -96, %sp my_block = block; /* * Is the block number in the simple indirect portion? */ if ( my_block <= LAST_INDIRECT ) { 4000c854: 03 10 00 72 sethi %hi(0x4001c800), %g1 4000c858: fa 00 60 98 ld [ %g1 + 0x98 ], %i5 ! 4001c898 4000c85c: bb 37 60 02 srl %i5, 2, %i5 4000c860: 82 07 7f ff add %i5, -1, %g1 4000c864: 80 a6 40 01 cmp %i1, %g1 4000c868: 18 80 00 18 bgu 4000c8c8 4000c86c: 90 07 60 01 add %i5, 1, %o0 p = info->indirect; if ( malloc_it ) { 4000c870: 80 a6 a0 00 cmp %i2, 0 4000c874: 02 80 00 10 be 4000c8b4 4000c878: c2 06 20 58 ld [ %i0 + 0x58 ], %g1 if ( !p ) { 4000c87c: 80 a0 60 00 cmp %g1, 0 4000c880: 32 80 00 0a bne,a 4000c8a8 4000c884: f0 06 20 58 ld [ %i0 + 0x58 ], %i0 p = memfile_alloc_block(); 4000c888: 7f ff ff e5 call 4000c81c 4000c88c: 01 00 00 00 nop if ( !p ) 4000c890: 80 a2 20 00 cmp %o0, 0 4000c894: 32 80 00 04 bne,a 4000c8a4 <== ALWAYS TAKEN 4000c898: d0 26 20 58 st %o0, [ %i0 + 0x58 ] return 0; 4000c89c: 81 c7 e0 08 ret <== NOT EXECUTED 4000c8a0: 91 e8 20 00 restore %g0, 0, %o0 <== NOT EXECUTED info->indirect = p; } return &info->indirect[ my_block ]; 4000c8a4: f0 06 20 58 ld [ %i0 + 0x58 ], %i0 4000c8a8: b3 2e 60 02 sll %i1, 2, %i1 4000c8ac: 81 c7 e0 08 ret 4000c8b0: 91 ee 00 19 restore %i0, %i1, %o0 } if ( !p ) 4000c8b4: 80 a0 60 00 cmp %g1, 0 4000c8b8: 02 bf ff f9 be 4000c89c <== NEVER TAKEN 4000c8bc: b3 2e 60 02 sll %i1, 2, %i1 return 0; return &info->indirect[ my_block ]; 4000c8c0: 81 c7 e0 08 ret 4000c8c4: 91 e8 40 19 restore %g1, %i1, %o0 /* * Is the block number in the doubly indirect portion? */ if ( my_block <= LAST_DOUBLY_INDIRECT ) { 4000c8c8: 40 00 29 36 call 40016da0 <.umul> 4000c8cc: 92 10 00 1d mov %i5, %o1 4000c8d0: 82 02 3f ff add %o0, -1, %g1 4000c8d4: 80 a6 40 01 cmp %i1, %g1 4000c8d8: 18 80 00 2c bgu 4000c988 4000c8dc: b8 10 00 08 mov %o0, %i4 my_block -= FIRST_DOUBLY_INDIRECT; 4000c8e0: b2 26 40 1d sub %i1, %i5, %i1 singly = my_block % IMFS_MEMFILE_BLOCK_SLOTS; 4000c8e4: 92 10 00 1d mov %i5, %o1 4000c8e8: 40 00 2a 14 call 40017138 <.urem> 4000c8ec: 90 10 00 19 mov %i1, %o0 doubly = my_block / IMFS_MEMFILE_BLOCK_SLOTS; 4000c8f0: 92 10 00 1d mov %i5, %o1 */ if ( my_block <= LAST_DOUBLY_INDIRECT ) { my_block -= FIRST_DOUBLY_INDIRECT; singly = my_block % IMFS_MEMFILE_BLOCK_SLOTS; 4000c8f4: b8 10 00 08 mov %o0, %i4 doubly = my_block / IMFS_MEMFILE_BLOCK_SLOTS; 4000c8f8: 40 00 29 64 call 40016e88 <.udiv> 4000c8fc: 90 10 00 19 mov %i1, %o0 p = info->doubly_indirect; if ( malloc_it ) { 4000c900: 80 a6 a0 00 cmp %i2, 0 if ( my_block <= LAST_DOUBLY_INDIRECT ) { my_block -= FIRST_DOUBLY_INDIRECT; singly = my_block % IMFS_MEMFILE_BLOCK_SLOTS; doubly = my_block / IMFS_MEMFILE_BLOCK_SLOTS; 4000c904: ba 10 00 08 mov %o0, %i5 p = info->doubly_indirect; if ( malloc_it ) { 4000c908: 02 80 00 17 be 4000c964 4000c90c: d0 06 20 5c ld [ %i0 + 0x5c ], %o0 if ( !p ) { 4000c910: 80 a2 20 00 cmp %o0, 0 4000c914: 12 80 00 08 bne 4000c934 4000c918: bb 2f 60 02 sll %i5, 2, %i5 p = memfile_alloc_block(); 4000c91c: 7f ff ff c0 call 4000c81c 4000c920: 01 00 00 00 nop if ( !p ) 4000c924: 80 a2 20 00 cmp %o0, 0 4000c928: 02 bf ff dd be 4000c89c <== NEVER TAKEN 4000c92c: 01 00 00 00 nop return 0; info->doubly_indirect = p; 4000c930: d0 26 20 5c st %o0, [ %i0 + 0x5c ] } p1 = (block_p *)p[ doubly ]; 4000c934: b6 02 00 1d add %o0, %i5, %i3 4000c938: d0 02 00 1d ld [ %o0 + %i5 ], %o0 if ( !p1 ) { 4000c93c: 80 a2 20 00 cmp %o0, 0 4000c940: 12 80 00 4a bne 4000ca68 4000c944: b1 2f 20 02 sll %i4, 2, %i0 p1 = memfile_alloc_block(); 4000c948: 7f ff ff b5 call 4000c81c 4000c94c: 01 00 00 00 nop if ( !p1 ) 4000c950: 80 a2 20 00 cmp %o0, 0 4000c954: 02 bf ff d2 be 4000c89c <== NEVER TAKEN 4000c958: 01 00 00 00 nop return 0; p[ doubly ] = (block_p) p1; 4000c95c: 10 80 00 43 b 4000ca68 4000c960: d0 26 c0 00 st %o0, [ %i3 ] } return (block_p *)&p1[ singly ]; } if ( !p ) 4000c964: 80 a2 20 00 cmp %o0, 0 4000c968: 02 bf ff cd be 4000c89c <== NEVER TAKEN 4000c96c: bb 2f 60 02 sll %i5, 2, %i5 return 0; p = (block_p *)p[ doubly ]; 4000c970: c2 02 00 1d ld [ %o0 + %i5 ], %g1 if ( !p ) 4000c974: 80 a0 60 00 cmp %g1, 0 4000c978: 02 bf ff c9 be 4000c89c <== NEVER TAKEN 4000c97c: 01 00 00 00 nop return 0; return (block_p *)&p[ singly ]; 4000c980: 10 80 00 48 b 4000caa0 4000c984: b1 2f 20 02 sll %i4, 2, %i0 } /* * Is the block number in the triply indirect portion? */ if ( my_block <= LAST_TRIPLY_INDIRECT ) { 4000c988: 90 02 20 01 inc %o0 4000c98c: 40 00 29 05 call 40016da0 <.umul> 4000c990: 92 10 00 1d mov %i5, %o1 4000c994: 90 02 3f ff add %o0, -1, %o0 4000c998: 80 a6 40 08 cmp %i1, %o0 4000c99c: 18 bf ff c0 bgu 4000c89c <== NEVER TAKEN 4000c9a0: b2 26 40 1c sub %i1, %i4, %i1 my_block -= FIRST_TRIPLY_INDIRECT; singly = my_block % IMFS_MEMFILE_BLOCK_SLOTS; 4000c9a4: 92 10 00 1d mov %i5, %o1 4000c9a8: 40 00 29 e4 call 40017138 <.urem> 4000c9ac: 90 10 00 19 mov %i1, %o0 doubly = my_block / IMFS_MEMFILE_BLOCK_SLOTS; 4000c9b0: 92 10 00 1d mov %i5, %o1 * 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; 4000c9b4: b6 10 00 08 mov %o0, %i3 doubly = my_block / IMFS_MEMFILE_BLOCK_SLOTS; 4000c9b8: 40 00 29 34 call 40016e88 <.udiv> 4000c9bc: 90 10 00 19 mov %i1, %o0 triply = doubly / IMFS_MEMFILE_BLOCK_SLOTS; 4000c9c0: 92 10 00 1d mov %i5, %o1 4000c9c4: 40 00 29 31 call 40016e88 <.udiv> 4000c9c8: b2 10 00 08 mov %o0, %i1 doubly %= IMFS_MEMFILE_BLOCK_SLOTS; 4000c9cc: 92 10 00 1d mov %i5, %o1 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; 4000c9d0: b8 10 00 08 mov %o0, %i4 doubly %= IMFS_MEMFILE_BLOCK_SLOTS; 4000c9d4: 40 00 29 d9 call 40017138 <.urem> 4000c9d8: 90 10 00 19 mov %i1, %o0 p = info->triply_indirect; if ( malloc_it ) { 4000c9dc: 80 a6 a0 00 cmp %i2, 0 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; doubly %= IMFS_MEMFILE_BLOCK_SLOTS; 4000c9e0: ba 10 00 08 mov %o0, %i5 p = info->triply_indirect; if ( malloc_it ) { 4000c9e4: 02 80 00 23 be 4000ca70 4000c9e8: d0 06 20 60 ld [ %i0 + 0x60 ], %o0 if ( !p ) { 4000c9ec: 80 a2 20 00 cmp %o0, 0 4000c9f0: 12 80 00 08 bne 4000ca10 4000c9f4: b9 2f 20 02 sll %i4, 2, %i4 p = memfile_alloc_block(); 4000c9f8: 7f ff ff 89 call 4000c81c 4000c9fc: 01 00 00 00 nop if ( !p ) 4000ca00: 80 a2 20 00 cmp %o0, 0 4000ca04: 02 bf ff a6 be 4000c89c <== NEVER TAKEN 4000ca08: 01 00 00 00 nop return 0; info->triply_indirect = p; 4000ca0c: d0 26 20 60 st %o0, [ %i0 + 0x60 ] } p1 = (block_p *) p[ triply ]; 4000ca10: b4 02 00 1c add %o0, %i4, %i2 4000ca14: d0 02 00 1c ld [ %o0 + %i4 ], %o0 if ( !p1 ) { 4000ca18: 80 a2 20 00 cmp %o0, 0 4000ca1c: 12 80 00 08 bne 4000ca3c 4000ca20: bb 2f 60 02 sll %i5, 2, %i5 p1 = memfile_alloc_block(); 4000ca24: 7f ff ff 7e call 4000c81c 4000ca28: 01 00 00 00 nop if ( !p1 ) 4000ca2c: 80 a2 20 00 cmp %o0, 0 4000ca30: 02 bf ff 9b be 4000c89c <== NEVER TAKEN 4000ca34: 01 00 00 00 nop return 0; p[ triply ] = (block_p) p1; 4000ca38: d0 26 80 00 st %o0, [ %i2 ] } p2 = (block_p *)p1[ doubly ]; 4000ca3c: b8 02 00 1d add %o0, %i5, %i4 4000ca40: d0 02 00 1d ld [ %o0 + %i5 ], %o0 if ( !p2 ) { 4000ca44: 80 a2 20 00 cmp %o0, 0 4000ca48: 12 80 00 08 bne 4000ca68 4000ca4c: b1 2e e0 02 sll %i3, 2, %i0 p2 = memfile_alloc_block(); 4000ca50: 7f ff ff 73 call 4000c81c 4000ca54: 01 00 00 00 nop if ( !p2 ) 4000ca58: 80 a2 20 00 cmp %o0, 0 4000ca5c: 02 bf ff 90 be 4000c89c <== NEVER TAKEN 4000ca60: 01 00 00 00 nop return 0; p1[ doubly ] = (block_p) p2; 4000ca64: d0 27 00 00 st %o0, [ %i4 ] } return (block_p *)&p2[ singly ]; 4000ca68: 81 c7 e0 08 ret 4000ca6c: 91 ea 00 18 restore %o0, %i0, %o0 } if ( !p ) 4000ca70: 80 a2 20 00 cmp %o0, 0 4000ca74: 02 bf ff 8a be 4000c89c <== NEVER TAKEN 4000ca78: b9 2f 20 02 sll %i4, 2, %i4 return 0; p1 = (block_p *) p[ triply ]; 4000ca7c: c2 02 00 1c ld [ %o0 + %i4 ], %g1 if ( !p1 ) 4000ca80: 80 a0 60 00 cmp %g1, 0 4000ca84: 02 bf ff 86 be 4000c89c <== NEVER TAKEN 4000ca88: bb 2f 60 02 sll %i5, 2, %i5 return 0; p2 = (block_p *)p1[ doubly ]; 4000ca8c: c2 00 40 1d ld [ %g1 + %i5 ], %g1 if ( !p2 ) 4000ca90: 80 a0 60 00 cmp %g1, 0 4000ca94: 02 bf ff 82 be 4000c89c <== NEVER TAKEN 4000ca98: 01 00 00 00 nop return 0; return (block_p *)&p2[ singly ]; 4000ca9c: b1 2e e0 02 sll %i3, 2, %i0 /* * This means the requested block number is out of range. */ return 0; } 4000caa0: 81 c7 e0 08 ret 4000caa4: 91 e8 40 18 restore %g1, %i0, %o0 =============================================================================== 4000caa8 : IMFS_jnode_t *the_jnode, off_t start, unsigned char *destination, unsigned int length ) { 4000caa8: 9d e3 bf 98 save %sp, -104, %sp rtems_chain_extract_unprotected( &node->Node ); } static inline IMFS_jnode_types_t IMFS_type( const IMFS_jnode_t *node ) { return node->control->imfs_type; 4000caac: c2 06 20 4c ld [ %i0 + 0x4c ], %g1 4000cab0: ba 10 00 18 mov %i0, %i5 * 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 ) { 4000cab4: c2 00 40 00 ld [ %g1 ], %g1 IMFS_jnode_t *the_jnode, off_t start, unsigned char *destination, unsigned int length ) { 4000cab8: a0 10 00 19 mov %i1, %l0 4000cabc: a2 10 00 1a mov %i2, %l1 * 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 ) { 4000cac0: 80 a0 60 05 cmp %g1, 5 4000cac4: 12 80 00 17 bne 4000cb20 4000cac8: a4 10 00 1b mov %i3, %l2 unsigned char *file_ptr; file_ptr = (unsigned char *)the_jnode->info.linearfile.direct; if (my_length > (the_jnode->info.linearfile.size - start)) 4000cacc: f4 1e 20 50 ldd [ %i0 + 0x50 ], %i2 4000cad0: 82 10 20 00 clr %g1 4000cad4: 86 a6 c0 11 subcc %i3, %l1, %g3 4000cad8: 84 66 80 19 subx %i2, %i1, %g2 4000cadc: 80 a0 40 02 cmp %g1, %g2 4000cae0: 14 80 00 07 bg 4000cafc <== NEVER TAKEN 4000cae4: d2 06 20 58 ld [ %i0 + 0x58 ], %o1 4000cae8: 80 a0 40 02 cmp %g1, %g2 4000caec: 12 80 00 06 bne 4000cb04 <== NEVER TAKEN 4000caf0: 80 a7 00 03 cmp %i4, %g3 4000caf4: 28 80 00 05 bleu,a 4000cb08 <== NEVER TAKEN 4000caf8: b0 10 00 1c mov %i4, %i0 <== NOT EXECUTED my_length = the_jnode->info.linearfile.size - start; 4000cafc: 10 80 00 03 b 4000cb08 4000cb00: b0 26 c0 11 sub %i3, %l1, %i0 /* * Linear files (as created from a tar file are easier to handle * than block files). */ my_length = length; 4000cb04: b0 10 00 1c mov %i4, %i0 <== 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); 4000cb08: 90 10 00 12 mov %l2, %o0 4000cb0c: 92 02 40 11 add %o1, %l1, %o1 4000cb10: 40 00 06 c0 call 4000e610 4000cb14: 94 10 00 18 mov %i0, %o2 return copied; memcpy( dest, &(*block_ptr)[ 0 ], my_length ); copied += my_length; } IMFS_update_atime( the_jnode ); 4000cb18: 10 80 00 5d b 4000cc8c 4000cb1c: 90 07 bf f8 add %fp, -8, %o0 /* * 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 ) 4000cb20: c6 06 20 50 ld [ %i0 + 0x50 ], %g3 4000cb24: 88 10 20 00 clr %g4 /* * 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; 4000cb28: 82 10 00 1a mov %i2, %g1 if ( last_byte > the_jnode->info.file.size ) 4000cb2c: c4 06 20 54 ld [ %i0 + 0x54 ], %g2 4000cb30: 80 a1 00 03 cmp %g4, %g3 4000cb34: 14 80 00 08 bg 4000cb54 <== NEVER TAKEN 4000cb38: b6 07 00 1a add %i4, %i2, %i3 4000cb3c: 80 a1 00 03 cmp %g4, %g3 4000cb40: 32 80 00 07 bne,a 4000cb5c <== NEVER TAKEN 4000cb44: 03 10 00 72 sethi %hi(0x4001c800), %g1 <== NOT EXECUTED 4000cb48: 80 a6 c0 02 cmp %i3, %g2 4000cb4c: 28 80 00 04 bleu,a 4000cb5c 4000cb50: 03 10 00 72 sethi %hi(0x4001c800), %g1 my_length = the_jnode->info.file.size - start; 4000cb54: b8 20 80 01 sub %g2, %g1, %i4 */ /* * Phase 1: possibly the last part of one block */ start_offset = start % IMFS_MEMFILE_BYTES_PER_BLOCK; 4000cb58: 03 10 00 72 sethi %hi(0x4001c800), %g1 4000cb5c: f6 00 60 98 ld [ %g1 + 0x98 ], %i3 ! 4001c898 4000cb60: 90 10 00 10 mov %l0, %o0 4000cb64: b5 3e e0 1f sra %i3, 0x1f, %i2 4000cb68: 96 10 00 1b mov %i3, %o3 4000cb6c: 94 10 00 1a mov %i2, %o2 4000cb70: 40 00 2b 09 call 40017794 <__moddi3> 4000cb74: 92 10 00 11 mov %l1, %o1 block = start / IMFS_MEMFILE_BYTES_PER_BLOCK; 4000cb78: 94 10 00 1a mov %i2, %o2 */ /* * Phase 1: possibly the last part of one block */ start_offset = start % IMFS_MEMFILE_BYTES_PER_BLOCK; 4000cb7c: a6 10 00 09 mov %o1, %l3 block = start / IMFS_MEMFILE_BYTES_PER_BLOCK; 4000cb80: 90 10 00 10 mov %l0, %o0 4000cb84: 92 10 00 11 mov %l1, %o1 4000cb88: 40 00 2a 18 call 400173e8 <__divdi3> 4000cb8c: 96 10 00 1b mov %i3, %o3 if ( start_offset ) { 4000cb90: 80 a4 e0 00 cmp %l3, 0 4000cb94: 02 80 00 18 be 4000cbf4 4000cb98: b4 10 00 09 mov %o1, %i2 to_copy = IMFS_MEMFILE_BYTES_PER_BLOCK - start_offset; 4000cb9c: b6 26 c0 13 sub %i3, %l3, %i3 4000cba0: 80 a7 00 1b cmp %i4, %i3 4000cba4: 08 80 00 03 bleu 4000cbb0 4000cba8: b2 10 00 1c mov %i4, %i1 4000cbac: b2 10 00 1b mov %i3, %i1 if ( to_copy > my_length ) to_copy = my_length; block_ptr = IMFS_memfile_get_block_pointer( the_jnode, block, 0 ); 4000cbb0: 90 10 00 1d mov %i5, %o0 4000cbb4: 92 10 00 1a mov %i2, %o1 4000cbb8: 94 10 20 00 clr %o2 4000cbbc: 7f ff ff 25 call 4000c850 4000cbc0: b0 10 20 00 clr %i0 if ( !block_ptr ) 4000cbc4: 80 a2 20 00 cmp %o0, 0 4000cbc8: 02 80 00 35 be 4000cc9c <== NEVER TAKEN 4000cbcc: 94 10 00 19 mov %i1, %o2 return copied; memcpy( dest, &(*block_ptr)[ start_offset ], to_copy ); 4000cbd0: d2 02 00 00 ld [ %o0 ], %o1 4000cbd4: 90 10 00 12 mov %l2, %o0 4000cbd8: 92 02 40 13 add %o1, %l3, %o1 4000cbdc: 40 00 06 8d call 4000e610 4000cbe0: a4 04 80 19 add %l2, %i1, %l2 dest += to_copy; block++; 4000cbe4: b4 06 a0 01 inc %i2 my_length -= to_copy; 4000cbe8: b8 27 00 19 sub %i4, %i1, %i4 copied += to_copy; 4000cbec: 10 80 00 03 b 4000cbf8 4000cbf0: b0 10 00 19 mov %i1, %i0 */ last_byte = start + length; if ( last_byte > the_jnode->info.file.size ) my_length = the_jnode->info.file.size - start; copied = 0; 4000cbf4: b0 10 20 00 clr %i0 } /* * Phase 2: all of zero of more blocks */ to_copy = IMFS_MEMFILE_BYTES_PER_BLOCK; 4000cbf8: 03 10 00 72 sethi %hi(0x4001c800), %g1 * is considered an error. Read from an offset for more bytes than * are between the offset and the end of the file will result in * reading the data between offset and the end of the file (truncated * read). */ MEMFILE_STATIC ssize_t IMFS_memfile_read( 4000cbfc: a4 24 80 18 sub %l2, %i0, %l2 } /* * Phase 2: all of zero of more blocks */ to_copy = IMFS_MEMFILE_BYTES_PER_BLOCK; 4000cc00: f6 00 60 98 ld [ %g1 + 0x98 ], %i3 while ( my_length >= IMFS_MEMFILE_BYTES_PER_BLOCK ) { 4000cc04: 10 80 00 0f b 4000cc40 4000cc08: a0 10 00 01 mov %g1, %l0 block_ptr = IMFS_memfile_get_block_pointer( the_jnode, block, 0 ); 4000cc0c: 90 10 00 1d mov %i5, %o0 4000cc10: 92 10 00 1a mov %i2, %o1 4000cc14: 7f ff ff 0f call 4000c850 4000cc18: 94 10 20 00 clr %o2 if ( !block_ptr ) 4000cc1c: 82 92 20 00 orcc %o0, 0, %g1 4000cc20: 02 80 00 1f be 4000cc9c <== NEVER TAKEN 4000cc24: 90 10 00 19 mov %i1, %o0 return copied; memcpy( dest, &(*block_ptr)[ 0 ], to_copy ); 4000cc28: d2 00 40 00 ld [ %g1 ], %o1 4000cc2c: 94 10 00 1b mov %i3, %o2 4000cc30: 40 00 06 78 call 4000e610 4000cc34: b4 06 a0 01 inc %i2 dest += to_copy; block++; my_length -= to_copy; 4000cc38: b8 27 00 1b sub %i4, %i3, %i4 copied += to_copy; 4000cc3c: b0 06 00 1b add %i0, %i3, %i0 /* * Phase 2: all of zero of more blocks */ to_copy = IMFS_MEMFILE_BYTES_PER_BLOCK; while ( my_length >= IMFS_MEMFILE_BYTES_PER_BLOCK ) { 4000cc40: c2 04 20 98 ld [ %l0 + 0x98 ], %g1 4000cc44: 80 a7 00 01 cmp %i4, %g1 4000cc48: 1a bf ff f1 bcc 4000cc0c 4000cc4c: b2 04 80 18 add %l2, %i0, %i1 /* * Phase 3: possibly the first part of one block */ IMFS_assert( my_length < IMFS_MEMFILE_BYTES_PER_BLOCK ); if ( my_length ) { 4000cc50: 80 a7 20 00 cmp %i4, 0 4000cc54: 02 80 00 0e be 4000cc8c 4000cc58: 90 07 bf f8 add %fp, -8, %o0 block_ptr = IMFS_memfile_get_block_pointer( the_jnode, block, 0 ); 4000cc5c: 90 10 00 1d mov %i5, %o0 4000cc60: 92 10 00 1a mov %i2, %o1 4000cc64: 7f ff fe fb call 4000c850 4000cc68: 94 10 20 00 clr %o2 if ( !block_ptr ) 4000cc6c: 82 92 20 00 orcc %o0, 0, %g1 4000cc70: 02 80 00 0b be 4000cc9c <== NEVER TAKEN 4000cc74: 90 10 00 19 mov %i1, %o0 return copied; memcpy( dest, &(*block_ptr)[ 0 ], my_length ); 4000cc78: d2 00 40 00 ld [ %g1 ], %o1 4000cc7c: 94 10 00 1c mov %i4, %o2 4000cc80: 40 00 06 64 call 4000e610 4000cc84: b0 07 00 18 add %i4, %i0, %i0 copied += my_length; } IMFS_update_atime( the_jnode ); 4000cc88: 90 07 bf f8 add %fp, -8, %o0 4000cc8c: 7f ff d8 fa call 40003074 4000cc90: 92 10 20 00 clr %o1 4000cc94: c2 07 bf f8 ld [ %fp + -8 ], %g1 4000cc98: c2 27 60 40 st %g1, [ %i5 + 0x40 ] return copied; } 4000cc9c: 81 c7 e0 08 ret 4000cca0: 81 e8 00 00 restore =============================================================================== 4000cda0 : * is better to stick to simple, easy to understand algorithms. */ IMFS_jnode_t *IMFS_memfile_remove( IMFS_jnode_t *the_jnode ) { 4000cda0: 9d e3 bf a0 save %sp, -96, %sp /* * 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; 4000cda4: 03 10 00 72 sethi %hi(0x4001c800), %g1 4000cda8: fa 00 60 98 ld [ %g1 + 0x98 ], %i5 ! 4001c898 * + doubly indirect * + triply indirect */ info = &the_jnode->info.file; if ( info->indirect ) { 4000cdac: c2 06 20 58 ld [ %i0 + 0x58 ], %g1 4000cdb0: 80 a0 60 00 cmp %g1, 0 4000cdb4: 02 80 00 05 be 4000cdc8 4000cdb8: bb 37 60 02 srl %i5, 2, %i5 memfile_free_blocks_in_table( &info->indirect, to_free ); 4000cdbc: 90 06 20 58 add %i0, 0x58, %o0 4000cdc0: 7f ff ff e5 call 4000cd54 4000cdc4: 92 10 00 1d mov %i5, %o1 } if ( info->doubly_indirect ) { 4000cdc8: c2 06 20 5c ld [ %i0 + 0x5c ], %g1 4000cdcc: b8 10 20 00 clr %i4 4000cdd0: 80 a0 60 00 cmp %g1, 0 4000cdd4: 12 80 00 0d bne 4000ce08 4000cdd8: 37 10 00 72 sethi %hi(0x4001c800), %i3 } memfile_free_blocks_in_table( &info->doubly_indirect, to_free ); } if ( info->triply_indirect ) { 4000cddc: 10 80 00 15 b 4000ce30 4000cde0: c2 06 20 60 ld [ %i0 + 0x60 ], %g1 * a significant difference in the performance of this routine. * * Regardless until the IMFS implementation is proven, it * is better to stick to simple, easy to understand algorithms. */ IMFS_jnode_t *IMFS_memfile_remove( 4000cde4: 83 2f 20 02 sll %i4, 2, %g1 memfile_free_blocks_in_table( &info->indirect, to_free ); } if ( info->doubly_indirect ) { for ( i=0 ; idoubly_indirect[i] ) { 4000cde8: 90 00 80 01 add %g2, %g1, %o0 4000cdec: c2 00 80 01 ld [ %g2 + %g1 ], %g1 4000cdf0: 80 a0 60 00 cmp %g1, 0 4000cdf4: 22 80 00 05 be,a 4000ce08 <== NEVER TAKEN 4000cdf8: b8 07 20 01 inc %i4 <== NOT EXECUTED memfile_free_blocks_in_table( 4000cdfc: 7f ff ff d6 call 4000cd54 4000ce00: 92 10 00 1d mov %i5, %o1 if ( info->indirect ) { memfile_free_blocks_in_table( &info->indirect, to_free ); } if ( info->doubly_indirect ) { for ( i=0 ; i 4000ce18: c4 06 20 5c ld [ %i0 + 0x5c ], %g2 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 ); 4000ce1c: 90 06 20 5c add %i0, 0x5c, %o0 4000ce20: 7f ff ff cd call 4000cd54 4000ce24: 92 10 00 1d mov %i5, %o1 } if ( info->triply_indirect ) { 4000ce28: c2 06 20 60 ld [ %i0 + 0x60 ], %g1 4000ce2c: b8 10 20 00 clr %i4 4000ce30: 80 a0 60 00 cmp %g1, 0 4000ce34: 12 80 00 1c bne 4000cea4 4000ce38: 33 10 00 72 sethi %hi(0x4001c800), %i1 4000ce3c: 81 c7 e0 08 ret 4000ce40: 81 e8 00 00 restore * a significant difference in the performance of this routine. * * Regardless until the IMFS implementation is proven, it * is better to stick to simple, easy to understand algorithms. */ IMFS_jnode_t *IMFS_memfile_remove( 4000ce44: a1 2f 20 02 sll %i4, 2, %l0 } if ( info->triply_indirect ) { for ( i=0 ; itriply_indirect[i]; 4000ce48: f6 00 40 10 ld [ %g1 + %l0 ], %i3 if ( !p ) /* ensure we have a valid pointer */ 4000ce4c: 80 a6 e0 00 cmp %i3, 0 4000ce50: 02 80 00 1b be 4000cebc <== NEVER TAKEN 4000ce54: 90 06 20 60 add %i0, 0x60, %o0 4000ce58: 10 80 00 09 b 4000ce7c 4000ce5c: b4 10 20 00 clr %i2 break; for ( j=0 ; j <== NEVER TAKEN 4000ce68: 90 10 00 1b mov %i3, %o0 memfile_free_blocks_in_table( (block_p **)&p[j], to_free); 4000ce6c: 7f ff ff ba call 4000cd54 4000ce70: 92 10 00 1d mov %i5, %o1 if ( info->triply_indirect ) { for ( i=0 ; itriply_indirect[i]; if ( !p ) /* ensure we have a valid pointer */ break; for ( j=0 ; j 4000ce8c: c2 06 c0 00 ld [ %i3 ], %g1 if ( p[j] ) { memfile_free_blocks_in_table( (block_p **)&p[j], to_free); } } memfile_free_blocks_in_table( 4000ce90: d0 06 20 60 ld [ %i0 + 0x60 ], %o0 4000ce94: 92 10 00 1d mov %i5, %o1 4000ce98: 90 02 00 10 add %o0, %l0, %o0 4000ce9c: 7f ff ff ae call 4000cd54 4000cea0: b8 07 20 01 inc %i4 memfile_free_blocks_in_table( &info->doubly_indirect, to_free ); } if ( info->triply_indirect ) { for ( i=0 ; i 4000ceb4: c2 06 20 60 ld [ %i0 + 0x60 ], %g1 } } memfile_free_blocks_in_table( (block_p **)&info->triply_indirect[i], to_free ); } memfile_free_blocks_in_table( 4000ceb8: 90 06 20 60 add %i0, 0x60, %o0 4000cebc: 7f ff ff a6 call 4000cd54 4000cec0: 92 10 00 1d mov %i5, %o1 (block_p **)&info->triply_indirect, to_free ); } return the_jnode; } 4000cec4: 81 c7 e0 08 ret 4000cec8: 81 e8 00 00 restore =============================================================================== 4000cecc : */ MEMFILE_STATIC int IMFS_memfile_remove_block( IMFS_jnode_t *the_jnode, unsigned int block ) { 4000cecc: 9d e3 bf a0 save %sp, -96, %sp <== NOT EXECUTED block_p *block_ptr; block_p ptr; block_ptr = IMFS_memfile_get_block_pointer( the_jnode, block, 0 ); 4000ced0: 94 10 20 00 clr %o2 <== NOT EXECUTED 4000ced4: 92 10 00 19 mov %i1, %o1 <== NOT EXECUTED 4000ced8: 7f ff fe 5e call 4000c850 <== NOT EXECUTED 4000cedc: 90 10 00 18 mov %i0, %o0 <== NOT EXECUTED 4000cee0: 82 10 00 08 mov %o0, %g1 <== NOT EXECUTED IMFS_assert( block_ptr ); ptr = *block_ptr; 4000cee4: d0 02 00 00 ld [ %o0 ], %o0 <== NOT EXECUTED *block_ptr = 0; memfile_free_block( ptr ); return 1; } 4000cee8: b0 10 20 01 mov 1, %i0 <== NOT EXECUTED block_ptr = IMFS_memfile_get_block_pointer( the_jnode, block, 0 ); IMFS_assert( block_ptr ); ptr = *block_ptr; *block_ptr = 0; memfile_free_block( ptr ); 4000ceec: 7f ff ff 91 call 4000cd30 <== NOT EXECUTED 4000cef0: c0 20 40 00 clr [ %g1 ] <== NOT EXECUTED return 1; } 4000cef4: 81 c7 e0 08 ret <== NOT EXECUTED 4000cef8: 81 e8 00 00 restore <== NOT EXECUTED =============================================================================== 4000d09c : IMFS_jnode_t *the_jnode, off_t start, const unsigned char *source, unsigned int length ) { 4000d09c: 9d e3 bf 98 save %sp, -104, %sp * 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 ) { 4000d0a0: c2 06 20 50 ld [ %i0 + 0x50 ], %g1 4000d0a4: 86 10 20 00 clr %g3 /* * 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; 4000d0a8: 96 07 00 1a add %i4, %i2, %o3 if ( last_byte > the_jnode->info.file.size ) { 4000d0ac: 80 a0 c0 01 cmp %g3, %g1 4000d0b0: 14 80 00 1b bg 4000d11c <== NEVER TAKEN 4000d0b4: c4 06 20 54 ld [ %i0 + 0x54 ], %g2 4000d0b8: 80 a0 c0 01 cmp %g3, %g1 4000d0bc: 32 80 00 06 bne,a 4000d0d4 <== NEVER TAKEN 4000d0c0: 03 10 00 72 sethi %hi(0x4001c800), %g1 <== NOT EXECUTED 4000d0c4: 80 a2 c0 02 cmp %o3, %g2 4000d0c8: 18 80 00 16 bgu 4000d120 4000d0cc: 80 a6 40 01 cmp %i1, %g1 */ /* * Phase 1: possibly the last part of one block */ start_offset = start % IMFS_MEMFILE_BYTES_PER_BLOCK; 4000d0d0: 03 10 00 72 sethi %hi(0x4001c800), %g1 4000d0d4: fa 00 60 98 ld [ %g1 + 0x98 ], %i5 ! 4001c898 4000d0d8: 92 10 00 1a mov %i2, %o1 4000d0dc: a3 3f 60 1f sra %i5, 0x1f, %l1 4000d0e0: 96 10 00 1d mov %i5, %o3 4000d0e4: 94 10 00 11 mov %l1, %o2 4000d0e8: 40 00 29 ab call 40017794 <__moddi3> 4000d0ec: 90 10 00 19 mov %i1, %o0 block = start / IMFS_MEMFILE_BYTES_PER_BLOCK; 4000d0f0: 90 10 00 19 mov %i1, %o0 */ /* * Phase 1: possibly the last part of one block */ start_offset = start % IMFS_MEMFILE_BYTES_PER_BLOCK; 4000d0f4: a0 10 00 09 mov %o1, %l0 block = start / IMFS_MEMFILE_BYTES_PER_BLOCK; 4000d0f8: 94 10 00 11 mov %l1, %o2 4000d0fc: 92 10 00 1a mov %i2, %o1 4000d100: 40 00 28 ba call 400173e8 <__divdi3> 4000d104: 96 10 00 1d mov %i5, %o3 if ( start_offset ) { 4000d108: 80 a4 20 00 cmp %l0, 0 4000d10c: 12 80 00 17 bne 4000d168 4000d110: b4 10 00 09 mov %o1, %i2 status = IMFS_memfile_extend( the_jnode, zero_fill, last_byte ); if ( status ) return status; } copied = 0; 4000d114: 10 80 00 28 b 4000d1b4 4000d118: ba 10 20 00 clr %i5 * in memory file, then extend the length. */ last_byte = start + my_length; if ( last_byte > the_jnode->info.file.size ) { bool zero_fill = start > the_jnode->info.file.size; 4000d11c: 80 a6 40 01 cmp %i1, %g1 <== NOT EXECUTED 4000d120: 14 80 00 09 bg 4000d144 <== NEVER TAKEN 4000d124: 92 10 20 01 mov 1, %o1 4000d128: 80 a6 40 01 cmp %i1, %g1 4000d12c: 32 80 00 06 bne,a 4000d144 <== NEVER TAKEN 4000d130: 92 10 20 00 clr %o1 <== NOT EXECUTED 4000d134: 80 a6 80 02 cmp %i2, %g2 4000d138: 18 80 00 04 bgu 4000d148 4000d13c: 90 10 00 18 mov %i0, %o0 4000d140: 92 10 20 00 clr %o1 status = IMFS_memfile_extend( the_jnode, zero_fill, last_byte ); 4000d144: 90 10 00 18 mov %i0, %o0 4000d148: 92 0a 60 01 and %o1, 1, %o1 4000d14c: 7f ff ff 6c call 4000cefc 4000d150: 94 10 20 00 clr %o2 if ( status ) 4000d154: 82 92 20 00 orcc %o0, 0, %g1 4000d158: 22 bf ff df be,a 4000d0d4 4000d15c: 03 10 00 72 sethi %hi(0x4001c800), %g1 } IMFS_mtime_ctime_update( the_jnode ); return copied; } 4000d160: 81 c7 e0 08 ret 4000d164: 91 e8 00 01 restore %g0, %g1, %o0 * 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; 4000d168: ba 27 40 10 sub %i5, %l0, %i5 4000d16c: 80 a7 40 1c cmp %i5, %i4 4000d170: 38 80 00 02 bgu,a 4000d178 4000d174: ba 10 00 1c mov %i4, %i5 if ( to_copy > my_length ) to_copy = my_length; block_ptr = IMFS_memfile_get_block_pointer( the_jnode, block, 0 ); 4000d178: 90 10 00 18 mov %i0, %o0 4000d17c: 92 10 00 1a mov %i2, %o1 4000d180: 7f ff fd b4 call 4000c850 4000d184: 94 10 20 00 clr %o2 if ( !block_ptr ) 4000d188: 80 a2 20 00 cmp %o0, 0 4000d18c: 02 80 00 36 be 4000d264 <== NEVER TAKEN 4000d190: 82 10 20 00 clr %g1 block, to_copy, src ); #endif memcpy( &(*block_ptr)[ start_offset ], src, to_copy ); 4000d194: d0 02 00 00 ld [ %o0 ], %o0 4000d198: 92 10 00 1b mov %i3, %o1 4000d19c: 90 02 00 10 add %o0, %l0, %o0 4000d1a0: 94 10 00 1d mov %i5, %o2 4000d1a4: 40 00 05 1b call 4000e610 4000d1a8: b6 06 c0 1d add %i3, %i5, %i3 src += to_copy; block++; 4000d1ac: b4 06 a0 01 inc %i2 my_length -= to_copy; 4000d1b0: b8 27 00 1d sub %i4, %i5, %i4 /* * Phase 2: all of zero of more blocks */ to_copy = IMFS_MEMFILE_BYTES_PER_BLOCK; 4000d1b4: 03 10 00 72 sethi %hi(0x4001c800), %g1 * 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( 4000d1b8: b6 26 c0 1d sub %i3, %i5, %i3 /* * Phase 2: all of zero of more blocks */ to_copy = IMFS_MEMFILE_BYTES_PER_BLOCK; 4000d1bc: f2 00 60 98 ld [ %g1 + 0x98 ], %i1 while ( my_length >= IMFS_MEMFILE_BYTES_PER_BLOCK ) { 4000d1c0: 10 80 00 0f b 4000d1fc 4000d1c4: a2 10 00 01 mov %g1, %l1 block_ptr = IMFS_memfile_get_block_pointer( the_jnode, block, 0 ); 4000d1c8: 90 10 00 18 mov %i0, %o0 4000d1cc: 92 10 00 1a mov %i2, %o1 4000d1d0: 7f ff fd a0 call 4000c850 4000d1d4: 94 10 20 00 clr %o2 if ( !block_ptr ) 4000d1d8: 80 a2 20 00 cmp %o0, 0 4000d1dc: 02 80 00 21 be 4000d260 <== NEVER TAKEN 4000d1e0: 94 10 00 19 mov %i1, %o2 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 ); 4000d1e4: d0 02 00 00 ld [ %o0 ], %o0 4000d1e8: 92 10 00 10 mov %l0, %o1 4000d1ec: 40 00 05 09 call 4000e610 4000d1f0: b4 06 a0 01 inc %i2 src += to_copy; block++; my_length -= to_copy; 4000d1f4: b8 27 00 19 sub %i4, %i1, %i4 * 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( 4000d1f8: ba 07 40 19 add %i5, %i1, %i5 /* * Phase 2: all of zero of more blocks */ to_copy = IMFS_MEMFILE_BYTES_PER_BLOCK; while ( my_length >= IMFS_MEMFILE_BYTES_PER_BLOCK ) { 4000d1fc: c2 04 60 98 ld [ %l1 + 0x98 ], %g1 4000d200: 80 a7 00 01 cmp %i4, %g1 4000d204: 1a bf ff f1 bcc 4000d1c8 4000d208: a0 06 c0 1d add %i3, %i5, %l0 * 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 ) { 4000d20c: 80 a7 20 00 cmp %i4, 0 4000d210: 02 80 00 0f be 4000d24c 4000d214: 90 07 bf f8 add %fp, -8, %o0 block_ptr = IMFS_memfile_get_block_pointer( the_jnode, block, 0 ); 4000d218: 90 10 00 18 mov %i0, %o0 4000d21c: 92 10 00 1a mov %i2, %o1 4000d220: 7f ff fd 8c call 4000c850 4000d224: 94 10 20 00 clr %o2 if ( !block_ptr ) 4000d228: 80 a2 20 00 cmp %o0, 0 4000d22c: 02 80 00 0e be 4000d264 <== NEVER TAKEN 4000d230: 82 10 00 1d mov %i5, %g1 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 ); 4000d234: d0 02 00 00 ld [ %o0 ], %o0 4000d238: 92 10 00 10 mov %l0, %o1 4000d23c: 94 10 00 1c mov %i4, %o2 4000d240: 40 00 04 f4 call 4000e610 4000d244: ba 07 40 1c add %i5, %i4, %i5 my_length = 0; copied += to_copy; } IMFS_mtime_ctime_update( the_jnode ); 4000d248: 90 07 bf f8 add %fp, -8, %o0 4000d24c: 7f ff d7 8a call 40003074 4000d250: 92 10 20 00 clr %o1 4000d254: c2 07 bf f8 ld [ %fp + -8 ], %g1 4000d258: c2 26 20 44 st %g1, [ %i0 + 0x44 ] 4000d25c: c2 26 20 48 st %g1, [ %i0 + 0x48 ] */ 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 ) 4000d260: 82 10 00 1d mov %i5, %g1 } IMFS_mtime_ctime_update( the_jnode ); return copied; } 4000d264: b0 10 00 01 mov %g1, %i0 4000d268: 81 c7 e0 08 ret 4000d26c: 81 e8 00 00 restore =============================================================================== 400027ec : const char *name, size_t namelen, mode_t mode, dev_t dev ) { 400027ec: 9d e3 bf 80 save %sp, -128, %sp dev_t dev, IMFS_jnode_types_t *type, IMFS_types_union *info ) { if ( S_ISDIR( mode ) ) { 400027f0: 05 00 00 3c sethi %hi(0xf000), %g2 400027f4: 07 00 00 10 sethi %hi(0x4000), %g3 400027f8: 84 0e c0 02 and %i3, %g2, %g2 400027fc: 80 a0 80 03 cmp %g2, %g3 40002800: 02 80 00 12 be 40002848 40002804: 07 00 00 20 sethi %hi(0x8000), %g3 *type = IMFS_DIRECTORY; } else if ( S_ISREG( mode ) ) { 40002808: 80 a0 80 03 cmp %g2, %g3 4000280c: 02 80 00 11 be 40002850 40002810: 09 00 00 2c sethi %hi(0xb000), %g4 *type = IMFS_MEMORY_FILE; } else if ( S_ISBLK( mode ) || S_ISCHR( mode ) ) { 40002814: 07 00 00 08 sethi %hi(0x2000), %g3 40002818: 88 0e c0 04 and %i3, %g4, %g4 4000281c: 80 a1 00 03 cmp %g4, %g3 40002820: 12 80 00 05 bne 40002834 40002824: 07 00 00 04 sethi %hi(0x1000), %g3 *type = IMFS_DEVICE; rtems_filesystem_split_dev_t( 40002828: f8 3f bf e8 std %i4, [ %fp + -24 ] 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; 4000282c: 10 80 00 0a b 40002854 40002830: 82 10 20 01 mov 1, %g1 rtems_filesystem_split_dev_t( dev, info->device.major, info->device.minor ); } else if (S_ISFIFO( mode )) { 40002834: 80 a0 80 03 cmp %g2, %g3 40002838: 32 80 00 08 bne,a 40002858 <== NEVER TAKEN 4000283c: c4 06 20 14 ld [ %i0 + 0x14 ], %g2 <== NOT EXECUTED *type = IMFS_FIFO; 40002840: 10 80 00 05 b 40002854 40002844: 82 10 20 06 mov 6, %g1 IMFS_jnode_types_t *type, IMFS_types_union *info ) { if ( S_ISDIR( mode ) ) { *type = IMFS_DIRECTORY; 40002848: 10 80 00 03 b 40002854 4000284c: 82 10 20 00 clr %g1 40002850: 82 10 20 04 mov 4, %g1 size_t namelen, mode_t mode, const IMFS_types_union *info ) { const IMFS_fs_info_t *fs_info = 40002854: c4 06 20 14 ld [ %i0 + 0x14 ], %g2 (const IMFS_fs_info_t *) parentloc->mt_entry->fs_info; return IMFS_create_node_with_control( 40002858: 82 00 60 02 add %g1, 2, %g1 4000285c: c4 00 a0 08 ld [ %g2 + 8 ], %g2 40002860: 83 28 60 02 sll %g1, 2, %g1 40002864: d2 00 80 01 ld [ %g2 + %g1 ], %o1 40002868: 90 10 00 18 mov %i0, %o0 4000286c: 94 10 00 19 mov %i1, %o2 40002870: 96 10 00 1a mov %i2, %o3 40002874: 98 10 00 1b mov %i3, %o4 40002878: 40 00 20 ff call 4000ac74 4000287c: 9a 07 bf e8 add %fp, -24, %o5 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 ) { 40002880: 80 a2 20 00 cmp %o0, 0 40002884: 02 80 00 0e be 400028bc 40002888: 90 07 bf e0 add %fp, -32, %o0 IMFS_jnode_t *parent = parentloc->node_access; 4000288c: fa 06 20 08 ld [ %i0 + 8 ], %i5 IMFS_update_ctime( parent ); 40002890: 40 00 01 f9 call 40003074 40002894: 92 10 20 00 clr %o1 40002898: c2 07 bf e0 ld [ %fp + -32 ], %g1 IMFS_update_mtime( parent ); 4000289c: 90 07 bf e0 add %fp, -32, %o0 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 ); 400028a0: c2 27 60 48 st %g1, [ %i5 + 0x48 ] IMFS_update_mtime( parent ); 400028a4: 40 00 01 f4 call 40003074 400028a8: 92 10 20 00 clr %o1 400028ac: c2 07 bf e0 ld [ %fp + -32 ], %g1 400028b0: c2 27 60 44 st %g1, [ %i5 + 0x44 ] size_t namelen, mode_t mode, dev_t dev ) { int rv = 0; 400028b4: 81 c7 e0 08 ret 400028b8: 91 e8 20 00 restore %g0, 0, %o0 } else { rv = -1; } return rv; } 400028bc: 81 c7 e0 08 ret 400028c0: 91 e8 3f ff restore %g0, -1, %o0 =============================================================================== 400028c4 : #endif #include "imfs.h" int IMFS_mount( rtems_filesystem_mount_table_entry_t *mt_entry ) { 400028c4: 9d e3 bf a0 save %sp, -96, %sp int rv = 0; IMFS_jnode_t *node = mt_entry->mt_point_node->location.node_access; 400028c8: c2 06 20 20 ld [ %i0 + 0x20 ], %g1 400028cc: c2 00 60 08 ld [ %g1 + 8 ], %g1 return node->control->imfs_type; } static inline bool IMFS_is_directory( const IMFS_jnode_t *node ) { return node->control->imfs_type == IMFS_DIRECTORY; 400028d0: c4 00 60 4c ld [ %g1 + 0x4c ], %g2 if ( IMFS_is_directory( node ) ) { 400028d4: c4 00 80 00 ld [ %g2 ], %g2 400028d8: 80 a0 a0 00 cmp %g2, 0 400028dc: 12 80 00 0d bne 40002910 400028e0: 01 00 00 00 nop if ( node->info.directory.mt_fs == NULL ) { 400028e4: c4 00 60 5c ld [ %g1 + 0x5c ], %g2 400028e8: 80 a0 a0 00 cmp %g2, 0 400028ec: 12 80 00 05 bne 40002900 <== NEVER TAKEN 400028f0: 01 00 00 00 nop node->info.directory.mt_fs = mt_entry; 400028f4: f0 20 60 5c st %i0, [ %g1 + 0x5c ] #include "imfs.h" int IMFS_mount( rtems_filesystem_mount_table_entry_t *mt_entry ) { int rv = 0; 400028f8: 81 c7 e0 08 ret 400028fc: 91 e8 20 00 restore %g0, 0, %o0 if ( IMFS_is_directory( node ) ) { if ( node->info.directory.mt_fs == NULL ) { node->info.directory.mt_fs = mt_entry; } else { errno = EBUSY; 40002900: 40 00 2c f3 call 4000dccc <__errno> <== NOT EXECUTED 40002904: 01 00 00 00 nop <== NOT EXECUTED 40002908: 10 80 00 05 b 4000291c <== NOT EXECUTED 4000290c: 82 10 20 10 mov 0x10, %g1 ! 10 <== NOT EXECUTED rv = -1; } } else { errno = ENOTDIR; 40002910: 40 00 2c ef call 4000dccc <__errno> 40002914: 01 00 00 00 nop 40002918: 82 10 20 14 mov 0x14, %g1 ! 14 4000291c: c2 22 00 00 st %g1, [ %o0 ] rv = -1; } return rv; } 40002920: 81 c7 e0 08 ret 40002924: 91 e8 3f ff restore %g0, -1, %o0 =============================================================================== 4000b088 : } static IMFS_jnode_t *IMFS_node_remove_directory( IMFS_jnode_t *node ) { 4000b088: 9d e3 bf a0 save %sp, -96, %sp if ( !rtems_chain_is_empty( &node->info.directory.Entries ) ) { 4000b08c: c4 06 20 50 ld [ %i0 + 0x50 ], %g2 RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( const Chain_Control *the_chain ) { return _Chain_Immutable_first( the_chain ) == _Chain_Immutable_tail( the_chain ); 4000b090: 82 06 20 54 add %i0, 0x54, %g1 4000b094: 80 a0 80 01 cmp %g2, %g1 4000b098: 22 80 00 06 be,a 4000b0b0 4000b09c: c2 06 20 5c ld [ %i0 + 0x5c ], %g1 errno = ENOTEMPTY; 4000b0a0: 40 00 0b 0b call 4000dccc <__errno> 4000b0a4: 01 00 00 00 nop 4000b0a8: 10 80 00 08 b 4000b0c8 4000b0ac: 82 10 20 5a mov 0x5a, %g1 ! 5a node = NULL; } else if ( IMFS_is_mount_point( node ) ) { 4000b0b0: 80 a0 60 00 cmp %g1, 0 4000b0b4: 02 80 00 07 be 4000b0d0 <== ALWAYS TAKEN 4000b0b8: 01 00 00 00 nop errno = EBUSY; 4000b0bc: 40 00 0b 04 call 4000dccc <__errno> <== NOT EXECUTED 4000b0c0: 01 00 00 00 nop <== NOT EXECUTED 4000b0c4: 82 10 20 10 mov 0x10, %g1 ! 10 <== NOT EXECUTED 4000b0c8: c2 22 00 00 st %g1, [ %o0 ] 4000b0cc: b0 10 20 00 clr %i0 node = NULL; } return node; } 4000b0d0: 81 c7 e0 08 ret 4000b0d4: 81 e8 00 00 restore =============================================================================== 40002928 : rtems_filesystem_node_types_t IMFS_node_type( const rtems_filesystem_location_info_t *loc ) { const IMFS_jnode_t *node = loc->node_access; 40002928: c4 02 20 08 ld [ %o0 + 8 ], %g2 rtems_chain_extract_unprotected( &node->Node ); } static inline IMFS_jnode_types_t IMFS_type( const IMFS_jnode_t *node ) { return node->control->imfs_type; 4000292c: c2 00 a0 4c ld [ %g2 + 0x4c ], %g1 40002930: c2 00 40 00 ld [ %g1 ], %g1 IMFS_jnode_types_t imfs_type = IMFS_type( node ); rtems_filesystem_node_types_t type; switch ( imfs_type ) { 40002934: 80 a0 60 02 cmp %g1, 2 40002938: 02 80 00 06 be 40002950 4000293c: 80 a0 60 05 cmp %g1, 5 40002940: 12 80 00 08 bne 40002960 <== ALWAYS TAKEN 40002944: 90 10 20 04 mov 4, %o0 40002948: 81 c3 e0 08 retl <== NOT EXECUTED 4000294c: 01 00 00 00 nop <== NOT EXECUTED 40002950: c2 00 a0 50 ld [ %g2 + 0x50 ], %g1 40002954: c2 00 60 4c ld [ %g1 + 0x4c ], %g1 case IMFS_HARD_LINK: type = IMFS_type( node->info.hard_link.link_node ); break; 40002958: 81 c3 e0 08 retl 4000295c: d0 00 40 00 ld [ %g1 ], %o0 type = imfs_type; break; } return type; } 40002960: 81 c3 e0 08 retl 40002964: 90 10 00 01 mov %g1, %o0 =============================================================================== 400029a4 : const rtems_filesystem_location_info_t *oldloc, const rtems_filesystem_location_info_t *newparentloc, const char *name, size_t namelen ) { 400029a4: 9d e3 bf 98 save %sp, -104, %sp int rv = 0; IMFS_jnode_t *node = oldloc->node_access; 400029a8: fa 06 60 08 ld [ %i1 + 8 ], %i5 /* * FIXME: Due to insufficient checks we can create inaccessible nodes with * this operation. */ if ( node->Parent != NULL ) { 400029ac: c2 07 60 08 ld [ %i5 + 8 ], %g1 400029b0: 80 a0 60 00 cmp %g1, 0 400029b4: 02 80 00 20 be 40002a34 <== NEVER TAKEN 400029b8: f4 06 a0 08 ld [ %i2 + 8 ], %i2 if ( namelen < IMFS_NAME_MAX ) { 400029bc: 80 a7 20 1f cmp %i4, 0x1f 400029c0: 18 80 00 19 bgu 40002a24 <== NEVER TAKEN 400029c4: 94 10 00 1c mov %i4, %o2 memcpy( node->name, name, namelen ); 400029c8: 92 10 00 1b mov %i3, %o1 400029cc: 40 00 2f 11 call 4000e610 400029d0: 90 07 60 0c add %i5, 0xc, %o0 node->name [namelen] = '\0'; 400029d4: b8 07 40 1c add %i5, %i4, %i4 400029d8: c0 2f 20 0c clrb [ %i4 + 0xc ] ) { Chain_Node *next; Chain_Node *previous; next = the_node->next; 400029dc: c4 07 40 00 ld [ %i5 ], %g2 previous = the_node->previous; 400029e0: c2 07 60 04 ld [ %i5 + 4 ], %g1 IMFS_remove_from_directory( node ); IMFS_add_to_directory( new_parent, node ); IMFS_update_ctime( node ); 400029e4: 90 07 bf f8 add %fp, -8, %o0 next->previous = previous; 400029e8: c2 20 a0 04 st %g1, [ %g2 + 4 ] previous->next = next; 400029ec: c4 20 40 00 st %g2, [ %g1 ] static inline void IMFS_add_to_directory( IMFS_jnode_t *dir, IMFS_jnode_t *node ) { node->Parent = dir; 400029f0: f4 27 60 08 st %i2, [ %i5 + 8 ] Chain_Control *the_chain, Chain_Node *the_node ) { Chain_Node *tail = _Chain_Tail( the_chain ); Chain_Node *old_last = tail->previous; 400029f4: c2 06 a0 58 ld [ %i2 + 0x58 ], %g1 RTEMS_INLINE_ROUTINE void _Chain_Append_unprotected( Chain_Control *the_chain, Chain_Node *the_node ) { Chain_Node *tail = _Chain_Tail( the_chain ); 400029f8: 84 06 a0 54 add %i2, 0x54, %g2 Chain_Node *old_last = tail->previous; the_node->next = tail; tail->previous = the_node; 400029fc: fa 26 a0 58 st %i5, [ %i2 + 0x58 ] ) { Chain_Node *tail = _Chain_Tail( the_chain ); Chain_Node *old_last = tail->previous; the_node->next = tail; 40002a00: c4 27 40 00 st %g2, [ %i5 ] tail->previous = the_node; old_last->next = the_node; 40002a04: fa 20 40 00 st %i5, [ %g1 ] the_node->previous = old_last; 40002a08: c2 27 60 04 st %g1, [ %i5 + 4 ] 40002a0c: 40 00 01 9a call 40003074 40002a10: 92 10 20 00 clr %o1 40002a14: c2 07 bf f8 ld [ %fp + -8 ], %g1 40002a18: c2 27 60 48 st %g1, [ %i5 + 0x48 ] const rtems_filesystem_location_info_t *newparentloc, const char *name, size_t namelen ) { int rv = 0; 40002a1c: 81 c7 e0 08 ret 40002a20: 91 e8 20 00 restore %g0, 0, %o0 IMFS_remove_from_directory( node ); IMFS_add_to_directory( new_parent, node ); IMFS_update_ctime( node ); } else { errno = ENAMETOOLONG; 40002a24: 40 00 2c aa call 4000dccc <__errno> <== NOT EXECUTED 40002a28: 01 00 00 00 nop <== NOT EXECUTED 40002a2c: 10 80 00 05 b 40002a40 <== NOT EXECUTED 40002a30: 82 10 20 5b mov 0x5b, %g1 ! 5b <== NOT EXECUTED rv = -1; } } else { errno = EINVAL; 40002a34: 40 00 2c a6 call 4000dccc <__errno> <== NOT EXECUTED 40002a38: 01 00 00 00 nop <== NOT EXECUTED 40002a3c: 82 10 20 16 mov 0x16, %g1 ! 16 <== NOT EXECUTED 40002a40: c2 22 00 00 st %g1, [ %o0 ] <== NOT EXECUTED rv = -1; } return rv; } 40002a44: 81 c7 e0 08 ret <== NOT EXECUTED 40002a48: 91 e8 3f ff restore %g0, -1, %o0 <== NOT EXECUTED =============================================================================== 40002b24 : #endif #include "imfs.h" int IMFS_unmount( rtems_filesystem_mount_table_entry_t *mt_entry ) { 40002b24: 9d e3 bf a0 save %sp, -96, %sp int rv = 0; IMFS_jnode_t *node = mt_entry->mt_point_node->location.node_access; 40002b28: c2 06 20 20 ld [ %i0 + 0x20 ], %g1 40002b2c: c2 00 60 08 ld [ %g1 + 8 ], %g1 return node->control->imfs_type; } static inline bool IMFS_is_directory( const IMFS_jnode_t *node ) { return node->control->imfs_type == IMFS_DIRECTORY; 40002b30: c4 00 60 4c ld [ %g1 + 0x4c ], %g2 if ( IMFS_is_directory( node ) ) { 40002b34: c4 00 80 00 ld [ %g2 ], %g2 40002b38: 80 a0 a0 00 cmp %g2, 0 40002b3c: 12 80 00 0d bne 40002b70 <== NEVER TAKEN 40002b40: 01 00 00 00 nop if ( node->info.directory.mt_fs == mt_entry ) { 40002b44: c4 00 60 5c ld [ %g1 + 0x5c ], %g2 40002b48: 80 a0 80 18 cmp %g2, %i0 40002b4c: 12 80 00 05 bne 40002b60 <== NEVER TAKEN 40002b50: 01 00 00 00 nop node->info.directory.mt_fs = NULL; 40002b54: c0 20 60 5c clr [ %g1 + 0x5c ] #include "imfs.h" int IMFS_unmount( rtems_filesystem_mount_table_entry_t *mt_entry ) { int rv = 0; 40002b58: 81 c7 e0 08 ret 40002b5c: 91 e8 20 00 restore %g0, 0, %o0 if ( IMFS_is_directory( node ) ) { if ( node->info.directory.mt_fs == mt_entry ) { node->info.directory.mt_fs = NULL; } else { errno = EINVAL; 40002b60: 40 00 2c 5b call 4000dccc <__errno> <== NOT EXECUTED 40002b64: 01 00 00 00 nop <== NOT EXECUTED 40002b68: 10 80 00 05 b 40002b7c <== NOT EXECUTED 40002b6c: 82 10 20 16 mov 0x16, %g1 ! 16 <== NOT EXECUTED rv = -1; } } else { errno = ENOTDIR; 40002b70: 40 00 2c 57 call 4000dccc <__errno> <== NOT EXECUTED 40002b74: 01 00 00 00 nop <== NOT EXECUTED 40002b78: 82 10 20 14 mov 0x14, %g1 ! 14 <== NOT EXECUTED 40002b7c: c2 22 00 00 st %g1, [ %o0 ] <== NOT EXECUTED rv = -1; } return rv; } 40002b80: 81 c7 e0 08 ret <== NOT EXECUTED 40002b84: 91 e8 3f ff restore %g0, -1, %o0 <== NOT EXECUTED =============================================================================== 40003260 : void RTEMS_Malloc_Initialize( const Heap_Area *areas, size_t area_count, Heap_Initialization_or_extend_handler extend ) { 40003260: 9d e3 bf a0 save %sp, -96, %sp Heap_Control *heap = RTEMS_Malloc_Heap; 40003264: 03 10 00 70 sethi %hi(0x4001c000), %g1 40003268: f6 00 61 e0 ld [ %g1 + 0x1e0 ], %i3 ! 4001c1e0 if ( !rtems_configuration_get_unified_work_area() ) { 4000326c: 03 10 00 69 sethi %hi(0x4001a400), %g1 40003270: c2 08 60 89 ldub [ %g1 + 0x89 ], %g1 ! 4001a489 40003274: 80 a0 60 00 cmp %g1, 0 40003278: 12 80 00 1b bne 400032e4 4000327c: 03 10 00 72 sethi %hi(0x4001c800), %g1 40003280: 3b 10 00 20 sethi %hi(0x40008000), %i5 40003284: b8 10 20 00 clr %i4 40003288: 10 80 00 0b b 400032b4 4000328c: ba 17 60 ec or %i5, 0xec, %i5 uintptr_t page_size = CPU_HEAP_ALIGNMENT; size_t i; for (i = 0; i < area_count; ++i) { const Heap_Area *area = &areas [i]; uintptr_t space_available = (*init_or_extend)( 40003290: d4 06 20 04 ld [ %i0 + 4 ], %o2 40003294: 90 10 00 1b mov %i3, %o0 40003298: 9f c7 40 00 call %i5 4000329c: 96 10 20 08 mov 8, %o3 area->begin, area->size, page_size ); if ( space_available > 0 ) { 400032a0: 80 a2 20 00 cmp %o0, 0 400032a4: 32 80 00 02 bne,a 400032ac <== ALWAYS TAKEN 400032a8: ba 10 00 1a mov %i2, %i5 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) { 400032ac: b8 07 20 01 inc %i4 400032b0: b0 06 20 08 add %i0, 8, %i0 400032b4: 80 a7 00 19 cmp %i4, %i1 400032b8: 32 bf ff f6 bne,a 40003290 400032bc: d2 06 00 00 ld [ %i0 ], %o1 if ( space_available > 0 ) { init_or_extend = extend; } } if ( init_or_extend == _Heap_Initialize ) { 400032c0: 03 10 00 20 sethi %hi(0x40008000), %g1 400032c4: 82 10 60 ec or %g1, 0xec, %g1 ! 400080ec <_Heap_Initialize> 400032c8: 80 a7 40 01 cmp %i5, %g1 400032cc: 12 80 00 06 bne 400032e4 400032d0: 03 10 00 72 sethi %hi(0x4001c800), %g1 _Internal_error_Occurred( 400032d4: 90 10 20 00 clr %o0 400032d8: 92 10 20 01 mov 1, %o1 400032dc: 40 00 14 17 call 40008338 <_Internal_error_Occurred> 400032e0: 94 10 20 17 mov 0x17, %o2 } /* * If configured, initialize the statistics support */ if ( rtems_malloc_statistics_helpers != NULL ) { 400032e4: c2 00 60 84 ld [ %g1 + 0x84 ], %g1 400032e8: 80 a0 60 00 cmp %g1, 0 400032ec: 02 80 00 05 be 40003300 400032f0: 3b 10 00 72 sethi %hi(0x4001c800), %i5 (*rtems_malloc_statistics_helpers->initialize)(); 400032f4: c2 00 40 00 ld [ %g1 ], %g1 400032f8: 9f c0 40 00 call %g1 400032fc: 01 00 00 00 nop } MSBUMP( space_available, _Protected_heap_Get_size( heap ) ); 40003300: f8 07 63 38 ld [ %i5 + 0x338 ], %i4 40003304: 40 00 16 4e call 40008c3c <_Protected_heap_Get_size> 40003308: 90 10 00 1b mov %i3, %o0 4000330c: 90 02 00 1c add %o0, %i4, %o0 40003310: d0 27 63 38 st %o0, [ %i5 + 0x338 ] 40003314: 81 c7 e0 08 ret 40003318: 81 e8 00 00 restore =============================================================================== 40020ea0 : static rtems_printk_plugin_t print_handler; static void Stack_check_Dump_threads_usage( Thread_Control *the_thread ) { 40020ea0: 9d e3 bf 98 save %sp, -104, %sp <== NOT EXECUTED /* * Obtain interrupt stack information */ #if (CPU_ALLOCATE_INTERRUPT_STACK == TRUE) if (the_thread == (Thread_Control *) -1) { 40020ea4: 80 a6 3f ff cmp %i0, -1 <== NOT EXECUTED 40020ea8: 32 80 00 0a bne,a 40020ed0 <== NOT EXECUTED 40020eac: e0 06 21 38 ld [ %i0 + 0x138 ], %l0 <== NOT EXECUTED if (!Stack_check_Interrupt_stack.area) 40020eb0: 3b 10 01 87 sethi %hi(0x40061c00), %i5 <== NOT EXECUTED 40020eb4: ba 17 63 9c or %i5, 0x39c, %i5 ! 40061f9c <== NOT EXECUTED 40020eb8: c2 07 60 04 ld [ %i5 + 4 ], %g1 <== NOT EXECUTED 40020ebc: 80 a0 60 00 cmp %g1, 0 <== NOT EXECUTED 40020ec0: 02 80 00 4c be 40020ff0 <== NOT EXECUTED 40020ec4: a0 10 20 00 clr %l0 <== NOT EXECUTED return; stack = &Stack_check_Interrupt_stack; the_thread = 0; 40020ec8: 10 80 00 04 b 40020ed8 <== NOT EXECUTED 40020ecc: b0 10 20 00 clr %i0 <== NOT EXECUTED current = 0; } else #endif { stack = &the_thread->Start.Initial_stack; 40020ed0: ba 06 20 b0 add %i0, 0xb0, %i5 <== NOT EXECUTED current = (void *)_CPU_Context_Get_SP( &the_thread->Registers ); } low = Stack_check_usable_stack_start(stack); 40020ed4: c2 07 60 04 ld [ %i5 + 4 ], %g1 <== NOT EXECUTED size = Stack_check_usable_stack_size(stack); 40020ed8: f2 07 40 00 ld [ %i5 ], %i1 <== NOT EXECUTED { stack = &the_thread->Start.Initial_stack; current = (void *)_CPU_Context_Get_SP( &the_thread->Registers ); } low = Stack_check_usable_stack_start(stack); 40020edc: 84 00 60 10 add %g1, 0x10, %g2 <== NOT EXECUTED size = Stack_check_usable_stack_size(stack); 40020ee0: b2 06 7f f0 add %i1, -16, %i1 <== NOT EXECUTED /* * start at lower memory and find first word that does not * match pattern */ base += PATTERN_SIZE_WORDS; 40020ee4: 82 00 60 20 add %g1, 0x20, %g1 <== NOT EXECUTED for (ebase = base + length; base < ebase; base++) 40020ee8: 86 0e 7f fc and %i1, -4, %g3 <== NOT EXECUTED if (*base != U32_PATTERN) 40020eec: 09 29 69 69 sethi %hi(0xa5a5a400), %g4 <== NOT EXECUTED * start at lower memory and find first word that does not * match pattern */ base += PATTERN_SIZE_WORDS; for (ebase = base + length; base < ebase; base++) 40020ef0: 86 00 40 03 add %g1, %g3, %g3 <== NOT EXECUTED if (*base != U32_PATTERN) 40020ef4: 10 80 00 06 b 40020f0c <== NOT EXECUTED 40020ef8: 88 11 21 a5 or %g4, 0x1a5, %g4 <== NOT EXECUTED 40020efc: 80 a7 00 04 cmp %i4, %g4 <== NOT EXECUTED 40020f00: 12 80 00 08 bne 40020f20 <== NOT EXECUTED 40020f04: 80 a0 60 00 cmp %g1, 0 <== NOT EXECUTED * start at lower memory and find first word that does not * match pattern */ base += PATTERN_SIZE_WORDS; for (ebase = base + length; base < ebase; base++) 40020f08: 82 00 60 04 add %g1, 4, %g1 <== NOT EXECUTED 40020f0c: 80 a0 40 03 cmp %g1, %g3 <== NOT EXECUTED 40020f10: 2a bf ff fb bcs,a 40020efc <== NOT EXECUTED 40020f14: f8 00 40 00 ld [ %g1 ], %i4 <== NOT EXECUTED 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; 40020f18: 10 80 00 06 b 40020f30 <== NOT EXECUTED 40020f1c: b8 10 20 00 clr %i4 <== NOT EXECUTED 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 ) 40020f20: 02 80 00 04 be 40020f30 <== NOT EXECUTED 40020f24: b8 10 20 00 clr %i4 <== NOT EXECUTED used = Stack_check_Calculate_used( low, size, high_water_mark ); 40020f28: b8 00 80 19 add %g2, %i1, %i4 <== NOT EXECUTED 40020f2c: b8 27 00 01 sub %i4, %g1, %i4 <== NOT EXECUTED else used = 0; #if (CPU_ALLOCATE_INTERRUPT_STACK == TRUE) if ( the_thread ) 40020f30: 80 a6 20 00 cmp %i0, 0 <== NOT EXECUTED 40020f34: 02 80 00 12 be 40020f7c <== NOT EXECUTED 40020f38: 03 10 01 85 sethi %hi(0x40061400), %g1 <== NOT EXECUTED #endif { (*print_handler)( 40020f3c: f6 06 20 08 ld [ %i0 + 8 ], %i3 <== NOT EXECUTED 40020f40: f4 00 60 68 ld [ %g1 + 0x68 ], %i2 <== NOT EXECUTED 40020f44: 03 10 01 85 sethi %hi(0x40061400), %g1 <== NOT EXECUTED 40020f48: e2 00 60 64 ld [ %g1 + 0x64 ], %l1 ! 40061464 <== NOT EXECUTED 40020f4c: 94 07 bf f8 add %fp, -8, %o2 <== NOT EXECUTED 40020f50: 90 10 00 1b mov %i3, %o0 <== NOT EXECUTED 40020f54: 7f ff b2 ba call 4000da3c <== NOT EXECUTED 40020f58: 92 10 20 05 mov 5, %o1 <== NOT EXECUTED 40020f5c: 13 10 01 60 sethi %hi(0x40058000), %o1 <== NOT EXECUTED 40020f60: 96 10 00 08 mov %o0, %o3 <== NOT EXECUTED 40020f64: 92 12 62 58 or %o1, 0x258, %o1 <== NOT EXECUTED 40020f68: 90 10 00 11 mov %l1, %o0 <== NOT EXECUTED 40020f6c: 9f c6 80 00 call %i2 <== NOT EXECUTED 40020f70: 94 10 00 1b mov %i3, %o2 <== NOT EXECUTED (*print_handler)( print_context, " %010p - %010p %010p %8" PRId32 " ", stack->area, stack->area + stack->size - 1, 40020f74: 10 80 00 0a b 40020f9c <== NOT EXECUTED 40020f78: d4 07 60 04 ld [ %i5 + 4 ], %o2 <== NOT EXECUTED 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 ); 40020f7c: 05 10 01 85 sethi %hi(0x40061400), %g2 <== NOT EXECUTED 40020f80: c2 00 60 68 ld [ %g1 + 0x68 ], %g1 <== NOT EXECUTED 40020f84: d0 00 a0 64 ld [ %g2 + 0x64 ], %o0 <== NOT EXECUTED 40020f88: 13 10 01 60 sethi %hi(0x40058000), %o1 <== NOT EXECUTED 40020f8c: 94 10 3f ff mov -1, %o2 <== NOT EXECUTED 40020f90: 9f c0 40 00 call %g1 <== NOT EXECUTED 40020f94: 92 12 62 68 or %o1, 0x268, %o1 <== NOT EXECUTED (*print_handler)( print_context, " %010p - %010p %010p %8" PRId32 " ", stack->area, stack->area + stack->size - 1, 40020f98: d4 07 60 04 ld [ %i5 + 4 ], %o2 <== NOT EXECUTED else { (*print_handler)( print_context, "0x%08" PRIx32 " INTR", ~0 ); } #endif (*print_handler)( 40020f9c: 35 10 01 85 sethi %hi(0x40061400), %i2 <== NOT EXECUTED 40020fa0: 37 10 01 85 sethi %hi(0x40061400), %i3 <== NOT EXECUTED print_context, " %010p - %010p %010p %8" PRId32 " ", stack->area, stack->area + stack->size - 1, 40020fa4: d6 07 40 00 ld [ %i5 ], %o3 <== NOT EXECUTED else { (*print_handler)( print_context, "0x%08" PRIx32 " INTR", ~0 ); } #endif (*print_handler)( 40020fa8: c2 06 a0 68 ld [ %i2 + 0x68 ], %g1 <== NOT EXECUTED 40020fac: d0 06 e0 64 ld [ %i3 + 0x64 ], %o0 <== NOT EXECUTED print_context, " %010p - %010p %010p %8" PRId32 " ", stack->area, stack->area + stack->size - 1, 40020fb0: 96 02 ff ff add %o3, -1, %o3 <== NOT EXECUTED else { (*print_handler)( print_context, "0x%08" PRIx32 " INTR", ~0 ); } #endif (*print_handler)( 40020fb4: 13 10 01 60 sethi %hi(0x40058000), %o1 <== NOT EXECUTED 40020fb8: 96 02 80 0b add %o2, %o3, %o3 <== NOT EXECUTED 40020fbc: 92 12 62 78 or %o1, 0x278, %o1 <== NOT EXECUTED 40020fc0: 98 10 00 10 mov %l0, %o4 <== NOT EXECUTED 40020fc4: 9f c0 40 00 call %g1 <== NOT EXECUTED 40020fc8: 9a 10 00 19 mov %i1, %o5 <== NOT EXECUTED stack->area + stack->size - 1, current, size ); if (Stack_check_Initialized == 0) { 40020fcc: 03 10 01 85 sethi %hi(0x40061400), %g1 <== NOT EXECUTED 40020fd0: c2 00 60 60 ld [ %g1 + 0x60 ], %g1 ! 40061460 <== NOT EXECUTED (*print_handler)( print_context, "Unavailable\n" ); 40020fd4: d0 06 e0 64 ld [ %i3 + 0x64 ], %o0 <== NOT EXECUTED stack->area + stack->size - 1, current, size ); if (Stack_check_Initialized == 0) { 40020fd8: 80 a0 60 00 cmp %g1, 0 <== NOT EXECUTED 40020fdc: 12 80 00 07 bne 40020ff8 <== NOT EXECUTED 40020fe0: c2 06 a0 68 ld [ %i2 + 0x68 ], %g1 <== NOT EXECUTED (*print_handler)( print_context, "Unavailable\n" ); 40020fe4: 13 10 01 60 sethi %hi(0x40058000), %o1 <== NOT EXECUTED 40020fe8: 9f c0 40 00 call %g1 <== NOT EXECUTED 40020fec: 92 12 62 98 or %o1, 0x298, %o1 ! 40058298 <== NOT EXECUTED 40020ff0: 81 c7 e0 08 ret <== NOT EXECUTED 40020ff4: 81 e8 00 00 restore <== NOT EXECUTED } else { (*print_handler)( print_context, "%8" PRId32 "\n", used ); 40020ff8: 13 10 01 60 sethi %hi(0x40058000), %o1 <== NOT EXECUTED 40020ffc: 94 10 00 1c mov %i4, %o2 <== NOT EXECUTED 40021000: 9f c0 40 00 call %g1 <== NOT EXECUTED 40021004: 92 12 62 a8 or %o1, 0x2a8, %o1 <== NOT EXECUTED 40021008: 81 c7 e0 08 ret <== NOT EXECUTED 4002100c: 81 e8 00 00 restore <== NOT EXECUTED =============================================================================== 400210f8 : Thread_Control *running, bool pattern_ok ) RTEMS_COMPILER_NO_RETURN_ATTRIBUTE; void Stack_check_report_blown_task(Thread_Control *running, bool pattern_ok) { 400210f8: 9d e3 bf 80 save %sp, -128, %sp <== NOT EXECUTED Stack_Control *stack = &running->Start.Initial_stack; void *pattern_area = Stack_check_Get_pattern(stack); char name[32]; printk("BLOWN STACK!!!\n"); 400210fc: 11 10 01 60 sethi %hi(0x40058000), %o0 <== NOT EXECUTED ) RTEMS_COMPILER_NO_RETURN_ATTRIBUTE; void Stack_check_report_blown_task(Thread_Control *running, bool pattern_ok) { Stack_Control *stack = &running->Start.Initial_stack; void *pattern_area = Stack_check_Get_pattern(stack); 40021100: fa 06 20 b4 ld [ %i0 + 0xb4 ], %i5 <== NOT EXECUTED char name[32]; printk("BLOWN STACK!!!\n"); 40021104: 7f ff 89 e3 call 40003890 <== NOT EXECUTED 40021108: 90 12 22 b0 or %o0, 0x2b0, %o0 <== NOT EXECUTED printk("task control block: 0x%08" PRIxPTR "\n", running); 4002110c: 92 10 00 18 mov %i0, %o1 <== NOT EXECUTED 40021110: 11 10 01 60 sethi %hi(0x40058000), %o0 <== NOT EXECUTED 40021114: 7f ff 89 df call 40003890 <== NOT EXECUTED 40021118: 90 12 22 c0 or %o0, 0x2c0, %o0 ! 400582c0 <== NOT EXECUTED printk("task ID: 0x%08lx\n", (unsigned long) running->Object.id); 4002111c: d2 06 20 08 ld [ %i0 + 8 ], %o1 <== NOT EXECUTED 40021120: 11 10 01 60 sethi %hi(0x40058000), %o0 <== NOT EXECUTED 40021124: 7f ff 89 db call 40003890 <== NOT EXECUTED 40021128: 90 12 22 e0 or %o0, 0x2e0, %o0 ! 400582e0 <== NOT EXECUTED printk( 4002112c: d2 06 20 0c ld [ %i0 + 0xc ], %o1 <== NOT EXECUTED 40021130: 11 10 01 60 sethi %hi(0x40058000), %o0 <== NOT EXECUTED 40021134: 7f ff 89 d7 call 40003890 <== NOT EXECUTED 40021138: 90 12 22 f8 or %o0, 0x2f8, %o0 ! 400582f8 <== NOT EXECUTED "task name: 0x%08" PRIx32 "\n", running->Object.name.name_u32 ); printk( 4002113c: d0 06 20 08 ld [ %i0 + 8 ], %o0 <== NOT EXECUTED 40021140: 94 07 bf e0 add %fp, -32, %o2 <== NOT EXECUTED 40021144: 7f ff b2 3e call 4000da3c <== NOT EXECUTED 40021148: 92 10 20 20 mov 0x20, %o1 <== NOT EXECUTED 4002114c: 92 10 00 08 mov %o0, %o1 <== NOT EXECUTED 40021150: 11 10 01 60 sethi %hi(0x40058000), %o0 <== NOT EXECUTED 40021154: 7f ff 89 cf call 40003890 <== NOT EXECUTED 40021158: 90 12 23 10 or %o0, 0x310, %o0 ! 40058310 <== NOT EXECUTED ); printk( "task stack area (%lu Bytes): 0x%08" PRIxPTR " .. 0x%08" PRIxPTR "\n", (unsigned long) stack->size, stack->area, ((char *) stack->area + stack->size) 4002115c: d4 06 20 b4 ld [ %i0 + 0xb4 ], %o2 <== NOT EXECUTED 40021160: d2 06 20 b0 ld [ %i0 + 0xb0 ], %o1 <== NOT EXECUTED ); printk( "task name string: %s\n", rtems_object_get_name(running->Object.id, sizeof(name), name) ); printk( 40021164: 11 10 01 60 sethi %hi(0x40058000), %o0 <== NOT EXECUTED 40021168: 96 02 80 09 add %o2, %o1, %o3 <== NOT EXECUTED 4002116c: 7f ff 89 c9 call 40003890 <== NOT EXECUTED 40021170: 90 12 23 28 or %o0, 0x328, %o0 <== NOT EXECUTED "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) { 40021174: 80 a6 60 00 cmp %i1, 0 <== NOT EXECUTED 40021178: 32 80 00 09 bne,a 4002119c <== NOT EXECUTED 4002117c: d2 06 20 0c ld [ %i0 + 0xc ], %o1 <== NOT EXECUTED printk( 40021180: 11 10 01 60 sethi %hi(0x40058000), %o0 <== NOT EXECUTED 40021184: 92 10 20 10 mov 0x10, %o1 <== NOT EXECUTED 40021188: 90 12 23 58 or %o0, 0x358, %o0 <== NOT EXECUTED 4002118c: 94 07 60 08 add %i5, 8, %o2 <== NOT EXECUTED 40021190: 7f ff 89 c0 call 40003890 <== NOT EXECUTED 40021194: 96 07 60 18 add %i5, 0x18, %o3 <== NOT EXECUTED rtems_configuration_get_user_multiprocessing_table()->node ); } #endif rtems_fatal( 40021198: d2 06 20 0c ld [ %i0 + 0xc ], %o1 <== NOT EXECUTED 4002119c: 7f ff 97 c3 call 400070a8 <== NOT EXECUTED 400211a0: 90 10 20 09 mov 9, %o0 <== NOT EXECUTED =============================================================================== 400105e4 <_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 ) { 400105e4: 9d e3 bf a0 save %sp, -96, %sp size_t message_buffering_required = 0; size_t allocated_message_size; the_message_queue->maximum_pending_messages = maximum_pending_messages; 400105e8: f4 26 20 44 st %i2, [ %i0 + 0x44 ] the_message_queue->number_of_pending_messages = 0; 400105ec: c0 26 20 48 clr [ %i0 + 0x48 ] /* * 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)) { 400105f0: 80 8e e0 03 btst 3, %i3 400105f4: 02 80 00 09 be 40010618 <_CORE_message_queue_Initialize+0x34> 400105f8: f6 26 20 4c st %i3, [ %i0 + 0x4c ] allocated_message_size += sizeof(uintptr_t); 400105fc: 96 06 e0 04 add %i3, 4, %o3 allocated_message_size &= ~(sizeof(uintptr_t) - 1); 40010600: 96 0a ff fc and %o3, -4, %o3 /* * 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) 40010604: 80 a2 c0 1b cmp %o3, %i3 40010608: 3a 80 00 06 bcc,a 40010620 <_CORE_message_queue_Initialize+0x3c> 4001060c: ba 02 e0 10 add %o3, 0x10, %i5 return false; 40010610: 10 80 00 24 b 400106a0 <_CORE_message_queue_Initialize+0xbc> 40010614: b0 10 20 00 clr %i0 /* * 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)) { 40010618: 96 10 00 1b mov %i3, %o3 /* * Calculate how much total memory is required for message buffering and * check for overflow on the multiplication. */ if ( !size_t_mult32_with_overflow( 4001061c: ba 02 e0 10 add %o3, 0x10, %i5 size_t a, size_t b, size_t *c ) { long long x = (long long)a*b; 40010620: 90 10 20 00 clr %o0 40010624: 92 10 00 1a mov %i2, %o1 40010628: 94 10 20 00 clr %o2 4001062c: 40 00 3d 92 call 4001fc74 <__muldi3> 40010630: 96 10 00 1d mov %i5, %o3 if ( x > SIZE_MAX ) 40010634: 80 a2 20 00 cmp %o0, 0 40010638: 34 80 00 1a bg,a 400106a0 <_CORE_message_queue_Initialize+0xbc> 4001063c: b0 10 20 00 clr %i0 /* * Attempt to allocate the message memory */ the_message_queue->message_buffers = (CORE_message_queue_Buffer *) _Workspace_Allocate( message_buffering_required ); 40010640: 40 00 0b bf call 4001353c <_Workspace_Allocate> 40010644: 90 10 00 09 mov %o1, %o0 return false; /* * Attempt to allocate the message memory */ the_message_queue->message_buffers = (CORE_message_queue_Buffer *) 40010648: d0 26 20 5c st %o0, [ %i0 + 0x5c ] _Workspace_Allocate( message_buffering_required ); if (the_message_queue->message_buffers == 0) 4001064c: 80 a2 20 00 cmp %o0, 0 40010650: 02 bf ff f0 be 40010610 <_CORE_message_queue_Initialize+0x2c><== NEVER TAKEN 40010654: 92 10 00 08 mov %o0, %o1 /* * Initialize the pool of inactive messages, pending messages, * and set of waiting threads. */ _Chain_Initialize ( 40010658: 90 06 20 60 add %i0, 0x60, %o0 4001065c: 94 10 00 1a mov %i2, %o2 40010660: 7f ff ff d3 call 400105ac <_Chain_Initialize> 40010664: 96 10 00 1d mov %i5, %o3 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 ); 40010668: 82 06 20 50 add %i0, 0x50, %g1 head->next = tail; head->previous = NULL; tail->previous = head; 4001066c: c2 26 20 58 st %g1, [ %i0 + 0x58 ] */ RTEMS_INLINE_ROUTINE bool _CORE_message_queue_Is_priority( CORE_message_queue_Attributes *the_attribute ) { return 40010670: c2 06 40 00 ld [ %i1 ], %g1 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 ); 40010674: 84 06 20 54 add %i0, 0x54, %g2 40010678: 82 18 60 01 xor %g1, 1, %g1 allocated_message_size + sizeof( CORE_message_queue_Buffer_control ) ); _Chain_Initialize_empty( &the_message_queue->Pending_messages ); _Thread_queue_Initialize( 4001067c: 80 a0 00 01 cmp %g0, %g1 head->next = tail; 40010680: c4 26 20 50 st %g2, [ %i0 + 0x50 ] head->previous = NULL; 40010684: c0 26 20 54 clr [ %i0 + 0x54 ] 40010688: 90 10 00 18 mov %i0, %o0 4001068c: 92 60 3f ff subx %g0, -1, %o1 40010690: 94 10 20 80 mov 0x80, %o2 40010694: 96 10 20 06 mov 6, %o3 40010698: 40 00 09 87 call 40012cb4 <_Thread_queue_Initialize> 4001069c: b0 10 20 01 mov 1, %i0 STATES_WAITING_FOR_MESSAGE, CORE_MESSAGE_QUEUE_STATUS_TIMEOUT ); return true; } 400106a0: b0 0e 20 01 and %i0, 1, %i0 400106a4: 81 c7 e0 08 ret 400106a8: 81 e8 00 00 restore =============================================================================== 40007e14 <_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 ) { 40007e14: 9d e3 bf a0 save %sp, -96, %sp ISR_Level level; CORE_semaphore_Status status; status = CORE_SEMAPHORE_STATUS_SUCCESSFUL; if ( (the_thread = _Thread_queue_Dequeue(&the_semaphore->Wait_queue)) ) { 40007e18: 90 10 00 18 mov %i0, %o0 40007e1c: 40 00 07 27 call 40009ab8 <_Thread_queue_Dequeue> 40007e20: ba 10 00 18 mov %i0, %i5 40007e24: 80 a2 20 00 cmp %o0, 0 40007e28: 12 80 00 0e bne 40007e60 <_CORE_semaphore_Surrender+0x4c> 40007e2c: b0 10 20 00 clr %i0 if ( !_Objects_Is_local_id( the_thread->Object.id ) ) (*api_semaphore_mp_support) ( the_thread, id ); #endif } else { _ISR_Disable( level ); 40007e30: 7f ff e8 9e call 400020a8 40007e34: 01 00 00 00 nop if ( the_semaphore->count < the_semaphore->Attributes.maximum_count ) 40007e38: c2 07 60 48 ld [ %i5 + 0x48 ], %g1 40007e3c: c4 07 60 40 ld [ %i5 + 0x40 ], %g2 40007e40: 80 a0 40 02 cmp %g1, %g2 40007e44: 1a 80 00 05 bcc 40007e58 <_CORE_semaphore_Surrender+0x44> <== NEVER TAKEN 40007e48: b0 10 20 04 mov 4, %i0 the_semaphore->count += 1; 40007e4c: 82 00 60 01 inc %g1 { Thread_Control *the_thread; ISR_Level level; CORE_semaphore_Status status; status = CORE_SEMAPHORE_STATUS_SUCCESSFUL; 40007e50: b0 10 20 00 clr %i0 #endif } else { _ISR_Disable( level ); if ( the_semaphore->count < the_semaphore->Attributes.maximum_count ) the_semaphore->count += 1; 40007e54: c2 27 60 48 st %g1, [ %i5 + 0x48 ] else status = CORE_SEMAPHORE_MAXIMUM_COUNT_EXCEEDED; _ISR_Enable( level ); 40007e58: 7f ff e8 98 call 400020b8 40007e5c: 01 00 00 00 nop } return status; } 40007e60: 81 c7 e0 08 ret 40007e64: 81 e8 00 00 restore =============================================================================== 40006b0c <_Event_Surrender>: rtems_event_set event_in, Event_Control *event, Thread_blocking_operation_States *sync_state, States_Control wait_state ) { 40006b0c: 9d e3 bf a0 save %sp, -96, %sp 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; 40006b10: e0 06 20 30 ld [ %i0 + 0x30 ], %l0 _ISR_Disable( level ); 40006b14: 7f ff ed 65 call 400020a8 40006b18: ba 10 00 18 mov %i0, %i5 40006b1c: b0 10 00 08 mov %o0, %i0 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; 40006b20: c2 06 80 00 ld [ %i2 ], %g1 40006b24: b2 16 40 01 or %i1, %g1, %i1 40006b28: f2 26 80 00 st %i1, [ %i2 ] _Event_sets_Post( event_in, &event->pending_events ); pending_events = event->pending_events; event_condition = the_thread->Wait.count; 40006b2c: c4 07 60 24 ld [ %i5 + 0x24 ], %g2 seized_events = _Event_sets_Get( pending_events, event_condition ); /* * No events were seized in this operation */ if ( _Event_sets_Is_empty( seized_events ) ) { 40006b30: 82 8e 40 02 andcc %i1, %g2, %g1 40006b34: 02 80 00 3d be 40006c28 <_Event_Surrender+0x11c> 40006b38: 07 10 00 73 sethi %hi(0x4001cc00), %g3 /* * 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() && 40006b3c: 86 10 e2 c0 or %g3, 0x2c0, %g3 ! 4001cec0 <_Per_CPU_Information> 40006b40: c8 00 e0 08 ld [ %g3 + 8 ], %g4 40006b44: 80 a1 20 00 cmp %g4, 0 40006b48: 22 80 00 18 be,a 40006ba8 <_Event_Surrender+0x9c> 40006b4c: c6 07 60 10 ld [ %i5 + 0x10 ], %g3 40006b50: c6 00 e0 10 ld [ %g3 + 0x10 ], %g3 40006b54: 80 a7 40 03 cmp %i5, %g3 40006b58: 32 80 00 14 bne,a 40006ba8 <_Event_Surrender+0x9c> 40006b5c: c6 07 60 10 ld [ %i5 + 0x10 ], %g3 _Thread_Is_executing( the_thread ) && ((*sync_state == THREAD_BLOCKING_OPERATION_TIMEOUT) || 40006b60: c6 06 c0 00 ld [ %i3 ], %g3 40006b64: 86 00 ff ff add %g3, -1, %g3 /* * 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 ) && 40006b68: 80 a0 e0 01 cmp %g3, 1 40006b6c: 38 80 00 0f bgu,a 40006ba8 <_Event_Surrender+0x9c> 40006b70: c6 07 60 10 ld [ %i5 + 0x10 ], %g3 ((*sync_state == THREAD_BLOCKING_OPERATION_TIMEOUT) || (*sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED)) ) { if ( seized_events == event_condition || _Options_Is_any(option_set) ) { 40006b74: 80 a0 40 02 cmp %g1, %g2 40006b78: 02 80 00 04 be 40006b88 <_Event_Surrender+0x7c> 40006b7c: 80 8c 20 02 btst 2, %l0 40006b80: 02 80 00 2a be 40006c28 <_Event_Surrender+0x11c> <== NEVER TAKEN 40006b84: 01 00 00 00 nop 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) ); 40006b88: b2 2e 40 01 andn %i1, %g1, %i1 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; 40006b8c: c4 07 60 28 ld [ %i5 + 0x28 ], %g2 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( 40006b90: f2 26 80 00 st %i1, [ %i2 ] pending_events, seized_events ); the_thread->Wait.count = 0; 40006b94: c0 27 60 24 clr [ %i5 + 0x24 ] *(rtems_event_set *)the_thread->Wait.return_argument = seized_events; 40006b98: c2 20 80 00 st %g1, [ %g2 ] *sync_state = THREAD_BLOCKING_OPERATION_SATISFIED; 40006b9c: 82 10 20 03 mov 3, %g1 40006ba0: 10 80 00 22 b 40006c28 <_Event_Surrender+0x11c> 40006ba4: c2 26 c0 00 st %g1, [ %i3 ] } /* * Otherwise, this is a normal send to another thread */ if ( _States_Are_set( the_thread->current_state, wait_state ) ) { 40006ba8: 80 8f 00 03 btst %i4, %g3 40006bac: 02 80 00 1f be 40006c28 <_Event_Surrender+0x11c> 40006bb0: 80 a0 40 02 cmp %g1, %g2 if ( seized_events == event_condition || _Options_Is_any( option_set ) ) { 40006bb4: 02 80 00 04 be 40006bc4 <_Event_Surrender+0xb8> 40006bb8: 80 8c 20 02 btst 2, %l0 40006bbc: 02 80 00 1b be 40006c28 <_Event_Surrender+0x11c> <== NEVER TAKEN 40006bc0: 01 00 00 00 nop 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; 40006bc4: c4 07 60 28 ld [ %i5 + 0x28 ], %g2 40006bc8: b2 2e 40 01 andn %i1, %g1, %i1 /* * 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( 40006bcc: f2 26 80 00 st %i1, [ %i2 ] pending_events, seized_events ); the_thread->Wait.count = 0; 40006bd0: c0 27 60 24 clr [ %i5 + 0x24 ] *(rtems_event_set *)the_thread->Wait.return_argument = seized_events; 40006bd4: c2 20 80 00 st %g1, [ %g2 ] _ISR_Flash( level ); 40006bd8: 7f ff ed 38 call 400020b8 40006bdc: 90 10 00 18 mov %i0, %o0 40006be0: 7f ff ed 32 call 400020a8 40006be4: 01 00 00 00 nop if ( !_Watchdog_Is_active( &the_thread->Timer ) ) { 40006be8: c2 07 60 50 ld [ %i5 + 0x50 ], %g1 40006bec: 80 a0 60 02 cmp %g1, 2 40006bf0: 02 80 00 06 be 40006c08 <_Event_Surrender+0xfc> 40006bf4: 82 10 20 03 mov 3, %g1 _ISR_Enable( level ); 40006bf8: 7f ff ed 30 call 400020b8 40006bfc: 33 04 01 ff sethi %hi(0x1007fc00), %i1 RTEMS_INLINE_ROUTINE void _Thread_Unblock ( Thread_Control *the_thread ) { _Thread_Clear_state( the_thread, STATES_BLOCKED ); 40006c00: 10 80 00 08 b 40006c20 <_Event_Surrender+0x114> 40006c04: b2 16 63 f8 or %i1, 0x3f8, %i1 ! 1007fff8 RTEMS_INLINE_ROUTINE void _Watchdog_Deactivate( Watchdog_Control *the_watchdog ) { the_watchdog->state = WATCHDOG_REMOVE_IT; 40006c08: c2 27 60 50 st %g1, [ %i5 + 0x50 ] _Thread_Unblock( the_thread ); } else { _Watchdog_Deactivate( &the_thread->Timer ); _ISR_Enable( level ); 40006c0c: 7f ff ed 2b call 400020b8 40006c10: 33 04 01 ff sethi %hi(0x1007fc00), %i1 (void) _Watchdog_Remove( &the_thread->Timer ); 40006c14: 40 00 0e 35 call 4000a4e8 <_Watchdog_Remove> 40006c18: 90 07 60 48 add %i5, 0x48, %o0 40006c1c: b2 16 63 f8 or %i1, 0x3f8, %i1 40006c20: 40 00 0a 03 call 4000942c <_Thread_Clear_state> 40006c24: 91 e8 00 1d restore %g0, %i5, %o0 _Thread_Unblock( the_thread ); } return; } } _ISR_Enable( level ); 40006c28: 7f ff ed 24 call 400020b8 40006c2c: 81 e8 00 00 restore =============================================================================== 40006c30 <_Event_Timeout>: void _Event_Timeout( Objects_Id id, void *arg ) { 40006c30: 9d e3 bf 98 save %sp, -104, %sp ISR_Level level; Thread_blocking_operation_States *sync_state; sync_state = arg; the_thread = _Thread_Get( id, &location ); 40006c34: 90 10 00 18 mov %i0, %o0 40006c38: 40 00 0a df call 400097b4 <_Thread_Get> 40006c3c: 92 07 bf fc add %fp, -4, %o1 switch ( location ) { 40006c40: c2 07 bf fc ld [ %fp + -4 ], %g1 40006c44: 80 a0 60 00 cmp %g1, 0 40006c48: 12 80 00 1b bne 40006cb4 <_Event_Timeout+0x84> <== NEVER TAKEN 40006c4c: ba 10 00 08 mov %o0, %i5 * * 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 ); 40006c50: 7f ff ed 16 call 400020a8 40006c54: 01 00 00 00 nop RTEMS_INLINE_ROUTINE bool _Thread_Is_executing ( const Thread_Control *the_thread ) { return ( the_thread == _Thread_Executing ); 40006c58: 03 10 00 73 sethi %hi(0x4001cc00), %g1 return; } #endif the_thread->Wait.count = 0; if ( _Thread_Is_executing( the_thread ) ) { 40006c5c: c2 00 62 d0 ld [ %g1 + 0x2d0 ], %g1 ! 4001ced0 <_Per_CPU_Information+0x10> 40006c60: 80 a7 40 01 cmp %i5, %g1 40006c64: 12 80 00 08 bne 40006c84 <_Event_Timeout+0x54> 40006c68: c0 27 60 24 clr [ %i5 + 0x24 ] if ( *sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED ) 40006c6c: c2 06 40 00 ld [ %i1 ], %g1 40006c70: 80 a0 60 01 cmp %g1, 1 40006c74: 12 80 00 05 bne 40006c88 <_Event_Timeout+0x58> 40006c78: 82 10 20 06 mov 6, %g1 *sync_state = THREAD_BLOCKING_OPERATION_TIMEOUT; 40006c7c: 82 10 20 02 mov 2, %g1 40006c80: c2 26 40 00 st %g1, [ %i1 ] } the_thread->Wait.return_code = RTEMS_TIMEOUT; 40006c84: 82 10 20 06 mov 6, %g1 40006c88: c2 27 60 34 st %g1, [ %i5 + 0x34 ] _ISR_Enable( level ); 40006c8c: 7f ff ed 0b call 400020b8 40006c90: 01 00 00 00 nop RTEMS_INLINE_ROUTINE void _Thread_Unblock ( Thread_Control *the_thread ) { _Thread_Clear_state( the_thread, STATES_BLOCKED ); 40006c94: 90 10 00 1d mov %i5, %o0 40006c98: 13 04 01 ff sethi %hi(0x1007fc00), %o1 40006c9c: 40 00 09 e4 call 4000942c <_Thread_Clear_state> 40006ca0: 92 12 63 f8 or %o1, 0x3f8, %o1 ! 1007fff8 * * 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; 40006ca4: 03 10 00 73 sethi %hi(0x4001cc00), %g1 40006ca8: c4 00 60 c0 ld [ %g1 + 0xc0 ], %g2 ! 4001ccc0 <_Thread_Dispatch_disable_level> --level; 40006cac: 84 00 bf ff add %g2, -1, %g2 _Thread_Dispatch_disable_level = level; 40006cb0: c4 20 60 c0 st %g2, [ %g1 + 0xc0 ] 40006cb4: 81 c7 e0 08 ret 40006cb8: 81 e8 00 00 restore =============================================================================== 4000c300 <_Heap_Free>: return do_free; } #endif bool _Heap_Free( Heap_Control *heap, void *alloc_begin_ptr ) { 4000c300: 9d e3 bf a0 save %sp, -96, %sp /* * 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 ) { 4000c304: 80 a6 60 00 cmp %i1, 0 4000c308: 02 80 00 7a be 4000c4f0 <_Heap_Free+0x1f0> 4000c30c: 88 10 20 01 mov 1, %g4 4000c310: d2 06 20 10 ld [ %i0 + 0x10 ], %o1 4000c314: 40 00 2b 89 call 40017138 <.urem> 4000c318: 90 10 00 19 mov %i1, %o0 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 4000c31c: f6 06 20 20 ld [ %i0 + 0x20 ], %i3 RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down( uintptr_t value, uintptr_t alignment ) { return value - (value % alignment); 4000c320: ba 06 7f f8 add %i1, -8, %i5 uintptr_t alloc_begin, uintptr_t page_size ) { return (Heap_Block *) (_Heap_Align_down( alloc_begin, page_size ) - HEAP_BLOCK_HEADER_SIZE); 4000c324: 90 27 40 08 sub %i5, %o0, %o0 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; 4000c328: 80 a2 00 1b cmp %o0, %i3 4000c32c: 0a 80 00 05 bcs 4000c340 <_Heap_Free+0x40> 4000c330: 82 10 20 00 clr %g1 4000c334: c2 06 20 24 ld [ %i0 + 0x24 ], %g1 4000c338: 80 a0 40 08 cmp %g1, %o0 4000c33c: 82 60 3f ff subx %g0, -1, %g1 } 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 ) ) { 4000c340: 80 a0 60 00 cmp %g1, 0 4000c344: 02 80 00 6b be 4000c4f0 <_Heap_Free+0x1f0> 4000c348: 88 10 20 00 clr %g4 - 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; 4000c34c: f8 02 20 04 ld [ %o0 + 4 ], %i4 4000c350: 84 0f 3f fe and %i4, -2, %g2 RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); 4000c354: 82 02 00 02 add %o0, %g2, %g1 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; 4000c358: 80 a0 40 1b cmp %g1, %i3 4000c35c: 0a 80 00 05 bcs 4000c370 <_Heap_Free+0x70> <== NEVER TAKEN 4000c360: 86 10 20 00 clr %g3 4000c364: c6 06 20 24 ld [ %i0 + 0x24 ], %g3 4000c368: 80 a0 c0 01 cmp %g3, %g1 4000c36c: 86 60 3f ff subx %g0, -1, %g3 _Heap_Protection_block_check( heap, block ); block_size = _Heap_Block_size( block ); next_block = _Heap_Block_at( block, block_size ); if ( !_Heap_Is_block_in_heap( heap, next_block ) ) { 4000c370: 80 a0 e0 00 cmp %g3, 0 4000c374: 02 80 00 5f be 4000c4f0 <_Heap_Free+0x1f0> <== NEVER TAKEN 4000c378: 88 10 20 00 clr %g4 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; 4000c37c: fa 00 60 04 ld [ %g1 + 4 ], %i5 return false; } _Heap_Protection_block_check( heap, next_block ); if ( !_Heap_Is_prev_used( next_block ) ) { 4000c380: 80 8f 60 01 btst 1, %i5 4000c384: 22 80 00 5c be,a 4000c4f4 <_Heap_Free+0x1f4> <== NEVER TAKEN 4000c388: b0 09 20 01 and %g4, 1, %i0 <== NOT EXECUTED if ( !_Heap_Protection_determine_block_free( heap, block ) ) { return true; } next_block_size = _Heap_Block_size( next_block ); next_is_free = next_block != heap->last_block 4000c38c: c8 06 20 24 ld [ %i0 + 0x24 ], %g4 && !_Heap_Is_prev_used( _Heap_Block_at( next_block, next_block_size )); 4000c390: 80 a0 40 04 cmp %g1, %g4 4000c394: 02 80 00 07 be 4000c3b0 <_Heap_Free+0xb0> 4000c398: ba 0f 7f fe and %i5, -2, %i5 4000c39c: 86 00 40 1d add %g1, %i5, %g3 4000c3a0: f4 00 e0 04 ld [ %g3 + 4 ], %i2 4000c3a4: b4 1e a0 01 xor %i2, 1, %i2 4000c3a8: 10 80 00 03 b 4000c3b4 <_Heap_Free+0xb4> 4000c3ac: b4 0e a0 01 and %i2, 1, %i2 4000c3b0: b4 10 20 00 clr %i2 if ( !_Heap_Is_prev_used( block ) ) { 4000c3b4: 80 8f 20 01 btst 1, %i4 4000c3b8: 12 80 00 26 bne 4000c450 <_Heap_Free+0x150> 4000c3bc: 80 8e a0 ff btst 0xff, %i2 uintptr_t const prev_size = block->prev_size; 4000c3c0: f8 02 00 00 ld [ %o0 ], %i4 RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); 4000c3c4: 86 22 00 1c sub %o0, %i4, %g3 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; 4000c3c8: 80 a0 c0 1b cmp %g3, %i3 4000c3cc: 0a 80 00 04 bcs 4000c3dc <_Heap_Free+0xdc> <== NEVER TAKEN 4000c3d0: b2 10 20 00 clr %i1 4000c3d4: 80 a1 00 03 cmp %g4, %g3 4000c3d8: b2 60 3f ff subx %g0, -1, %i1 Heap_Block * const prev_block = _Heap_Block_at( block, -prev_size ); if ( !_Heap_Is_block_in_heap( heap, prev_block ) ) { 4000c3dc: 80 a6 60 00 cmp %i1, 0 4000c3e0: 02 80 00 44 be 4000c4f0 <_Heap_Free+0x1f0> <== NEVER TAKEN 4000c3e4: 88 10 20 00 clr %g4 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; 4000c3e8: f6 00 e0 04 ld [ %g3 + 4 ], %i3 return( false ); } /* As we always coalesce free blocks, the block that preceedes prev_block must have been used. */ if ( !_Heap_Is_prev_used ( prev_block) ) { 4000c3ec: 80 8e e0 01 btst 1, %i3 4000c3f0: 02 80 00 40 be 4000c4f0 <_Heap_Free+0x1f0> <== NEVER TAKEN 4000c3f4: 80 8e a0 ff btst 0xff, %i2 _HAssert( false ); return( false ); } if ( next_is_free ) { /* coalesce both */ 4000c3f8: 22 80 00 0f be,a 4000c434 <_Heap_Free+0x134> 4000c3fc: b8 00 80 1c add %g2, %i4, %i4 return _Heap_Free_list_tail(heap)->prev; } RTEMS_INLINE_ROUTINE void _Heap_Free_list_remove( Heap_Block *block ) { Heap_Block *next = block->next; 4000c400: c8 00 60 08 ld [ %g1 + 8 ], %g4 Heap_Block *prev = block->prev; 4000c404: c2 00 60 0c ld [ %g1 + 0xc ], %g1 uintptr_t const size = block_size + prev_size + next_block_size; 4000c408: ba 00 80 1d add %g2, %i5, %i5 prev->next = next; 4000c40c: c8 20 60 08 st %g4, [ %g1 + 8 ] next->prev = prev; 4000c410: c2 21 20 0c st %g1, [ %g4 + 0xc ] _Heap_Free_list_remove( next_block ); stats->free_blocks -= 1; 4000c414: c2 06 20 38 ld [ %i0 + 0x38 ], %g1 _HAssert( false ); return( false ); } if ( next_is_free ) { /* coalesce both */ uintptr_t const size = block_size + prev_size + next_block_size; 4000c418: b8 07 40 1c add %i5, %i4, %i4 _Heap_Free_list_remove( next_block ); stats->free_blocks -= 1; 4000c41c: 82 00 7f ff add %g1, -1, %g1 4000c420: c2 26 20 38 st %g1, [ %i0 + 0x38 ] 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; 4000c424: f8 20 c0 1c st %i4, [ %g3 + %i4 ] 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; 4000c428: 82 17 20 01 or %i4, 1, %g1 4000c42c: 10 80 00 27 b 4000c4c8 <_Heap_Free+0x1c8> 4000c430: c2 20 e0 04 st %g1, [ %g3 + 4 ] 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; prev_block->size_and_flag = size | HEAP_PREV_BLOCK_USED; 4000c434: 88 17 20 01 or %i4, 1, %g4 4000c438: c8 20 e0 04 st %g4, [ %g3 + 4 ] next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED; 4000c43c: c6 00 60 04 ld [ %g1 + 4 ], %g3 next_block->prev_size = size; 4000c440: f8 22 00 02 st %i4, [ %o0 + %g2 ] _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; 4000c444: 86 08 ff fe and %g3, -2, %g3 4000c448: 10 80 00 20 b 4000c4c8 <_Heap_Free+0x1c8> 4000c44c: c6 20 60 04 st %g3, [ %g1 + 4 ] next_block->prev_size = size; } } else if ( next_is_free ) { /* coalesce next */ 4000c450: 22 80 00 0d be,a 4000c484 <_Heap_Free+0x184> 4000c454: c6 06 20 08 ld [ %i0 + 8 ], %g3 RTEMS_INLINE_ROUTINE void _Heap_Free_list_replace( Heap_Block *old_block, Heap_Block *new_block ) { Heap_Block *next = old_block->next; 4000c458: c8 00 60 08 ld [ %g1 + 8 ], %g4 Heap_Block *prev = old_block->prev; 4000c45c: c2 00 60 0c ld [ %g1 + 0xc ], %g1 new_block->next = next; 4000c460: c8 22 20 08 st %g4, [ %o0 + 8 ] new_block->prev = prev; 4000c464: c2 22 20 0c st %g1, [ %o0 + 0xc ] uintptr_t const size = block_size + next_block_size; 4000c468: 86 07 40 02 add %i5, %g2, %g3 next->prev = new_block; prev->next = new_block; 4000c46c: d0 20 60 08 st %o0, [ %g1 + 8 ] Heap_Block *prev = old_block->prev; new_block->next = next; new_block->prev = prev; next->prev = new_block; 4000c470: d0 21 20 0c st %o0, [ %g4 + 0xc ] _Heap_Free_list_replace( next_block, block ); block->size_and_flag = size | HEAP_PREV_BLOCK_USED; 4000c474: 82 10 e0 01 or %g3, 1, %g1 next_block = _Heap_Block_at( block, size ); next_block->prev_size = size; 4000c478: c6 22 00 03 st %g3, [ %o0 + %g3 ] 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; 4000c47c: 10 80 00 13 b 4000c4c8 <_Heap_Free+0x1c8> 4000c480: c2 22 20 04 st %g1, [ %o0 + 4 ] ) { Heap_Block *next = block_before->next; new_block->next = next; new_block->prev = block_before; 4000c484: f0 22 20 0c st %i0, [ %o0 + 0xc ] Heap_Block *new_block ) { Heap_Block *next = block_before->next; new_block->next = next; 4000c488: c6 22 20 08 st %g3, [ %o0 + 8 ] new_block->prev = block_before; block_before->next = new_block; next->prev = new_block; 4000c48c: d0 20 e0 0c st %o0, [ %g3 + 0xc ] 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; 4000c490: 86 10 a0 01 or %g2, 1, %g3 4000c494: c6 22 20 04 st %g3, [ %o0 + 4 ] next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED; 4000c498: c6 00 60 04 ld [ %g1 + 4 ], %g3 next_block->prev_size = block_size; 4000c49c: c4 22 00 02 st %g2, [ %o0 + %g2 ] } 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; 4000c4a0: 86 08 ff fe and %g3, -2, %g3 4000c4a4: c6 20 60 04 st %g3, [ %g1 + 4 ] next_block->prev_size = block_size; /* Statistics */ ++stats->free_blocks; 4000c4a8: c2 06 20 38 ld [ %i0 + 0x38 ], %g1 if ( stats->max_free_blocks < stats->free_blocks ) { 4000c4ac: c6 06 20 3c ld [ %i0 + 0x3c ], %g3 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; 4000c4b0: 82 00 60 01 inc %g1 { Heap_Block *next = block_before->next; new_block->next = next; new_block->prev = block_before; block_before->next = new_block; 4000c4b4: d0 26 20 08 st %o0, [ %i0 + 8 ] if ( stats->max_free_blocks < stats->free_blocks ) { 4000c4b8: 80 a0 c0 01 cmp %g3, %g1 4000c4bc: 1a 80 00 03 bcc 4000c4c8 <_Heap_Free+0x1c8> 4000c4c0: c2 26 20 38 st %g1, [ %i0 + 0x38 ] stats->max_free_blocks = stats->free_blocks; 4000c4c4: c2 26 20 3c st %g1, [ %i0 + 0x3c ] } } /* Statistics */ --stats->used_blocks; 4000c4c8: c2 06 20 40 ld [ %i0 + 0x40 ], %g1 4000c4cc: 82 00 7f ff add %g1, -1, %g1 4000c4d0: c2 26 20 40 st %g1, [ %i0 + 0x40 ] ++stats->frees; 4000c4d4: c2 06 20 50 ld [ %i0 + 0x50 ], %g1 4000c4d8: 82 00 60 01 inc %g1 4000c4dc: c2 26 20 50 st %g1, [ %i0 + 0x50 ] stats->free_size += block_size; 4000c4e0: c2 06 20 30 ld [ %i0 + 0x30 ], %g1 4000c4e4: 84 00 40 02 add %g1, %g2, %g2 4000c4e8: c4 26 20 30 st %g2, [ %i0 + 0x30 ] * 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; 4000c4ec: 88 10 20 01 mov 1, %g4 --stats->used_blocks; ++stats->frees; stats->free_size += block_size; return( true ); } 4000c4f0: b0 09 20 01 and %g4, 1, %i0 4000c4f4: 81 c7 e0 08 ret 4000c4f8: 81 e8 00 00 restore =============================================================================== 40009dfc <_Heap_Greedy_allocate>: Heap_Block *_Heap_Greedy_allocate( Heap_Control *heap, const uintptr_t *block_sizes, size_t block_count ) { 40009dfc: 9d e3 bf a0 save %sp, -96, %sp Heap_Block *allocated_blocks = NULL; Heap_Block *blocks = NULL; Heap_Block *current; size_t i; for (i = 0; i < block_count; ++i) { 40009e00: b6 10 20 00 clr %i3 Heap_Block *_Heap_Greedy_allocate( Heap_Control *heap, const uintptr_t *block_sizes, size_t block_count ) { 40009e04: ba 10 00 18 mov %i0, %i5 Heap_Block *allocated_blocks = NULL; Heap_Block *blocks = NULL; Heap_Block *current; size_t i; for (i = 0; i < block_count; ++i) { 40009e08: 10 80 00 11 b 40009e4c <_Heap_Greedy_allocate+0x50> 40009e0c: b8 10 20 00 clr %i4 * @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 ); 40009e10: d2 06 40 01 ld [ %i1 + %g1 ], %o1 40009e14: 90 10 00 1d mov %i5, %o0 40009e18: 94 10 20 00 clr %o2 40009e1c: 40 00 1a f5 call 400109f0 <_Heap_Allocate_aligned_with_boundary> 40009e20: 96 10 20 00 clr %o3 void *next = _Heap_Allocate( heap, block_sizes [i] ); if ( next != NULL ) { 40009e24: 82 92 20 00 orcc %o0, 0, %g1 40009e28: 22 80 00 09 be,a 40009e4c <_Heap_Greedy_allocate+0x50> <== NEVER TAKEN 40009e2c: b6 06 e0 01 inc %i3 <== NOT EXECUTED RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down( uintptr_t value, uintptr_t alignment ) { return value - (value % alignment); 40009e30: d2 07 60 10 ld [ %i5 + 0x10 ], %o1 40009e34: 40 00 30 bc call 40016124 <.urem> 40009e38: b0 00 7f f8 add %g1, -8, %i0 uintptr_t alloc_begin, uintptr_t page_size ) { return (Heap_Block *) (_Heap_Align_down( alloc_begin, page_size ) - HEAP_BLOCK_HEADER_SIZE); 40009e3c: 90 26 00 08 sub %i0, %o0, %o0 Heap_Block *next_block = _Heap_Block_of_alloc_area( (uintptr_t) next, heap->page_size ); next_block->next = allocated_blocks; 40009e40: f8 22 20 08 st %i4, [ %o0 + 8 ] 40009e44: b8 10 00 08 mov %o0, %i4 Heap_Block *allocated_blocks = NULL; Heap_Block *blocks = NULL; Heap_Block *current; size_t i; for (i = 0; i < block_count; ++i) { 40009e48: b6 06 e0 01 inc %i3 40009e4c: 80 a6 c0 1a cmp %i3, %i2 40009e50: 12 bf ff f0 bne 40009e10 <_Heap_Greedy_allocate+0x14> 40009e54: 83 2e e0 02 sll %i3, 2, %g1 40009e58: 10 80 00 0a b 40009e80 <_Heap_Greedy_allocate+0x84> 40009e5c: b0 10 20 00 clr %i0 allocated_blocks = next_block; } } while ( (current = _Heap_Free_list_first( heap )) != free_list_tail ) { _Heap_Block_allocate( 40009e60: 90 10 00 1d mov %i5, %o0 } RTEMS_INLINE_ROUTINE uintptr_t _Heap_Block_size( const Heap_Block *block ) { return block->size_and_flag & ~HEAP_PREV_BLOCK_USED; 40009e64: 96 0a ff fe and %o3, -2, %o3 40009e68: 92 10 00 1b mov %i3, %o1 40009e6c: 94 06 e0 08 add %i3, 8, %o2 40009e70: 40 00 00 cb call 4000a19c <_Heap_Block_allocate> 40009e74: 96 02 ff f8 add %o3, -8, %o3 current, _Heap_Alloc_area_of_block( current ), _Heap_Block_size( current ) - HEAP_BLOCK_HEADER_SIZE ); current->next = blocks; 40009e78: f0 26 e0 08 st %i0, [ %i3 + 8 ] 40009e7c: b0 10 00 1b mov %i3, %i0 return &heap->free_list; } RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Free_list_first( Heap_Control *heap ) { return _Heap_Free_list_head(heap)->next; 40009e80: f6 07 60 08 ld [ %i5 + 8 ], %i3 next_block->next = allocated_blocks; allocated_blocks = next_block; } } while ( (current = _Heap_Free_list_first( heap )) != free_list_tail ) { 40009e84: 80 a6 c0 1d cmp %i3, %i5 40009e88: 32 bf ff f6 bne,a 40009e60 <_Heap_Greedy_allocate+0x64> 40009e8c: d6 06 e0 04 ld [ %i3 + 4 ], %o3 current->next = blocks; blocks = current; } while ( allocated_blocks != NULL ) { 40009e90: 10 80 00 07 b 40009eac <_Heap_Greedy_allocate+0xb0> 40009e94: 80 a7 20 00 cmp %i4, 0 current = allocated_blocks; allocated_blocks = allocated_blocks->next; _Heap_Free( heap, (void *) _Heap_Alloc_area_of_block( current ) ); 40009e98: 92 07 20 08 add %i4, 8, %o1 40009e9c: 90 10 00 1d mov %i5, %o0 40009ea0: 40 00 1b 45 call 40010bb4 <_Heap_Free> 40009ea4: b8 10 00 1b mov %i3, %i4 current->next = blocks; blocks = current; } while ( allocated_blocks != NULL ) { 40009ea8: 80 a7 20 00 cmp %i4, 0 40009eac: 32 bf ff fb bne,a 40009e98 <_Heap_Greedy_allocate+0x9c> 40009eb0: f6 07 20 08 ld [ %i4 + 8 ], %i3 allocated_blocks = allocated_blocks->next; _Heap_Free( heap, (void *) _Heap_Alloc_area_of_block( current ) ); } return blocks; } 40009eb4: 81 c7 e0 08 ret 40009eb8: 81 e8 00 00 restore =============================================================================== 40011d64 <_Heap_Iterate>: void _Heap_Iterate( Heap_Control *heap, Heap_Block_visitor visitor, void *visitor_arg ) { 40011d64: 9d e3 bf a0 save %sp, -96, %sp <== NOT EXECUTED Heap_Block *current = heap->first_block; Heap_Block *end = heap->last_block; bool stop = false; 40011d68: 90 10 20 00 clr %o0 <== NOT EXECUTED Heap_Control *heap, Heap_Block_visitor visitor, void *visitor_arg ) { Heap_Block *current = heap->first_block; 40011d6c: c2 06 20 20 ld [ %i0 + 0x20 ], %g1 <== NOT EXECUTED Heap_Block *end = heap->last_block; bool stop = false; while ( !stop && current != end ) { 40011d70: 10 80 00 0a b 40011d98 <_Heap_Iterate+0x34> <== NOT EXECUTED 40011d74: f8 06 20 24 ld [ %i0 + 0x24 ], %i4 <== NOT EXECUTED 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 ); 40011d78: 90 10 00 01 mov %g1, %o0 <== NOT EXECUTED 40011d7c: 92 0a 7f fe and %o1, -2, %o1 <== NOT EXECUTED RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); 40011d80: ba 00 40 09 add %g1, %o1, %i5 <== NOT EXECUTED 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; 40011d84: d4 07 60 04 ld [ %i5 + 4 ], %o2 <== NOT EXECUTED 40011d88: 96 10 00 1a mov %i2, %o3 <== NOT EXECUTED 40011d8c: 9f c6 40 00 call %i1 <== NOT EXECUTED 40011d90: 94 0a a0 01 and %o2, 1, %o2 <== NOT EXECUTED 40011d94: 82 10 00 1d mov %i5, %g1 <== NOT EXECUTED { Heap_Block *current = heap->first_block; Heap_Block *end = heap->last_block; bool stop = false; while ( !stop && current != end ) { 40011d98: 80 a0 40 1c cmp %g1, %i4 <== NOT EXECUTED 40011d9c: 02 80 00 05 be 40011db0 <_Heap_Iterate+0x4c> <== NOT EXECUTED 40011da0: 90 1a 20 01 xor %o0, 1, %o0 <== NOT EXECUTED 40011da4: 80 8a 20 ff btst 0xff, %o0 <== NOT EXECUTED 40011da8: 32 bf ff f4 bne,a 40011d78 <_Heap_Iterate+0x14> <== NOT EXECUTED 40011dac: d2 00 60 04 ld [ %g1 + 4 ], %o1 <== NOT EXECUTED 40011db0: 81 c7 e0 08 ret <== NOT EXECUTED 40011db4: 81 e8 00 00 restore <== NOT EXECUTED =============================================================================== 4001a138 <_Heap_Size_of_alloc_area>: bool _Heap_Size_of_alloc_area( Heap_Control *heap, void *alloc_begin_ptr, uintptr_t *alloc_size ) { 4001a138: 9d e3 bf a0 save %sp, -96, %sp RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down( uintptr_t value, uintptr_t alignment ) { return value - (value % alignment); 4001a13c: d2 06 20 10 ld [ %i0 + 0x10 ], %o1 4001a140: 7f ff f3 fe call 40017138 <.urem> 4001a144: 90 10 00 19 mov %i1, %o0 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 4001a148: c8 06 20 20 ld [ %i0 + 0x20 ], %g4 RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down( uintptr_t value, uintptr_t alignment ) { return value - (value % alignment); 4001a14c: ba 06 7f f8 add %i1, -8, %i5 uintptr_t alloc_begin, uintptr_t page_size ) { return (Heap_Block *) (_Heap_Align_down( alloc_begin, page_size ) - HEAP_BLOCK_HEADER_SIZE); 4001a150: 90 27 40 08 sub %i5, %o0, %o0 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; 4001a154: 80 a2 00 04 cmp %o0, %g4 4001a158: 0a 80 00 05 bcs 4001a16c <_Heap_Size_of_alloc_area+0x34> 4001a15c: 82 10 20 00 clr %g1 4001a160: c2 06 20 24 ld [ %i0 + 0x24 ], %g1 4001a164: 80 a0 40 08 cmp %g1, %o0 4001a168: 82 60 3f ff subx %g0, -1, %g1 uintptr_t const alloc_begin = (uintptr_t) alloc_begin_ptr; Heap_Block *block = _Heap_Block_of_alloc_area( alloc_begin, page_size ); Heap_Block *next_block = NULL; uintptr_t block_size = 0; if ( !_Heap_Is_block_in_heap( heap, block ) ) { 4001a16c: 80 a0 60 00 cmp %g1, 0 4001a170: 02 80 00 15 be 4001a1c4 <_Heap_Size_of_alloc_area+0x8c> 4001a174: 86 10 20 00 clr %g3 - 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; 4001a178: c2 02 20 04 ld [ %o0 + 4 ], %g1 4001a17c: 82 08 7f fe and %g1, -2, %g1 RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); 4001a180: 82 02 00 01 add %o0, %g1, %g1 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; 4001a184: 80 a0 40 04 cmp %g1, %g4 4001a188: 0a 80 00 05 bcs 4001a19c <_Heap_Size_of_alloc_area+0x64> <== NEVER TAKEN 4001a18c: 84 10 20 00 clr %g2 4001a190: c4 06 20 24 ld [ %i0 + 0x24 ], %g2 4001a194: 80 a0 80 01 cmp %g2, %g1 4001a198: 84 60 3f ff subx %g0, -1, %g2 } block_size = _Heap_Block_size( block ); next_block = _Heap_Block_at( block, block_size ); if ( 4001a19c: 80 a0 a0 00 cmp %g2, 0 4001a1a0: 02 80 00 09 be 4001a1c4 <_Heap_Size_of_alloc_area+0x8c> <== NEVER TAKEN 4001a1a4: 86 10 20 00 clr %g3 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; 4001a1a8: c4 00 60 04 ld [ %g1 + 4 ], %g2 !_Heap_Is_block_in_heap( heap, next_block ) || !_Heap_Is_prev_used( next_block ) 4001a1ac: 80 88 a0 01 btst 1, %g2 4001a1b0: 02 80 00 05 be 4001a1c4 <_Heap_Size_of_alloc_area+0x8c> <== NEVER TAKEN 4001a1b4: 82 20 40 19 sub %g1, %i1, %g1 return false; } *alloc_size = (uintptr_t) next_block + HEAP_ALLOC_BONUS - alloc_begin; return true; 4001a1b8: 86 10 20 01 mov 1, %g3 || !_Heap_Is_prev_used( next_block ) ) { return false; } *alloc_size = (uintptr_t) next_block + HEAP_ALLOC_BONUS - alloc_begin; 4001a1bc: 82 00 60 04 add %g1, 4, %g1 4001a1c0: c2 26 80 00 st %g1, [ %i2 ] return true; } 4001a1c4: b0 08 e0 01 and %g3, 1, %i0 4001a1c8: 81 c7 e0 08 ret 4001a1cc: 81 e8 00 00 restore =============================================================================== 40008bfc <_Heap_Walk>: bool _Heap_Walk( Heap_Control *heap, int source, bool dump ) { 40008bfc: 9d e3 bf 80 save %sp, -128, %sp 40008c00: ac 10 00 19 mov %i1, %l6 uintptr_t const page_size = heap->page_size; 40008c04: f8 06 20 10 ld [ %i0 + 0x10 ], %i4 uintptr_t const min_block_size = heap->min_block_size; 40008c08: f6 06 20 14 ld [ %i0 + 0x14 ], %i3 Heap_Block *const first_block = heap->first_block; 40008c0c: f2 06 20 20 ld [ %i0 + 0x20 ], %i1 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; 40008c10: 80 a6 a0 00 cmp %i2, 0 40008c14: 02 80 00 05 be 40008c28 <_Heap_Walk+0x2c> 40008c18: e0 06 20 24 ld [ %i0 + 0x24 ], %l0 40008c1c: 3b 10 00 22 sethi %hi(0x40008800), %i5 40008c20: 10 80 00 04 b 40008c30 <_Heap_Walk+0x34> 40008c24: ba 17 63 ac or %i5, 0x3ac, %i5 ! 40008bac <_Heap_Walk_print> 40008c28: 3b 10 00 22 sethi %hi(0x40008800), %i5 40008c2c: ba 17 63 a4 or %i5, 0x3a4, %i5 ! 40008ba4 <_Heap_Walk_print_nothing> if ( !_System_state_Is_up( _System_state_Get() ) ) { 40008c30: 05 10 00 5d sethi %hi(0x40017400), %g2 40008c34: c4 00 a0 6c ld [ %g2 + 0x6c ], %g2 ! 4001746c <_System_state_Current> 40008c38: 80 a0 a0 03 cmp %g2, 3 40008c3c: 22 80 00 04 be,a 40008c4c <_Heap_Walk+0x50> 40008c40: c4 06 20 1c ld [ %i0 + 0x1c ], %g2 return true; 40008c44: 10 80 01 2a b 400090ec <_Heap_Walk+0x4f0> 40008c48: b0 10 20 01 mov 1, %i0 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)( 40008c4c: da 06 20 18 ld [ %i0 + 0x18 ], %o5 40008c50: c4 23 a0 5c st %g2, [ %sp + 0x5c ] 40008c54: f2 23 a0 60 st %i1, [ %sp + 0x60 ] 40008c58: e0 23 a0 64 st %l0, [ %sp + 0x64 ] 40008c5c: c4 06 20 08 ld [ %i0 + 8 ], %g2 40008c60: 90 10 00 16 mov %l6, %o0 40008c64: c4 23 a0 68 st %g2, [ %sp + 0x68 ] 40008c68: c4 06 20 0c ld [ %i0 + 0xc ], %g2 40008c6c: 92 10 20 00 clr %o1 40008c70: c4 23 a0 6c st %g2, [ %sp + 0x6c ] 40008c74: 15 10 00 52 sethi %hi(0x40014800), %o2 40008c78: 96 10 00 1c mov %i4, %o3 40008c7c: 94 12 a3 60 or %o2, 0x360, %o2 40008c80: 9f c7 40 00 call %i5 40008c84: 98 10 00 1b mov %i3, %o4 heap->area_begin, heap->area_end, first_block, last_block, first_free_block, last_free_block ); if ( page_size == 0 ) { 40008c88: 80 a7 20 00 cmp %i4, 0 40008c8c: 12 80 00 07 bne 40008ca8 <_Heap_Walk+0xac> 40008c90: 80 8f 20 07 btst 7, %i4 (*printer)( source, true, "page size is zero\n" ); 40008c94: 15 10 00 52 sethi %hi(0x40014800), %o2 40008c98: 90 10 00 16 mov %l6, %o0 40008c9c: 92 10 20 01 mov 1, %o1 40008ca0: 10 80 00 37 b 40008d7c <_Heap_Walk+0x180> 40008ca4: 94 12 a3 f8 or %o2, 0x3f8, %o2 return false; } if ( !_Addresses_Is_aligned( (void *) page_size ) ) { 40008ca8: 22 80 00 08 be,a 40008cc8 <_Heap_Walk+0xcc> 40008cac: 90 10 00 1b mov %i3, %o0 (*printer)( 40008cb0: 15 10 00 53 sethi %hi(0x40014c00), %o2 40008cb4: 90 10 00 16 mov %l6, %o0 40008cb8: 92 10 20 01 mov 1, %o1 40008cbc: 94 12 a0 10 or %o2, 0x10, %o2 40008cc0: 10 80 01 12 b 40009108 <_Heap_Walk+0x50c> 40008cc4: 96 10 00 1c mov %i4, %o3 RTEMS_INLINE_ROUTINE bool _Heap_Is_aligned( uintptr_t value, uintptr_t alignment ) { return (value % alignment) == 0; 40008cc8: 7f ff e3 af call 40001b84 <.urem> 40008ccc: 92 10 00 1c mov %i4, %o1 ); return false; } if ( !_Heap_Is_aligned( min_block_size, page_size ) ) { 40008cd0: 80 a2 20 00 cmp %o0, 0 40008cd4: 22 80 00 08 be,a 40008cf4 <_Heap_Walk+0xf8> 40008cd8: 90 06 60 08 add %i1, 8, %o0 (*printer)( 40008cdc: 15 10 00 53 sethi %hi(0x40014c00), %o2 40008ce0: 90 10 00 16 mov %l6, %o0 40008ce4: 92 10 20 01 mov 1, %o1 40008ce8: 94 12 a0 30 or %o2, 0x30, %o2 40008cec: 10 80 01 07 b 40009108 <_Heap_Walk+0x50c> 40008cf0: 96 10 00 1b mov %i3, %o3 40008cf4: 7f ff e3 a4 call 40001b84 <.urem> 40008cf8: 92 10 00 1c mov %i4, %o1 ); return false; } if ( 40008cfc: 80 a2 20 00 cmp %o0, 0 40008d00: 22 80 00 07 be,a 40008d1c <_Heap_Walk+0x120> 40008d04: c4 06 60 04 ld [ %i1 + 4 ], %g2 !_Heap_Is_aligned( _Heap_Alloc_area_of_block( first_block ), page_size ) ) { (*printer)( 40008d08: 15 10 00 53 sethi %hi(0x40014c00), %o2 40008d0c: 90 10 00 16 mov %l6, %o0 40008d10: 92 10 20 01 mov 1, %o1 40008d14: 10 80 00 fc b 40009104 <_Heap_Walk+0x508> 40008d18: 94 12 a0 58 or %o2, 0x58, %o2 ); return false; } if ( !_Heap_Is_prev_used( first_block ) ) { 40008d1c: 80 88 a0 01 btst 1, %g2 40008d20: 32 80 00 07 bne,a 40008d3c <_Heap_Walk+0x140> 40008d24: f4 04 20 04 ld [ %l0 + 4 ], %i2 (*printer)( 40008d28: 15 10 00 53 sethi %hi(0x40014c00), %o2 40008d2c: 90 10 00 16 mov %l6, %o0 40008d30: 92 10 20 01 mov 1, %o1 40008d34: 10 80 00 12 b 40008d7c <_Heap_Walk+0x180> 40008d38: 94 12 a0 90 or %o2, 0x90, %o2 - 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; 40008d3c: b4 0e bf fe and %i2, -2, %i2 RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); 40008d40: b4 04 00 1a add %l0, %i2, %i2 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; 40008d44: c4 06 a0 04 ld [ %i2 + 4 ], %g2 ); return false; } if ( _Heap_Is_free( last_block ) ) { 40008d48: 80 88 a0 01 btst 1, %g2 40008d4c: 12 80 00 07 bne 40008d68 <_Heap_Walk+0x16c> 40008d50: 80 a6 80 19 cmp %i2, %i1 (*printer)( 40008d54: 15 10 00 53 sethi %hi(0x40014c00), %o2 40008d58: 90 10 00 16 mov %l6, %o0 40008d5c: 92 10 20 01 mov 1, %o1 40008d60: 10 80 00 07 b 40008d7c <_Heap_Walk+0x180> 40008d64: 94 12 a0 c0 or %o2, 0xc0, %o2 ); return false; } if ( 40008d68: 02 80 00 0a be 40008d90 <_Heap_Walk+0x194> 40008d6c: 15 10 00 53 sethi %hi(0x40014c00), %o2 _Heap_Block_at( last_block, _Heap_Block_size( last_block ) ) != first_block ) { (*printer)( 40008d70: 90 10 00 16 mov %l6, %o0 40008d74: 92 10 20 01 mov 1, %o1 40008d78: 94 12 a0 d8 or %o2, 0xd8, %o2 40008d7c: 9f c7 40 00 call %i5 40008d80: b0 10 20 00 clr %i0 40008d84: b0 0e 20 ff and %i0, 0xff, %i0 40008d88: 81 c7 e0 08 ret 40008d8c: 81 e8 00 00 restore int source, Heap_Walk_printer printer, Heap_Control *heap ) { uintptr_t const page_size = heap->page_size; 40008d90: e2 06 20 10 ld [ %i0 + 0x10 ], %l1 return &heap->free_list; } RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Free_list_first( Heap_Control *heap ) { return _Heap_Free_list_head(heap)->next; 40008d94: d6 06 20 08 ld [ %i0 + 8 ], %o3 const Heap_Block *const free_list_tail = _Heap_Free_list_tail( heap ); 40008d98: 10 80 00 30 b 40008e58 <_Heap_Walk+0x25c> 40008d9c: b2 10 00 18 mov %i0, %i1 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; 40008da0: 80 a0 c0 0b cmp %g3, %o3 40008da4: 18 80 00 05 bgu 40008db8 <_Heap_Walk+0x1bc> 40008da8: 84 10 20 00 clr %g2 40008dac: c4 06 20 24 ld [ %i0 + 0x24 ], %g2 40008db0: 80 a0 80 0b cmp %g2, %o3 40008db4: 84 60 3f ff subx %g0, -1, %g2 const Heap_Block *const first_free_block = _Heap_Free_list_first( heap ); const Heap_Block *prev_block = free_list_tail; const Heap_Block *free_block = first_free_block; while ( free_block != free_list_tail ) { if ( !_Heap_Is_block_in_heap( heap, free_block ) ) { 40008db8: 80 a0 a0 00 cmp %g2, 0 40008dbc: 32 80 00 07 bne,a 40008dd8 <_Heap_Walk+0x1dc> 40008dc0: 90 02 e0 08 add %o3, 8, %o0 (*printer)( 40008dc4: 15 10 00 53 sethi %hi(0x40014c00), %o2 40008dc8: 90 10 00 16 mov %l6, %o0 40008dcc: 92 10 20 01 mov 1, %o1 40008dd0: 10 80 00 ce b 40009108 <_Heap_Walk+0x50c> 40008dd4: 94 12 a1 08 or %o2, 0x108, %o2 RTEMS_INLINE_ROUTINE bool _Heap_Is_aligned( uintptr_t value, uintptr_t alignment ) { return (value % alignment) == 0; 40008dd8: d6 27 bf fc st %o3, [ %fp + -4 ] 40008ddc: 7f ff e3 6a call 40001b84 <.urem> 40008de0: 92 10 00 11 mov %l1, %o1 ); return false; } if ( 40008de4: 80 a2 20 00 cmp %o0, 0 40008de8: 02 80 00 07 be 40008e04 <_Heap_Walk+0x208> 40008dec: d6 07 bf fc ld [ %fp + -4 ], %o3 !_Heap_Is_aligned( _Heap_Alloc_area_of_block( free_block ), page_size ) ) { (*printer)( 40008df0: 15 10 00 53 sethi %hi(0x40014c00), %o2 40008df4: 90 10 00 16 mov %l6, %o0 40008df8: 92 10 20 01 mov 1, %o1 40008dfc: 10 80 00 c3 b 40009108 <_Heap_Walk+0x50c> 40008e00: 94 12 a1 28 or %o2, 0x128, %o2 - 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; 40008e04: c4 02 e0 04 ld [ %o3 + 4 ], %g2 40008e08: 84 08 bf fe and %g2, -2, %g2 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; 40008e0c: 84 02 c0 02 add %o3, %g2, %g2 40008e10: c4 00 a0 04 ld [ %g2 + 4 ], %g2 ); return false; } if ( _Heap_Is_used( free_block ) ) { 40008e14: 80 88 a0 01 btst 1, %g2 40008e18: 22 80 00 07 be,a 40008e34 <_Heap_Walk+0x238> 40008e1c: d8 02 e0 0c ld [ %o3 + 0xc ], %o4 (*printer)( 40008e20: 15 10 00 53 sethi %hi(0x40014c00), %o2 40008e24: 90 10 00 16 mov %l6, %o0 40008e28: 92 10 20 01 mov 1, %o1 40008e2c: 10 80 00 b7 b 40009108 <_Heap_Walk+0x50c> 40008e30: 94 12 a1 58 or %o2, 0x158, %o2 ); return false; } if ( free_block->prev != prev_block ) { 40008e34: 80 a3 00 19 cmp %o4, %i1 40008e38: 02 80 00 07 be 40008e54 <_Heap_Walk+0x258> 40008e3c: b2 10 00 0b mov %o3, %i1 (*printer)( 40008e40: 15 10 00 53 sethi %hi(0x40014c00), %o2 40008e44: 90 10 00 16 mov %l6, %o0 40008e48: 92 10 20 01 mov 1, %o1 40008e4c: 10 80 00 4d b 40008f80 <_Heap_Walk+0x384> 40008e50: 94 12 a1 78 or %o2, 0x178, %o2 return false; } prev_block = free_block; free_block = free_block->next; 40008e54: d6 02 e0 08 ld [ %o3 + 8 ], %o3 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 ) { 40008e58: 80 a2 c0 18 cmp %o3, %i0 40008e5c: 32 bf ff d1 bne,a 40008da0 <_Heap_Walk+0x1a4> 40008e60: c6 06 20 20 ld [ %i0 + 0x20 ], %g3 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)( 40008e64: 2b 10 00 53 sethi %hi(0x40014c00), %l5 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 ) { 40008e68: b2 10 00 1a mov %i2, %i1 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)( 40008e6c: aa 15 62 78 or %l5, 0x278, %l5 " (= first free)" : (block->prev == free_list_head ? " (= head)" : ""), block->next, block->next == last_free_block ? " (= last free)" : (block->next == free_list_tail ? " (= tail)" : "") 40008e70: 23 10 00 53 sethi %hi(0x40014c00), %l1 40008e74: 2f 10 00 52 sethi %hi(0x40014800), %l7 - 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; 40008e78: e4 06 60 04 ld [ %i1 + 4 ], %l2 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; 40008e7c: d8 06 20 20 ld [ %i0 + 0x20 ], %o4 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; 40008e80: 9e 1e 40 10 xor %i1, %l0, %o7 40008e84: 80 a0 00 0f cmp %g0, %o7 - 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; 40008e88: a8 0c bf fe and %l2, -2, %l4 40008e8c: 9a 40 20 00 addx %g0, 0, %o5 RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); 40008e90: a6 06 40 14 add %i1, %l4, %l3 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; 40008e94: a4 0c a0 01 and %l2, 1, %l2 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; 40008e98: 80 a3 00 13 cmp %o4, %l3 40008e9c: 18 80 00 05 bgu 40008eb0 <_Heap_Walk+0x2b4> <== NEVER TAKEN 40008ea0: 9e 10 20 00 clr %o7 40008ea4: de 06 20 24 ld [ %i0 + 0x24 ], %o7 40008ea8: 80 a3 c0 13 cmp %o7, %l3 40008eac: 9e 60 3f ff subx %g0, -1, %o7 if ( !_Heap_Is_block_in_heap( heap, next_block ) ) { 40008eb0: 80 a3 e0 00 cmp %o7, 0 40008eb4: 32 80 00 07 bne,a 40008ed0 <_Heap_Walk+0x2d4> 40008eb8: da 27 bf f8 st %o5, [ %fp + -8 ] (*printer)( 40008ebc: 15 10 00 53 sethi %hi(0x40014c00), %o2 40008ec0: 90 10 00 16 mov %l6, %o0 40008ec4: 92 10 20 01 mov 1, %o1 40008ec8: 10 80 00 2c b 40008f78 <_Heap_Walk+0x37c> 40008ecc: 94 12 a1 b0 or %o2, 0x1b0, %o2 RTEMS_INLINE_ROUTINE bool _Heap_Is_aligned( uintptr_t value, uintptr_t alignment ) { return (value % alignment) == 0; 40008ed0: 90 10 00 14 mov %l4, %o0 40008ed4: 7f ff e3 2c call 40001b84 <.urem> 40008ed8: 92 10 00 1c mov %i4, %o1 40008edc: da 07 bf f8 ld [ %fp + -8 ], %o5 ); return false; } if ( !_Heap_Is_aligned( block_size, page_size ) && is_not_last_block ) { 40008ee0: 80 a2 20 00 cmp %o0, 0 40008ee4: 02 80 00 0c be 40008f14 <_Heap_Walk+0x318> 40008ee8: 9e 0b 60 ff and %o5, 0xff, %o7 40008eec: 80 a3 e0 00 cmp %o7, 0 40008ef0: 02 80 00 19 be 40008f54 <_Heap_Walk+0x358> 40008ef4: 80 a6 40 13 cmp %i1, %l3 (*printer)( 40008ef8: 15 10 00 53 sethi %hi(0x40014c00), %o2 40008efc: 90 10 00 16 mov %l6, %o0 40008f00: 92 10 20 01 mov 1, %o1 40008f04: 94 12 a1 e0 or %o2, 0x1e0, %o2 40008f08: 96 10 00 19 mov %i1, %o3 40008f0c: 10 80 00 1d b 40008f80 <_Heap_Walk+0x384> 40008f10: 98 10 00 14 mov %l4, %o4 ); return false; } if ( block_size < min_block_size && is_not_last_block ) { 40008f14: 80 a3 e0 00 cmp %o7, 0 40008f18: 02 80 00 0f be 40008f54 <_Heap_Walk+0x358> 40008f1c: 80 a6 40 13 cmp %i1, %l3 40008f20: 80 a5 00 1b cmp %l4, %i3 40008f24: 1a 80 00 0c bcc 40008f54 <_Heap_Walk+0x358> 40008f28: 80 a6 40 13 cmp %i1, %l3 (*printer)( 40008f2c: 90 10 00 16 mov %l6, %o0 40008f30: 92 10 20 01 mov 1, %o1 40008f34: 15 10 00 53 sethi %hi(0x40014c00), %o2 40008f38: 96 10 00 19 mov %i1, %o3 40008f3c: 94 12 a2 10 or %o2, 0x210, %o2 40008f40: 98 10 00 14 mov %l4, %o4 40008f44: 9f c7 40 00 call %i5 40008f48: 9a 10 00 1b mov %i3, %o5 "block 0x%08x: next block 0x%08x is not a successor\n", block, next_block ); return false; 40008f4c: 10 80 00 68 b 400090ec <_Heap_Walk+0x4f0> 40008f50: b0 10 20 00 clr %i0 ); return false; } if ( next_block_begin <= block_begin && is_not_last_block ) { 40008f54: 2a 80 00 10 bcs,a 40008f94 <_Heap_Walk+0x398> 40008f58: de 04 e0 04 ld [ %l3 + 4 ], %o7 40008f5c: 80 8b 60 ff btst 0xff, %o5 40008f60: 22 80 00 0d be,a 40008f94 <_Heap_Walk+0x398> 40008f64: de 04 e0 04 ld [ %l3 + 4 ], %o7 (*printer)( 40008f68: 15 10 00 53 sethi %hi(0x40014c00), %o2 40008f6c: 90 10 00 16 mov %l6, %o0 40008f70: 92 10 20 01 mov 1, %o1 40008f74: 94 12 a2 40 or %o2, 0x240, %o2 40008f78: 96 10 00 19 mov %i1, %o3 40008f7c: 98 10 00 13 mov %l3, %o4 40008f80: 9f c7 40 00 call %i5 40008f84: b0 10 20 00 clr %i0 40008f88: b0 0e 20 ff and %i0, 0xff, %i0 40008f8c: 81 c7 e0 08 ret 40008f90: 81 e8 00 00 restore ); return false; } if ( !_Heap_Is_prev_used( next_block ) ) { 40008f94: 80 8b e0 01 btst 1, %o7 40008f98: 12 80 00 3f bne 40009094 <_Heap_Walk+0x498> 40008f9c: 90 10 00 16 mov %l6, %o0 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 ? 40008fa0: da 06 60 0c ld [ %i1 + 0xc ], %o5 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)( 40008fa4: d8 06 20 08 ld [ %i0 + 8 ], %o4 40008fa8: 80 a3 40 0c cmp %o5, %o4 40008fac: 02 80 00 08 be 40008fcc <_Heap_Walk+0x3d0> 40008fb0: de 06 20 0c ld [ %i0 + 0xc ], %o7 block, block_size, block->prev, block->prev == first_free_block ? " (= first free)" : (block->prev == free_list_head ? " (= head)" : ""), 40008fb4: 80 a3 40 18 cmp %o5, %i0 40008fb8: 12 80 00 07 bne 40008fd4 <_Heap_Walk+0x3d8> 40008fbc: 96 14 62 e8 or %l1, 0x2e8, %o3 40008fc0: 17 10 00 52 sethi %hi(0x40014800), %o3 40008fc4: 10 80 00 04 b 40008fd4 <_Heap_Walk+0x3d8> 40008fc8: 96 12 e3 30 or %o3, 0x330, %o3 ! 40014b30 <__log2table+0x130> 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)( 40008fcc: 03 10 00 52 sethi %hi(0x40014800), %g1 40008fd0: 96 10 63 20 or %g1, 0x320, %o3 ! 40014b20 <__log2table+0x120> block->prev, block->prev == first_free_block ? " (= first free)" : (block->prev == free_list_head ? " (= head)" : ""), block->next, block->next == last_free_block ? 40008fd4: d8 06 60 08 ld [ %i1 + 8 ], %o4 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)( 40008fd8: 80 a3 00 0f cmp %o4, %o7 40008fdc: 02 80 00 06 be 40008ff4 <_Heap_Walk+0x3f8> 40008fe0: 80 a3 00 18 cmp %o4, %i0 " (= first free)" : (block->prev == free_list_head ? " (= head)" : ""), block->next, block->next == last_free_block ? " (= last free)" : (block->next == free_list_tail ? " (= tail)" : "") 40008fe4: 12 80 00 06 bne 40008ffc <_Heap_Walk+0x400> 40008fe8: 9e 14 62 e8 or %l1, 0x2e8, %o7 40008fec: 10 80 00 04 b 40008ffc <_Heap_Walk+0x400> 40008ff0: 9e 15 e3 50 or %l7, 0x350, %o7 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)( 40008ff4: 03 10 00 52 sethi %hi(0x40014800), %g1 40008ff8: 9e 10 63 40 or %g1, 0x340, %o7 ! 40014b40 <__log2table+0x140> 40008ffc: d6 23 a0 5c st %o3, [ %sp + 0x5c ] 40009000: d8 23 a0 60 st %o4, [ %sp + 0x60 ] 40009004: de 23 a0 64 st %o7, [ %sp + 0x64 ] 40009008: 90 10 00 16 mov %l6, %o0 4000900c: 92 10 20 00 clr %o1 40009010: 94 10 00 15 mov %l5, %o2 40009014: 96 10 00 19 mov %i1, %o3 40009018: 9f c7 40 00 call %i5 4000901c: 98 10 00 14 mov %l4, %o4 block->next == last_free_block ? " (= last free)" : (block->next == free_list_tail ? " (= tail)" : "") ); if ( block_size != next_block->prev_size ) { 40009020: da 04 c0 00 ld [ %l3 ], %o5 40009024: 80 a5 00 0d cmp %l4, %o5 40009028: 02 80 00 0c be 40009058 <_Heap_Walk+0x45c> 4000902c: 80 a4 a0 00 cmp %l2, 0 (*printer)( 40009030: e6 23 a0 5c st %l3, [ %sp + 0x5c ] 40009034: 90 10 00 16 mov %l6, %o0 40009038: 92 10 20 01 mov 1, %o1 4000903c: 15 10 00 53 sethi %hi(0x40014c00), %o2 40009040: 96 10 00 19 mov %i1, %o3 40009044: 94 12 a2 b0 or %o2, 0x2b0, %o2 40009048: 9f c7 40 00 call %i5 4000904c: 98 10 00 14 mov %l4, %o4 "block 0x%08x: next block 0x%08x is not a successor\n", block, next_block ); return false; 40009050: 10 bf ff ce b 40008f88 <_Heap_Walk+0x38c> 40009054: b0 10 20 00 clr %i0 ); return false; } if ( !prev_used ) { 40009058: 32 80 00 0a bne,a 40009080 <_Heap_Walk+0x484> 4000905c: c6 06 20 08 ld [ %i0 + 8 ], %g3 (*printer)( 40009060: 15 10 00 53 sethi %hi(0x40014c00), %o2 40009064: 90 10 00 16 mov %l6, %o0 40009068: 92 10 20 01 mov 1, %o1 4000906c: 10 80 00 26 b 40009104 <_Heap_Walk+0x508> 40009070: 94 12 a2 f0 or %o2, 0x2f0, %o2 { const Heap_Block *const free_list_tail = _Heap_Free_list_tail( heap ); const Heap_Block *free_block = _Heap_Free_list_first( heap ); while ( free_block != free_list_tail ) { if ( free_block == block ) { 40009074: 22 80 00 19 be,a 400090d8 <_Heap_Walk+0x4dc> 40009078: b2 10 00 13 mov %l3, %i1 return true; } free_block = free_block->next; 4000907c: c6 00 e0 08 ld [ %g3 + 8 ], %g3 ) { 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 ) { 40009080: 80 a0 c0 18 cmp %g3, %i0 40009084: 12 bf ff fc bne 40009074 <_Heap_Walk+0x478> 40009088: 80 a0 c0 19 cmp %g3, %i1 return false; } if ( !_Heap_Walk_is_in_free_list( heap, block ) ) { (*printer)( 4000908c: 10 80 00 1b b 400090f8 <_Heap_Walk+0x4fc> 40009090: 15 10 00 53 sethi %hi(0x40014c00), %o2 if ( !_Heap_Is_prev_used( next_block ) ) { if ( !_Heap_Walk_check_free_block( source, printer, heap, block ) ) { return false; } } else if (prev_used) { 40009094: 80 a4 a0 00 cmp %l2, 0 40009098: 02 80 00 09 be 400090bc <_Heap_Walk+0x4c0> 4000909c: 92 10 20 00 clr %o1 (*printer)( 400090a0: 15 10 00 53 sethi %hi(0x40014c00), %o2 400090a4: 96 10 00 19 mov %i1, %o3 400090a8: 94 12 a3 20 or %o2, 0x320, %o2 400090ac: 9f c7 40 00 call %i5 400090b0: 98 10 00 14 mov %l4, %o4 400090b4: 10 80 00 09 b 400090d8 <_Heap_Walk+0x4dc> 400090b8: b2 10 00 13 mov %l3, %i1 "block 0x%08x: size %u\n", block, block_size ); } else { (*printer)( 400090bc: da 06 40 00 ld [ %i1 ], %o5 400090c0: 15 10 00 53 sethi %hi(0x40014c00), %o2 400090c4: 96 10 00 19 mov %i1, %o3 400090c8: 94 12 a3 38 or %o2, 0x338, %o2 400090cc: 9f c7 40 00 call %i5 400090d0: 98 10 00 14 mov %l4, %o4 400090d4: b2 10 00 13 mov %l3, %i1 block->prev_size ); } block = next_block; } while ( block != first_block ); 400090d8: 80 a4 c0 1a cmp %l3, %i2 400090dc: 32 bf ff 68 bne,a 40008e7c <_Heap_Walk+0x280> 400090e0: e4 06 60 04 ld [ %i1 + 4 ], %l2 400090e4: 10 80 00 02 b 400090ec <_Heap_Walk+0x4f0> 400090e8: b0 10 20 01 mov 1, %i0 400090ec: b0 0e 20 ff and %i0, 0xff, %i0 400090f0: 81 c7 e0 08 ret 400090f4: 81 e8 00 00 restore return false; } if ( !_Heap_Walk_is_in_free_list( heap, block ) ) { (*printer)( 400090f8: 90 10 00 16 mov %l6, %o0 400090fc: 92 10 20 01 mov 1, %o1 40009100: 94 12 a3 60 or %o2, 0x360, %o2 40009104: 96 10 00 19 mov %i1, %o3 40009108: 9f c7 40 00 call %i5 4000910c: b0 10 20 00 clr %i0 40009110: b0 0e 20 ff and %i0, 0xff, %i0 40009114: 81 c7 e0 08 ret 40009118: 81 e8 00 00 restore =============================================================================== 40008338 <_Internal_error_Occurred>: void _Internal_error_Occurred( Internal_errors_Source the_source, bool is_internal, Internal_errors_t the_error ) { 40008338: 9d e3 bf 90 save %sp, -112, %sp Internal_errors_t error ) { User_extensions_Fatal_context ctx = { source, is_internal, error }; _User_extensions_Iterate( &ctx, _User_extensions_Fatal_visitor ); 4000833c: 13 10 00 28 sethi %hi(0x4000a000), %o1 40008340: 90 07 bf f4 add %fp, -12, %o0 40008344: 92 12 62 5c or %o1, 0x25c, %o1 Internal_errors_Source source, bool is_internal, Internal_errors_t error ) { User_extensions_Fatal_context ctx = { source, is_internal, error }; 40008348: f0 27 bf f4 st %i0, [ %fp + -12 ] 4000834c: f2 2f bf f8 stb %i1, [ %fp + -8 ] _User_extensions_Iterate( &ctx, _User_extensions_Fatal_visitor ); 40008350: 40 00 07 ce call 4000a288 <_User_extensions_Iterate> 40008354: f4 27 bf fc st %i2, [ %fp + -4 ] _User_extensions_Fatal( the_source, is_internal, the_error ); _Internal_errors_What_happened.the_source = the_source; 40008358: 05 10 00 73 sethi %hi(0x4001cc00), %g2 <== NOT EXECUTED 4000835c: 82 10 a2 b0 or %g2, 0x2b0, %g1 ! 4001ceb0 <_Internal_errors_What_happened><== NOT EXECUTED 40008360: f0 20 a2 b0 st %i0, [ %g2 + 0x2b0 ] <== NOT EXECUTED _Internal_errors_What_happened.is_internal = is_internal; 40008364: f2 28 60 04 stb %i1, [ %g1 + 4 ] <== NOT EXECUTED _Internal_errors_What_happened.the_error = the_error; 40008368: f4 20 60 08 st %i2, [ %g1 + 8 ] <== NOT EXECUTED RTEMS_INLINE_ROUTINE void _System_state_Set ( System_state_Codes state ) { _System_state_Current = state; 4000836c: 84 10 20 05 mov 5, %g2 <== NOT EXECUTED 40008370: 03 10 00 73 sethi %hi(0x4001cc00), %g1 <== NOT EXECUTED _System_state_Set( SYSTEM_STATE_FAILED ); _CPU_Fatal_halt( the_error ); 40008374: 7f ff e7 4d call 400020a8 <== NOT EXECUTED 40008378: c4 20 62 bc st %g2, [ %g1 + 0x2bc ] ! 4001cebc <_System_state_Current><== NOT EXECUTED 4000837c: 82 10 00 08 mov %o0, %g1 <== NOT EXECUTED 40008380: 30 80 00 00 b,a 40008380 <_Internal_error_Occurred+0x48> <== NOT EXECUTED =============================================================================== 400083ec <_Objects_Allocate>: #endif Objects_Control *_Objects_Allocate( Objects_Information *information ) { 400083ec: 9d e3 bf a0 save %sp, -96, %sp * 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 ) 400083f0: c2 06 20 18 ld [ %i0 + 0x18 ], %g1 400083f4: 80 a0 60 00 cmp %g1, 0 400083f8: 12 80 00 04 bne 40008408 <_Objects_Allocate+0x1c> <== ALWAYS TAKEN 400083fc: ba 10 00 18 mov %i0, %i5 return NULL; 40008400: 81 c7 e0 08 ret 40008404: 91 e8 20 00 restore %g0, 0, %o0 /* * 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 ); 40008408: b8 06 20 20 add %i0, 0x20, %i4 4000840c: 7f ff fd 85 call 40007a20 <_Chain_Get> 40008410: 90 10 00 1c mov %i4, %o0 if ( information->auto_extend ) { 40008414: c2 0f 60 12 ldub [ %i5 + 0x12 ], %g1 40008418: 80 a0 60 00 cmp %g1, 0 4000841c: 02 80 00 1d be 40008490 <_Objects_Allocate+0xa4> 40008420: b0 10 00 08 mov %o0, %i0 /* * If the list is empty then we are out of objects and need to * extend information base. */ if ( !the_object ) { 40008424: 80 a2 20 00 cmp %o0, 0 40008428: 32 80 00 0a bne,a 40008450 <_Objects_Allocate+0x64> 4000842c: c4 07 60 08 ld [ %i5 + 8 ], %g2 _Objects_Extend_information( information ); 40008430: 40 00 00 21 call 400084b4 <_Objects_Extend_information> 40008434: 90 10 00 1d mov %i5, %o0 the_object = (Objects_Control *) _Chain_Get( &information->Inactive ); 40008438: 7f ff fd 7a call 40007a20 <_Chain_Get> 4000843c: 90 10 00 1c mov %i4, %o0 } if ( the_object ) { 40008440: b0 92 20 00 orcc %o0, 0, %i0 40008444: 02 bf ff ef be 40008400 <_Objects_Allocate+0x14> 40008448: 01 00 00 00 nop uint32_t block; block = (uint32_t) _Objects_Get_index( the_object->id ) - 4000844c: c4 07 60 08 ld [ %i5 + 8 ], %g2 40008450: d0 06 20 08 ld [ %i0 + 8 ], %o0 _Objects_Get_index( information->minimum_id ); block /= information->allocation_size; 40008454: d2 17 60 14 lduh [ %i5 + 0x14 ], %o1 } if ( the_object ) { uint32_t block; block = (uint32_t) _Objects_Get_index( the_object->id ) - 40008458: 03 00 00 3f sethi %hi(0xfc00), %g1 4000845c: 82 10 63 ff or %g1, 0x3ff, %g1 ! ffff 40008460: 90 0a 00 01 and %o0, %g1, %o0 40008464: 82 08 80 01 and %g2, %g1, %g1 _Objects_Get_index( information->minimum_id ); block /= information->allocation_size; 40008468: 40 00 3a 88 call 40016e88 <.udiv> 4000846c: 90 22 00 01 sub %o0, %g1, %o0 information->inactive_per_block[ block ]--; 40008470: c2 07 60 30 ld [ %i5 + 0x30 ], %g1 40008474: 91 2a 20 02 sll %o0, 2, %o0 40008478: c4 00 40 08 ld [ %g1 + %o0 ], %g2 4000847c: 84 00 bf ff add %g2, -1, %g2 40008480: c4 20 40 08 st %g2, [ %g1 + %o0 ] information->inactive--; 40008484: c2 17 60 2c lduh [ %i5 + 0x2c ], %g1 40008488: 82 00 7f ff add %g1, -1, %g1 4000848c: c2 37 60 2c sth %g1, [ %i5 + 0x2c ] ); } #endif return the_object; } 40008490: 81 c7 e0 08 ret 40008494: 81 e8 00 00 restore =============================================================================== 4000881c <_Objects_Get_information>: Objects_Information *_Objects_Get_information( Objects_APIs the_api, uint16_t the_class ) { 4000881c: 9d e3 bf a0 save %sp, -96, %sp Objects_Information *info; int the_class_api_maximum; if ( !the_class ) 40008820: 80 a6 60 00 cmp %i1, 0 40008824: 12 80 00 04 bne 40008834 <_Objects_Get_information+0x18> 40008828: 01 00 00 00 nop return NULL; 4000882c: 81 c7 e0 08 ret 40008830: 91 e8 20 00 restore %g0, 0, %o0 /* * 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 ); 40008834: 40 00 0f 32 call 4000c4fc <_Objects_API_maximum_class> 40008838: 90 10 00 18 mov %i0, %o0 if ( the_class_api_maximum == 0 ) 4000883c: 80 a2 20 00 cmp %o0, 0 40008840: 02 bf ff fb be 4000882c <_Objects_Get_information+0x10> 40008844: 80 a6 40 08 cmp %i1, %o0 return NULL; if ( the_class > (uint32_t) the_class_api_maximum ) 40008848: 18 bf ff f9 bgu 4000882c <_Objects_Get_information+0x10> 4000884c: 03 10 00 73 sethi %hi(0x4001cc00), %g1 return NULL; if ( !_Objects_Information_table[ the_api ] ) 40008850: b1 2e 20 02 sll %i0, 2, %i0 40008854: 82 10 60 24 or %g1, 0x24, %g1 40008858: c2 00 40 18 ld [ %g1 + %i0 ], %g1 4000885c: 80 a0 60 00 cmp %g1, 0 40008860: 02 bf ff f3 be 4000882c <_Objects_Get_information+0x10> <== NEVER TAKEN 40008864: b3 2e 60 02 sll %i1, 2, %i1 return NULL; info = _Objects_Information_table[ the_api ][ the_class ]; 40008868: f0 00 40 19 ld [ %g1 + %i1 ], %i0 if ( !info ) 4000886c: 80 a6 20 00 cmp %i0, 0 40008870: 02 bf ff ef be 4000882c <_Objects_Get_information+0x10> <== NEVER TAKEN 40008874: 01 00 00 00 nop * 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 ) 40008878: c2 16 20 10 lduh [ %i0 + 0x10 ], %g1 4000887c: 80 a0 60 00 cmp %g1, 0 40008880: 02 bf ff eb be 4000882c <_Objects_Get_information+0x10> 40008884: 01 00 00 00 nop return NULL; #endif return info; } 40008888: 81 c7 e0 08 ret 4000888c: 81 e8 00 00 restore =============================================================================== 4001ab64 <_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; 4001ab64: c2 02 20 08 ld [ %o0 + 8 ], %g1 4001ab68: 92 22 40 01 sub %o1, %g1, %o1 if ( information->maximum >= index ) { 4001ab6c: c2 12 20 10 lduh [ %o0 + 0x10 ], %g1 /* * 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; 4001ab70: 92 02 60 01 inc %o1 if ( information->maximum >= index ) { 4001ab74: 80 a0 40 09 cmp %g1, %o1 4001ab78: 0a 80 00 09 bcs 4001ab9c <_Objects_Get_no_protection+0x38> 4001ab7c: 93 2a 60 02 sll %o1, 2, %o1 if ( (the_object = information->local_table[ index ]) != NULL ) { 4001ab80: c2 02 20 1c ld [ %o0 + 0x1c ], %g1 4001ab84: d0 00 40 09 ld [ %g1 + %o1 ], %o0 4001ab88: 80 a2 20 00 cmp %o0, 0 4001ab8c: 02 80 00 05 be 4001aba0 <_Objects_Get_no_protection+0x3c> <== NEVER TAKEN 4001ab90: 82 10 20 01 mov 1, %g1 *location = OBJECTS_LOCAL; return the_object; 4001ab94: 81 c3 e0 08 retl 4001ab98: c0 22 80 00 clr [ %o2 ] /* * This isn't supported or required yet for Global objects so * if it isn't local, we don't find it. */ *location = OBJECTS_ERROR; 4001ab9c: 82 10 20 01 mov 1, %g1 return NULL; 4001aba0: 90 10 20 00 clr %o0 } 4001aba4: 81 c3 e0 08 retl 4001aba8: c2 22 80 00 st %g1, [ %o2 ] =============================================================================== 4000c940 <_Objects_Id_to_name>: Objects_Name_or_id_lookup_errors _Objects_Id_to_name ( Objects_Id id, Objects_Name *name ) { 4000c940: 9d e3 bf 98 save %sp, -104, %sp /* * Caller is trusted for name != NULL. */ tmpId = (id == OBJECTS_ID_OF_SELF) ? _Thread_Executing->Object.id : id; 4000c944: 80 a6 20 00 cmp %i0, 0 4000c948: 12 80 00 06 bne 4000c960 <_Objects_Id_to_name+0x20> 4000c94c: 83 36 20 18 srl %i0, 0x18, %g1 4000c950: 03 10 00 b4 sethi %hi(0x4002d000), %g1 4000c954: c2 00 61 e0 ld [ %g1 + 0x1e0 ], %g1 ! 4002d1e0 <_Per_CPU_Information+0x10> 4000c958: f0 00 60 08 ld [ %g1 + 8 ], %i0 4000c95c: 83 36 20 18 srl %i0, 0x18, %g1 4000c960: 82 08 60 07 and %g1, 7, %g1 */ RTEMS_INLINE_ROUTINE bool _Objects_Is_api_valid( uint32_t the_api ) { if ( !the_api || the_api > OBJECTS_APIS_LAST ) 4000c964: 84 00 7f ff add %g1, -1, %g2 4000c968: 80 a0 a0 02 cmp %g2, 2 4000c96c: 08 80 00 14 bleu 4000c9bc <_Objects_Id_to_name+0x7c> 4000c970: 83 28 60 02 sll %g1, 2, %g1 the_api = _Objects_Get_API( tmpId ); if ( !_Objects_Is_api_valid( the_api ) ) return OBJECTS_INVALID_ID; 4000c974: 81 c7 e0 08 ret 4000c978: 91 e8 20 03 restore %g0, 3, %o0 if ( !_Objects_Information_table[ the_api ] ) return OBJECTS_INVALID_ID; the_class = _Objects_Get_class( tmpId ); information = _Objects_Information_table[ the_api ][ the_class ]; 4000c97c: 85 28 a0 02 sll %g2, 2, %g2 4000c980: d0 00 40 02 ld [ %g1 + %g2 ], %o0 if ( !information ) 4000c984: 80 a2 20 00 cmp %o0, 0 4000c988: 02 bf ff fb be 4000c974 <_Objects_Id_to_name+0x34> <== NEVER TAKEN 4000c98c: 92 10 00 18 mov %i0, %o1 #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 ); 4000c990: 7f ff ff cf call 4000c8cc <_Objects_Get> 4000c994: 94 07 bf fc add %fp, -4, %o2 if ( !the_object ) 4000c998: 80 a2 20 00 cmp %o0, 0 4000c99c: 02 bf ff f6 be 4000c974 <_Objects_Id_to_name+0x34> 4000c9a0: 01 00 00 00 nop return OBJECTS_INVALID_ID; *name = the_object->name; 4000c9a4: c2 02 20 0c ld [ %o0 + 0xc ], %g1 _Thread_Enable_dispatch(); return OBJECTS_NAME_OR_ID_LOOKUP_SUCCESSFUL; 4000c9a8: b0 10 20 00 clr %i0 the_object = _Objects_Get( information, tmpId, &ignored_location ); if ( !the_object ) return OBJECTS_INVALID_ID; *name = the_object->name; _Thread_Enable_dispatch(); 4000c9ac: 40 00 03 8e call 4000d7e4 <_Thread_Enable_dispatch> 4000c9b0: c2 26 40 00 st %g1, [ %i1 ] 4000c9b4: 81 c7 e0 08 ret 4000c9b8: 81 e8 00 00 restore the_api = _Objects_Get_API( tmpId ); if ( !_Objects_Is_api_valid( the_api ) ) return OBJECTS_INVALID_ID; if ( !_Objects_Information_table[ the_api ] ) 4000c9bc: 05 10 00 b3 sethi %hi(0x4002cc00), %g2 4000c9c0: 84 10 a2 f4 or %g2, 0x2f4, %g2 ! 4002cef4 <_Objects_Information_table> 4000c9c4: c2 00 80 01 ld [ %g2 + %g1 ], %g1 4000c9c8: 80 a0 60 00 cmp %g1, 0 4000c9cc: 12 bf ff ec bne 4000c97c <_Objects_Id_to_name+0x3c> 4000c9d0: 85 36 20 1b srl %i0, 0x1b, %g2 4000c9d4: 30 bf ff e8 b,a 4000c974 <_Objects_Id_to_name+0x34> =============================================================================== 40009644 <_RBTree_Extract_unprotected>: */ void _RBTree_Extract_unprotected( RBTree_Control *the_rbtree, RBTree_Node *the_node ) { 40009644: 9d e3 bf a0 save %sp, -96, %sp RBTree_Node *leaf, *target; RBTree_Color victim_color; RBTree_Direction dir; if (!the_node) return; 40009648: 80 a6 60 00 cmp %i1, 0 4000964c: 02 80 00 69 be 400097f0 <_RBTree_Extract_unprotected+0x1ac> 40009650: 01 00 00 00 nop /* check if min needs to be updated */ if (the_node == the_rbtree->first[RBT_LEFT]) { 40009654: c2 06 20 08 ld [ %i0 + 8 ], %g1 40009658: 80 a6 40 01 cmp %i1, %g1 4000965c: 32 80 00 07 bne,a 40009678 <_RBTree_Extract_unprotected+0x34> 40009660: c2 06 20 0c ld [ %i0 + 0xc ], %g1 */ RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_Successor_unprotected( const RBTree_Node *node ) { return _RBTree_Next_unprotected( node, RBT_RIGHT ); 40009664: 90 10 00 19 mov %i1, %o0 40009668: 40 00 01 31 call 40009b2c <_RBTree_Next_unprotected> 4000966c: 92 10 20 01 mov 1, %o1 RBTree_Node *next; next = _RBTree_Successor_unprotected(the_node); the_rbtree->first[RBT_LEFT] = next; 40009670: d0 26 20 08 st %o0, [ %i0 + 8 ] } /* 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]) { 40009674: c2 06 20 0c ld [ %i0 + 0xc ], %g1 40009678: 80 a6 40 01 cmp %i1, %g1 4000967c: 32 80 00 07 bne,a 40009698 <_RBTree_Extract_unprotected+0x54> 40009680: fa 06 60 04 ld [ %i1 + 4 ], %i5 */ RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_Predecessor_unprotected( const RBTree_Node *node ) { return _RBTree_Next_unprotected( node, RBT_LEFT ); 40009684: 90 10 00 19 mov %i1, %o0 40009688: 40 00 01 29 call 40009b2c <_RBTree_Next_unprotected> 4000968c: 92 10 20 00 clr %o1 RBTree_Node *previous; previous = _RBTree_Predecessor_unprotected(the_node); the_rbtree->first[RBT_RIGHT] = previous; 40009690: d0 26 20 0c st %o0, [ %i0 + 0xc ] * 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]) { 40009694: fa 06 60 04 ld [ %i1 + 4 ], %i5 40009698: 80 a7 60 00 cmp %i5, 0 4000969c: 02 80 00 36 be 40009774 <_RBTree_Extract_unprotected+0x130> 400096a0: f8 06 60 08 ld [ %i1 + 8 ], %i4 400096a4: 80 a7 20 00 cmp %i4, 0 400096a8: 32 80 00 05 bne,a 400096bc <_RBTree_Extract_unprotected+0x78> 400096ac: c2 07 60 08 ld [ %i5 + 8 ], %g1 400096b0: 10 80 00 35 b 40009784 <_RBTree_Extract_unprotected+0x140> 400096b4: b8 10 00 1d mov %i5, %i4 target = the_node->child[RBT_LEFT]; /* find max in node->child[RBT_LEFT] */ while (target->child[RBT_RIGHT]) target = target->child[RBT_RIGHT]; 400096b8: c2 07 60 08 ld [ %i5 + 8 ], %g1 400096bc: 80 a0 60 00 cmp %g1, 0 400096c0: 32 bf ff fe bne,a 400096b8 <_RBTree_Extract_unprotected+0x74> 400096c4: ba 10 00 01 mov %g1, %i5 * 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]; 400096c8: f8 07 60 04 ld [ %i5 + 4 ], %i4 if(leaf) { 400096cc: 80 a7 20 00 cmp %i4, 0 400096d0: 02 80 00 05 be 400096e4 <_RBTree_Extract_unprotected+0xa0> 400096d4: 01 00 00 00 nop leaf->parent = target->parent; 400096d8: c2 07 40 00 ld [ %i5 ], %g1 400096dc: 10 80 00 04 b 400096ec <_RBTree_Extract_unprotected+0xa8> 400096e0: c2 27 00 00 st %g1, [ %i4 ] } else { /* fix the tree here if the child is a null leaf. */ _RBTree_Extract_validate_unprotected(target); 400096e4: 7f ff ff 73 call 400094b0 <_RBTree_Extract_validate_unprotected> 400096e8: 90 10 00 1d mov %i5, %o0 } victim_color = target->color; dir = target != target->parent->child[0]; 400096ec: c4 07 40 00 ld [ %i5 ], %g2 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; 400096f0: c2 07 60 0c ld [ %i5 + 0xc ], %g1 dir = target != target->parent->child[0]; 400096f4: c6 00 a0 04 ld [ %g2 + 4 ], %g3 400096f8: 86 1f 40 03 xor %i5, %g3, %g3 400096fc: 80 a0 00 03 cmp %g0, %g3 40009700: 86 40 20 00 addx %g0, 0, %g3 target->parent->child[dir] = leaf; 40009704: 87 28 e0 02 sll %g3, 2, %g3 40009708: 84 00 80 03 add %g2, %g3, %g2 4000970c: f8 20 a0 04 st %i4, [ %g2 + 4 ] /* now replace the_node with target */ dir = the_node != the_node->parent->child[0]; 40009710: c4 06 40 00 ld [ %i1 ], %g2 40009714: c6 00 a0 04 ld [ %g2 + 4 ], %g3 40009718: 86 1e 40 03 xor %i1, %g3, %g3 4000971c: 80 a0 00 03 cmp %g0, %g3 40009720: 86 40 20 00 addx %g0, 0, %g3 the_node->parent->child[dir] = target; 40009724: 87 28 e0 02 sll %g3, 2, %g3 40009728: 84 00 80 03 add %g2, %g3, %g2 4000972c: fa 20 a0 04 st %i5, [ %g2 + 4 ] /* set target's new children to the original node's children */ target->child[RBT_RIGHT] = the_node->child[RBT_RIGHT]; 40009730: c4 06 60 08 ld [ %i1 + 8 ], %g2 40009734: c4 27 60 08 st %g2, [ %i5 + 8 ] if (the_node->child[RBT_RIGHT]) 40009738: c4 06 60 08 ld [ %i1 + 8 ], %g2 4000973c: 80 a0 a0 00 cmp %g2, 0 40009740: 32 80 00 02 bne,a 40009748 <_RBTree_Extract_unprotected+0x104><== ALWAYS TAKEN 40009744: fa 20 80 00 st %i5, [ %g2 ] the_node->child[RBT_RIGHT]->parent = target; target->child[RBT_LEFT] = the_node->child[RBT_LEFT]; 40009748: c4 06 60 04 ld [ %i1 + 4 ], %g2 4000974c: c4 27 60 04 st %g2, [ %i5 + 4 ] if (the_node->child[RBT_LEFT]) 40009750: c4 06 60 04 ld [ %i1 + 4 ], %g2 40009754: 80 a0 a0 00 cmp %g2, 0 40009758: 32 80 00 02 bne,a 40009760 <_RBTree_Extract_unprotected+0x11c> 4000975c: fa 20 80 00 st %i5, [ %g2 ] /* 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; 40009760: c4 06 40 00 ld [ %i1 ], %g2 40009764: c4 27 40 00 st %g2, [ %i5 ] target->color = the_node->color; 40009768: c4 06 60 0c ld [ %i1 + 0xc ], %g2 4000976c: 10 80 00 14 b 400097bc <_RBTree_Extract_unprotected+0x178> 40009770: c4 27 60 0c st %g2, [ %i5 + 0xc ] * violated. We will fix it later. * For now we store the color of the node being deleted in victim_color. */ leaf = the_node->child[RBT_LEFT] ? the_node->child[RBT_LEFT] : the_node->child[RBT_RIGHT]; if( leaf ) { 40009774: 80 a7 20 00 cmp %i4, 0 40009778: 32 80 00 04 bne,a 40009788 <_RBTree_Extract_unprotected+0x144> 4000977c: c2 06 40 00 ld [ %i1 ], %g1 40009780: 30 80 00 04 b,a 40009790 <_RBTree_Extract_unprotected+0x14c> leaf->parent = the_node->parent; 40009784: c2 06 40 00 ld [ %i1 ], %g1 40009788: 10 80 00 04 b 40009798 <_RBTree_Extract_unprotected+0x154> 4000978c: c2 27 00 00 st %g1, [ %i4 ] } else { /* fix the tree here if the child is a null leaf. */ _RBTree_Extract_validate_unprotected(the_node); 40009790: 7f ff ff 48 call 400094b0 <_RBTree_Extract_validate_unprotected> 40009794: 90 10 00 19 mov %i1, %o0 } victim_color = the_node->color; /* remove the_node from the tree */ dir = the_node != the_node->parent->child[0]; 40009798: c4 06 40 00 ld [ %i1 ], %g2 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; 4000979c: c2 06 60 0c ld [ %i1 + 0xc ], %g1 /* remove the_node from the tree */ dir = the_node != the_node->parent->child[0]; 400097a0: c6 00 a0 04 ld [ %g2 + 4 ], %g3 400097a4: 86 1e 40 03 xor %i1, %g3, %g3 400097a8: 80 a0 00 03 cmp %g0, %g3 400097ac: 86 40 20 00 addx %g0, 0, %g3 the_node->parent->child[dir] = leaf; 400097b0: 87 28 e0 02 sll %g3, 2, %g3 400097b4: 84 00 80 03 add %g2, %g3, %g2 400097b8: f8 20 a0 04 st %i4, [ %g2 + 4 ] /* 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 */ 400097bc: 80 a0 60 00 cmp %g1, 0 400097c0: 32 80 00 06 bne,a 400097d8 <_RBTree_Extract_unprotected+0x194> 400097c4: c2 06 20 04 ld [ %i0 + 4 ], %g1 if (leaf) { 400097c8: 80 a7 20 00 cmp %i4, 0 400097cc: 32 80 00 02 bne,a 400097d4 <_RBTree_Extract_unprotected+0x190> 400097d0: c0 27 20 0c clr [ %i4 + 0xc ] /* 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; 400097d4: c2 06 20 04 ld [ %i0 + 4 ], %g1 */ RTEMS_INLINE_ROUTINE void _RBTree_Set_off_rbtree( RBTree_Node *node ) { node->parent = node->child[RBT_LEFT] = node->child[RBT_RIGHT] = NULL; 400097d8: c0 26 60 08 clr [ %i1 + 8 ] 400097dc: c0 26 60 04 clr [ %i1 + 4 ] 400097e0: 80 a0 60 00 cmp %g1, 0 400097e4: 02 80 00 03 be 400097f0 <_RBTree_Extract_unprotected+0x1ac> 400097e8: c0 26 40 00 clr [ %i1 ] 400097ec: c0 20 60 0c clr [ %g1 + 0xc ] 400097f0: 81 c7 e0 08 ret 400097f4: 81 e8 00 00 restore =============================================================================== 4000a8bc <_RBTree_Initialize>: void *starting_address, size_t number_nodes, size_t node_size, bool is_unique ) { 4000a8bc: 9d e3 bf a0 save %sp, -96, %sp size_t count; RBTree_Node *next; /* TODO: Error message? */ if (!the_rbtree) return; 4000a8c0: 80 a6 20 00 cmp %i0, 0 4000a8c4: 02 80 00 10 be 4000a904 <_RBTree_Initialize+0x48> <== NEVER TAKEN 4000a8c8: 01 00 00 00 nop RBTree_Control *the_rbtree, RBTree_Compare_function compare_function, bool is_unique ) { the_rbtree->permanent_null = NULL; 4000a8cc: c0 26 00 00 clr [ %i0 ] the_rbtree->root = NULL; 4000a8d0: c0 26 20 04 clr [ %i0 + 4 ] the_rbtree->first[0] = NULL; 4000a8d4: c0 26 20 08 clr [ %i0 + 8 ] the_rbtree->first[1] = NULL; 4000a8d8: c0 26 20 0c clr [ %i0 + 0xc ] the_rbtree->compare_function = compare_function; 4000a8dc: f2 26 20 10 st %i1, [ %i0 + 0x10 ] /* could do sanity checks here */ _RBTree_Initialize_empty(the_rbtree, compare_function, is_unique); count = number_nodes; next = starting_address; while ( count-- ) { 4000a8e0: 10 80 00 06 b 4000a8f8 <_RBTree_Initialize+0x3c> 4000a8e4: fa 2e 20 14 stb %i5, [ %i0 + 0x14 ] _RBTree_Insert_unprotected(the_rbtree, next); 4000a8e8: 90 10 00 18 mov %i0, %o0 4000a8ec: 7f ff ff 2e call 4000a5a4 <_RBTree_Insert_unprotected> 4000a8f0: b4 06 80 1c add %i2, %i4, %i2 4000a8f4: b6 06 ff ff add %i3, -1, %i3 /* could do sanity checks here */ _RBTree_Initialize_empty(the_rbtree, compare_function, is_unique); count = number_nodes; next = starting_address; while ( count-- ) { 4000a8f8: 80 a6 e0 00 cmp %i3, 0 4000a8fc: 12 bf ff fb bne 4000a8e8 <_RBTree_Initialize+0x2c> 4000a900: 92 10 00 1a mov %i2, %o1 4000a904: 81 c7 e0 08 ret 4000a908: 81 e8 00 00 restore =============================================================================== 40009898 <_RBTree_Insert_unprotected>: */ RBTree_Node *_RBTree_Insert_unprotected( RBTree_Control *the_rbtree, RBTree_Node *the_node ) { 40009898: 9d e3 bf a0 save %sp, -96, %sp if(!the_node) return (RBTree_Node*)-1; 4000989c: 80 a6 60 00 cmp %i1, 0 400098a0: 02 80 00 7c be 40009a90 <_RBTree_Insert_unprotected+0x1f8> 400098a4: ba 10 00 18 mov %i0, %i5 RBTree_Node *iter_node = the_rbtree->root; 400098a8: f0 06 20 04 ld [ %i0 + 4 ], %i0 int compare_result; if (!iter_node) { /* special case: first node inserted */ 400098ac: b6 96 20 00 orcc %i0, 0, %i3 400098b0: 32 80 00 0c bne,a 400098e0 <_RBTree_Insert_unprotected+0x48> 400098b4: c2 07 60 10 ld [ %i5 + 0x10 ], %g1 the_node->color = RBT_BLACK; 400098b8: c0 26 60 0c clr [ %i1 + 0xc ] the_rbtree->root = the_node; 400098bc: f2 27 60 04 st %i1, [ %i5 + 4 ] the_rbtree->first[0] = the_rbtree->first[1] = the_node; 400098c0: f2 27 60 0c st %i1, [ %i5 + 0xc ] 400098c4: f2 27 60 08 st %i1, [ %i5 + 8 ] the_node->parent = (RBTree_Node *) the_rbtree; 400098c8: fa 26 40 00 st %i5, [ %i1 ] the_node->child[RBT_LEFT] = the_node->child[RBT_RIGHT] = NULL; 400098cc: c0 26 60 08 clr [ %i1 + 8 ] 400098d0: c0 26 60 04 clr [ %i1 + 4 ] 400098d4: 81 c7 e0 08 ret 400098d8: 81 e8 00 00 restore } 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); 400098dc: c2 07 60 10 ld [ %i5 + 0x10 ], %g1 400098e0: 90 10 00 19 mov %i1, %o0 400098e4: 9f c0 40 00 call %g1 400098e8: 92 10 00 18 mov %i0, %o1 if ( the_rbtree->is_unique && _RBTree_Is_equal( compare_result ) ) 400098ec: c2 0f 60 14 ldub [ %i5 + 0x14 ], %g1 400098f0: 80 a0 60 00 cmp %g1, 0 400098f4: 02 80 00 05 be 40009908 <_RBTree_Insert_unprotected+0x70> 400098f8: b8 38 00 08 xnor %g0, %o0, %i4 400098fc: 80 a2 20 00 cmp %o0, 0 40009900: 02 80 00 65 be 40009a94 <_RBTree_Insert_unprotected+0x1fc> 40009904: 01 00 00 00 nop return iter_node; RBTree_Direction dir = !_RBTree_Is_lesser( compare_result ); 40009908: b9 37 20 1f srl %i4, 0x1f, %i4 if (!iter_node->child[dir]) { 4000990c: 83 2f 20 02 sll %i4, 2, %g1 40009910: 82 06 00 01 add %i0, %g1, %g1 40009914: f0 00 60 04 ld [ %g1 + 4 ], %i0 40009918: 80 a6 20 00 cmp %i0, 0 4000991c: 32 bf ff f0 bne,a 400098dc <_RBTree_Insert_unprotected+0x44> 40009920: b6 10 00 18 mov %i0, %i3 the_node->child[RBT_LEFT] = the_node->child[RBT_RIGHT] = NULL; 40009924: c0 26 60 08 clr [ %i1 + 8 ] 40009928: c0 26 60 04 clr [ %i1 + 4 ] the_node->color = RBT_RED; 4000992c: 84 10 20 01 mov 1, %g2 iter_node->child[dir] = the_node; 40009930: f2 20 60 04 st %i1, [ %g1 + 4 ] 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; 40009934: c4 26 60 0c st %g2, [ %i1 + 0xc ] iter_node->child[dir] = the_node; the_node->parent = iter_node; 40009938: f6 26 40 00 st %i3, [ %i1 ] /* update min/max */ compare_result = the_rbtree->compare_function( 4000993c: c2 07 60 10 ld [ %i5 + 0x10 ], %g1 RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_First( const RBTree_Control *the_rbtree, RBTree_Direction dir ) { return the_rbtree->first[dir]; 40009940: b6 07 20 02 add %i4, 2, %i3 40009944: 85 2e e0 02 sll %i3, 2, %g2 40009948: d2 07 40 02 ld [ %i5 + %g2 ], %o1 4000994c: 9f c0 40 00 call %g1 40009950: 90 10 00 19 mov %i1, %o0 the_node, _RBTree_First(the_rbtree, dir) ); if ( (!dir && _RBTree_Is_lesser(compare_result)) || 40009954: 80 a7 20 00 cmp %i4, 0 40009958: 12 80 00 06 bne 40009970 <_RBTree_Insert_unprotected+0xd8> 4000995c: 80 a2 20 00 cmp %o0, 0 40009960: 36 80 00 3c bge,a 40009a50 <_RBTree_Insert_unprotected+0x1b8> 40009964: d0 06 40 00 ld [ %i1 ], %o0 (dir && _RBTree_Is_greater(compare_result)) ) { the_rbtree->first[dir] = the_node; 40009968: 10 80 00 04 b 40009978 <_RBTree_Insert_unprotected+0xe0> 4000996c: b7 2e e0 02 sll %i3, 2, %i3 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)) ) { 40009970: 04 80 00 37 ble 40009a4c <_RBTree_Insert_unprotected+0x1b4> 40009974: b7 2e e0 02 sll %i3, 2, %i3 the_rbtree->first[dir] = the_node; 40009978: 10 80 00 35 b 40009a4c <_RBTree_Insert_unprotected+0x1b4> 4000997c: f2 27 40 1b st %i1, [ %i5 + %i3 ] const RBTree_Node *the_node ) { if(!the_node) return NULL; if(!(the_node->parent)) return NULL; if(!(the_node->parent->parent)) return NULL; 40009980: 02 80 00 13 be 400099cc <_RBTree_Insert_unprotected+0x134><== NEVER TAKEN 40009984: 82 10 20 00 clr %g1 if(!(the_node->parent->parent->parent)) return NULL; 40009988: c2 07 40 00 ld [ %i5 ], %g1 4000998c: 80 a0 60 00 cmp %g1, 0 40009990: 02 80 00 0f be 400099cc <_RBTree_Insert_unprotected+0x134><== NEVER TAKEN 40009994: 82 10 20 00 clr %g1 { 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]) 40009998: c2 07 60 04 ld [ %i5 + 4 ], %g1 4000999c: 80 a2 00 01 cmp %o0, %g1 400099a0: 22 80 00 02 be,a 400099a8 <_RBTree_Insert_unprotected+0x110> 400099a4: c2 07 60 08 ld [ %i5 + 8 ], %g1 */ RTEMS_INLINE_ROUTINE bool _RBTree_Is_red( const RBTree_Node *the_node ) { return (the_node && the_node->color == RBT_RED); 400099a8: 80 a0 60 00 cmp %g1, 0 400099ac: 02 80 00 09 be 400099d0 <_RBTree_Insert_unprotected+0x138> 400099b0: 84 10 20 00 clr %g2 400099b4: c4 00 60 0c ld [ %g1 + 0xc ], %g2 400099b8: 80 a0 a0 01 cmp %g2, 1 400099bc: 32 80 00 05 bne,a 400099d0 <_RBTree_Insert_unprotected+0x138> 400099c0: 84 10 20 00 clr %g2 400099c4: 10 80 00 03 b 400099d0 <_RBTree_Insert_unprotected+0x138> 400099c8: 84 10 20 01 mov 1, %g2 400099cc: 84 10 20 00 clr %g2 <== NOT EXECUTED while (_RBTree_Is_red(_RBTree_Parent(the_node))) { 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)) { 400099d0: 80 a0 a0 00 cmp %g2, 0 400099d4: 22 80 00 08 be,a 400099f4 <_RBTree_Insert_unprotected+0x15c> 400099d8: c2 07 60 04 ld [ %i5 + 4 ], %g1 the_node->parent->color = RBT_BLACK; 400099dc: c0 22 20 0c clr [ %o0 + 0xc ] u->color = RBT_BLACK; 400099e0: c0 20 60 0c clr [ %g1 + 0xc ] g->color = RBT_RED; 400099e4: b2 10 00 1d mov %i5, %i1 400099e8: 82 10 20 01 mov 1, %g1 400099ec: 10 80 00 18 b 40009a4c <_RBTree_Insert_unprotected+0x1b4> 400099f0: c2 27 60 0c st %g1, [ %i5 + 0xc ] the_node = g; } else { /* if uncle is black */ RBTree_Direction dir = the_node != the_node->parent->child[0]; RBTree_Direction pdir = the_node->parent != g->child[0]; 400099f4: 82 1a 00 01 xor %o0, %g1, %g1 400099f8: 80 a0 00 01 cmp %g0, %g1 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]; 400099fc: c2 02 20 04 ld [ %o0 + 4 ], %g1 RBTree_Direction pdir = the_node->parent != g->child[0]; 40009a00: b8 40 20 00 addx %g0, 0, %i4 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]; 40009a04: 82 1e 40 01 xor %i1, %g1, %g1 40009a08: 80 a0 00 01 cmp %g0, %g1 40009a0c: 82 40 20 00 addx %g0, 0, %g1 RBTree_Direction pdir = the_node->parent != g->child[0]; /* ensure node is on the same branch direction as parent */ if (dir != pdir) { 40009a10: 80 a0 40 1c cmp %g1, %i4 40009a14: 22 80 00 08 be,a 40009a34 <_RBTree_Insert_unprotected+0x19c> 40009a18: c2 06 40 00 ld [ %i1 ], %g1 _RBTree_Rotate(the_node->parent, pdir); 40009a1c: 7f ff ff 80 call 4000981c <_RBTree_Rotate> 40009a20: 92 10 00 1c mov %i4, %o1 the_node = the_node->child[pdir]; 40009a24: 83 2f 20 02 sll %i4, 2, %g1 40009a28: b2 06 40 01 add %i1, %g1, %i1 40009a2c: f2 06 60 04 ld [ %i1 + 4 ], %i1 } the_node->parent->color = RBT_BLACK; 40009a30: c2 06 40 00 ld [ %i1 ], %g1 g->color = RBT_RED; 40009a34: 92 10 20 01 mov 1, %o1 /* 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; 40009a38: c0 20 60 0c clr [ %g1 + 0xc ] g->color = RBT_RED; 40009a3c: d2 27 60 0c st %o1, [ %i5 + 0xc ] /* now rotate grandparent in the other branch direction (toward uncle) */ _RBTree_Rotate(g, (1-pdir)); 40009a40: 90 10 00 1d mov %i5, %o0 40009a44: 7f ff ff 76 call 4000981c <_RBTree_Rotate> 40009a48: 92 22 40 1c sub %o1, %i4, %o1 */ RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_Parent( const RBTree_Node *the_node ) { if (!the_node->parent->parent) return NULL; 40009a4c: d0 06 40 00 ld [ %i1 ], %o0 40009a50: fa 02 00 00 ld [ %o0 ], %i5 40009a54: 80 a7 60 00 cmp %i5, 0 40009a58: 22 80 00 06 be,a 40009a70 <_RBTree_Insert_unprotected+0x1d8> 40009a5c: 82 10 20 00 clr %g1 */ RTEMS_INLINE_ROUTINE bool _RBTree_Is_red( const RBTree_Node *the_node ) { return (the_node && the_node->color == RBT_RED); 40009a60: c2 02 20 0c ld [ %o0 + 0xc ], %g1 40009a64: 82 18 60 01 xor %g1, 1, %g1 40009a68: 80 a0 00 01 cmp %g0, %g1 40009a6c: 82 60 3f ff subx %g0, -1, %g1 RBTree_Node *u,*g; /* note: the insert root case is handled already */ /* if the parent is black, nothing needs to be done * otherwise may need to loop a few times */ while (_RBTree_Is_red(_RBTree_Parent(the_node))) { 40009a70: 80 a0 60 00 cmp %g1, 0 40009a74: 12 bf ff c3 bne 40009980 <_RBTree_Insert_unprotected+0xe8> 40009a78: 80 a7 60 00 cmp %i5, 0 /* 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; 40009a7c: 12 80 00 06 bne 40009a94 <_RBTree_Insert_unprotected+0x1fc> 40009a80: 01 00 00 00 nop 40009a84: c0 26 60 0c clr [ %i1 + 0xc ] 40009a88: 81 c7 e0 08 ret 40009a8c: 81 e8 00 00 restore RBTree_Node *_RBTree_Insert_unprotected( RBTree_Control *the_rbtree, RBTree_Node *the_node ) { if(!the_node) return (RBTree_Node*)-1; 40009a90: b0 10 3f ff mov -1, %i0 /* verify red-black properties */ _RBTree_Validate_insert_unprotected(the_node); } return (RBTree_Node*)0; } 40009a94: 81 c7 e0 08 ret 40009a98: 81 e8 00 00 restore =============================================================================== 40009acc <_RBTree_Iterate_unprotected>: const RBTree_Control *rbtree, RBTree_Direction dir, RBTree_Visitor visitor, void *visitor_arg ) { 40009acc: 9d e3 bf a0 save %sp, -96, %sp RBTree_Direction opp_dir = _RBTree_Opposite_direction( dir ); const RBTree_Node *current = _RBTree_First( rbtree, opp_dir ); bool stop = false; 40009ad0: b8 10 20 00 clr %i4 */ RTEMS_INLINE_ROUTINE RBTree_Direction _RBTree_Opposite_direction( RBTree_Direction the_dir ) { return (RBTree_Direction) !((int) the_dir); 40009ad4: 80 a0 00 19 cmp %g0, %i1 40009ad8: 82 60 3f ff subx %g0, -1, %g1 RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_First( const RBTree_Control *the_rbtree, RBTree_Direction dir ) { return the_rbtree->first[dir]; 40009adc: 82 00 60 02 add %g1, 2, %g1 40009ae0: 83 28 60 02 sll %g1, 2, %g1 while ( !stop && current != NULL ) { 40009ae4: 10 80 00 0a b 40009b0c <_RBTree_Iterate_unprotected+0x40> 40009ae8: fa 06 00 01 ld [ %i0 + %g1 ], %i5 stop = (*visitor)( current, dir, visitor_arg ); 40009aec: 92 10 00 19 mov %i1, %o1 40009af0: 9f c6 80 00 call %i2 40009af4: 94 10 00 1b mov %i3, %o2 current = _RBTree_Next_unprotected( current, dir ); 40009af8: 92 10 00 19 mov %i1, %o1 RBTree_Direction opp_dir = _RBTree_Opposite_direction( dir ); const RBTree_Node *current = _RBTree_First( rbtree, opp_dir ); bool stop = false; while ( !stop && current != NULL ) { stop = (*visitor)( current, dir, visitor_arg ); 40009afc: b8 10 00 08 mov %o0, %i4 current = _RBTree_Next_unprotected( current, dir ); 40009b00: 40 00 00 0b call 40009b2c <_RBTree_Next_unprotected> 40009b04: 90 10 00 1d mov %i5, %o0 40009b08: ba 10 00 08 mov %o0, %i5 { RBTree_Direction opp_dir = _RBTree_Opposite_direction( dir ); const RBTree_Node *current = _RBTree_First( rbtree, opp_dir ); bool stop = false; while ( !stop && current != NULL ) { 40009b0c: 80 a7 60 00 cmp %i5, 0 40009b10: 02 80 00 05 be 40009b24 <_RBTree_Iterate_unprotected+0x58> 40009b14: b8 1f 20 01 xor %i4, 1, %i4 40009b18: 80 8f 20 ff btst 0xff, %i4 40009b1c: 12 bf ff f4 bne 40009aec <_RBTree_Iterate_unprotected+0x20><== ALWAYS TAKEN 40009b20: 90 10 00 1d mov %i5, %o0 40009b24: 81 c7 e0 08 ret 40009b28: 81 e8 00 00 restore =============================================================================== 40009434 <_RBTree_Rotate>: RBTree_Node *the_node, RBTree_Direction dir ) { RBTree_Node *c; if (the_node == NULL) return; 40009434: 80 a2 20 00 cmp %o0, 0 40009438: 02 80 00 1c be 400094a8 <_RBTree_Rotate+0x74> <== NEVER TAKEN 4000943c: 80 a0 00 09 cmp %g0, %o1 */ RTEMS_INLINE_ROUTINE RBTree_Direction _RBTree_Opposite_direction( RBTree_Direction the_dir ) { return (RBTree_Direction) !((int) the_dir); 40009440: 86 60 3f ff subx %g0, -1, %g3 RBTree_Direction dir ) { RBTree_Node *c; if (the_node == NULL) return; if (the_node->child[_RBTree_Opposite_direction(dir)] == NULL) return; 40009444: 87 28 e0 02 sll %g3, 2, %g3 40009448: 86 02 00 03 add %o0, %g3, %g3 4000944c: c2 00 e0 04 ld [ %g3 + 4 ], %g1 40009450: 80 a0 60 00 cmp %g1, 0 40009454: 02 80 00 15 be 400094a8 <_RBTree_Rotate+0x74> <== NEVER TAKEN 40009458: 93 2a 60 02 sll %o1, 2, %o1 c = the_node->child[_RBTree_Opposite_direction(dir)]; the_node->child[_RBTree_Opposite_direction(dir)] = c->child[dir]; 4000945c: 84 00 40 09 add %g1, %o1, %g2 40009460: c8 00 a0 04 ld [ %g2 + 4 ], %g4 40009464: c8 20 e0 04 st %g4, [ %g3 + 4 ] if (c->child[dir]) 40009468: c4 00 a0 04 ld [ %g2 + 4 ], %g2 4000946c: 80 a0 a0 00 cmp %g2, 0 40009470: 32 80 00 02 bne,a 40009478 <_RBTree_Rotate+0x44> 40009474: d0 20 80 00 st %o0, [ %g2 ] c->child[dir]->parent = the_node; c->child[dir] = the_node; the_node->parent->child[the_node != the_node->parent->child[0]] = c; 40009478: c4 02 00 00 ld [ %o0 ], %g2 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; 4000947c: 92 00 40 09 add %g1, %o1, %o1 40009480: d0 22 60 04 st %o0, [ %o1 + 4 ] the_node->parent->child[the_node != the_node->parent->child[0]] = c; 40009484: c6 00 a0 04 ld [ %g2 + 4 ], %g3 c->parent = the_node->parent; 40009488: c4 20 40 00 st %g2, [ %g1 ] 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; 4000948c: 86 1a 00 03 xor %o0, %g3, %g3 c->parent = the_node->parent; the_node->parent = c; 40009490: c2 22 00 00 st %g1, [ %o0 ] 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; 40009494: 80 a0 00 03 cmp %g0, %g3 40009498: 86 40 20 00 addx %g0, 0, %g3 4000949c: 87 28 e0 02 sll %g3, 2, %g3 400094a0: 86 00 80 03 add %g2, %g3, %g3 400094a4: c2 20 e0 04 st %g1, [ %g3 + 4 ] 400094a8: 81 c3 e0 08 retl =============================================================================== 400093e4 <_RBTree_Sibling>: */ RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_Sibling( const RBTree_Node *the_node ) { if(!the_node) return NULL; 400093e4: 80 a2 20 00 cmp %o0, 0 400093e8: 02 80 00 10 be 40009428 <_RBTree_Sibling+0x44> <== NEVER TAKEN 400093ec: 82 10 20 00 clr %g1 if(!(the_node->parent)) return NULL; 400093f0: c4 02 00 00 ld [ %o0 ], %g2 400093f4: 80 a0 a0 00 cmp %g2, 0 400093f8: 22 80 00 0d be,a 4000942c <_RBTree_Sibling+0x48> <== NEVER TAKEN 400093fc: 90 10 00 01 mov %g1, %o0 <== NOT EXECUTED if(!(the_node->parent->parent)) return NULL; 40009400: c2 00 80 00 ld [ %g2 ], %g1 40009404: 80 a0 60 00 cmp %g1, 0 40009408: 02 80 00 08 be 40009428 <_RBTree_Sibling+0x44> 4000940c: 82 10 20 00 clr %g1 if(the_node == the_node->parent->child[RBT_LEFT]) 40009410: c2 00 a0 04 ld [ %g2 + 4 ], %g1 40009414: 80 a2 00 01 cmp %o0, %g1 40009418: 22 80 00 04 be,a 40009428 <_RBTree_Sibling+0x44> 4000941c: c2 00 a0 08 ld [ %g2 + 8 ], %g1 return the_node->parent->child[RBT_RIGHT]; 40009420: 81 c3 e0 08 retl 40009424: 90 10 00 01 mov %g1, %o0 else return the_node->parent->child[RBT_LEFT]; } 40009428: 90 10 00 01 mov %g1, %o0 4000942c: 81 c3 e0 08 retl =============================================================================== 400080cc <_RTEMS_signal_Post_switch_hook>: #include #include #include static void _RTEMS_signal_Post_switch_hook( Thread_Control *executing ) { 400080cc: 9d e3 bf 98 save %sp, -104, %sp RTEMS_API_Control *api; ASR_Information *asr; rtems_signal_set signal_set; Modes_Control prev_mode; api = executing->API_Extensions[ THREAD_API_RTEMS ]; 400080d0: fa 06 21 4c ld [ %i0 + 0x14c ], %i5 if ( !api ) 400080d4: 80 a7 60 00 cmp %i5, 0 400080d8: 02 80 00 1c be 40008148 <_RTEMS_signal_Post_switch_hook+0x7c><== NEVER TAKEN 400080dc: 01 00 00 00 nop * Signal Processing */ asr = &api->Signal; _ISR_Disable( level ); 400080e0: 7f ff eb d3 call 4000302c 400080e4: 01 00 00 00 nop signal_set = asr->signals_posted; 400080e8: f8 07 60 14 ld [ %i5 + 0x14 ], %i4 asr->signals_posted = 0; 400080ec: c0 27 60 14 clr [ %i5 + 0x14 ] _ISR_Enable( level ); 400080f0: 7f ff eb d3 call 4000303c 400080f4: 01 00 00 00 nop if ( !signal_set ) /* similar to _ASR_Are_signals_pending( asr ) */ 400080f8: 80 a7 20 00 cmp %i4, 0 400080fc: 02 80 00 13 be 40008148 <_RTEMS_signal_Post_switch_hook+0x7c> 40008100: 94 07 bf fc add %fp, -4, %o2 return; asr->nest_level += 1; 40008104: c2 07 60 1c ld [ %i5 + 0x1c ], %g1 rtems_task_mode( asr->mode_set, RTEMS_ALL_MODE_MASKS, &prev_mode ); 40008108: d0 07 60 10 ld [ %i5 + 0x10 ], %o0 if ( !signal_set ) /* similar to _ASR_Are_signals_pending( asr ) */ return; asr->nest_level += 1; 4000810c: 82 00 60 01 inc %g1 40008110: c2 27 60 1c st %g1, [ %i5 + 0x1c ] rtems_task_mode( asr->mode_set, RTEMS_ALL_MODE_MASKS, &prev_mode ); 40008114: 37 00 00 3f sethi %hi(0xfc00), %i3 40008118: 40 00 01 03 call 40008524 4000811c: 92 16 e3 ff or %i3, 0x3ff, %o1 ! ffff (*asr->handler)( signal_set ); 40008120: c2 07 60 0c ld [ %i5 + 0xc ], %g1 40008124: 9f c0 40 00 call %g1 40008128: 90 10 00 1c mov %i4, %o0 asr->nest_level -= 1; 4000812c: c2 07 60 1c ld [ %i5 + 0x1c ], %g1 rtems_task_mode( prev_mode, RTEMS_ALL_MODE_MASKS, &prev_mode ); 40008130: d0 07 bf fc ld [ %fp + -4 ], %o0 asr->nest_level += 1; rtems_task_mode( asr->mode_set, RTEMS_ALL_MODE_MASKS, &prev_mode ); (*asr->handler)( signal_set ); asr->nest_level -= 1; 40008134: 82 00 7f ff add %g1, -1, %g1 rtems_task_mode( prev_mode, RTEMS_ALL_MODE_MASKS, &prev_mode ); 40008138: 92 16 e3 ff or %i3, 0x3ff, %o1 asr->nest_level += 1; rtems_task_mode( asr->mode_set, RTEMS_ALL_MODE_MASKS, &prev_mode ); (*asr->handler)( signal_set ); asr->nest_level -= 1; 4000813c: c2 27 60 1c st %g1, [ %i5 + 0x1c ] rtems_task_mode( prev_mode, RTEMS_ALL_MODE_MASKS, &prev_mode ); 40008140: 40 00 00 f9 call 40008524 40008144: 94 07 bf fc add %fp, -4, %o2 40008148: 81 c7 e0 08 ret 4000814c: 81 e8 00 00 restore =============================================================================== 400318c4 <_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 ) { 400318c4: 9d e3 bf 98 save %sp, -104, %sp */ static inline void _TOD_Get_uptime( Timestamp_Control *time ) { _TOD_Get_with_nanoseconds( time, &_TOD.uptime ); 400318c8: 13 10 01 86 sethi %hi(0x40061800), %o1 #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ Timestamp_Control uptime; #endif Thread_Control *owning_thread = the_period->owner; 400318cc: f6 06 20 40 ld [ %i0 + 0x40 ], %i3 400318d0: 90 07 bf f8 add %fp, -8, %o0 400318d4: 7f ff 57 de call 4000784c <_TOD_Get_with_nanoseconds> 400318d8: 92 12 63 50 or %o1, 0x350, %o1 /* * Determine elapsed wall time since period initiated. */ #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ _TOD_Get_uptime( &uptime ); _Timestamp_Subtract( 400318dc: c4 1f bf f8 ldd [ %fp + -8 ], %g2 const Timestamp64_Control *_start, const Timestamp64_Control *_end, Timestamp64_Control *_result ) { *_result = *_end - *_start; 400318e0: f8 1e 20 50 ldd [ %i0 + 0x50 ], %i4 * Determine cpu usage since period initiated. */ used = owning_thread->cpu_time_used; #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ if (owning_thread == _Thread_Executing) { 400318e4: 09 10 01 87 sethi %hi(0x40061c00), %g4 400318e8: ba a0 c0 1d subcc %g3, %i5, %i5 400318ec: 88 11 22 00 or %g4, 0x200, %g4 400318f0: b8 60 80 1c subx %g2, %i4, %i4 400318f4: f8 3e 40 00 std %i4, [ %i1 ] 400318f8: fa 01 20 10 ld [ %g4 + 0x10 ], %i5 #endif /* * Determine cpu usage since period initiated. */ used = owning_thread->cpu_time_used; 400318fc: d8 1e e0 80 ldd [ %i3 + 0x80 ], %o4 #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ if (owning_thread == _Thread_Executing) { 40031900: 80 a6 c0 1d cmp %i3, %i5 40031904: 12 80 00 15 bne 40031958 <_Rate_monotonic_Get_status+0x94> 40031908: 82 10 20 01 mov 1, %g1 4003190c: f8 19 20 20 ldd [ %g4 + 0x20 ], %i4 40031910: 86 a0 c0 1d subcc %g3, %i5, %g3 40031914: 84 60 80 1c subx %g2, %i4, %g2 static inline void _Timestamp64_implementation_Add_to( Timestamp64_Control *_time, const Timestamp64_Control *_add ) { *_time += *_add; 40031918: ba 83 40 03 addcc %o5, %g3, %i5 4003191c: b8 43 00 02 addx %o4, %g2, %i4 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 40031920: c4 1e 20 48 ldd [ %i0 + 0x48 ], %g2 /* * The cpu usage info was reset while executing. Can't * determine a status. */ if (_Timestamp_Less_than(&used, &the_period->cpu_usage_period_initiated)) 40031924: 80 a0 80 1c cmp %g2, %i4 40031928: 34 80 00 0c bg,a 40031958 <_Rate_monotonic_Get_status+0x94><== NEVER TAKEN 4003192c: 82 10 20 00 clr %g1 <== NOT EXECUTED 40031930: 32 80 00 06 bne,a 40031948 <_Rate_monotonic_Get_status+0x84> 40031934: 86 a7 40 03 subcc %i5, %g3, %g3 40031938: 80 a0 c0 1d cmp %g3, %i5 4003193c: 18 80 00 06 bgu 40031954 <_Rate_monotonic_Get_status+0x90> 40031940: 86 a7 40 03 subcc %i5, %g3, %g3 if (used < the_period->cpu_usage_period_initiated) return false; *cpu_since_last_period = used - the_period->cpu_usage_period_initiated; #endif return true; 40031944: 82 10 20 01 mov 1, %g1 const Timestamp64_Control *_start, const Timestamp64_Control *_end, Timestamp64_Control *_result ) { *_result = *_end - *_start; 40031948: 84 67 00 02 subx %i4, %g2, %g2 4003194c: 10 80 00 03 b 40031958 <_Rate_monotonic_Get_status+0x94> 40031950: c4 3e 80 00 std %g2, [ %i2 ] /* * 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; 40031954: 82 10 20 00 clr %g1 return false; *cpu_since_last_period = used - the_period->cpu_usage_period_initiated; #endif return true; } 40031958: b0 08 60 01 and %g1, 1, %i0 4003195c: 81 c7 e0 08 ret 40031960: 81 e8 00 00 restore =============================================================================== 40031ccc <_Rate_monotonic_Timeout>: void _Rate_monotonic_Timeout( Objects_Id id, void *ignored ) { 40031ccc: 9d e3 bf 98 save %sp, -104, %sp 40031cd0: 11 10 01 88 sethi %hi(0x40062000), %o0 40031cd4: 92 10 00 18 mov %i0, %o1 40031cd8: 90 12 20 28 or %o0, 0x28, %o0 40031cdc: 7f ff 59 83 call 400082e8 <_Objects_Get> 40031ce0: 94 07 bf fc add %fp, -4, %o2 /* * 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 ) { 40031ce4: c2 07 bf fc ld [ %fp + -4 ], %g1 40031ce8: 80 a0 60 00 cmp %g1, 0 40031cec: 12 80 00 24 bne 40031d7c <_Rate_monotonic_Timeout+0xb0> <== NEVER TAKEN 40031cf0: ba 10 00 08 mov %o0, %i5 case OBJECTS_LOCAL: the_thread = the_period->owner; 40031cf4: d0 02 20 40 ld [ %o0 + 0x40 ], %o0 if ( _States_Is_waiting_for_period( the_thread->current_state ) && 40031cf8: 03 00 00 10 sethi %hi(0x4000), %g1 */ RTEMS_INLINE_ROUTINE bool _States_Is_waiting_for_period ( States_Control the_states ) { return (the_states & STATES_WAITING_FOR_PERIOD); 40031cfc: c4 02 20 10 ld [ %o0 + 0x10 ], %g2 40031d00: 80 88 80 01 btst %g2, %g1 40031d04: 22 80 00 0b be,a 40031d30 <_Rate_monotonic_Timeout+0x64> 40031d08: c2 07 60 38 ld [ %i5 + 0x38 ], %g1 40031d0c: c4 02 20 20 ld [ %o0 + 0x20 ], %g2 40031d10: c2 07 60 08 ld [ %i5 + 8 ], %g1 40031d14: 80 a0 80 01 cmp %g2, %g1 40031d18: 32 80 00 06 bne,a 40031d30 <_Rate_monotonic_Timeout+0x64> 40031d1c: c2 07 60 38 ld [ %i5 + 0x38 ], %g1 RTEMS_INLINE_ROUTINE void _Thread_Unblock ( Thread_Control *the_thread ) { _Thread_Clear_state( the_thread, STATES_BLOCKED ); 40031d20: 13 04 01 ff sethi %hi(0x1007fc00), %o1 40031d24: 7f ff 5c 11 call 40008d68 <_Thread_Clear_state> 40031d28: 92 12 63 f8 or %o1, 0x3f8, %o1 ! 1007fff8 40031d2c: 30 80 00 06 b,a 40031d44 <_Rate_monotonic_Timeout+0x78> _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 ) { 40031d30: 80 a0 60 01 cmp %g1, 1 40031d34: 12 80 00 0d bne 40031d68 <_Rate_monotonic_Timeout+0x9c> 40031d38: 82 10 20 04 mov 4, %g1 the_period->state = RATE_MONOTONIC_EXPIRED_WHILE_BLOCKING; 40031d3c: 82 10 20 03 mov 3, %g1 40031d40: c2 27 60 38 st %g1, [ %i5 + 0x38 ] _Rate_monotonic_Initiate_statistics( the_period ); 40031d44: 7f ff ff 51 call 40031a88 <_Rate_monotonic_Initiate_statistics> 40031d48: 90 10 00 1d mov %i5, %o0 Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 40031d4c: c2 07 60 3c ld [ %i5 + 0x3c ], %g1 _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 40031d50: 11 10 01 87 sethi %hi(0x40061c00), %o0 Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 40031d54: c2 27 60 1c st %g1, [ %i5 + 0x1c ] _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 40031d58: 90 12 20 98 or %o0, 0x98, %o0 40031d5c: 7f ff 5f da call 40009cc4 <_Watchdog_Insert> 40031d60: 92 07 60 10 add %i5, 0x10, %o1 40031d64: 30 80 00 02 b,a 40031d6c <_Rate_monotonic_Timeout+0xa0> _Watchdog_Insert_ticks( &the_period->Timer, the_period->next_length ); } else the_period->state = RATE_MONOTONIC_EXPIRED; 40031d68: c2 27 60 38 st %g1, [ %i5 + 0x38 ] * * 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; 40031d6c: 03 10 01 87 sethi %hi(0x40061c00), %g1 40031d70: c4 00 60 00 ld [ %g1 ], %g2 --level; 40031d74: 84 00 bf ff add %g2, -1, %g2 _Thread_Dispatch_disable_level = level; 40031d78: c4 20 60 00 st %g2, [ %g1 ] 40031d7c: 81 c7 e0 08 ret 40031d80: 81 e8 00 00 restore =============================================================================== 40031964 <_Rate_monotonic_Update_statistics>: } static void _Rate_monotonic_Update_statistics( Rate_monotonic_Control *the_period ) { 40031964: 9d e3 bf 90 save %sp, -112, %sp /* * Update the counts. */ stats = &the_period->Statistics; stats->count++; 40031968: c2 06 20 58 ld [ %i0 + 0x58 ], %g1 4003196c: 82 00 60 01 inc %g1 40031970: c2 26 20 58 st %g1, [ %i0 + 0x58 ] if ( the_period->state == RATE_MONOTONIC_EXPIRED ) 40031974: c2 06 20 38 ld [ %i0 + 0x38 ], %g1 40031978: 80 a0 60 04 cmp %g1, 4 4003197c: 12 80 00 05 bne 40031990 <_Rate_monotonic_Update_statistics+0x2c> 40031980: 90 10 00 18 mov %i0, %o0 stats->missed_count++; 40031984: c2 06 20 5c ld [ %i0 + 0x5c ], %g1 40031988: 82 00 60 01 inc %g1 4003198c: c2 26 20 5c st %g1, [ %i0 + 0x5c ] /* * Grab status for time statistics. */ valid_status = 40031990: 92 07 bf f8 add %fp, -8, %o1 40031994: 7f ff ff cc call 400318c4 <_Rate_monotonic_Get_status> 40031998: 94 07 bf f0 add %fp, -16, %o2 _Rate_monotonic_Get_status( the_period, &since_last_period, &executed ); if (!valid_status) 4003199c: 80 8a 20 ff btst 0xff, %o0 400319a0: 02 80 00 38 be 40031a80 <_Rate_monotonic_Update_statistics+0x11c> 400319a4: c4 1f bf f0 ldd [ %fp + -16 ], %g2 static inline void _Timestamp64_implementation_Add_to( Timestamp64_Control *_time, const Timestamp64_Control *_add ) { *_time += *_add; 400319a8: f8 1e 20 70 ldd [ %i0 + 0x70 ], %i4 * 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 ) ) 400319ac: c2 06 20 60 ld [ %i0 + 0x60 ], %g1 400319b0: b6 87 40 03 addcc %i5, %g3, %i3 400319b4: b4 47 00 02 addx %i4, %g2, %i2 400319b8: 80 a0 40 02 cmp %g1, %g2 400319bc: 14 80 00 09 bg 400319e0 <_Rate_monotonic_Update_statistics+0x7c> 400319c0: f4 3e 20 70 std %i2, [ %i0 + 0x70 ] 400319c4: 80 a0 40 02 cmp %g1, %g2 400319c8: 32 80 00 08 bne,a 400319e8 <_Rate_monotonic_Update_statistics+0x84><== NEVER TAKEN 400319cc: c2 06 20 68 ld [ %i0 + 0x68 ], %g1 <== NOT EXECUTED 400319d0: c2 06 20 64 ld [ %i0 + 0x64 ], %g1 400319d4: 80 a0 40 03 cmp %g1, %g3 400319d8: 28 80 00 04 bleu,a 400319e8 <_Rate_monotonic_Update_statistics+0x84> 400319dc: c2 06 20 68 ld [ %i0 + 0x68 ], %g1 stats->min_cpu_time = executed; 400319e0: c4 3e 20 60 std %g2, [ %i0 + 0x60 ] if ( _Timestamp_Greater_than( &executed, &stats->max_cpu_time ) ) 400319e4: c2 06 20 68 ld [ %i0 + 0x68 ], %g1 400319e8: 80 a0 40 02 cmp %g1, %g2 400319ec: 26 80 00 0a bl,a 40031a14 <_Rate_monotonic_Update_statistics+0xb0><== NEVER TAKEN 400319f0: c4 3e 20 68 std %g2, [ %i0 + 0x68 ] <== NOT EXECUTED 400319f4: 80 a0 40 02 cmp %g1, %g2 400319f8: 32 80 00 08 bne,a 40031a18 <_Rate_monotonic_Update_statistics+0xb4><== NEVER TAKEN 400319fc: c4 1f bf f8 ldd [ %fp + -8 ], %g2 <== NOT EXECUTED 40031a00: c2 06 20 6c ld [ %i0 + 0x6c ], %g1 40031a04: 80 a0 40 03 cmp %g1, %g3 40031a08: 3a 80 00 04 bcc,a 40031a18 <_Rate_monotonic_Update_statistics+0xb4> 40031a0c: c4 1f bf f8 ldd [ %fp + -8 ], %g2 stats->max_cpu_time = executed; 40031a10: c4 3e 20 68 std %g2, [ %i0 + 0x68 ] /* * Update Wall time */ #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ _Timestamp_Add_to( &stats->total_wall_time, &since_last_period ); 40031a14: c4 1f bf f8 ldd [ %fp + -8 ], %g2 40031a18: f8 1e 20 88 ldd [ %i0 + 0x88 ], %i4 if ( _Timestamp_Less_than( &since_last_period, &stats->min_wall_time ) ) 40031a1c: c2 06 20 78 ld [ %i0 + 0x78 ], %g1 40031a20: b6 87 40 03 addcc %i5, %g3, %i3 40031a24: b4 47 00 02 addx %i4, %g2, %i2 40031a28: 80 a0 40 02 cmp %g1, %g2 40031a2c: 14 80 00 09 bg 40031a50 <_Rate_monotonic_Update_statistics+0xec> 40031a30: f4 3e 20 88 std %i2, [ %i0 + 0x88 ] 40031a34: 80 a0 40 02 cmp %g1, %g2 40031a38: 32 80 00 08 bne,a 40031a58 <_Rate_monotonic_Update_statistics+0xf4><== NEVER TAKEN 40031a3c: c2 06 20 80 ld [ %i0 + 0x80 ], %g1 <== NOT EXECUTED 40031a40: c2 06 20 7c ld [ %i0 + 0x7c ], %g1 40031a44: 80 a0 40 03 cmp %g1, %g3 40031a48: 28 80 00 04 bleu,a 40031a58 <_Rate_monotonic_Update_statistics+0xf4> 40031a4c: c2 06 20 80 ld [ %i0 + 0x80 ], %g1 stats->min_wall_time = since_last_period; 40031a50: c4 3e 20 78 std %g2, [ %i0 + 0x78 ] if ( _Timestamp_Greater_than( &since_last_period, &stats->max_wall_time ) ) 40031a54: c2 06 20 80 ld [ %i0 + 0x80 ], %g1 40031a58: 80 a0 40 02 cmp %g1, %g2 40031a5c: 26 80 00 09 bl,a 40031a80 <_Rate_monotonic_Update_statistics+0x11c><== NEVER TAKEN 40031a60: c4 3e 20 80 std %g2, [ %i0 + 0x80 ] <== NOT EXECUTED 40031a64: 80 a0 40 02 cmp %g1, %g2 40031a68: 12 80 00 06 bne 40031a80 <_Rate_monotonic_Update_statistics+0x11c><== NEVER TAKEN 40031a6c: 01 00 00 00 nop 40031a70: c2 06 20 84 ld [ %i0 + 0x84 ], %g1 40031a74: 80 a0 40 03 cmp %g1, %g3 40031a78: 2a 80 00 02 bcs,a 40031a80 <_Rate_monotonic_Update_statistics+0x11c> 40031a7c: c4 3e 20 80 std %g2, [ %i0 + 0x80 ] 40031a80: 81 c7 e0 08 ret 40031a84: 81 e8 00 00 restore =============================================================================== 40009794 <_Scheduler_CBS_Allocate>: #include void *_Scheduler_CBS_Allocate( Thread_Control *the_thread ) { 40009794: 9d e3 bf a0 save %sp, -96, %sp void *sched; Scheduler_CBS_Per_thread *schinfo; sched = _Workspace_Allocate(sizeof(Scheduler_CBS_Per_thread)); 40009798: 40 00 06 7d call 4000b18c <_Workspace_Allocate> 4000979c: 90 10 20 1c mov 0x1c, %o0 if ( sched ) { 400097a0: 80 a2 20 00 cmp %o0, 0 400097a4: 02 80 00 06 be 400097bc <_Scheduler_CBS_Allocate+0x28> <== NEVER TAKEN 400097a8: 82 10 20 02 mov 2, %g1 the_thread->scheduler_info = sched; 400097ac: d0 26 20 88 st %o0, [ %i0 + 0x88 ] schinfo = (Scheduler_CBS_Per_thread *)(the_thread->scheduler_info); schinfo->edf_per_thread.thread = the_thread; 400097b0: f0 22 00 00 st %i0, [ %o0 ] schinfo->edf_per_thread.queue_state = SCHEDULER_EDF_QUEUE_STATE_NEVER_HAS_BEEN; 400097b4: c2 22 20 14 st %g1, [ %o0 + 0x14 ] schinfo->cbs_server = NULL; 400097b8: c0 22 20 18 clr [ %o0 + 0x18 ] } return sched; } 400097bc: 81 c7 e0 08 ret 400097c0: 91 e8 00 08 restore %g0, %o0, %o0 =============================================================================== 4000aad4 <_Scheduler_CBS_Budget_callout>: Scheduler_CBS_Server **_Scheduler_CBS_Server_list; void _Scheduler_CBS_Budget_callout( Thread_Control *the_thread ) { 4000aad4: 9d e3 bf 98 save %sp, -104, %sp 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; 4000aad8: d2 06 20 ac ld [ %i0 + 0xac ], %o1 if ( the_thread->real_priority != new_priority ) 4000aadc: c2 06 20 18 ld [ %i0 + 0x18 ], %g1 4000aae0: 80 a0 40 09 cmp %g1, %o1 4000aae4: 32 80 00 02 bne,a 4000aaec <_Scheduler_CBS_Budget_callout+0x18><== ALWAYS TAKEN 4000aae8: d2 26 20 18 st %o1, [ %i0 + 0x18 ] the_thread->real_priority = new_priority; if ( the_thread->current_priority != new_priority ) 4000aaec: c2 06 20 14 ld [ %i0 + 0x14 ], %g1 4000aaf0: 80 a0 40 09 cmp %g1, %o1 4000aaf4: 02 80 00 04 be 4000ab04 <_Scheduler_CBS_Budget_callout+0x30><== NEVER TAKEN 4000aaf8: 90 10 00 18 mov %i0, %o0 _Thread_Change_priority(the_thread, new_priority, true); 4000aafc: 40 00 01 81 call 4000b100 <_Thread_Change_priority> 4000ab00: 94 10 20 01 mov 1, %o2 /* Invoke callback function if any. */ sched_info = (Scheduler_CBS_Per_thread *) the_thread->scheduler_info; 4000ab04: fa 06 20 88 ld [ %i0 + 0x88 ], %i5 if ( sched_info->cbs_server->cbs_budget_overrun ) { 4000ab08: c2 07 60 18 ld [ %i5 + 0x18 ], %g1 4000ab0c: c4 00 60 0c ld [ %g1 + 0xc ], %g2 4000ab10: 80 a0 a0 00 cmp %g2, 0 4000ab14: 02 80 00 09 be 4000ab38 <_Scheduler_CBS_Budget_callout+0x64><== NEVER TAKEN 4000ab18: 01 00 00 00 nop _Scheduler_CBS_Get_server_id( 4000ab1c: d0 00 40 00 ld [ %g1 ], %o0 4000ab20: 7f ff ff d7 call 4000aa7c <_Scheduler_CBS_Get_server_id> 4000ab24: 92 07 bf fc add %fp, -4, %o1 sched_info->cbs_server->task_id, &server_id ); sched_info->cbs_server->cbs_budget_overrun( server_id ); 4000ab28: c2 07 60 18 ld [ %i5 + 0x18 ], %g1 4000ab2c: c2 00 60 0c ld [ %g1 + 0xc ], %g1 4000ab30: 9f c0 40 00 call %g1 4000ab34: d0 07 bf fc ld [ %fp + -4 ], %o0 4000ab38: 81 c7 e0 08 ret 4000ab3c: 81 e8 00 00 restore =============================================================================== 4000a6dc <_Scheduler_CBS_Create_server>: int _Scheduler_CBS_Create_server ( Scheduler_CBS_Parameters *params, Scheduler_CBS_Budget_overrun budget_overrun_callback, rtems_id *server_id ) { 4000a6dc: 9d e3 bf a0 save %sp, -96, %sp unsigned int i; Scheduler_CBS_Server *the_server; if ( params->budget <= 0 || 4000a6e0: c2 06 20 04 ld [ %i0 + 4 ], %g1 4000a6e4: 80 a0 60 00 cmp %g1, 0 4000a6e8: 04 80 00 1d ble 4000a75c <_Scheduler_CBS_Create_server+0x80> 4000a6ec: 01 00 00 00 nop 4000a6f0: c2 06 00 00 ld [ %i0 ], %g1 4000a6f4: 80 a0 60 00 cmp %g1, 0 4000a6f8: 04 80 00 19 ble 4000a75c <_Scheduler_CBS_Create_server+0x80> 4000a6fc: 03 10 00 7e sethi %hi(0x4001f800), %g1 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++ ) { 4000a700: c4 00 60 b0 ld [ %g1 + 0xb0 ], %g2 ! 4001f8b0 <_Scheduler_CBS_Maximum_servers> if ( !_Scheduler_CBS_Server_list[i] ) 4000a704: 03 10 00 81 sethi %hi(0x40020400), %g1 4000a708: c6 00 62 28 ld [ %g1 + 0x228 ], %g3 ! 40020628 <_Scheduler_CBS_Server_list> 4000a70c: 10 80 00 07 b 4000a728 <_Scheduler_CBS_Create_server+0x4c> 4000a710: 82 10 20 00 clr %g1 4000a714: c8 00 c0 1c ld [ %g3 + %i4 ], %g4 4000a718: 80 a1 20 00 cmp %g4, 0 4000a71c: 02 80 00 14 be 4000a76c <_Scheduler_CBS_Create_server+0x90> 4000a720: 3b 10 00 81 sethi %hi(0x40020400), %i5 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++ ) { 4000a724: 82 00 60 01 inc %g1 4000a728: 80 a0 40 02 cmp %g1, %g2 4000a72c: 12 bf ff fa bne 4000a714 <_Scheduler_CBS_Create_server+0x38> 4000a730: b9 28 60 02 sll %g1, 2, %i4 if ( !_Scheduler_CBS_Server_list[i] ) break; } if ( i == _Scheduler_CBS_Maximum_servers ) return SCHEDULER_CBS_ERROR_FULL; 4000a734: 81 c7 e0 08 ret 4000a738: 91 e8 3f e6 restore %g0, -26, %o0 _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; 4000a73c: c4 20 60 04 st %g2, [ %g1 + 4 ] 4000a740: c4 06 20 04 ld [ %i0 + 4 ], %g2 the_server->task_id = -1; the_server->cbs_budget_overrun = budget_overrun_callback; 4000a744: f2 20 60 0c st %i1, [ %g1 + 0xc ] _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; 4000a748: c4 20 60 08 st %g2, [ %g1 + 8 ] the_server->task_id = -1; 4000a74c: 84 10 3f ff mov -1, %g2 4000a750: c4 20 40 00 st %g2, [ %g1 ] the_server->cbs_budget_overrun = budget_overrun_callback; return SCHEDULER_CBS_OK; 4000a754: 81 c7 e0 08 ret 4000a758: 91 e8 20 00 restore %g0, 0, %o0 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; 4000a75c: 81 c7 e0 08 ret 4000a760: 91 e8 3f ee restore %g0, -18, %o0 *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 ) return SCHEDULER_CBS_ERROR_NO_MEMORY; 4000a764: 81 c7 e0 08 ret <== NOT EXECUTED 4000a768: 91 e8 3f ef restore %g0, -17, %o0 <== NOT EXECUTED if ( i == _Scheduler_CBS_Maximum_servers ) return SCHEDULER_CBS_ERROR_FULL; *server_id = i; _Scheduler_CBS_Server_list[*server_id] = (Scheduler_CBS_Server *) 4000a76c: f6 07 62 28 ld [ %i5 + 0x228 ], %i3 } if ( i == _Scheduler_CBS_Maximum_servers ) return SCHEDULER_CBS_ERROR_FULL; *server_id = i; 4000a770: c2 26 80 00 st %g1, [ %i2 ] _Scheduler_CBS_Server_list[*server_id] = (Scheduler_CBS_Server *) _Workspace_Allocate( sizeof(Scheduler_CBS_Server) ); 4000a774: 40 00 07 6f call 4000c530 <_Workspace_Allocate> 4000a778: 90 10 20 10 mov 0x10, %o0 the_server = _Scheduler_CBS_Server_list[*server_id]; 4000a77c: c2 06 80 00 ld [ %i2 ], %g1 if ( i == _Scheduler_CBS_Maximum_servers ) return SCHEDULER_CBS_ERROR_FULL; *server_id = i; _Scheduler_CBS_Server_list[*server_id] = (Scheduler_CBS_Server *) 4000a780: d0 26 c0 1c st %o0, [ %i3 + %i4 ] _Workspace_Allocate( sizeof(Scheduler_CBS_Server) ); the_server = _Scheduler_CBS_Server_list[*server_id]; 4000a784: c4 07 62 28 ld [ %i5 + 0x228 ], %g2 4000a788: 83 28 60 02 sll %g1, 2, %g1 4000a78c: c2 00 80 01 ld [ %g2 + %g1 ], %g1 if ( !the_server ) 4000a790: 80 a0 60 00 cmp %g1, 0 4000a794: 32 bf ff ea bne,a 4000a73c <_Scheduler_CBS_Create_server+0x60><== ALWAYS TAKEN 4000a798: c4 06 00 00 ld [ %i0 ], %g2 4000a79c: 30 bf ff f2 b,a 4000a764 <_Scheduler_CBS_Create_server+0x88><== NOT EXECUTED =============================================================================== 4000a814 <_Scheduler_CBS_Detach_thread>: int _Scheduler_CBS_Detach_thread ( Scheduler_CBS_Server_id server_id, rtems_id task_id ) { 4000a814: 9d e3 bf 98 save %sp, -104, %sp Objects_Locations location; Thread_Control *the_thread; Scheduler_CBS_Per_thread *sched_info; the_thread = _Thread_Get(task_id, &location); 4000a818: 90 10 00 19 mov %i1, %o0 4000a81c: 40 00 03 5f call 4000b598 <_Thread_Get> 4000a820: 92 07 bf fc add %fp, -4, %o1 /* The routine _Thread_Get may disable dispatch and not enable again. */ if ( the_thread ) { 4000a824: ba 92 20 00 orcc %o0, 0, %i5 4000a828: 02 80 00 05 be 4000a83c <_Scheduler_CBS_Detach_thread+0x28> 4000a82c: 03 10 00 7e sethi %hi(0x4001f800), %g1 _Thread_Enable_dispatch(); 4000a830: 40 00 03 4e call 4000b568 <_Thread_Enable_dispatch> 4000a834: 01 00 00 00 nop } if ( server_id >= _Scheduler_CBS_Maximum_servers ) 4000a838: 03 10 00 7e sethi %hi(0x4001f800), %g1 4000a83c: c2 00 60 b0 ld [ %g1 + 0xb0 ], %g1 ! 4001f8b0 <_Scheduler_CBS_Maximum_servers> 4000a840: 80 a6 00 01 cmp %i0, %g1 4000a844: 1a 80 00 1b bcc 4000a8b0 <_Scheduler_CBS_Detach_thread+0x9c> 4000a848: 80 a7 60 00 cmp %i5, 0 return SCHEDULER_CBS_ERROR_INVALID_PARAMETER; if ( !the_thread ) 4000a84c: 02 80 00 19 be 4000a8b0 <_Scheduler_CBS_Detach_thread+0x9c> 4000a850: 03 10 00 81 sethi %hi(0x40020400), %g1 return SCHEDULER_CBS_ERROR_INVALID_PARAMETER; /* Server is not valid. */ if ( !_Scheduler_CBS_Server_list[server_id] ) 4000a854: c2 00 62 28 ld [ %g1 + 0x228 ], %g1 ! 40020628 <_Scheduler_CBS_Server_list> 4000a858: b1 2e 20 02 sll %i0, 2, %i0 4000a85c: c2 00 40 18 ld [ %g1 + %i0 ], %g1 4000a860: 80 a0 60 00 cmp %g1, 0 4000a864: 02 80 00 11 be 4000a8a8 <_Scheduler_CBS_Detach_thread+0x94> 4000a868: 01 00 00 00 nop return SCHEDULER_CBS_ERROR_NOSERVER; /* Thread and server are not attached. */ if ( _Scheduler_CBS_Server_list[server_id]->task_id != task_id ) 4000a86c: c4 00 40 00 ld [ %g1 ], %g2 4000a870: 80 a0 80 19 cmp %g2, %i1 4000a874: 12 80 00 0f bne 4000a8b0 <_Scheduler_CBS_Detach_thread+0x9c><== NEVER TAKEN 4000a878: 84 10 3f ff mov -1, %g2 return SCHEDULER_CBS_ERROR_INVALID_PARAMETER; _Scheduler_CBS_Server_list[server_id]->task_id = -1; 4000a87c: c4 20 40 00 st %g2, [ %g1 ] sched_info = (Scheduler_CBS_Per_thread *) the_thread->scheduler_info; sched_info->cbs_server = NULL; 4000a880: c2 07 60 88 ld [ %i5 + 0x88 ], %g1 4000a884: c0 20 60 18 clr [ %g1 + 0x18 ] the_thread->budget_algorithm = the_thread->Start.budget_algorithm; 4000a888: c2 07 60 a0 ld [ %i5 + 0xa0 ], %g1 4000a88c: c2 27 60 78 st %g1, [ %i5 + 0x78 ] the_thread->budget_callout = the_thread->Start.budget_callout; 4000a890: c2 07 60 a4 ld [ %i5 + 0xa4 ], %g1 4000a894: c2 27 60 7c st %g1, [ %i5 + 0x7c ] the_thread->is_preemptible = the_thread->Start.is_preemptible; 4000a898: c2 0f 60 9c ldub [ %i5 + 0x9c ], %g1 4000a89c: c2 2f 60 70 stb %g1, [ %i5 + 0x70 ] return SCHEDULER_CBS_OK; 4000a8a0: 81 c7 e0 08 ret 4000a8a4: 91 e8 20 00 restore %g0, 0, %o0 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] ) return SCHEDULER_CBS_ERROR_NOSERVER; 4000a8a8: 81 c7 e0 08 ret 4000a8ac: 91 e8 3f e7 restore %g0, -25, %o0 the_thread->budget_algorithm = the_thread->Start.budget_algorithm; the_thread->budget_callout = the_thread->Start.budget_callout; the_thread->is_preemptible = the_thread->Start.is_preemptible; return SCHEDULER_CBS_OK; } 4000a8b0: 81 c7 e0 08 ret 4000a8b4: 91 e8 3f ee restore %g0, -18, %o0 =============================================================================== 4000ab40 <_Scheduler_CBS_Initialize>: } } int _Scheduler_CBS_Initialize(void) { 4000ab40: 9d e3 bf a0 save %sp, -96, %sp unsigned int i; _Scheduler_CBS_Server_list = (Scheduler_CBS_Server **) _Workspace_Allocate( _Scheduler_CBS_Maximum_servers * sizeof(Scheduler_CBS_Server*) ); 4000ab44: 3b 10 00 7e sethi %hi(0x4001f800), %i5 4000ab48: d0 07 60 b0 ld [ %i5 + 0xb0 ], %o0 ! 4001f8b0 <_Scheduler_CBS_Maximum_servers> } int _Scheduler_CBS_Initialize(void) { unsigned int i; _Scheduler_CBS_Server_list = (Scheduler_CBS_Server **) _Workspace_Allocate( 4000ab4c: 40 00 06 79 call 4000c530 <_Workspace_Allocate> 4000ab50: 91 2a 20 02 sll %o0, 2, %o0 4000ab54: 05 10 00 81 sethi %hi(0x40020400), %g2 _Scheduler_CBS_Maximum_servers * sizeof(Scheduler_CBS_Server*) ); if ( !_Scheduler_CBS_Server_list ) 4000ab58: 80 a2 20 00 cmp %o0, 0 4000ab5c: 02 80 00 0d be 4000ab90 <_Scheduler_CBS_Initialize+0x50> <== NEVER TAKEN 4000ab60: d0 20 a2 28 st %o0, [ %g2 + 0x228 ] return SCHEDULER_CBS_ERROR_NO_MEMORY; for (i = 0; i<_Scheduler_CBS_Maximum_servers; i++) { 4000ab64: c6 07 60 b0 ld [ %i5 + 0xb0 ], %g3 4000ab68: 10 80 00 05 b 4000ab7c <_Scheduler_CBS_Initialize+0x3c> 4000ab6c: 82 10 20 00 clr %g1 _Scheduler_CBS_Server_list[i] = NULL; 4000ab70: 89 28 60 02 sll %g1, 2, %g4 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++) { 4000ab74: 82 00 60 01 inc %g1 _Scheduler_CBS_Server_list[i] = NULL; 4000ab78: c0 27 40 04 clr [ %i5 + %g4 ] 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++) { 4000ab7c: 80 a0 40 03 cmp %g1, %g3 4000ab80: 12 bf ff fc bne 4000ab70 <_Scheduler_CBS_Initialize+0x30> 4000ab84: fa 00 a2 28 ld [ %g2 + 0x228 ], %i5 _Scheduler_CBS_Server_list[i] = NULL; } return SCHEDULER_CBS_OK; 4000ab88: 81 c7 e0 08 ret 4000ab8c: 91 e8 20 00 restore %g0, 0, %o0 } 4000ab90: 81 c7 e0 08 ret <== NOT EXECUTED 4000ab94: 91 e8 3f ef restore %g0, -17, %o0 <== NOT EXECUTED =============================================================================== 400097c4 <_Scheduler_CBS_Release_job>: { 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; 400097c4: c2 02 20 88 ld [ %o0 + 0x88 ], %g1 if (deadline) { 400097c8: 80 a2 60 00 cmp %o1, 0 400097cc: 02 80 00 10 be 4000980c <_Scheduler_CBS_Release_job+0x48> 400097d0: c2 00 60 18 ld [ %g1 + 0x18 ], %g1 /* Initializing or shifting deadline. */ if (serv_info) 400097d4: 80 a0 60 00 cmp %g1, 0 400097d8: 02 80 00 08 be 400097f8 <_Scheduler_CBS_Release_job+0x34> 400097dc: 05 10 00 7a sethi %hi(0x4001e800), %g2 new_priority = (_Watchdog_Ticks_since_boot + serv_info->parameters.deadline) 400097e0: d2 00 a1 98 ld [ %g2 + 0x198 ], %o1 ! 4001e998 <_Watchdog_Ticks_since_boot> 400097e4: c4 00 60 04 ld [ %g1 + 4 ], %g2 400097e8: 92 02 40 02 add %o1, %g2, %o1 400097ec: 05 20 00 00 sethi %hi(0x80000000), %g2 400097f0: 10 80 00 0a b 40009818 <_Scheduler_CBS_Release_job+0x54> 400097f4: 92 2a 40 02 andn %o1, %g2, %o1 & ~SCHEDULER_EDF_PRIO_MSB; else new_priority = (_Watchdog_Ticks_since_boot + deadline) 400097f8: c2 00 a1 98 ld [ %g2 + 0x198 ], %g1 400097fc: 92 02 40 01 add %o1, %g1, %o1 40009800: 03 20 00 00 sethi %hi(0x80000000), %g1 40009804: 10 80 00 07 b 40009820 <_Scheduler_CBS_Release_job+0x5c> 40009808: 92 2a 40 01 andn %o1, %g1, %o1 /* Switch back to background priority. */ new_priority = the_thread->Start.initial_priority; } /* Budget replenishment for the next job. */ if (serv_info) 4000980c: 80 a0 60 00 cmp %g1, 0 40009810: 02 80 00 04 be 40009820 <_Scheduler_CBS_Release_job+0x5c> <== NEVER TAKEN 40009814: d2 02 20 ac ld [ %o0 + 0xac ], %o1 the_thread->cpu_time_budget = serv_info->parameters.budget; 40009818: c2 00 60 08 ld [ %g1 + 8 ], %g1 4000981c: c2 22 20 74 st %g1, [ %o0 + 0x74 ] the_thread->real_priority = new_priority; 40009820: d2 22 20 18 st %o1, [ %o0 + 0x18 ] _Thread_Change_priority(the_thread, new_priority, true); 40009824: 94 10 20 01 mov 1, %o2 40009828: 82 13 c0 00 mov %o7, %g1 4000982c: 40 00 01 24 call 40009cbc <_Thread_Change_priority> 40009830: 9e 10 40 00 mov %g1, %o7 =============================================================================== 40009834 <_Scheduler_CBS_Unblock>: #include void _Scheduler_CBS_Unblock( Thread_Control *the_thread ) { 40009834: 9d e3 bf a0 save %sp, -96, %sp Scheduler_CBS_Per_thread *sched_info; Scheduler_CBS_Server *serv_info; Priority_Control new_priority; _Scheduler_EDF_Enqueue(the_thread); 40009838: 40 00 00 4c call 40009968 <_Scheduler_EDF_Enqueue> 4000983c: 90 10 00 18 mov %i0, %o0 /* TODO: flash critical section? */ sched_info = (Scheduler_CBS_Per_thread *) the_thread->scheduler_info; serv_info = (Scheduler_CBS_Server *) sched_info->cbs_server; 40009840: c2 06 20 88 ld [ %i0 + 0x88 ], %g1 40009844: fa 00 60 18 ld [ %g1 + 0x18 ], %i5 * 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) { 40009848: 80 a7 60 00 cmp %i5, 0 4000984c: 02 80 00 18 be 400098ac <_Scheduler_CBS_Unblock+0x78> 40009850: 03 10 00 7a sethi %hi(0x4001e800), %g1 time_t budget = serv_info->parameters.budget; time_t deadline_left = the_thread->cpu_time_budget; time_t budget_left = the_thread->real_priority - _Watchdog_Ticks_since_boot; if ( deadline*budget_left > budget*deadline_left ) { 40009854: d2 07 60 04 ld [ %i5 + 4 ], %o1 */ if (serv_info) { 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 - 40009858: d0 00 61 98 ld [ %g1 + 0x198 ], %o0 4000985c: f8 06 20 18 ld [ %i0 + 0x18 ], %i4 _Watchdog_Ticks_since_boot; if ( deadline*budget_left > budget*deadline_left ) { 40009860: 40 00 3b b7 call 4001873c <.umul> 40009864: 90 27 00 08 sub %i4, %o0, %o0 40009868: d2 06 20 74 ld [ %i0 + 0x74 ], %o1 4000986c: b6 10 00 08 mov %o0, %i3 40009870: 40 00 3b b3 call 4001873c <.umul> 40009874: d0 07 60 08 ld [ %i5 + 8 ], %o0 40009878: 80 a6 c0 08 cmp %i3, %o0 4000987c: 24 80 00 0d ble,a 400098b0 <_Scheduler_CBS_Unblock+0x7c> 40009880: 3b 10 00 7a sethi %hi(0x4001e800), %i5 /* Put late unblocked task to background until the end of period. */ new_priority = the_thread->Start.initial_priority; 40009884: d2 06 20 ac ld [ %i0 + 0xac ], %o1 if ( the_thread->real_priority != new_priority ) 40009888: 80 a7 00 09 cmp %i4, %o1 4000988c: 32 80 00 02 bne,a 40009894 <_Scheduler_CBS_Unblock+0x60> 40009890: d2 26 20 18 st %o1, [ %i0 + 0x18 ] the_thread->real_priority = new_priority; if ( the_thread->current_priority != new_priority ) 40009894: c2 06 20 14 ld [ %i0 + 0x14 ], %g1 40009898: 80 a0 40 09 cmp %g1, %o1 4000989c: 02 80 00 04 be 400098ac <_Scheduler_CBS_Unblock+0x78> 400098a0: 90 10 00 18 mov %i0, %o0 _Thread_Change_priority(the_thread, new_priority, true); 400098a4: 40 00 01 06 call 40009cbc <_Thread_Change_priority> 400098a8: 94 10 20 01 mov 1, %o2 * 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, 400098ac: 3b 10 00 7a sethi %hi(0x4001e800), %i5 400098b0: ba 17 62 b0 or %i5, 0x2b0, %i5 ! 4001eab0 <_Per_CPU_Information> 400098b4: c4 07 60 14 ld [ %i5 + 0x14 ], %g2 400098b8: 03 10 00 77 sethi %hi(0x4001dc00), %g1 400098bc: d0 06 20 14 ld [ %i0 + 0x14 ], %o0 400098c0: c2 00 61 94 ld [ %g1 + 0x194 ], %g1 400098c4: 9f c0 40 00 call %g1 400098c8: d2 00 a0 14 ld [ %g2 + 0x14 ], %o1 400098cc: 80 a2 20 00 cmp %o0, 0 400098d0: 04 80 00 0f ble 4000990c <_Scheduler_CBS_Unblock+0xd8> 400098d4: 01 00 00 00 nop _Thread_Heir->current_priority)) { _Thread_Heir = the_thread; if ( _Thread_Executing->is_preemptible || 400098d8: c2 07 60 10 ld [ %i5 + 0x10 ], %g1 * 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; 400098dc: f0 27 60 14 st %i0, [ %i5 + 0x14 ] if ( _Thread_Executing->is_preemptible || 400098e0: c2 08 60 70 ldub [ %g1 + 0x70 ], %g1 400098e4: 80 a0 60 00 cmp %g1, 0 400098e8: 12 80 00 06 bne 40009900 <_Scheduler_CBS_Unblock+0xcc> 400098ec: 84 10 20 01 mov 1, %g2 400098f0: c2 06 20 14 ld [ %i0 + 0x14 ], %g1 400098f4: 80 a0 60 00 cmp %g1, 0 400098f8: 12 80 00 05 bne 4000990c <_Scheduler_CBS_Unblock+0xd8> <== ALWAYS TAKEN 400098fc: 01 00 00 00 nop the_thread->current_priority == 0 ) _Thread_Dispatch_necessary = true; 40009900: 03 10 00 7a sethi %hi(0x4001e800), %g1 40009904: 82 10 62 b0 or %g1, 0x2b0, %g1 ! 4001eab0 <_Per_CPU_Information> 40009908: c4 28 60 0c stb %g2, [ %g1 + 0xc ] 4000990c: 81 c7 e0 08 ret 40009910: 81 e8 00 00 restore =============================================================================== 40009794 <_Scheduler_EDF_Allocate>: #include void *_Scheduler_EDF_Allocate( Thread_Control *the_thread ) { 40009794: 9d e3 bf a0 save %sp, -96, %sp void *sched; Scheduler_EDF_Per_thread *schinfo; sched = _Workspace_Allocate( sizeof(Scheduler_EDF_Per_thread) ); 40009798: 40 00 06 52 call 4000b0e0 <_Workspace_Allocate> 4000979c: 90 10 20 18 mov 0x18, %o0 if ( sched ) { 400097a0: 80 a2 20 00 cmp %o0, 0 400097a4: 02 80 00 05 be 400097b8 <_Scheduler_EDF_Allocate+0x24> <== NEVER TAKEN 400097a8: 82 10 20 02 mov 2, %g1 the_thread->scheduler_info = sched; 400097ac: d0 26 20 88 st %o0, [ %i0 + 0x88 ] schinfo = (Scheduler_EDF_Per_thread *)(the_thread->scheduler_info); schinfo->thread = the_thread; 400097b0: f0 22 00 00 st %i0, [ %o0 ] schinfo->queue_state = SCHEDULER_EDF_QUEUE_STATE_NEVER_HAS_BEEN; 400097b4: c2 22 20 14 st %g1, [ %o0 + 0x14 ] } return sched; } 400097b8: 81 c7 e0 08 ret 400097bc: 91 e8 00 08 restore %g0, %o0, %o0 =============================================================================== 4000995c <_Scheduler_EDF_Unblock>: #include void _Scheduler_EDF_Unblock( Thread_Control *the_thread ) { 4000995c: 9d e3 bf a0 save %sp, -96, %sp _Scheduler_EDF_Enqueue(the_thread); 40009960: 7f ff ff ad call 40009814 <_Scheduler_EDF_Enqueue> 40009964: 90 10 00 18 mov %i0, %o0 * 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( 40009968: 3b 10 00 7a sethi %hi(0x4001e800), %i5 4000996c: ba 17 62 00 or %i5, 0x200, %i5 ! 4001ea00 <_Per_CPU_Information> 40009970: c4 07 60 14 ld [ %i5 + 0x14 ], %g2 40009974: 03 10 00 77 sethi %hi(0x4001dc00), %g1 40009978: d0 00 a0 14 ld [ %g2 + 0x14 ], %o0 4000997c: c2 00 60 e4 ld [ %g1 + 0xe4 ], %g1 40009980: 9f c0 40 00 call %g1 40009984: d2 06 20 14 ld [ %i0 + 0x14 ], %o1 40009988: 80 a2 20 00 cmp %o0, 0 4000998c: 16 80 00 0f bge 400099c8 <_Scheduler_EDF_Unblock+0x6c> 40009990: 01 00 00 00 nop _Thread_Heir->current_priority, the_thread->current_priority )) { _Thread_Heir = the_thread; if ( _Thread_Executing->is_preemptible || 40009994: c2 07 60 10 ld [ %i5 + 0x10 ], %g1 * 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; 40009998: f0 27 60 14 st %i0, [ %i5 + 0x14 ] if ( _Thread_Executing->is_preemptible || 4000999c: c2 08 60 70 ldub [ %g1 + 0x70 ], %g1 400099a0: 80 a0 60 00 cmp %g1, 0 400099a4: 12 80 00 06 bne 400099bc <_Scheduler_EDF_Unblock+0x60> 400099a8: 84 10 20 01 mov 1, %g2 400099ac: c2 06 20 14 ld [ %i0 + 0x14 ], %g1 400099b0: 80 a0 60 00 cmp %g1, 0 400099b4: 12 80 00 05 bne 400099c8 <_Scheduler_EDF_Unblock+0x6c> <== ALWAYS TAKEN 400099b8: 01 00 00 00 nop the_thread->current_priority == 0 ) _Thread_Dispatch_necessary = true; 400099bc: 03 10 00 7a sethi %hi(0x4001e800), %g1 400099c0: 82 10 62 00 or %g1, 0x200, %g1 ! 4001ea00 <_Per_CPU_Information> 400099c4: c4 28 60 0c stb %g2, [ %g1 + 0xc ] 400099c8: 81 c7 e0 08 ret 400099cc: 81 e8 00 00 restore =============================================================================== 40007d4c <_TOD_Validate>: }; bool _TOD_Validate( const rtems_time_of_day *the_tod ) { 40007d4c: 9d e3 bf a0 save %sp, -96, %sp uint32_t days_in_month; uint32_t ticks_per_second; ticks_per_second = TOD_MICROSECONDS_PER_SECOND / 40007d50: 03 10 00 71 sethi %hi(0x4001c400), %g1 40007d54: d2 00 62 dc ld [ %g1 + 0x2dc ], %o1 ! 4001c6dc 40007d58: 11 00 03 d0 sethi %hi(0xf4000), %o0 40007d5c: 40 00 44 bf call 40019058 <.udiv> 40007d60: 90 12 22 40 or %o0, 0x240, %o0 ! f4240 rtems_configuration_get_microseconds_per_tick(); if ((!the_tod) || 40007d64: 80 a6 20 00 cmp %i0, 0 40007d68: 02 80 00 28 be 40007e08 <_TOD_Validate+0xbc> <== NEVER TAKEN 40007d6c: 84 10 20 00 clr %g2 40007d70: c2 06 20 18 ld [ %i0 + 0x18 ], %g1 40007d74: 80 a0 40 08 cmp %g1, %o0 40007d78: 3a 80 00 25 bcc,a 40007e0c <_TOD_Validate+0xc0> 40007d7c: b0 08 a0 01 and %g2, 1, %i0 (the_tod->ticks >= ticks_per_second) || 40007d80: c2 06 20 14 ld [ %i0 + 0x14 ], %g1 40007d84: 80 a0 60 3b cmp %g1, 0x3b 40007d88: 38 80 00 21 bgu,a 40007e0c <_TOD_Validate+0xc0> 40007d8c: b0 08 a0 01 and %g2, 1, %i0 (the_tod->second >= TOD_SECONDS_PER_MINUTE) || 40007d90: c2 06 20 10 ld [ %i0 + 0x10 ], %g1 40007d94: 80 a0 60 3b cmp %g1, 0x3b 40007d98: 38 80 00 1d bgu,a 40007e0c <_TOD_Validate+0xc0> 40007d9c: b0 08 a0 01 and %g2, 1, %i0 (the_tod->minute >= TOD_MINUTES_PER_HOUR) || 40007da0: c2 06 20 0c ld [ %i0 + 0xc ], %g1 40007da4: 80 a0 60 17 cmp %g1, 0x17 40007da8: 38 80 00 19 bgu,a 40007e0c <_TOD_Validate+0xc0> 40007dac: b0 08 a0 01 and %g2, 1, %i0 (the_tod->hour >= TOD_HOURS_PER_DAY) || (the_tod->month == 0) || 40007db0: c2 06 20 04 ld [ %i0 + 4 ], %g1 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) || 40007db4: 80 a0 60 00 cmp %g1, 0 40007db8: 02 80 00 14 be 40007e08 <_TOD_Validate+0xbc> <== NEVER TAKEN 40007dbc: 80 a0 60 0c cmp %g1, 0xc (the_tod->month == 0) || 40007dc0: 38 80 00 13 bgu,a 40007e0c <_TOD_Validate+0xc0> 40007dc4: b0 08 a0 01 and %g2, 1, %i0 (the_tod->month > TOD_MONTHS_PER_YEAR) || (the_tod->year < TOD_BASE_YEAR) || 40007dc8: c8 06 00 00 ld [ %i0 ], %g4 (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) || 40007dcc: 80 a1 27 c3 cmp %g4, 0x7c3 40007dd0: 28 80 00 0f bleu,a 40007e0c <_TOD_Validate+0xc0> 40007dd4: b0 08 a0 01 and %g2, 1, %i0 (the_tod->year < TOD_BASE_YEAR) || (the_tod->day == 0) ) 40007dd8: c6 06 20 08 ld [ %i0 + 8 ], %g3 (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) || 40007ddc: 80 a0 e0 00 cmp %g3, 0 40007de0: 02 80 00 0a be 40007e08 <_TOD_Validate+0xbc> <== NEVER TAKEN 40007de4: 80 89 20 03 btst 3, %g4 40007de8: 05 10 00 75 sethi %hi(0x4001d400), %g2 (the_tod->day == 0) ) return false; if ( (the_tod->year % 4) == 0 ) 40007dec: 12 80 00 03 bne 40007df8 <_TOD_Validate+0xac> 40007df0: 84 10 a3 d0 or %g2, 0x3d0, %g2 ! 4001d7d0 <_TOD_Days_per_month> days_in_month = _TOD_Days_per_month[ 1 ][ the_tod->month ]; 40007df4: 82 00 60 0d add %g1, 0xd, %g1 else days_in_month = _TOD_Days_per_month[ 0 ][ the_tod->month ]; 40007df8: 83 28 60 02 sll %g1, 2, %g1 40007dfc: c2 00 80 01 ld [ %g2 + %g1 ], %g1 if ( the_tod->day > days_in_month ) 40007e00: 80 a0 40 03 cmp %g1, %g3 40007e04: 84 60 3f ff subx %g0, -1, %g2 return false; return true; } 40007e08: b0 08 a0 01 and %g2, 1, %i0 40007e0c: 81 c7 e0 08 ret 40007e10: 81 e8 00 00 restore =============================================================================== 4000931c <_Thread_Change_priority>: void _Thread_Change_priority( Thread_Control *the_thread, Priority_Control new_priority, bool prepend_it ) { 4000931c: 9d e3 bf a0 save %sp, -96, %sp 40009320: ba 10 00 18 mov %i0, %i5 States_Control state, original_state; /* * Save original state */ original_state = the_thread->current_state; 40009324: f0 06 20 10 ld [ %i0 + 0x10 ], %i0 /* * 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 ); 40009328: 40 00 03 46 call 4000a040 <_Thread_Set_transient> 4000932c: 90 10 00 1d mov %i5, %o0 /* * Do not bother recomputing all the priority related information if * we are not REALLY changing priority. */ if ( the_thread->current_priority != new_priority ) 40009330: c2 07 60 14 ld [ %i5 + 0x14 ], %g1 40009334: 80 a0 40 19 cmp %g1, %i1 40009338: 02 80 00 04 be 40009348 <_Thread_Change_priority+0x2c> 4000933c: 90 10 00 1d mov %i5, %o0 _Thread_Set_priority( the_thread, new_priority ); 40009340: 40 00 03 27 call 40009fdc <_Thread_Set_priority> 40009344: 92 10 00 19 mov %i1, %o1 _ISR_Disable( level ); 40009348: 7f ff e3 58 call 400020a8 4000934c: 01 00 00 00 nop 40009350: b6 10 00 08 mov %o0, %i3 /* * 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; 40009354: f8 07 60 10 ld [ %i5 + 0x10 ], %i4 if ( state != STATES_TRANSIENT ) { 40009358: 80 a7 20 04 cmp %i4, 4 4000935c: 02 80 00 10 be 4000939c <_Thread_Change_priority+0x80> 40009360: 82 0e 20 04 and %i0, 4, %g1 /* Only clear the transient state if it wasn't set already */ if ( ! _States_Is_transient( original_state ) ) 40009364: 80 a0 60 00 cmp %g1, 0 40009368: 12 80 00 03 bne 40009374 <_Thread_Change_priority+0x58> <== NEVER TAKEN 4000936c: 82 0f 3f fb and %i4, -5, %g1 the_thread->current_state = _States_Clear( STATES_TRANSIENT, state ); 40009370: c2 27 60 10 st %g1, [ %i5 + 0x10 ] _ISR_Enable( level ); 40009374: 7f ff e3 51 call 400020b8 40009378: 90 10 00 1b mov %i3, %o0 if ( _States_Is_waiting_on_thread_queue( state ) ) { 4000937c: 03 00 00 ef sethi %hi(0x3bc00), %g1 40009380: 82 10 62 e0 or %g1, 0x2e0, %g1 ! 3bee0 40009384: 80 8f 00 01 btst %i4, %g1 40009388: 02 80 00 27 be 40009424 <_Thread_Change_priority+0x108> 4000938c: 01 00 00 00 nop _Thread_queue_Requeue( the_thread->Wait.queue, the_thread ); 40009390: f0 07 60 44 ld [ %i5 + 0x44 ], %i0 40009394: 40 00 02 e5 call 40009f28 <_Thread_queue_Requeue> 40009398: 93 e8 00 1d restore %g0, %i5, %o1 } return; } /* Only clear the transient state if it wasn't set already */ if ( ! _States_Is_transient( original_state ) ) { 4000939c: 80 a0 60 00 cmp %g1, 0 400093a0: 12 80 00 0b bne 400093cc <_Thread_Change_priority+0xb0> <== NEVER TAKEN 400093a4: 03 10 00 70 sethi %hi(0x4001c000), %g1 * 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 ); 400093a8: c0 27 60 10 clr [ %i5 + 0x10 ] if ( prepend_it ) 400093ac: 80 a6 a0 00 cmp %i2, 0 400093b0: 02 80 00 04 be 400093c0 <_Thread_Change_priority+0xa4> 400093b4: 82 10 61 e4 or %g1, 0x1e4, %g1 */ RTEMS_INLINE_ROUTINE void _Scheduler_Enqueue_first( Thread_Control *the_thread ) { _Scheduler.Operations.enqueue_first( the_thread ); 400093b8: 10 80 00 03 b 400093c4 <_Thread_Change_priority+0xa8> 400093bc: c2 00 60 28 ld [ %g1 + 0x28 ], %g1 */ RTEMS_INLINE_ROUTINE void _Scheduler_Enqueue( Thread_Control *the_thread ) { _Scheduler.Operations.enqueue( the_thread ); 400093c0: c2 00 60 24 ld [ %g1 + 0x24 ], %g1 400093c4: 9f c0 40 00 call %g1 400093c8: 90 10 00 1d mov %i5, %o0 _Scheduler_Enqueue_first( the_thread ); else _Scheduler_Enqueue( the_thread ); } _ISR_Flash( level ); 400093cc: 7f ff e3 3b call 400020b8 400093d0: 90 10 00 1b mov %i3, %o0 400093d4: 7f ff e3 35 call 400020a8 400093d8: 01 00 00 00 nop 400093dc: b0 10 00 08 mov %o0, %i0 * 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(); 400093e0: 03 10 00 70 sethi %hi(0x4001c000), %g1 400093e4: c2 00 61 ec ld [ %g1 + 0x1ec ], %g1 ! 4001c1ec <_Scheduler+0x8> 400093e8: 9f c0 40 00 call %g1 400093ec: 01 00 00 00 nop * is also the heir thread, and false otherwise. */ RTEMS_INLINE_ROUTINE bool _Thread_Is_executing_also_the_heir( void ) { return ( _Thread_Executing == _Thread_Heir ); 400093f0: 03 10 00 73 sethi %hi(0x4001cc00), %g1 400093f4: 82 10 62 c0 or %g1, 0x2c0, %g1 ! 4001cec0 <_Per_CPU_Information> * 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() && 400093f8: c4 18 60 10 ldd [ %g1 + 0x10 ], %g2 400093fc: 80 a0 80 03 cmp %g2, %g3 40009400: 02 80 00 07 be 4000941c <_Thread_Change_priority+0x100> 40009404: 01 00 00 00 nop 40009408: c4 08 a0 70 ldub [ %g2 + 0x70 ], %g2 4000940c: 80 a0 a0 00 cmp %g2, 0 40009410: 02 80 00 03 be 4000941c <_Thread_Change_priority+0x100> 40009414: 84 10 20 01 mov 1, %g2 _Thread_Executing->is_preemptible ) _Thread_Dispatch_necessary = true; 40009418: c4 28 60 0c stb %g2, [ %g1 + 0xc ] _ISR_Enable( level ); 4000941c: 7f ff e3 27 call 400020b8 40009420: 81 e8 00 00 restore 40009424: 81 c7 e0 08 ret 40009428: 81 e8 00 00 restore =============================================================================== 400095ec <_Thread_Delay_ended>: void _Thread_Delay_ended( Objects_Id id, void *ignored __attribute__((unused)) ) { 400095ec: 9d e3 bf 98 save %sp, -104, %sp Thread_Control *the_thread; Objects_Locations location; the_thread = _Thread_Get( id, &location ); 400095f0: 90 10 00 18 mov %i0, %o0 400095f4: 40 00 00 70 call 400097b4 <_Thread_Get> 400095f8: 92 07 bf fc add %fp, -4, %o1 switch ( location ) { 400095fc: c2 07 bf fc ld [ %fp + -4 ], %g1 40009600: 80 a0 60 00 cmp %g1, 0 40009604: 12 80 00 08 bne 40009624 <_Thread_Delay_ended+0x38> <== NEVER TAKEN 40009608: 13 04 00 00 sethi %hi(0x10000000), %o1 #if defined(RTEMS_MULTIPROCESSING) case OBJECTS_REMOTE: /* impossible */ #endif break; case OBJECTS_LOCAL: _Thread_Clear_state( 4000960c: 7f ff ff 88 call 4000942c <_Thread_Clear_state> 40009610: 92 12 60 18 or %o1, 0x18, %o1 ! 10000018 * * 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; 40009614: 03 10 00 73 sethi %hi(0x4001cc00), %g1 40009618: c4 00 60 c0 ld [ %g1 + 0xc0 ], %g2 ! 4001ccc0 <_Thread_Dispatch_disable_level> --level; 4000961c: 84 00 bf ff add %g2, -1, %g2 _Thread_Dispatch_disable_level = level; 40009620: c4 20 60 c0 st %g2, [ %g1 + 0xc0 ] 40009624: 81 c7 e0 08 ret 40009628: 81 e8 00 00 restore =============================================================================== 4000962c <_Thread_Dispatch>: #if defined(RTEMS_SMP) #include #endif void _Thread_Dispatch( void ) { 4000962c: 9d e3 bf 98 save %sp, -104, %sp #endif /* * Now determine if we need to perform a dispatch on the current CPU. */ executing = _Thread_Executing; 40009630: 35 10 00 73 sethi %hi(0x4001cc00), %i2 40009634: 82 16 a2 c0 or %i2, 0x2c0, %g1 ! 4001cec0 <_Per_CPU_Information> _ISR_Disable( level ); 40009638: 7f ff e2 9c call 400020a8 4000963c: f6 00 60 10 ld [ %g1 + 0x10 ], %i3 */ static inline void _TOD_Get_uptime( Timestamp_Control *time ) { _TOD_Get_with_nanoseconds( time, &_TOD.uptime ); 40009640: 21 10 00 73 sethi %hi(0x4001cc00), %l0 { 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 ) { 40009644: 27 10 00 70 sethi %hi(0x4001c000), %l3 * 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; 40009648: 33 10 00 73 sethi %hi(0x4001cc00), %i1 #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; 4000964c: 31 10 00 73 sethi %hi(0x4001cc00), %i0 40009650: a0 14 20 10 or %l0, 0x10, %l0 #endif /* * Switch libc's task specific data. */ if ( _Thread_libc_reent ) { 40009654: 23 10 00 73 sethi %hi(0x4001cc00), %l1 */ RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_first( const Chain_Control *the_chain ) { return _Chain_Immutable_head( the_chain )->next; 40009658: 25 10 00 70 sethi %hi(0x4001c000), %l2 /* * Now determine if we need to perform a dispatch on the current CPU. */ executing = _Thread_Executing; _ISR_Disable( level ); while ( _Thread_Dispatch_necessary == true ) { 4000965c: 10 80 00 3b b 40009748 <_Thread_Dispatch+0x11c> 40009660: a6 14 e3 10 or %l3, 0x310, %l3 40009664: 84 10 20 01 mov 1, %g2 40009668: c4 26 60 c0 st %g2, [ %i1 + 0xc0 ] heir = _Thread_Heir; #ifndef RTEMS_SMP _Thread_Dispatch_set_disable_level( 1 ); #endif _Thread_Dispatch_necessary = false; 4000966c: c0 28 60 0c clrb [ %g1 + 0xc ] /* * 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 ) 40009670: 80 a5 00 1b cmp %l4, %i3 40009674: 12 80 00 0a bne 4000969c <_Thread_Dispatch+0x70> 40009678: e8 20 60 10 st %l4, [ %g1 + 0x10 ] 4000967c: 03 10 00 73 sethi %hi(0x4001cc00), %g1 40009680: c0 20 60 c0 clr [ %g1 + 0xc0 ] ! 4001ccc0 <_Thread_Dispatch_disable_level> post_switch: #ifndef RTEMS_SMP _Thread_Dispatch_set_disable_level( 0 ); #endif _ISR_Enable( level ); 40009684: 7f ff e2 8d call 400020b8 40009688: 39 10 00 73 sethi %hi(0x4001cc00), %i4 4000968c: 03 10 00 73 sethi %hi(0x4001cc00), %g1 40009690: fa 00 61 30 ld [ %g1 + 0x130 ], %i5 ! 4001cd30 <_API_extensions_Post_switch_list> { 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 ) { 40009694: 10 80 00 37 b 40009770 <_Thread_Dispatch+0x144> 40009698: b8 17 21 34 or %i4, 0x134, %i4 */ #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 ) 4000969c: c2 05 20 78 ld [ %l4 + 0x78 ], %g1 400096a0: 80 a0 60 01 cmp %g1, 1 400096a4: 12 80 00 03 bne 400096b0 <_Thread_Dispatch+0x84> 400096a8: c2 06 20 20 ld [ %i0 + 0x20 ], %g1 heir->cpu_time_budget = _Thread_Ticks_per_timeslice; 400096ac: c2 25 20 74 st %g1, [ %l4 + 0x74 ] _ISR_Enable( level ); 400096b0: 7f ff e2 82 call 400020b8 400096b4: 01 00 00 00 nop 400096b8: 90 07 bf f8 add %fp, -8, %o0 400096bc: 7f ff f9 eb call 40007e68 <_TOD_Get_with_nanoseconds> 400096c0: 92 10 00 10 mov %l0, %o1 #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ { Timestamp_Control uptime, ran; _TOD_Get_uptime( &uptime ); _Timestamp_Subtract( 400096c4: c4 1f bf f8 ldd [ %fp + -8 ], %g2 400096c8: 82 16 a2 c0 or %i2, 0x2c0, %g1 const Timestamp64_Control *_start, const Timestamp64_Control *_end, Timestamp64_Control *_result ) { *_result = *_end - *_start; 400096cc: f8 18 60 20 ldd [ %g1 + 0x20 ], %i4 400096d0: 96 a0 c0 1d subcc %g3, %i5, %o3 400096d4: 94 60 80 1c subx %g2, %i4, %o2 static inline void _Timestamp64_implementation_Add_to( Timestamp64_Control *_time, const Timestamp64_Control *_add ) { *_time += *_add; 400096d8: f8 1e e0 80 ldd [ %i3 + 0x80 ], %i4 400096dc: 9a 87 40 0b addcc %i5, %o3, %o5 400096e0: 98 47 00 0a addx %i4, %o2, %o4 400096e4: d8 3e e0 80 std %o4, [ %i3 + 0x80 ] &_Thread_Time_of_last_context_switch, &uptime, &ran ); _Timestamp_Add_to( &executing->cpu_time_used, &ran ); _Thread_Time_of_last_context_switch = uptime; 400096e8: c4 38 60 20 std %g2, [ %g1 + 0x20 ] #endif /* * Switch libc's task specific data. */ if ( _Thread_libc_reent ) { 400096ec: c2 04 61 2c ld [ %l1 + 0x12c ], %g1 400096f0: 80 a0 60 00 cmp %g1, 0 400096f4: 22 80 00 0c be,a 40009724 <_Thread_Dispatch+0xf8> <== NEVER TAKEN 400096f8: fa 04 a3 0c ld [ %l2 + 0x30c ], %i5 <== NOT EXECUTED executing->libc_reent = *_Thread_libc_reent; 400096fc: c4 00 40 00 ld [ %g1 ], %g2 40009700: c4 26 e1 48 st %g2, [ %i3 + 0x148 ] *_Thread_libc_reent = heir->libc_reent; 40009704: c4 05 21 48 ld [ %l4 + 0x148 ], %g2 40009708: c4 20 40 00 st %g2, [ %g1 ] 4000970c: 10 80 00 06 b 40009724 <_Thread_Dispatch+0xf8> 40009710: fa 04 a3 0c ld [ %l2 + 0x30c ], %i5 const User_extensions_Switch_control *extension = (const User_extensions_Switch_control *) node; (*extension->thread_switch)( executing, heir ); 40009714: 90 10 00 1b mov %i3, %o0 40009718: 9f c0 40 00 call %g1 4000971c: 92 10 00 14 mov %l4, %o1 */ RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_next( const Chain_Node *the_node ) { return the_node->next; 40009720: fa 07 40 00 ld [ %i5 ], %i5 { 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 ) { 40009724: 80 a7 40 13 cmp %i5, %l3 40009728: 32 bf ff fb bne,a 40009714 <_Thread_Dispatch+0xe8> 4000972c: c2 07 60 08 ld [ %i5 + 8 ], %g1 if ( executing->fp_context != NULL ) _Context_Save_fp( &executing->fp_context ); #endif #endif _Context_Switch( &executing->Registers, &heir->Registers ); 40009730: 90 06 e0 c0 add %i3, 0xc0, %o0 40009734: 40 00 04 22 call 4000a7bc <_CPU_Context_switch> 40009738: 92 05 20 c0 add %l4, 0xc0, %o1 if ( executing->fp_context != NULL ) _Context_Restore_fp( &executing->fp_context ); #endif #endif executing = _Thread_Executing; 4000973c: 82 16 a2 c0 or %i2, 0x2c0, %g1 _ISR_Disable( level ); 40009740: 7f ff e2 5a call 400020a8 40009744: f6 00 60 10 ld [ %g1 + 0x10 ], %i3 /* * Now determine if we need to perform a dispatch on the current CPU. */ executing = _Thread_Executing; _ISR_Disable( level ); while ( _Thread_Dispatch_necessary == true ) { 40009748: 82 16 a2 c0 or %i2, 0x2c0, %g1 4000974c: c4 08 60 0c ldub [ %g1 + 0xc ], %g2 40009750: 80 a0 a0 00 cmp %g2, 0 40009754: 32 bf ff c4 bne,a 40009664 <_Thread_Dispatch+0x38> 40009758: e8 00 60 14 ld [ %g1 + 0x14 ], %l4 4000975c: 10 bf ff c9 b 40009680 <_Thread_Dispatch+0x54> 40009760: 03 10 00 73 sethi %hi(0x4001cc00), %g1 const API_extensions_Post_switch_control *post_switch = (const API_extensions_Post_switch_control *) node; (*post_switch->hook)( executing ); 40009764: 9f c0 40 00 call %g1 40009768: 90 10 00 1b mov %i3, %o0 4000976c: fa 07 40 00 ld [ %i5 ], %i5 { 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 ) { 40009770: 80 a7 40 1c cmp %i5, %i4 40009774: 32 bf ff fc bne,a 40009764 <_Thread_Dispatch+0x138> 40009778: c2 07 60 08 ld [ %i5 + 8 ], %g1 #ifdef RTEMS_SMP _Thread_Unnest_dispatch(); #endif _API_extensions_Run_post_switch( executing ); } 4000977c: 81 c7 e0 08 ret 40009780: 81 e8 00 00 restore =============================================================================== 4000db30 <_Thread_Handler>: #define INIT_NAME __main #define EXECUTE_GLOBAL_CONSTRUCTORS #endif void _Thread_Handler( void ) { 4000db30: 9d e3 bf a0 save %sp, -96, %sp #if defined(EXECUTE_GLOBAL_CONSTRUCTORS) static bool doneConstructors; bool doCons; #endif executing = _Thread_Executing; 4000db34: 03 10 00 73 sethi %hi(0x4001cc00), %g1 4000db38: fa 00 62 d0 ld [ %g1 + 0x2d0 ], %i5 ! 4001ced0 <_Per_CPU_Information+0x10> /* * Some CPUs need to tinker with the call frame or registers when the * thread actually begins to execute for the first time. This is a * hook point where the port gets a shot at doing whatever it requires. */ _Context_Initialization_at_thread_begin(); 4000db3c: 3f 10 00 36 sethi %hi(0x4000d800), %i7 4000db40: be 17 e3 30 or %i7, 0x330, %i7 ! 4000db30 <_Thread_Handler> /* * have to put level into a register for those cpu's that use * inline asm here */ level = executing->Start.isr_level; 4000db44: d0 07 60 a8 ld [ %i5 + 0xa8 ], %o0 _ISR_Set_level(level); 4000db48: 7f ff d1 5c call 400020b8 4000db4c: 91 2a 20 08 sll %o0, 8, %o0 doCons = !doneConstructors && _Objects_Get_API( executing->Object.id ) != OBJECTS_INTERNAL_API; if (doCons) doneConstructors = true; #else doCons = !doneConstructors; 4000db50: 03 10 00 72 sethi %hi(0x4001c800), %g1 doneConstructors = true; 4000db54: 84 10 20 01 mov 1, %g2 doCons = !doneConstructors && _Objects_Get_API( executing->Object.id ) != OBJECTS_INTERNAL_API; if (doCons) doneConstructors = true; #else doCons = !doneConstructors; 4000db58: f8 08 61 b0 ldub [ %g1 + 0x1b0 ], %i4 ); } static inline void _User_extensions_Thread_begin( Thread_Control *executing ) { _User_extensions_Iterate( 4000db5c: 90 10 00 1d mov %i5, %o0 4000db60: 13 10 00 28 sethi %hi(0x4000a000), %o1 4000db64: 92 12 62 14 or %o1, 0x214, %o1 ! 4000a214 <_User_extensions_Thread_begin_visitor> 4000db68: 7f ff f1 c8 call 4000a288 <_User_extensions_Iterate> 4000db6c: c4 28 61 b0 stb %g2, [ %g1 + 0x1b0 ] _User_extensions_Thread_begin( executing ); /* * At this point, the dispatch disable level BETTER be 1. */ _Thread_Enable_dispatch(); 4000db70: 7f ff ef 05 call 40009784 <_Thread_Enable_dispatch> 4000db74: 01 00 00 00 nop /* * _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) */ { 4000db78: 80 8f 20 ff btst 0xff, %i4 4000db7c: 32 80 00 05 bne,a 4000db90 <_Thread_Handler+0x60> 4000db80: c2 07 60 90 ld [ %i5 + 0x90 ], %g1 INIT_NAME (); 4000db84: 40 00 39 63 call 4001c110 <_init> 4000db88: 01 00 00 00 nop _Thread_Enable_dispatch(); #endif } #endif if ( executing->Start.prototype == THREAD_START_NUMERIC ) { 4000db8c: c2 07 60 90 ld [ %i5 + 0x90 ], %g1 4000db90: 80 a0 60 00 cmp %g1, 0 4000db94: 12 80 00 07 bne 4000dbb0 <_Thread_Handler+0x80> <== NEVER TAKEN 4000db98: 90 10 00 1d mov %i5, %o0 executing->Wait.return_argument = (*(Thread_Entry_numeric) executing->Start.entry_point)( 4000db9c: c2 07 60 8c ld [ %i5 + 0x8c ], %g1 4000dba0: 9f c0 40 00 call %g1 4000dba4: d0 07 60 98 ld [ %i5 + 0x98 ], %o0 #endif } #endif if ( executing->Start.prototype == THREAD_START_NUMERIC ) { executing->Wait.return_argument = 4000dba8: d0 27 60 28 st %o0, [ %i5 + 0x28 ] } } static inline void _User_extensions_Thread_exitted( Thread_Control *executing ) { _User_extensions_Iterate( 4000dbac: 90 10 00 1d mov %i5, %o0 4000dbb0: 13 10 00 28 sethi %hi(0x4000a000), %o1 4000dbb4: 7f ff f1 b5 call 4000a288 <_User_extensions_Iterate> 4000dbb8: 92 12 62 38 or %o1, 0x238, %o1 ! 4000a238 <_User_extensions_Thread_exitted_visitor> * able to fit in a (void *). */ _User_extensions_Thread_exitted( executing ); _Internal_error_Occurred( 4000dbbc: 90 10 20 00 clr %o0 4000dbc0: 92 10 20 01 mov 1, %o1 4000dbc4: 7f ff e9 dd call 40008338 <_Internal_error_Occurred> 4000dbc8: 94 10 20 05 mov 5, %o2 =============================================================================== 40009a10 <_Thread_Handler_initialization>: #if defined(RTEMS_SMP) #include #endif void _Thread_Handler_initialization(void) { 40009a10: 9d e3 bf 98 save %sp, -104, %sp uint32_t ticks_per_timeslice = 40009a14: 03 10 00 69 sethi %hi(0x4001a400), %g1 40009a18: 82 10 60 58 or %g1, 0x58, %g1 ! 4001a458 #if defined(RTEMS_MULTIPROCESSING) uint32_t maximum_proxies = _Configuration_MP_table->maximum_proxies; #endif if ( rtems_configuration_get_stack_allocate_hook() == NULL || 40009a1c: c6 00 60 28 ld [ %g1 + 0x28 ], %g3 #include #endif void _Thread_Handler_initialization(void) { uint32_t ticks_per_timeslice = 40009a20: fa 00 60 14 ld [ %g1 + 0x14 ], %i5 rtems_configuration_get_ticks_per_timeslice(); uint32_t maximum_extensions = 40009a24: f8 00 60 08 ld [ %g1 + 8 ], %i4 #if defined(RTEMS_MULTIPROCESSING) uint32_t maximum_proxies = _Configuration_MP_table->maximum_proxies; #endif if ( rtems_configuration_get_stack_allocate_hook() == NULL || 40009a28: 80 a0 e0 00 cmp %g3, 0 40009a2c: 02 80 00 06 be 40009a44 <_Thread_Handler_initialization+0x34><== NEVER TAKEN 40009a30: c4 00 60 24 ld [ %g1 + 0x24 ], %g2 40009a34: c6 00 60 2c ld [ %g1 + 0x2c ], %g3 40009a38: 80 a0 e0 00 cmp %g3, 0 40009a3c: 12 80 00 06 bne 40009a54 <_Thread_Handler_initialization+0x44> 40009a40: 80 a0 a0 00 cmp %g2, 0 rtems_configuration_get_stack_free_hook() == NULL) _Internal_error_Occurred( 40009a44: 90 10 20 00 clr %o0 40009a48: 92 10 20 01 mov 1, %o1 40009a4c: 7f ff fa 3b call 40008338 <_Internal_error_Occurred> 40009a50: 94 10 20 0e mov 0xe, %o2 INTERNAL_ERROR_CORE, true, INTERNAL_ERROR_BAD_STACK_HOOK ); if ( stack_allocate_init_hook != NULL ) 40009a54: 22 80 00 05 be,a 40009a68 <_Thread_Handler_initialization+0x58> 40009a58: 03 10 00 73 sethi %hi(0x4001cc00), %g1 (*stack_allocate_init_hook)( rtems_configuration_get_stack_space_size() ); 40009a5c: 9f c0 80 00 call %g2 40009a60: d0 00 60 04 ld [ %g1 + 4 ], %o0 ! 4001cc04 <_CPU_ISR_Dispatch_disable+0x4> _Thread_Dispatch_necessary = false; 40009a64: 03 10 00 73 sethi %hi(0x4001cc00), %g1 40009a68: 82 10 62 c0 or %g1, 0x2c0, %g1 ! 4001cec0 <_Per_CPU_Information> 40009a6c: c0 28 60 0c clrb [ %g1 + 0xc ] _Thread_Executing = NULL; 40009a70: c0 20 60 10 clr [ %g1 + 0x10 ] _Thread_Heir = NULL; 40009a74: c0 20 60 14 clr [ %g1 + 0x14 ] #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) _Thread_Allocated_fp = NULL; #endif _Thread_Maximum_extensions = maximum_extensions; 40009a78: 03 10 00 73 sethi %hi(0x4001cc00), %g1 40009a7c: f8 20 61 3c st %i4, [ %g1 + 0x13c ] ! 4001cd3c <_Thread_Maximum_extensions> _Thread_Ticks_per_timeslice = ticks_per_timeslice; 40009a80: 03 10 00 73 sethi %hi(0x4001cc00), %g1 40009a84: fa 20 60 20 st %i5, [ %g1 + 0x20 ] ! 4001cc20 <_Thread_Ticks_per_timeslice> #if defined(RTEMS_MULTIPROCESSING) if ( _System_state_Is_multiprocessing ) maximum_internal_threads += 1; #endif _Objects_Initialize_information( 40009a88: 82 10 20 08 mov 8, %g1 40009a8c: 11 10 00 73 sethi %hi(0x4001cc00), %o0 40009a90: c2 23 a0 5c st %g1, [ %sp + 0x5c ] 40009a94: 90 12 21 b0 or %o0, 0x1b0, %o0 40009a98: 92 10 20 01 mov 1, %o1 40009a9c: 94 10 20 01 mov 1, %o2 40009aa0: 96 10 20 01 mov 1, %o3 40009aa4: 98 10 21 60 mov 0x160, %o4 40009aa8: 7f ff fb b4 call 40008978 <_Objects_Initialize_information> 40009aac: 9a 10 20 00 clr %o5 40009ab0: 81 c7 e0 08 ret 40009ab4: 81 e8 00 00 restore =============================================================================== 40009864 <_Thread_Initialize>: Thread_CPU_budget_algorithms budget_algorithm, Thread_CPU_budget_algorithm_callout budget_callout, uint32_t isr_level, Objects_Name name ) { 40009864: 9d e3 bf 98 save %sp, -104, %sp 40009868: c2 07 a0 6c ld [ %fp + 0x6c ], %g1 4000986c: f4 0f a0 5f ldub [ %fp + 0x5f ], %i2 40009870: e0 00 40 00 ld [ %g1 ], %l0 /* * Zero out all the allocated memory fields */ for ( i=0 ; i <= THREAD_API_LAST ; i++ ) the_thread->API_Extensions[i] = NULL; 40009874: c0 26 61 4c clr [ %i1 + 0x14c ] 40009878: c0 26 61 50 clr [ %i1 + 0x150 ] extensions_area = NULL; the_thread->libc_reent = NULL; 4000987c: c0 26 61 48 clr [ %i1 + 0x148 ] /* * Allocate and Initialize the stack for this thread. */ #if !defined(RTEMS_SCORE_THREAD_ENABLE_USER_PROVIDED_STACK_VIA_API) actual_stack_size = _Thread_Stack_Allocate( the_thread, stack_size ); 40009880: 90 10 00 19 mov %i1, %o0 40009884: 40 00 01 fe call 4000a07c <_Thread_Stack_Allocate> 40009888: 92 10 00 1b mov %i3, %o1 if ( !actual_stack_size || actual_stack_size < stack_size ) 4000988c: 80 a2 00 1b cmp %o0, %i3 40009890: 0a 80 00 5c bcs 40009a00 <_Thread_Initialize+0x19c> 40009894: 80 a2 20 00 cmp %o0, 0 40009898: 22 80 00 5b be,a 40009a04 <_Thread_Initialize+0x1a0> <== NEVER TAKEN 4000989c: b0 10 20 00 clr %i0 <== NOT EXECUTED Stack_Control *the_stack, void *starting_address, size_t size ) { the_stack->area = starting_address; 400098a0: c2 06 60 b8 ld [ %i1 + 0xb8 ], %g1 the_stack->size = size; 400098a4: d0 26 60 b0 st %o0, [ %i1 + 0xb0 ] Stack_Control *the_stack, void *starting_address, size_t size ) { the_stack->area = starting_address; 400098a8: c2 26 60 b4 st %g1, [ %i1 + 0xb4 ] #endif /* * Allocate the extensions area for this thread */ if ( _Thread_Maximum_extensions ) { 400098ac: 03 10 00 73 sethi %hi(0x4001cc00), %g1 400098b0: d0 00 61 3c ld [ %g1 + 0x13c ], %o0 ! 4001cd3c <_Thread_Maximum_extensions> Watchdog_Service_routine_entry routine, Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; 400098b4: c0 26 60 50 clr [ %i1 + 0x50 ] the_watchdog->routine = routine; 400098b8: c0 26 60 64 clr [ %i1 + 0x64 ] the_watchdog->id = id; 400098bc: c0 26 60 68 clr [ %i1 + 0x68 ] the_watchdog->user_data = user_data; 400098c0: c0 26 60 6c clr [ %i1 + 0x6c ] 400098c4: 80 a2 20 00 cmp %o0, 0 400098c8: 02 80 00 08 be 400098e8 <_Thread_Initialize+0x84> 400098cc: b8 10 20 00 clr %i4 extensions_area = _Workspace_Allocate( 400098d0: 90 02 20 01 inc %o0 400098d4: 40 00 03 9e call 4000a74c <_Workspace_Allocate> 400098d8: 91 2a 20 02 sll %o0, 2, %o0 (_Thread_Maximum_extensions + 1) * sizeof( void * ) ); if ( !extensions_area ) 400098dc: b8 92 20 00 orcc %o0, 0, %i4 400098e0: 02 80 00 3c be 400099d0 <_Thread_Initialize+0x16c> 400098e4: b6 10 20 00 clr %i3 * if they are linked to the thread. An extension user may * create the extension long after tasks have been created * so they cannot rely on the thread create user extension * call. */ if ( the_thread->extensions ) { 400098e8: 80 a7 20 00 cmp %i4, 0 400098ec: 12 80 00 17 bne 40009948 <_Thread_Initialize+0xe4> 400098f0: f8 26 61 54 st %i4, [ %i1 + 0x154 ] /* * General initialization */ the_thread->Start.is_preemptible = is_preemptible; the_thread->Start.budget_algorithm = budget_algorithm; 400098f4: c2 07 a0 60 ld [ %fp + 0x60 ], %g1 /* * General initialization */ the_thread->Start.is_preemptible = is_preemptible; 400098f8: f4 2e 60 9c stb %i2, [ %i1 + 0x9c ] the_thread->Start.budget_algorithm = budget_algorithm; 400098fc: c2 26 60 a0 st %g1, [ %i1 + 0xa0 ] the_thread->Start.budget_callout = budget_callout; 40009900: c2 07 a0 64 ld [ %fp + 0x64 ], %g1 #endif } the_thread->Start.isr_level = isr_level; the_thread->current_state = STATES_DORMANT; 40009904: b4 10 20 01 mov 1, %i2 * General initialization */ the_thread->Start.is_preemptible = is_preemptible; the_thread->Start.budget_algorithm = budget_algorithm; the_thread->Start.budget_callout = budget_callout; 40009908: c2 26 60 a4 st %g1, [ %i1 + 0xa4 ] case THREAD_CPU_BUDGET_ALGORITHM_CALLOUT: break; #endif } the_thread->Start.isr_level = isr_level; 4000990c: c2 07 a0 68 ld [ %fp + 0x68 ], %g1 the_thread->current_state = STATES_DORMANT; 40009910: f4 26 60 10 st %i2, [ %i1 + 0x10 ] case THREAD_CPU_BUDGET_ALGORITHM_CALLOUT: break; #endif } the_thread->Start.isr_level = isr_level; 40009914: c2 26 60 a8 st %g1, [ %i1 + 0xa8 ] */ RTEMS_INLINE_ROUTINE void* _Scheduler_Allocate( Thread_Control *the_thread ) { return _Scheduler.Operations.allocate( the_thread ); 40009918: 03 10 00 70 sethi %hi(0x4001c000), %g1 4000991c: c2 00 61 fc ld [ %g1 + 0x1fc ], %g1 ! 4001c1fc <_Scheduler+0x18> the_thread->current_state = STATES_DORMANT; the_thread->Wait.queue = NULL; 40009920: c0 26 60 44 clr [ %i1 + 0x44 ] the_thread->resource_count = 0; 40009924: c0 26 60 1c clr [ %i1 + 0x1c ] the_thread->real_priority = priority; 40009928: fa 26 60 18 st %i5, [ %i1 + 0x18 ] the_thread->Start.initial_priority = priority; 4000992c: fa 26 60 ac st %i5, [ %i1 + 0xac ] 40009930: 9f c0 40 00 call %g1 40009934: 90 10 00 19 mov %i1, %o0 sched =_Scheduler_Allocate( the_thread ); if ( !sched ) 40009938: b6 92 20 00 orcc %o0, 0, %i3 4000993c: 12 80 00 0f bne 40009978 <_Thread_Initialize+0x114> 40009940: 90 10 00 19 mov %i1, %o0 40009944: 30 80 00 23 b,a 400099d0 <_Thread_Initialize+0x16c> * create the extension long after tasks have been created * so they cannot rely on the thread create user extension * call. */ if ( the_thread->extensions ) { for ( i = 0; i <= _Thread_Maximum_extensions ; i++ ) 40009948: 03 10 00 73 sethi %hi(0x4001cc00), %g1 4000994c: c4 00 61 3c ld [ %g1 + 0x13c ], %g2 ! 4001cd3c <_Thread_Maximum_extensions> 40009950: 10 80 00 05 b 40009964 <_Thread_Initialize+0x100> 40009954: 82 10 20 00 clr %g1 the_thread->extensions[i] = NULL; 40009958: 87 28 60 02 sll %g1, 2, %g3 * create the extension long after tasks have been created * so they cannot rely on the thread create user extension * call. */ if ( the_thread->extensions ) { for ( i = 0; i <= _Thread_Maximum_extensions ; i++ ) 4000995c: 82 00 60 01 inc %g1 the_thread->extensions[i] = NULL; 40009960: c0 21 00 03 clr [ %g4 + %g3 ] * create the extension long after tasks have been created * so they cannot rely on the thread create user extension * call. */ if ( the_thread->extensions ) { for ( i = 0; i <= _Thread_Maximum_extensions ; i++ ) 40009964: 80 a0 40 02 cmp %g1, %g2 40009968: 28 bf ff fc bleu,a 40009958 <_Thread_Initialize+0xf4> 4000996c: c8 06 61 54 ld [ %i1 + 0x154 ], %g4 /* * General initialization */ the_thread->Start.is_preemptible = is_preemptible; the_thread->Start.budget_algorithm = budget_algorithm; 40009970: 10 bf ff e2 b 400098f8 <_Thread_Initialize+0x94> 40009974: c2 07 a0 60 ld [ %fp + 0x60 ], %g1 the_thread->real_priority = priority; the_thread->Start.initial_priority = priority; sched =_Scheduler_Allocate( the_thread ); if ( !sched ) goto failed; _Thread_Set_priority( the_thread, priority ); 40009978: 40 00 01 99 call 40009fdc <_Thread_Set_priority> 4000997c: 92 10 00 1d mov %i5, %o1 #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 40009980: c4 06 20 1c ld [ %i0 + 0x1c ], %g2 Objects_Information *information, Objects_Control *the_object, Objects_Name name ) { _Objects_Set_local_object( 40009984: c2 16 60 0a lduh [ %i1 + 0xa ], %g1 static inline void _Timestamp64_implementation_Set_to_zero( Timestamp64_Control *_time ) { *_time = 0; 40009988: c0 26 60 80 clr [ %i1 + 0x80 ] 4000998c: c0 26 60 84 clr [ %i1 + 0x84 ] #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 40009990: 83 28 60 02 sll %g1, 2, %g1 40009994: f2 20 80 01 st %i1, [ %g2 + %g1 ] information, _Objects_Get_index( the_object->id ), the_object ); the_object->name = name; 40009998: e0 26 60 0c st %l0, [ %i1 + 0xc ] * @{ */ static inline bool _User_extensions_Thread_create( Thread_Control *created ) { User_extensions_Thread_create_context ctx = { created, true }; 4000999c: f2 27 bf f8 st %i1, [ %fp + -8 ] 400099a0: f4 2f bf fc stb %i2, [ %fp + -4 ] _User_extensions_Iterate( &ctx, _User_extensions_Thread_create_visitor ); 400099a4: 90 07 bf f8 add %fp, -8, %o0 400099a8: 13 10 00 28 sethi %hi(0x4000a000), %o1 400099ac: 40 00 02 37 call 4000a288 <_User_extensions_Iterate> 400099b0: 92 12 61 64 or %o1, 0x164, %o1 ! 4000a164 <_User_extensions_Thread_create_visitor> * user extensions with dispatching enabled. The Allocator * Mutex provides sufficient protection to let the user extensions * run safely. */ extension_status = _User_extensions_Thread_create( the_thread ); if ( extension_status ) 400099b4: c2 0f bf fc ldub [ %fp + -4 ], %g1 400099b8: 80 a0 60 00 cmp %g1, 0 400099bc: 02 80 00 05 be 400099d0 <_Thread_Initialize+0x16c> 400099c0: b0 10 20 01 mov 1, %i0 400099c4: b0 0e 20 01 and %i0, 1, %i0 400099c8: 81 c7 e0 08 ret 400099cc: 81 e8 00 00 restore return true; failed: _Workspace_Free( the_thread->libc_reent ); 400099d0: 40 00 03 67 call 4000a76c <_Workspace_Free> 400099d4: d0 06 61 48 ld [ %i1 + 0x148 ], %o0 for ( i=0 ; i <= THREAD_API_LAST ; i++ ) _Workspace_Free( the_thread->API_Extensions[i] ); 400099d8: 40 00 03 65 call 4000a76c <_Workspace_Free> 400099dc: d0 06 61 4c ld [ %i1 + 0x14c ], %o0 400099e0: 40 00 03 63 call 4000a76c <_Workspace_Free> 400099e4: d0 06 61 50 ld [ %i1 + 0x150 ], %o0 _Workspace_Free( extensions_area ); 400099e8: 40 00 03 61 call 4000a76c <_Workspace_Free> 400099ec: 90 10 00 1c mov %i4, %o0 #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) _Workspace_Free( fp_area ); #endif _Workspace_Free( sched ); 400099f0: 40 00 03 5f call 4000a76c <_Workspace_Free> 400099f4: 90 10 00 1b mov %i3, %o0 _Thread_Stack_Free( the_thread ); 400099f8: 40 00 01 b1 call 4000a0bc <_Thread_Stack_Free> 400099fc: 90 10 00 19 mov %i1, %o0 * Allocate and Initialize the stack for this thread. */ #if !defined(RTEMS_SCORE_THREAD_ENABLE_USER_PROVIDED_STACK_VIA_API) actual_stack_size = _Thread_Stack_Allocate( the_thread, stack_size ); if ( !actual_stack_size || actual_stack_size < stack_size ) return false; /* stack allocation failed */ 40009a00: b0 10 20 00 clr %i0 _Workspace_Free( sched ); _Thread_Stack_Free( the_thread ); return false; } 40009a04: b0 0e 20 01 and %i0, 1, %i0 40009a08: 81 c7 e0 08 ret 40009a0c: 81 e8 00 00 restore =============================================================================== 4000dbd0 <_Thread_queue_Extract_fifo>: void _Thread_queue_Extract_fifo( Thread_queue_Control *the_thread_queue __attribute__((unused)), Thread_Control *the_thread ) { 4000dbd0: 9d e3 bf a0 save %sp, -96, %sp <== NOT EXECUTED ISR_Level level; _ISR_Disable( level ); 4000dbd4: 7f ff d1 35 call 400020a8 <== NOT EXECUTED 4000dbd8: 01 00 00 00 nop <== NOT EXECUTED 4000dbdc: b0 10 00 08 mov %o0, %i0 <== NOT EXECUTED 4000dbe0: c4 06 60 10 ld [ %i1 + 0x10 ], %g2 <== NOT EXECUTED if ( !_States_Is_waiting_on_thread_queue( the_thread->current_state ) ) { 4000dbe4: 03 00 00 ef sethi %hi(0x3bc00), %g1 <== NOT EXECUTED 4000dbe8: 82 10 62 e0 or %g1, 0x2e0, %g1 ! 3bee0 <== NOT EXECUTED 4000dbec: 80 88 80 01 btst %g2, %g1 <== NOT EXECUTED 4000dbf0: 32 80 00 04 bne,a 4000dc00 <_Thread_queue_Extract_fifo+0x30><== NOT EXECUTED 4000dbf4: c2 06 60 04 ld [ %i1 + 4 ], %g1 <== NOT EXECUTED _ISR_Enable( level ); 4000dbf8: 7f ff d1 30 call 400020b8 <== NOT EXECUTED 4000dbfc: 81 e8 00 00 restore <== NOT EXECUTED ) { Chain_Node *next; Chain_Node *previous; next = the_node->next; 4000dc00: c4 06 40 00 ld [ %i1 ], %g2 <== NOT EXECUTED previous = the_node->previous; next->previous = previous; 4000dc04: c2 20 a0 04 st %g1, [ %g2 + 4 ] <== NOT EXECUTED previous->next = next; 4000dc08: c4 20 40 00 st %g2, [ %g1 ] <== NOT EXECUTED _Chain_Extract_unprotected( &the_thread->Object.Node ); the_thread->Wait.queue = NULL; if ( !_Watchdog_Is_active( &the_thread->Timer ) ) { 4000dc0c: c2 06 60 50 ld [ %i1 + 0x50 ], %g1 <== NOT EXECUTED 4000dc10: 80 a0 60 02 cmp %g1, 2 <== NOT EXECUTED 4000dc14: 02 80 00 06 be 4000dc2c <_Thread_queue_Extract_fifo+0x5c> <== NOT EXECUTED 4000dc18: c0 26 60 44 clr [ %i1 + 0x44 ] <== NOT EXECUTED _ISR_Enable( level ); 4000dc1c: 7f ff d1 27 call 400020b8 <== NOT EXECUTED 4000dc20: b0 10 00 19 mov %i1, %i0 <== NOT EXECUTED 4000dc24: 10 80 00 09 b 4000dc48 <_Thread_queue_Extract_fifo+0x78> <== NOT EXECUTED 4000dc28: 33 04 01 ff sethi %hi(0x1007fc00), %i1 <== NOT EXECUTED 4000dc2c: 82 10 20 03 mov 3, %g1 <== NOT EXECUTED 4000dc30: c2 26 60 50 st %g1, [ %i1 + 0x50 ] <== NOT EXECUTED } else { _Watchdog_Deactivate( &the_thread->Timer ); _ISR_Enable( level ); 4000dc34: 7f ff d1 21 call 400020b8 <== NOT EXECUTED 4000dc38: b0 10 00 19 mov %i1, %i0 <== NOT EXECUTED (void) _Watchdog_Remove( &the_thread->Timer ); 4000dc3c: 7f ff f2 2b call 4000a4e8 <_Watchdog_Remove> <== NOT EXECUTED 4000dc40: 90 06 60 48 add %i1, 0x48, %o0 <== NOT EXECUTED 4000dc44: 33 04 01 ff sethi %hi(0x1007fc00), %i1 <== NOT EXECUTED 4000dc48: b2 16 63 f8 or %i1, 0x3f8, %i1 ! 1007fff8 <== NOT EXECUTED 4000dc4c: 7f ff ed f8 call 4000942c <_Thread_Clear_state> <== NOT EXECUTED 4000dc50: 81 e8 00 00 restore <== NOT EXECUTED =============================================================================== 40009f28 <_Thread_queue_Requeue>: void _Thread_queue_Requeue( Thread_queue_Control *the_thread_queue, Thread_Control *the_thread ) { 40009f28: 9d e3 bf 98 save %sp, -104, %sp /* * Just in case the thread really wasn't blocked on a thread queue * when we get here. */ if ( !the_thread_queue ) 40009f2c: 80 a6 20 00 cmp %i0, 0 40009f30: 02 80 00 19 be 40009f94 <_Thread_queue_Requeue+0x6c> <== NEVER TAKEN 40009f34: 01 00 00 00 nop /* * 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 ) { 40009f38: fa 06 20 34 ld [ %i0 + 0x34 ], %i5 40009f3c: 80 a7 60 01 cmp %i5, 1 40009f40: 12 80 00 15 bne 40009f94 <_Thread_queue_Requeue+0x6c> <== NEVER TAKEN 40009f44: 01 00 00 00 nop Thread_queue_Control *tq = the_thread_queue; ISR_Level level; ISR_Level level_ignored; _ISR_Disable( level ); 40009f48: 7f ff e0 58 call 400020a8 40009f4c: 01 00 00 00 nop 40009f50: b8 10 00 08 mov %o0, %i4 40009f54: c4 06 60 10 ld [ %i1 + 0x10 ], %g2 if ( _States_Is_waiting_on_thread_queue( the_thread->current_state ) ) { 40009f58: 03 00 00 ef sethi %hi(0x3bc00), %g1 40009f5c: 82 10 62 e0 or %g1, 0x2e0, %g1 ! 3bee0 40009f60: 80 88 80 01 btst %g2, %g1 40009f64: 02 80 00 0a be 40009f8c <_Thread_queue_Requeue+0x64> <== NEVER TAKEN 40009f68: 90 10 00 18 mov %i0, %o0 _Thread_queue_Enter_critical_section( tq ); _Thread_queue_Extract_priority_helper( tq, the_thread, true ); 40009f6c: 92 10 00 19 mov %i1, %o1 40009f70: 94 10 20 01 mov 1, %o2 40009f74: 40 00 09 bf call 4000c670 <_Thread_queue_Extract_priority_helper> 40009f78: fa 26 20 30 st %i5, [ %i0 + 0x30 ] (void) _Thread_queue_Enqueue_priority( tq, the_thread, &level_ignored ); 40009f7c: 90 10 00 18 mov %i0, %o0 40009f80: 92 10 00 19 mov %i1, %o1 40009f84: 7f ff ff 50 call 40009cc4 <_Thread_queue_Enqueue_priority> 40009f88: 94 07 bf fc add %fp, -4, %o2 } _ISR_Enable( level ); 40009f8c: 7f ff e0 4b call 400020b8 40009f90: 90 10 00 1c mov %i4, %o0 40009f94: 81 c7 e0 08 ret 40009f98: 81 e8 00 00 restore =============================================================================== 40009f9c <_Thread_queue_Timeout>: void _Thread_queue_Timeout( Objects_Id id, void *ignored __attribute__((unused)) ) { 40009f9c: 9d e3 bf 98 save %sp, -104, %sp Thread_Control *the_thread; Objects_Locations location; the_thread = _Thread_Get( id, &location ); 40009fa0: 90 10 00 18 mov %i0, %o0 40009fa4: 7f ff fe 04 call 400097b4 <_Thread_Get> 40009fa8: 92 07 bf fc add %fp, -4, %o1 switch ( location ) { 40009fac: c2 07 bf fc ld [ %fp + -4 ], %g1 40009fb0: 80 a0 60 00 cmp %g1, 0 40009fb4: 12 80 00 08 bne 40009fd4 <_Thread_queue_Timeout+0x38> <== NEVER TAKEN 40009fb8: 01 00 00 00 nop #if defined(RTEMS_MULTIPROCESSING) case OBJECTS_REMOTE: /* impossible */ #endif break; case OBJECTS_LOCAL: _Thread_queue_Process_timeout( the_thread ); 40009fbc: 40 00 09 e4 call 4000c74c <_Thread_queue_Process_timeout> 40009fc0: 01 00 00 00 nop * * 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; 40009fc4: 03 10 00 73 sethi %hi(0x4001cc00), %g1 40009fc8: c4 00 60 c0 ld [ %g1 + 0xc0 ], %g2 ! 4001ccc0 <_Thread_Dispatch_disable_level> --level; 40009fcc: 84 00 bf ff add %g2, -1, %g2 _Thread_Dispatch_disable_level = level; 40009fd0: c4 20 60 c0 st %g2, [ %g1 + 0xc0 ] 40009fd4: 81 c7 e0 08 ret 40009fd8: 81 e8 00 00 restore =============================================================================== 40018288 <_Timer_server_Body>: * @a arg points to the corresponding timer server control block. */ static rtems_task _Timer_server_Body( rtems_task_argument arg ) { 40018288: 9d e3 bf 88 save %sp, -120, %sp static void _Timer_server_Process_interval_watchdogs( Timer_server_Watchdogs *watchdogs, Chain_Control *fire_chain ) { Watchdog_Interval snapshot = _Watchdog_Ticks_since_boot; 4001828c: 27 10 00 ef sethi %hi(0x4003bc00), %l3 ) { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); head->next = tail; 40018290: a4 07 bf e8 add %fp, -24, %l2 40018294: aa 07 bf ec add %fp, -20, %l5 40018298: b8 07 bf f4 add %fp, -12, %i4 4001829c: b2 07 bf f8 add %fp, -8, %i1 400182a0: ea 27 bf e8 st %l5, [ %fp + -24 ] head->previous = NULL; 400182a4: c0 27 bf ec clr [ %fp + -20 ] tail->previous = head; 400182a8: e4 27 bf f0 st %l2, [ %fp + -16 ] ) { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); head->next = tail; 400182ac: f2 27 bf f4 st %i1, [ %fp + -12 ] head->previous = NULL; 400182b0: c0 27 bf f8 clr [ %fp + -8 ] tail->previous = head; 400182b4: f8 27 bf fc st %i4, [ %fp + -4 ] */ Watchdog_Interval delta = snapshot - watchdogs->last_snapshot; watchdogs->last_snapshot = snapshot; _Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain ); 400182b8: b4 06 20 30 add %i0, 0x30, %i2 static void _Timer_server_Process_tod_watchdogs( Timer_server_Watchdogs *watchdogs, Chain_Control *fire_chain ) { Watchdog_Interval snapshot = (Watchdog_Interval) _TOD_Seconds_since_epoch(); 400182bc: 29 10 00 ef sethi %hi(0x4003bc00), %l4 /* * 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 ); 400182c0: b6 06 20 68 add %i0, 0x68, %i3 static void _Timer_server_Stop_interval_system_watchdog( Timer_server_Control *ts ) { _Watchdog_Remove( &ts->Interval_watchdogs.System_watchdog ); 400182c4: a2 06 20 08 add %i0, 8, %l1 static void _Timer_server_Stop_tod_system_watchdog( Timer_server_Control *ts ) { _Watchdog_Remove( &ts->TOD_watchdogs.System_watchdog ); 400182c8: a0 06 20 40 add %i0, 0x40, %l0 { /* * 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; 400182cc: e4 26 20 78 st %l2, [ %i0 + 0x78 ] static void _Timer_server_Process_interval_watchdogs( Timer_server_Watchdogs *watchdogs, Chain_Control *fire_chain ) { Watchdog_Interval snapshot = _Watchdog_Ticks_since_boot; 400182d0: c2 04 e3 b8 ld [ %l3 + 0x3b8 ], %g1 /* * We assume adequate unsigned arithmetic here. */ Watchdog_Interval delta = snapshot - watchdogs->last_snapshot; 400182d4: d2 06 20 3c ld [ %i0 + 0x3c ], %o1 watchdogs->last_snapshot = snapshot; _Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain ); 400182d8: 90 10 00 1a mov %i2, %o0 400182dc: 92 20 40 09 sub %g1, %o1, %o1 /* * We assume adequate unsigned arithmetic here. */ Watchdog_Interval delta = snapshot - watchdogs->last_snapshot; watchdogs->last_snapshot = snapshot; 400182e0: c2 26 20 3c st %g1, [ %i0 + 0x3c ] _Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain ); 400182e4: 40 00 11 18 call 4001c744 <_Watchdog_Adjust_to_chain> 400182e8: 94 10 00 1c mov %i4, %o2 400182ec: d0 1d 22 18 ldd [ %l4 + 0x218 ], %o0 400182f0: 94 10 20 00 clr %o2 400182f4: 17 0e e6 b2 sethi %hi(0x3b9ac800), %o3 400182f8: 40 00 4b b1 call 4002b1bc <__divdi3> 400182fc: 96 12 e2 00 or %o3, 0x200, %o3 ! 3b9aca00 Timer_server_Watchdogs *watchdogs, Chain_Control *fire_chain ) { Watchdog_Interval snapshot = (Watchdog_Interval) _TOD_Seconds_since_epoch(); Watchdog_Interval last_snapshot = watchdogs->last_snapshot; 40018300: d4 06 20 74 ld [ %i0 + 0x74 ], %o2 /* * 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 ) { 40018304: 80 a2 40 0a cmp %o1, %o2 40018308: 08 80 00 07 bleu 40018324 <_Timer_server_Body+0x9c> 4001830c: ba 10 00 09 mov %o1, %i5 /* * 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 ); 40018310: 92 22 40 0a sub %o1, %o2, %o1 40018314: 90 10 00 1b mov %i3, %o0 40018318: 40 00 11 0b call 4001c744 <_Watchdog_Adjust_to_chain> 4001831c: 94 10 00 1c mov %i4, %o2 40018320: 30 80 00 06 b,a 40018338 <_Timer_server_Body+0xb0> } else if ( snapshot < last_snapshot ) { 40018324: 1a 80 00 05 bcc 40018338 <_Timer_server_Body+0xb0> 40018328: 90 10 00 1b mov %i3, %o0 /* * 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 ); 4001832c: 92 10 20 01 mov 1, %o1 40018330: 40 00 10 dd call 4001c6a4 <_Watchdog_Adjust> 40018334: 94 22 80 1d sub %o2, %i5, %o2 } watchdogs->last_snapshot = snapshot; 40018338: fa 26 20 74 st %i5, [ %i0 + 0x74 ] } static void _Timer_server_Process_insertions( Timer_server_Control *ts ) { while ( true ) { Timer_Control *timer = (Timer_Control *) _Chain_Get( ts->insert_chain ); 4001833c: d0 06 20 78 ld [ %i0 + 0x78 ], %o0 40018340: 40 00 02 d8 call 40018ea0 <_Chain_Get> 40018344: 01 00 00 00 nop if ( timer == NULL ) { 40018348: 92 92 20 00 orcc %o0, 0, %o1 4001834c: 02 80 00 0c be 4001837c <_Timer_server_Body+0xf4> 40018350: 01 00 00 00 nop static void _Timer_server_Insert_timer( Timer_server_Control *ts, Timer_Control *timer ) { if ( timer->the_class == TIMER_INTERVAL_ON_TASK ) { 40018354: c2 02 60 38 ld [ %o1 + 0x38 ], %g1 40018358: 80 a0 60 01 cmp %g1, 1 4001835c: 02 80 00 05 be 40018370 <_Timer_server_Body+0xe8> 40018360: 90 10 00 1a mov %i2, %o0 _Watchdog_Insert( &ts->Interval_watchdogs.Chain, &timer->Ticker ); } else if ( timer->the_class == TIMER_TIME_OF_DAY_ON_TASK ) { 40018364: 80 a0 60 03 cmp %g1, 3 40018368: 12 bf ff f5 bne 4001833c <_Timer_server_Body+0xb4> <== NEVER TAKEN 4001836c: 90 10 00 1b mov %i3, %o0 _Watchdog_Insert( &ts->TOD_watchdogs.Chain, &timer->Ticker ); 40018370: 40 00 11 1f call 4001c7ec <_Watchdog_Insert> 40018374: 92 02 60 10 add %o1, 0x10, %o1 40018378: 30 bf ff f1 b,a 4001833c <_Timer_server_Body+0xb4> * of zero it will be processed in the next iteration of the timer server * body loop. */ _Timer_server_Process_insertions( ts ); _ISR_Disable( level ); 4001837c: 7f ff df a6 call 40010214 40018380: 01 00 00 00 nop if ( _Chain_Is_empty( insert_chain ) ) { 40018384: c2 07 bf e8 ld [ %fp + -24 ], %g1 40018388: 80 a0 40 15 cmp %g1, %l5 4001838c: 12 80 00 0a bne 400183b4 <_Timer_server_Body+0x12c> <== NEVER TAKEN 40018390: 01 00 00 00 nop ts->insert_chain = NULL; 40018394: c0 26 20 78 clr [ %i0 + 0x78 ] _ISR_Enable( level ); 40018398: 7f ff df a3 call 40010224 4001839c: 01 00 00 00 nop _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 ) ) { 400183a0: c2 07 bf f4 ld [ %fp + -12 ], %g1 400183a4: 80 a0 40 19 cmp %g1, %i1 400183a8: 12 80 00 06 bne 400183c0 <_Timer_server_Body+0x138> 400183ac: 01 00 00 00 nop 400183b0: 30 80 00 18 b,a 40018410 <_Timer_server_Body+0x188> ts->insert_chain = NULL; _ISR_Enable( level ); break; } else { _ISR_Enable( level ); 400183b4: 7f ff df 9c call 40010224 <== NOT EXECUTED 400183b8: 01 00 00 00 nop <== NOT EXECUTED 400183bc: 30 bf ff c5 b,a 400182d0 <_Timer_server_Body+0x48> <== NOT EXECUTED /* * It is essential that interrupts are disable here since an interrupt * service routine may remove a watchdog from the chain. */ _ISR_Disable( level ); 400183c0: 7f ff df 95 call 40010214 400183c4: 01 00 00 00 nop */ RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_first( const Chain_Control *the_chain ) { return _Chain_Immutable_head( the_chain )->next; 400183c8: fa 07 bf f4 ld [ %fp + -12 ], %i5 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Get_unprotected( Chain_Control *the_chain ) { if ( !_Chain_Is_empty(the_chain)) 400183cc: 80 a7 40 19 cmp %i5, %i1 400183d0: 02 80 00 0d be 40018404 <_Timer_server_Body+0x17c> 400183d4: 01 00 00 00 nop Chain_Control *the_chain ) { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *old_first = head->next; Chain_Node *new_first = old_first->next; 400183d8: c2 07 40 00 ld [ %i5 ], %g1 head->next = new_first; new_first->previous = head; 400183dc: f8 20 60 04 st %i4, [ %g1 + 4 ] { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *old_first = head->next; Chain_Node *new_first = old_first->next; head->next = new_first; 400183e0: c2 27 bf f4 st %g1, [ %fp + -12 ] watchdog = (Watchdog_Control *) _Chain_Get_unprotected( &fire_chain ); if ( watchdog != NULL ) { watchdog->state = WATCHDOG_INACTIVE; 400183e4: c0 27 60 08 clr [ %i5 + 8 ] _ISR_Enable( level ); 400183e8: 7f ff df 8f call 40010224 400183ec: 01 00 00 00 nop /* * 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 ); 400183f0: c2 07 60 1c ld [ %i5 + 0x1c ], %g1 400183f4: d0 07 60 20 ld [ %i5 + 0x20 ], %o0 400183f8: 9f c0 40 00 call %g1 400183fc: d2 07 60 24 ld [ %i5 + 0x24 ], %o1 } 40018400: 30 bf ff f0 b,a 400183c0 <_Timer_server_Body+0x138> watchdog = (Watchdog_Control *) _Chain_Get_unprotected( &fire_chain ); if ( watchdog != NULL ) { watchdog->state = WATCHDOG_INACTIVE; _ISR_Enable( level ); } else { _ISR_Enable( level ); 40018404: 7f ff df 88 call 40010224 40018408: 01 00 00 00 nop 4001840c: 30 bf ff b0 b,a 400182cc <_Timer_server_Body+0x44> * the active flag of the timer server is true. */ (*watchdog->routine)( watchdog->id, watchdog->user_data ); } } else { ts->active = false; 40018410: c0 2e 20 7c clrb [ %i0 + 0x7c ] * * 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; 40018414: 03 10 00 ef sethi %hi(0x4003bc00), %g1 40018418: c4 00 62 d0 ld [ %g1 + 0x2d0 ], %g2 ! 4003bed0 <_Thread_Dispatch_disable_level> ++level; 4001841c: 84 00 a0 01 inc %g2 _Thread_Dispatch_disable_level = level; 40018420: c4 20 62 d0 st %g2, [ %g1 + 0x2d0 ] /* * Block until there is something to do. */ _Thread_Disable_dispatch(); _Thread_Set_state( ts->thread, STATES_DELAYING ); 40018424: d0 06 00 00 ld [ %i0 ], %o0 40018428: 40 00 0f bc call 4001c318 <_Thread_Set_state> 4001842c: 92 10 20 08 mov 8, %o1 _Timer_server_Reset_interval_system_watchdog( ts ); 40018430: 7f ff ff 6e call 400181e8 <_Timer_server_Reset_interval_system_watchdog> 40018434: 90 10 00 18 mov %i0, %o0 _Timer_server_Reset_tod_system_watchdog( ts ); 40018438: 7f ff ff 80 call 40018238 <_Timer_server_Reset_tod_system_watchdog> 4001843c: 90 10 00 18 mov %i0, %o0 _Thread_Enable_dispatch(); 40018440: 40 00 0d 7b call 4001ba2c <_Thread_Enable_dispatch> 40018444: 01 00 00 00 nop ts->active = true; 40018448: 82 10 20 01 mov 1, %g1 ! 1 static void _Timer_server_Stop_interval_system_watchdog( Timer_server_Control *ts ) { _Watchdog_Remove( &ts->Interval_watchdogs.System_watchdog ); 4001844c: 90 10 00 11 mov %l1, %o0 _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; 40018450: c2 2e 20 7c stb %g1, [ %i0 + 0x7c ] static void _Timer_server_Stop_interval_system_watchdog( Timer_server_Control *ts ) { _Watchdog_Remove( &ts->Interval_watchdogs.System_watchdog ); 40018454: 40 00 11 3e call 4001c94c <_Watchdog_Remove> 40018458: 01 00 00 00 nop static void _Timer_server_Stop_tod_system_watchdog( Timer_server_Control *ts ) { _Watchdog_Remove( &ts->TOD_watchdogs.System_watchdog ); 4001845c: 40 00 11 3c call 4001c94c <_Watchdog_Remove> 40018460: 90 10 00 10 mov %l0, %o0 40018464: 30 bf ff 9a b,a 400182cc <_Timer_server_Body+0x44> =============================================================================== 40018468 <_Timer_server_Schedule_operation_method>: static void _Timer_server_Schedule_operation_method( Timer_server_Control *ts, Timer_Control *timer ) { 40018468: 9d e3 bf a0 save %sp, -96, %sp if ( ts->insert_chain == NULL ) { 4001846c: c2 06 20 78 ld [ %i0 + 0x78 ], %g1 40018470: 80 a0 60 00 cmp %g1, 0 40018474: 12 80 00 51 bne 400185b8 <_Timer_server_Schedule_operation_method+0x150> 40018478: ba 10 00 19 mov %i1, %i5 * * 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; 4001847c: 03 10 00 ef sethi %hi(0x4003bc00), %g1 40018480: c4 00 62 d0 ld [ %g1 + 0x2d0 ], %g2 ! 4003bed0 <_Thread_Dispatch_disable_level> ++level; 40018484: 84 00 a0 01 inc %g2 _Thread_Dispatch_disable_level = level; 40018488: c4 20 62 d0 st %g2, [ %g1 + 0x2d0 ] * being inserted. This could result in an integer overflow. */ _Thread_Disable_dispatch(); if ( timer->the_class == TIMER_INTERVAL_ON_TASK ) { 4001848c: c2 06 60 38 ld [ %i1 + 0x38 ], %g1 40018490: 80 a0 60 01 cmp %g1, 1 40018494: 12 80 00 1f bne 40018510 <_Timer_server_Schedule_operation_method+0xa8> 40018498: 80 a0 60 03 cmp %g1, 3 /* * We have to advance the last known ticks value of the server and update * the watchdog chain accordingly. */ _ISR_Disable( level ); 4001849c: 7f ff df 5e call 40010214 400184a0: 01 00 00 00 nop snapshot = _Watchdog_Ticks_since_boot; 400184a4: 03 10 00 ef sethi %hi(0x4003bc00), %g1 400184a8: c4 00 63 b8 ld [ %g1 + 0x3b8 ], %g2 ! 4003bfb8 <_Watchdog_Ticks_since_boot> */ RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_first( const Chain_Control *the_chain ) { return _Chain_Immutable_head( the_chain )->next; 400184ac: c2 06 20 30 ld [ %i0 + 0x30 ], %g1 last_snapshot = ts->Interval_watchdogs.last_snapshot; 400184b0: c8 06 20 3c ld [ %i0 + 0x3c ], %g4 RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( const Chain_Control *the_chain ) { return _Chain_Immutable_first( the_chain ) == _Chain_Immutable_tail( the_chain ); 400184b4: 86 06 20 34 add %i0, 0x34, %g3 if ( !_Chain_Is_empty( &ts->Interval_watchdogs.Chain ) ) { 400184b8: 80 a0 40 03 cmp %g1, %g3 400184bc: 02 80 00 08 be 400184dc <_Timer_server_Schedule_operation_method+0x74> 400184c0: 88 20 80 04 sub %g2, %g4, %g4 /* * We assume adequate unsigned arithmetic here. */ delta = snapshot - last_snapshot; delta_interval = first_watchdog->delta_interval; 400184c4: f8 00 60 10 ld [ %g1 + 0x10 ], %i4 if (delta_interval > delta) { 400184c8: 80 a7 00 04 cmp %i4, %g4 400184cc: 08 80 00 03 bleu 400184d8 <_Timer_server_Schedule_operation_method+0x70> 400184d0: 86 10 20 00 clr %g3 delta_interval -= delta; 400184d4: 86 27 00 04 sub %i4, %g4, %g3 } else { delta_interval = 0; } first_watchdog->delta_interval = delta_interval; 400184d8: c6 20 60 10 st %g3, [ %g1 + 0x10 ] } ts->Interval_watchdogs.last_snapshot = snapshot; 400184dc: c4 26 20 3c st %g2, [ %i0 + 0x3c ] _ISR_Enable( level ); 400184e0: 7f ff df 51 call 40010224 400184e4: 01 00 00 00 nop _Watchdog_Insert( &ts->Interval_watchdogs.Chain, &timer->Ticker ); 400184e8: 90 06 20 30 add %i0, 0x30, %o0 400184ec: 40 00 10 c0 call 4001c7ec <_Watchdog_Insert> 400184f0: 92 07 60 10 add %i5, 0x10, %o1 if ( !ts->active ) { 400184f4: c2 0e 20 7c ldub [ %i0 + 0x7c ], %g1 400184f8: 80 a0 60 00 cmp %g1, 0 400184fc: 12 80 00 2d bne 400185b0 <_Timer_server_Schedule_operation_method+0x148> 40018500: 01 00 00 00 nop _Timer_server_Reset_interval_system_watchdog( ts ); 40018504: 7f ff ff 39 call 400181e8 <_Timer_server_Reset_interval_system_watchdog> 40018508: 90 10 00 18 mov %i0, %o0 4001850c: 30 80 00 29 b,a 400185b0 <_Timer_server_Schedule_operation_method+0x148> } } else if ( timer->the_class == TIMER_TIME_OF_DAY_ON_TASK ) { 40018510: 12 80 00 28 bne 400185b0 <_Timer_server_Schedule_operation_method+0x148> 40018514: 01 00 00 00 nop /* * We have to advance the last known seconds value of the server and update * the watchdog chain accordingly. */ _ISR_Disable( level ); 40018518: 7f ff df 3f call 40010214 4001851c: 01 00 00 00 nop 40018520: b8 10 00 08 mov %o0, %i4 40018524: 03 10 00 ef sethi %hi(0x4003bc00), %g1 40018528: d0 18 62 18 ldd [ %g1 + 0x218 ], %o0 ! 4003be18 <_TOD> 4001852c: 94 10 20 00 clr %o2 40018530: 17 0e e6 b2 sethi %hi(0x3b9ac800), %o3 40018534: 40 00 4b 22 call 4002b1bc <__divdi3> 40018538: 96 12 e2 00 or %o3, 0x200, %o3 ! 3b9aca00 */ RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_first( const Chain_Control *the_chain ) { return _Chain_Immutable_head( the_chain )->next; 4001853c: c2 06 20 68 ld [ %i0 + 0x68 ], %g1 snapshot = (Watchdog_Interval) _TOD_Seconds_since_epoch(); last_snapshot = ts->TOD_watchdogs.last_snapshot; 40018540: c4 06 20 74 ld [ %i0 + 0x74 ], %g2 RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( const Chain_Control *the_chain ) { return _Chain_Immutable_first( the_chain ) == _Chain_Immutable_tail( the_chain ); 40018544: 86 06 20 6c add %i0, 0x6c, %g3 if ( !_Chain_Is_empty( &ts->TOD_watchdogs.Chain ) ) { 40018548: 80 a0 40 03 cmp %g1, %g3 4001854c: 02 80 00 0d be 40018580 <_Timer_server_Schedule_operation_method+0x118> 40018550: 80 a2 40 02 cmp %o1, %g2 first_watchdog = _Watchdog_First( &ts->TOD_watchdogs.Chain ); delta_interval = first_watchdog->delta_interval; if ( snapshot > last_snapshot ) { 40018554: 08 80 00 08 bleu 40018574 <_Timer_server_Schedule_operation_method+0x10c> 40018558: c6 00 60 10 ld [ %g1 + 0x10 ], %g3 /* * We advanced in time. */ delta = snapshot - last_snapshot; 4001855c: 88 22 40 02 sub %o1, %g2, %g4 if (delta_interval > delta) { 40018560: 80 a0 c0 04 cmp %g3, %g4 40018564: 08 80 00 06 bleu 4001857c <_Timer_server_Schedule_operation_method+0x114><== NEVER TAKEN 40018568: 84 10 20 00 clr %g2 delta_interval -= delta; 4001856c: 10 80 00 04 b 4001857c <_Timer_server_Schedule_operation_method+0x114> 40018570: 84 20 c0 04 sub %g3, %g4, %g2 } } else { /* * Someone put us in the past. */ delta = last_snapshot - snapshot; 40018574: 84 00 c0 02 add %g3, %g2, %g2 delta_interval += delta; 40018578: 84 20 80 09 sub %g2, %o1, %g2 } first_watchdog->delta_interval = delta_interval; 4001857c: c4 20 60 10 st %g2, [ %g1 + 0x10 ] } ts->TOD_watchdogs.last_snapshot = snapshot; 40018580: d2 26 20 74 st %o1, [ %i0 + 0x74 ] _ISR_Enable( level ); 40018584: 7f ff df 28 call 40010224 40018588: 90 10 00 1c mov %i4, %o0 _Watchdog_Insert( &ts->TOD_watchdogs.Chain, &timer->Ticker ); 4001858c: 90 06 20 68 add %i0, 0x68, %o0 40018590: 40 00 10 97 call 4001c7ec <_Watchdog_Insert> 40018594: 92 07 60 10 add %i5, 0x10, %o1 if ( !ts->active ) { 40018598: c2 0e 20 7c ldub [ %i0 + 0x7c ], %g1 4001859c: 80 a0 60 00 cmp %g1, 0 400185a0: 12 80 00 04 bne 400185b0 <_Timer_server_Schedule_operation_method+0x148> 400185a4: 01 00 00 00 nop _Timer_server_Reset_tod_system_watchdog( ts ); 400185a8: 7f ff ff 24 call 40018238 <_Timer_server_Reset_tod_system_watchdog> 400185ac: 90 10 00 18 mov %i0, %o0 } } _Thread_Enable_dispatch(); 400185b0: 40 00 0d 1f call 4001ba2c <_Thread_Enable_dispatch> 400185b4: 81 e8 00 00 restore * 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 ); 400185b8: f0 06 20 78 ld [ %i0 + 0x78 ], %i0 400185bc: 40 00 02 2d call 40018e70 <_Chain_Append> 400185c0: 81 e8 00 00 restore =============================================================================== 4000ba58 <_Timestamp64_Divide>: const Timestamp64_Control *_lhs, const Timestamp64_Control *_rhs, uint32_t *_ival_percentage, uint32_t *_fval_percentage ) { 4000ba58: 9d e3 bf a0 save %sp, -96, %sp Timestamp64_Control answer; if ( *_rhs == 0 ) { 4000ba5c: d4 1e 40 00 ldd [ %i1 ], %o2 4000ba60: 80 92 80 0b orcc %o2, %o3, %g0 4000ba64: 32 80 00 06 bne,a 4000ba7c <_Timestamp64_Divide+0x24> <== ALWAYS TAKEN 4000ba68: d8 1e 00 00 ldd [ %i0 ], %o4 *_ival_percentage = 0; 4000ba6c: c0 26 80 00 clr [ %i2 ] <== NOT EXECUTED *_fval_percentage = 0; 4000ba70: c0 26 c0 00 clr [ %i3 ] <== NOT EXECUTED return; 4000ba74: 81 c7 e0 08 ret <== NOT EXECUTED 4000ba78: 81 e8 00 00 restore <== NOT EXECUTED * This looks odd but gives the results the proper precision. * * TODO: Rounding on the last digit of the fval. */ answer = (*_lhs * 100000) / *_rhs; 4000ba7c: 83 2b 20 02 sll %o4, 2, %g1 4000ba80: 87 2b 60 02 sll %o5, 2, %g3 4000ba84: 89 33 60 1e srl %o5, 0x1e, %g4 4000ba88: bb 28 e0 05 sll %g3, 5, %i5 4000ba8c: 84 11 00 01 or %g4, %g1, %g2 4000ba90: 83 30 e0 1b srl %g3, 0x1b, %g1 4000ba94: b9 28 a0 05 sll %g2, 5, %i4 4000ba98: 86 a7 40 03 subcc %i5, %g3, %g3 4000ba9c: b8 10 40 1c or %g1, %i4, %i4 4000baa0: 84 67 00 02 subx %i4, %g2, %g2 4000baa4: b2 80 c0 0d addcc %g3, %o5, %i1 4000baa8: b0 40 80 0c addx %g2, %o4, %i0 4000baac: 83 36 60 1e srl %i1, 0x1e, %g1 4000bab0: 87 2e 60 02 sll %i1, 2, %g3 4000bab4: 85 2e 20 02 sll %i0, 2, %g2 4000bab8: 84 10 40 02 or %g1, %g2, %g2 4000babc: ba 86 40 03 addcc %i1, %g3, %i5 4000bac0: b8 46 00 02 addx %i0, %g2, %i4 4000bac4: 83 37 60 1e srl %i5, 0x1e, %g1 4000bac8: 87 2f 60 02 sll %i5, 2, %g3 4000bacc: 85 2f 20 02 sll %i4, 2, %g2 4000bad0: 84 10 40 02 or %g1, %g2, %g2 4000bad4: 92 87 40 03 addcc %i5, %g3, %o1 4000bad8: 90 47 00 02 addx %i4, %g2, %o0 4000badc: 87 32 60 1b srl %o1, 0x1b, %g3 4000bae0: 85 2a 20 05 sll %o0, 5, %g2 4000bae4: 83 2a 60 05 sll %o1, 5, %g1 4000bae8: 90 10 c0 02 or %g3, %g2, %o0 4000baec: 40 00 36 b3 call 400195b8 <__divdi3> 4000baf0: 92 10 00 01 mov %g1, %o1 *_ival_percentage = answer / 1000; 4000baf4: 94 10 20 00 clr %o2 * This looks odd but gives the results the proper precision. * * TODO: Rounding on the last digit of the fval. */ answer = (*_lhs * 100000) / *_rhs; 4000baf8: b8 10 00 08 mov %o0, %i4 4000bafc: ba 10 00 09 mov %o1, %i5 *_ival_percentage = answer / 1000; 4000bb00: 40 00 36 ae call 400195b8 <__divdi3> 4000bb04: 96 10 23 e8 mov 0x3e8, %o3 *_fval_percentage = answer % 1000; 4000bb08: 90 10 00 1c mov %i4, %o0 * TODO: Rounding on the last digit of the fval. */ answer = (*_lhs * 100000) / *_rhs; *_ival_percentage = answer / 1000; 4000bb0c: d2 26 80 00 st %o1, [ %i2 ] *_fval_percentage = answer % 1000; 4000bb10: 94 10 20 00 clr %o2 4000bb14: 92 10 00 1d mov %i5, %o1 4000bb18: 40 00 37 93 call 40019964 <__moddi3> 4000bb1c: 96 10 23 e8 mov 0x3e8, %o3 4000bb20: d2 26 c0 00 st %o1, [ %i3 ] 4000bb24: 81 c7 e0 08 ret 4000bb28: 81 e8 00 00 restore =============================================================================== 4000a348 <_User_extensions_Handler_initialization>: } } void _User_extensions_Handler_initialization(void) { 4000a348: 9d e3 bf 98 save %sp, -104, %sp uint32_t number_of_initial_extensions = 4000a34c: 03 10 00 69 sethi %hi(0x4001a400), %g1 4000a350: c2 00 60 98 ld [ %g1 + 0x98 ], %g1 ! 4001a498 rtems_configuration_get_number_of_initial_extensions(); if ( number_of_initial_extensions > 0 ) { 4000a354: 80 a0 60 00 cmp %g1, 0 4000a358: 02 80 00 0a be 4000a380 <_User_extensions_Handler_initialization+0x38><== NEVER TAKEN 4000a35c: 91 28 60 02 sll %g1, 2, %o0 User_extensions_Switch_control *initial_extension_switch_controls = _Workspace_Allocate_or_fatal_error( number_of_initial_extensions * sizeof( *initial_extension_switch_controls ) 4000a360: 83 28 60 04 sll %g1, 4, %g1 { 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 = 4000a364: 40 00 01 08 call 4000a784 <_Workspace_Allocate_or_fatal_error> 4000a368: 90 20 40 08 sub %g1, %o0, %o0 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 ); 4000a36c: 13 10 00 28 sethi %hi(0x4000a000), %o1 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 }; 4000a370: d0 27 bf fc st %o0, [ %fp + -4 ] _User_extensions_Iterate( &ctx, _User_extensions_Switch_visitor ); 4000a374: 92 12 63 04 or %o1, 0x304, %o1 4000a378: 7f ff ff c4 call 4000a288 <_User_extensions_Iterate> 4000a37c: 90 07 bf fc add %fp, -4, %o0 4000a380: 81 c7 e0 08 ret 4000a384: 81 e8 00 00 restore =============================================================================== 4000bd90 <_Watchdog_Adjust>: void _Watchdog_Adjust( Chain_Control *header, Watchdog_Adjust_directions direction, Watchdog_Interval units ) { 4000bd90: 9d e3 bf a0 save %sp, -96, %sp ISR_Level level; _ISR_Disable( level ); 4000bd94: 7f ff dc 57 call 40002ef0 4000bd98: 01 00 00 00 nop */ RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_first( const Chain_Control *the_chain ) { return _Chain_Immutable_head( the_chain )->next; 4000bd9c: c2 06 00 00 ld [ %i0 ], %g1 RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( const Chain_Control *the_chain ) { return _Chain_Immutable_first( the_chain ) == _Chain_Immutable_tail( the_chain ); 4000bda0: b8 06 20 04 add %i0, 4, %i4 * hence the compiler must not assume *header to remain * unmodified across that call. * * Till Straumann, 7/2003 */ if ( !_Chain_Is_empty( header ) ) { 4000bda4: 80 a0 40 1c cmp %g1, %i4 4000bda8: 02 80 00 20 be 4000be28 <_Watchdog_Adjust+0x98> 4000bdac: 80 a6 60 00 cmp %i1, 0 switch ( direction ) { 4000bdb0: 02 80 00 1b be 4000be1c <_Watchdog_Adjust+0x8c> 4000bdb4: b6 10 20 01 mov 1, %i3 4000bdb8: 80 a6 60 01 cmp %i1, 1 4000bdbc: 12 80 00 1b bne 4000be28 <_Watchdog_Adjust+0x98> <== NEVER TAKEN 4000bdc0: 01 00 00 00 nop case WATCHDOG_BACKWARD: _Watchdog_First( header )->delta_interval += units; 4000bdc4: c4 00 60 10 ld [ %g1 + 0x10 ], %g2 4000bdc8: 10 80 00 07 b 4000bde4 <_Watchdog_Adjust+0x54> 4000bdcc: b4 00 80 1a add %g2, %i2, %i2 break; case WATCHDOG_FORWARD: while ( units ) { if ( units < _Watchdog_First( header )->delta_interval ) { 4000bdd0: c4 00 60 10 ld [ %g1 + 0x10 ], %g2 4000bdd4: 80 a6 80 02 cmp %i2, %g2 4000bdd8: 3a 80 00 05 bcc,a 4000bdec <_Watchdog_Adjust+0x5c> 4000bddc: f6 20 60 10 st %i3, [ %g1 + 0x10 ] _Watchdog_First( header )->delta_interval -= units; 4000bde0: b4 20 80 1a sub %g2, %i2, %i2 break; 4000bde4: 10 80 00 11 b 4000be28 <_Watchdog_Adjust+0x98> 4000bde8: f4 20 60 10 st %i2, [ %g1 + 0x10 ] } else { units -= _Watchdog_First( header )->delta_interval; 4000bdec: b4 26 80 02 sub %i2, %g2, %i2 _Watchdog_First( header )->delta_interval = 1; _ISR_Enable( level ); 4000bdf0: 7f ff dc 44 call 40002f00 4000bdf4: 01 00 00 00 nop _Watchdog_Tickle( header ); 4000bdf8: 40 00 00 90 call 4000c038 <_Watchdog_Tickle> 4000bdfc: 90 10 00 18 mov %i0, %o0 _ISR_Disable( level ); 4000be00: 7f ff dc 3c call 40002ef0 4000be04: 01 00 00 00 nop if ( _Chain_Is_empty( header ) ) 4000be08: c2 06 00 00 ld [ %i0 ], %g1 4000be0c: 80 a0 40 1c cmp %g1, %i4 4000be10: 12 80 00 04 bne 4000be20 <_Watchdog_Adjust+0x90> 4000be14: 80 a6 a0 00 cmp %i2, 0 4000be18: 30 80 00 04 b,a 4000be28 <_Watchdog_Adjust+0x98> switch ( direction ) { case WATCHDOG_BACKWARD: _Watchdog_First( header )->delta_interval += units; break; case WATCHDOG_FORWARD: while ( units ) { 4000be1c: 80 a6 a0 00 cmp %i2, 0 4000be20: 32 bf ff ec bne,a 4000bdd0 <_Watchdog_Adjust+0x40> <== ALWAYS TAKEN 4000be24: c2 06 00 00 ld [ %i0 ], %g1 } break; } } _ISR_Enable( level ); 4000be28: 7f ff dc 36 call 40002f00 4000be2c: 91 e8 00 08 restore %g0, %o0, %o0 =============================================================================== 4000a4e8 <_Watchdog_Remove>: #include Watchdog_States _Watchdog_Remove( Watchdog_Control *the_watchdog ) { 4000a4e8: 9d e3 bf a0 save %sp, -96, %sp ISR_Level level; Watchdog_States previous_state; Watchdog_Control *next_watchdog; _ISR_Disable( level ); 4000a4ec: 7f ff de ef call 400020a8 4000a4f0: ba 10 00 18 mov %i0, %i5 previous_state = the_watchdog->state; 4000a4f4: f0 06 20 08 ld [ %i0 + 8 ], %i0 switch ( previous_state ) { 4000a4f8: 80 a6 20 01 cmp %i0, 1 4000a4fc: 22 80 00 1e be,a 4000a574 <_Watchdog_Remove+0x8c> 4000a500: c0 27 60 08 clr [ %i5 + 8 ] 4000a504: 0a 80 00 1d bcs 4000a578 <_Watchdog_Remove+0x90> 4000a508: 03 10 00 73 sethi %hi(0x4001cc00), %g1 4000a50c: 80 a6 20 03 cmp %i0, 3 4000a510: 18 80 00 1a bgu 4000a578 <_Watchdog_Remove+0x90> <== NEVER TAKEN 4000a514: 01 00 00 00 nop RTEMS_INLINE_ROUTINE Watchdog_Control *_Watchdog_Next( Watchdog_Control *the_watchdog ) { return ( (Watchdog_Control *) the_watchdog->Node.next ); 4000a518: 10 80 00 02 b 4000a520 <_Watchdog_Remove+0x38> 4000a51c: c2 07 40 00 ld [ %i5 ], %g1 break; case WATCHDOG_ACTIVE: case WATCHDOG_REMOVE_IT: the_watchdog->state = WATCHDOG_INACTIVE; 4000a520: c0 27 60 08 clr [ %i5 + 8 ] next_watchdog = _Watchdog_Next( the_watchdog ); if ( _Watchdog_Next(next_watchdog) ) 4000a524: c4 00 40 00 ld [ %g1 ], %g2 4000a528: 80 a0 a0 00 cmp %g2, 0 4000a52c: 02 80 00 07 be 4000a548 <_Watchdog_Remove+0x60> 4000a530: 05 10 00 73 sethi %hi(0x4001cc00), %g2 next_watchdog->delta_interval += the_watchdog->delta_interval; 4000a534: c6 00 60 10 ld [ %g1 + 0x10 ], %g3 4000a538: c4 07 60 10 ld [ %i5 + 0x10 ], %g2 4000a53c: 84 00 c0 02 add %g3, %g2, %g2 4000a540: c4 20 60 10 st %g2, [ %g1 + 0x10 ] if ( _Watchdog_Sync_count ) 4000a544: 05 10 00 73 sethi %hi(0x4001cc00), %g2 4000a548: c4 00 a1 a4 ld [ %g2 + 0x1a4 ], %g2 ! 4001cda4 <_Watchdog_Sync_count> 4000a54c: 80 a0 a0 00 cmp %g2, 0 4000a550: 22 80 00 07 be,a 4000a56c <_Watchdog_Remove+0x84> 4000a554: c4 07 60 04 ld [ %i5 + 4 ], %g2 _Watchdog_Sync_level = _ISR_Nest_level; 4000a558: 05 10 00 73 sethi %hi(0x4001cc00), %g2 4000a55c: c6 00 a2 c8 ld [ %g2 + 0x2c8 ], %g3 ! 4001cec8 <_Per_CPU_Information+0x8> 4000a560: 05 10 00 73 sethi %hi(0x4001cc00), %g2 4000a564: c6 20 a1 44 st %g3, [ %g2 + 0x144 ] ! 4001cd44 <_Watchdog_Sync_level> { Chain_Node *next; Chain_Node *previous; next = the_node->next; previous = the_node->previous; 4000a568: c4 07 60 04 ld [ %i5 + 4 ], %g2 next->previous = previous; 4000a56c: c4 20 60 04 st %g2, [ %g1 + 4 ] previous->next = next; 4000a570: c2 20 80 00 st %g1, [ %g2 ] _Chain_Extract_unprotected( &the_watchdog->Node ); break; } the_watchdog->stop_time = _Watchdog_Ticks_since_boot; 4000a574: 03 10 00 73 sethi %hi(0x4001cc00), %g1 4000a578: c2 00 61 a8 ld [ %g1 + 0x1a8 ], %g1 ! 4001cda8 <_Watchdog_Ticks_since_boot> 4000a57c: c2 27 60 18 st %g1, [ %i5 + 0x18 ] _ISR_Enable( level ); 4000a580: 7f ff de ce call 400020b8 4000a584: 01 00 00 00 nop return( previous_state ); } 4000a588: 81 c7 e0 08 ret 4000a58c: 81 e8 00 00 restore =============================================================================== 4000b73c <_Watchdog_Report_chain>: void _Watchdog_Report_chain( const char *name, Chain_Control *header ) { 4000b73c: 9d e3 bf a0 save %sp, -96, %sp ISR_Level level; Chain_Node *node; _ISR_Disable( level ); 4000b740: 7f ff dc c9 call 40002a64 4000b744: b8 10 00 18 mov %i0, %i4 4000b748: b0 10 00 08 mov %o0, %i0 printk( "Watchdog Chain: %s %p\n", name, header ); 4000b74c: 11 10 00 74 sethi %hi(0x4001d000), %o0 4000b750: 94 10 00 19 mov %i1, %o2 4000b754: 90 12 20 50 or %o0, 0x50, %o0 4000b758: 7f ff e4 1a call 400047c0 4000b75c: 92 10 00 1c mov %i4, %o1 */ RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_first( const Chain_Control *the_chain ) { return _Chain_Immutable_head( the_chain )->next; 4000b760: fa 06 40 00 ld [ %i1 ], %i5 RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( const Chain_Control *the_chain ) { return _Chain_Immutable_first( the_chain ) == _Chain_Immutable_tail( the_chain ); 4000b764: b2 06 60 04 add %i1, 4, %i1 if ( !_Chain_Is_empty( header ) ) { 4000b768: 80 a7 40 19 cmp %i5, %i1 4000b76c: 12 80 00 04 bne 4000b77c <_Watchdog_Report_chain+0x40> 4000b770: 92 10 00 1d mov %i5, %o1 _Watchdog_Report( NULL, watch ); } printk( "== end of %s \n", name ); } else { printk( "Chain is empty\n" ); 4000b774: 10 80 00 0d b 4000b7a8 <_Watchdog_Report_chain+0x6c> 4000b778: 11 10 00 74 sethi %hi(0x4001d000), %o0 node != _Chain_Tail(header) ; node = node->next ) { Watchdog_Control *watch = (Watchdog_Control *) node; _Watchdog_Report( NULL, watch ); 4000b77c: 40 00 00 0f call 4000b7b8 <_Watchdog_Report> 4000b780: 90 10 20 00 clr %o0 _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 ) 4000b784: fa 07 40 00 ld [ %i5 ], %i5 Chain_Node *node; _ISR_Disable( level ); printk( "Watchdog Chain: %s %p\n", name, header ); if ( !_Chain_Is_empty( header ) ) { for ( node = _Chain_First( header ) ; 4000b788: 80 a7 40 19 cmp %i5, %i1 4000b78c: 12 bf ff fc bne 4000b77c <_Watchdog_Report_chain+0x40> <== NEVER TAKEN 4000b790: 92 10 00 1d mov %i5, %o1 { Watchdog_Control *watch = (Watchdog_Control *) node; _Watchdog_Report( NULL, watch ); } printk( "== end of %s \n", name ); 4000b794: 11 10 00 74 sethi %hi(0x4001d000), %o0 4000b798: 92 10 00 1c mov %i4, %o1 4000b79c: 7f ff e4 09 call 400047c0 4000b7a0: 90 12 20 68 or %o0, 0x68, %o0 4000b7a4: 30 80 00 03 b,a 4000b7b0 <_Watchdog_Report_chain+0x74> } else { printk( "Chain is empty\n" ); 4000b7a8: 7f ff e4 06 call 400047c0 4000b7ac: 90 12 20 78 or %o0, 0x78, %o0 } _ISR_Enable( level ); 4000b7b0: 7f ff dc b1 call 40002a74 4000b7b4: 81 e8 00 00 restore =============================================================================== 4000a590 <_Watchdog_Tickle>: #include void _Watchdog_Tickle( Chain_Control *header ) { 4000a590: 9d e3 bf a0 save %sp, -96, %sp * 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 ); 4000a594: 7f ff de c5 call 400020a8 4000a598: b8 10 00 18 mov %i0, %i4 4000a59c: b0 10 00 08 mov %o0, %i0 */ RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_first( const Chain_Control *the_chain ) { return _Chain_Immutable_head( the_chain )->next; 4000a5a0: fa 07 00 00 ld [ %i4 ], %i5 RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( const Chain_Control *the_chain ) { return _Chain_Immutable_first( the_chain ) == _Chain_Immutable_tail( the_chain ); 4000a5a4: b6 07 20 04 add %i4, 4, %i3 if ( _Chain_Is_empty( header ) ) 4000a5a8: 80 a7 40 1b cmp %i5, %i3 4000a5ac: 02 80 00 1f be 4000a628 <_Watchdog_Tickle+0x98> 4000a5b0: 01 00 00 00 nop * 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) { 4000a5b4: c2 07 60 10 ld [ %i5 + 0x10 ], %g1 4000a5b8: 80 a0 60 00 cmp %g1, 0 4000a5bc: 02 80 00 06 be 4000a5d4 <_Watchdog_Tickle+0x44> <== NEVER TAKEN 4000a5c0: 82 00 7f ff add %g1, -1, %g1 the_watchdog->delta_interval--; 4000a5c4: c2 27 60 10 st %g1, [ %i5 + 0x10 ] if ( the_watchdog->delta_interval != 0 ) 4000a5c8: 80 a0 60 00 cmp %g1, 0 4000a5cc: 12 80 00 17 bne 4000a628 <_Watchdog_Tickle+0x98> 4000a5d0: 01 00 00 00 nop goto leave; } do { watchdog_state = _Watchdog_Remove( the_watchdog ); 4000a5d4: 7f ff ff c5 call 4000a4e8 <_Watchdog_Remove> 4000a5d8: 90 10 00 1d mov %i5, %o0 4000a5dc: b4 10 00 08 mov %o0, %i2 _ISR_Enable( level ); 4000a5e0: 7f ff de b6 call 400020b8 4000a5e4: 90 10 00 18 mov %i0, %o0 switch( watchdog_state ) { 4000a5e8: 80 a6 a0 02 cmp %i2, 2 4000a5ec: 12 80 00 06 bne 4000a604 <_Watchdog_Tickle+0x74> 4000a5f0: 01 00 00 00 nop case WATCHDOG_ACTIVE: (*the_watchdog->routine)( 4000a5f4: c2 07 60 1c ld [ %i5 + 0x1c ], %g1 4000a5f8: d0 07 60 20 ld [ %i5 + 0x20 ], %o0 4000a5fc: 9f c0 40 00 call %g1 4000a600: d2 07 60 24 ld [ %i5 + 0x24 ], %o1 case WATCHDOG_REMOVE_IT: break; } _ISR_Disable( level ); 4000a604: 7f ff de a9 call 400020a8 4000a608: 01 00 00 00 nop 4000a60c: b0 10 00 08 mov %o0, %i0 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_First( Chain_Control *the_chain ) { return _Chain_Head( the_chain )->next; 4000a610: fa 07 00 00 ld [ %i4 ], %i5 the_watchdog = _Watchdog_First( header ); } while ( !_Chain_Is_empty( header ) && (the_watchdog->delta_interval == 0) ); 4000a614: 80 a7 40 1b cmp %i5, %i3 4000a618: 02 80 00 04 be 4000a628 <_Watchdog_Tickle+0x98> 4000a61c: 01 00 00 00 nop } _ISR_Disable( level ); the_watchdog = _Watchdog_First( header ); } while ( !_Chain_Is_empty( header ) && 4000a620: 10 bf ff ea b 4000a5c8 <_Watchdog_Tickle+0x38> 4000a624: c2 07 60 10 ld [ %i5 + 0x10 ], %g1 (the_watchdog->delta_interval == 0) ); leave: _ISR_Enable(level); 4000a628: 7f ff de a4 call 400020b8 4000a62c: 81 e8 00 00 restore =============================================================================== 4000a630 <_Workspace_Handler_initialization>: void _Workspace_Handler_initialization( Heap_Area *areas, size_t area_count, Heap_Initialization_or_extend_handler extend ) { 4000a630: 9d e3 bf a0 save %sp, -96, %sp Heap_Initialization_or_extend_handler init_or_extend = _Heap_Initialize; uintptr_t remaining = rtems_configuration_get_work_space_size(); 4000a634: 05 10 00 69 sethi %hi(0x4001a400), %g2 4000a638: 82 10 a0 58 or %g2, 0x58, %g1 ! 4001a458 4000a63c: c6 08 60 32 ldub [ %g1 + 0x32 ], %g3 4000a640: fa 00 a0 58 ld [ %g2 + 0x58 ], %i5 4000a644: 80 a0 e0 00 cmp %g3, 0 4000a648: 12 80 00 03 bne 4000a654 <_Workspace_Handler_initialization+0x24> 4000a64c: 84 10 20 00 clr %g2 4000a650: c4 00 60 04 ld [ %g1 + 4 ], %g2 Heap_Area *areas, size_t area_count, Heap_Initialization_or_extend_handler extend ) { Heap_Initialization_or_extend_handler init_or_extend = _Heap_Initialize; 4000a654: 21 10 00 20 sethi %hi(0x40008000), %l0 } else { size = 0; } } space_available = (*init_or_extend)( 4000a658: 27 10 00 73 sethi %hi(0x4001cc00), %l3 size_t area_count, Heap_Initialization_or_extend_handler extend ) { Heap_Initialization_or_extend_handler init_or_extend = _Heap_Initialize; uintptr_t remaining = rtems_configuration_get_work_space_size(); 4000a65c: ba 00 80 1d add %g2, %i5, %i5 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) { 4000a660: b6 10 20 00 clr %i3 Heap_Area *areas, size_t area_count, Heap_Initialization_or_extend_handler extend ) { Heap_Initialization_or_extend_handler init_or_extend = _Heap_Initialize; 4000a664: a0 14 20 ec or %l0, 0xec, %l0 size_t i; for (i = 0; i < area_count; ++i) { Heap_Area *area = &areas [i]; if ( do_zero ) { 4000a668: e2 08 60 30 ldub [ %g1 + 0x30 ], %l1 if ( area->size > overhead ) { uintptr_t space_available; uintptr_t size; if ( unified ) { 4000a66c: e4 08 60 31 ldub [ %g1 + 0x31 ], %l2 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) { 4000a670: 10 80 00 2c b 4000a720 <_Workspace_Handler_initialization+0xf0> 4000a674: a6 14 e0 d0 or %l3, 0xd0, %l3 Heap_Area *area = &areas [i]; if ( do_zero ) { 4000a678: 22 80 00 07 be,a 4000a694 <_Workspace_Handler_initialization+0x64> 4000a67c: f8 06 20 04 ld [ %i0 + 4 ], %i4 memset( area->begin, 0, area->size ); 4000a680: d0 06 00 00 ld [ %i0 ], %o0 4000a684: d4 06 20 04 ld [ %i0 + 4 ], %o2 4000a688: 40 00 10 1f call 4000e704 4000a68c: 92 10 20 00 clr %o1 } if ( area->size > overhead ) { 4000a690: f8 06 20 04 ld [ %i0 + 4 ], %i4 4000a694: 80 a7 20 16 cmp %i4, 0x16 4000a698: 28 80 00 21 bleu,a 4000a71c <_Workspace_Handler_initialization+0xec> 4000a69c: b6 06 e0 01 inc %i3 uintptr_t space_available; uintptr_t size; if ( unified ) { 4000a6a0: 80 a4 a0 00 cmp %l2, 0 4000a6a4: 32 80 00 0c bne,a 4000a6d4 <_Workspace_Handler_initialization+0xa4> 4000a6a8: d2 06 00 00 ld [ %i0 ], %o1 size = area->size; } else { if ( remaining > 0 ) { 4000a6ac: 80 a7 60 00 cmp %i5, 0 4000a6b0: 22 80 00 08 be,a 4000a6d0 <_Workspace_Handler_initialization+0xa0><== NEVER TAKEN 4000a6b4: b8 10 20 00 clr %i4 <== NOT EXECUTED size = remaining < area->size - overhead ? 4000a6b8: 82 07 3f ea add %i4, -22, %g1 remaining + overhead : area->size; 4000a6bc: 80 a7 40 01 cmp %i5, %g1 4000a6c0: 2a 80 00 04 bcs,a 4000a6d0 <_Workspace_Handler_initialization+0xa0><== ALWAYS TAKEN 4000a6c4: b8 07 60 16 add %i5, 0x16, %i4 } else { size = 0; } } space_available = (*init_or_extend)( 4000a6c8: 10 80 00 03 b 4000a6d4 <_Workspace_Handler_initialization+0xa4><== NOT EXECUTED 4000a6cc: d2 06 00 00 ld [ %i0 ], %o1 <== NOT EXECUTED 4000a6d0: d2 06 00 00 ld [ %i0 ], %o1 4000a6d4: 94 10 00 1c mov %i4, %o2 4000a6d8: 90 10 00 13 mov %l3, %o0 4000a6dc: 9f c4 00 00 call %l0 4000a6e0: 96 10 20 08 mov 8, %o3 area->begin, size, page_size ); area->begin = (char *) area->begin + size; 4000a6e4: c2 06 00 00 ld [ %i0 ], %g1 area->size -= size; if ( space_available < remaining ) { 4000a6e8: 80 a2 00 1d cmp %o0, %i5 area->begin, size, page_size ); area->begin = (char *) area->begin + size; 4000a6ec: 82 00 40 1c add %g1, %i4, %g1 4000a6f0: c2 26 00 00 st %g1, [ %i0 ] area->size -= size; 4000a6f4: c2 06 20 04 ld [ %i0 + 4 ], %g1 4000a6f8: b8 20 40 1c sub %g1, %i4, %i4 if ( space_available < remaining ) { 4000a6fc: 1a 80 00 05 bcc 4000a710 <_Workspace_Handler_initialization+0xe0><== ALWAYS TAKEN 4000a700: f8 26 20 04 st %i4, [ %i0 + 4 ] remaining -= space_available; 4000a704: ba 27 40 08 sub %i5, %o0, %i5 <== NOT EXECUTED } else { remaining = 0; } init_or_extend = extend; 4000a708: 10 80 00 04 b 4000a718 <_Workspace_Handler_initialization+0xe8><== NOT EXECUTED 4000a70c: a0 10 00 1a mov %i2, %l0 <== NOT EXECUTED 4000a710: a0 10 00 1a mov %i2, %l0 area->size -= size; if ( space_available < remaining ) { remaining -= space_available; } else { remaining = 0; 4000a714: ba 10 20 00 clr %i5 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) { 4000a718: b6 06 e0 01 inc %i3 4000a71c: b0 06 20 08 add %i0, 8, %i0 4000a720: 80 a6 c0 19 cmp %i3, %i1 4000a724: 12 bf ff d5 bne 4000a678 <_Workspace_Handler_initialization+0x48> 4000a728: 80 a4 60 00 cmp %l1, 0 init_or_extend = extend; } } if ( remaining > 0 ) { 4000a72c: 80 a7 60 00 cmp %i5, 0 4000a730: 02 80 00 05 be 4000a744 <_Workspace_Handler_initialization+0x114> 4000a734: 90 10 20 00 clr %o0 _Internal_error_Occurred( 4000a738: 92 10 20 01 mov 1, %o1 4000a73c: 7f ff f6 ff call 40008338 <_Internal_error_Occurred> 4000a740: 94 10 20 02 mov 2, %o2 4000a744: 81 c7 e0 08 ret 4000a748: 81 e8 00 00 restore =============================================================================== 4000a2b8 <_Workspace_String_duplicate>: char *_Workspace_String_duplicate( const char *string, size_t len ) { 4000a2b8: 9d e3 bf a0 save %sp, -96, %sp char *dup = _Workspace_Allocate(len + 1); 4000a2bc: 7f ff ff e3 call 4000a248 <_Workspace_Allocate> 4000a2c0: 90 06 60 01 add %i1, 1, %o0 if (dup != NULL) { 4000a2c4: ba 92 20 00 orcc %o0, 0, %i5 4000a2c8: 02 80 00 05 be 4000a2dc <_Workspace_String_duplicate+0x24><== NEVER TAKEN 4000a2cc: 92 10 00 18 mov %i0, %o1 dup [len] = '\0'; 4000a2d0: c0 2f 40 19 clrb [ %i5 + %i1 ] memcpy(dup, string, len); 4000a2d4: 40 00 0f cd call 4000e208 4000a2d8: 94 10 00 19 mov %i1, %o2 } return dup; } 4000a2dc: 81 c7 e0 08 ret 4000a2e0: 91 e8 00 1d restore %g0, %i5, %o0 =============================================================================== 40019c34 <__kill>: #endif int __kill( pid_t pid, int sig ) { return 0; } 40019c34: 81 c3 e0 08 retl <== NOT EXECUTED 40019c38: 90 10 20 00 clr %o0 <== NOT EXECUTED =============================================================================== 40019ab4 <_calloc_r>: struct _reent *ignored __attribute__((unused)), size_t elements, size_t size ) { return calloc( elements, size ); 40019ab4: 90 10 00 09 mov %o1, %o0 <== NOT EXECUTED 40019ab8: 92 10 00 0a mov %o2, %o1 <== NOT EXECUTED 40019abc: 82 13 c0 00 mov %o7, %g1 <== NOT EXECUTED 40019ac0: 7f ff a4 90 call 40002d00 <== NOT EXECUTED 40019ac4: 9e 10 40 00 mov %g1, %o7 <== NOT EXECUTED =============================================================================== 40019b3c <_close_r>: int _close_r( struct _reent *ptr __attribute__((unused)), int fd ) { return close( fd ); 40019b3c: 90 10 00 09 mov %o1, %o0 40019b40: 82 13 c0 00 mov %o7, %g1 40019b44: 7f ff ff e1 call 40019ac8 40019b48: 9e 10 40 00 mov %g1, %o7 =============================================================================== 40012400 <_fat_block_read>: uint32_t start, uint32_t offset, uint32_t count, void *buff ) { 40012400: 9d e3 bf 98 save %sp, -104, %sp uint32_t sec_num = start; uint32_t ofs = offset; uint8_t *sec_buf; uint32_t c = 0; while (count > 0) 40012404: 10 80 00 17 b 40012460 <_fat_block_read+0x60> 40012408: ba 10 20 00 clr %i5 { rc = fat_buf_access(fs_info, sec_num, FAT_OP_TYPE_READ, &sec_buf); 4001240c: 92 10 00 19 mov %i1, %o1 40012410: 94 10 20 01 mov 1, %o2 40012414: 7f ff ff cc call 40012344 40012418: 96 07 bf fc add %fp, -4, %o3 if (rc != RC_OK) 4001241c: 80 a2 20 00 cmp %o0, 0 40012420: 32 80 00 15 bne,a 40012474 <_fat_block_read+0x74> <== NEVER TAKEN 40012424: ba 10 3f ff mov -1, %i5 <== NOT EXECUTED return -1; c = MIN(count, (fs_info->vol.bps - ofs)); 40012428: e0 16 00 00 lduh [ %i0 ], %l0 4001242c: a0 24 00 1a sub %l0, %i2, %l0 40012430: 80 a4 00 1b cmp %l0, %i3 40012434: 38 80 00 02 bgu,a 4001243c <_fat_block_read+0x3c> 40012438: a0 10 00 1b mov %i3, %l0 memcpy((buff + cmpltd), (sec_buf + ofs), c); 4001243c: d2 07 bf fc ld [ %fp + -4 ], %o1 40012440: 90 07 00 1d add %i4, %i5, %o0 40012444: 92 02 40 1a add %o1, %i2, %o1 40012448: 94 10 00 10 mov %l0, %o2 4001244c: 40 00 20 5d call 4001a5c0 40012450: b6 26 c0 10 sub %i3, %l0, %i3 count -= c; cmpltd += c; 40012454: ba 04 00 1d add %l0, %i5, %i5 sec_num++; 40012458: b2 06 60 01 inc %i1 ofs = 0; 4001245c: b4 10 20 00 clr %i2 uint32_t sec_num = start; uint32_t ofs = offset; uint8_t *sec_buf; uint32_t c = 0; while (count > 0) 40012460: 80 a6 e0 00 cmp %i3, 0 40012464: 12 bf ff ea bne 4001240c <_fat_block_read+0xc> 40012468: 90 10 00 18 mov %i0, %o0 cmpltd += c; sec_num++; ofs = 0; } return cmpltd; } 4001246c: 81 c7 e0 08 ret 40012470: 91 e8 00 1d restore %g0, %i5, %o0 40012474: b0 10 00 1d mov %i5, %i0 <== NOT EXECUTED 40012478: 81 c7 e0 08 ret <== NOT EXECUTED 4001247c: 81 e8 00 00 restore <== NOT EXECUTED =============================================================================== 4000310c <_gettimeofday>: int _gettimeofday( struct timeval *tp, struct timezone *tzp ) { return gettimeofday( tp, tzp ); 4000310c: 82 13 c0 00 mov %o7, %g1 <== NOT EXECUTED 40003110: 7f ff ff d9 call 40003074 <== NOT EXECUTED 40003114: 9e 10 40 00 mov %g1, %o7 <== NOT EXECUTED =============================================================================== 40003c90 <_lstat_r>: struct _reent *ptr __attribute__((unused)), const char *path, struct stat *buf ) { return _STAT_NAME( path, buf ); 40003c90: 90 10 00 09 mov %o1, %o0 <== NOT EXECUTED 40003c94: 92 10 00 0a mov %o2, %o1 <== NOT EXECUTED 40003c98: 82 13 c0 00 mov %o7, %g1 <== NOT EXECUTED 40003c9c: 7f ff ff e9 call 40003c40 <== NOT EXECUTED 40003ca0: 9e 10 40 00 mov %g1, %o7 <== NOT EXECUTED =============================================================================== 40003e8c <_stat_r>: struct _reent *ptr __attribute__((unused)), const char *path, struct stat *buf ) { return _STAT_NAME( path, buf ); 40003e8c: 90 10 00 09 mov %o1, %o0 <== NOT EXECUTED 40003e90: 92 10 00 0a mov %o2, %o1 <== NOT EXECUTED 40003e94: 82 13 c0 00 mov %o7, %g1 <== NOT EXECUTED 40003e98: 7f ff ff e9 call 40003e3c <== NOT EXECUTED 40003e9c: 9e 10 40 00 mov %g1, %o7 <== NOT EXECUTED =============================================================================== 400038c0 : #include #include int chroot( const char *path ) { 400038c0: 9d e3 bf 48 save %sp, -184, %sp /* * 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( 400038c4: 94 10 20 19 mov 0x19, %o2 400038c8: 92 10 00 18 mov %i0, %o1 400038cc: 90 07 bf c8 add %fp, -56, %o0 400038d0: 17 10 00 4e sethi %hi(0x40013800), %o3 400038d4: 96 12 e0 b4 or %o3, 0xb4, %o3 ! 400138b4 400038d8: 40 00 04 c3 call 40004be4 400038dc: 98 02 ff fc add %o3, -4, %o4 400038e0: 90 07 bf b0 add %fp, -80, %o0 400038e4: 40 00 05 da call 4000504c 400038e8: 92 07 bf e0 add %fp, -32, %o1 &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 ); 400038ec: 40 00 06 50 call 4000522c 400038f0: 90 07 bf b0 add %fp, -80, %o0 if ( !rtems_filesystem_global_location_is_null( new_current_loc ) ) { 400038f4: c2 02 20 10 ld [ %o0 + 0x10 ], %g1 400038f8: 39 10 00 4b sethi %hi(0x40012c00), %i4 400038fc: b8 17 23 34 or %i4, 0x334, %i4 ! 40012f34 40003900: 80 a0 40 1c cmp %g1, %i4 40003904: 02 80 00 29 be 400039a8 40003908: d0 27 bf ac st %o0, [ %fp + -84 ] rtems_filesystem_global_location_t *new_root_loc = 4000390c: 40 00 06 16 call 40005164 40003910: 90 07 bf ac add %fp, -84, %o0 rtems_filesystem_global_location_obtain( &new_current_loc ); rtems_filesystem_node_types_t type = (*new_root_loc->location.mt_entry->ops->node_type_h)( 40003914: c2 02 20 14 ld [ %o0 + 0x14 ], %g1 40003918: c2 00 60 0c ld [ %g1 + 0xc ], %g1 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 = 4000391c: c2 00 60 14 ld [ %g1 + 0x14 ], %g1 40003920: 9f c0 40 00 call %g1 40003924: ba 10 00 08 mov %o0, %i5 (*new_root_loc->location.mt_entry->ops->node_type_h)( &new_root_loc->location ); if ( type == RTEMS_FILESYSTEM_DIRECTORY ) { 40003928: 80 a2 20 00 cmp %o0, 0 4000392c: 32 80 00 17 bne,a 40003988 40003930: c2 07 60 10 ld [ %i5 + 0x10 ], %g1 sc = rtems_libio_set_private_env(); 40003934: 40 00 03 1d call 400045a8 40003938: 01 00 00 00 nop if (sc == RTEMS_SUCCESSFUL) { 4000393c: 80 a2 20 00 cmp %o0, 0 40003940: 12 80 00 0c bne 40003970 40003944: 80 a2 20 0d cmp %o0, 0xd rtems_filesystem_global_location_assign( 40003948: 39 10 00 4e sethi %hi(0x40013800), %i4 4000394c: d0 07 20 ac ld [ %i4 + 0xac ], %o0 ! 400138ac 40003950: 92 10 00 1d mov %i5, %o1 40003954: 40 00 05 fb call 40005140 40003958: 90 02 20 04 add %o0, 4, %o0 &rtems_filesystem_root, new_root_loc ); rtems_filesystem_global_location_assign( 4000395c: d0 07 20 ac ld [ %i4 + 0xac ], %o0 40003960: d2 07 bf ac ld [ %fp + -84 ], %o1 40003964: 40 00 05 f7 call 40005140 40003968: b0 10 20 00 clr %i0 4000396c: 30 80 00 10 b,a 400039ac &rtems_filesystem_current, new_current_loc ); } else { if (sc != RTEMS_UNSATISFIED) { 40003970: 02 80 00 18 be 400039d0 <== NEVER TAKEN 40003974: 01 00 00 00 nop errno = ENOMEM; 40003978: 40 00 1b e0 call 4000a8f8 <__errno> 4000397c: 01 00 00 00 nop 40003980: 10 80 00 08 b 400039a0 40003984: 82 10 20 0c mov 0xc, %g1 ! c static inline void rtems_filesystem_location_error( const rtems_filesystem_location_info_t *loc, int eno ) { if ( !rtems_filesystem_location_is_null( loc ) ) { 40003988: 80 a0 40 1c cmp %g1, %i4 4000398c: 02 80 00 11 be 400039d0 <== NEVER TAKEN 40003990: 01 00 00 00 nop errno = eno; 40003994: 40 00 1b d9 call 4000a8f8 <__errno> 40003998: 01 00 00 00 nop 4000399c: 82 10 20 14 mov 0x14, %g1 ! 14 400039a0: 10 80 00 0c b 400039d0 400039a4: c2 22 00 00 st %g1, [ %o0 ] if ( rv != 0 ) { rtems_filesystem_global_location_release( new_root_loc ); } } else { rv = -1; 400039a8: b0 10 3f ff mov -1, %i0 } rtems_filesystem_eval_path_cleanup( &ctx ); 400039ac: 40 00 04 d4 call 40004cfc 400039b0: 90 07 bf c8 add %fp, -56, %o0 if ( rv != 0 ) { 400039b4: 80 a6 20 00 cmp %i0, 0 400039b8: 02 80 00 0a be 400039e0 400039bc: 01 00 00 00 nop rtems_filesystem_global_location_release( new_current_loc ); 400039c0: 40 00 05 c8 call 400050e0 400039c4: d0 07 bf ac ld [ %fp + -84 ], %o0 400039c8: 81 c7 e0 08 ret 400039cc: 81 e8 00 00 restore rtems_filesystem_location_error( &new_root_loc->location, ENOTDIR ); rv = -1; } if ( rv != 0 ) { rtems_filesystem_global_location_release( new_root_loc ); 400039d0: 40 00 05 c4 call 400050e0 400039d4: 90 10 00 1d mov %i5, %o0 } } else { rv = -1; 400039d8: 10 bf ff f5 b 400039ac 400039dc: b0 10 3f ff mov -1, %i0 if ( rv != 0 ) { rtems_filesystem_global_location_release( new_current_loc ); } return rv; } 400039e0: 81 c7 e0 08 ret 400039e4: 81 e8 00 00 restore =============================================================================== 40003074 : dev_t dev, const char *name, rtems_disk_device **dd_ptr, char **alloc_name_ptr ) { 40003074: 9d e3 bf a0 save %sp, -96, %sp rtems_device_major_number major = 0; rtems_device_minor_number minor = 0; rtems_filesystem_split_dev_t(dev, major, minor); if (major >= disktab_size) { 40003078: 03 10 00 63 sethi %hi(0x40018c00), %g1 4000307c: e0 00 62 70 ld [ %g1 + 0x270 ], %l0 ! 40018e70 40003080: 80 a6 00 10 cmp %i0, %l0 40003084: 0a 80 00 16 bcs 400030dc 40003088: 03 10 00 63 sethi %hi(0x40018c00), %g1 rtems_disk_device_table *table = disktab; rtems_device_major_number old_size = disktab_size; rtems_device_major_number new_size = 2 * old_size; 4000308c: bb 2c 20 01 sll %l0, 1, %i5 if (major >= new_size) { 40003090: 80 a6 00 1d cmp %i0, %i5 40003094: 0a 80 00 03 bcs 400030a0 <== NEVER TAKEN 40003098: d0 00 62 74 ld [ %g1 + 0x274 ], %o0 new_size = major + 1; 4000309c: ba 06 20 01 add %i0, 1, %i5 } table = realloc(table, new_size * sizeof(*table)); 400030a0: 40 00 07 ce call 40004fd8 400030a4: 93 2f 60 03 sll %i5, 3, %o1 if (table == NULL) { 400030a8: a2 92 20 00 orcc %o0, 0, %l1 400030ac: 02 80 00 58 be 4000320c <== ALWAYS TAKEN 400030b0: 94 27 40 10 sub %i5, %l0, %o2 return NULL; } memset(table + old_size, 0, (new_size - old_size) * sizeof(*table)); 400030b4: 91 2c 20 03 sll %l0, 3, %o0 <== NOT EXECUTED 400030b8: 92 10 20 00 clr %o1 <== NOT EXECUTED 400030bc: 90 04 40 08 add %l1, %o0, %o0 <== NOT EXECUTED 400030c0: 40 00 3e 55 call 40012a14 <== NOT EXECUTED 400030c4: 95 2a a0 03 sll %o2, 3, %o2 <== NOT EXECUTED disktab = table; 400030c8: 03 10 00 63 sethi %hi(0x40018c00), %g1 <== NOT EXECUTED 400030cc: e2 20 62 74 st %l1, [ %g1 + 0x274 ] ! 40018e74 <== NOT EXECUTED disktab_size = new_size; 400030d0: 03 10 00 63 sethi %hi(0x40018c00), %g1 <== NOT EXECUTED 400030d4: fa 20 62 70 st %i5, [ %g1 + 0x270 ] ! 40018e70 <== NOT EXECUTED } if (disktab [major].minor == NULL || minor >= disktab[major].size) { 400030d8: 03 10 00 63 sethi %hi(0x40018c00), %g1 <== NOT EXECUTED 400030dc: e4 00 62 74 ld [ %g1 + 0x274 ], %l2 ! 40018e74 400030e0: a3 2e 20 03 sll %i0, 3, %l1 400030e4: d0 04 80 11 ld [ %l2 + %l1 ], %o0 400030e8: a8 04 80 11 add %l2, %l1, %l4 400030ec: 80 a2 20 00 cmp %o0, 0 400030f0: 02 80 00 05 be 40003104 400030f4: e0 05 20 04 ld [ %l4 + 4 ], %l0 400030f8: 80 a6 40 10 cmp %i1, %l0 400030fc: 2a 80 00 16 bcs,a 40003154 40003100: e2 04 80 11 ld [ %l2 + %l1 ], %l1 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) { 40003104: 80 a4 20 00 cmp %l0, 0 40003108: 02 80 00 03 be 40003114 4000310c: ba 10 20 08 mov 8, %i5 new_size = DISKTAB_INITIAL_SIZE; } else { new_size = 2 * old_size; 40003110: bb 2c 20 01 sll %l0, 1, %i5 } if (minor >= new_size) { 40003114: 80 a6 40 1d cmp %i1, %i5 40003118: 3a 80 00 02 bcc,a 40003120 4000311c: ba 06 60 01 add %i1, 1, %i5 new_size = minor + 1; } table = realloc(table, new_size * sizeof(*table)); 40003120: 40 00 07 ae call 40004fd8 40003124: 93 2f 60 02 sll %i5, 2, %o1 if (table == NULL) { 40003128: a6 92 20 00 orcc %o0, 0, %l3 4000312c: 02 80 00 38 be 4000320c 40003130: 94 27 40 10 sub %i5, %l0, %o2 return NULL; } memset(table + old_size, 0, (new_size - old_size) * sizeof(*table)); 40003134: 91 2c 20 02 sll %l0, 2, %o0 40003138: 92 10 20 00 clr %o1 4000313c: 90 04 c0 08 add %l3, %o0, %o0 40003140: 40 00 3e 35 call 40012a14 40003144: 95 2a a0 02 sll %o2, 2, %o2 disktab [major].minor = table; 40003148: e6 24 80 11 st %l3, [ %l2 + %l1 ] disktab [major].size = new_size; 4000314c: fa 25 20 04 st %i5, [ %l4 + 4 ] } return disktab [major].minor + minor; 40003150: e2 04 80 11 ld [ %l2 + %l1 ], %l1 40003154: a1 2e 60 02 sll %i1, 2, %l0 40003158: 82 04 40 10 add %l1, %l0, %g1 { rtems_disk_device **dd_entry = create_disk_table_entry(dev); rtems_disk_device *dd = NULL; char *alloc_name = NULL; if (dd_entry == NULL) { 4000315c: 80 a0 60 00 cmp %g1, 0 40003160: 32 80 00 04 bne,a 40003170 <== ALWAYS TAKEN 40003164: c4 04 40 10 ld [ %l1 + %l0 ], %g2 return RTEMS_NO_MEMORY; 40003168: 10 80 00 2a b 40003210 <== NOT EXECUTED 4000316c: 82 10 20 1a mov 0x1a, %g1 <== NOT EXECUTED } if (*dd_entry != NULL) { 40003170: 80 a0 a0 00 cmp %g2, 0 40003174: 12 80 00 27 bne 40003210 40003178: 82 10 20 0c mov 0xc, %g1 return RTEMS_RESOURCE_IN_USE; } dd = malloc(sizeof(*dd)); 4000317c: 40 00 04 f5 call 40004550 40003180: 90 10 20 78 mov 0x78, %o0 if (dd == NULL) { 40003184: ba 92 20 00 orcc %o0, 0, %i5 40003188: 02 80 00 21 be 4000320c <== NEVER TAKEN 4000318c: 80 a6 a0 00 cmp %i2, 0 return RTEMS_NO_MEMORY; } if (name != NULL) { 40003190: 02 80 00 11 be 400031d4 40003194: a4 10 20 00 clr %l2 alloc_name = strdup(name); 40003198: 40 00 3e f9 call 40012d7c 4000319c: 90 10 00 1a mov %i2, %o0 if (alloc_name == NULL) { 400031a0: a4 92 20 00 orcc %o0, 0, %l2 400031a4: 12 80 00 11 bne 400031e8 <== ALWAYS TAKEN 400031a8: b4 10 00 08 mov %o0, %i2 free(dd); 400031ac: 40 00 03 a8 call 4000404c <== NOT EXECUTED 400031b0: 90 10 00 1d mov %i5, %o0 <== NOT EXECUTED 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; 400031b4: 10 80 00 17 b 40003210 <== NOT EXECUTED 400031b8: 82 10 20 1a mov 0x1a, %g1 <== NOT EXECUTED } } if (name != NULL) { if (mknod(alloc_name, 0777 | S_IFBLK, dev) < 0) { free(alloc_name); 400031bc: 40 00 03 a4 call 4000404c <== NOT EXECUTED 400031c0: 90 10 00 1a mov %i2, %o0 <== NOT EXECUTED free(dd); 400031c4: 40 00 03 a2 call 4000404c <== NOT EXECUTED 400031c8: 90 10 00 1d mov %i5, %o0 <== NOT EXECUTED return RTEMS_UNSATISFIED; 400031cc: 10 80 00 11 b 40003210 <== NOT EXECUTED 400031d0: 82 10 20 0d mov 0xd, %g1 <== NOT EXECUTED } } *dd_entry = dd; 400031d4: fa 24 40 10 st %i5, [ %l1 + %l0 ] *dd_ptr = dd; 400031d8: fa 26 c0 00 st %i5, [ %i3 ] *alloc_name_ptr = alloc_name; 400031dc: e4 27 00 00 st %l2, [ %i4 ] return RTEMS_SUCCESSFUL; 400031e0: 10 80 00 0c b 40003210 400031e4: 82 10 20 00 clr %g1 return RTEMS_NO_MEMORY; } } if (name != NULL) { if (mknod(alloc_name, 0777 | S_IFBLK, dev) < 0) { 400031e8: 13 00 00 18 sethi %hi(0x6000), %o1 400031ec: 94 10 00 18 mov %i0, %o2 400031f0: 92 12 61 ff or %o1, 0x1ff, %o1 400031f4: 40 00 05 47 call 40004710 400031f8: 96 10 00 19 mov %i1, %o3 400031fc: 80 a2 20 00 cmp %o0, 0 40003200: 36 bf ff f6 bge,a 400031d8 <== ALWAYS TAKEN 40003204: fa 24 40 10 st %i5, [ %l1 + %l0 ] 40003208: 30 bf ff ed b,a 400031bc <== NOT EXECUTED 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; 4000320c: 82 10 20 1a mov 0x1a, %g1 *dd_entry = dd; *dd_ptr = dd; *alloc_name_ptr = alloc_name; return RTEMS_SUCCESSFUL; } 40003210: 81 c7 e0 08 ret 40003214: 91 e8 00 01 restore %g0, %g1, %o0 =============================================================================== 400042d8 : * RTEMS_SUCCESSFUL, if success; * RTEMS_NO_MEMOTY, if cannot allocate memory for part_desc_t strucure; * RTEMS_INTERNAL_ERROR, if other error occurs. */ static rtems_status_code data_to_part_desc(uint8_t *data, rtems_part_desc_t **new_part_desc) 400042d8: 9d e3 bf 98 save %sp, -104, %sp return RTEMS_INTERNAL_ERROR; } *new_part_desc = NULL; if ((part_desc = calloc(1, sizeof(rtems_part_desc_t))) == NULL) 400042dc: 90 10 20 01 mov 1, %o0 * RTEMS_SUCCESSFUL, if success; * RTEMS_NO_MEMOTY, if cannot allocate memory for part_desc_t strucure; * RTEMS_INTERNAL_ERROR, if other error occurs. */ static rtems_status_code data_to_part_desc(uint8_t *data, rtems_part_desc_t **new_part_desc) 400042e0: b8 10 00 18 mov %i0, %i4 if (new_part_desc == NULL) { return RTEMS_INTERNAL_ERROR; } *new_part_desc = NULL; 400042e4: c0 26 40 00 clr [ %i1 ] if ((part_desc = calloc(1, sizeof(rtems_part_desc_t))) == NULL) 400042e8: 92 10 20 28 mov 0x28, %o1 400042ec: 40 00 03 1a call 40004f54 400042f0: b0 10 20 1a mov 0x1a, %i0 400042f4: 80 a2 20 00 cmp %o0, 0 400042f8: 02 80 00 27 be 40004394 <== NEVER TAKEN 400042fc: ba 10 00 08 mov %o0, %i5 { return RTEMS_NO_MEMORY; } part_desc->bootable = *(data + RTEMS_IDE_PARTITION_BOOTABLE_OFFSET); 40004300: c2 0f 00 00 ldub [ %i4 ], %g1 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)); 40004304: 92 07 20 08 add %i4, 8, %o1 if ((part_desc = calloc(1, sizeof(rtems_part_desc_t))) == NULL) { return RTEMS_NO_MEMORY; } part_desc->bootable = *(data + RTEMS_IDE_PARTITION_BOOTABLE_OFFSET); 40004308: c2 2a 00 00 stb %g1, [ %o0 ] part_desc->sys_type = *(data + RTEMS_IDE_PARTITION_SYS_TYPE_OFFSET); 4000430c: f6 0f 20 04 ldub [ %i4 + 4 ], %i3 /* 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)); 40004310: 94 10 20 04 mov 4, %o2 { return RTEMS_NO_MEMORY; } part_desc->bootable = *(data + RTEMS_IDE_PARTITION_BOOTABLE_OFFSET); part_desc->sys_type = *(data + RTEMS_IDE_PARTITION_SYS_TYPE_OFFSET); 40004314: f6 2a 20 01 stb %i3, [ %o0 + 1 ] /* 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)); 40004318: 40 00 3e 4a call 40013c40 4000431c: 90 07 bf fc add %fp, -4, %o0 part_desc->start = LE_TO_CPU_U32(temp); 40004320: 7f ff ff ac call 400041d0 40004324: d0 07 bf fc ld [ %fp + -4 ], %o0 memcpy(&temp, data + RTEMS_IDE_PARTITION_SIZE_OFFSET, sizeof(uint32_t)); 40004328: 92 07 20 0c add %i4, 0xc, %o1 /* 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); 4000432c: d0 27 60 04 st %o0, [ %i5 + 4 ] memcpy(&temp, data + RTEMS_IDE_PARTITION_SIZE_OFFSET, sizeof(uint32_t)); 40004330: 94 10 20 04 mov 4, %o2 40004334: 40 00 3e 43 call 40013c40 40004338: 90 07 bf fc add %fp, -4, %o0 part_desc->size = LE_TO_CPU_U32(temp); 4000433c: 7f ff ff a5 call 400041d0 40004340: d0 07 bf fc ld [ %fp + -4 ], %o0 40004344: d0 27 60 08 st %o0, [ %i5 + 8 ] * use partitions that are * - extended * or * - FAT type and non-zero */ if (is_extended(part_desc->sys_type) || 40004348: 82 0e e0 7f and %i3, 0x7f, %g1 4000434c: 80 a0 60 05 cmp %g1, 5 40004350: 02 80 00 0c be 40004380 40004354: b8 10 00 08 mov %o0, %i4 DOS_P32MB_PARTITION, FAT32_PARTITION ,FAT32_LBA_PARTITION, FAT16_LBA_PARTITION }; return (NULL != memchr(fat_part_types,type,sizeof(fat_part_types))); 40004358: 11 10 00 8d sethi %hi(0x40023400), %o0 4000435c: 92 0e e0 ff and %i3, 0xff, %o1 40004360: 90 12 21 f8 or %o0, 0x1f8, %o0 40004364: 40 00 3d c9 call 40013a88 40004368: 94 10 20 06 mov 6, %o2 * use partitions that are * - extended * or * - FAT type and non-zero */ if (is_extended(part_desc->sys_type) || 4000436c: 80 a2 20 00 cmp %o0, 0 40004370: 02 80 00 06 be 40004388 40004374: 80 a7 20 00 cmp %i4, 0 ((is_fat_partition(part_desc->sys_type)) && (part_desc->size != 0))) { 40004378: 02 80 00 04 be 40004388 <== NEVER TAKEN 4000437c: 01 00 00 00 nop *new_part_desc = part_desc; 40004380: 10 80 00 04 b 40004390 40004384: fa 26 40 00 st %i5, [ %i1 ] } else { /* empty partition */ free(part_desc); 40004388: 40 00 03 2b call 40005034 4000438c: 90 10 00 1d mov %i5, %o0 } return RTEMS_SUCCESSFUL; 40004390: b0 10 20 00 clr %i0 } 40004394: 81 c7 e0 08 ret 40004398: 81 e8 00 00 restore =============================================================================== 40002408 : #endif #include "devfs.h" void devFS_Show(void) { 40002408: 9d e3 bf a0 save %sp, -96, %sp rtems_filesystem_location_info_t *rootloc = &rtems_filesystem_root->location; 4000240c: 03 10 00 46 sethi %hi(0x40011800), %g1 40002410: c2 00 62 78 ld [ %g1 + 0x278 ], %g1 ! 40011a78 if (rootloc->mt_entry->ops == &devFS_ops) { 40002414: 05 10 00 44 sethi %hi(0x40011000), %g2 40002418: c2 00 60 04 ld [ %g1 + 4 ], %g1 4000241c: 84 10 a0 6c or %g2, 0x6c, %g2 40002420: c2 00 60 14 ld [ %g1 + 0x14 ], %g1 40002424: c6 00 60 0c ld [ %g1 + 0xc ], %g3 40002428: 80 a0 c0 02 cmp %g3, %g2 4000242c: 12 80 00 25 bne 400024c0 <== NEVER TAKEN 40002430: 33 10 00 44 sethi %hi(0x40011000), %i1 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; 40002434: c2 00 60 10 ld [ %g1 + 0x10 ], %g1 size_t j = 0; size_t m = current->namelen; printk("/"); for (j = 0; j < m; ++j) { printk("%c", current->name [j]); 40002438: 31 10 00 44 sethi %hi(0x40011000), %i0 } printk( 4000243c: 21 10 00 44 sethi %hi(0x40011000), %l0 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; 40002440: f4 00 60 04 ld [ %g1 + 4 ], %i2 40002444: fa 00 40 00 ld [ %g1 ], %i5 devFS_node *nodes = data->nodes; for (i = 0; i < n; ++i) { 40002448: b6 10 20 00 clr %i3 if (current->name != NULL) { size_t j = 0; size_t m = current->namelen; printk("/"); 4000244c: b2 16 60 c0 or %i1, 0xc0, %i1 for (j = 0; j < m; ++j) { printk("%c", current->name [j]); 40002450: b0 16 20 c8 or %i0, 0xc8, %i0 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) { 40002454: 10 80 00 18 b 400024b4 40002458: a0 14 20 d0 or %l0, 0xd0, %l0 devFS_node *current = nodes + i; if (current->name != NULL) { 4000245c: 80 a0 60 00 cmp %g1, 0 40002460: 22 80 00 14 be,a 400024b0 40002464: b6 06 e0 01 inc %i3 size_t j = 0; size_t m = current->namelen; 40002468: e2 07 60 04 ld [ %i5 + 4 ], %l1 printk("/"); 4000246c: 90 10 00 19 mov %i1, %o0 40002470: 40 00 03 d1 call 400033b4 40002474: b8 10 20 00 clr %i4 for (j = 0; j < m; ++j) { 40002478: 10 80 00 07 b 40002494 4000247c: 80 a7 00 11 cmp %i4, %l1 printk("%c", current->name [j]); 40002480: 90 10 00 18 mov %i0, %o0 40002484: d2 48 40 1c ldsb [ %g1 + %i4 ], %o1 40002488: 40 00 03 cb call 400033b4 4000248c: b8 07 20 01 inc %i4 if (current->name != NULL) { size_t j = 0; size_t m = current->namelen; printk("/"); for (j = 0; j < m; ++j) { 40002490: 80 a7 00 11 cmp %i4, %l1 40002494: 32 bf ff fb bne,a 40002480 40002498: c2 07 40 00 ld [ %i5 ], %g1 printk("%c", current->name [j]); } printk( 4000249c: d2 07 60 08 ld [ %i5 + 8 ], %o1 400024a0: d4 07 60 0c ld [ %i5 + 0xc ], %o2 400024a4: 40 00 03 c4 call 400033b4 400024a8: 90 10 00 10 mov %l0, %o0 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) { 400024ac: b6 06 e0 01 inc %i3 400024b0: ba 07 60 14 add %i5, 0x14, %i5 400024b4: 80 a6 c0 1a cmp %i3, %i2 400024b8: 32 bf ff e9 bne,a 4000245c 400024bc: c2 07 40 00 ld [ %i5 ], %g1 400024c0: 81 c7 e0 08 ret 400024c4: 81 e8 00 00 restore =============================================================================== 4000bcf8 : } void devFS_eval_path( rtems_filesystem_eval_path_context_t *ctx ) { 4000bcf8: 9d e3 bf a0 save %sp, -96, %sp 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; 4000bcfc: c2 06 20 2c ld [ %i0 + 0x2c ], %g1 static inline const char *rtems_filesystem_eval_path_get_path( rtems_filesystem_eval_path_context_t *ctx ) { return ctx->path; 4000bd00: f2 06 00 00 ld [ %i0 ], %i1 4000bd04: c2 00 60 10 ld [ %g1 + 0x10 ], %g1 static inline size_t rtems_filesystem_eval_path_get_pathlen( rtems_filesystem_eval_path_context_t *ctx ) { return ctx->pathlen; 4000bd08: f6 06 20 04 ld [ %i0 + 4 ], %i3 size_t pathlen, devFS_node **free_node_ptr ) { size_t i = 0; size_t n = data->count; 4000bd0c: e2 00 60 04 ld [ %g1 + 4 ], %l1 4000bd10: fa 00 40 00 ld [ %g1 ], %i5 devFS_node *nodes = data->nodes; devFS_node *node = NULL; 4000bd14: b8 10 20 00 clr %i4 devFS_node *free_node = NULL; 4000bd18: 82 10 20 00 clr %g1 for (i = 0; (free_node == NULL || node == NULL) && i < n; ++i) { 4000bd1c: 10 80 00 12 b 4000bd64 4000bd20: b4 10 20 00 clr %i2 devFS_node *current = nodes + i; if (current->name != NULL) { 4000bd24: 80 a2 20 00 cmp %o0, 0 4000bd28: 02 80 00 0c be 4000bd58 4000bd2c: a0 10 00 1d mov %i5, %l0 if ( 4000bd30: c4 07 60 04 ld [ %i5 + 4 ], %g2 4000bd34: 80 a0 80 1b cmp %g2, %i3 4000bd38: 12 80 00 08 bne 4000bd58 4000bd3c: a0 10 00 01 mov %g1, %l0 current->namelen == pathlen && memcmp(current->name, path, pathlen) == 0 4000bd40: 92 10 00 19 mov %i1, %o1 4000bd44: 40 00 09 ae call 4000e3fc 4000bd48: 94 10 00 1b mov %i3, %o2 4000bd4c: 80 a2 20 00 cmp %o0, 0 4000bd50: 22 80 00 02 be,a 4000bd58 4000bd54: b8 10 00 1d mov %i5, %i4 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) { 4000bd58: b4 06 a0 01 inc %i2 4000bd5c: ba 07 60 14 add %i5, 0x14, %i5 4000bd60: 82 10 00 10 mov %l0, %g1 4000bd64: 80 a7 20 00 cmp %i4, 0 4000bd68: 02 80 00 0a be 4000bd90 4000bd6c: 80 a6 80 11 cmp %i2, %l1 4000bd70: 80 a0 60 00 cmp %g1, 0 4000bd74: 02 80 00 07 be 4000bd90 <== NEVER TAKEN 4000bd78: 80 a6 80 11 cmp %i2, %l1 rtems_filesystem_eval_path_get_pathlen(ctx), &free_node ); int eval_flags = rtems_filesystem_eval_path_get_flags(ctx); if (node != NULL) { 4000bd7c: 80 a7 20 00 cmp %i4, 0 4000bd80: 12 80 00 08 bne 4000bda0 4000bd84: c4 06 20 10 ld [ %i0 + 0x10 ], %g2 rtems_filesystem_eval_path_clear_path(ctx); } else { rtems_filesystem_eval_path_error(ctx, EEXIST); } } else { if ((eval_flags & RTEMS_FS_MAKE) != 0) { 4000bd88: 10 80 00 0b b 4000bdb4 4000bd8c: 80 88 a0 20 btst 0x20, %g2 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) { 4000bd90: 32 bf ff e5 bne,a 4000bd24 4000bd94: d0 07 40 00 ld [ %i5 ], %o0 rtems_filesystem_eval_path_get_pathlen(ctx), &free_node ); int eval_flags = rtems_filesystem_eval_path_get_flags(ctx); if (node != NULL) { 4000bd98: 10 bf ff fa b 4000bd80 4000bd9c: 80 a7 20 00 cmp %i4, 0 if ((eval_flags & RTEMS_FS_EXCLUSIVE) == 0) { 4000bda0: 80 88 a0 40 btst 0x40, %g2 4000bda4: 12 80 00 12 bne 4000bdec 4000bda8: b2 10 20 11 mov 0x11, %i1 currentloc->node_access = node; 4000bdac: 10 80 00 0a b 4000bdd4 4000bdb0: f8 26 20 20 st %i4, [ %i0 + 0x20 ] rtems_filesystem_eval_path_clear_path(ctx); } else { rtems_filesystem_eval_path_error(ctx, EEXIST); } } else { if ((eval_flags & RTEMS_FS_MAKE) != 0) { 4000bdb4: 02 80 00 0d be 4000bde8 <== NEVER TAKEN 4000bdb8: 80 a0 60 00 cmp %g1, 0 if (free_node != NULL) { 4000bdbc: 02 80 00 09 be 4000bde0 4000bdc0: 84 10 21 ff mov 0x1ff, %g2 free_node->mode = S_IRWXU | S_IRWXG | S_IRWXO; 4000bdc4: c4 20 60 10 st %g2, [ %g1 + 0x10 ] currentloc->node_access = free_node; 4000bdc8: c2 26 20 20 st %g1, [ %i0 + 0x20 ] rtems_filesystem_eval_path_context_t *ctx, const char *token, size_t tokenlen ) { ctx->token = token; 4000bdcc: f2 26 20 08 st %i1, [ %i0 + 8 ] ctx->tokenlen = tokenlen; 4000bdd0: f6 26 20 0c st %i3, [ %i0 + 0xc ] static inline void rtems_filesystem_eval_path_clear_path( rtems_filesystem_eval_path_context_t *ctx ) { ctx->pathlen = 0; 4000bdd4: c0 26 20 04 clr [ %i0 + 4 ] 4000bdd8: 81 c7 e0 08 ret 4000bddc: 81 e8 00 00 restore 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); 4000bde0: 10 80 00 03 b 4000bdec 4000bde4: b2 10 20 1c mov 0x1c, %i1 } } else { rtems_filesystem_eval_path_error(ctx, ENOENT); 4000bde8: b2 10 20 02 mov 2, %i1 <== NOT EXECUTED 4000bdec: 7f ff e4 b4 call 400050bc 4000bdf0: 81 e8 00 00 restore =============================================================================== 40003ea0 : const char *name, size_t namelen, mode_t mode, dev_t dev ) { 40003ea0: 9d e3 bf a0 save %sp, -96, %sp int rv = 0; if (namelen != 3 || name [0] != 'd' || name [1] != 'e' || name [2] != 'v') { 40003ea4: 80 a6 a0 03 cmp %i2, 3 40003ea8: 12 80 00 0e bne 40003ee0 40003eac: 05 00 00 2c sethi %hi(0xb000), %g2 40003eb0: c2 4e 40 00 ldsb [ %i1 ], %g1 40003eb4: 80 a0 60 64 cmp %g1, 0x64 40003eb8: 12 80 00 0b bne 40003ee4 <== NEVER TAKEN 40003ebc: 03 00 00 08 sethi %hi(0x2000), %g1 40003ec0: c2 4e 60 01 ldsb [ %i1 + 1 ], %g1 40003ec4: 80 a0 60 65 cmp %g1, 0x65 40003ec8: 12 80 00 07 bne 40003ee4 <== NEVER TAKEN 40003ecc: 03 00 00 08 sethi %hi(0x2000), %g1 40003ed0: c2 4e 60 02 ldsb [ %i1 + 2 ], %g1 40003ed4: 80 a0 60 76 cmp %g1, 0x76 40003ed8: 02 80 00 1b be 40003f44 <== ALWAYS TAKEN 40003edc: 03 00 00 3c sethi %hi(0xf000), %g1 if (S_ISBLK(mode) || S_ISCHR(mode)) { 40003ee0: 03 00 00 08 sethi %hi(0x2000), %g1 40003ee4: 84 0e c0 02 and %i3, %g2, %g2 40003ee8: 80 a0 80 01 cmp %g2, %g1 40003eec: 12 80 00 1b bne 40003f58 40003ef0: 01 00 00 00 nop char *dupname = malloc(namelen); 40003ef4: 40 00 01 47 call 40004410 40003ef8: 90 10 00 1a mov %i2, %o0 if (dupname != NULL) { 40003efc: 84 92 20 00 orcc %o0, 0, %g2 40003f00: 02 80 00 0d be 40003f34 40003f04: 92 10 00 19 mov %i1, %o1 devFS_node *node = parentloc->node_access; 40003f08: c2 06 20 08 ld [ %i0 + 8 ], %g1 node->name = dupname; 40003f0c: c4 20 40 00 st %g2, [ %g1 ] node->namelen = namelen; 40003f10: f4 20 60 04 st %i2, [ %g1 + 4 ] node->major = rtems_filesystem_dev_major_t(dev); 40003f14: f8 20 60 08 st %i4, [ %g1 + 8 ] node->minor = rtems_filesystem_dev_minor_t(dev); 40003f18: fa 20 60 0c st %i5, [ %g1 + 0xc ] node->mode = mode; 40003f1c: f6 20 60 10 st %i3, [ %g1 + 0x10 ] memcpy(dupname, name, namelen); 40003f20: 94 10 00 1a mov %i2, %o2 40003f24: 40 00 29 60 call 4000e4a4 40003f28: b0 10 20 00 clr %i0 40003f2c: 81 c7 e0 08 ret 40003f30: 81 e8 00 00 restore } else { errno = ENOMEM; 40003f34: 40 00 25 57 call 4000d490 <__errno> 40003f38: 01 00 00 00 nop 40003f3c: 10 80 00 0a b 40003f64 40003f40: 82 10 20 0c mov 0xc, %g1 ! c } else { errno = ENOTSUP; rv = -1; } } else { if (!S_ISDIR(mode)) { 40003f44: b6 0e c0 01 and %i3, %g1, %i3 40003f48: 03 00 00 10 sethi %hi(0x4000), %g1 40003f4c: 80 a6 c0 01 cmp %i3, %g1 40003f50: 02 bf ff f7 be 40003f2c <== ALWAYS TAKEN 40003f54: b0 10 20 00 clr %i0 errno = ENOTSUP; 40003f58: 40 00 25 4e call 4000d490 <__errno> 40003f5c: 01 00 00 00 nop 40003f60: 82 10 20 86 mov 0x86, %g1 ! 86 40003f64: c2 22 00 00 st %g1, [ %o0 ] rv = -1; 40003f68: b0 10 3f ff mov -1, %i0 } } return rv; } 40003f6c: 81 c7 e0 08 ret 40003f70: 81 e8 00 00 restore =============================================================================== 40003004 : */ static volatile bool diskdevs_protected; static rtems_status_code disk_lock(void) { 40003004: 9d e3 bf a0 save %sp, -96, %sp rtems_status_code sc = RTEMS_SUCCESSFUL; sc = rtems_semaphore_obtain(diskdevs_mutex, RTEMS_WAIT, RTEMS_NO_TIMEOUT); 40003008: 03 10 00 63 sethi %hi(0x40018c00), %g1 4000300c: d0 00 62 6c ld [ %g1 + 0x26c ], %o0 ! 40018e6c 40003010: 92 10 20 00 clr %o1 40003014: 94 10 20 00 clr %o2 40003018: 40 00 14 91 call 4000825c 4000301c: b0 10 20 16 mov 0x16, %i0 if (sc == RTEMS_SUCCESSFUL) { 40003020: 80 a2 20 00 cmp %o0, 0 40003024: 12 80 00 05 bne 40003038 <== NEVER TAKEN 40003028: 84 10 20 01 mov 1, %g2 diskdevs_protected = true; 4000302c: 03 10 00 63 sethi %hi(0x40018c00), %g1 return RTEMS_SUCCESSFUL; 40003030: b0 10 20 00 clr %i0 { rtems_status_code sc = RTEMS_SUCCESSFUL; sc = rtems_semaphore_obtain(diskdevs_mutex, RTEMS_WAIT, RTEMS_NO_TIMEOUT); if (sc == RTEMS_SUCCESSFUL) { diskdevs_protected = true; 40003034: c4 28 62 68 stb %g2, [ %g1 + 0x268 ] return RTEMS_SUCCESSFUL; } else { return RTEMS_NOT_CONFIGURED; } } 40003038: 81 c7 e0 08 ret 4000303c: 81 e8 00 00 restore =============================================================================== 40003040 : static void disk_unlock(void) { 40003040: 9d e3 bf a0 save %sp, -96, %sp rtems_status_code sc = RTEMS_SUCCESSFUL; diskdevs_protected = false; 40003044: 03 10 00 63 sethi %hi(0x40018c00), %g1 40003048: c0 28 62 68 clrb [ %g1 + 0x268 ] ! 40018e68 sc = rtems_semaphore_release(diskdevs_mutex); 4000304c: 03 10 00 63 sethi %hi(0x40018c00), %g1 40003050: 40 00 14 cc call 40008380 40003054: d0 00 62 6c ld [ %g1 + 0x26c ], %o0 ! 40018e6c if (sc != RTEMS_SUCCESSFUL) { 40003058: 80 a2 20 00 cmp %o0, 0 4000305c: 02 80 00 04 be 4000306c <== ALWAYS TAKEN 40003060: 11 37 ab 6f sethi %hi(0xdeadbc00), %o0 /* FIXME: Error number */ rtems_fatal_error_occurred(0xdeadbeef); 40003064: 40 00 16 2f call 40008920 <== NOT EXECUTED 40003068: 90 12 22 ef or %o0, 0x2ef, %o0 ! deadbeef <== NOT EXECUTED 4000306c: 81 c7 e0 08 ret 40003070: 81 e8 00 00 restore =============================================================================== 40004a0c : /* * Drain output queue */ static void drainOutput (struct rtems_termios_tty *tty) 40004a0c: 9d e3 bf a0 save %sp, -96, %sp { rtems_interrupt_level level; rtems_status_code sc; if (tty->device.outputUsesInterrupts != TERMIOS_POLLED) { rtems_interrupt_disable (level); 40004a10: 7f ff f5 a6 call 400020a8 40004a14: 01 00 00 00 nop while (tty->rawOutBuf.Tail != tty->rawOutBuf.Head) { tty->rawOutBufState = rob_wait; 40004a18: 10 80 00 0f b 40004a54 40004a1c: b8 10 20 02 mov 2, %i4 ! 2 rtems_interrupt_enable (level); 40004a20: 7f ff f5 a6 call 400020b8 <== NOT EXECUTED 40004a24: 01 00 00 00 nop <== NOT EXECUTED sc = rtems_semaphore_obtain( 40004a28: d0 06 20 8c ld [ %i0 + 0x8c ], %o0 <== NOT EXECUTED 40004a2c: 92 10 20 00 clr %o1 <== NOT EXECUTED 40004a30: 40 00 09 50 call 40006f70 <== NOT EXECUTED 40004a34: 94 10 20 00 clr %o2 <== NOT EXECUTED tty->rawOutBuf.Semaphore, RTEMS_WAIT, RTEMS_NO_TIMEOUT); if (sc != RTEMS_SUCCESSFUL) 40004a38: 80 a2 20 00 cmp %o0, 0 <== NOT EXECUTED 40004a3c: 02 80 00 04 be 40004a4c <== NOT EXECUTED 40004a40: 01 00 00 00 nop <== NOT EXECUTED rtems_fatal_error_occurred (sc); 40004a44: 40 00 0b 26 call 400076dc <== NOT EXECUTED 40004a48: 01 00 00 00 nop <== NOT EXECUTED rtems_interrupt_disable (level); 40004a4c: 7f ff f5 97 call 400020a8 <== NOT EXECUTED 40004a50: 01 00 00 00 nop <== 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) { 40004a54: c4 06 20 84 ld [ %i0 + 0x84 ], %g2 40004a58: c2 06 20 80 ld [ %i0 + 0x80 ], %g1 40004a5c: 80 a0 80 01 cmp %g2, %g1 40004a60: 32 bf ff f0 bne,a 40004a20 <== NEVER TAKEN 40004a64: f8 26 20 94 st %i4, [ %i0 + 0x94 ] <== 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); 40004a68: 7f ff f5 94 call 400020b8 40004a6c: 91 e8 00 08 restore %g0, %o0, %o0 =============================================================================== 400034a8 : int dup( int fildes ) { return fcntl( fildes, F_DUPFD, 0 ); 400034a8: 92 10 20 00 clr %o1 400034ac: 94 10 20 00 clr %o2 400034b0: 82 13 c0 00 mov %o7, %g1 400034b4: 40 00 00 0c call 400034e4 400034b8: 9e 10 40 00 mov %g1, %o7 400034bc: 40 00 35 64 call 40010a4c <_vfiprintf_r+0x3fc> <== NOT EXECUTED 400034c0: 40 00 36 40 call 40010dc0 <_vfiprintf_r+0x770> <== NOT EXECUTED 400034c4: 40 00 36 4c call 40010df4 <_vfiprintf_r+0x7a4> <== NOT EXECUTED 400034c8: 40 00 36 64 call 40010e58 <_vfiprintf_r+0x808> <== NOT EXECUTED 400034cc: 40 00 36 74 call 40010e9c <_vfiprintf_r+0x84c> <== NOT EXECUTED 400034d0: 40 00 36 98 call 40010f30 <_vfiprintf_r+0x8e0> <== NOT EXECUTED 400034d4: 40 00 36 98 call 40010f34 <_vfiprintf_r+0x8e4> <== NOT EXECUTED 400034d8: 40 00 36 98 call 40010f38 <_vfiprintf_r+0x8e8> <== NOT EXECUTED 400034dc: 40 00 36 98 call 40010f3c <_vfiprintf_r+0x8ec> <== NOT EXECUTED 400034e0: 40 00 36 98 call 40010f40 <_vfiprintf_r+0x8f0> <== NOT EXECUTED =============================================================================== 4000345c : */ int dup2( int fildes, int fildes2 ) { 4000345c: 9d e3 bf 58 save %sp, -168, %sp /* * If fildes is not valid, then fildes2 should not be closed. */ status = fstat( fildes, &buf ); 40003460: 90 10 00 18 mov %i0, %o0 40003464: 40 00 01 46 call 4000397c 40003468: 92 07 bf b8 add %fp, -72, %o1 if ( status == -1 ) 4000346c: 80 a2 3f ff cmp %o0, -1 40003470: 12 80 00 04 bne 40003480 40003474: 90 10 00 19 mov %i1, %o0 return -1; 40003478: 81 c7 e0 08 ret 4000347c: 91 e8 3f ff restore %g0, -1, %o0 /* * If fildes2 is not valid, then we should not do anything either. */ status = fstat( fildes2, &buf ); 40003480: 40 00 01 3f call 4000397c 40003484: 92 07 bf b8 add %fp, -72, %o1 if ( status == -1 ) 40003488: 80 a2 3f ff cmp %o0, -1 4000348c: 02 bf ff fb be 40003478 <== NEVER TAKEN 40003490: 90 10 00 18 mov %i0, %o0 /* * This fcntl handles everything else. */ return fcntl( fildes, F_DUPFD, fildes2 ); 40003494: 92 10 20 00 clr %o1 40003498: 40 00 00 13 call 400034e4 4000349c: 94 10 00 19 mov %i1, %o2 } 400034a0: 81 c7 e0 08 ret 400034a4: 91 e8 00 08 restore %g0, %o0, %o0 =============================================================================== 400057f8 : /* * Echo a typed character */ static void echo (unsigned char c, struct rtems_termios_tty *tty) { 400057f8: 9d e3 bf 98 save %sp, -104, %sp if ((tty->termios.c_lflag & ECHOCTL) && 400057fc: c2 06 60 3c ld [ %i1 + 0x3c ], %g1 40005800: 80 88 62 00 btst 0x200, %g1 40005804: 02 80 00 19 be 40005868 <== NEVER TAKEN 40005808: 03 10 00 70 sethi %hi(0x4001c000), %g1 iscntrl(c) && (c != '\t') && (c != '\n')) { 4000580c: c2 00 63 90 ld [ %g1 + 0x390 ], %g1 ! 4001c390 <__ctype_ptr__> 40005810: 82 00 40 18 add %g1, %i0, %g1 40005814: c2 08 60 01 ldub [ %g1 + 1 ], %g1 * Echo a typed character */ static void echo (unsigned char c, struct rtems_termios_tty *tty) { if ((tty->termios.c_lflag & ECHOCTL) && 40005818: 80 88 60 20 btst 0x20, %g1 4000581c: 02 80 00 14 be 4000586c 40005820: 90 10 00 18 mov %i0, %o0 iscntrl(c) && (c != '\t') && (c != '\n')) { 40005824: 82 06 3f f7 add %i0, -9, %g1 40005828: 82 08 60 ff and %g1, 0xff, %g1 4000582c: 80 a0 60 01 cmp %g1, 1 40005830: 08 80 00 0f bleu 4000586c 40005834: 82 10 20 5e mov 0x5e, %g1 char echobuf[2]; echobuf[0] = '^'; echobuf[1] = c ^ 0x40; 40005838: b0 1e 20 40 xor %i0, 0x40, %i0 { if ((tty->termios.c_lflag & ECHOCTL) && iscntrl(c) && (c != '\t') && (c != '\n')) { char echobuf[2]; echobuf[0] = '^'; 4000583c: c2 2f bf f8 stb %g1, [ %fp + -8 ] echobuf[1] = c ^ 0x40; 40005840: f0 2f bf f9 stb %i0, [ %fp + -7 ] rtems_termios_puts (echobuf, 2, tty); 40005844: 90 07 bf f8 add %fp, -8, %o0 40005848: 92 10 20 02 mov 2, %o1 4000584c: 7f ff ff 43 call 40005558 40005850: 94 10 00 19 mov %i1, %o2 tty->column += 2; 40005854: c2 06 60 28 ld [ %i1 + 0x28 ], %g1 40005858: 82 00 60 02 add %g1, 2, %g1 4000585c: c2 26 60 28 st %g1, [ %i1 + 0x28 ] 40005860: 81 c7 e0 08 ret 40005864: 81 e8 00 00 restore } else { oproc (c, tty); 40005868: 90 10 00 18 mov %i0, %o0 <== NOT EXECUTED 4000586c: 7f ff ff 84 call 4000567c 40005870: 92 10 00 19 mov %i1, %o1 40005874: 81 c7 e0 08 ret 40005878: 81 e8 00 00 restore =============================================================================== 4002347c : } void endgrent(void) { if (group_fp != NULL) 4002347c: 03 10 01 85 sethi %hi(0x40061400), %g1 40023480: d0 00 62 48 ld [ %g1 + 0x248 ], %o0 ! 40061648 40023484: 80 a2 20 00 cmp %o0, 0 40023488: 02 80 00 05 be 4002349c <== NEVER TAKEN 4002348c: 01 00 00 00 nop fclose(group_fp); 40023490: 82 13 c0 00 mov %o7, %g1 40023494: 40 00 48 6a call 4003563c 40023498: 9e 10 40 00 mov %g1, %o7 4002349c: 81 c3 e0 08 retl <== NOT EXECUTED =============================================================================== 400232d8 : } void endpwent(void) { if (passwd_fp != NULL) 400232d8: 03 10 01 85 sethi %hi(0x40061400), %g1 400232dc: d0 00 61 68 ld [ %g1 + 0x168 ], %o0 ! 40061568 400232e0: 80 a2 20 00 cmp %o0, 0 400232e4: 02 80 00 05 be 400232f8 <== NEVER TAKEN 400232e8: 01 00 00 00 nop fclose(passwd_fp); 400232ec: 82 13 c0 00 mov %o7, %g1 400232f0: 40 00 48 d3 call 4003563c 400232f4: 9e 10 40 00 mov %g1, %o7 400232f8: 81 c3 e0 08 retl <== NOT EXECUTED =============================================================================== 4000587c : * 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) 4000587c: 9d e3 bf a0 save %sp, -96, %sp rtems_termios_puts ("\b \b", 3, tty); if (tty->column) tty->column--; } if (!iscntrl (c) || (tty->termios.c_lflag & ECHOCTL)) { rtems_termios_puts ("\b \b", 3, tty); 40005880: 35 10 00 6b sethi %hi(0x4001ac00), %i2 * 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) 40005884: ba 10 00 18 mov %i0, %i5 40005888: 37 10 00 70 sethi %hi(0x4001c000), %i3 /* * Back up over the tab */ while (tty->column > col) { rtems_termios_puts ("\b", 1, tty); 4000588c: 31 10 00 6b sethi %hi(0x4001ac00), %i0 rtems_termios_puts ("\b \b", 3, tty); if (tty->column) tty->column--; } if (!iscntrl (c) || (tty->termios.c_lflag & ECHOCTL)) { rtems_termios_puts ("\b \b", 3, tty); 40005890: b4 16 a3 a0 or %i2, 0x3a0, %i2 /* * Back up over the tab */ while (tty->column > col) { rtems_termios_puts ("\b", 1, tty); 40005894: 10 80 00 62 b 40005a1c 40005898: b0 16 23 98 or %i0, 0x398, %i0 } while (tty->ccount) { unsigned char c = tty->cbuf[--tty->ccount]; if (tty->termios.c_lflag & ECHO) { 4000589c: c2 07 60 3c ld [ %i5 + 0x3c ], %g1 return; } } while (tty->ccount) { unsigned char c = tty->cbuf[--tty->ccount]; 400058a0: 86 00 ff ff add %g3, -1, %g3 400058a4: c6 27 60 20 st %g3, [ %i5 + 0x20 ] if (tty->termios.c_lflag & ECHO) { 400058a8: 80 88 60 08 btst 8, %g1 400058ac: 02 80 00 59 be 40005a10 <== NEVER TAKEN 400058b0: f8 09 00 03 ldub [ %g4 + %g3 ], %i4 if (!lineFlag && !(tty->termios.c_lflag & ECHOE)) { 400058b4: 80 a6 60 00 cmp %i1, 0 400058b8: 32 80 00 08 bne,a 400058d8 400058bc: b8 0f 20 ff and %i4, 0xff, %i4 400058c0: 80 88 60 10 btst 0x10, %g1 400058c4: 32 80 00 05 bne,a 400058d8 <== ALWAYS TAKEN 400058c8: b8 0f 20 ff and %i4, 0xff, %i4 echo (tty->termios.c_cc[VERASE], tty); 400058cc: f0 0f 60 43 ldub [ %i5 + 0x43 ], %i0 <== NOT EXECUTED 400058d0: 7f ff ff ca call 400057f8 <== NOT EXECUTED 400058d4: 93 e8 00 1d restore %g0, %i5, %o1 <== NOT EXECUTED } else if (c == '\t') { 400058d8: 80 a7 20 09 cmp %i4, 9 400058dc: 32 80 00 28 bne,a 4000597c 400058e0: c4 06 e3 90 ld [ %i3 + 0x390 ], %g2 int col = tty->read_start_column; 400058e4: f8 07 60 2c ld [ %i5 + 0x2c ], %i4 */ while (i != tty->ccount) { c = tty->cbuf[i++]; if (c == '\t') { col = (col | 7) + 1; } else if (iscntrl (c)) { 400058e8: da 06 e3 90 ld [ %i3 + 0x390 ], %o5 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; 400058ec: 84 10 20 00 clr %g2 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) 400058f0: 10 80 00 12 b 40005938 400058f4: 82 08 62 00 and %g1, 0x200, %g1 /* * Find the character before the tab */ while (i != tty->ccount) { c = tty->cbuf[i++]; if (c == '\t') { 400058f8: 80 a3 e0 09 cmp %o7, 9 400058fc: 12 80 00 04 bne 4000590c 40005900: 84 00 a0 01 inc %g2 col = (col | 7) + 1; 40005904: 10 80 00 0c b 40005934 40005908: b8 17 20 07 or %i4, 7, %i4 } else if (iscntrl (c)) { 4000590c: 9e 03 40 0f add %o5, %o7, %o7 40005910: de 0b e0 01 ldub [ %o7 + 1 ], %o7 40005914: 80 8b e0 20 btst 0x20, %o7 40005918: 22 80 00 08 be,a 40005938 <== ALWAYS TAKEN 4000591c: b8 07 20 01 inc %i4 if (tty->termios.c_lflag & ECHOCTL) 40005920: 80 a0 60 00 cmp %g1, 0 <== NOT EXECUTED 40005924: 32 80 00 05 bne,a 40005938 <== NOT EXECUTED 40005928: b8 07 20 02 add %i4, 2, %i4 <== NOT EXECUTED int i = 0; /* * Find the character before the tab */ while (i != tty->ccount) { 4000592c: 10 80 00 04 b 4000593c <== NOT EXECUTED 40005930: 80 a0 80 03 cmp %g2, %g3 <== NOT EXECUTED col = (col | 7) + 1; } else if (iscntrl (c)) { if (tty->termios.c_lflag & ECHOCTL) col += 2; } else { col++; 40005934: b8 07 20 01 inc %i4 int i = 0; /* * Find the character before the tab */ while (i != tty->ccount) { 40005938: 80 a0 80 03 cmp %g2, %g3 4000593c: 32 bf ff ef bne,a 400058f8 40005940: de 09 00 02 ldub [ %g4 + %g2 ], %o7 } /* * Back up over the tab */ while (tty->column > col) { 40005944: 10 80 00 09 b 40005968 40005948: c2 07 60 28 ld [ %i5 + 0x28 ], %g1 rtems_termios_puts ("\b", 1, tty); 4000594c: 92 10 20 01 mov 1, %o1 40005950: 7f ff ff 02 call 40005558 40005954: 94 10 00 1d mov %i5, %o2 tty->column--; 40005958: c2 07 60 28 ld [ %i5 + 0x28 ], %g1 4000595c: 82 00 7f ff add %g1, -1, %g1 40005960: c2 27 60 28 st %g1, [ %i5 + 0x28 ] } /* * Back up over the tab */ while (tty->column > col) { 40005964: c2 07 60 28 ld [ %i5 + 0x28 ], %g1 40005968: 80 a0 40 1c cmp %g1, %i4 4000596c: 14 bf ff f8 bg 4000594c 40005970: 90 10 00 18 mov %i0, %o0 if (tty->column) tty->column--; } } } if (!lineFlag) 40005974: 10 80 00 28 b 40005a14 40005978: 80 a6 60 00 cmp %i1, 0 rtems_termios_puts ("\b", 1, tty); tty->column--; } } else { if (iscntrl (c) && (tty->termios.c_lflag & ECHOCTL)) { 4000597c: b8 07 20 01 inc %i4 40005980: c4 08 80 1c ldub [ %g2 + %i4 ], %g2 40005984: 80 88 a0 20 btst 0x20, %g2 40005988: 22 80 00 10 be,a 400059c8 <== ALWAYS TAKEN 4000598c: c2 06 e3 90 ld [ %i3 + 0x390 ], %g1 40005990: 80 88 62 00 btst 0x200, %g1 <== NOT EXECUTED 40005994: 02 80 00 0d be 400059c8 <== NOT EXECUTED 40005998: c2 06 e3 90 ld [ %i3 + 0x390 ], %g1 <== NOT EXECUTED rtems_termios_puts ("\b \b", 3, tty); 4000599c: 90 10 00 1a mov %i2, %o0 <== NOT EXECUTED 400059a0: 92 10 20 03 mov 3, %o1 <== NOT EXECUTED 400059a4: 7f ff fe ed call 40005558 <== NOT EXECUTED 400059a8: 94 10 00 1d mov %i5, %o2 <== NOT EXECUTED if (tty->column) 400059ac: c2 07 60 28 ld [ %i5 + 0x28 ], %g1 <== NOT EXECUTED 400059b0: 80 a0 60 00 cmp %g1, 0 <== NOT EXECUTED 400059b4: 22 80 00 05 be,a 400059c8 <== NOT EXECUTED 400059b8: c2 06 e3 90 ld [ %i3 + 0x390 ], %g1 <== NOT EXECUTED tty->column--; 400059bc: 82 00 7f ff add %g1, -1, %g1 <== NOT EXECUTED 400059c0: c2 27 60 28 st %g1, [ %i5 + 0x28 ] <== NOT EXECUTED } if (!iscntrl (c) || (tty->termios.c_lflag & ECHOCTL)) { 400059c4: c2 06 e3 90 ld [ %i3 + 0x390 ], %g1 <== NOT EXECUTED 400059c8: c2 08 40 1c ldub [ %g1 + %i4 ], %g1 400059cc: 80 88 60 20 btst 0x20, %g1 400059d0: 02 80 00 07 be 400059ec <== ALWAYS TAKEN 400059d4: 90 10 00 1a mov %i2, %o0 400059d8: c2 07 60 3c ld [ %i5 + 0x3c ], %g1 <== NOT EXECUTED 400059dc: 80 88 62 00 btst 0x200, %g1 <== NOT EXECUTED 400059e0: 02 80 00 0d be 40005a14 <== NOT EXECUTED 400059e4: 80 a6 60 00 cmp %i1, 0 <== NOT EXECUTED rtems_termios_puts ("\b \b", 3, tty); 400059e8: 90 10 00 1a mov %i2, %o0 <== NOT EXECUTED 400059ec: 92 10 20 03 mov 3, %o1 400059f0: 7f ff fe da call 40005558 400059f4: 94 10 00 1d mov %i5, %o2 if (tty->column) 400059f8: c2 07 60 28 ld [ %i5 + 0x28 ], %g1 400059fc: 80 a0 60 00 cmp %g1, 0 40005a00: 02 80 00 05 be 40005a14 <== NEVER TAKEN 40005a04: 80 a6 60 00 cmp %i1, 0 tty->column--; 40005a08: 82 00 7f ff add %g1, -1, %g1 40005a0c: c2 27 60 28 st %g1, [ %i5 + 0x28 ] } } } if (!lineFlag) 40005a10: 80 a6 60 00 cmp %i1, 0 40005a14: 02 80 00 06 be 40005a2c 40005a18: 01 00 00 00 nop echo ('\n', tty); return; } } while (tty->ccount) { 40005a1c: c6 07 60 20 ld [ %i5 + 0x20 ], %g3 40005a20: 80 a0 e0 00 cmp %g3, 0 40005a24: 32 bf ff 9e bne,a 4000589c 40005a28: c8 07 60 1c ld [ %i5 + 0x1c ], %g4 40005a2c: 81 c7 e0 08 ret 40005a30: 81 e8 00 00 restore =============================================================================== 40004028 : size_t pathlen, int eval_flags, rtems_filesystem_global_location_t *const *global_root_ptr, rtems_filesystem_global_location_t *const *global_current_ptr ) { 40004028: 9d e3 bf 98 save %sp, -104, %sp memset(ctx, 0, sizeof(*ctx)); 4000402c: 92 10 20 00 clr %o1 40004030: 90 10 00 18 mov %i0, %o0 40004034: 40 00 29 b4 call 4000e704 40004038: 94 10 20 38 mov 0x38, %o2 ctx->path = path; 4000403c: f2 26 00 00 st %i1, [ %i0 ] ctx->pathlen = pathlen; 40004040: f4 26 20 04 st %i2, [ %i0 + 4 ] rtems_filesystem_eval_path_context_t *ctx, rtems_filesystem_global_location_t *const *global_root_ptr, rtems_filesystem_global_location_t *const *global_current_ptr ) { if (ctx->pathlen > 0) { 40004044: 80 a6 a0 00 cmp %i2, 0 40004048: 02 80 00 19 be 400040ac 4000404c: f6 26 20 10 st %i3, [ %i0 + 0x10 ] char c = ctx->path [0]; 40004050: f6 0e 40 00 ldub [ %i1 ], %i3 ctx->rootloc = rtems_filesystem_global_location_obtain(global_root_ptr); 40004054: 40 00 01 79 call 40004638 40004058: 90 10 00 1c mov %i4, %o0 gid_t node_gid ); static inline bool rtems_filesystem_is_delimiter(char c) { return c == '/' || c == '\\'; 4000405c: 83 2e e0 18 sll %i3, 0x18, %g1 40004060: 83 38 60 18 sra %g1, 0x18, %g1 if (rtems_filesystem_is_delimiter(c)) { 40004064: 80 a0 60 5c cmp %g1, 0x5c 40004068: 02 80 00 05 be 4000407c <== NEVER TAKEN 4000406c: d0 26 20 30 st %o0, [ %i0 + 0x30 ] 40004070: 80 a0 60 2f cmp %g1, 0x2f 40004074: 12 80 00 0a bne 4000409c 40004078: 90 10 00 1d mov %i5, %o0 ++ctx->path; 4000407c: c2 06 00 00 ld [ %i0 ], %g1 --ctx->pathlen; ctx->startloc = rtems_filesystem_global_location_obtain( 40004080: 90 06 20 30 add %i0, 0x30, %o0 char c = ctx->path [0]; ctx->rootloc = rtems_filesystem_global_location_obtain(global_root_ptr); if (rtems_filesystem_is_delimiter(c)) { ++ctx->path; 40004084: 82 00 60 01 inc %g1 40004088: c2 26 00 00 st %g1, [ %i0 ] --ctx->pathlen; 4000408c: c2 06 20 04 ld [ %i0 + 4 ], %g1 40004090: 82 00 7f ff add %g1, -1, %g1 40004094: 10 80 00 02 b 4000409c 40004098: c2 26 20 04 st %g1, [ %i0 + 4 ] ctx->startloc = rtems_filesystem_global_location_obtain( &ctx->rootloc ); } else { ctx->startloc = rtems_filesystem_global_location_obtain( 4000409c: 40 00 01 67 call 40004638 400040a0: 01 00 00 00 nop 400040a4: 10 80 00 0d b 400040d8 400040a8: d0 26 20 34 st %o0, [ %i0 + 0x34 ] ); static inline rtems_filesystem_global_location_t * rtems_filesystem_global_location_obtain_null(void) { rtems_filesystem_global_location_t *global_loc = NULL; 400040ac: c0 27 bf fc clr [ %fp + -4 ] return rtems_filesystem_global_location_obtain( &global_loc ); 400040b0: 40 00 01 62 call 40004638 400040b4: 90 07 bf fc add %fp, -4, %o0 ); static inline rtems_filesystem_global_location_t * rtems_filesystem_global_location_obtain_null(void) { rtems_filesystem_global_location_t *global_loc = NULL; 400040b8: c0 27 bf fc clr [ %fp + -4 ] global_current_ptr ); } } else { ctx->rootloc = rtems_filesystem_global_location_obtain_null(); 400040bc: d0 26 20 30 st %o0, [ %i0 + 0x30 ] return rtems_filesystem_global_location_obtain( &global_loc ); 400040c0: 40 00 01 5e call 40004638 400040c4: 90 07 bf fc add %fp, -4, %o0 ctx->startloc = rtems_filesystem_global_location_obtain_null(); errno = ENOENT; 400040c8: 40 00 27 01 call 4000dccc <__errno> 400040cc: d0 26 20 34 st %o0, [ %i0 + 0x34 ] 400040d0: 82 10 20 02 mov 2, %g1 400040d4: c2 22 00 00 st %g1, [ %o0 ] static inline void rtems_filesystem_instance_lock( const rtems_filesystem_location_info_t *loc ) { const rtems_filesystem_mount_table_entry_t *mt_entry = loc->mt_entry; 400040d8: c2 06 20 34 ld [ %i0 + 0x34 ], %g1 400040dc: d0 00 60 14 ld [ %g1 + 0x14 ], %o0 (*mt_entry->ops->lock_h)( mt_entry ); 400040e0: c2 02 20 0c ld [ %o0 + 0xc ], %g1 400040e4: c2 00 40 00 ld [ %g1 ], %g1 400040e8: 9f c0 40 00 call %g1 400040ec: ba 06 20 18 add %i0, 0x18, %i5 set_startloc(ctx, global_root_ptr, global_current_ptr); rtems_filesystem_instance_lock(&ctx->startloc->location); rtems_filesystem_location_clone( 400040f0: d2 06 20 34 ld [ %i0 + 0x34 ], %o1 400040f4: 40 00 1c 82 call 4000b2fc 400040f8: 90 10 00 1d mov %i5, %o0 &ctx->currentloc, &ctx->startloc->location ); rtems_filesystem_eval_path_continue(ctx); 400040fc: 90 10 00 18 mov %i0, %o0 40004100: 7f ff ff b0 call 40003fc0 40004104: b0 10 00 1d mov %i5, %i0 return &ctx->currentloc; } 40004108: 81 c7 e0 08 ret 4000410c: 81 e8 00 00 restore =============================================================================== 40012344 : int fat_buf_access(fat_fs_info_t *fs_info, const uint32_t sec_num, const int op_type, uint8_t **sec_buf) { 40012344: 9d e3 bf a0 save %sp, -96, %sp 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); 40012348: c2 0e 20 02 ldub [ %i0 + 2 ], %g1 4001234c: c4 0e 20 0c ldub [ %i0 + 0xc ], %g2 40012350: 84 20 80 01 sub %g2, %g1, %g2 40012354: bb 36 40 02 srl %i1, %g2, %i5 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); 40012358: b9 2f 40 02 sll %i5, %g2, %i4 fat_sector_offset_to_block_offset (const fat_fs_info_t *fs_info, const uint32_t sector, const uint32_t sector_offset) { return sector_offset + ((sector - 4001235c: b8 26 40 1c sub %i1, %i4, %i4 fat_block_num_to_sector_num (fs_info, fat_sector_num_to_block_num (fs_info, sector))) << fs_info->vol.sec_log2); 40012360: b9 2f 00 01 sll %i4, %g1, %i4 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) 40012364: c2 0e 20 89 ldub [ %i0 + 0x89 ], %g1 40012368: 80 a0 60 00 cmp %g1, 0 4001236c: 02 80 00 06 be 40012384 40012370: 01 00 00 00 nop 40012374: c2 06 20 84 ld [ %i0 + 0x84 ], %g1 40012378: 80 a0 40 19 cmp %g1, %i1 4001237c: 22 80 00 1c be,a 400123ec 40012380: c2 06 20 8c ld [ %i0 + 0x8c ], %g1 { fat_buf_release(fs_info); 40012384: 7f ff ff 7c call 40012174 40012388: 90 10 00 18 mov %i0, %o0 if (op_type == FAT_OP_TYPE_READ) sc = rtems_bdbuf_read(fs_info->vol.dd, blk, &fs_info->c.buf); 4001238c: 92 10 00 1d mov %i5, %o1 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) 40012390: 80 a6 a0 01 cmp %i2, 1 40012394: d0 06 20 64 ld [ %i0 + 0x64 ], %o0 40012398: 12 80 00 06 bne 400123b0 4001239c: 94 06 20 8c add %i0, 0x8c, %o2 sc = rtems_bdbuf_read(fs_info->vol.dd, blk, &fs_info->c.buf); 400123a0: 7f ff f7 ae call 40010258 400123a4: 01 00 00 00 nop else sc = rtems_bdbuf_get(fs_info->vol.dd, blk, &fs_info->c.buf); if (sc != RTEMS_SUCCESSFUL) 400123a8: 10 80 00 05 b 400123bc 400123ac: 80 a2 20 00 cmp %o0, 0 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); else sc = rtems_bdbuf_get(fs_info->vol.dd, blk, &fs_info->c.buf); 400123b0: 7f ff f7 79 call 40010194 400123b4: 01 00 00 00 nop if (sc != RTEMS_SUCCESSFUL) 400123b8: 80 a2 20 00 cmp %o0, 0 400123bc: 02 80 00 08 be 400123dc <== ALWAYS TAKEN 400123c0: 82 10 20 01 mov 1, %g1 rtems_set_errno_and_return_minus_one(EIO); 400123c4: 40 00 1d da call 40019b2c <__errno> <== NOT EXECUTED 400123c8: b0 10 3f ff mov -1, %i0 <== NOT EXECUTED 400123cc: 82 10 20 05 mov 5, %g1 <== NOT EXECUTED 400123d0: c2 22 00 00 st %g1, [ %o0 ] <== NOT EXECUTED 400123d4: 81 c7 e0 08 ret <== NOT EXECUTED 400123d8: 81 e8 00 00 restore <== NOT EXECUTED fs_info->c.blk_num = sec_num; 400123dc: f2 26 20 84 st %i1, [ %i0 + 0x84 ] fs_info->c.modified = 0; 400123e0: c0 2e 20 88 clrb [ %i0 + 0x88 ] fs_info->c.state = FAT_CACHE_ACTUAL; 400123e4: c2 2e 20 89 stb %g1, [ %i0 + 0x89 ] } *sec_buf = &fs_info->c.buf->buffer[blk_ofs]; 400123e8: c2 06 20 8c ld [ %i0 + 0x8c ], %g1 400123ec: c2 00 60 1c ld [ %g1 + 0x1c ], %g1 400123f0: b8 00 40 1c add %g1, %i4, %i4 400123f4: f8 26 c0 00 st %i4, [ %i3 ] return RC_OK; } 400123f8: 81 c7 e0 08 ret 400123fc: 91 e8 20 00 restore %g0, 0, %o0 =============================================================================== 40012174 : return RC_OK; } int fat_buf_release(fat_fs_info_t *fs_info) { 40012174: 9d e3 bf 98 save %sp, -104, %sp rtems_status_code sc = RTEMS_SUCCESSFUL; if (fs_info->c.state == FAT_CACHE_EMPTY) 40012178: c2 0e 20 89 ldub [ %i0 + 0x89 ], %g1 return RC_OK; } int fat_buf_release(fat_fs_info_t *fs_info) { 4001217c: ba 10 00 18 mov %i0, %i5 rtems_status_code sc = RTEMS_SUCCESSFUL; if (fs_info->c.state == FAT_CACHE_EMPTY) 40012180: 80 a0 60 00 cmp %g1, 0 40012184: 02 80 00 6e be 4001233c 40012188: b0 10 20 00 clr %i0 return RC_OK; if (fs_info->c.modified) 4001218c: c2 0f 60 88 ldub [ %i5 + 0x88 ], %g1 40012190: 80 a0 60 00 cmp %g1, 0 40012194: 02 80 00 5d be 40012308 40012198: 01 00 00 00 nop { uint32_t sec_num = fs_info->c.blk_num; 4001219c: c2 07 60 84 ld [ %i5 + 0x84 ], %g1 bool sec_of_fat = ((sec_num >= fs_info->vol.fat_loc) && 400121a0: c4 17 60 18 lduh [ %i5 + 0x18 ], %g2 400121a4: 80 a0 40 02 cmp %g1, %g2 400121a8: 0a 80 00 05 bcs 400121bc 400121ac: b8 10 20 00 clr %i4 400121b0: c4 07 60 20 ld [ %i5 + 0x20 ], %g2 400121b4: 80 a0 40 02 cmp %g1, %g2 400121b8: b8 40 20 00 addx %g0, 0, %i4 uint32_t ino ) { return (ino >= fs_info->uino_base); } 400121bc: c4 0f 60 02 ldub [ %i5 + 2 ], %g2 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) 400121c0: 80 8f 20 ff btst 0xff, %i4 400121c4: 02 80 00 12 be 4001220c 400121c8: c6 0f 60 0c ldub [ %i5 + 0xc ], %g3 400121cc: c8 0f 60 54 ldub [ %i5 + 0x54 ], %g4 400121d0: 80 a1 20 00 cmp %g4, 0 400121d4: 12 80 00 0e bne 4001220c <== NEVER TAKEN 400121d8: 84 08 a0 ff and %g2, 0xff, %g2 memcpy(fs_info->sec_buf, fs_info->c.buf->buffer + blk_ofs, 400121dc: c8 07 60 8c ld [ %i5 + 0x8c ], %g4 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, 400121e0: d0 07 60 90 ld [ %i5 + 0x90 ], %o0 400121e4: d2 01 20 1c ld [ %g4 + 0x1c ], %o1 400121e8: d4 17 40 00 lduh [ %i5 ], %o2 400121ec: 86 08 e0 ff and %g3, 0xff, %g3 400121f0: 86 20 c0 02 sub %g3, %g2, %g3 400121f4: b7 30 40 03 srl %g1, %g3, %i3 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); 400121f8: 87 2e c0 03 sll %i3, %g3, %g3 fat_sector_offset_to_block_offset (const fat_fs_info_t *fs_info, const uint32_t sector, const uint32_t sector_offset) { return sector_offset + ((sector - 400121fc: 82 20 40 03 sub %g1, %g3, %g1 fat_block_num_to_sector_num (fs_info, fat_sector_num_to_block_num (fs_info, sector))) << fs_info->vol.sec_log2); 40012200: 85 28 40 02 sll %g1, %g2, %g2 40012204: 40 00 20 ef call 4001a5c0 40012208: 92 02 40 02 add %o1, %g2, %o1 fs_info->c.buf->buffer + blk_ofs, fs_info->vol.bps); sc = rtems_bdbuf_release_modified(fs_info->c.buf); 4001220c: 7f ff f8 c4 call 4001051c 40012210: d0 07 60 8c ld [ %i5 + 0x8c ], %o0 if (sc != RTEMS_SUCCESSFUL) 40012214: 80 a2 20 00 cmp %o0, 0 40012218: 12 80 00 41 bne 4001231c <== NEVER TAKEN 4001221c: 80 8f 20 ff btst 0xff, %i4 rtems_set_errno_and_return_minus_one(EIO); fs_info->c.modified = 0; if (sec_of_fat && !fs_info->vol.mirror) 40012220: 02 80 00 45 be 40012334 40012224: c0 2f 60 88 clrb [ %i5 + 0x88 ] 40012228: c2 0f 60 54 ldub [ %i5 + 0x54 ], %g1 4001222c: 80 a0 60 00 cmp %g1, 0 40012230: 22 80 00 2f be,a 400122ec <== ALWAYS TAKEN 40012234: b8 10 20 01 mov 1, %i4 { 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; 40012238: 10 80 00 40 b 40012338 <== NOT EXECUTED 4001223c: c0 2f 60 89 clrb [ %i5 + 0x89 ] <== NOT EXECUTED for (i = 1; i < fs_info->vol.fats; i++) { rtems_bdbuf_buffer *bd; sec_num = fs_info->c.blk_num + fs_info->vol.fat_length * i, 40012240: 7f ff c1 04 call 40002650 <.umul> 40012244: d2 07 60 1c ld [ %i5 + 0x1c ], %o1 40012248: f6 07 60 84 ld [ %i5 + 0x84 ], %i3 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); 4001224c: c2 0f 60 02 ldub [ %i5 + 2 ], %g1 40012250: 90 02 00 1b add %o0, %i3, %o0 40012254: f6 0f 60 0c ldub [ %i5 + 0xc ], %i3 40012258: b6 26 c0 01 sub %i3, %g1, %i3 4001225c: 93 32 00 1b srl %o0, %i3, %o1 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); 40012260: b7 2a 40 1b sll %o1, %i3, %i3 fat_sector_offset_to_block_offset (const fat_fs_info_t *fs_info, const uint32_t sector, const uint32_t sector_offset) { return sector_offset + ((sector - 40012264: b6 22 00 1b sub %o0, %i3, %i3 fat_block_num_to_sector_num (fs_info, fat_sector_num_to_block_num (fs_info, sector))) << fs_info->vol.sec_log2); 40012268: b7 2e c0 01 sll %i3, %g1, %i3 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 4001226c: 80 a6 e0 00 cmp %i3, 0 40012270: 12 80 00 0b bne 4001229c 40012274: d0 07 60 64 ld [ %i5 + 0x64 ], %o0 && fs_info->vol.bps == fs_info->vol.bytes_per_block) 40012278: c4 17 40 00 lduh [ %i5 ], %g2 4001227c: c2 17 60 0a lduh [ %i5 + 0xa ], %g1 40012280: 80 a0 80 01 cmp %g2, %g1 40012284: 12 80 00 06 bne 4001229c 40012288: 01 00 00 00 nop { sc = rtems_bdbuf_get(fs_info->vol.dd, blk, &bd); 4001228c: 7f ff f7 c2 call 40010194 40012290: 94 07 bf fc add %fp, -4, %o2 } else { sc = rtems_bdbuf_read(fs_info->vol.dd, blk, &bd); } if ( sc != RTEMS_SUCCESSFUL) 40012294: 10 80 00 05 b 400122a8 40012298: 80 a2 20 00 cmp %o0, 0 { sc = rtems_bdbuf_get(fs_info->vol.dd, blk, &bd); } else { sc = rtems_bdbuf_read(fs_info->vol.dd, blk, &bd); 4001229c: 7f ff f7 ef call 40010258 400122a0: 94 07 bf fc add %fp, -4, %o2 } if ( sc != RTEMS_SUCCESSFUL) 400122a4: 80 a2 20 00 cmp %o0, 0 400122a8: 22 80 00 03 be,a 400122b4 <== ALWAYS TAKEN 400122ac: c2 07 bf fc ld [ %fp + -4 ], %g1 400122b0: 30 80 00 0b b,a 400122dc <== NOT EXECUTED rtems_set_errno_and_return_minus_one(ENOMEM); memcpy(bd->buffer + blk_ofs, fs_info->sec_buf, fs_info->vol.bps); 400122b4: d2 07 60 90 ld [ %i5 + 0x90 ], %o1 400122b8: d0 00 60 1c ld [ %g1 + 0x1c ], %o0 400122bc: d4 17 40 00 lduh [ %i5 ], %o2 400122c0: 40 00 20 c0 call 4001a5c0 400122c4: 90 02 00 1b add %o0, %i3, %o0 sc = rtems_bdbuf_release_modified(bd); 400122c8: 7f ff f8 95 call 4001051c 400122cc: d0 07 bf fc ld [ %fp + -4 ], %o0 if ( sc != RTEMS_SUCCESSFUL) 400122d0: 80 a2 20 00 cmp %o0, 0 400122d4: 22 80 00 06 be,a 400122ec <== ALWAYS TAKEN 400122d8: b8 07 20 01 inc %i4 rtems_set_errno_and_return_minus_one(ENOMEM); 400122dc: 40 00 1e 14 call 40019b2c <__errno> <== NOT EXECUTED 400122e0: 01 00 00 00 nop <== NOT EXECUTED 400122e4: 10 80 00 11 b 40012328 <== NOT EXECUTED 400122e8: 82 10 20 0c mov 0xc, %g1 ! c <== NOT EXECUTED if (sec_of_fat && !fs_info->vol.mirror) { uint8_t i; for (i = 1; i < fs_info->vol.fats; i++) 400122ec: c2 0f 60 0d ldub [ %i5 + 0xd ], %g1 400122f0: 90 0f 20 ff and %i4, 0xff, %o0 400122f4: 80 a2 00 01 cmp %o0, %g1 400122f8: 0a bf ff d2 bcs 40012240 400122fc: 01 00 00 00 nop { 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; 40012300: 10 80 00 0e b 40012338 40012304: c0 2f 60 89 clrb [ %i5 + 0x89 ] } } } else { sc = rtems_bdbuf_release(fs_info->c.buf); 40012308: 7f ff f8 50 call 40010448 4001230c: d0 07 60 8c ld [ %i5 + 0x8c ], %o0 if (sc != RTEMS_SUCCESSFUL) 40012310: 80 a2 20 00 cmp %o0, 0 40012314: 22 80 00 09 be,a 40012338 <== ALWAYS TAKEN 40012318: c0 2f 60 89 clrb [ %i5 + 0x89 ] rtems_set_errno_and_return_minus_one(EIO); 4001231c: 40 00 1e 04 call 40019b2c <__errno> <== NOT EXECUTED 40012320: 01 00 00 00 nop <== NOT EXECUTED 40012324: 82 10 20 05 mov 5, %g1 ! 5 <== NOT EXECUTED 40012328: c2 22 00 00 st %g1, [ %o0 ] <== NOT EXECUTED 4001232c: 81 c7 e0 08 ret <== NOT EXECUTED 40012330: 91 e8 3f ff restore %g0, -1, %o0 <== NOT EXECUTED } fs_info->c.state = FAT_CACHE_EMPTY; 40012334: c0 2f 60 89 clrb [ %i5 + 0x89 ] return RC_OK; 40012338: b0 10 20 00 clr %i0 } 4001233c: 81 c7 e0 08 ret 40012340: 81 e8 00 00 restore =============================================================================== 40012118 : 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)) ) 40012118: 80 a2 60 00 cmp %o1, 0 4001211c: 32 80 00 0c bne,a 4001214c 40012120: c2 0a 20 0c ldub [ %o0 + 0xc ], %g1 40012124: c2 0a 20 0e ldub [ %o0 + 0xe ], %g1 40012128: 80 88 60 03 btst 3, %g1 4001212c: 22 80 00 08 be,a 4001214c <== NEVER TAKEN 40012130: c2 0a 20 0c ldub [ %o0 + 0xc ], %g1 <== 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); 40012134: c4 0a 20 0c ldub [ %o0 + 0xc ], %g2 40012138: c2 0a 20 02 ldub [ %o0 + 2 ], %g1 4001213c: d0 02 20 20 ld [ %o0 + 0x20 ], %o0 40012140: 82 20 80 01 sub %g2, %g1, %g1 40012144: 81 c3 e0 08 retl 40012148: 91 32 00 01 srl %o0, %g1, %o0 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); 4001214c: c4 0a 20 08 ldub [ %o0 + 8 ], %g2 if ( (cln == 0) && (fs_info->vol.type & (FAT_FAT12 | FAT_FAT16)) ) blk = fat_sector_num_to_block_num(fs_info, fs_info->vol.rdir_loc); else { cln -= FAT_RSRVD_CLN; 40012150: 92 02 7f fe add %o1, -2, %o1 blk = cln << (fs_info->vol.bpc_log2 - fs_info->vol.bytes_per_block_log2); 40012154: 84 20 80 01 sub %g2, %g1, %g2 40012158: 93 2a 40 02 sll %o1, %g2, %o1 4001215c: c4 0a 20 02 ldub [ %o0 + 2 ], %g2 40012160: d0 02 20 34 ld [ %o0 + 0x34 ], %o0 40012164: 82 20 40 02 sub %g1, %g2, %g1 40012168: 91 32 00 01 srl %o0, %g1, %o0 blk += fat_sector_num_to_block_num(fs_info, fs_info->vol.data_fsec); } return blk; } 4001216c: 81 c3 e0 08 retl 40012170: 90 02 00 09 add %o0, %o1, %o0 =============================================================================== 40011474 : 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)) ) 40011474: 80 a2 60 00 cmp %o1, 0 40011478: 32 80 00 08 bne,a 40011498 4001147c: c2 0a 20 05 ldub [ %o0 + 5 ], %g1 40011480: c2 0a 20 0e ldub [ %o0 + 0xe ], %g1 40011484: 80 88 60 03 btst 3, %g1 40011488: 22 80 00 04 be,a 40011498 <== NEVER TAKEN 4001148c: c2 0a 20 05 ldub [ %o0 + 5 ], %g1 <== NOT EXECUTED return fs_info->vol.rdir_loc; 40011490: 81 c3 e0 08 retl 40011494: d0 02 20 20 ld [ %o0 + 0x20 ], %o0 return (((cln - FAT_RSRVD_CLN) << fs_info->vol.spc_log2) + 40011498: 92 02 7f fe add %o1, -2, %o1 4001149c: 93 2a 40 01 sll %o1, %g1, %o1 400114a0: c2 02 20 34 ld [ %o0 + 0x34 ], %g1 fs_info->vol.data_fsec); } 400114a4: 81 c3 e0 08 retl 400114a8: 90 02 40 01 add %o1, %g1, %o0 =============================================================================== 40012518 : fat_fs_info_t *fs_info, const uint32_t start_cln, const uint32_t offset, const uint32_t count, const uint8_t pattern) { 40012518: 9d e3 bf 98 save %sp, -104, %sp ssize_t rc = RC_OK; uint32_t bytes_to_write = MIN(count, (fs_info->vol.bpc - offset)); 4001251c: c2 16 20 06 lduh [ %i0 + 6 ], %g1 40012520: 82 20 40 1a sub %g1, %i2, %g1 40012524: 80 a6 c0 01 cmp %i3, %g1 40012528: 38 80 00 02 bgu,a 40012530 <== NEVER TAKEN 4001252c: b6 10 00 01 mov %g1, %i3 <== NOT EXECUTED uint32_t cur_blk = fat_cluster_num_to_block_num(fs_info, start_cln); 40012530: 90 10 00 18 mov %i0, %o0 40012534: 7f ff fe f9 call 40012118 40012538: 92 10 00 19 mov %i1, %o1 uint32_t blocks_in_offset = offset >> fs_info->vol.bytes_per_block_log2; 4001253c: c2 0e 20 0c ldub [ %i0 + 0xc ], %g1 uint32_t ofs_blk = offset - (blocks_in_offset << fs_info->vol.bytes_per_block_log2); ssize_t bytes_written = 0; 40012540: a0 10 20 00 clr %l0 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; 40012544: a3 36 80 01 srl %i2, %g1, %l1 uint32_t ofs_blk = offset - (blocks_in_offset << fs_info->vol.bytes_per_block_log2); 40012548: 83 2c 40 01 sll %l1, %g1, %g1 4001254c: a4 10 20 01 mov 1, %l2 40012550: b4 26 80 01 sub %i2, %g1, %i2 ssize_t bytes_written = 0; ssize_t ret; cur_blk += blocks_in_offset; 40012554: a2 02 00 11 add %o0, %l1, %l1 while ( (RC_OK == rc) 40012558: 10 80 00 2a b 40012600 4001255c: 82 10 20 00 clr %g1 && (0 < bytes_to_write)) { uint32_t c = MIN(bytes_to_write, (fs_info->vol.bytes_per_block - ofs_blk)); 40012560: 82 20 80 1a sub %g2, %i2, %g1 40012564: 80 a0 40 1b cmp %g1, %i3 40012568: 08 80 00 03 bleu 40012574 <== ALWAYS TAKEN 4001256c: ba 10 00 01 mov %g1, %i5 40012570: ba 10 00 1b mov %i3, %i5 <== 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)); 40012574: 80 a7 40 01 cmp %i5, %g1 40012578: 08 80 00 03 bleu 40012584 <== ALWAYS TAKEN 4001257c: b2 10 00 1d mov %i5, %i1 40012580: b2 10 00 01 mov %g1, %i1 <== NOT EXECUTED uint32_t ino ) { return (ino >= fs_info->uino_base); } 40012584: c2 0e 20 02 ldub [ %i0 + 2 ], %g1 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) 40012588: 80 a6 60 00 cmp %i1, 0 4001258c: 02 80 00 27 be 40012628 <== NEVER TAKEN 40012590: d2 0e 20 0c ldub [ %i0 + 0xc ], %o1 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); 40012594: 92 22 40 01 sub %o1, %g1, %o1 { if (bytes_to_write == fs_info->vol.bytes_per_block) { rc = fat_buf_access(fs_info, sec_num, FAT_OP_TYPE_GET, &blk_buf); 40012598: 90 10 00 18 mov %i0, %o0 4001259c: 93 2c 40 09 sll %l1, %o1, %o1 uint8_t *blk_buf; uint32_t sec_num = fat_block_num_to_sector_num(fs_info, start_blk); if (0 < bytes_to_write) { if (bytes_to_write == fs_info->vol.bytes_per_block) 400125a0: 80 a6 40 02 cmp %i1, %g2 400125a4: 02 80 00 03 be 400125b0 400125a8: 94 10 20 02 mov 2, %o2 { 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); 400125ac: 94 10 20 01 mov 1, %o2 400125b0: 7f ff ff 65 call 40012344 400125b4: 96 07 bf fc add %fp, -4, %o3 if (RC_OK == rc) 400125b8: 80 a2 20 00 cmp %o0, 0 400125bc: 12 80 00 0a bne 400125e4 <== NEVER TAKEN 400125c0: 80 a7 40 08 cmp %i5, %o0 { memset(blk_buf + offset, pattern, bytes_to_write); 400125c4: d0 07 bf fc ld [ %fp + -4 ], %o0 400125c8: 92 10 00 1c mov %i4, %o1 400125cc: 90 02 00 1a add %o0, %i2, %o0 400125d0: 40 00 20 39 call 4001a6b4 400125d4: 94 10 00 19 mov %i1, %o2 } static inline void fat_buf_mark_modified(fat_fs_info_t *fs_info) { fs_info->c.modified = true; 400125d8: 10 80 00 14 b 40012628 400125dc: e4 2e 20 88 stb %l2, [ %i0 + 0x88 ] fs_info, cur_blk, ofs_blk, c, pattern); if (c != ret) 400125e0: 80 a7 40 08 cmp %i5, %o0 400125e4: 12 80 00 06 bne 400125fc <== NEVER TAKEN 400125e8: 82 10 3f ff mov -1, %g1 rc = -1; else { bytes_to_write -= ret; 400125ec: b6 26 c0 1d sub %i3, %i5, %i3 bytes_written += ret; 400125f0: a0 04 00 1d add %l0, %i5, %l0 ++cur_blk; 400125f4: a2 04 60 01 inc %l1 400125f8: 82 10 20 00 clr %g1 400125fc: b4 10 20 00 clr %i2 ssize_t bytes_written = 0; ssize_t ret; cur_blk += blocks_in_offset; while ( (RC_OK == rc) 40012600: 80 a6 e0 00 cmp %i3, 0 40012604: 02 80 00 04 be 40012614 40012608: 80 a0 60 00 cmp %g1, 0 4001260c: 22 bf ff d5 be,a 40012560 <== ALWAYS TAKEN 40012610: c4 16 20 0a lduh [ %i0 + 0xa ], %g2 bytes_written += ret; ++cur_blk; } ofs_blk = 0; } if (RC_OK != rc) 40012614: 80 a0 60 00 cmp %g1, 0 40012618: 12 80 00 06 bne 40012630 <== NEVER TAKEN 4001261c: b0 10 3f ff mov -1, %i0 40012620: 81 c7 e0 08 ret 40012624: 91 e8 00 10 restore %g0, %l0, %o0 } } if (RC_OK != rc) return rc; else return bytes_to_write; 40012628: 10 bf ff ee b 400125e0 4001262c: 90 10 00 19 mov %i1, %o0 } if (RC_OK != rc) return rc; else return bytes_written; } 40012630: 81 c7 e0 08 ret <== NOT EXECUTED 40012634: 81 e8 00 00 restore <== NOT EXECUTED =============================================================================== 40012638 : const uint32_t start_cln, const uint32_t offset, const uint32_t count, const void *buff, const bool overwrite_cluster) { 40012638: 9d e3 bf 98 save %sp, -104, %sp ssize_t rc = RC_OK; uint32_t bytes_to_write = MIN(count, (fs_info->vol.bpc - offset)); 4001263c: c2 16 20 06 lduh [ %i0 + 6 ], %g1 40012640: 82 20 40 1a sub %g1, %i2, %g1 40012644: 80 a6 c0 01 cmp %i3, %g1 40012648: 38 80 00 02 bgu,a 40012650 <== NEVER TAKEN 4001264c: b6 10 00 01 mov %g1, %i3 <== NOT EXECUTED uint32_t cur_blk = fat_cluster_num_to_block_num(fs_info, start_cln); 40012650: 90 10 00 18 mov %i0, %o0 40012654: 7f ff fe b1 call 40012118 40012658: 92 10 00 19 mov %i1, %o1 uint32_t blocks_in_offset = (offset >> fs_info->vol.bytes_per_block_log2); 4001265c: c2 0e 20 0c ldub [ %i0 + 0xc ], %g1 uint32_t ofs_blk = offset - (blocks_in_offset << fs_info->vol.bytes_per_block_log2); ssize_t bytes_written = 0; 40012660: a2 10 20 00 clr %l1 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); 40012664: a5 36 80 01 srl %i2, %g1, %l2 uint32_t ofs_blk = offset - (blocks_in_offset << fs_info->vol.bytes_per_block_log2); 40012668: 83 2c 80 01 sll %l2, %g1, %g1 4001266c: a6 10 20 01 mov 1, %l3 40012670: b4 26 80 01 sub %i2, %g1, %i2 ssize_t bytes_written = 0; uint8_t *buffer = (uint8_t*)buff; ssize_t ret; uint32_t c; cur_blk += blocks_in_offset; 40012674: a4 02 00 12 add %o0, %l2, %l2 while ( (RC_OK == rc) 40012678: 10 80 00 2d b 4001272c 4001267c: 82 10 20 00 clr %g1 && (0 < bytes_to_write)) { c = MIN(bytes_to_write, (fs_info->vol.bytes_per_block - ofs_blk)); 40012680: 82 20 80 1a sub %g2, %i2, %g1 40012684: 80 a0 40 1b cmp %g1, %i3 40012688: 08 80 00 03 bleu 40012694 4001268c: b2 10 00 01 mov %g1, %i1 40012690: b2 10 00 1b mov %i3, %i1 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)); 40012694: 80 a6 40 01 cmp %i1, %g1 40012698: 08 80 00 03 bleu 400126a4 <== ALWAYS TAKEN 4001269c: a0 10 00 19 mov %i1, %l0 400126a0: a0 10 00 01 mov %g1, %l0 <== NOT EXECUTED uint32_t ino ) { return (ino >= fs_info->uino_base); } 400126a4: c2 0e 20 02 ldub [ %i0 + 2 ], %g1 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) 400126a8: 80 a4 20 00 cmp %l0, 0 400126ac: 02 80 00 2a be 40012754 <== NEVER TAKEN 400126b0: d2 0e 20 0c ldub [ %i0 + 0xc ], %o1 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); 400126b4: 92 22 40 01 sub %o1, %g1, %o1 { 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); 400126b8: 90 10 00 18 mov %i0, %o0 uint8_t *blk_buf; uint32_t sec_num = fat_block_num_to_sector_num(fs_info, start_blk); if (0 < bytes_to_write) { if ( overwrite_block 400126bc: 80 a7 60 00 cmp %i5, 0 400126c0: 12 80 00 05 bne 400126d4 400126c4: 93 2c 80 09 sll %l2, %o1, %o1 || (bytes_to_write == fs_info->vol.bytes_per_block)) 400126c8: 80 a4 00 02 cmp %l0, %g2 400126cc: 12 80 00 04 bne 400126dc 400126d0: 94 10 20 01 mov 1, %o2 { rc = fat_buf_access(fs_info, sec_num, FAT_OP_TYPE_GET, &blk_buf); 400126d4: 10 80 00 02 b 400126dc 400126d8: 94 10 20 02 mov 2, %o2 } else rc = fat_buf_access(fs_info, sec_num, FAT_OP_TYPE_READ, &blk_buf); 400126dc: 7f ff ff 1a call 40012344 400126e0: 96 07 bf fc add %fp, -4, %o3 if (RC_OK == rc) 400126e4: 80 a2 20 00 cmp %o0, 0 400126e8: 12 80 00 0a bne 40012710 <== NEVER TAKEN 400126ec: 80 a6 40 08 cmp %i1, %o0 { memcpy(blk_buf + offset, buf, bytes_to_write); 400126f0: d0 07 bf fc ld [ %fp + -4 ], %o0 400126f4: 92 07 00 11 add %i4, %l1, %o1 400126f8: 90 02 00 1a add %o0, %i2, %o0 400126fc: 40 00 1f b1 call 4001a5c0 40012700: 94 10 00 10 mov %l0, %o2 } static inline void fat_buf_mark_modified(fat_fs_info_t *fs_info) { fs_info->c.modified = true; 40012704: 10 80 00 14 b 40012754 40012708: e6 2e 20 88 stb %l3, [ %i0 + 0x88 ] cur_blk, ofs_blk, c, &buffer[bytes_written], overwrite_cluster); if (c != ret) 4001270c: 80 a6 40 08 cmp %i1, %o0 40012710: 12 80 00 06 bne 40012728 <== NEVER TAKEN 40012714: 82 10 3f ff mov -1, %g1 rc = -1; else { bytes_to_write -= ret; 40012718: b6 26 c0 19 sub %i3, %i1, %i3 bytes_written += ret; 4001271c: a2 04 40 19 add %l1, %i1, %l1 ++cur_blk; 40012720: a4 04 a0 01 inc %l2 40012724: 82 10 20 00 clr %g1 40012728: b4 10 20 00 clr %i2 ssize_t ret; uint32_t c; cur_blk += blocks_in_offset; while ( (RC_OK == rc) 4001272c: 80 a6 e0 00 cmp %i3, 0 40012730: 02 80 00 04 be 40012740 40012734: 80 a0 60 00 cmp %g1, 0 40012738: 22 bf ff d2 be,a 40012680 <== ALWAYS TAKEN 4001273c: c4 16 20 0a lduh [ %i0 + 0xa ], %g2 bytes_written += ret; ++cur_blk; } ofs_blk = 0; } if (RC_OK != rc) 40012740: 80 a0 60 00 cmp %g1, 0 40012744: 12 80 00 06 bne 4001275c <== NEVER TAKEN 40012748: b0 10 3f ff mov -1, %i0 4001274c: 81 c7 e0 08 ret 40012750: 91 e8 00 11 restore %g0, %l1, %o0 } } if (RC_OK != rc) return rc; else return bytes_to_write; 40012754: 10 bf ff ee b 4001270c 40012758: 90 10 00 10 mov %l0, %o0 } if (RC_OK != rc) return rc; else return bytes_written; } 4001275c: 81 c7 e0 08 ret <== NOT EXECUTED 40012760: 81 e8 00 00 restore <== NOT EXECUTED =============================================================================== 400119e0 : int fat_file_close( fat_fs_info_t *fs_info, fat_file_fd_t *fat_fd ) { 400119e0: 9d e3 bf a0 save %sp, -96, %sp /* * 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) 400119e4: c2 06 60 08 ld [ %i1 + 8 ], %g1 400119e8: 80 a0 60 01 cmp %g1, 1 400119ec: 08 80 00 05 bleu 40011a00 400119f0: 82 00 7f ff add %g1, -1, %g1 { fat_fd->links_num--; return rc; 400119f4: 90 10 20 00 clr %o0 400119f8: 10 80 00 25 b 40011a8c 400119fc: c2 26 60 08 st %g1, [ %i1 + 8 ] } key = fat_construct_key(fs_info, &fat_fd->dir_pos.sname); if (fat_fd->flags & FAT_FILE_REMOVED) 40011a00: c2 0e 60 30 ldub [ %i1 + 0x30 ], %g1 40011a04: 80 88 60 01 btst 1, %g1 40011a08: 02 80 00 14 be 40011a58 40011a0c: 90 10 00 18 mov %i0, %o0 { rc = fat_file_truncate(fs_info, fat_fd, 0); 40011a10: 92 10 00 19 mov %i1, %o1 40011a14: 7f ff ff ae call 400118cc 40011a18: 94 10 20 00 clr %o2 if ( rc != RC_OK ) 40011a1c: 80 a2 20 00 cmp %o0, 0 40011a20: 12 80 00 1b bne 40011a8c <== NEVER TAKEN 40011a24: 01 00 00 00 nop */ RTEMS_INLINE_ROUTINE void rtems_chain_extract( rtems_chain_node *the_node ) { _Chain_Extract( the_node ); 40011a28: 40 00 0c 7d call 40014c1c <_Chain_Extract> 40011a2c: 90 10 00 19 mov %i1, %o0 return rc; _hash_delete(fs_info->rhash, key, fat_fd->ino, fat_fd); if ( fat_ino_is_unique(fs_info, fat_fd->ino) ) 40011a30: d2 06 60 0c ld [ %i1 + 0xc ], %o1 40011a34: 40 00 06 01 call 40013238 40011a38: 90 10 00 18 mov %i0, %o0 40011a3c: 80 8a 20 ff btst 0xff, %o0 40011a40: 02 80 00 0f be 40011a7c <== ALWAYS TAKEN 40011a44: 01 00 00 00 nop fat_free_unique_ino(fs_info, fat_fd->ino); 40011a48: d2 06 60 0c ld [ %i1 + 0xc ], %o1 <== NOT EXECUTED 40011a4c: 40 00 05 f0 call 4001320c <== NOT EXECUTED 40011a50: 90 10 00 18 mov %i0, %o0 <== NOT EXECUTED 40011a54: 30 80 00 0a b,a 40011a7c <== NOT EXECUTED free(fat_fd); } else { if (fat_ino_is_unique(fs_info, fat_fd->ino)) 40011a58: 40 00 05 f8 call 40013238 40011a5c: d2 06 60 0c ld [ %i1 + 0xc ], %o1 40011a60: 80 8a 20 ff btst 0xff, %o0 40011a64: 02 80 00 04 be 40011a74 40011a68: 01 00 00 00 nop { fat_fd->links_num = 0; 40011a6c: 10 80 00 06 b 40011a84 40011a70: c0 26 60 08 clr [ %i1 + 8 ] 40011a74: 40 00 0c 6a call 40014c1c <_Chain_Extract> 40011a78: 90 10 00 19 mov %i1, %o0 } else { _hash_delete(fs_info->vhash, key, fat_fd->ino, fat_fd); free(fat_fd); 40011a7c: 7f ff cc 21 call 40004b00 40011a80: 90 10 00 19 mov %i1, %o0 } } /* * flush any modified "cached" buffer back to disk */ rc = fat_buf_release(fs_info); 40011a84: 40 00 01 bc call 40012174 40011a88: 81 e8 00 00 restore return rc; } 40011a8c: 81 c7 e0 08 ret 40011a90: 91 e8 00 08 restore %g0, %o0, %o0 =============================================================================== 40011b64 : fat_file_fd_t *fat_fd, bool zero_fill, uint32_t new_length, uint32_t *a_length ) { 40011b64: 9d e3 bf 90 save %sp, -112, %sp uint32_t last_cl = 0; uint32_t bytes_remain = 0; uint32_t cls_added; ssize_t bytes_written; *a_length = new_length; 40011b68: f6 27 00 00 st %i3, [ %i4 ] if (new_length <= fat_fd->fat_file_size) 40011b6c: c2 06 60 18 ld [ %i1 + 0x18 ], %g1 uint32_t new_length, uint32_t *a_length ) { int rc = RC_OK; uint32_t chain = 0; 40011b70: c0 27 bf f0 clr [ %fp + -16 ] uint32_t bytes2add = 0; uint32_t cls2add = 0; uint32_t old_last_cl; uint32_t last_cl = 0; 40011b74: c0 27 bf f8 clr [ %fp + -8 ] uint32_t cls_added; ssize_t bytes_written; *a_length = new_length; if (new_length <= fat_fd->fat_file_size) 40011b78: 80 a6 c0 01 cmp %i3, %g1 40011b7c: 18 80 00 04 bgu 40011b8c 40011b80: ba 10 00 18 mov %i0, %i5 return RC_OK; 40011b84: 81 c7 e0 08 ret 40011b88: 91 e8 20 00 restore %g0, 0, %o0 if ((FAT_FD_OF_ROOT_DIR(fat_fd)) && 40011b8c: c4 06 60 20 ld [ %i1 + 0x20 ], %g2 40011b90: 80 a0 a0 01 cmp %g2, 1 40011b94: 32 80 00 0b bne,a 40011bc0 40011b98: e0 17 60 06 lduh [ %i5 + 6 ], %l0 40011b9c: c4 06 60 24 ld [ %i1 + 0x24 ], %g2 40011ba0: 80 a0 a0 00 cmp %g2, 0 40011ba4: 32 80 00 07 bne,a 40011bc0 <== NEVER TAKEN 40011ba8: e0 17 60 06 lduh [ %i5 + 6 ], %l0 <== NOT EXECUTED (fs_info->vol.type & (FAT_FAT12 | FAT_FAT16))) 40011bac: c4 0e 20 0e ldub [ %i0 + 0xe ], %g2 *a_length = new_length; if (new_length <= fat_fd->fat_file_size) return RC_OK; if ((FAT_FD_OF_ROOT_DIR(fat_fd)) && 40011bb0: 80 88 a0 03 btst 3, %g2 40011bb4: 22 80 00 03 be,a 40011bc0 <== NEVER TAKEN 40011bb8: e0 17 60 06 lduh [ %i5 + 6 ], %l0 <== NOT EXECUTED 40011bbc: 30 80 00 34 b,a 40011c8c (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))) & 40011bc0: 84 04 3f ff add %l0, -1, %g2 40011bc4: a4 08 80 01 and %g2, %g1, %l2 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 - 40011bc8: a0 24 00 12 sub %l0, %l2, %l0 40011bcc: a0 0c 00 02 and %l0, %g2, %l0 (fat_fd->fat_file_size & (fs_info->vol.bpc - 1))) & (fs_info->vol.bpc - 1); bytes2add = new_length - fat_fd->fat_file_size; 40011bd0: 84 26 c0 01 sub %i3, %g1, %g2 if (bytes2add > bytes_remain) 40011bd4: 80 a0 80 10 cmp %g2, %l0 40011bd8: 08 80 00 03 bleu 40011be4 40011bdc: a2 10 20 00 clr %l1 bytes2add -= bytes_remain; 40011be0: a2 20 80 10 sub %g2, %l0, %l1 else bytes2add = 0; if (zero_fill && bytes_remain > 0) { 40011be4: 80 a4 20 00 cmp %l0, 0 40011be8: 02 80 00 17 be 40011c44 40011bec: 80 a4 60 00 cmp %l1, 0 40011bf0: 80 a6 a0 00 cmp %i2, 0 40011bf4: 02 80 00 14 be 40011c44 40011bf8: 80 a4 60 00 cmp %l1, 0 uint32_t start = fat_fd->fat_file_size; uint32_t cl_start = start >> fs_info->vol.bpc_log2; 40011bfc: d4 0f 60 08 ldub [ %i5 + 8 ], %o2 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); 40011c00: 90 10 00 1d mov %i5, %o0 40011c04: 92 10 00 19 mov %i1, %o1 40011c08: 95 30 40 0a srl %g1, %o2, %o2 40011c0c: 7f ff fe 39 call 400114f0 40011c10: 96 07 bf fc add %fp, -4, %o3 if (rc != RC_OK) 40011c14: b0 92 60 00 orcc %o1, 0, %i0 40011c18: 12 80 00 21 bne 40011c9c <== NEVER TAKEN 40011c1c: d2 07 bf fc ld [ %fp + -4 ], %o1 return rc; bytes_written = fat_cluster_set (fs_info, cur_cln, ofs, bytes_remain, 0); 40011c20: 90 10 00 1d mov %i5, %o0 40011c24: 94 10 00 12 mov %l2, %o2 40011c28: 96 10 00 10 mov %l0, %o3 40011c2c: 98 10 20 00 clr %o4 40011c30: 40 00 02 3a call 40012518 40011c34: b0 10 3f ff mov -1, %i0 if (bytes_remain != bytes_written) 40011c38: 80 a4 00 08 cmp %l0, %o0 40011c3c: 12 80 00 18 bne 40011c9c <== NEVER TAKEN 40011c40: 80 a4 60 00 cmp %l1, 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) 40011c44: 02 bf ff d0 be 40011b84 40011c48: a4 04 7f ff add %l1, -1, %l2 return RC_OK; cls2add = ((bytes2add - 1) >> fs_info->vol.bpc_log2) + 1; 40011c4c: c2 0f 60 08 ldub [ %i5 + 8 ], %g1 rc = fat_scan_fat_for_free_clusters(fs_info, &chain, cls2add, 40011c50: 90 10 00 1d mov %i5, %o0 * file ) - return */ if (bytes2add == 0) return RC_OK; cls2add = ((bytes2add - 1) >> fs_info->vol.bpc_log2) + 1; 40011c54: a5 34 80 01 srl %l2, %g1, %l2 rc = fat_scan_fat_for_free_clusters(fs_info, &chain, cls2add, 40011c58: 92 07 bf f0 add %fp, -16, %o1 * file ) - return */ if (bytes2add == 0) return RC_OK; cls2add = ((bytes2add - 1) >> fs_info->vol.bpc_log2) + 1; 40011c5c: a4 04 a0 01 inc %l2 rc = fat_scan_fat_for_free_clusters(fs_info, &chain, cls2add, 40011c60: 96 07 bf fc add %fp, -4, %o3 40011c64: 94 10 00 12 mov %l2, %o2 40011c68: 98 07 bf f8 add %fp, -8, %o4 40011c6c: 40 00 1a 28 call 4001850c 40011c70: 9a 10 00 1a mov %i2, %o5 &cls_added, &last_cl, zero_fill); /* this means that low level I/O error occured */ if (rc != RC_OK) 40011c74: b0 92 20 00 orcc %o0, 0, %i0 40011c78: 12 80 00 09 bne 40011c9c <== NEVER TAKEN 40011c7c: c2 07 bf fc ld [ %fp + -4 ], %g1 return rc; /* this means that no space left on device */ if ((cls_added == 0) && (bytes_remain == 0)) 40011c80: 80 94 00 01 orcc %l0, %g1, %g0 40011c84: 12 80 00 08 bne 40011ca4 <== ALWAYS TAKEN 40011c88: 80 a4 80 01 cmp %l2, %g1 rtems_set_errno_and_return_minus_one(ENOSPC); 40011c8c: 40 00 1f a8 call 40019b2c <__errno> 40011c90: b0 10 3f ff mov -1, %i0 40011c94: 82 10 20 1c mov 0x1c, %g1 40011c98: c2 22 00 00 st %g1, [ %o0 ] 40011c9c: 81 c7 e0 08 ret 40011ca0: 81 e8 00 00 restore /* check wether we satisfied request for 'cls2add' clusters */ if (cls2add != cls_added) 40011ca4: 02 80 00 09 be 40011cc8 <== ALWAYS TAKEN 40011ca8: 82 24 80 01 sub %l2, %g1, %g1 { new_length -= bytes2add & (fs_info->vol.bpc - 1); 40011cac: c4 17 60 06 lduh [ %i5 + 6 ], %g2 <== NOT EXECUTED 40011cb0: 84 00 bf ff add %g2, -1, %g2 <== NOT EXECUTED 40011cb4: a2 0c 40 02 and %l1, %g2, %l1 <== NOT EXECUTED new_length -= (cls2add - cls_added) << fs_info->vol.bpc_log2; 40011cb8: c4 0f 60 08 ldub [ %i5 + 8 ], %g2 <== 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); 40011cbc: b6 26 c0 11 sub %i3, %l1, %i3 <== NOT EXECUTED new_length -= (cls2add - cls_added) << fs_info->vol.bpc_log2; 40011cc0: 83 28 40 02 sll %g1, %g2, %g1 <== NOT EXECUTED 40011cc4: b6 26 c0 01 sub %i3, %g1, %i3 <== NOT EXECUTED } /* add new chain to the end of existed */ if ( fat_fd->fat_file_size == 0 ) 40011cc8: d6 06 60 18 ld [ %i1 + 0x18 ], %o3 40011ccc: 80 a2 e0 00 cmp %o3, 0 40011cd0: 32 80 00 07 bne,a 40011cec 40011cd4: c2 06 60 3c ld [ %i1 + 0x3c ], %g1 { fat_fd->map.disk_cln = fat_fd->cln = chain; 40011cd8: c2 07 bf f0 ld [ %fp + -16 ], %g1 fat_fd->map.file_cln = 0; 40011cdc: c0 26 60 34 clr [ %i1 + 0x34 ] } /* add new chain to the end of existed */ if ( fat_fd->fat_file_size == 0 ) { fat_fd->map.disk_cln = fat_fd->cln = chain; 40011ce0: c2 26 60 1c st %g1, [ %i1 + 0x1c ] 40011ce4: 10 80 00 1d b 40011d58 40011ce8: c2 26 60 38 st %g1, [ %i1 + 0x38 ] fat_fd->map.file_cln = 0; } else { if (fat_fd->map.last_cln != FAT_UNDEFINED_VALUE) 40011cec: 80 a0 7f ff cmp %g1, -1 40011cf0: 22 80 00 04 be,a 40011d00 <== NEVER TAKEN 40011cf4: 90 10 00 1d mov %i5, %o0 <== NOT EXECUTED { old_last_cl = fat_fd->map.last_cln; 40011cf8: 10 80 00 0c b 40011d28 40011cfc: c2 27 bf f4 st %g1, [ %fp + -12 ] } else { rc = fat_file_ioctl(fs_info, fat_fd, F_CLU_NUM, 40011d00: 92 10 00 19 mov %i1, %o1 <== NOT EXECUTED 40011d04: 94 10 20 01 mov 1, %o2 <== NOT EXECUTED 40011d08: 96 02 ff ff add %o3, -1, %o3 <== NOT EXECUTED 40011d0c: 7f ff ff 62 call 40011a94 <== NOT EXECUTED 40011d10: 98 07 bf f4 add %fp, -12, %o4 <== NOT EXECUTED (fat_fd->fat_file_size - 1), &old_last_cl); if ( rc != RC_OK ) 40011d14: b4 92 20 00 orcc %o0, 0, %i2 <== NOT EXECUTED 40011d18: 02 80 00 05 be 40011d2c <== NOT EXECUTED 40011d1c: d2 07 bf f4 ld [ %fp + -12 ], %o1 <== 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); 40011d20: 10 80 00 1f b 40011d9c <== NOT EXECUTED 40011d24: 90 10 00 1d mov %i5, %o0 <== NOT EXECUTED fat_free_fat_clusters_chain(fs_info, chain); return rc; } } rc = fat_set_fat_cluster(fs_info, old_last_cl, chain); 40011d28: d2 07 bf f4 ld [ %fp + -12 ], %o1 40011d2c: d4 07 bf f0 ld [ %fp + -16 ], %o2 40011d30: 40 00 19 27 call 400181cc 40011d34: 90 10 00 1d mov %i5, %o0 40011d38: b4 10 00 08 mov %o0, %i2 if ( rc != RC_OK ) 40011d3c: 80 a6 a0 00 cmp %i2, 0 40011d40: 02 80 00 04 be 40011d50 <== ALWAYS TAKEN 40011d44: 90 10 00 1d mov %i5, %o0 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); 40011d48: 10 80 00 16 b 40011da0 <== NOT EXECUTED 40011d4c: d2 07 bf f0 ld [ %fp + -16 ], %o1 <== NOT EXECUTED if ( rc != RC_OK ) { fat_free_fat_clusters_chain(fs_info, chain); return rc; } fat_buf_release(fs_info); 40011d50: 40 00 01 09 call 40012174 40011d54: 01 00 00 00 nop } /* update number of the last cluster of the file if it changed */ if (cls_added != 0) 40011d58: c2 07 bf fc ld [ %fp + -4 ], %g1 40011d5c: 80 a0 60 00 cmp %g1, 0 40011d60: 22 80 00 14 be,a 40011db0 <== NEVER TAKEN 40011d64: f6 27 00 00 st %i3, [ %i4 ] <== NOT EXECUTED { fat_fd->map.last_cln = last_cl; 40011d68: c2 07 bf f8 ld [ %fp + -8 ], %g1 40011d6c: c2 26 60 3c st %g1, [ %i1 + 0x3c ] if (fat_fd->fat_file_type == FAT_DIRECTORY) 40011d70: c2 06 60 10 ld [ %i1 + 0x10 ], %g1 40011d74: 80 a0 60 00 cmp %g1, 0 40011d78: 32 80 00 0e bne,a 40011db0 40011d7c: f6 27 00 00 st %i3, [ %i4 ] { rc = fat_init_clusters_chain(fs_info, chain); 40011d80: d2 07 bf f0 ld [ %fp + -16 ], %o1 40011d84: 40 00 04 d4 call 400130d4 40011d88: 90 10 00 1d mov %i5, %o0 if ( rc != RC_OK ) 40011d8c: b4 92 20 00 orcc %o0, 0, %i2 40011d90: 22 80 00 08 be,a 40011db0 <== ALWAYS TAKEN 40011d94: f6 27 00 00 st %i3, [ %i4 ] { fat_free_fat_clusters_chain(fs_info, chain); 40011d98: 90 10 00 1d mov %i5, %o0 <== NOT EXECUTED 40011d9c: d2 07 bf f0 ld [ %fp + -16 ], %o1 <== NOT EXECUTED 40011da0: 40 00 19 ac call 40018450 <== NOT EXECUTED 40011da4: b0 10 00 1a mov %i2, %i0 <== NOT EXECUTED 40011da8: 81 c7 e0 08 ret <== NOT EXECUTED 40011dac: 81 e8 00 00 restore <== NOT EXECUTED } } } *a_length = new_length; fat_fd->fat_file_size = new_length; 40011db0: f6 26 60 18 st %i3, [ %i1 + 0x18 ] return RC_OK; } 40011db4: 81 c7 e0 08 ret 40011db8: 81 e8 00 00 restore =============================================================================== 40011a94 : fat_file_ioctl( fat_fs_info_t *fs_info, fat_file_fd_t *fat_fd, int cmd, ...) { 40011a94: 9d e3 bf 98 save %sp, -104, %sp uint32_t cl_start = 0; uint32_t pos = 0; uint32_t *ret; va_list ap; va_start(ap, cmd); 40011a98: 82 07 a0 50 add %fp, 0x50, %g1 40011a9c: f6 27 a0 50 st %i3, [ %fp + 0x50 ] 40011aa0: f8 27 a0 54 st %i4, [ %fp + 0x54 ] 40011aa4: fa 27 a0 58 st %i5, [ %fp + 0x58 ] fat_file_fd_t *fat_fd, int cmd, ...) { int rc = RC_OK; uint32_t cur_cln = 0; 40011aa8: c0 27 bf f8 clr [ %fp + -8 ] uint32_t *ret; va_list ap; va_start(ap, cmd); switch (cmd) 40011aac: 80 a6 a0 01 cmp %i2, 1 40011ab0: 12 80 00 26 bne 40011b48 <== NEVER TAKEN 40011ab4: c2 27 bf fc st %g1, [ %fp + -4 ] { case F_CLU_NUM: pos = va_arg(ap, uint32_t); ret = va_arg(ap, uint32_t *); 40011ab8: 82 07 a0 58 add %fp, 0x58, %g1 40011abc: c2 27 bf fc st %g1, [ %fp + -4 ] /* sanity check */ if ( pos >= fat_fd->fat_file_size ) { 40011ac0: c2 06 60 18 ld [ %i1 + 0x18 ], %g1 40011ac4: 80 a6 c0 01 cmp %i3, %g1 40011ac8: 0a 80 00 06 bcs 40011ae0 <== ALWAYS TAKEN 40011acc: ba 10 00 1c mov %i4, %i5 va_end(ap); rtems_set_errno_and_return_minus_one( EIO ); 40011ad0: 40 00 20 17 call 40019b2c <__errno> <== NOT EXECUTED 40011ad4: 01 00 00 00 nop <== NOT EXECUTED 40011ad8: 10 80 00 1f b 40011b54 <== NOT EXECUTED 40011adc: 82 10 20 05 mov 5, %g1 ! 5 <== NOT EXECUTED } if ((FAT_FD_OF_ROOT_DIR(fat_fd)) && 40011ae0: c2 06 60 20 ld [ %i1 + 0x20 ], %g1 40011ae4: 80 a0 60 01 cmp %g1, 1 40011ae8: 32 80 00 0d bne,a 40011b1c 40011aec: d4 0e 20 08 ldub [ %i0 + 8 ], %o2 40011af0: c2 06 60 24 ld [ %i1 + 0x24 ], %g1 40011af4: 80 a0 60 00 cmp %g1, 0 40011af8: 32 80 00 09 bne,a 40011b1c <== NEVER TAKEN 40011afc: d4 0e 20 08 ldub [ %i0 + 8 ], %o2 <== NOT EXECUTED (fs_info->vol.type & (FAT_FAT12 | FAT_FAT16))) 40011b00: c2 0e 20 0e ldub [ %i0 + 0xe ], %g1 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)) && 40011b04: 80 88 60 03 btst 3, %g1 40011b08: 22 80 00 05 be,a 40011b1c 40011b0c: d4 0e 20 08 ldub [ %i0 + 8 ], %o2 (fs_info->vol.type & (FAT_FAT12 | FAT_FAT16))) { /* cluster 0 (zero) reserved for root dir */ *ret = 0; 40011b10: c0 27 00 00 clr [ %i4 ] rc = RC_OK; break; 40011b14: 81 c7 e0 08 ret 40011b18: 91 e8 20 00 restore %g0, 0, %o0 } cl_start = pos >> fs_info->vol.bpc_log2; rc = fat_file_lseek(fs_info, fat_fd, cl_start, &cur_cln); 40011b1c: 90 10 00 18 mov %i0, %o0 40011b20: 92 10 00 19 mov %i1, %o1 40011b24: 95 36 c0 0a srl %i3, %o2, %o2 40011b28: 7f ff fe 72 call 400114f0 40011b2c: 96 07 bf f8 add %fp, -8, %o3 if ( rc != RC_OK ) 40011b30: b0 92 60 00 orcc %o1, 0, %i0 40011b34: 12 80 00 03 bne 40011b40 <== NEVER TAKEN 40011b38: c2 07 bf f8 ld [ %fp + -8 ], %g1 break; *ret = cur_cln; 40011b3c: c2 27 40 00 st %g1, [ %i5 ] break; 40011b40: 81 c7 e0 08 ret 40011b44: 81 e8 00 00 restore default: errno = EINVAL; 40011b48: 40 00 1f f9 call 40019b2c <__errno> <== NOT EXECUTED 40011b4c: 01 00 00 00 nop <== NOT EXECUTED 40011b50: 82 10 20 16 mov 0x16, %g1 ! 16 <== NOT EXECUTED 40011b54: c2 22 00 00 st %g1, [ %o0 ] <== NOT EXECUTED rc = -1; 40011b58: b0 10 3f ff mov -1, %i0 <== NOT EXECUTED break; } va_end(ap); return rc; } 40011b5c: 81 c7 e0 08 ret <== NOT EXECUTED 40011b60: 81 e8 00 00 restore <== NOT EXECUTED =============================================================================== 400114f0 : fat_fs_info_t *fs_info, fat_file_fd_t *fat_fd, uint32_t file_cln, uint32_t *disk_cln ) { 400114f0: 9d e3 bf 98 save %sp, -104, %sp int rc = RC_OK; if (file_cln == fat_fd->map.file_cln) 400114f4: c2 06 60 34 ld [ %i1 + 0x34 ], %g1 400114f8: 80 a6 80 01 cmp %i2, %g1 400114fc: 12 80 00 05 bne 40011510 40011500: 01 00 00 00 nop *disk_cln = fat_fd->map.disk_cln; 40011504: c2 06 60 38 ld [ %i1 + 0x38 ], %g1 40011508: 10 80 00 1b b 40011574 4001150c: c2 26 c0 00 st %g1, [ %i3 ] { uint32_t cur_cln; uint32_t count; uint32_t i; if (file_cln > fat_fd->map.file_cln) 40011510: 28 80 00 06 bleu,a 40011528 40011514: c2 06 60 1c ld [ %i1 + 0x1c ], %g1 { cur_cln = fat_fd->map.disk_cln; 40011518: c4 06 60 38 ld [ %i1 + 0x38 ], %g2 count = file_cln - fat_fd->map.file_cln; 4001151c: b8 26 80 01 sub %i2, %g1, %i4 uint32_t count; uint32_t i; if (file_cln > fat_fd->map.file_cln) { cur_cln = fat_fd->map.disk_cln; 40011520: 10 80 00 04 b 40011530 40011524: c4 27 bf fc st %g2, [ %fp + -4 ] count = file_cln - fat_fd->map.file_cln; } else { cur_cln = fat_fd->cln; 40011528: b8 10 00 1a mov %i2, %i4 4001152c: c2 27 bf fc st %g1, [ %fp + -4 ] count = file_cln; } /* skip over the clusters */ for (i = 0; i < count; i++) 40011530: 10 80 00 0b b 4001155c 40011534: ba 10 20 00 clr %i5 { rc = fat_get_fat_cluster(fs_info, cur_cln, &cur_cln); 40011538: 90 10 00 18 mov %i0, %o0 4001153c: 40 00 1a b2 call 40018004 40011540: 94 07 bf fc add %fp, -4, %o2 if ( rc != RC_OK ) 40011544: 80 a2 20 00 cmp %o0, 0 40011548: 22 80 00 05 be,a 4001155c <== ALWAYS TAKEN 4001154c: ba 07 60 01 inc %i5 return rc; 40011550: 86 10 00 08 mov %o0, %g3 <== NOT EXECUTED 40011554: 10 80 00 0a b 4001157c <== NOT EXECUTED 40011558: 85 3a 20 1f sra %o0, 0x1f, %g2 <== NOT EXECUTED cur_cln = fat_fd->cln; count = file_cln; } /* skip over the clusters */ for (i = 0; i < count; i++) 4001155c: 80 a7 40 1c cmp %i5, %i4 40011560: 12 bf ff f6 bne 40011538 40011564: d2 07 bf fc ld [ %fp + -4 ], %o1 if ( rc != RC_OK ) return rc; } /* update cache */ fat_fd->map.file_cln = file_cln; 40011568: f4 26 60 34 st %i2, [ %i1 + 0x34 ] fat_fd->map.disk_cln = cur_cln; 4001156c: d2 26 60 38 st %o1, [ %i1 + 0x38 ] *disk_cln = cur_cln; 40011570: d2 26 c0 00 st %o1, [ %i3 ] } return RC_OK; 40011574: 84 10 20 00 clr %g2 40011578: 86 10 20 00 clr %g3 } 4001157c: b0 10 00 02 mov %g2, %i0 40011580: 81 c7 e0 08 ret 40011584: 93 e8 00 03 restore %g0, %g3, %o1 =============================================================================== 40011588 : fat_file_open( fat_fs_info_t *fs_info, fat_dir_pos_t *dir_pos, fat_file_fd_t **fat_fd ) { 40011588: 9d e3 bf a0 save %sp, -96, %sp int rc = RC_OK; fat_file_fd_t *lfat_fd = NULL; uint32_t key = 0; /* construct key */ key = fat_construct_key(fs_info, &dir_pos->sname); 4001158c: 90 10 00 18 mov %i0, %o0 40011590: 7f ff ff c7 call 400114ac 40011594: 92 10 00 19 mov %i1, %o1 uint32_t key1, uint32_t key2, fat_file_fd_t **ret ) { uint32_t mod = (key1) % FAT_HASH_MODULE; 40011598: 82 0a 20 01 and %o0, 1, %g1 rtems_chain_node *the_node = rtems_chain_first(hash + mod); 4001159c: 85 28 60 02 sll %g1, 2, %g2 400115a0: b7 28 60 04 sll %g1, 4, %i3 400115a4: c2 06 20 6c ld [ %i0 + 0x6c ], %g1 400115a8: b6 26 c0 02 sub %i3, %g2, %i3 int rc = RC_OK; fat_file_fd_t *lfat_fd = NULL; uint32_t key = 0; /* construct key */ key = fat_construct_key(fs_info, &dir_pos->sname); 400115ac: b8 10 00 08 mov %o0, %i4 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); 400115b0: a0 00 40 1b add %g1, %i3, %l0 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_First( Chain_Control *the_chain ) { return _Chain_Head( the_chain )->next; 400115b4: fa 00 40 1b ld [ %g1 + %i3 ], %i5 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 )); 400115b8: 10 80 00 0c b 400115e8 400115bc: a0 04 20 04 add %l0, 4, %l0 for ( ; !rtems_chain_is_tail((hash) + mod, the_node) ; ) { fat_file_fd_t *ffd = (fat_file_fd_t *)the_node; uint32_t ck = fat_construct_key(fs_info, &ffd->dir_pos.sname); 400115c0: 7f ff ff bb call 400114ac 400115c4: 92 07 60 20 add %i5, 0x20, %o1 if ( (key1) == ck) 400115c8: 80 a7 00 08 cmp %i4, %o0 400115cc: 32 80 00 07 bne,a 400115e8 400115d0: fa 07 40 00 ld [ %i5 ], %i5 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++; 400115d4: c2 07 60 08 ld [ %i5 + 8 ], %g1 /* 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; 400115d8: fa 26 80 00 st %i5, [ %i2 ] lfat_fd->links_num++; 400115dc: 82 00 60 01 inc %g1 400115e0: 10 80 00 42 b 400116e8 400115e4: c2 27 60 08 st %g1, [ %i5 + 8 ] ) { 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) ; ) 400115e8: 80 a7 40 10 cmp %i5, %l0 400115ec: 12 bf ff f5 bne 400115c0 400115f0: 90 10 00 18 mov %i0, %o0 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); 400115f4: 10 80 00 3f b 400116f0 400115f8: c2 06 20 70 ld [ %i0 + 0x70 ], %g1 for ( ; !rtems_chain_is_tail((hash) + mod, the_node) ; ) { fat_file_fd_t *ffd = (fat_file_fd_t *)the_node; uint32_t ck = fat_construct_key(fs_info, &ffd->dir_pos.sname); 400115fc: 7f ff ff ac call 400114ac <== NOT EXECUTED 40011600: 92 07 60 20 add %i5, 0x20, %o1 <== NOT EXECUTED if ( (key1) == ck) 40011604: 80 a7 00 08 cmp %i4, %o0 <== NOT EXECUTED 40011608: 32 80 00 0a bne,a 40011630 <== NOT EXECUTED 4001160c: fa 07 40 00 ld [ %i5 ], %i5 <== NOT EXECUTED { if ( ((key2) == 0) || ((key2) == ffd->ino) ) 40011610: 80 a7 20 00 cmp %i4, 0 <== NOT EXECUTED 40011614: 22 80 00 0b be,a 40011640 <== NOT EXECUTED 40011618: a0 10 20 00 clr %l0 <== NOT EXECUTED 4001161c: c2 07 60 0c ld [ %i5 + 0xc ], %g1 <== NOT EXECUTED 40011620: 80 a7 00 01 cmp %i4, %g1 <== NOT EXECUTED 40011624: 22 80 00 07 be,a 40011640 <== NOT EXECUTED 40011628: a0 10 20 00 clr %l0 <== NOT EXECUTED { *ret = (void *)the_node; return 0; } } the_node = the_node->next; 4001162c: fa 07 40 00 ld [ %i5 ], %i5 <== 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) ; ) 40011630: 80 a7 40 10 cmp %i5, %l0 40011634: 12 bf ff f2 bne 400115fc <== NEVER TAKEN 40011638: 90 10 00 18 mov %i0, %o0 4001163c: a0 10 3f ff mov -1, %l0 } /* 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)); 40011640: 7f ff ce 7a call 40005028 40011644: 90 10 20 44 mov 0x44, %o0 40011648: d0 26 80 00 st %o0, [ %i2 ] if ( lfat_fd == NULL ) 4001164c: 80 a2 20 00 cmp %o0, 0 40011650: 02 80 00 1c be 400116c0 <== NEVER TAKEN 40011654: ba 10 00 08 mov %o0, %i5 rtems_set_errno_and_return_minus_one( ENOMEM ); memset(lfat_fd, 0, sizeof(fat_file_fd_t)); 40011658: 92 10 20 00 clr %o1 4001165c: 40 00 24 16 call 4001a6b4 40011660: 94 10 20 44 mov 0x44, %o2 lfat_fd->links_num = 1; 40011664: 82 10 20 01 mov 1, %g1 40011668: c2 27 60 08 st %g1, [ %i5 + 8 ] lfat_fd->flags &= ~FAT_FILE_REMOVED; 4001166c: c2 0f 60 30 ldub [ %i5 + 0x30 ], %g1 lfat_fd->map.last_cln = FAT_UNDEFINED_VALUE; lfat_fd->dir_pos = *dir_pos; 40011670: 90 07 60 20 add %i5, 0x20, %o0 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; 40011674: 82 08 7f fe and %g1, -2, %g1 40011678: c2 2f 60 30 stb %g1, [ %i5 + 0x30 ] lfat_fd->map.last_cln = FAT_UNDEFINED_VALUE; 4001167c: 82 10 3f ff mov -1, %g1 lfat_fd->dir_pos = *dir_pos; 40011680: 92 10 00 19 mov %i1, %o1 memset(lfat_fd, 0, sizeof(fat_file_fd_t)); lfat_fd->links_num = 1; lfat_fd->flags &= ~FAT_FILE_REMOVED; lfat_fd->map.last_cln = FAT_UNDEFINED_VALUE; 40011684: c2 27 60 3c st %g1, [ %i5 + 0x3c ] lfat_fd->dir_pos = *dir_pos; 40011688: 40 00 23 ce call 4001a5c0 4001168c: 94 10 20 10 mov 0x10, %o2 if ( rc != RC_OK ) 40011690: 80 a4 20 00 cmp %l0, 0 40011694: 02 80 00 04 be 400116a4 <== NEVER TAKEN 40011698: 01 00 00 00 nop lfat_fd->ino = key; 4001169c: 10 80 00 0f b 400116d8 400116a0: f8 27 60 0c st %i4, [ %i5 + 0xc ] else { lfat_fd->ino = fat_get_unique_ino(fs_info); 400116a4: 40 00 06 aa call 4001314c <== NOT EXECUTED 400116a8: 90 10 00 18 mov %i0, %o0 <== NOT EXECUTED if ( lfat_fd->ino == 0 ) 400116ac: 80 a2 20 00 cmp %o0, 0 <== NOT EXECUTED 400116b0: 12 80 00 0a bne 400116d8 <== NOT EXECUTED 400116b4: d0 27 60 0c st %o0, [ %i5 + 0xc ] <== NOT EXECUTED { free((*fat_fd)); 400116b8: 7f ff cd 12 call 40004b00 <== NOT EXECUTED 400116bc: d0 06 80 00 ld [ %i2 ], %o0 <== 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 ); 400116c0: 40 00 21 1b call 40019b2c <__errno> <== NOT EXECUTED 400116c4: b0 10 3f ff mov -1, %i0 <== NOT EXECUTED 400116c8: 82 10 20 0c mov 0xc, %g1 <== NOT EXECUTED 400116cc: c2 22 00 00 st %g1, [ %o0 ] <== NOT EXECUTED 400116d0: 81 c7 e0 08 ret <== NOT EXECUTED 400116d4: 81 e8 00 00 restore <== NOT EXECUTED */ static inline void _hash_insert(rtems_chain_control *hash, uint32_t key1, uint32_t key2, fat_file_fd_t *el) { rtems_chain_append((hash) + ((key1) % FAT_HASH_MODULE), &(el)->link); 400116d8: d0 06 20 6c ld [ %i0 + 0x6c ], %o0 RTEMS_INLINE_ROUTINE void rtems_chain_append( rtems_chain_control *the_chain, rtems_chain_node *the_node ) { _Chain_Append( the_chain, the_node ); 400116dc: 92 10 00 1d mov %i5, %o1 400116e0: 7f ff e0 bd call 400099d4 <_Chain_Append> 400116e4: 90 02 00 1b add %o0, %i3, %o0 /* * other fields of fat-file descriptor will be initialized on upper * level */ return RC_OK; 400116e8: 81 c7 e0 08 ret 400116ec: 91 e8 20 00 restore %g0, 0, %o0 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); 400116f0: a0 00 40 1b add %g1, %i3, %l0 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_First( Chain_Control *the_chain ) { return _Chain_Head( the_chain )->next; 400116f4: fa 00 40 1b ld [ %g1 + %i3 ], %i5 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 )); 400116f8: 10 bf ff ce b 40011630 400116fc: a0 04 20 04 add %l0, 4, %l0 =============================================================================== 40011714 : fat_file_fd_t *fat_fd, uint32_t start, uint32_t count, uint8_t *buf ) { 40011714: 9d e3 bf 98 save %sp, -104, %sp int rc = RC_OK; ssize_t ret = 0; uint32_t cmpltd = 0; uint32_t cur_cln = 0; 40011718: c0 27 bf fc clr [ %fp + -4 ] fat_file_fd_t *fat_fd, uint32_t start, uint32_t count, uint8_t *buf ) { 4001171c: ba 10 00 18 mov %i0, %i5 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) 40011720: 80 a6 e0 00 cmp %i3, 0 40011724: 02 80 00 68 be 400118c4 <== NEVER TAKEN 40011728: 90 10 20 00 clr %o0 /* * >= because start is offset and computed from 0 and file_size * computed from 1 */ if ( start >= fat_fd->fat_file_size ) 4001172c: c2 06 60 18 ld [ %i1 + 0x18 ], %g1 40011730: 80 a6 80 01 cmp %i2, %g1 40011734: 1a 80 00 64 bcc 400118c4 40011738: 80 a6 c0 01 cmp %i3, %g1 return FAT_EOF; if ((count > fat_fd->fat_file_size) || 4001173c: 38 80 00 07 bgu,a 40011758 <== NEVER TAKEN 40011740: b6 20 40 1a sub %g1, %i2, %i3 <== NOT EXECUTED (start > fat_fd->fat_file_size - count)) 40011744: 84 20 40 1b sub %g1, %i3, %g2 * computed from 1 */ if ( start >= fat_fd->fat_file_size ) return FAT_EOF; if ((count > fat_fd->fat_file_size) || 40011748: 80 a6 80 02 cmp %i2, %g2 4001174c: 28 80 00 04 bleu,a 4001175c 40011750: c2 06 60 20 ld [ %i1 + 0x20 ], %g1 (start > fat_fd->fat_file_size - count)) count = fat_fd->fat_file_size - start; 40011754: b6 20 40 1a sub %g1, %i2, %i3 if ((FAT_FD_OF_ROOT_DIR(fat_fd)) && 40011758: c2 06 60 20 ld [ %i1 + 0x20 ], %g1 4001175c: 80 a0 60 01 cmp %g1, 1 40011760: 32 80 00 1c bne,a 400117d0 40011764: e4 0f 60 08 ldub [ %i5 + 8 ], %l2 40011768: c2 06 60 24 ld [ %i1 + 0x24 ], %g1 4001176c: 80 a0 60 00 cmp %g1, 0 40011770: 32 80 00 18 bne,a 400117d0 <== NEVER TAKEN 40011774: e4 0f 60 08 ldub [ %i5 + 8 ], %l2 <== NOT EXECUTED (fs_info->vol.type & (FAT_FAT12 | FAT_FAT16))) 40011778: c2 0f 60 0e ldub [ %i5 + 0xe ], %g1 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)) && 4001177c: 80 88 60 03 btst 3, %g1 40011780: 22 80 00 14 be,a 400117d0 40011784: e4 0f 60 08 ldub [ %i5 + 8 ], %l2 (fs_info->vol.type & (FAT_FAT12 | FAT_FAT16))) { sec = fat_cluster_num_to_sector_num(fs_info, fat_fd->cln); 40011788: d2 06 60 1c ld [ %i1 + 0x1c ], %o1 4001178c: 7f ff ff 3a call 40011474 40011790: 90 10 00 1d mov %i5, %o0 sec += (start >> fs_info->vol.sec_log2); 40011794: d2 0f 60 02 ldub [ %i5 + 2 ], %o1 byte = start & (fs_info->vol.bps - 1); 40011798: d4 17 40 00 lduh [ %i5 ], %o2 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); 4001179c: 93 36 80 09 srl %i2, %o1, %o1 byte = start & (fs_info->vol.bps - 1); 400117a0: 94 02 bf ff add %o2, -1, %o2 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); 400117a4: 92 02 00 09 add %o0, %o1, %o1 byte = start & (fs_info->vol.bps - 1); ret = _fat_block_read(fs_info, sec, byte, count, buf); 400117a8: 94 0e 80 0a and %i2, %o2, %o2 400117ac: 90 10 00 1d mov %i5, %o0 400117b0: 96 10 00 1b mov %i3, %o3 400117b4: 40 00 03 13 call 40012400 <_fat_block_read> 400117b8: 98 10 00 1c mov %i4, %o4 if ( ret < 0 ) 400117bc: 80 a2 20 00 cmp %o0, 0 400117c0: 16 80 00 41 bge 400118c4 <== ALWAYS TAKEN 400117c4: 01 00 00 00 nop 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; 400117c8: 10 80 00 3f b 400118c4 <== NOT EXECUTED 400117cc: 90 10 3f ff mov -1, %o0 ! ffffffff <== NOT EXECUTED return ret; } cl_start = start >> fs_info->vol.bpc_log2; save_ofs = ofs = start & (fs_info->vol.bpc - 1); 400117d0: f0 17 60 06 lduh [ %i5 + 6 ], %i0 return -1; return ret; } cl_start = start >> fs_info->vol.bpc_log2; 400117d4: a5 36 80 12 srl %i2, %l2, %l2 save_ofs = ofs = start & (fs_info->vol.bpc - 1); rc = fat_file_lseek(fs_info, fat_fd, cl_start, &cur_cln); 400117d8: a6 07 bf fc add %fp, -4, %l3 400117dc: 90 10 00 1d mov %i5, %o0 400117e0: 92 10 00 19 mov %i1, %o1 400117e4: 94 10 00 12 mov %l2, %o2 400117e8: 7f ff ff 42 call 400114f0 400117ec: 96 10 00 13 mov %l3, %o3 if (rc != RC_OK) 400117f0: 90 92 60 00 orcc %o1, 0, %o0 400117f4: 12 80 00 34 bne 400118c4 <== NEVER TAKEN 400117f8: a0 10 20 00 clr %l0 return ret; } cl_start = start >> fs_info->vol.bpc_log2; save_ofs = ofs = start & (fs_info->vol.bpc - 1); 400117fc: b1 2e 20 10 sll %i0, 0x10, %i0 40011800: b1 36 20 10 srl %i0, 0x10, %i0 40011804: b0 06 3f ff add %i0, -1, %i0 40011808: b4 0e 80 18 and %i2, %i0, %i2 4001180c: b0 10 20 00 clr %i0 40011810: 10 80 00 20 b 40011890 40011814: a2 10 00 1a mov %i2, %l1 if (rc != RC_OK) return rc; while (count > 0) { c = MIN(count, (fs_info->vol.bpc - ofs)); 40011818: a0 24 00 11 sub %l0, %l1, %l0 4001181c: 80 a4 00 1b cmp %l0, %i3 40011820: 38 80 00 02 bgu,a 40011828 40011824: a0 10 00 1b mov %i3, %l0 sec = fat_cluster_num_to_sector_num(fs_info, cur_cln); 40011828: d2 07 bf fc ld [ %fp + -4 ], %o1 4001182c: 7f ff ff 12 call 40011474 40011830: 90 10 00 1d mov %i5, %o0 sec += (ofs >> fs_info->vol.sec_log2); 40011834: d2 0f 60 02 ldub [ %i5 + 2 ], %o1 byte = ofs & (fs_info->vol.bps - 1); 40011838: d4 17 40 00 lduh [ %i5 ], %o2 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); 4001183c: 93 34 40 09 srl %l1, %o1, %o1 byte = ofs & (fs_info->vol.bps - 1); 40011840: 94 02 bf ff add %o2, -1, %o2 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); 40011844: 92 02 00 09 add %o0, %o1, %o1 byte = ofs & (fs_info->vol.bps - 1); ret = _fat_block_read(fs_info, sec, byte, c, buf + cmpltd); 40011848: 94 0c 40 0a and %l1, %o2, %o2 4001184c: 90 10 00 1d mov %i5, %o0 40011850: 96 10 00 10 mov %l0, %o3 40011854: 40 00 02 eb call 40012400 <_fat_block_read> 40011858: 98 07 00 18 add %i4, %i0, %o4 if ( ret < 0 ) 4001185c: 80 a2 20 00 cmp %o0, 0 40011860: 06 80 00 18 bl 400118c0 <== NEVER TAKEN 40011864: b6 26 c0 10 sub %i3, %l0, %i3 return -1; count -= c; cmpltd += c; 40011868: b0 06 00 10 add %i0, %l0, %i0 save_cln = cur_cln; 4001186c: e0 07 bf fc ld [ %fp + -4 ], %l0 rc = fat_get_fat_cluster(fs_info, cur_cln, &cur_cln); 40011870: 90 10 00 1d mov %i5, %o0 40011874: 92 10 00 10 mov %l0, %o1 40011878: 94 10 00 13 mov %l3, %o2 4001187c: 40 00 19 e2 call 40018004 40011880: a2 10 20 00 clr %l1 if ( rc != RC_OK ) 40011884: 80 a2 20 00 cmp %o0, 0 40011888: 12 80 00 0f bne 400118c4 <== NEVER TAKEN 4001188c: 01 00 00 00 nop rc = fat_file_lseek(fs_info, fat_fd, cl_start, &cur_cln); if (rc != RC_OK) return rc; while (count > 0) 40011890: 80 a6 e0 00 cmp %i3, 0 40011894: 32 bf ff e1 bne,a 40011818 40011898: e0 17 60 06 lduh [ %i5 + 6 ], %l0 } /* 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); 4001189c: c2 0f 60 08 ldub [ %i5 + 8 ], %g1 400118a0: b4 06 bf ff add %i2, -1, %i2 fat_fd->map.disk_cln = save_cln; 400118a4: e0 26 60 38 st %l0, [ %i1 + 0x38 ] } /* 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); 400118a8: b4 06 80 18 add %i2, %i0, %i2 fat_fd->map.disk_cln = save_cln; return cmpltd; 400118ac: 90 10 00 18 mov %i0, %o0 } /* 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); 400118b0: b5 36 80 01 srl %i2, %g1, %i2 ofs = 0; } /* update cache */ /* XXX: check this - I'm not sure :( */ fat_fd->map.file_cln = cl_start + 400118b4: a4 06 80 12 add %i2, %l2, %l2 400118b8: 10 80 00 03 b 400118c4 400118bc: e4 26 60 34 st %l2, [ %i1 + 0x34 ] 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; 400118c0: 90 10 3f ff mov -1, %o0 <== NOT EXECUTED fat_fd->map.file_cln = cl_start + ((save_ofs + cmpltd - 1) >> fs_info->vol.bpc_log2); fat_fd->map.disk_cln = save_cln; return cmpltd; } 400118c4: 81 c7 e0 08 ret 400118c8: 91 e8 00 08 restore %g0, %o0, %o0 =============================================================================== 4001203c : int fat_file_size( fat_fs_info_t *fs_info, fat_file_fd_t *fat_fd ) { 4001203c: 9d e3 bf 98 save %sp, -104, %sp int rc = RC_OK; uint32_t cur_cln = fat_fd->cln; 40012040: c2 06 60 1c ld [ %i1 + 0x1c ], %g1 40012044: c2 27 bf fc st %g1, [ %fp + -4 ] uint32_t save_cln = 0; /* Have we requested root dir size for FAT12/16? */ if ((FAT_FD_OF_ROOT_DIR(fat_fd)) && 40012048: c2 06 60 20 ld [ %i1 + 0x20 ], %g1 4001204c: 80 a0 60 01 cmp %g1, 1 40012050: 12 80 00 0d bne 40012084 40012054: ba 10 00 18 mov %i0, %i5 40012058: c2 06 60 24 ld [ %i1 + 0x24 ], %g1 4001205c: 80 a0 60 00 cmp %g1, 0 40012060: 32 80 00 0a bne,a 40012088 <== NEVER TAKEN 40012064: c0 26 60 18 clr [ %i1 + 0x18 ] <== NOT EXECUTED (fs_info->vol.type & (FAT_FAT12 | FAT_FAT16))) 40012068: c2 0e 20 0e ldub [ %i0 + 0xe ], %g1 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)) && 4001206c: 80 88 60 03 btst 3, %g1 40012070: 22 80 00 06 be,a 40012088 <== ALWAYS TAKEN 40012074: c0 26 60 18 clr [ %i1 + 0x18 ] (fs_info->vol.type & (FAT_FAT12 | FAT_FAT16))) { fat_fd->fat_file_size = fs_info->vol.rdir_size; 40012078: c2 06 20 2c ld [ %i0 + 0x2c ], %g1 <== NOT EXECUTED 4001207c: 10 80 00 18 b 400120dc <== NOT EXECUTED 40012080: c2 26 60 18 st %g1, [ %i1 + 0x18 ] <== NOT EXECUTED return rc; } fat_fd->fat_file_size = 0; 40012084: c0 26 60 18 clr [ %i1 + 0x18 ] while ((cur_cln & fs_info->vol.mask) < fs_info->vol.eoc_val) 40012088: 10 80 00 0d b 400120bc 4001208c: 82 10 20 00 clr %g1 { save_cln = cur_cln; rc = fat_get_fat_cluster(fs_info, cur_cln, &cur_cln); 40012090: 92 10 00 1c mov %i4, %o1 40012094: 40 00 17 dc call 40018004 40012098: 94 07 bf fc add %fp, -4, %o2 if ( rc != RC_OK ) 4001209c: b0 92 20 00 orcc %o0, 0, %i0 400120a0: 12 80 00 10 bne 400120e0 <== NEVER TAKEN 400120a4: 01 00 00 00 nop return rc; fat_fd->fat_file_size += fs_info->vol.bpc; 400120a8: c2 17 60 06 lduh [ %i5 + 6 ], %g1 400120ac: c4 06 60 18 ld [ %i1 + 0x18 ], %g2 400120b0: 82 00 80 01 add %g2, %g1, %g1 400120b4: c2 26 60 18 st %g1, [ %i1 + 0x18 ] fat_fd->fat_file_size = 0; while ((cur_cln & fs_info->vol.mask) < fs_info->vol.eoc_val) { save_cln = cur_cln; 400120b8: 82 10 00 1c mov %i4, %g1 return rc; } fat_fd->fat_file_size = 0; while ((cur_cln & fs_info->vol.mask) < fs_info->vol.eoc_val) 400120bc: f8 07 bf fc ld [ %fp + -4 ], %i4 400120c0: c6 07 60 10 ld [ %i5 + 0x10 ], %g3 400120c4: c4 07 60 14 ld [ %i5 + 0x14 ], %g2 400120c8: 86 0f 00 03 and %i4, %g3, %g3 400120cc: 80 a0 c0 02 cmp %g3, %g2 400120d0: 0a bf ff f0 bcs 40012090 400120d4: 90 10 00 1d mov %i5, %o0 if ( rc != RC_OK ) return rc; fat_fd->fat_file_size += fs_info->vol.bpc; } fat_fd->map.last_cln = save_cln; 400120d8: c2 26 60 3c st %g1, [ %i1 + 0x3c ] 400120dc: b0 10 20 00 clr %i0 return rc; } 400120e0: 81 c7 e0 08 ret 400120e4: 81 e8 00 00 restore =============================================================================== 400118cc : fat_file_truncate( fat_fs_info_t *fs_info, fat_file_fd_t *fat_fd, uint32_t new_length ) { 400118cc: 9d e3 bf 98 save %sp, -104, %sp int rc = RC_OK; uint32_t cur_cln = 0; uint32_t cl_start = 0; uint32_t new_last_cln = FAT_UNDEFINED_VALUE; 400118d0: 82 10 3f ff mov -1, %g1 400118d4: c2 27 bf fc st %g1, [ %fp + -4 ] if ( new_length >= fat_fd->fat_file_size ) 400118d8: c2 06 60 18 ld [ %i1 + 0x18 ], %g1 400118dc: 80 a6 80 01 cmp %i2, %g1 400118e0: 0a 80 00 04 bcs 400118f0 400118e4: c0 27 bf f8 clr [ %fp + -8 ] return rc; 400118e8: 10 80 00 3b b 400119d4 400118ec: 92 10 20 00 clr %o1 assert(fat_fd->fat_file_size); 400118f0: 80 a0 60 00 cmp %g1, 0 400118f4: 32 80 00 0a bne,a 4001191c <== ALWAYS TAKEN 400118f8: c4 0e 20 08 ldub [ %i0 + 8 ], %g2 400118fc: 11 10 00 a9 sethi %hi(0x4002a400), %o0 <== NOT EXECUTED 40011900: 15 10 00 a9 sethi %hi(0x4002a400), %o2 <== NOT EXECUTED 40011904: 17 10 00 a9 sethi %hi(0x4002a400), %o3 <== NOT EXECUTED 40011908: 90 12 20 e8 or %o0, 0xe8, %o0 <== NOT EXECUTED 4001190c: 92 10 22 d1 mov 0x2d1, %o1 <== NOT EXECUTED 40011910: 94 12 a1 48 or %o2, 0x148, %o2 <== NOT EXECUTED 40011914: 7f ff cc 15 call 40004968 <__assert_func> <== NOT EXECUTED 40011918: 96 12 e1 30 or %o3, 0x130, %o3 <== NOT EXECUTED cl_start = (new_length + fs_info->vol.bpc - 1) >> fs_info->vol.bpc_log2; 4001191c: c6 16 20 06 lduh [ %i0 + 6 ], %g3 40011920: 86 00 ff ff add %g3, -1, %g3 40011924: b4 00 c0 1a add %g3, %i2, %i2 40011928: b5 36 80 02 srl %i2, %g2, %i2 if ((cl_start << fs_info->vol.bpc_log2) >= fat_fd->fat_file_size) 4001192c: 85 2e 80 02 sll %i2, %g2, %g2 40011930: 80 a0 80 01 cmp %g2, %g1 40011934: 1a bf ff ed bcc 400118e8 40011938: 80 a6 a0 00 cmp %i2, 0 return RC_OK; if (cl_start != 0) 4001193c: 12 80 00 0b bne 40011968 40011940: 90 10 00 18 mov %i0, %o0 if (rc != RC_OK) return rc; } rc = fat_file_lseek(fs_info, fat_fd, cl_start, &cur_cln); 40011944: 92 10 00 19 mov %i1, %o1 40011948: 94 10 00 1a mov %i2, %o2 4001194c: 7f ff fe e9 call 400114f0 40011950: 96 07 bf f8 add %fp, -8, %o3 if (rc != RC_OK) 40011954: 80 a2 60 00 cmp %o1, 0 40011958: 32 80 00 20 bne,a 400119d8 <== NEVER TAKEN 4001195c: b0 10 00 09 mov %o1, %i0 <== NOT EXECUTED return rc; rc = fat_free_fat_clusters_chain(fs_info, cur_cln); 40011960: 10 80 00 0b b 4001198c 40011964: d2 07 bf f8 ld [ %fp + -8 ], %o1 if ((cl_start << fs_info->vol.bpc_log2) >= fat_fd->fat_file_size) return RC_OK; if (cl_start != 0) { rc = fat_file_lseek(fs_info, fat_fd, cl_start - 1, &new_last_cln); 40011968: 92 10 00 19 mov %i1, %o1 4001196c: 94 06 bf ff add %i2, -1, %o2 40011970: 7f ff fe e0 call 400114f0 40011974: 96 07 bf fc add %fp, -4, %o3 if (rc != RC_OK) 40011978: 80 a2 60 00 cmp %o1, 0 4001197c: 02 bf ff f2 be 40011944 <== ALWAYS TAKEN 40011980: 90 10 00 18 mov %i0, %o0 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; } 40011984: 81 c7 e0 08 ret <== NOT EXECUTED 40011988: 91 e8 00 09 restore %g0, %o1, %o0 <== NOT EXECUTED 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); 4001198c: 40 00 1a b1 call 40018450 40011990: 90 10 00 18 mov %i0, %o0 if (rc != RC_OK) 40011994: 92 92 20 00 orcc %o0, 0, %o1 40011998: 12 80 00 0f bne 400119d4 <== NEVER TAKEN 4001199c: 80 a6 a0 00 cmp %i2, 0 return rc; if (cl_start != 0) 400119a0: 02 80 00 0d be 400119d4 400119a4: 92 10 20 00 clr %o1 { rc = fat_set_fat_cluster(fs_info, new_last_cln, FAT_GENFAT_EOC); 400119a8: d2 07 bf fc ld [ %fp + -4 ], %o1 400119ac: 90 10 00 18 mov %i0, %o0 400119b0: 40 00 1a 07 call 400181cc 400119b4: 94 10 3f ff mov -1, %o2 if ( rc != RC_OK ) 400119b8: 92 92 20 00 orcc %o0, 0, %o1 400119bc: 12 80 00 06 bne 400119d4 <== NEVER TAKEN 400119c0: c2 07 bf fc ld [ %fp + -4 ], %g1 return rc; fat_fd->map.file_cln = cl_start - 1; 400119c4: b4 06 bf ff add %i2, -1, %i2 fat_fd->map.disk_cln = new_last_cln; 400119c8: c2 26 60 38 st %g1, [ %i1 + 0x38 ] 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; 400119cc: f4 26 60 34 st %i2, [ %i1 + 0x34 ] fat_fd->map.disk_cln = new_last_cln; fat_fd->map.last_cln = new_last_cln; 400119d0: c2 26 60 3c st %g1, [ %i1 + 0x3c ] } return RC_OK; } 400119d4: b0 10 00 09 mov %o1, %i0 400119d8: 81 c7 e0 08 ret 400119dc: 81 e8 00 00 restore =============================================================================== 40011dbc : fat_file_fd_t *fat_fd, uint32_t start, uint32_t count, const uint8_t *buf ) { 40011dbc: 9d e3 bf 98 save %sp, -104, %sp int rc = RC_OK; ssize_t ret; uint32_t cmpltd = 0; uint32_t byte; uint32_t c = 0; 40011dc0: c0 27 bf f8 clr [ %fp + -8 ] fat_file_fd_t *fat_fd, uint32_t start, uint32_t count, const uint8_t *buf ) { 40011dc4: a0 10 00 18 mov %i0, %l0 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; 40011dc8: c2 06 60 18 ld [ %i1 + 0x18 ], %g1 uint32_t file_cln_initial = fat_fd->map.file_cln; 40011dcc: e6 06 60 34 ld [ %i1 + 0x34 ], %l3 uint32_t cln; if ( count == 0 ) 40011dd0: 80 a6 e0 00 cmp %i3, 0 40011dd4: 02 80 00 84 be 40011fe4 <== NEVER TAKEN 40011dd8: 90 10 20 00 clr %o0 return cmpltd; if (start >= fat_fd->size_limit) 40011ddc: fa 06 60 14 ld [ %i1 + 0x14 ], %i5 40011de0: 80 a6 80 1d cmp %i2, %i5 40011de4: 2a 80 00 07 bcs,a 40011e00 <== ALWAYS TAKEN 40011de8: ba 27 40 1a sub %i5, %i2, %i5 rtems_set_errno_and_return_minus_one(EFBIG); 40011dec: 40 00 1f 50 call 40019b2c <__errno> <== NOT EXECUTED 40011df0: 01 00 00 00 nop <== NOT EXECUTED 40011df4: 82 10 20 1b mov 0x1b, %g1 ! 1b <== NOT EXECUTED 40011df8: 10 80 00 30 b 40011eb8 <== NOT EXECUTED 40011dfc: c2 22 00 00 st %g1, [ %o0 ] <== NOT EXECUTED 40011e00: 80 a7 40 1b cmp %i5, %i3 40011e04: 38 80 00 02 bgu,a 40011e0c <== ALWAYS TAKEN 40011e08: ba 10 00 1b mov %i3, %i5 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; 40011e0c: 80 a0 40 1a cmp %g1, %i2 rtems_set_errno_and_return_minus_one(EFBIG); 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); 40011e10: b6 07 40 1a add %i5, %i2, %i3 40011e14: 94 40 20 00 addx %g0, 0, %o2 40011e18: 90 10 00 10 mov %l0, %o0 40011e1c: 92 10 00 19 mov %i1, %o1 40011e20: 96 10 00 1b mov %i3, %o3 40011e24: 7f ff ff 50 call 40011b64 40011e28: 98 07 bf f8 add %fp, -8, %o4 if (RC_OK == rc) 40011e2c: 80 a2 20 00 cmp %o0, 0 40011e30: 12 80 00 6d bne 40011fe4 40011e34: c2 07 bf f8 ld [ %fp + -8 ], %g1 { /* * check whether there was enough room on device to locate * file of 'start + count' bytes */ if (c != (start + count)) 40011e38: 80 a0 40 1b cmp %g1, %i3 40011e3c: 32 80 00 02 bne,a 40011e44 <== NEVER TAKEN 40011e40: ba 20 40 1a sub %g1, %i2, %i5 <== 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)); 40011e44: c6 06 60 20 ld [ %i1 + 0x20 ], %g3 */ 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)) 40011e48: c4 0c 20 0e ldub [ %l0 + 0xe ], %g2 */ 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)); 40011e4c: 80 a0 e0 01 cmp %g3, 1 40011e50: 12 80 00 09 bne 40011e74 40011e54: 82 10 20 00 clr %g1 40011e58: c6 06 60 24 ld [ %i1 + 0x24 ], %g3 40011e5c: 80 a0 e0 00 cmp %g3, 0 40011e60: 12 80 00 06 bne 40011e78 <== NEVER TAKEN 40011e64: 80 a0 60 00 cmp %g1, 0 40011e68: 82 08 a0 03 and %g2, 3, %g1 40011e6c: 80 a0 00 01 cmp %g0, %g1 40011e70: 82 40 20 00 addx %g0, 0, %g1 */ 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)) 40011e74: 80 a0 60 00 cmp %g1, 0 40011e78: 02 80 00 12 be 40011ec0 40011e7c: f6 0c 20 08 ldub [ %l0 + 8 ], %i3 { cln = fat_fd->cln; 40011e80: d2 06 60 1c ld [ %i1 + 0x1c ], %o1 cln += (start >> fs_info->vol.bpc_log2); byte = start & (fs_info->vol.bpc -1); 40011e84: d4 14 20 06 lduh [ %l0 + 6 ], %o2 /* 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); 40011e88: b7 36 80 1b srl %i2, %i3, %i3 byte = start & (fs_info->vol.bpc -1); 40011e8c: 94 02 bf ff add %o2, -1, %o2 ret = fat_cluster_write(fs_info, 40011e90: 90 10 00 10 mov %l0, %o0 40011e94: 92 06 c0 09 add %i3, %o1, %o1 40011e98: 94 0e 80 0a and %i2, %o2, %o2 40011e9c: 96 10 00 1d mov %i5, %o3 40011ea0: 98 10 00 1c mov %i4, %o4 40011ea4: 40 00 01 e5 call 40012638 40011ea8: 9a 10 20 00 clr %o5 cln, byte, count, buf, false); if (0 > ret) 40011eac: 80 a2 20 00 cmp %o0, 0 40011eb0: 16 80 00 4d bge 40011fe4 <== ALWAYS TAKEN 40011eb4: 01 00 00 00 nop rc = -1; 40011eb8: 10 80 00 4b b 40011fe4 <== NOT EXECUTED 40011ebc: 90 10 3f ff mov -1, %o0 ! ffffffff <== NOT EXECUTED const uint8_t *buf, const uint32_t file_cln_initial) { int rc = RC_OK; uint32_t cmpltd = 0; uint32_t cur_cln = 0; 40011ec0: c0 27 bf fc clr [ %fp + -4 ] uint32_t save_cln = 0; /* FIXME: This might be incorrect, cf. below */ uint32_t start_cln = start >> fs_info->vol.bpc_log2; 40011ec4: b6 0e e0 ff and %i3, 0xff, %i3 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); 40011ec8: aa 07 bf fc add %fp, -4, %l5 { 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; 40011ecc: a3 36 80 1b srl %i2, %i3, %l1 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); 40011ed0: 90 10 00 10 mov %l0, %o0 40011ed4: 92 10 00 19 mov %i1, %o1 40011ed8: 94 10 00 11 mov %l1, %o2 40011edc: 7f ff fd 85 call 400114f0 40011ee0: 96 10 00 15 mov %l5, %o3 if (RC_OK == rc) 40011ee4: 80 a2 60 00 cmp %o1, 0 40011ee8: 12 80 00 34 bne 40011fb8 <== NEVER TAKEN 40011eec: b7 2c 40 1b sll %l1, %i3, %i3 { file_cln_cnt = cur_cln - fat_fd->cln; 40011ef0: c2 06 60 1c ld [ %i1 + 0x1c ], %g1 40011ef4: e4 07 bf fc ld [ %fp + -4 ], %l2 40011ef8: a4 24 80 01 sub %l2, %g1, %l2 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); 40011efc: b4 26 80 1b sub %i2, %i3, %i2 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; 40011f00: 90 10 20 00 clr %o0 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); 40011f04: b0 10 00 1a mov %i2, %i0 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; 40011f08: a8 10 20 00 clr %l4 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 */ 40011f0c: ac 10 20 00 clr %l6 const uint32_t count, const uint8_t *buf, const uint32_t file_cln_initial) { int rc = RC_OK; uint32_t cmpltd = 0; 40011f10: 10 80 00 1a b 40011f78 40011f14: b6 10 20 00 clr %i3 { file_cln_cnt = cur_cln - fat_fd->cln; while ( (RC_OK == rc) && (bytes_to_write > 0)) { c = MIN(bytes_to_write, (fs_info->vol.bpc - ofs_cln)); 40011f18: 96 22 c0 18 sub %o3, %i0, %o3 40011f1c: 80 a2 c0 1d cmp %o3, %i5 40011f20: 38 80 00 02 bgu,a 40011f28 40011f24: 96 10 00 1d mov %i5, %o3 if (file_cln_initial < file_cln_cnt) 40011f28: 80 a4 c0 12 cmp %l3, %l2 40011f2c: 2a 80 00 02 bcs,a 40011f34 40011f30: a8 10 20 01 mov 1, %l4 overwrite_cluster = true; ret = fat_cluster_write(fs_info, 40011f34: d2 07 bf fc ld [ %fp + -4 ], %o1 40011f38: 90 10 00 10 mov %l0, %o0 40011f3c: 94 10 00 18 mov %i0, %o2 40011f40: 98 07 00 1b add %i4, %i3, %o4 40011f44: 40 00 01 bd call 40012638 40011f48: 9a 0d 20 01 and %l4, 1, %o5 40011f4c: 82 10 00 08 mov %o0, %g1 cur_cln, ofs_cln, c, &buf[cmpltd], overwrite_cluster); if (0 > ret) 40011f50: 80 a0 60 00 cmp %g1, 0 40011f54: 16 80 00 1d bge 40011fc8 <== ALWAYS TAKEN 40011f58: 90 10 3f ff mov -1, %o0 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) 40011f5c: 10 80 00 08 b 40011f7c <== NOT EXECUTED 40011f60: 80 a7 60 00 cmp %i5, 0 <== NOT EXECUTED ++file_cln_cnt; bytes_to_write -= ret; cmpltd += ret; save_cln = cur_cln; if (0 < bytes_to_write) rc = fat_get_fat_cluster(fs_info, cur_cln, &cur_cln); 40011f64: 90 10 00 10 mov %l0, %o0 40011f68: 92 10 00 16 mov %l6, %o1 40011f6c: 40 00 18 26 call 40018004 40011f70: 94 10 00 15 mov %l5, %o2 ofs_cln = 0; 40011f74: b0 10 20 00 clr %i0 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) 40011f78: 80 a7 60 00 cmp %i5, 0 40011f7c: 02 80 00 04 be 40011f8c 40011f80: 80 a2 20 00 cmp %o0, 0 40011f84: 22 bf ff e5 be,a 40011f18 <== ALWAYS TAKEN 40011f88: d6 14 20 06 lduh [ %l0 + 6 ], %o3 } /* 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); 40011f8c: c2 0c 20 08 ldub [ %l0 + 8 ], %g1 40011f90: b4 06 bf ff add %i2, -1, %i2 fat_fd->map.disk_cln = save_cln; 40011f94: ec 26 60 38 st %l6, [ %i1 + 0x38 ] } /* 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); 40011f98: b4 06 80 1b add %i2, %i3, %i2 40011f9c: b5 36 80 01 srl %i2, %g1, %i2 } } /* update cache */ /* XXX: check this - I'm not sure :( */ fat_fd->map.file_cln = start_cln + 40011fa0: a2 06 80 11 add %i2, %l1, %l1 ((ofs_cln_save + cmpltd - 1) >> fs_info->vol.bpc_log2); fat_fd->map.disk_cln = save_cln; } if (RC_OK != rc) 40011fa4: 92 92 20 00 orcc %o0, 0, %o1 40011fa8: 12 80 00 03 bne 40011fb4 <== NEVER TAKEN 40011fac: e2 26 60 34 st %l1, [ %i1 + 0x34 ] return rc; else return cmpltd; 40011fb0: 92 10 00 1b mov %i3, %o1 fat_fd, start, count, buf, file_cln_initial); if (0 > ret) 40011fb4: 80 a2 60 00 cmp %o1, 0 40011fb8: 16 80 00 0b bge 40011fe4 <== ALWAYS TAKEN 40011fbc: 90 10 00 09 mov %o1, %o0 40011fc0: 10 80 00 09 b 40011fe4 <== NOT EXECUTED 40011fc4: 90 10 3f ff mov -1, %o0 <== NOT EXECUTED if (0 > ret) rc = -1; if (RC_OK == rc) { ++file_cln_cnt; 40011fc8: a4 04 a0 01 inc %l2 bytes_to_write -= ret; cmpltd += ret; 40011fcc: b6 06 c0 01 add %i3, %g1, %i3 save_cln = cur_cln; if (0 < bytes_to_write) 40011fd0: ba a7 40 01 subcc %i5, %g1, %i5 40011fd4: 12 bf ff e4 bne 40011f64 40011fd8: ec 07 bf fc ld [ %fp + -4 ], %l6 40011fdc: 10 bf ff e6 b 40011f74 40011fe0: 90 10 20 00 clr %o0 } if (RC_OK != rc) return rc; else return cmpltd; } 40011fe4: 81 c7 e0 08 ret 40011fe8: 91 e8 00 08 restore %g0, %o0, %o0 =============================================================================== 40018450 : int fat_free_fat_clusters_chain( fat_fs_info_t *fs_info, uint32_t chain ) { 40018450: 9d e3 bf 98 save %sp, -104, %sp int rc = RC_OK, rc1 = RC_OK; uint32_t cur_cln = chain; uint32_t next_cln = 0; uint32_t freed_cls_cnt = 0; 40018454: b8 10 20 00 clr %i4 int fat_free_fat_clusters_chain( fat_fs_info_t *fs_info, uint32_t chain ) { 40018458: ba 10 00 18 mov %i0, %i5 int rc = RC_OK, rc1 = RC_OK; uint32_t cur_cln = chain; uint32_t next_cln = 0; 4001845c: c0 27 bf fc clr [ %fp + -4 ] fat_fs_info_t *fs_info, uint32_t chain ) { int rc = RC_OK, rc1 = RC_OK; uint32_t cur_cln = chain; 40018460: b6 10 00 19 mov %i1, %i3 uint32_t next_cln = 0; uint32_t freed_cls_cnt = 0; while ((cur_cln & fs_info->vol.mask) < fs_info->vol.eoc_val) 40018464: 10 80 00 19 b 400184c8 40018468: b4 10 20 00 clr %i2 { rc = fat_get_fat_cluster(fs_info, cur_cln, &next_cln); 4001846c: 92 10 00 1b mov %i3, %o1 40018470: 7f ff fe e5 call 40018004 40018474: 94 07 bf fc add %fp, -4, %o2 if ( rc != RC_OK ) 40018478: b0 92 20 00 orcc %o0, 0, %i0 4001847c: 02 80 00 0b be 400184a8 <== ALWAYS TAKEN 40018480: 90 10 00 1d mov %i5, %o0 { if(fs_info->vol.free_cls != FAT_UNDEFINED_VALUE) 40018484: c2 07 60 44 ld [ %i5 + 0x44 ], %g1 <== NOT EXECUTED 40018488: 80 a0 7f ff cmp %g1, -1 <== NOT EXECUTED 4001848c: 02 80 00 03 be 40018498 <== NOT EXECUTED 40018490: b8 07 00 01 add %i4, %g1, %i4 <== NOT EXECUTED fs_info->vol.free_cls += freed_cls_cnt; 40018494: f8 27 60 44 st %i4, [ %i5 + 0x44 ] <== NOT EXECUTED fat_buf_release(fs_info); 40018498: 7f ff e7 37 call 40012174 <== NOT EXECUTED 4001849c: 90 10 00 1d mov %i5, %o0 <== NOT EXECUTED 400184a0: 81 c7 e0 08 ret <== NOT EXECUTED 400184a4: 81 e8 00 00 restore <== NOT EXECUTED return rc; } rc = fat_set_fat_cluster(fs_info, cur_cln, FAT_GENFAT_FREE); 400184a8: 92 10 00 1b mov %i3, %o1 400184ac: 7f ff ff 48 call 400181cc 400184b0: 94 10 20 00 clr %o2 if ( rc != RC_OK ) 400184b4: 80 a2 20 00 cmp %o0, 0 400184b8: 32 80 00 02 bne,a 400184c0 <== NEVER TAKEN 400184bc: b4 10 00 08 mov %o0, %i2 <== NOT EXECUTED rc1 = rc; freed_cls_cnt++; cur_cln = next_cln; 400184c0: f6 07 bf fc ld [ %fp + -4 ], %i3 rc = fat_set_fat_cluster(fs_info, cur_cln, FAT_GENFAT_FREE); if ( rc != RC_OK ) rc1 = rc; freed_cls_cnt++; 400184c4: b8 07 20 01 inc %i4 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) 400184c8: c4 07 60 10 ld [ %i5 + 0x10 ], %g2 400184cc: c2 07 60 14 ld [ %i5 + 0x14 ], %g1 400184d0: 84 0e c0 02 and %i3, %g2, %g2 400184d4: 80 a0 80 01 cmp %g2, %g1 400184d8: 0a bf ff e5 bcs 4001846c 400184dc: 90 10 00 1d mov %i5, %o0 freed_cls_cnt++; cur_cln = next_cln; } fs_info->vol.next_cl = chain; if (fs_info->vol.free_cls != FAT_UNDEFINED_VALUE) 400184e0: c2 07 60 44 ld [ %i5 + 0x44 ], %g1 400184e4: 80 a0 7f ff cmp %g1, -1 400184e8: 02 80 00 05 be 400184fc <== ALWAYS TAKEN 400184ec: f2 27 60 4c st %i1, [ %i5 + 0x4c ] fs_info->vol.free_cls += freed_cls_cnt; 400184f0: b8 07 00 01 add %i4, %g1, %i4 <== NOT EXECUTED 400184f4: f8 27 60 44 st %i4, [ %i5 + 0x44 ] <== NOT EXECUTED fat_buf_release(fs_info); 400184f8: 90 10 00 1d mov %i5, %o0 <== NOT EXECUTED 400184fc: 7f ff e7 1e call 40012174 40018500: b0 10 00 1a mov %i2, %i0 if (rc1 != RC_OK) return rc1; return RC_OK; } 40018504: 81 c7 e0 08 ret 40018508: 81 e8 00 00 restore =============================================================================== 4001320c : fat_free_unique_ino( fat_fs_info_t *fs_info, uint32_t ino ) { FAT_SET_UNIQ_INO_FREE((ino - fs_info->uino_base), fs_info->uino); 4001320c: c2 02 20 80 ld [ %o0 + 0x80 ], %g1 <== NOT EXECUTED 40013210: c4 02 20 74 ld [ %o0 + 0x74 ], %g2 <== NOT EXECUTED 40013214: 86 10 20 01 mov 1, %g3 <== NOT EXECUTED 40013218: 92 22 40 01 sub %o1, %g1, %o1 <== NOT EXECUTED 4001321c: 83 32 60 03 srl %o1, 3, %g1 <== NOT EXECUTED 40013220: 92 0a 60 07 and %o1, 7, %o1 <== NOT EXECUTED 40013224: 93 28 c0 09 sll %g3, %o1, %o1 <== NOT EXECUTED 40013228: c6 08 80 01 ldub [ %g2 + %g1 ], %g3 <== NOT EXECUTED 4001322c: 92 28 c0 09 andn %g3, %o1, %o1 <== NOT EXECUTED 40013230: 81 c3 e0 08 retl <== NOT EXECUTED 40013234: d2 28 80 01 stb %o1, [ %g2 + %g1 ] <== NOT EXECUTED =============================================================================== 40018004 : fat_get_fat_cluster( fat_fs_info_t *fs_info, uint32_t cln, uint32_t *ret_val ) { 40018004: 9d e3 bf 98 save %sp, -104, %sp uint8_t *sec_buf; uint32_t sec = 0; uint32_t ofs = 0; /* sanity check */ if ( (cln < 2) || (cln > (fs_info->vol.data_cls + 1)) ) 40018008: 80 a6 60 01 cmp %i1, 1 4001800c: 08 80 00 67 bleu 400181a8 <== NEVER TAKEN 40018010: ba 10 00 18 mov %i0, %i5 40018014: c2 06 20 38 ld [ %i0 + 0x38 ], %g1 40018018: 82 00 60 01 inc %g1 4001801c: 80 a6 40 01 cmp %i1, %g1 40018020: 28 80 00 03 bleu,a 4001802c <== ALWAYS TAKEN 40018024: c2 0e 20 0e ldub [ %i0 + 0xe ], %g1 40018028: 30 80 00 60 b,a 400181a8 <== NOT EXECUTED rtems_set_errno_and_return_minus_one(EIO); sec = (FAT_FAT_OFFSET(fs_info->vol.type, cln) >> fs_info->vol.sec_log2) + 4001802c: 86 08 60 01 and %g1, 1, %g3 40018030: 80 88 e0 ff btst 0xff, %g3 40018034: 02 80 00 05 be 40018048 40018038: 88 08 60 02 and %g1, 2, %g4 4001803c: 85 36 60 01 srl %i1, 1, %g2 40018040: 10 80 00 06 b 40018058 40018044: 84 00 80 19 add %g2, %i1, %g2 40018048: 80 89 20 ff btst 0xff, %g4 4001804c: 02 80 00 03 be 40018058 40018050: 85 2e 60 02 sll %i1, 2, %g2 40018054: 85 2e 60 01 sll %i1, 1, %g2 40018058: f6 0f 60 02 ldub [ %i5 + 2 ], %i3 4001805c: c8 07 60 58 ld [ %i5 + 0x58 ], %g4 40018060: 85 30 80 1b srl %g2, %i3, %g2 fs_info->vol.afat_loc; ofs = FAT_FAT_OFFSET(fs_info->vol.type, cln) & (fs_info->vol.bps - 1); 40018064: 80 88 e0 ff btst 0xff, %g3 40018068: 02 80 00 05 be 4001807c 4001806c: b6 00 80 04 add %g2, %g4, %i3 40018070: b9 36 60 01 srl %i1, 1, %i4 40018074: 10 80 00 07 b 40018090 40018078: b8 07 00 19 add %i4, %i1, %i4 4001807c: 82 08 60 02 and %g1, 2, %g1 40018080: 80 88 60 ff btst 0xff, %g1 40018084: 02 80 00 03 be 40018090 40018088: b9 2e 60 02 sll %i1, 2, %i4 4001808c: b9 2e 60 01 sll %i1, 1, %i4 40018090: e0 17 40 00 lduh [ %i5 ], %l0 rc = fat_buf_access(fs_info, sec, FAT_OP_TYPE_READ, &sec_buf); 40018094: 90 10 00 1d mov %i5, %o0 40018098: 92 10 00 1b mov %i3, %o1 4001809c: 94 10 20 01 mov 1, %o2 400180a0: 7f ff e8 a9 call 40012344 400180a4: 96 07 bf fc add %fp, -4, %o3 if (rc != RC_OK) 400180a8: b0 92 20 00 orcc %o0, 0, %i0 400180ac: 12 80 00 37 bne 40018188 <== NEVER TAKEN 400180b0: 83 2c 20 10 sll %l0, 0x10, %g1 return rc; switch ( fs_info->vol.type ) 400180b4: c4 0f 60 0e ldub [ %i5 + 0xe ], %g2 400180b8: 80 a0 a0 02 cmp %g2, 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); 400180bc: 83 30 60 10 srl %g1, 0x10, %g1 400180c0: 82 00 7f ff add %g1, -1, %g1 rc = fat_buf_access(fs_info, sec, FAT_OP_TYPE_READ, &sec_buf); if (rc != RC_OK) return rc; switch ( fs_info->vol.type ) 400180c4: 02 80 00 27 be 40018160 400180c8: 82 0f 00 01 and %i4, %g1, %g1 400180cc: 80 a0 a0 04 cmp %g2, 4 400180d0: 02 80 00 30 be 40018190 400180d4: 80 a0 a0 01 cmp %g2, 1 400180d8: 12 80 00 34 bne 400181a8 <== NEVER TAKEN 400180dc: c6 07 bf fc ld [ %fp + -4 ], %g3 /* * we are enforced in complex computations for FAT12 to escape CPU * align problems for some architectures */ *ret_val = (*(sec_buf + ofs)); if ( ofs == (fs_info->vol.bps - 1) ) 400180e0: c8 17 40 00 lduh [ %i5 ], %g4 case FAT_FAT12: /* * we are enforced in complex computations for FAT12 to escape CPU * align problems for some architectures */ *ret_val = (*(sec_buf + ofs)); 400180e4: c4 08 c0 01 ldub [ %g3 + %g1 ], %g2 if ( ofs == (fs_info->vol.bps - 1) ) 400180e8: 88 01 3f ff add %g4, -1, %g4 400180ec: 80 a0 40 04 cmp %g1, %g4 400180f0: 12 80 00 10 bne 40018130 <== ALWAYS TAKEN 400180f4: c4 26 80 00 st %g2, [ %i2 ] { rc = fat_buf_access(fs_info, sec + 1, FAT_OP_TYPE_READ, 400180f8: 90 10 00 1d mov %i5, %o0 <== NOT EXECUTED 400180fc: 92 06 e0 01 add %i3, 1, %o1 <== NOT EXECUTED 40018100: 94 10 20 01 mov 1, %o2 <== NOT EXECUTED 40018104: 7f ff e8 90 call 40012344 <== NOT EXECUTED 40018108: 96 07 bf fc add %fp, -4, %o3 <== NOT EXECUTED &sec_buf); if (rc != RC_OK) 4001810c: 80 a2 20 00 cmp %o0, 0 <== NOT EXECUTED 40018110: 12 80 00 2c bne 400181c0 <== NOT EXECUTED 40018114: c2 07 bf fc ld [ %fp + -4 ], %g1 <== NOT EXECUTED return rc; *ret_val |= *sec_buf << 8; 40018118: c4 06 80 00 ld [ %i2 ], %g2 <== NOT EXECUTED 4001811c: c2 08 40 00 ldub [ %g1 ], %g1 <== NOT EXECUTED 40018120: 83 28 60 08 sll %g1, 8, %g1 <== NOT EXECUTED 40018124: 82 10 80 01 or %g2, %g1, %g1 <== NOT EXECUTED 40018128: 10 80 00 07 b 40018144 <== NOT EXECUTED 4001812c: c2 26 80 00 st %g1, [ %i2 ] <== NOT EXECUTED } else { *ret_val |= *(sec_buf + ofs + 1) << 8; 40018130: 82 00 c0 01 add %g3, %g1, %g1 40018134: c2 08 60 01 ldub [ %g1 + 1 ], %g1 40018138: 83 28 60 08 sll %g1, 8, %g1 4001813c: 84 10 40 02 or %g1, %g2, %g2 40018140: c4 26 80 00 st %g2, [ %i2 ] } if ( FAT_CLUSTER_IS_ODD(cln) ) 40018144: 80 8e 60 01 btst 1, %i1 40018148: 02 80 00 04 be 40018158 4001814c: c2 06 80 00 ld [ %i2 ], %g1 *ret_val = (*ret_val) >> FAT12_SHIFT; 40018150: 10 80 00 0d b 40018184 40018154: 83 30 60 04 srl %g1, 4, %g1 else *ret_val = (*ret_val) & FAT_FAT12_MASK; 40018158: 10 80 00 0b b 40018184 4001815c: 82 08 6f ff and %g1, 0xfff, %g1 break; case FAT_FAT16: *ret_val = *((uint16_t *)(sec_buf + ofs)); 40018160: c4 07 bf fc ld [ %fp + -4 ], %g2 *ret_val = CF_LE_W(*ret_val); 40018164: 07 00 00 3f sethi %hi(0xfc00), %g3 else *ret_val = (*ret_val) & FAT_FAT12_MASK; break; case FAT_FAT16: *ret_val = *((uint16_t *)(sec_buf + ofs)); 40018168: c2 10 80 01 lduh [ %g2 + %g1 ], %g1 *ret_val = CF_LE_W(*ret_val); 4001816c: 86 10 e3 ff or %g3, 0x3ff, %g3 40018170: 83 28 60 10 sll %g1, 0x10, %g1 40018174: 85 30 60 18 srl %g1, 0x18, %g2 40018178: 83 30 60 08 srl %g1, 8, %g1 4001817c: 82 08 40 03 and %g1, %g3, %g1 40018180: 82 10 80 01 or %g2, %g1, %g1 40018184: c2 26 80 00 st %g1, [ %i2 ] break; 40018188: 81 c7 e0 08 ret 4001818c: 81 e8 00 00 restore case FAT_FAT32: *ret_val = *((uint32_t *)(sec_buf + ofs)); *ret_val = CF_LE_L(*ret_val); 40018190: c4 07 bf fc ld [ %fp + -4 ], %g2 40018194: 7f ff ff 90 call 40017fd4 40018198: d0 00 80 01 ld [ %g2 + %g1 ], %o0 4001819c: d0 26 80 00 st %o0, [ %i2 ] break; 400181a0: 81 c7 e0 08 ret 400181a4: 81 e8 00 00 restore default: rtems_set_errno_and_return_minus_one(EIO); 400181a8: 40 00 06 61 call 40019b2c <__errno> <== NOT EXECUTED 400181ac: b0 10 3f ff mov -1, %i0 <== NOT EXECUTED 400181b0: 82 10 20 05 mov 5, %g1 <== NOT EXECUTED 400181b4: c2 22 00 00 st %g1, [ %o0 ] <== NOT EXECUTED 400181b8: 81 c7 e0 08 ret <== NOT EXECUTED 400181bc: 81 e8 00 00 restore <== 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) 400181c0: b0 10 00 08 mov %o0, %i0 <== NOT EXECUTED rtems_set_errno_and_return_minus_one(EIO); break; } return RC_OK; } 400181c4: 81 c7 e0 08 ret <== NOT EXECUTED 400181c8: 81 e8 00 00 restore <== NOT EXECUTED =============================================================================== 4001314c : * 0 means FAILED !!! * */ uint32_t fat_get_unique_ino(fat_fs_info_t *fs_info) { 4001314c: 9d e3 bf a0 save %sp, -96, %sp <== 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)) 40013150: 39 03 ff ff sethi %hi(0xffffc00), %i4 <== NOT EXECUTED fat_get_unique_ino(fat_fs_info_t *fs_info) { uint32_t j = 0; bool resrc_unsuff = false; while (!resrc_unsuff) 40013154: 10 80 00 2b b 40013200 <== NOT EXECUTED 40013158: b8 17 23 ff or %i4, 0x3ff, %i4 ! fffffff <== NOT EXECUTED { for (j = 0; j < fs_info->uino_pool_size; j++) { if (!FAT_UNIQ_INO_IS_BUSY(fs_info->index, fs_info->uino)) 4001315c: c2 06 20 78 ld [ %i0 + 0x78 ], %g1 <== NOT EXECUTED 40013160: 85 30 60 03 srl %g1, 3, %g2 <== NOT EXECUTED 40013164: b6 00 c0 02 add %g3, %g2, %i3 <== NOT EXECUTED 40013168: f4 08 c0 02 ldub [ %g3 + %g2 ], %i2 <== NOT EXECUTED 4001316c: c4 48 c0 02 ldsb [ %g3 + %g2 ], %g2 <== NOT EXECUTED 40013170: ba 08 60 07 and %g1, 7, %i5 <== NOT EXECUTED 40013174: 85 38 80 1d sra %g2, %i5, %g2 <== NOT EXECUTED 40013178: 80 88 a0 01 btst 1, %g2 <== NOT EXECUTED 4001317c: 12 80 00 0a bne 400131a4 <== NOT EXECUTED 40013180: 82 00 60 01 inc %g1 <== NOT EXECUTED { FAT_SET_UNIQ_INO_BUSY(fs_info->index, fs_info->uino); 40013184: 82 10 20 01 mov 1, %g1 <== NOT EXECUTED 40013188: bb 28 40 1d sll %g1, %i5, %i5 <== NOT EXECUTED 4001318c: ba 17 40 1a or %i5, %i2, %i5 <== NOT EXECUTED 40013190: fa 2e c0 00 stb %i5, [ %i3 ] <== NOT EXECUTED return (fs_info->uino_base + fs_info->index); 40013194: c4 06 20 78 ld [ %i0 + 0x78 ], %g2 <== NOT EXECUTED 40013198: c2 06 20 80 ld [ %i0 + 0x80 ], %g1 <== NOT EXECUTED 4001319c: 81 c7 e0 08 ret <== NOT EXECUTED 400131a0: 91 e8 80 01 restore %g2, %g1, %o0 <== NOT EXECUTED } fs_info->index++; if (fs_info->index >= fs_info->uino_pool_size) 400131a4: 80 a0 40 04 cmp %g1, %g4 <== NOT EXECUTED 400131a8: 3a 80 00 03 bcc,a 400131b4 <== NOT EXECUTED 400131ac: c0 26 20 78 clr [ %i0 + 0x78 ] <== NOT EXECUTED 400131b0: c2 26 20 78 st %g1, [ %i0 + 0x78 ] <== NOT EXECUTED uint32_t j = 0; bool resrc_unsuff = false; while (!resrc_unsuff) { for (j = 0; j < fs_info->uino_pool_size; j++) 400131b4: 92 02 60 01 inc %o1 <== NOT EXECUTED 400131b8: 80 a2 40 04 cmp %o1, %g4 <== NOT EXECUTED 400131bc: 32 bf ff e8 bne,a 4001315c <== NOT EXECUTED 400131c0: c6 06 20 74 ld [ %i0 + 0x74 ], %g3 <== 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)) 400131c4: c2 06 20 80 ld [ %i0 + 0x80 ], %g1 <== NOT EXECUTED 400131c8: 93 2a 60 01 sll %o1, 1, %o1 <== NOT EXECUTED 400131cc: 82 27 00 01 sub %i4, %g1, %g1 <== NOT EXECUTED 400131d0: 80 a2 40 01 cmp %o1, %g1 <== NOT EXECUTED 400131d4: 2a 80 00 04 bcs,a 400131e4 <== NOT EXECUTED 400131d8: d0 06 20 74 ld [ %i0 + 0x74 ], %o0 <== NOT EXECUTED resrc_unsuff = true; } else resrc_unsuff = true; } return 0; 400131dc: 81 c7 e0 08 ret <== NOT EXECUTED 400131e0: 91 e8 20 00 restore %g0, 0, %o0 <== 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); 400131e4: 7f ff ca 33 call 40005ab0 <== NOT EXECUTED 400131e8: d2 26 20 7c st %o1, [ %i0 + 0x7c ] <== NOT EXECUTED if (fs_info->uino != NULL) 400131ec: 80 a2 20 00 cmp %o0, 0 <== NOT EXECUTED 400131f0: 02 bf ff fb be 400131dc <== NOT EXECUTED 400131f4: d0 26 20 74 st %o0, [ %i0 + 0x74 ] <== NOT EXECUTED fs_info->index = fs_info->uino_pool_size; 400131f8: c2 06 20 7c ld [ %i0 + 0x7c ], %g1 <== NOT EXECUTED 400131fc: c2 26 20 78 st %g1, [ %i0 + 0x78 ] <== NOT EXECUTED uint32_t j = 0; bool resrc_unsuff = false; while (!resrc_unsuff) { for (j = 0; j < fs_info->uino_pool_size; j++) 40013200: c8 06 20 7c ld [ %i0 + 0x7c ], %g4 <== NOT EXECUTED 40013204: 10 bf ff ed b 400131b8 <== NOT EXECUTED 40013208: 92 10 20 00 clr %o1 <== NOT EXECUTED =============================================================================== 400130d4 : int fat_init_clusters_chain( fat_fs_info_t *fs_info, uint32_t start_cln ) { 400130d4: 9d e3 bf 98 save %sp, -104, %sp 400130d8: ba 10 00 18 mov %i0, %i5 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) 400130dc: 10 80 00 10 b 4001311c 400130e0: f2 27 bf fc st %i1, [ %fp + -4 ] { ret = fat_cluster_set(fs_info, cur_cln, 0, fs_info->vol.bpc, 0); 400130e4: 90 10 00 1d mov %i5, %o0 400130e8: 94 10 20 00 clr %o2 400130ec: 7f ff fd 0b call 40012518 400130f0: 98 10 20 00 clr %o4 if ( ret != fs_info->vol.bpc ) 400130f4: c2 17 60 06 lduh [ %i5 + 6 ], %g1 400130f8: 80 a2 00 01 cmp %o0, %g1 400130fc: 12 80 00 11 bne 40013140 <== NEVER TAKEN 40013100: d2 07 bf fc ld [ %fp + -4 ], %o1 { return -1; } rc = fat_get_fat_cluster(fs_info, cur_cln, &cur_cln); 40013104: 90 10 00 1d mov %i5, %o0 40013108: 40 00 13 bf call 40018004 4001310c: 94 07 bf fc add %fp, -4, %o2 if ( rc != RC_OK ) 40013110: b0 92 20 00 orcc %o0, 0, %i0 40013114: 12 80 00 0c bne 40013144 <== NEVER TAKEN 40013118: 01 00 00 00 nop { 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) 4001311c: d2 07 bf fc ld [ %fp + -4 ], %o1 40013120: c4 07 60 10 ld [ %i5 + 0x10 ], %g2 40013124: c2 07 60 14 ld [ %i5 + 0x14 ], %g1 40013128: 84 0a 40 02 and %o1, %g2, %g2 4001312c: 80 a0 80 01 cmp %g2, %g1 40013130: 2a bf ff ed bcs,a 400130e4 40013134: d6 17 60 06 lduh [ %i5 + 6 ], %o3 return rc; } } return rc; 40013138: 81 c7 e0 08 ret 4001313c: 91 e8 20 00 restore %g0, 0, %o0 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; 40013140: b0 10 3f ff mov -1, %i0 <== NOT EXECUTED } } return rc; } 40013144: 81 c7 e0 08 ret <== NOT EXECUTED 40013148: 81 e8 00 00 restore <== NOT EXECUTED =============================================================================== 40012764 : * 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) { 40012764: 9d e3 bf 08 save %sp, -248, %sp ssize_t ret = 0; struct stat stat_buf; int i = 0; rtems_bdbuf_buffer *block = NULL; vol->fd = open(device, O_RDWR); 40012768: 92 10 20 02 mov 2, %o1 * 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) { 4001276c: b6 10 00 18 mov %i0, %i3 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; 40012770: c0 27 bf a4 clr [ %fp + -92 ] vol->fd = open(device, O_RDWR); 40012774: 7f ff cc 34 call 40005844 40012778: 90 10 00 19 mov %i1, %o0 if (vol->fd < 0) 4001277c: 80 a2 20 00 cmp %o0, 0 40012780: 06 80 00 17 bl 400127dc <== NEVER TAKEN 40012784: d0 26 e0 60 st %o0, [ %i3 + 0x60 ] { rtems_set_errno_and_return_minus_one(ENXIO); } rc = fstat(vol->fd, &stat_buf); 40012788: 7f ff c9 08 call 40004ba8 4001278c: 92 07 bf b8 add %fp, -72, %o1 if (rc != 0) 40012790: 80 a2 20 00 cmp %o0, 0 40012794: 12 80 00 10 bne 400127d4 <== NEVER TAKEN 40012798: d0 06 20 60 ld [ %i0 + 0x60 ], %o0 close(vol->fd); rtems_set_errno_and_return_minus_one(ENXIO); } /* Must be a block device. */ if (!S_ISBLK(stat_buf.st_mode)) 4001279c: c6 07 bf c4 ld [ %fp + -60 ], %g3 400127a0: 05 00 00 3c sethi %hi(0xf000), %g2 400127a4: 86 08 c0 02 and %g3, %g2, %g3 400127a8: 05 00 00 18 sethi %hi(0x6000), %g2 400127ac: 80 a0 c0 02 cmp %g3, %g2 400127b0: 12 80 00 09 bne 400127d4 <== NEVER TAKEN 400127b4: 13 10 01 10 sethi %hi(0x40044000), %o1 static inline int rtems_disk_fd_get_disk_device( int fd, rtems_disk_device **dd_ptr ) { return ioctl(fd, RTEMS_BLKIO_GETDISKDEV, dd_ptr); 400127b8: 94 06 20 64 add %i0, 0x64, %o2 400127bc: 40 00 05 35 call 40013c90 400127c0: 92 12 62 09 or %o1, 0x209, %o1 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) { 400127c4: 80 a2 20 00 cmp %o0, 0 400127c8: 22 80 00 09 be,a 400127ec <== ALWAYS TAKEN 400127cc: d0 06 20 64 ld [ %i0 + 0x64 ], %o0 close(vol->fd); 400127d0: d0 06 20 60 ld [ %i0 + 0x60 ], %o0 <== NOT EXECUTED 400127d4: 7f ff c8 aa call 40004a7c <== NOT EXECUTED 400127d8: 01 00 00 00 nop <== NOT EXECUTED rtems_set_errno_and_return_minus_one(ENXIO); 400127dc: 40 00 1c d4 call 40019b2c <__errno> <== NOT EXECUTED 400127e0: 01 00 00 00 nop <== NOT EXECUTED 400127e4: 10 80 01 af b 40012ea0 <== NOT EXECUTED 400127e8: 82 10 20 06 mov 6, %g1 ! 6 <== NOT EXECUTED } /* Read boot record */ /* FIXME: Asserts FAT_MAX_BPB_SIZE < bdbuf block size */ sc = rtems_bdbuf_read( vol->dd, 0, &block); 400127ec: 92 10 20 00 clr %o1 400127f0: 7f ff f6 9a call 40010258 400127f4: 94 07 bf a4 add %fp, -92, %o2 if (sc != RTEMS_SUCCESSFUL) 400127f8: 80 a2 20 00 cmp %o0, 0 400127fc: 22 80 00 03 be,a 40012808 <== ALWAYS TAKEN 40012800: d0 07 bf a4 ld [ %fp + -92 ], %o0 40012804: 30 80 00 32 b,a 400128cc <== NOT EXECUTED { close(vol->fd); rtems_set_errno_and_return_minus_one( EIO); } memcpy( boot_rec, block->buffer, FAT_MAX_BPB_SIZE); 40012808: c6 02 20 1c ld [ %o0 + 0x1c ], %g3 4001280c: c2 08 e0 20 ldub [ %g3 + 0x20 ], %g1 40012810: c4 08 e0 0b ldub [ %g3 + 0xb ], %g2 40012814: c2 2f bf 9a stb %g1, [ %fp + -102 ] 40012818: c2 08 e0 22 ldub [ %g3 + 0x22 ], %g1 4001281c: d2 08 e0 0c ldub [ %g3 + 0xc ], %o1 40012820: c2 2f bf 9b stb %g1, [ %fp + -101 ] 40012824: c2 08 e0 23 ldub [ %g3 + 0x23 ], %g1 40012828: d8 08 e0 0e ldub [ %g3 + 0xe ], %o4 4001282c: c2 2f bf 8f stb %g1, [ %fp + -113 ] 40012830: c2 08 e0 2c ldub [ %g3 + 0x2c ], %g1 40012834: d6 08 e0 0f ldub [ %g3 + 0xf ], %o3 40012838: c2 2f bf 9e stb %g1, [ %fp + -98 ] 4001283c: c2 08 e0 2d ldub [ %g3 + 0x2d ], %g1 40012840: c8 08 e0 11 ldub [ %g3 + 0x11 ], %g4 40012844: c2 2f bf 9d stb %g1, [ %fp + -99 ] 40012848: c2 08 e0 2e ldub [ %g3 + 0x2e ], %g1 4001284c: da 08 e0 12 ldub [ %g3 + 0x12 ], %o5 40012850: c2 2f bf 9c stb %g1, [ %fp + -100 ] 40012854: c2 08 e0 2f ldub [ %g3 + 0x2f ], %g1 40012858: fa 08 e0 0d ldub [ %g3 + 0xd ], %i5 4001285c: f4 08 e0 10 ldub [ %g3 + 0x10 ], %i2 40012860: e2 08 e0 13 ldub [ %g3 + 0x13 ], %l1 40012864: e4 08 e0 14 ldub [ %g3 + 0x14 ], %l2 40012868: ee 08 e0 16 ldub [ %g3 + 0x16 ], %l7 4001286c: f0 08 e0 17 ldub [ %g3 + 0x17 ], %i0 40012870: e0 08 e0 21 ldub [ %g3 + 0x21 ], %l0 40012874: e8 08 e0 24 ldub [ %g3 + 0x24 ], %l4 40012878: ec 08 e0 25 ldub [ %g3 + 0x25 ], %l6 4001287c: ea 08 e0 26 ldub [ %g3 + 0x26 ], %l5 40012880: e6 08 e0 27 ldub [ %g3 + 0x27 ], %l3 40012884: f8 08 e0 28 ldub [ %g3 + 0x28 ], %i4 40012888: c2 2f bf 97 stb %g1, [ %fp + -105 ] 4001288c: c2 08 e0 30 ldub [ %g3 + 0x30 ], %g1 40012890: f2 08 e0 31 ldub [ %g3 + 0x31 ], %i1 40012894: c2 2f bf 9f stb %g1, [ %fp + -97 ] sc = rtems_bdbuf_release( block); 40012898: c4 27 bf 80 st %g2, [ %fp + -128 ] 4001289c: c8 27 bf 7c st %g4, [ %fp + -132 ] 400128a0: d2 27 bf 78 st %o1, [ %fp + -136 ] 400128a4: d6 27 bf 74 st %o3, [ %fp + -140 ] 400128a8: 7f ff f6 e8 call 40010448 400128ac: d8 3f bf 68 std %o4, [ %fp + -152 ] if (sc != RTEMS_SUCCESSFUL) 400128b0: c4 07 bf 80 ld [ %fp + -128 ], %g2 400128b4: 80 a2 20 00 cmp %o0, 0 400128b8: c8 07 bf 7c ld [ %fp + -132 ], %g4 400128bc: d2 07 bf 78 ld [ %fp + -136 ], %o1 400128c0: d6 07 bf 74 ld [ %fp + -140 ], %o3 400128c4: 02 80 00 08 be 400128e4 <== ALWAYS TAKEN 400128c8: d8 1f bf 68 ldd [ %fp + -152 ], %o4 { close(vol->fd); 400128cc: 7f ff c8 6c call 40004a7c <== NOT EXECUTED 400128d0: d0 06 e0 60 ld [ %i3 + 0x60 ], %o0 <== NOT EXECUTED rtems_set_errno_and_return_minus_one( EIO ); 400128d4: 40 00 1c 96 call 40019b2c <__errno> <== NOT EXECUTED 400128d8: 01 00 00 00 nop <== NOT EXECUTED 400128dc: 10 80 01 71 b 40012ea0 <== NOT EXECUTED 400128e0: 82 10 20 05 mov 5, %g1 ! 5 <== NOT EXECUTED } /* Evaluate boot record */ vol->bps = FAT_GET_BR_BYTES_PER_SECTOR(boot_rec); 400128e4: 84 08 a0 ff and %g2, 0xff, %g2 400128e8: 92 0a 60 ff and %o1, 0xff, %o1 400128ec: 93 2a 60 08 sll %o1, 8, %o1 400128f0: 92 12 40 02 or %o1, %g2, %o1 400128f4: d2 36 c0 00 sth %o1, [ %i3 ] if ( (vol->bps != 512) && 400128f8: 85 2a 60 10 sll %o1, 0x10, %g2 400128fc: 85 30 a0 10 srl %g2, 0x10, %g2 40012900: 80 a0 a4 00 cmp %g2, 0x400 40012904: 02 80 00 0c be 40012934 <== NEVER TAKEN 40012908: 86 10 00 09 mov %o1, %g3 4001290c: 80 a0 a2 00 cmp %g2, 0x200 40012910: 22 80 00 0a be,a 40012938 <== ALWAYS TAKEN 40012914: 85 2a 60 10 sll %o1, 0x10, %g2 (vol->bps != 1024) && 40012918: 80 a0 a8 00 cmp %g2, 0x800 <== NOT EXECUTED 4001291c: 02 80 00 06 be 40012934 <== NOT EXECUTED 40012920: 1f 00 00 04 sethi %hi(0x1000), %o7 <== NOT EXECUTED (vol->bps != 2048) && 40012924: 80 a0 80 0f cmp %g2, %o7 <== NOT EXECUTED 40012928: 02 80 00 04 be 40012938 <== NOT EXECUTED 4001292c: 85 2a 60 10 sll %o1, 0x10, %g2 <== NOT EXECUTED 40012930: 30 80 00 d6 b,a 40012c88 <== 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; 40012934: 85 2a 60 10 sll %o1, 0x10, %g2 <== NOT EXECUTED 40012938: c0 2e e0 03 clrb [ %i3 + 3 ] 4001293c: 10 80 00 05 b 40012950 40012940: 85 30 a0 19 srl %g2, 0x19, %g2 i >>= 1, vol->sec_mul++); 40012944: 85 38 a0 01 sra %g2, 1, %g2 <== NOT EXECUTED 40012948: 9e 03 e0 01 inc %o7 <== NOT EXECUTED 4001294c: de 2e e0 03 stb %o7, [ %i3 + 3 ] <== 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; 40012950: 80 88 a0 01 btst 1, %g2 40012954: 22 bf ff fc be,a 40012944 <== NEVER TAKEN 40012958: de 0e e0 03 ldub [ %i3 + 3 ], %o7 <== NOT EXECUTED i >>= 1, vol->sec_mul++); for (vol->sec_log2 = 0, i = vol->bps; (i & 1) == 0; 4001295c: 93 2a 60 10 sll %o1, 0x10, %o1 40012960: c0 2e e0 02 clrb [ %i3 + 2 ] 40012964: 93 32 60 10 srl %o1, 0x10, %o1 40012968: 10 80 00 05 b 4001297c 4001296c: 9e 10 00 09 mov %o1, %o7 i >>= 1, vol->sec_log2++); 40012970: 84 00 a0 01 inc %g2 40012974: 9f 3b e0 01 sra %o7, 1, %o7 40012978: c4 2e e0 02 stb %g2, [ %i3 + 2 ] 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; 4001297c: 80 8b e0 01 btst 1, %o7 40012980: 02 bf ff fc be 40012970 40012984: c4 0e e0 02 ldub [ %i3 + 2 ], %g2 i >>= 1, vol->sec_log2++); vol->bytes_per_block = vol->bps; 40012988: c6 36 e0 0a sth %g3, [ %i3 + 0xa ] vol->bytes_per_block_log2 = vol->sec_log2; 4001298c: c4 2e e0 0c stb %g2, [ %i3 + 0xc ] vol->sectors_per_block = 1; 40012990: 86 10 20 01 mov 1, %g3 vol->spc = FAT_GET_BR_SECTORS_PER_CLUSTER(boot_rec); 40012994: fa 2e e0 04 stb %i5, [ %i3 + 4 ] /* * "sectors per cluster" of zero is invalid * (and would hang the following loop) */ if (vol->spc == 0) 40012998: 9e 8f 60 ff andcc %i5, 0xff, %o7 4001299c: 02 80 00 bb be 40012c88 <== NEVER TAKEN 400129a0: c6 2e e0 09 stb %g3, [ %i3 + 9 ] { close(vol->fd); rtems_set_errno_and_return_minus_one(EINVAL); } for (vol->spc_log2 = 0, i = vol->spc; (i & 1) == 0; 400129a4: 10 80 00 05 b 400129b8 400129a8: c0 2e e0 05 clrb [ %i3 + 5 ] i >>= 1, vol->spc_log2++); 400129ac: 86 00 e0 01 inc %g3 400129b0: 9f 3b e0 01 sra %o7, 1, %o7 400129b4: c6 2e e0 05 stb %g3, [ %i3 + 5 ] { close(vol->fd); rtems_set_errno_and_return_minus_one(EINVAL); } for (vol->spc_log2 = 0, i = vol->spc; (i & 1) == 0; 400129b8: 80 8b e0 01 btst 1, %o7 400129bc: 02 bf ff fc be 400129ac 400129c0: c6 0e e0 05 ldub [ %i3 + 5 ], %g3 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) 400129c4: 87 2a 40 03 sll %o1, %g3, %g3 400129c8: 95 28 e0 10 sll %g3, 0x10, %o2 400129cc: 1f 20 00 00 sethi %hi(0x80000000), %o7 400129d0: 80 a2 80 0f cmp %o2, %o7 400129d4: 18 80 00 ad bgu 40012c88 <== NEVER TAKEN 400129d8: c6 36 e0 06 sth %g3, [ %i3 + 6 ] { close(vol->fd); rtems_set_errno_and_return_minus_one(EINVAL); } for (vol->bpc_log2 = 0, i = vol->bpc; (i & 1) == 0; 400129dc: 1f 00 00 3f sethi %hi(0xfc00), %o7 400129e0: c0 2e e0 08 clrb [ %i3 + 8 ] 400129e4: 9e 13 e3 ff or %o7, 0x3ff, %o7 400129e8: 10 80 00 05 b 400129fc 400129ec: 86 08 c0 0f and %g3, %o7, %g3 i >>= 1, vol->bpc_log2++); 400129f0: 87 38 e0 01 sra %g3, 1, %g3 400129f4: 9e 03 e0 01 inc %o7 400129f8: de 2e e0 08 stb %o7, [ %i3 + 8 ] { close(vol->fd); rtems_set_errno_and_return_minus_one(EINVAL); } for (vol->bpc_log2 = 0, i = vol->bpc; (i & 1) == 0; 400129fc: 80 88 e0 01 btst 1, %g3 40012a00: 22 bf ff fc be,a 400129f0 40012a04: de 0e e0 08 ldub [ %i3 + 8 ], %o7 i >>= 1, vol->bpc_log2++); vol->fats = FAT_GET_BR_FAT_NUM(boot_rec); 40012a08: f4 2e e0 0d stb %i2, [ %i3 + 0xd ] 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)) / 40012a0c: 86 02 7f ff add %o1, -1, %g3 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); 40012a10: 96 0a e0 ff and %o3, 0xff, %o3 40012a14: 98 0b 20 ff and %o4, 0xff, %o4 40012a18: 97 2a e0 08 sll %o3, 8, %o3 vol->rdir_entrs = FAT_GET_BR_FILES_PER_ROOT_DIR(boot_rec); 40012a1c: 9a 0b 60 ff and %o5, 0xff, %o5 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); 40012a20: 98 12 c0 0c or %o3, %o4, %o4 vol->rdir_entrs = FAT_GET_BR_FILES_PER_ROOT_DIR(boot_rec); 40012a24: 9b 2b 60 08 sll %o5, 8, %o5 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); 40012a28: d8 36 e0 18 sth %o4, [ %i3 + 0x18 ] vol->rdir_entrs = FAT_GET_BR_FILES_PER_ROOT_DIR(boot_rec); 40012a2c: 88 09 20 ff and %g4, 0xff, %g4 40012a30: 88 13 40 04 or %o5, %g4, %g4 40012a34: c8 36 e0 24 sth %g4, [ %i3 + 0x24 ] /* calculate the count of sectors occupied by the root directory */ vol->rdir_secs = ((vol->rdir_entrs * FAT_DIRENTRY_SIZE) + (vol->bps - 1)) / 40012a38: 89 29 20 10 sll %g4, 0x10, %g4 40012a3c: c4 27 bf 80 st %g2, [ %fp + -128 ] 40012a40: 91 31 20 0b srl %g4, 0xb, %o0 40012a44: d8 27 bf 68 st %o4, [ %fp + -152 ] 40012a48: 7f ff bf 3e call 40002740 <.div> 40012a4c: 90 02 00 03 add %o0, %g3, %o0 vol->bps; vol->rdir_size = vol->rdir_secs << vol->sec_log2; 40012a50: c4 07 bf 80 ld [ %fp + -128 ], %g2 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)) / 40012a54: d0 26 e0 28 st %o0, [ %i3 + 0x28 ] vol->bps; vol->rdir_size = vol->rdir_secs << vol->sec_log2; 40012a58: 85 2a 00 02 sll %o0, %g2, %g2 40012a5c: c4 26 e0 2c st %g2, [ %i3 + 0x2c ] if ( (FAT_GET_BR_SECTORS_PER_FAT(boot_rec)) != 0) 40012a60: b0 0e 20 ff and %i0, 0xff, %i0 40012a64: ae 0d e0 ff and %l7, 0xff, %l7 40012a68: b1 2e 20 08 sll %i0, 8, %i0 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)) / 40012a6c: 86 10 00 08 mov %o0, %g3 vol->bps; vol->rdir_size = vol->rdir_secs << vol->sec_log2; if ( (FAT_GET_BR_SECTORS_PER_FAT(boot_rec)) != 0) 40012a70: ae 16 00 17 or %i0, %l7, %l7 40012a74: af 2d e0 10 sll %l7, 0x10, %l7 40012a78: 80 a5 e0 00 cmp %l7, 0 40012a7c: 02 80 00 05 be 40012a90 40012a80: d8 07 bf 68 ld [ %fp + -152 ], %o4 vol->fat_length = FAT_GET_BR_SECTORS_PER_FAT(boot_rec); 40012a84: af 35 e0 10 srl %l7, 0x10, %l7 40012a88: 10 80 00 0c b 40012ab8 40012a8c: ee 26 e0 1c st %l7, [ %i3 + 0x1c ] else vol->fat_length = FAT_GET_BR_SECTORS_PER_FAT32(boot_rec); 40012a90: ac 0d a0 ff and %l6, 0xff, %l6 40012a94: aa 0d 60 ff and %l5, 0xff, %l5 40012a98: ad 2d a0 08 sll %l6, 8, %l6 40012a9c: ab 2d 60 10 sll %l5, 0x10, %l5 40012aa0: a8 0d 20 ff and %l4, 0xff, %l4 40012aa4: aa 15 80 15 or %l6, %l5, %l5 40012aa8: a7 2c e0 18 sll %l3, 0x18, %l3 40012aac: a8 15 40 14 or %l5, %l4, %l4 40012ab0: a6 15 00 13 or %l4, %l3, %l3 40012ab4: e6 26 e0 1c st %l3, [ %i3 + 0x1c ] vol->data_fsec = vol->fat_loc + vol->fats * vol->fat_length + 40012ab8: d2 06 e0 1c ld [ %i3 + 0x1c ], %o1 40012abc: 99 2b 20 10 sll %o4, 0x10, %o4 40012ac0: c6 27 bf 84 st %g3, [ %fp + -124 ] 40012ac4: b1 33 20 10 srl %o4, 0x10, %i0 40012ac8: 7f ff be e2 call 40002650 <.umul> 40012acc: 90 0e a0 ff and %i2, 0xff, %o0 40012ad0: c6 07 bf 84 ld [ %fp + -124 ], %g3 40012ad4: 90 06 00 08 add %i0, %o0, %o0 40012ad8: 86 00 c0 08 add %g3, %o0, %g3 vol->rdir_secs; /* for FAT12/16 root dir starts at(sector) */ vol->rdir_loc = vol->fat_loc + vol->fats * vol->fat_length; 40012adc: d0 26 e0 20 st %o0, [ %i3 + 0x20 ] if ( (FAT_GET_BR_TOTAL_SECTORS_NUM16(boot_rec)) != 0) 40012ae0: a4 0c a0 ff and %l2, 0xff, %l2 40012ae4: a2 0c 60 ff and %l1, 0xff, %l1 40012ae8: a5 2c a0 08 sll %l2, 8, %l2 40012aec: a2 14 80 11 or %l2, %l1, %l1 40012af0: a3 2c 60 10 sll %l1, 0x10, %l1 40012af4: 80 a4 60 00 cmp %l1, 0 40012af8: 02 80 00 05 be 40012b0c 40012afc: c6 26 e0 34 st %g3, [ %i3 + 0x34 ] vol->tot_secs = FAT_GET_BR_TOTAL_SECTORS_NUM16(boot_rec); 40012b00: a3 34 60 10 srl %l1, 0x10, %l1 40012b04: 10 80 00 0d b 40012b38 40012b08: e2 26 e0 30 st %l1, [ %i3 + 0x30 ] else vol->tot_secs = FAT_GET_BR_TOTAL_SECTORS_NUM32(boot_rec); 40012b0c: c8 0f bf 9a ldub [ %fp + -102 ], %g4 40012b10: c4 0f bf 9b ldub [ %fp + -101 ], %g2 40012b14: c2 0f bf 8f ldub [ %fp + -113 ], %g1 40012b18: a0 0c 20 ff and %l0, 0xff, %l0 40012b1c: 85 28 a0 10 sll %g2, 0x10, %g2 40012b20: a1 2c 20 08 sll %l0, 8, %l0 40012b24: 84 14 00 02 or %l0, %g2, %g2 40012b28: 84 10 80 04 or %g2, %g4, %g2 40012b2c: 89 28 60 18 sll %g1, 0x18, %g4 40012b30: 84 10 80 04 or %g2, %g4, %g2 40012b34: c4 26 e0 30 st %g2, [ %i3 + 0x30 ] data_secs = vol->tot_secs - vol->data_fsec; 40012b38: d0 06 e0 30 ld [ %i3 + 0x30 ], %o0 vol->data_cls = data_secs / vol->spc; 40012b3c: 92 0f 60 ff and %i5, 0xff, %o1 40012b40: 7f ff be fe call 40002738 <.udiv> 40012b44: 90 22 00 03 sub %o0, %g3, %o0 /* determine FAT type at least */ if ( vol->data_cls < FAT_FAT12_MAX_CLN) 40012b48: 80 a2 2f f4 cmp %o0, 0xff4 40012b4c: 18 80 00 08 bgu 40012b6c 40012b50: d0 26 e0 38 st %o0, [ %i3 + 0x38 ] { vol->type = FAT_FAT12; 40012b54: 84 10 20 01 mov 1, %g2 40012b58: c4 2e e0 0e stb %g2, [ %i3 + 0xe ] vol->mask = FAT_FAT12_MASK; 40012b5c: 84 10 2f ff mov 0xfff, %g2 40012b60: c4 26 e0 10 st %g2, [ %i3 + 0x10 ] vol->eoc_val = FAT_FAT12_EOC; 40012b64: 10 80 00 0f b 40012ba0 40012b68: 84 10 2f f8 mov 0xff8, %g2 } else { if ( vol->data_cls < FAT_FAT16_MAX_CLN) 40012b6c: 05 00 00 3f sethi %hi(0xfc00), %g2 40012b70: 86 10 a3 f4 or %g2, 0x3f4, %g3 ! fff4 40012b74: 80 a2 00 03 cmp %o0, %g3 40012b78: 38 80 00 05 bgu,a 40012b8c 40012b7c: 84 10 20 04 mov 4, %g2 { vol->type = FAT_FAT16; 40012b80: 86 10 20 02 mov 2, %g3 40012b84: 10 80 00 04 b 40012b94 40012b88: c6 2e e0 0e stb %g3, [ %i3 + 0xe ] vol->mask = FAT_FAT16_MASK; vol->eoc_val = FAT_FAT16_EOC; } else { vol->type = FAT_FAT32; 40012b8c: c4 2e e0 0e stb %g2, [ %i3 + 0xe ] vol->mask = FAT_FAT32_MASK; 40012b90: 05 03 ff ff sethi %hi(0xffffc00), %g2 40012b94: 86 10 a3 ff or %g2, 0x3ff, %g3 ! fffffff vol->eoc_val = FAT_FAT32_EOC; 40012b98: 84 10 a3 f8 or %g2, 0x3f8, %g2 vol->eoc_val = FAT_FAT16_EOC; } else { vol->type = FAT_FAT32; vol->mask = FAT_FAT32_MASK; 40012b9c: c6 26 e0 10 st %g3, [ %i3 + 0x10 ] vol->eoc_val = FAT_FAT32_EOC; 40012ba0: c4 26 e0 14 st %g2, [ %i3 + 0x14 ] } } if (vol->type == FAT_FAT32) 40012ba4: c4 0e e0 0e ldub [ %i3 + 0xe ], %g2 40012ba8: 80 a0 a0 04 cmp %g2, 4 40012bac: 12 80 00 63 bne 40012d38 40012bb0: 82 10 3f ff mov -1, %g1 { vol->rdir_cl = FAT_GET_BR_FAT32_ROOT_CLUSTER(boot_rec); 40012bb4: c6 0f bf 9d ldub [ %fp + -99 ], %g3 40012bb8: c4 0f bf 9c ldub [ %fp + -100 ], %g2 40012bbc: 87 28 e0 08 sll %g3, 8, %g3 40012bc0: 85 28 a0 10 sll %g2, 0x10, %g2 40012bc4: c2 0f bf 97 ldub [ %fp + -105 ], %g1 40012bc8: 84 10 c0 02 or %g3, %g2, %g2 40012bcc: c6 0f bf 9e ldub [ %fp + -98 ], %g3 40012bd0: 84 10 80 03 or %g2, %g3, %g2 40012bd4: 87 28 60 18 sll %g1, 0x18, %g3 40012bd8: 84 10 80 03 or %g2, %g3, %g2 40012bdc: c4 26 e0 3c st %g2, [ %i3 + 0x3c ] vol->mirror = FAT_GET_BR_EXT_FLAGS(boot_rec) & FAT_BR_EXT_FLAGS_MIRROR; 40012be0: 84 0f 3f 80 and %i4, -128, %g2 if (vol->mirror) 40012be4: 80 88 a0 80 btst 0x80, %g2 40012be8: 02 80 00 05 be 40012bfc <== ALWAYS TAKEN 40012bec: c4 2e e0 54 stb %g2, [ %i3 + 0x54 ] vol->afat = FAT_GET_BR_EXT_FLAGS(boot_rec) & FAT_BR_EXT_FLAGS_FAT_NUM; 40012bf0: b8 0f 20 0f and %i4, 0xf, %i4 <== NOT EXECUTED 40012bf4: 10 80 00 03 b 40012c00 <== NOT EXECUTED 40012bf8: f8 2e e0 5c stb %i4, [ %i3 + 0x5c ] <== NOT EXECUTED else vol->afat = 0; 40012bfc: c0 2e e0 5c clrb [ %i3 + 0x5c ] vol->info_sec = FAT_GET_BR_FAT32_FS_INFO_SECTOR(boot_rec); 40012c00: f4 0f bf 9f ldub [ %fp + -97 ], %i2 40012c04: b2 0e 60 ff and %i1, 0xff, %i1 40012c08: b3 2e 60 08 sll %i1, 8, %i1 40012c0c: b4 16 40 1a or %i1, %i2, %i2 40012c10: f4 36 e0 40 sth %i2, [ %i3 + 0x40 ] if( vol->info_sec == 0 ) 40012c14: b5 2e a0 10 sll %i2, 0x10, %i2 40012c18: 93 36 a0 10 srl %i2, 0x10, %o1 40012c1c: 80 a2 60 00 cmp %o1, 0 40012c20: 32 80 00 03 bne,a 40012c2c <== ALWAYS TAKEN 40012c24: 90 10 00 1b mov %i3, %o0 40012c28: 30 80 00 18 b,a 40012c88 <== NOT EXECUTED close(vol->fd); rtems_set_errno_and_return_minus_one( EINVAL ); } else { ret = _fat_block_read(fs_info, vol->info_sec , 0, 40012c2c: 94 10 20 00 clr %o2 40012c30: 96 10 20 04 mov 4, %o3 40012c34: 7f ff fd f3 call 40012400 <_fat_block_read> 40012c38: 98 07 bf a8 add %fp, -88, %o4 FAT_FSI_LEADSIG_SIZE, fs_info_sector); if ( ret < 0 ) 40012c3c: 80 a2 20 00 cmp %o0, 0 40012c40: 06 80 00 22 bl 40012cc8 <== NEVER TAKEN 40012c44: c4 0f bf aa ldub [ %fp + -86 ], %g2 { close(vol->fd); return -1; } if (FAT_GET_FSINFO_LEAD_SIGNATURE(fs_info_sector) != 40012c48: c6 0f bf a9 ldub [ %fp + -87 ], %g3 40012c4c: 85 28 a0 10 sll %g2, 0x10, %g2 40012c50: 87 28 e0 08 sll %g3, 8, %g3 40012c54: 86 10 c0 02 or %g3, %g2, %g3 40012c58: c4 0f bf a8 ldub [ %fp + -88 ], %g2 40012c5c: 86 10 c0 02 or %g3, %g2, %g3 40012c60: c4 0f bf ab ldub [ %fp + -85 ], %g2 40012c64: 85 28 a0 18 sll %g2, 0x18, %g2 40012c68: 86 10 c0 02 or %g3, %g2, %g3 40012c6c: 05 10 58 54 sethi %hi(0x41615000), %g2 40012c70: 84 10 a2 52 or %g2, 0x252, %g2 ! 41615252 40012c74: 80 a0 c0 02 cmp %g3, %g2 40012c78: 02 80 00 0a be 40012ca0 <== ALWAYS TAKEN 40012c7c: 90 10 00 1b mov %i3, %o0 * 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); 40012c80: 7f ff fd 3d call 40012174 <== NOT EXECUTED 40012c84: 01 00 00 00 nop <== NOT EXECUTED if (FAT_GET_FSINFO_LEAD_SIGNATURE(fs_info_sector) != FAT_FSINFO_LEAD_SIGNATURE_VALUE) { _fat_block_release(fs_info); close(vol->fd); 40012c88: 7f ff c7 7d call 40004a7c <== NOT EXECUTED 40012c8c: d0 06 e0 60 ld [ %i3 + 0x60 ], %o0 <== NOT EXECUTED rtems_set_errno_and_return_minus_one( EINVAL ); 40012c90: 40 00 1b a7 call 40019b2c <__errno> <== NOT EXECUTED 40012c94: 01 00 00 00 nop <== NOT EXECUTED 40012c98: 10 80 00 82 b 40012ea0 <== NOT EXECUTED 40012c9c: 82 10 20 16 mov 0x16, %g1 ! 16 <== NOT EXECUTED } else { ret = _fat_block_read(fs_info, vol->info_sec , FAT_FSI_INFO, 40012ca0: d2 16 e0 40 lduh [ %i3 + 0x40 ], %o1 40012ca4: 94 10 21 e4 mov 0x1e4, %o2 40012ca8: 96 10 20 0c mov 0xc, %o3 40012cac: 7f ff fd d5 call 40012400 <_fat_block_read> 40012cb0: 98 07 bf a8 add %fp, -88, %o4 FAT_USEFUL_INFO_SIZE, fs_info_sector); if ( ret < 0 ) 40012cb4: 80 a2 20 00 cmp %o0, 0 40012cb8: 16 80 00 08 bge 40012cd8 <== ALWAYS TAKEN 40012cbc: c6 0f bf ad ldub [ %fp + -83 ], %g3 * 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); 40012cc0: 7f ff fd 2d call 40012174 <== NOT EXECUTED 40012cc4: 90 10 00 1b mov %i3, %o0 <== NOT EXECUTED ret = _fat_block_read(fs_info, vol->info_sec , FAT_FSI_INFO, FAT_USEFUL_INFO_SIZE, fs_info_sector); if ( ret < 0 ) { _fat_block_release(fs_info); close(vol->fd); 40012cc8: 7f ff c7 6d call 40004a7c <== NOT EXECUTED 40012ccc: d0 06 e0 60 ld [ %i3 + 0x60 ], %o0 <== NOT EXECUTED { close(vol->fd); free(fs_info->vhash); free(fs_info->rhash); free(fs_info->uino); rtems_set_errno_and_return_minus_one( ENOMEM ); 40012cd0: 81 c7 e0 08 ret <== NOT EXECUTED 40012cd4: 91 e8 3f ff restore %g0, -1, %o0 <== NOT EXECUTED close(vol->fd); return -1; } vol->free_cls_in_fs_info = FAT_GET_FSINFO_FREE_CLUSTER_COUNT(fs_info_sector); 40012cd8: c4 0f bf ae ldub [ %fp + -82 ], %g2 40012cdc: 87 28 e0 08 sll %g3, 8, %g3 40012ce0: 85 28 a0 10 sll %g2, 0x10, %g2 40012ce4: 84 10 c0 02 or %g3, %g2, %g2 40012ce8: c6 0f bf ac ldub [ %fp + -84 ], %g3 40012cec: 84 10 80 03 or %g2, %g3, %g2 40012cf0: c6 0f bf af ldub [ %fp + -81 ], %g3 40012cf4: 87 28 e0 18 sll %g3, 0x18, %g3 40012cf8: 84 10 80 03 or %g2, %g3, %g2 vol->free_cls = vol->free_cls_in_fs_info; vol->next_cl_in_fs_info = FAT_GET_FSINFO_NEXT_FREE_CLUSTER(fs_info_sector); 40012cfc: c6 0f bf b1 ldub [ %fp + -79 ], %g3 _fat_block_release(fs_info); close(vol->fd); return -1; } vol->free_cls_in_fs_info = 40012d00: c4 26 e0 48 st %g2, [ %i3 + 0x48 ] FAT_GET_FSINFO_FREE_CLUSTER_COUNT(fs_info_sector); vol->free_cls = vol->free_cls_in_fs_info; 40012d04: c4 26 e0 44 st %g2, [ %i3 + 0x44 ] vol->next_cl_in_fs_info = FAT_GET_FSINFO_NEXT_FREE_CLUSTER(fs_info_sector); 40012d08: c4 0f bf b2 ldub [ %fp + -78 ], %g2 40012d0c: 87 28 e0 08 sll %g3, 8, %g3 40012d10: 85 28 a0 10 sll %g2, 0x10, %g2 40012d14: 84 10 c0 02 or %g3, %g2, %g2 40012d18: c6 0f bf b0 ldub [ %fp + -80 ], %g3 40012d1c: 84 10 80 03 or %g2, %g3, %g2 40012d20: c6 0f bf b3 ldub [ %fp + -77 ], %g3 40012d24: 87 28 e0 18 sll %g3, 0x18, %g3 40012d28: 84 10 80 03 or %g2, %g3, %g2 } 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 = 40012d2c: c4 26 e0 50 st %g2, [ %i3 + 0x50 ] FAT_GET_FSINFO_NEXT_FREE_CLUSTER(fs_info_sector); vol->next_cl = vol->next_cl_in_fs_info; 40012d30: 10 80 00 07 b 40012d4c 40012d34: c4 26 e0 4c st %g2, [ %i3 + 0x4c ] } } } else { vol->rdir_cl = 0; 40012d38: c0 26 e0 3c clr [ %i3 + 0x3c ] vol->mirror = 0; 40012d3c: c0 2e e0 54 clrb [ %i3 + 0x54 ] vol->afat = 0; 40012d40: c0 2e e0 5c clrb [ %i3 + 0x5c ] vol->free_cls = FAT_UNDEFINED_VALUE; 40012d44: c2 26 e0 44 st %g1, [ %i3 + 0x44 ] vol->next_cl = FAT_UNDEFINED_VALUE; 40012d48: c2 26 e0 4c st %g1, [ %i3 + 0x4c ] * 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); 40012d4c: 7f ff fd 0a call 40012174 40012d50: 90 10 00 1b mov %i3, %o0 vol->next_cl = FAT_UNDEFINED_VALUE; } _fat_block_release(fs_info); vol->afat_loc = vol->fat_loc + vol->fat_length * vol->afat; 40012d54: d2 06 e0 1c ld [ %i3 + 0x1c ], %o1 40012d58: 7f ff be 3e call 40002650 <.umul> 40012d5c: d0 0e e0 5c ldub [ %i3 + 0x5c ], %o0 40012d60: c4 16 e0 18 lduh [ %i3 + 0x18 ], %g2 /* set up collection of fat-files fd */ fs_info->vhash = calloc(FAT_HASH_SIZE, sizeof(rtems_chain_control)); 40012d64: 92 10 20 0c mov 0xc, %o1 vol->next_cl = FAT_UNDEFINED_VALUE; } _fat_block_release(fs_info); vol->afat_loc = vol->fat_loc + vol->fat_length * vol->afat; 40012d68: 90 02 00 02 add %o0, %g2, %o0 40012d6c: d0 26 e0 58 st %o0, [ %i3 + 0x58 ] /* set up collection of fat-files fd */ fs_info->vhash = calloc(FAT_HASH_SIZE, sizeof(rtems_chain_control)); 40012d70: 7f ff c7 2c call 40004a20 40012d74: 90 10 20 02 mov 2, %o0 if ( fs_info->vhash == NULL ) 40012d78: 80 a2 20 00 cmp %o0, 0 40012d7c: 02 80 00 12 be 40012dc4 <== NEVER TAKEN 40012d80: d0 26 e0 6c st %o0, [ %i3 + 0x6c ] 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 ); 40012d84: 84 02 20 04 add %o0, 4, %g2 40012d88: 86 02 20 10 add %o0, 0x10, %g3 head->next = tail; 40012d8c: c4 22 00 00 st %g2, [ %o0 ] 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 ); 40012d90: 84 02 20 0c add %o0, 0xc, %g2 head->next = tail; head->previous = NULL; 40012d94: c0 22 20 04 clr [ %o0 + 4 ] tail->previous = head; 40012d98: d0 22 20 08 st %o0, [ %o0 + 8 ] ) { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); head->next = tail; 40012d9c: c6 22 20 0c st %g3, [ %o0 + 0xc ] head->previous = NULL; 40012da0: c0 22 20 10 clr [ %o0 + 0x10 ] tail->previous = head; 40012da4: c4 22 20 14 st %g2, [ %o0 + 0x14 ] } for (i = 0; i < FAT_HASH_SIZE; i++) rtems_chain_initialize_empty(fs_info->vhash + i); fs_info->rhash = calloc(FAT_HASH_SIZE, sizeof(rtems_chain_control)); 40012da8: 92 10 20 0c mov 0xc, %o1 40012dac: 7f ff c7 1d call 40004a20 40012db0: 90 10 20 02 mov 2, %o0 if ( fs_info->rhash == NULL ) 40012db4: 80 a2 20 00 cmp %o0, 0 40012db8: 12 80 00 06 bne 40012dd0 <== ALWAYS TAKEN 40012dbc: d0 26 e0 70 st %o0, [ %i3 + 0x70 ] 40012dc0: 30 80 00 1c b,a 40012e30 <== 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); 40012dc4: 7f ff c7 2e call 40004a7c <== NOT EXECUTED 40012dc8: d0 06 e0 60 ld [ %i3 + 0x60 ], %o0 <== NOT EXECUTED 40012dcc: 30 80 00 32 b,a 40012e94 <== NOT EXECUTED RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); 40012dd0: 84 02 20 04 add %o0, 4, %g2 head->next = tail; 40012dd4: c4 22 00 00 st %g2, [ %o0 ] 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 ); 40012dd8: 84 02 20 0c add %o0, 0xc, %g2 head->next = tail; head->previous = NULL; 40012ddc: c0 22 20 04 clr [ %o0 + 4 ] tail->previous = head; 40012de0: c4 22 20 14 st %g2, [ %o0 + 0x14 ] 40012de4: d0 22 20 08 st %o0, [ %o0 + 8 ] { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); head->next = tail; head->previous = NULL; 40012de8: c0 22 20 10 clr [ %o0 + 0x10 ] 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 ); 40012dec: 86 02 20 10 add %o0, 0x10, %g3 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; 40012df0: 84 10 21 00 mov 0x100, %g2 head->next = tail; 40012df4: c6 22 20 0c st %g3, [ %o0 + 0xc ] 40012df8: c4 26 e0 7c st %g2, [ %i3 + 0x7c ] fs_info->uino_base = (vol->tot_secs << vol->sec_mul) << 4; 40012dfc: c6 06 e0 30 ld [ %i3 + 0x30 ], %g3 40012e00: c4 0e e0 03 ldub [ %i3 + 3 ], %g2 fs_info->index = 0; 40012e04: c0 26 e0 78 clr [ %i3 + 0x78 ] } 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; 40012e08: 85 28 c0 02 sll %g3, %g2, %g2 40012e0c: 85 28 a0 04 sll %g2, 4, %g2 fs_info->index = 0; fs_info->uino = (char *)calloc(fs_info->uino_pool_size, sizeof(char)); 40012e10: 90 10 21 00 mov 0x100, %o0 } 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; 40012e14: c4 26 e0 80 st %g2, [ %i3 + 0x80 ] fs_info->index = 0; fs_info->uino = (char *)calloc(fs_info->uino_pool_size, sizeof(char)); 40012e18: 7f ff c7 02 call 40004a20 40012e1c: 92 10 20 01 mov 1, %o1 if ( fs_info->uino == NULL ) 40012e20: 80 a2 20 00 cmp %o0, 0 40012e24: 12 80 00 0d bne 40012e58 <== ALWAYS TAKEN 40012e28: d0 26 e0 74 st %o0, [ %i3 + 0x74 ] 40012e2c: 30 80 00 05 b,a 40012e40 <== 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); 40012e30: 7f ff c7 13 call 40004a7c <== NOT EXECUTED 40012e34: d0 06 e0 60 ld [ %i3 + 0x60 ], %o0 <== NOT EXECUTED free(fs_info->vhash); 40012e38: 10 80 00 15 b 40012e8c <== NOT EXECUTED 40012e3c: d0 06 e0 6c ld [ %i3 + 0x6c ], %o0 <== 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); 40012e40: 7f ff c7 0f call 40004a7c <== NOT EXECUTED 40012e44: d0 06 e0 60 ld [ %i3 + 0x60 ], %o0 <== NOT EXECUTED free(fs_info->vhash); 40012e48: 7f ff c7 2e call 40004b00 <== NOT EXECUTED 40012e4c: d0 06 e0 6c ld [ %i3 + 0x6c ], %o0 <== NOT EXECUTED free(fs_info->rhash); 40012e50: 10 80 00 0f b 40012e8c <== NOT EXECUTED 40012e54: d0 06 e0 70 ld [ %i3 + 0x70 ], %o0 <== NOT EXECUTED rtems_set_errno_and_return_minus_one( ENOMEM ); } fs_info->sec_buf = (uint8_t *)calloc(vol->bps, sizeof(uint8_t)); 40012e58: d0 16 c0 00 lduh [ %i3 ], %o0 40012e5c: 7f ff c6 f1 call 40004a20 40012e60: 92 10 20 01 mov 1, %o1 if (fs_info->sec_buf == NULL) 40012e64: 80 a2 20 00 cmp %o0, 0 40012e68: 12 80 00 11 bne 40012eac <== ALWAYS TAKEN 40012e6c: d0 26 e0 90 st %o0, [ %i3 + 0x90 ] { close(vol->fd); 40012e70: 7f ff c7 03 call 40004a7c <== NOT EXECUTED 40012e74: d0 06 e0 60 ld [ %i3 + 0x60 ], %o0 <== NOT EXECUTED free(fs_info->vhash); 40012e78: 7f ff c7 22 call 40004b00 <== NOT EXECUTED 40012e7c: d0 06 e0 6c ld [ %i3 + 0x6c ], %o0 <== NOT EXECUTED free(fs_info->rhash); 40012e80: 7f ff c7 20 call 40004b00 <== NOT EXECUTED 40012e84: d0 06 e0 70 ld [ %i3 + 0x70 ], %o0 <== NOT EXECUTED free(fs_info->uino); 40012e88: d0 06 e0 74 ld [ %i3 + 0x74 ], %o0 <== NOT EXECUTED 40012e8c: 7f ff c7 1d call 40004b00 <== NOT EXECUTED 40012e90: 01 00 00 00 nop <== NOT EXECUTED rtems_set_errno_and_return_minus_one( ENOMEM ); 40012e94: 40 00 1b 26 call 40019b2c <__errno> <== NOT EXECUTED 40012e98: 01 00 00 00 nop <== NOT EXECUTED 40012e9c: 82 10 20 0c mov 0xc, %g1 ! c <== NOT EXECUTED 40012ea0: c2 22 00 00 st %g1, [ %o0 ] <== NOT EXECUTED 40012ea4: 81 c7 e0 08 ret <== NOT EXECUTED 40012ea8: 91 e8 3f ff restore %g0, -1, %o0 <== NOT EXECUTED return bytes_written; } static bool is_cluster_aligned(const fat_vol_t *vol, uint32_t sec_num) { return (sec_num & (vol->spc - 1)) == 0; 40012eac: c4 0e e0 04 ldub [ %i3 + 4 ], %g2 40012eb0: c6 06 e0 34 ld [ %i3 + 0x34 ], %g3 40012eb4: 84 00 bf ff add %g2, -1, %g2 /* * 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) 40012eb8: 80 88 80 03 btst %g2, %g3 40012ebc: 22 80 00 04 be,a 40012ecc <== ALWAYS TAKEN 40012ec0: c6 0e e0 0e ldub [ %i3 + 0xe ], %g3 vol->bytes_per_block_log2 = vol->bpc_log2; vol->sectors_per_block = vol->spc; } } return RC_OK; 40012ec4: 81 c7 e0 08 ret <== NOT EXECUTED 40012ec8: 91 e8 20 00 restore %g0, 0, %o0 <== NOT EXECUTED * 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))) 40012ecc: 80 a0 e0 04 cmp %g3, 4 40012ed0: 22 80 00 07 be,a 40012eec 40012ed4: d0 06 e0 64 ld [ %i3 + 0x64 ], %o0 return bytes_written; } static bool is_cluster_aligned(const fat_vol_t *vol, uint32_t sec_num) { return (sec_num & (vol->spc - 1)) == 0; 40012ed8: c6 06 e0 20 ld [ %i3 + 0x20 ], %g3 * 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))) 40012edc: 80 88 80 03 btst %g2, %g3 40012ee0: 12 80 00 0f bne 40012f1c <== NEVER TAKEN 40012ee4: b0 10 20 00 clr %i0 { sc = rtems_bdbuf_set_block_size (vol->dd, vol->bpc, true); 40012ee8: d0 06 e0 64 ld [ %i3 + 0x64 ], %o0 40012eec: d2 16 e0 06 lduh [ %i3 + 6 ], %o1 40012ef0: 7f ff f6 78 call 400108d0 40012ef4: 94 10 20 01 mov 1, %o2 if (sc == RTEMS_SUCCESSFUL) 40012ef8: 80 a2 20 00 cmp %o0, 0 40012efc: 12 80 00 08 bne 40012f1c <== NEVER TAKEN 40012f00: b0 10 20 00 clr %i0 { vol->bytes_per_block = vol->bpc; 40012f04: c4 16 e0 06 lduh [ %i3 + 6 ], %g2 40012f08: c4 36 e0 0a sth %g2, [ %i3 + 0xa ] vol->bytes_per_block_log2 = vol->bpc_log2; 40012f0c: c4 0e e0 08 ldub [ %i3 + 8 ], %g2 40012f10: c4 2e e0 0c stb %g2, [ %i3 + 0xc ] vol->sectors_per_block = vol->spc; 40012f14: c4 0e e0 04 ldub [ %i3 + 4 ], %g2 40012f18: c4 2e e0 09 stb %g2, [ %i3 + 9 ] } } return RC_OK; } 40012f1c: 81 c7 e0 08 ret 40012f20: 81 e8 00 00 restore =============================================================================== 4001850c : uint32_t count, uint32_t *cls_added, uint32_t *last_cl, bool zero_fill ) { 4001850c: 9d e3 bf 98 save %sp, -104, %sp 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; 40018510: e8 06 20 38 ld [ %i0 + 0x38 ], %l4 bool zero_fill ) { int rc = RC_OK; uint32_t cl4find = 2; uint32_t next_cln = 0; 40018514: c0 27 bf fc clr [ %fp + -4 ] uint32_t save_cln = 0; uint32_t data_cls_val = fs_info->vol.data_cls + 2; uint32_t i = 2; ssize_t bytes_written; *cls_added = 0; 40018518: c0 26 c0 00 clr [ %i3 ] if (count == 0) 4001851c: 80 a6 a0 00 cmp %i2, 0 40018520: 02 80 00 7e be 40018718 <== NEVER TAKEN 40018524: a2 10 20 00 clr %l1 return rc; if (fs_info->vol.next_cl != FAT_UNDEFINED_VALUE) 40018528: e0 06 20 4c ld [ %i0 + 0x4c ], %l0 4001852c: 80 a4 3f ff cmp %l0, -1 40018530: 22 80 00 02 be,a 40018538 40018534: a0 10 20 02 mov 2, %l0 { 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; 40018538: a8 05 20 02 add %l4, 2, %l4 4001853c: a6 10 20 02 mov 2, %l3 40018540: 10 80 00 5a b 400186a8 40018544: a4 10 20 00 clr %l2 * starting at cluster 2, so the maximum valid cluster number is * (fs_info->vol.data_cls + 1) */ while (i < data_cls_val) { rc = fat_get_fat_cluster(fs_info, cl4find, &next_cln); 40018548: 92 10 00 10 mov %l0, %o1 4001854c: 7f ff fe ae call 40018004 40018550: 94 07 bf fc add %fp, -4, %o2 if ( rc != RC_OK ) 40018554: a2 92 20 00 orcc %o0, 0, %l1 40018558: 02 80 00 0b be 40018584 <== ALWAYS TAKEN 4001855c: c2 07 bf fc ld [ %fp + -4 ], %g1 { if (*cls_added != 0) 40018560: c2 06 c0 00 ld [ %i3 ], %g1 <== NOT EXECUTED 40018564: 80 a0 60 00 cmp %g1, 0 <== NOT EXECUTED 40018568: 22 80 00 6d be,a 4001871c <== NOT EXECUTED 4001856c: b0 10 00 11 mov %l1, %i0 <== NOT EXECUTED fat_free_fat_clusters_chain(fs_info, (*chain)); 40018570: d2 06 40 00 ld [ %i1 ], %o1 <== NOT EXECUTED 40018574: 7f ff ff b7 call 40018450 <== NOT EXECUTED 40018578: 90 10 00 18 mov %i0, %o0 <== 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; } 4001857c: 81 c7 e0 08 ret <== NOT EXECUTED 40018580: 91 e8 00 11 restore %g0, %l1, %o0 <== NOT EXECUTED if (*cls_added != 0) fat_free_fat_clusters_chain(fs_info, (*chain)); return rc; } if (next_cln == FAT_GENFAT_FREE) 40018584: 80 a0 60 00 cmp %g1, 0 40018588: 32 80 00 44 bne,a 40018698 4001858c: a0 04 20 01 inc %l0 /* * 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) 40018590: c2 06 c0 00 ld [ %i3 ], %g1 40018594: 80 a0 60 00 cmp %g1, 0 40018598: 12 80 00 0e bne 400185d0 4001859c: 90 10 00 18 mov %i0, %o0 { *chain = cl4find; 400185a0: e0 26 40 00 st %l0, [ %i1 ] rc = fat_set_fat_cluster(fs_info, cl4find, FAT_GENFAT_EOC); 400185a4: 92 10 00 10 mov %l0, %o1 400185a8: 7f ff ff 09 call 400181cc 400185ac: 94 10 3f ff mov -1, %o2 if ( rc != RC_OK ) 400185b0: 80 a2 20 00 cmp %o0, 0 400185b4: 32 80 00 59 bne,a 40018718 <== NEVER TAKEN 400185b8: a2 10 00 08 mov %o0, %l1 <== NOT EXECUTED rc = fat_set_fat_cluster(fs_info, save_cln, cl4find); if ( rc != RC_OK ) goto cleanup; } if (zero_fill) 400185bc: 80 a7 60 00 cmp %i5, 0 400185c0: 22 80 00 18 be,a 40018620 400185c4: c2 06 c0 00 ld [ %i3 ], %g1 { bytes_written = fat_cluster_set (fs_info, cl4find, 0, fs_info->vol.bpc, 0); 400185c8: 10 80 00 1c b 40018638 400185cc: d6 16 20 06 lduh [ %i0 + 6 ], %o3 } } else { /* set EOC value to new allocated cluster */ rc = fat_set_fat_cluster(fs_info, cl4find, FAT_GENFAT_EOC); 400185d0: 92 10 00 10 mov %l0, %o1 400185d4: 7f ff fe fe call 400181cc 400185d8: 94 10 3f ff mov -1, %o2 400185dc: aa 10 00 08 mov %o0, %l5 if ( rc != RC_OK ) 400185e0: 80 a5 60 00 cmp %l5, 0 400185e4: 02 80 00 07 be 40018600 <== ALWAYS TAKEN 400185e8: 90 10 00 18 mov %i0, %o0 { /* cleanup activity */ fat_free_fat_clusters_chain(fs_info, (*chain)); 400185ec: d2 06 40 00 ld [ %i1 ], %o1 <== NOT EXECUTED 400185f0: 7f ff ff 98 call 40018450 <== NOT EXECUTED 400185f4: a2 10 00 15 mov %l5, %l1 <== 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; } 400185f8: 81 c7 e0 08 ret <== NOT EXECUTED 400185fc: 91 e8 00 11 restore %g0, %l1, %o0 <== NOT EXECUTED /* cleanup activity */ fat_free_fat_clusters_chain(fs_info, (*chain)); return rc; } rc = fat_set_fat_cluster(fs_info, save_cln, cl4find); 40018600: 92 10 00 12 mov %l2, %o1 40018604: 7f ff fe f2 call 400181cc 40018608: 94 10 00 10 mov %l0, %o2 if ( rc != RC_OK ) 4001860c: a4 92 20 00 orcc %o0, 0, %l2 40018610: 02 bf ff ec be 400185c0 <== ALWAYS TAKEN 40018614: 80 a7 60 00 cmp %i5, 0 return RC_OK; cleanup: /* cleanup activity */ fat_free_fat_clusters_chain(fs_info, (*chain)); 40018618: 10 80 00 35 b 400186ec <== NOT EXECUTED 4001861c: d2 06 40 00 ld [ %i1 ], %o1 <== NOT EXECUTED goto cleanup; } } save_cln = cl4find; (*cls_added)++; 40018620: 82 00 60 01 inc %g1 /* have we satisfied request ? */ if (*cls_added == count) 40018624: 80 a0 40 1a cmp %g1, %i2 40018628: 02 80 00 0f be 40018664 4001862c: c2 26 c0 00 st %g1, [ %i3 ] 40018630: 10 80 00 19 b 40018694 40018634: a4 10 00 10 mov %l0, %l2 goto cleanup; } if (zero_fill) { bytes_written = fat_cluster_set (fs_info, cl4find, 0, fs_info->vol.bpc, 0); 40018638: 90 10 00 18 mov %i0, %o0 4001863c: 92 10 00 10 mov %l0, %o1 40018640: 94 10 20 00 clr %o2 40018644: 7f ff e7 b5 call 40012518 40018648: 98 10 20 00 clr %o4 if (fs_info->vol.bpc != bytes_written) 4001864c: c2 16 20 06 lduh [ %i0 + 6 ], %g1 40018650: 80 a0 40 08 cmp %g1, %o0 40018654: 22 bf ff f3 be,a 40018620 <== ALWAYS TAKEN 40018658: c2 06 c0 00 ld [ %i3 ], %g1 { rc = -1; 4001865c: 10 80 00 23 b 400186e8 <== NOT EXECUTED 40018660: a4 10 3f ff mov -1, %l2 <== 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) 40018664: c2 06 20 44 ld [ %i0 + 0x44 ], %g1 40018668: 80 a0 7f ff cmp %g1, -1 4001866c: 02 80 00 05 be 40018680 <== ALWAYS TAKEN 40018670: e0 26 20 4c st %l0, [ %i0 + 0x4c ] fs_info->vol.free_cls -= (*cls_added); 40018674: c4 06 c0 00 ld [ %i3 ], %g2 <== NOT EXECUTED 40018678: 82 20 40 02 sub %g1, %g2, %g1 <== NOT EXECUTED 4001867c: c2 26 20 44 st %g1, [ %i0 + 0x44 ] <== NOT EXECUTED *last_cl = save_cln; 40018680: e0 27 00 00 st %l0, [ %i4 ] fat_buf_release(fs_info); 40018684: 7f ff e6 bc call 40012174 40018688: 90 10 00 18 mov %i0, %o0 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; } 4001868c: 81 c7 e0 08 ret 40018690: 91 e8 00 11 restore %g0, %l1, %o0 fat_buf_release(fs_info); return rc; } } i++; cl4find++; 40018694: a0 04 20 01 inc %l0 if (cl4find >= data_cls_val) 40018698: 80 a4 00 14 cmp %l0, %l4 4001869c: 0a 80 00 03 bcs 400186a8 <== ALWAYS TAKEN 400186a0: a6 04 e0 01 inc %l3 cl4find = 2; 400186a4: a0 10 20 02 mov 2, %l0 <== 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) 400186a8: 80 a4 c0 14 cmp %l3, %l4 400186ac: 0a bf ff a7 bcs 40018548 <== ALWAYS TAKEN 400186b0: 90 10 00 18 mov %i0, %o0 if (cl4find >= data_cls_val) cl4find = 2; } fs_info->vol.next_cl = save_cln; if (fs_info->vol.free_cls != FAT_UNDEFINED_VALUE) 400186b4: c2 06 20 44 ld [ %i0 + 0x44 ], %g1 <== NOT EXECUTED 400186b8: 80 a0 7f ff cmp %g1, -1 <== NOT EXECUTED 400186bc: 02 80 00 05 be 400186d0 <== NOT EXECUTED 400186c0: e4 26 20 4c st %l2, [ %i0 + 0x4c ] <== NOT EXECUTED fs_info->vol.free_cls -= (*cls_added); 400186c4: c4 06 c0 00 ld [ %i3 ], %g2 <== NOT EXECUTED 400186c8: 82 20 40 02 sub %g1, %g2, %g1 <== NOT EXECUTED 400186cc: c2 26 20 44 st %g1, [ %i0 + 0x44 ] <== NOT EXECUTED *last_cl = save_cln; 400186d0: e4 27 00 00 st %l2, [ %i4 ] <== NOT EXECUTED fat_buf_release(fs_info); 400186d4: 90 10 00 18 mov %i0, %o0 <== NOT EXECUTED 400186d8: 7f ff e6 a7 call 40012174 <== NOT EXECUTED 400186dc: a2 10 20 00 clr %l1 <== 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; } 400186e0: 81 c7 e0 08 ret <== NOT EXECUTED 400186e4: 91 e8 00 11 restore %g0, %l1, %o0 <== NOT EXECUTED return RC_OK; cleanup: /* cleanup activity */ fat_free_fat_clusters_chain(fs_info, (*chain)); 400186e8: d2 06 40 00 ld [ %i1 ], %o1 <== NOT EXECUTED 400186ec: 7f ff ff 59 call 40018450 <== NOT EXECUTED 400186f0: 90 10 00 18 mov %i0, %o0 <== NOT EXECUTED /* trying to save last allocated cluster for future use */ fat_set_fat_cluster(fs_info, cl4find, FAT_GENFAT_FREE); 400186f4: 92 10 00 10 mov %l0, %o1 <== NOT EXECUTED 400186f8: 94 10 20 00 clr %o2 <== NOT EXECUTED 400186fc: 7f ff fe b4 call 400181cc <== NOT EXECUTED 40018700: 90 10 00 18 mov %i0, %o0 <== NOT EXECUTED fat_buf_release(fs_info); 40018704: 90 10 00 18 mov %i0, %o0 <== NOT EXECUTED 40018708: 7f ff e6 9b call 40012174 <== NOT EXECUTED 4001870c: a2 10 00 12 mov %l2, %l1 <== NOT EXECUTED return rc; } 40018710: 81 c7 e0 08 ret <== NOT EXECUTED 40018714: 91 e8 00 11 restore %g0, %l1, %o0 <== NOT EXECUTED 40018718: b0 10 00 11 mov %l1, %i0 <== NOT EXECUTED 4001871c: 81 c7 e0 08 ret <== NOT EXECUTED 40018720: 81 e8 00 00 restore <== NOT EXECUTED =============================================================================== 40012480 : fat_fs_info_t *fs_info, uint32_t start, uint32_t offset, uint32_t count, const void *buff) { 40012480: 9d e3 bf 98 save %sp, -104, %sp int rc = RC_OK; ssize_t cmpltd = 0; 40012484: a0 10 20 00 clr %l0 uint32_t sec_num = start; uint32_t ofs = offset; uint8_t *sec_buf; uint32_t c = 0; while(count > 0) 40012488: 10 80 00 1b b 400124f4 4001248c: a2 10 20 01 mov 1, %l1 { c = MIN(count, (fs_info->vol.bps - ofs)); 40012490: ba 27 40 1a sub %i5, %i2, %i5 40012494: 80 a7 40 1b cmp %i5, %i3 40012498: 38 80 00 02 bgu,a 400124a0 4001249c: ba 10 00 1b mov %i3, %i5 if (c == fs_info->vol.bytes_per_block) 400124a0: c2 16 20 0a lduh [ %i0 + 0xa ], %g1 rc = fat_buf_access(fs_info, sec_num, FAT_OP_TYPE_GET, &sec_buf); 400124a4: 90 10 00 18 mov %i0, %o0 400124a8: 92 10 00 19 mov %i1, %o1 while(count > 0) { c = MIN(count, (fs_info->vol.bps - ofs)); if (c == fs_info->vol.bytes_per_block) 400124ac: 80 a7 40 01 cmp %i5, %g1 400124b0: 02 80 00 03 be 400124bc <== NEVER TAKEN 400124b4: 94 10 20 02 mov 2, %o2 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); 400124b8: 94 10 20 01 mov 1, %o2 400124bc: 7f ff ff a2 call 40012344 400124c0: 96 07 bf fc add %fp, -4, %o3 if (rc != RC_OK) 400124c4: 80 a2 20 00 cmp %o0, 0 400124c8: 12 80 00 10 bne 40012508 <== NEVER TAKEN 400124cc: d0 07 bf fc ld [ %fp + -4 ], %o0 return -1; memcpy((sec_buf + ofs), (buff + cmpltd), c); 400124d0: 92 07 00 10 add %i4, %l0, %o1 400124d4: 90 02 00 1a add %o0, %i2, %o0 400124d8: 94 10 00 1d mov %i5, %o2 400124dc: 40 00 20 39 call 4001a5c0 400124e0: b6 26 c0 1d sub %i3, %i5, %i3 fat_buf_mark_modified(fs_info); count -= c; cmpltd +=c; 400124e4: a0 07 40 10 add %i5, %l0, %l0 } static inline void fat_buf_mark_modified(fat_fs_info_t *fs_info) { fs_info->c.modified = true; 400124e8: e2 2e 20 88 stb %l1, [ %i0 + 0x88 ] sec_num++; 400124ec: b2 06 60 01 inc %i1 ofs = 0; 400124f0: b4 10 20 00 clr %i2 uint32_t sec_num = start; uint32_t ofs = offset; uint8_t *sec_buf; uint32_t c = 0; while(count > 0) 400124f4: 80 a6 e0 00 cmp %i3, 0 400124f8: 32 bf ff e6 bne,a 40012490 400124fc: fa 16 00 00 lduh [ %i0 ], %i5 cmpltd +=c; sec_num++; ofs = 0; } return cmpltd; } 40012500: 81 c7 e0 08 ret 40012504: 91 e8 00 10 restore %g0, %l0, %o0 if (c == fs_info->vol.bytes_per_block) rc = fat_buf_access(fs_info, sec_num, FAT_OP_TYPE_GET, &sec_buf); else rc = fat_buf_access(fs_info, sec_num, FAT_OP_TYPE_READ, &sec_buf); if (rc != RC_OK) return -1; 40012508: a0 10 3f ff mov -1, %l0 <== NOT EXECUTED cmpltd +=c; sec_num++; ofs = 0; } return cmpltd; } 4001250c: b0 10 00 10 mov %l0, %i0 <== NOT EXECUTED 40012510: 81 c7 e0 08 ret <== NOT EXECUTED 40012514: 81 e8 00 00 restore <== NOT EXECUTED =============================================================================== 400181cc : fat_set_fat_cluster( fat_fs_info_t *fs_info, uint32_t cln, uint32_t in_val ) { 400181cc: 9d e3 bf 98 save %sp, -104, %sp 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; 400181d0: c0 27 bf fc clr [ %fp + -4 ] /* sanity check */ if ( (cln < 2) || (cln > (fs_info->vol.data_cls + 1)) ) 400181d4: 80 a6 60 01 cmp %i1, 1 400181d8: 08 80 00 98 bleu 40018438 <== NEVER TAKEN 400181dc: ba 10 00 18 mov %i0, %i5 400181e0: c2 06 20 38 ld [ %i0 + 0x38 ], %g1 400181e4: 82 00 60 01 inc %g1 400181e8: 80 a6 40 01 cmp %i1, %g1 400181ec: 28 80 00 03 bleu,a 400181f8 <== ALWAYS TAKEN 400181f0: c2 0e 20 0e ldub [ %i0 + 0xe ], %g1 400181f4: 30 80 00 91 b,a 40018438 <== NOT EXECUTED rtems_set_errno_and_return_minus_one(EIO); sec = (FAT_FAT_OFFSET(fs_info->vol.type, cln) >> fs_info->vol.sec_log2) + 400181f8: 84 08 60 01 and %g1, 1, %g2 400181fc: 80 88 a0 ff btst 0xff, %g2 40018200: 02 80 00 05 be 40018214 40018204: 86 08 60 02 and %g1, 2, %g3 40018208: a1 36 60 01 srl %i1, 1, %l0 4001820c: 10 80 00 06 b 40018224 40018210: a0 04 00 19 add %l0, %i1, %l0 40018214: 80 88 e0 ff btst 0xff, %g3 40018218: 02 80 00 03 be 40018224 4001821c: a1 2e 60 02 sll %i1, 2, %l0 40018220: a1 2e 60 01 sll %i1, 1, %l0 40018224: c6 0f 60 02 ldub [ %i5 + 2 ], %g3 fs_info->vol.afat_loc; ofs = FAT_FAT_OFFSET(fs_info->vol.type, cln) & (fs_info->vol.bps - 1); 40018228: 80 88 a0 ff btst 0xff, %g2 /* 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) + 4001822c: a1 34 00 03 srl %l0, %g3, %l0 40018230: c6 07 60 58 ld [ %i5 + 0x58 ], %g3 fs_info->vol.afat_loc; ofs = FAT_FAT_OFFSET(fs_info->vol.type, cln) & (fs_info->vol.bps - 1); 40018234: 02 80 00 05 be 40018248 40018238: a0 04 00 03 add %l0, %g3, %l0 4001823c: b7 36 60 01 srl %i1, 1, %i3 40018240: 10 80 00 07 b 4001825c 40018244: b6 06 c0 19 add %i3, %i1, %i3 40018248: 82 08 60 02 and %g1, 2, %g1 4001824c: 80 88 60 ff btst 0xff, %g1 40018250: 02 80 00 03 be 4001825c 40018254: b7 2e 60 02 sll %i1, 2, %i3 40018258: b7 2e 60 01 sll %i1, 1, %i3 4001825c: f8 17 40 00 lduh [ %i5 ], %i4 rc = fat_buf_access(fs_info, sec, FAT_OP_TYPE_READ, &sec_buf); 40018260: 90 10 00 1d mov %i5, %o0 40018264: 92 10 00 10 mov %l0, %o1 40018268: 94 10 20 01 mov 1, %o2 4001826c: 7f ff e8 36 call 40012344 40018270: 96 07 bf fc add %fp, -4, %o3 if (rc != RC_OK) 40018274: b0 92 20 00 orcc %o0, 0, %i0 40018278: 12 80 00 4c bne 400183a8 <== NEVER TAKEN 4001827c: b9 2f 20 10 sll %i4, 0x10, %i4 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); 40018280: b9 37 20 10 srl %i4, 0x10, %i4 40018284: b8 07 3f ff add %i4, -1, %i4 40018288: b8 0e c0 1c and %i3, %i4, %i4 rc = fat_buf_access(fs_info, sec, FAT_OP_TYPE_READ, &sec_buf); if (rc != RC_OK) return rc; switch ( fs_info->vol.type ) 4001828c: f6 0f 60 0e ldub [ %i5 + 0xe ], %i3 40018290: 80 a6 e0 02 cmp %i3, 2 40018294: 02 80 00 53 be 400183e0 40018298: 80 a6 e0 04 cmp %i3, 4 4001829c: 02 80 00 5b be 40018408 400182a0: 80 a6 e0 01 cmp %i3, 1 400182a4: 12 80 00 65 bne 40018438 <== NEVER TAKEN 400182a8: 80 8e 60 01 btst 1, %i1 { case FAT_FAT12: if ( FAT_CLUSTER_IS_ODD(cln) ) 400182ac: 02 80 00 23 be 40018338 400182b0: c2 07 bf fc ld [ %fp + -4 ], %g1 { fat16_clv = ((uint16_t )in_val) << FAT_FAT12_SHIFT; *(sec_buf + ofs) &= 0x0F; 400182b4: c4 08 40 1c ldub [ %g1 + %i4 ], %g2 400182b8: 84 08 a0 0f and %g2, 0xf, %g2 400182bc: c4 28 40 1c stb %g2, [ %g1 + %i4 ] *(sec_buf + ofs) |= (uint8_t)(fat16_clv & 0x00F0); 400182c0: c2 07 bf fc ld [ %fp + -4 ], %g1 400182c4: 85 2e a0 04 sll %i2, 4, %g2 400182c8: c6 08 40 1c ldub [ %g1 + %i4 ], %g3 400182cc: 84 10 c0 02 or %g3, %g2, %g2 400182d0: c4 28 40 1c stb %g2, [ %g1 + %i4 ] fat_buf_mark_modified(fs_info); if ( ofs == (fs_info->vol.bps - 1) ) 400182d4: c2 17 40 00 lduh [ %i5 ], %g1 400182d8: 82 00 7f ff add %g1, -1, %g1 400182dc: 80 a7 00 01 cmp %i4, %g1 400182e0: 12 80 00 0f bne 4001831c <== ALWAYS TAKEN 400182e4: f6 2f 60 88 stb %i3, [ %i5 + 0x88 ] { rc = fat_buf_access(fs_info, sec + 1, FAT_OP_TYPE_READ, 400182e8: 90 10 00 1d mov %i5, %o0 <== NOT EXECUTED 400182ec: 92 04 20 01 add %l0, 1, %o1 <== NOT EXECUTED 400182f0: 94 10 20 01 mov 1, %o2 <== NOT EXECUTED 400182f4: 7f ff e8 14 call 40012344 <== NOT EXECUTED 400182f8: 96 07 bf fc add %fp, -4, %o3 <== NOT EXECUTED &sec_buf); if (rc != RC_OK) 400182fc: b0 92 20 00 orcc %o0, 0, %i0 <== NOT EXECUTED 40018300: 12 80 00 2a bne 400183a8 <== NOT EXECUTED 40018304: c2 07 bf fc ld [ %fp + -4 ], %g1 <== NOT EXECUTED return rc; *sec_buf &= 0x00; *sec_buf |= (uint8_t)((fat16_clv & 0xFF00)>>8); 40018308: b5 2e a0 14 sll %i2, 0x14, %i2 <== 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; 4001830c: c0 28 40 00 clrb [ %g1 ] <== NOT EXECUTED *sec_buf |= (uint8_t)((fat16_clv & 0xFF00)>>8); 40018310: b5 36 a0 18 srl %i2, 0x18, %i2 <== NOT EXECUTED 40018314: 10 80 00 21 b 40018398 <== NOT EXECUTED 40018318: c2 07 bf fc ld [ %fp + -4 ], %g1 <== NOT EXECUTED fat_buf_mark_modified(fs_info); } else { *(sec_buf + ofs + 1) &= 0x00; 4001831c: c2 07 bf fc ld [ %fp + -4 ], %g1 40018320: b8 07 20 01 inc %i4 *(sec_buf + ofs + 1) |= (uint8_t )((fat16_clv & 0xFF00)>>8); 40018324: b5 2e a0 14 sll %i2, 0x14, %i2 fat_buf_mark_modified(fs_info); } else { *(sec_buf + ofs + 1) &= 0x00; 40018328: c0 28 40 1c clrb [ %g1 + %i4 ] *(sec_buf + ofs + 1) |= (uint8_t )((fat16_clv & 0xFF00)>>8); 4001832c: b5 36 a0 18 srl %i2, 0x18, %i2 40018330: 10 80 00 27 b 400183cc 40018334: c2 07 bf fc ld [ %fp + -4 ], %g1 } } else { fat16_clv = ((uint16_t )in_val) & FAT_FAT12_MASK; *(sec_buf + ofs) &= 0x00; 40018338: c0 28 40 1c clrb [ %g1 + %i4 ] *(sec_buf + ofs) |= (uint8_t)(fat16_clv & 0x00FF); 4001833c: c2 07 bf fc ld [ %fp + -4 ], %g1 *(sec_buf + ofs + 1) |= (uint8_t )((fat16_clv & 0xFF00)>>8); } } else { fat16_clv = ((uint16_t )in_val) & FAT_FAT12_MASK; 40018340: b4 0e af ff and %i2, 0xfff, %i2 *(sec_buf + ofs) &= 0x00; *(sec_buf + ofs) |= (uint8_t)(fat16_clv & 0x00FF); 40018344: c4 08 40 1c ldub [ %g1 + %i4 ], %g2 40018348: 84 10 80 1a or %g2, %i2, %g2 4001834c: c4 28 40 1c stb %g2, [ %g1 + %i4 ] fat_buf_mark_modified(fs_info); if ( ofs == (fs_info->vol.bps - 1) ) 40018350: c2 17 40 00 lduh [ %i5 ], %g1 40018354: 82 00 7f ff add %g1, -1, %g1 40018358: 80 a7 00 01 cmp %i4, %g1 4001835c: 12 80 00 15 bne 400183b0 <== ALWAYS TAKEN 40018360: f6 2f 60 88 stb %i3, [ %i5 + 0x88 ] { rc = fat_buf_access(fs_info, sec + 1, FAT_OP_TYPE_READ, 40018364: 90 10 00 1d mov %i5, %o0 <== NOT EXECUTED 40018368: 92 04 20 01 add %l0, 1, %o1 <== NOT EXECUTED 4001836c: 94 10 20 01 mov 1, %o2 <== NOT EXECUTED 40018370: 7f ff e7 f5 call 40012344 <== NOT EXECUTED 40018374: 96 07 bf fc add %fp, -4, %o3 <== NOT EXECUTED &sec_buf); if (rc != RC_OK) 40018378: b0 92 20 00 orcc %o0, 0, %i0 <== NOT EXECUTED 4001837c: 12 80 00 0b bne 400183a8 <== NOT EXECUTED 40018380: c2 07 bf fc ld [ %fp + -4 ], %g1 <== NOT EXECUTED return rc; *sec_buf &= 0xF0; *sec_buf |= (uint8_t)((fat16_clv & 0xFF00)>>8); 40018384: b5 36 a0 08 srl %i2, 8, %i2 <== 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; 40018388: c4 08 40 00 ldub [ %g1 ], %g2 <== NOT EXECUTED 4001838c: 84 08 bf f0 and %g2, -16, %g2 <== NOT EXECUTED 40018390: c4 28 40 00 stb %g2, [ %g1 ] <== NOT EXECUTED *sec_buf |= (uint8_t)((fat16_clv & 0xFF00)>>8); 40018394: c2 07 bf fc ld [ %fp + -4 ], %g1 <== NOT EXECUTED 40018398: c4 08 40 00 ldub [ %g1 ], %g2 <== NOT EXECUTED 4001839c: b4 16 80 02 or %i2, %g2, %i2 <== NOT EXECUTED 400183a0: f4 28 40 00 stb %i2, [ %g1 ] <== NOT EXECUTED } static inline void fat_buf_mark_modified(fat_fs_info_t *fs_info) { fs_info->c.modified = true; 400183a4: f6 2f 60 88 stb %i3, [ %i5 + 0x88 ] <== NOT EXECUTED 400183a8: 81 c7 e0 08 ret <== NOT EXECUTED 400183ac: 81 e8 00 00 restore <== NOT EXECUTED fat_buf_mark_modified(fs_info); } else { *(sec_buf + ofs + 1) &= 0xF0; 400183b0: c2 07 bf fc ld [ %fp + -4 ], %g1 400183b4: b8 07 20 01 inc %i4 400183b8: c4 08 40 1c ldub [ %g1 + %i4 ], %g2 *(sec_buf + ofs+1) |= (uint8_t)((fat16_clv & 0xFF00)>>8); 400183bc: b5 36 a0 08 srl %i2, 8, %i2 fat_buf_mark_modified(fs_info); } else { *(sec_buf + ofs + 1) &= 0xF0; 400183c0: 84 08 bf f0 and %g2, -16, %g2 400183c4: c4 28 40 1c stb %g2, [ %g1 + %i4 ] *(sec_buf + ofs+1) |= (uint8_t)((fat16_clv & 0xFF00)>>8); 400183c8: c2 07 bf fc ld [ %fp + -4 ], %g1 400183cc: c4 08 40 1c ldub [ %g1 + %i4 ], %g2 400183d0: b4 10 80 1a or %g2, %i2, %i2 400183d4: f4 28 40 1c stb %i2, [ %g1 + %i4 ] 400183d8: 81 c7 e0 08 ret 400183dc: 81 e8 00 00 restore break; } return RC_OK; } 400183e0: 03 00 00 3f sethi %hi(0xfc00), %g1 400183e4: 82 10 63 ff or %g1, 0x3ff, %g1 ! ffff 400183e8: 82 0e 80 01 and %i2, %g1, %g1 } break; case FAT_FAT16: *((uint16_t *)(sec_buf + ofs)) = (uint16_t )(CT_LE_W(in_val)); 400183ec: 83 28 60 08 sll %g1, 8, %g1 400183f0: b5 2e a0 10 sll %i2, 0x10, %i2 400183f4: b5 36 a0 18 srl %i2, 0x18, %i2 400183f8: b4 10 40 1a or %g1, %i2, %i2 } } break; case FAT_FAT16: *((uint16_t *)(sec_buf + ofs)) = 400183fc: c2 07 bf fc ld [ %fp + -4 ], %g1 40018400: 10 80 00 0a b 40018428 40018404: f4 30 40 1c sth %i2, [ %g1 + %i4 ] (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)); 40018408: 11 3c 00 00 sethi %hi(0xf0000000), %o0 4001840c: 7f ff fe f2 call 40017fd4 40018410: 90 2e 80 08 andn %i2, %o0, %o0 *((uint32_t *)(sec_buf + ofs)) &= CT_LE_L(0xF0000000); 40018414: c2 07 bf fc ld [ %fp + -4 ], %g1 40018418: c4 00 40 1c ld [ %g1 + %i4 ], %g2 4001841c: 84 08 a0 f0 and %g2, 0xf0, %g2 *((uint32_t *)(sec_buf + ofs)) |= fat32_clv; 40018420: 90 12 00 02 or %o0, %g2, %o0 40018424: d0 20 40 1c st %o0, [ %g1 + %i4 ] 40018428: 82 10 20 01 mov 1, %g1 4001842c: c2 2f 60 88 stb %g1, [ %i5 + 0x88 ] 40018430: 81 c7 e0 08 ret 40018434: 81 e8 00 00 restore fat_buf_mark_modified(fs_info); break; default: rtems_set_errno_and_return_minus_one(EIO); 40018438: 40 00 05 bd call 40019b2c <__errno> <== NOT EXECUTED 4001843c: b0 10 3f ff mov -1, %i0 <== NOT EXECUTED 40018440: 82 10 20 05 mov 5, %g1 <== NOT EXECUTED 40018444: c2 22 00 00 st %g1, [ %o0 ] <== NOT EXECUTED break; } return RC_OK; } 40018448: 81 c7 e0 08 ret <== NOT EXECUTED 4001844c: 81 e8 00 00 restore <== NOT EXECUTED =============================================================================== 40012ff4 : * RC_OK on success, or -1 if error occured * and errno set appropriately */ int fat_shutdown_drive(fat_fs_info_t *fs_info) { 40012ff4: 9d e3 bf a0 save %sp, -96, %sp int rc = RC_OK; int i = 0; rc = fat_sync(fs_info); 40012ff8: 90 10 00 18 mov %i0, %o0 40012ffc: 7f ff ff ca call 40012f24 40013000: ba 10 00 18 mov %i0, %i5 if ( rc != RC_OK ) 40013004: b0 92 20 00 orcc %o0, 0, %i0 40013008: 32 80 00 02 bne,a 40013010 <== NEVER TAKEN 4001300c: b0 10 3f ff mov -1, %i0 <== NOT EXECUTED rc = -1; 40013010: b8 10 20 00 clr %i4 for (i = 0; i < FAT_HASH_SIZE; i++) { rtems_chain_node *node = NULL; rtems_chain_control *the_chain = fs_info->vhash + i; 40013014: f6 07 60 6c ld [ %i5 + 0x6c ], %i3 while ( (node = rtems_chain_get(the_chain)) != NULL ) 40013018: 10 80 00 04 b 40013028 4001301c: b6 06 c0 1c add %i3, %i4, %i3 free(node); 40013020: 7f ff c6 b8 call 40004b00 40013024: 01 00 00 00 nop */ RTEMS_INLINE_ROUTINE rtems_chain_node *rtems_chain_get( rtems_chain_control *the_chain ) { return _Chain_Get( the_chain ); 40013028: 7f ff da 77 call 40009a04 <_Chain_Get> 4001302c: 90 10 00 1b mov %i3, %o0 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 ) 40013030: 80 a2 20 00 cmp %o0, 0 40013034: 12 bf ff fb bne 40013020 40013038: 01 00 00 00 nop 4001303c: b8 07 20 0c add %i4, 0xc, %i4 rc = fat_sync(fs_info); if ( rc != RC_OK ) rc = -1; for (i = 0; i < FAT_HASH_SIZE; i++) 40013040: 80 a7 20 18 cmp %i4, 0x18 40013044: 32 bf ff f5 bne,a 40013018 40013048: f6 07 60 6c ld [ %i5 + 0x6c ], %i3 4001304c: b8 10 20 00 clr %i4 } for (i = 0; i < FAT_HASH_SIZE; i++) { rtems_chain_node *node = NULL; rtems_chain_control *the_chain = fs_info->rhash + i; 40013050: f6 07 60 70 ld [ %i5 + 0x70 ], %i3 while ( (node = rtems_chain_get(the_chain)) != NULL ) 40013054: 10 80 00 04 b 40013064 40013058: b6 06 c0 1c add %i3, %i4, %i3 free(node); 4001305c: 7f ff c6 a9 call 40004b00 <== NOT EXECUTED 40013060: 01 00 00 00 nop <== NOT EXECUTED 40013064: 7f ff da 68 call 40009a04 <_Chain_Get> 40013068: 90 10 00 1b mov %i3, %o0 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 ) 4001306c: 80 a2 20 00 cmp %o0, 0 40013070: 12 bf ff fb bne 4001305c <== NEVER TAKEN 40013074: 01 00 00 00 nop 40013078: b8 07 20 0c add %i4, 0xc, %i4 while ( (node = rtems_chain_get(the_chain)) != NULL ) free(node); } for (i = 0; i < FAT_HASH_SIZE; i++) 4001307c: 80 a7 20 18 cmp %i4, 0x18 40013080: 32 bf ff f5 bne,a 40013054 40013084: f6 07 60 70 ld [ %i5 + 0x70 ], %i3 while ( (node = rtems_chain_get(the_chain)) != NULL ) free(node); } free(fs_info->vhash); 40013088: 7f ff c6 9e call 40004b00 4001308c: d0 07 60 6c ld [ %i5 + 0x6c ], %o0 free(fs_info->rhash); 40013090: 7f ff c6 9c call 40004b00 40013094: d0 07 60 70 ld [ %i5 + 0x70 ], %o0 free(fs_info->uino); 40013098: 7f ff c6 9a call 40004b00 4001309c: d0 07 60 74 ld [ %i5 + 0x74 ], %o0 free(fs_info->sec_buf); 400130a0: 7f ff c6 98 call 40004b00 400130a4: d0 07 60 90 ld [ %i5 + 0x90 ], %o0 close(fs_info->vol.fd); 400130a8: 7f ff c6 75 call 40004a7c 400130ac: d0 07 60 60 ld [ %i5 + 0x60 ], %o0 if (rc) 400130b0: 80 a6 20 00 cmp %i0, 0 400130b4: 02 80 00 06 be 400130cc <== ALWAYS TAKEN 400130b8: 01 00 00 00 nop errno = EIO; 400130bc: 40 00 1a 9c call 40019b2c <__errno> <== NOT EXECUTED 400130c0: 01 00 00 00 nop <== NOT EXECUTED 400130c4: 82 10 20 05 mov 5, %g1 ! 5 <== NOT EXECUTED 400130c8: c2 22 00 00 st %g1, [ %o0 ] <== NOT EXECUTED return rc; } 400130cc: 81 c7 e0 08 ret 400130d0: 81 e8 00 00 restore =============================================================================== 40012f24 : return RC_OK; } int fat_sync(fat_fs_info_t *fs_info) { 40012f24: 9d e3 bf 98 save %sp, -104, %sp 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) 40012f28: c4 0e 20 0e ldub [ %i0 + 0xe ], %g2 return RC_OK; } int fat_sync(fat_fs_info_t *fs_info) { 40012f2c: ba 10 00 18 mov %i0, %i5 * RC_OK on success, or -1 if error occured (errno set appropriately) */ static int fat_fat32_update_fsinfo_sector(fat_fs_info_t *fs_info) { ssize_t ret1 = 0, ret2 = 0; 40012f30: 90 10 20 00 clr %o0 if (fs_info->vol.type == FAT_FAT32) 40012f34: 80 a0 a0 04 cmp %g2, 4 40012f38: 12 80 00 20 bne 40012fb8 40012f3c: b4 10 20 00 clr %i2 { uint32_t free_count = fs_info->vol.free_cls; 40012f40: f6 06 20 44 ld [ %i0 + 0x44 ], %i3 uint32_t next_free = fs_info->vol.next_cl; if (free_count != fs_info->vol.free_cls_in_fs_info) 40012f44: c2 06 20 48 ld [ %i0 + 0x48 ], %g1 40012f48: 80 a6 c0 01 cmp %i3, %g1 40012f4c: 02 80 00 0d be 40012f80 <== ALWAYS TAKEN 40012f50: f8 06 20 4c ld [ %i0 + 0x4c ], %i4 { uint32_t le_free_count = CT_LE_L(free_count); 40012f54: 7f ff fc 65 call 400120e8 <== NOT EXECUTED 40012f58: 90 10 00 1b mov %i3, %o0 <== NOT EXECUTED fs_info->vol.free_cls_in_fs_info = free_count; ret1 = fat_sector_write(fs_info, 40012f5c: d2 16 20 40 lduh [ %i0 + 0x40 ], %o1 <== 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); 40012f60: d0 27 bf fc st %o0, [ %fp + -4 ] <== NOT EXECUTED fs_info->vol.free_cls_in_fs_info = free_count; 40012f64: f6 26 20 48 st %i3, [ %i0 + 0x48 ] <== NOT EXECUTED ret1 = fat_sector_write(fs_info, 40012f68: 90 10 00 18 mov %i0, %o0 <== NOT EXECUTED 40012f6c: 94 10 21 e8 mov 0x1e8, %o2 <== NOT EXECUTED 40012f70: 96 10 20 04 mov 4, %o3 <== NOT EXECUTED 40012f74: 7f ff fd 43 call 40012480 <== NOT EXECUTED 40012f78: 98 07 bf fc add %fp, -4, %o4 <== NOT EXECUTED 40012f7c: b4 10 00 08 mov %o0, %i2 <== 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) 40012f80: c4 07 60 50 ld [ %i5 + 0x50 ], %g2 40012f84: 80 a7 00 02 cmp %i4, %g2 40012f88: 02 80 00 0c be 40012fb8 <== NEVER TAKEN 40012f8c: 90 10 20 00 clr %o0 { uint32_t le_next_free = CT_LE_L(next_free); 40012f90: 7f ff fc 56 call 400120e8 40012f94: 90 10 00 1c mov %i4, %o0 fs_info->vol.next_cl_in_fs_info = next_free; ret2 = fat_sector_write(fs_info, 40012f98: d2 17 60 40 lduh [ %i5 + 0x40 ], %o1 &le_free_count); } if (next_free != fs_info->vol.next_cl_in_fs_info) { uint32_t le_next_free = CT_LE_L(next_free); 40012f9c: d0 27 bf fc st %o0, [ %fp + -4 ] fs_info->vol.next_cl_in_fs_info = next_free; 40012fa0: f8 27 60 50 st %i4, [ %i5 + 0x50 ] ret2 = fat_sector_write(fs_info, 40012fa4: 90 10 00 1d mov %i5, %o0 40012fa8: 94 10 21 ec mov 0x1ec, %o2 40012fac: 96 10 20 04 mov 4, %o3 40012fb0: 7f ff fd 34 call 40012480 40012fb4: 98 07 bf fc add %fp, -4, %o4 sizeof(le_next_free), &le_next_free); } } if ( (ret1 < 0) || (ret2 < 0) ) 40012fb8: 80 a2 20 00 cmp %o0, 0 40012fbc: 06 80 00 04 bl 40012fcc <== NEVER TAKEN 40012fc0: 80 a6 a0 00 cmp %i2, 0 40012fc4: 16 80 00 03 bge 40012fd0 <== ALWAYS TAKEN 40012fc8: b0 10 20 00 clr %i0 { int rc = RC_OK; rc = fat_fat32_update_fsinfo_sector(fs_info); if ( rc != RC_OK ) rc = -1; 40012fcc: b0 10 3f ff mov -1, %i0 <== NOT EXECUTED fat_buf_release(fs_info); 40012fd0: 7f ff fc 69 call 40012174 40012fd4: 90 10 00 1d mov %i5, %o0 if (rtems_bdbuf_syncdev(fs_info->vol.dd) != RTEMS_SUCCESSFUL) 40012fd8: 7f ff f5 bb call 400106c4 40012fdc: d0 07 60 64 ld [ %i5 + 0x64 ], %o0 40012fe0: 80 a2 20 00 cmp %o0, 0 40012fe4: 32 80 00 02 bne,a 40012fec <== NEVER TAKEN 40012fe8: b0 10 3f ff mov -1, %i0 <== NOT EXECUTED rc = -1; return rc; } 40012fec: 81 c7 e0 08 ret 40012ff0: 81 e8 00 00 restore =============================================================================== 400311a8 : /** * compatible with SVr4, 4.4BSD and X/OPEN - Change Directory */ int fchdir( int fd ) { 400311a8: 9d e3 bf 40 save %sp, -192, %sp <== NOT EXECUTED st.st_mode = 0; st.st_uid = 0; st.st_gid = 0; rtems_libio_check_fd( fd ); 400311ac: 03 10 01 76 sethi %hi(0x4005d800), %g1 <== NOT EXECUTED 400311b0: c2 00 62 10 ld [ %g1 + 0x210 ], %g1 ! 4005da10 <== NOT EXECUTED int rv = 0; rtems_libio_t *iop; struct stat st; rtems_filesystem_location_info_t loc; st.st_mode = 0; 400311b4: c0 27 bf c4 clr [ %fp + -60 ] <== NOT EXECUTED st.st_uid = 0; 400311b8: c0 37 bf ca clrh [ %fp + -54 ] <== NOT EXECUTED st.st_gid = 0; rtems_libio_check_fd( fd ); 400311bc: 80 a6 00 01 cmp %i0, %g1 <== NOT EXECUTED 400311c0: 1a 80 00 0c bcc 400311f0 <== NOT EXECUTED 400311c4: c0 37 bf cc clrh [ %fp + -52 ] <== NOT EXECUTED iop = rtems_libio_iop( fd ); 400311c8: 83 2e 20 03 sll %i0, 3, %g1 <== NOT EXECUTED 400311cc: b1 2e 20 06 sll %i0, 6, %i0 <== NOT EXECUTED 400311d0: b0 26 00 01 sub %i0, %g1, %i0 <== NOT EXECUTED 400311d4: 03 10 01 86 sethi %hi(0x40061800), %g1 <== NOT EXECUTED 400311d8: fa 00 62 74 ld [ %g1 + 0x274 ], %i5 ! 40061a74 <== NOT EXECUTED 400311dc: ba 07 40 18 add %i5, %i0, %i5 <== NOT EXECUTED rtems_libio_check_is_open( iop ); 400311e0: c2 07 60 10 ld [ %i5 + 0x10 ], %g1 <== NOT EXECUTED 400311e4: 80 88 61 00 btst 0x100, %g1 <== NOT EXECUTED 400311e8: 32 80 00 08 bne,a 40031208 <== NOT EXECUTED 400311ec: d0 07 60 28 ld [ %i5 + 0x28 ], %o0 <== NOT EXECUTED 400311f0: 40 00 10 c1 call 400354f4 <__errno> <== NOT EXECUTED 400311f4: b0 10 3f ff mov -1, %i0 <== NOT EXECUTED 400311f8: 82 10 20 09 mov 9, %g1 <== NOT EXECUTED 400311fc: c2 22 00 00 st %g1, [ %o0 ] <== NOT EXECUTED 40031200: 81 c7 e0 08 ret <== NOT EXECUTED 40031204: 81 e8 00 00 restore <== NOT EXECUTED 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 ); 40031208: c2 02 20 0c ld [ %o0 + 0xc ], %g1 <== NOT EXECUTED 4003120c: c2 00 40 00 ld [ %g1 ], %g1 <== NOT EXECUTED 40031210: 9f c0 40 00 call %g1 <== NOT EXECUTED 40031214: b8 07 60 14 add %i5, 0x14, %i4 <== NOT EXECUTED rtems_filesystem_instance_lock( &iop->pathinfo ); rv = (*iop->pathinfo.handlers->fstat_h)( &iop->pathinfo, &st ); 40031218: c2 07 60 24 ld [ %i5 + 0x24 ], %g1 <== NOT EXECUTED 4003121c: 90 10 00 1c mov %i4, %o0 <== NOT EXECUTED 40031220: c2 00 60 18 ld [ %g1 + 0x18 ], %g1 <== NOT EXECUTED 40031224: 9f c0 40 00 call %g1 <== NOT EXECUTED 40031228: 92 07 bf b8 add %fp, -72, %o1 <== NOT EXECUTED if ( rv == 0 ) { 4003122c: b0 92 20 00 orcc %o0, 0, %i0 <== NOT EXECUTED 40031230: 32 80 00 13 bne,a 4003127c <== NOT EXECUTED 40031234: d0 07 60 28 ld [ %i5 + 0x28 ], %o0 <== NOT EXECUTED bool access_ok = rtems_filesystem_check_access( 40031238: d2 07 bf c4 ld [ %fp + -60 ], %o1 <== NOT EXECUTED 4003123c: d4 17 bf ca lduh [ %fp + -54 ], %o2 <== NOT EXECUTED 40031240: d6 17 bf cc lduh [ %fp + -52 ], %o3 <== NOT EXECUTED 40031244: 7f ff 70 c2 call 4000d54c <== NOT EXECUTED 40031248: 90 10 20 01 mov 1, %o0 <== NOT EXECUTED st.st_mode, st.st_uid, st.st_gid ); if ( access_ok ) { 4003124c: 80 8a 20 ff btst 0xff, %o0 <== NOT EXECUTED 40031250: 02 80 00 06 be 40031268 <== NOT EXECUTED 40031254: 90 07 bf a0 add %fp, -96, %o0 <== NOT EXECUTED rtems_filesystem_location_clone( &loc, &iop->pathinfo ); 40031258: 7f ff 6f 31 call 4000cf1c <== NOT EXECUTED 4003125c: 92 10 00 1c mov %i4, %o1 <== NOT EXECUTED static inline void rtems_filesystem_instance_unlock( const rtems_filesystem_location_info_t *loc ) { const rtems_filesystem_mount_table_entry_t *mt_entry = loc->mt_entry; 40031260: 10 80 00 07 b 4003127c <== NOT EXECUTED 40031264: d0 07 60 28 ld [ %i5 + 0x28 ], %o0 <== NOT EXECUTED } else { errno = EACCES; 40031268: 40 00 10 a3 call 400354f4 <__errno> <== NOT EXECUTED 4003126c: b0 10 3f ff mov -1, %i0 <== NOT EXECUTED 40031270: 82 10 20 0d mov 0xd, %g1 <== NOT EXECUTED 40031274: c2 22 00 00 st %g1, [ %o0 ] <== NOT EXECUTED 40031278: d0 07 60 28 ld [ %i5 + 0x28 ], %o0 <== NOT EXECUTED (*mt_entry->ops->unlock_h)( mt_entry ); 4003127c: c2 02 20 0c ld [ %o0 + 0xc ], %g1 <== NOT EXECUTED 40031280: c2 00 60 04 ld [ %g1 + 4 ], %g1 <== NOT EXECUTED 40031284: 9f c0 40 00 call %g1 <== NOT EXECUTED 40031288: 01 00 00 00 nop <== NOT EXECUTED rv = -1; } } rtems_filesystem_instance_unlock( &iop->pathinfo ); if ( rv == 0 ) { 4003128c: 80 a6 20 00 cmp %i0, 0 <== NOT EXECUTED 40031290: 12 80 00 05 bne 400312a4 <== NOT EXECUTED 40031294: 01 00 00 00 nop <== NOT EXECUTED rv = rtems_filesystem_chdir( &loc ); 40031298: 7f ff c4 0b call 400222c4 <== NOT EXECUTED 4003129c: 90 07 bf a0 add %fp, -96, %o0 <== NOT EXECUTED 400312a0: b0 10 00 08 mov %o0, %i0 <== NOT EXECUTED } return rv; } 400312a4: 81 c7 e0 08 ret <== NOT EXECUTED 400312a8: 81 e8 00 00 restore <== NOT EXECUTED 400312ac: 40 03 13 54 call 400f5ffc <__end+0x93d3c> <== NOT EXECUTED 400312b0: 40 03 14 30 call 400f6370 <__end+0x940b0> <== NOT EXECUTED 400312b4: 40 03 14 3c call 400f63a4 <__end+0x940e4> <== NOT EXECUTED 400312b8: 40 03 14 54 call 400f6408 <__end+0x94148> <== NOT EXECUTED 400312bc: 40 03 14 64 call 400f644c <__end+0x9418c> <== NOT EXECUTED 400312c0: 40 03 14 88 call 400f64e0 <__end+0x94220> <== NOT EXECUTED 400312c4: 40 03 14 88 call 400f64e4 <__end+0x94224> <== NOT EXECUTED 400312c8: 40 03 14 88 call 400f64e8 <__end+0x94228> <== NOT EXECUTED 400312cc: 40 03 14 88 call 400f64ec <__end+0x9422c> <== NOT EXECUTED 400312d0: 40 03 14 88 call 400f64f0 <__end+0x94230> <== NOT EXECUTED =============================================================================== 4002281c : /** * POSIX 1003.1b 5.6.4 - Change File Modes */ int fchmod( int fd, mode_t mode ) { 4002281c: 9d e3 bf a0 save %sp, -96, %sp int rv; rtems_libio_t *iop; rtems_libio_check_fd( fd ); 40022820: 03 10 01 76 sethi %hi(0x4005d800), %g1 40022824: c2 00 62 10 ld [ %g1 + 0x210 ], %g1 ! 4005da10 40022828: 80 a6 00 01 cmp %i0, %g1 4002282c: 2a 80 00 03 bcs,a 40022838 40022830: 83 2e 20 03 sll %i0, 3, %g1 40022834: 30 80 00 0a b,a 4002285c iop = rtems_libio_iop( fd ); 40022838: b1 2e 20 06 sll %i0, 6, %i0 4002283c: b0 26 00 01 sub %i0, %g1, %i0 40022840: 03 10 01 86 sethi %hi(0x40061800), %g1 40022844: fa 00 62 74 ld [ %g1 + 0x274 ], %i5 ! 40061a74 40022848: ba 07 40 18 add %i5, %i0, %i5 rtems_libio_check_is_open(iop); 4002284c: c2 07 60 10 ld [ %i5 + 0x10 ], %g1 40022850: 80 88 61 00 btst 0x100, %g1 40022854: 32 80 00 06 bne,a 4002286c 40022858: d0 07 60 28 ld [ %i5 + 0x28 ], %o0 4002285c: 40 00 4b 26 call 400354f4 <__errno> 40022860: 01 00 00 00 nop 40022864: 10 80 00 1b b 400228d0 40022868: 82 10 20 09 mov 9, %g1 ! 9 if (iop->pathinfo.mt_entry->writeable) { 4002286c: c2 0a 20 29 ldub [ %o0 + 0x29 ], %g1 40022870: 80 a0 60 00 cmp %g1, 0 40022874: 02 80 00 14 be 400228c4 <== NEVER TAKEN 40022878: 01 00 00 00 nop 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 ); 4002287c: c2 02 20 0c ld [ %o0 + 0xc ], %g1 40022880: c2 00 40 00 ld [ %g1 ], %g1 40022884: 9f c0 40 00 call %g1 40022888: 01 00 00 00 nop rtems_filesystem_instance_lock( &iop->pathinfo ); rv = (*iop->pathinfo.mt_entry->ops->fchmod_h)( &iop->pathinfo, mode ); 4002288c: c2 07 60 28 ld [ %i5 + 0x28 ], %g1 40022890: 90 07 60 14 add %i5, 0x14, %o0 40022894: c2 00 60 0c ld [ %g1 + 0xc ], %g1 40022898: c2 00 60 20 ld [ %g1 + 0x20 ], %g1 4002289c: 9f c0 40 00 call %g1 400228a0: 92 10 00 19 mov %i1, %o1 400228a4: b0 10 00 08 mov %o0, %i0 static inline void rtems_filesystem_instance_unlock( const rtems_filesystem_location_info_t *loc ) { const rtems_filesystem_mount_table_entry_t *mt_entry = loc->mt_entry; 400228a8: d0 07 60 28 ld [ %i5 + 0x28 ], %o0 (*mt_entry->ops->unlock_h)( mt_entry ); 400228ac: c2 02 20 0c ld [ %o0 + 0xc ], %g1 400228b0: c2 00 60 04 ld [ %g1 + 4 ], %g1 400228b4: 9f c0 40 00 call %g1 400228b8: 01 00 00 00 nop 400228bc: 81 c7 e0 08 ret 400228c0: 81 e8 00 00 restore rtems_filesystem_instance_unlock( &iop->pathinfo ); } else { errno = EROFS; 400228c4: 40 00 4b 0c call 400354f4 <__errno> <== NOT EXECUTED 400228c8: 01 00 00 00 nop <== NOT EXECUTED 400228cc: 82 10 20 1e mov 0x1e, %g1 ! 1e <== NOT EXECUTED 400228d0: c2 22 00 00 st %g1, [ %o0 ] rv = -1; } return rv; } 400228d4: 81 c7 e0 08 ret 400228d8: 91 e8 3f ff restore %g0, -1, %o0 =============================================================================== 400228dc : /** * POSIX 1003.1b 5.6.5 - Change Owner and Group of a File */ int fchown( int fd, uid_t owner, gid_t group ) { 400228dc: 9d e3 bf a0 save %sp, -96, %sp int rv = 0; rtems_libio_t *iop; rtems_libio_check_fd( fd ); 400228e0: 03 10 01 76 sethi %hi(0x4005d800), %g1 400228e4: c2 00 62 10 ld [ %g1 + 0x210 ], %g1 ! 4005da10 400228e8: 80 a6 00 01 cmp %i0, %g1 400228ec: 2a 80 00 03 bcs,a 400228f8 400228f0: 83 2e 20 03 sll %i0, 3, %g1 400228f4: 30 80 00 0a b,a 4002291c iop = rtems_libio_iop( fd ); 400228f8: b1 2e 20 06 sll %i0, 6, %i0 400228fc: b0 26 00 01 sub %i0, %g1, %i0 40022900: 03 10 01 86 sethi %hi(0x40061800), %g1 40022904: fa 00 62 74 ld [ %g1 + 0x274 ], %i5 ! 40061a74 40022908: ba 07 40 18 add %i5, %i0, %i5 rtems_libio_check_is_open(iop); 4002290c: c2 07 60 10 ld [ %i5 + 0x10 ], %g1 40022910: 80 88 61 00 btst 0x100, %g1 40022914: 32 80 00 06 bne,a 4002292c 40022918: d0 07 60 28 ld [ %i5 + 0x28 ], %o0 4002291c: 40 00 4a f6 call 400354f4 <__errno> 40022920: 01 00 00 00 nop 40022924: 10 80 00 1c b 40022994 40022928: 82 10 20 09 mov 9, %g1 ! 9 if (iop->pathinfo.mt_entry->writeable) { 4002292c: c2 0a 20 29 ldub [ %o0 + 0x29 ], %g1 40022930: 80 a0 60 00 cmp %g1, 0 40022934: 02 80 00 15 be 40022988 <== NEVER TAKEN 40022938: 01 00 00 00 nop 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 ); 4002293c: c2 02 20 0c ld [ %o0 + 0xc ], %g1 40022940: c2 00 40 00 ld [ %g1 ], %g1 40022944: 9f c0 40 00 call %g1 40022948: 01 00 00 00 nop rtems_filesystem_instance_lock( &iop->pathinfo ); rv = (*iop->pathinfo.mt_entry->ops->chown_h)( 4002294c: c2 07 60 28 ld [ %i5 + 0x28 ], %g1 40022950: 90 07 60 14 add %i5, 0x14, %o0 40022954: c2 00 60 0c ld [ %g1 + 0xc ], %g1 40022958: 92 10 00 19 mov %i1, %o1 4002295c: c2 00 60 24 ld [ %g1 + 0x24 ], %g1 40022960: 9f c0 40 00 call %g1 40022964: 94 10 00 1a mov %i2, %o2 40022968: b0 10 00 08 mov %o0, %i0 static inline void rtems_filesystem_instance_unlock( const rtems_filesystem_location_info_t *loc ) { const rtems_filesystem_mount_table_entry_t *mt_entry = loc->mt_entry; 4002296c: d0 07 60 28 ld [ %i5 + 0x28 ], %o0 (*mt_entry->ops->unlock_h)( mt_entry ); 40022970: c2 02 20 0c ld [ %o0 + 0xc ], %g1 40022974: c2 00 60 04 ld [ %g1 + 4 ], %g1 40022978: 9f c0 40 00 call %g1 4002297c: 01 00 00 00 nop 40022980: 81 c7 e0 08 ret 40022984: 81 e8 00 00 restore owner, group ); rtems_filesystem_instance_unlock( &iop->pathinfo ); } else { errno = EROFS; 40022988: 40 00 4a db call 400354f4 <__errno> <== NOT EXECUTED 4002298c: 01 00 00 00 nop <== NOT EXECUTED 40022990: 82 10 20 1e mov 0x1e, %g1 ! 1e <== NOT EXECUTED 40022994: c2 22 00 00 st %g1, [ %o0 ] rv = -1; } return rv; } 40022998: 81 c7 e0 08 ret 4002299c: 91 e8 3f ff restore %g0, -1, %o0 =============================================================================== 4002f8c0 : int fcntl( int fd, int cmd, ... ) { 4002f8c0: 9d e3 bf 98 save %sp, -104, %sp int fd2; int flags; int mask; int ret = 0; rtems_libio_check_fd( fd ); 4002f8c4: 05 10 00 d4 sethi %hi(0x40035000), %g2 4002f8c8: c4 00 a3 bc ld [ %g2 + 0x3bc ], %g2 ! 400353bc ... ) { int ret; va_list ap; va_start( ap, cmd ); 4002f8cc: 82 07 a0 4c add %fp, 0x4c, %g1 4002f8d0: f4 27 a0 4c st %i2, [ %fp + 0x4c ] 4002f8d4: f6 27 a0 50 st %i3, [ %fp + 0x50 ] 4002f8d8: f8 27 a0 54 st %i4, [ %fp + 0x54 ] 4002f8dc: fa 27 a0 58 st %i5, [ %fp + 0x58 ] int fd2; int flags; int mask; int ret = 0; rtems_libio_check_fd( fd ); 4002f8e0: 80 a6 00 02 cmp %i0, %g2 4002f8e4: 1a 80 00 0c bcc 4002f914 4002f8e8: c2 27 bf fc st %g1, [ %fp + -4 ] iop = rtems_libio_iop( fd ); 4002f8ec: 85 2e 20 03 sll %i0, 3, %g2 4002f8f0: b1 2e 20 06 sll %i0, 6, %i0 4002f8f4: b0 26 00 02 sub %i0, %g2, %i0 4002f8f8: 05 10 01 17 sethi %hi(0x40045c00), %g2 4002f8fc: fa 00 a2 28 ld [ %g2 + 0x228 ], %i5 ! 40045e28 4002f900: ba 07 40 18 add %i5, %i0, %i5 rtems_libio_check_is_open(iop); 4002f904: d0 07 60 10 ld [ %i5 + 0x10 ], %o0 4002f908: 80 8a 21 00 btst 0x100, %o0 4002f90c: 12 80 00 06 bne 4002f924 4002f910: 80 a6 60 09 cmp %i1, 9 4002f914: 7f ff be 6c call 4001f2c4 <__errno> 4002f918: 01 00 00 00 nop 4002f91c: 10 80 00 5d b 4002fa90 4002f920: 82 10 20 09 mov 9, %g1 ! 9 /* * This switch should contain all the cases from POSIX. */ switch ( cmd ) { 4002f924: 18 80 00 58 bgu 4002fa84 4002f928: 85 2e 60 02 sll %i1, 2, %g2 4002f92c: 07 10 00 be sethi %hi(0x4002f800), %g3 4002f930: 86 10 e0 98 or %g3, 0x98, %g3 ! 4002f898 <_calloc_r+0x14> 4002f934: c4 00 c0 02 ld [ %g3 + %g2 ], %g2 4002f938: 81 c0 80 00 jmp %g2 4002f93c: 01 00 00 00 nop /* * FIXME: We ignore the start value fd2 for the file descriptor search. This * is not POSIX conform. */ rtems_libio_t *diop = rtems_libio_allocate(); 4002f940: 7f ff 60 75 call 40007b14 4002f944: 01 00 00 00 nop if (diop != NULL) { 4002f948: b8 92 20 00 orcc %o0, 0, %i4 4002f94c: 02 80 00 62 be 4002fad4 4002f950: b0 10 3f ff mov -1, %i0 int oflag = rtems_libio_to_fcntl_flags( iop->flags ); 4002f954: 7f ff 60 5a call 40007abc 4002f958: d0 07 60 10 ld [ %i5 + 0x10 ], %o0 oflag &= ~O_CREAT; diop->flags |= rtems_libio_fcntl_flags( oflag ); 4002f95c: f4 07 20 10 ld [ %i4 + 0x10 ], %i2 rtems_libio_t *diop = rtems_libio_allocate(); if (diop != NULL) { int oflag = rtems_libio_to_fcntl_flags( iop->flags ); oflag &= ~O_CREAT; 4002f960: b6 0a 3d ff and %o0, -513, %i3 diop->flags |= rtems_libio_fcntl_flags( oflag ); 4002f964: 7f ff 60 49 call 40007a88 4002f968: 90 10 00 1b mov %i3, %o0 4002f96c: 90 12 00 1a or %o0, %i2, %o0 4002f970: d0 27 20 10 st %o0, [ %i4 + 0x10 ] static inline void rtems_filesystem_instance_lock( const rtems_filesystem_location_info_t *loc ) { const rtems_filesystem_mount_table_entry_t *mt_entry = loc->mt_entry; 4002f974: d0 07 60 28 ld [ %i5 + 0x28 ], %o0 (*mt_entry->ops->lock_h)( mt_entry ); 4002f978: c2 02 20 0c ld [ %o0 + 0xc ], %g1 4002f97c: c2 00 40 00 ld [ %g1 ], %g1 4002f980: 9f c0 40 00 call %g1 4002f984: 01 00 00 00 nop rtems_filesystem_instance_lock( &iop->pathinfo ); rtems_filesystem_location_clone( &diop->pathinfo, &iop->pathinfo ); 4002f988: 92 07 60 14 add %i5, 0x14, %o1 4002f98c: 7f ff 99 27 call 40015e28 4002f990: 90 07 20 14 add %i4, 0x14, %o0 static inline void rtems_filesystem_instance_unlock( const rtems_filesystem_location_info_t *loc ) { const rtems_filesystem_mount_table_entry_t *mt_entry = loc->mt_entry; 4002f994: d0 07 60 28 ld [ %i5 + 0x28 ], %o0 (*mt_entry->ops->unlock_h)( mt_entry ); 4002f998: c2 02 20 0c ld [ %o0 + 0xc ], %g1 4002f99c: c2 00 60 04 ld [ %g1 + 4 ], %g1 4002f9a0: 9f c0 40 00 call %g1 4002f9a4: 01 00 00 00 nop /* * 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 ); 4002f9a8: c2 07 20 24 ld [ %i4 + 0x24 ], %g1 4002f9ac: 90 10 00 1c mov %i4, %o0 4002f9b0: c2 00 40 00 ld [ %g1 ], %g1 4002f9b4: 92 10 20 00 clr %o1 4002f9b8: 94 10 00 1b mov %i3, %o2 4002f9bc: 9f c0 40 00 call %g1 4002f9c0: 96 10 20 00 clr %o3 if ( rv == 0 ) { 4002f9c4: b0 92 20 00 orcc %o0, 0, %i0 4002f9c8: 12 80 00 11 bne 4002fa0c <== NEVER TAKEN 4002f9cc: 03 10 01 17 sethi %hi(0x40045c00), %g1 rv = diop - rtems_libio_iops; 4002f9d0: f0 00 62 28 ld [ %g1 + 0x228 ], %i0 ! 40045e28 4002f9d4: b8 27 00 18 sub %i4, %i0, %i4 4002f9d8: b9 3f 20 03 sra %i4, 3, %i4 4002f9dc: 85 2f 20 03 sll %i4, 3, %g2 4002f9e0: 83 2f 20 06 sll %i4, 6, %g1 4002f9e4: 82 00 80 01 add %g2, %g1, %g1 4002f9e8: 85 28 60 06 sll %g1, 6, %g2 4002f9ec: 82 00 40 02 add %g1, %g2, %g1 4002f9f0: 82 00 40 1c add %g1, %i4, %g1 4002f9f4: b1 28 60 0f sll %g1, 0xf, %i0 4002f9f8: 82 00 40 18 add %g1, %i0, %g1 4002f9fc: 83 28 60 03 sll %g1, 3, %g1 4002fa00: b8 00 40 1c add %g1, %i4, %i4 4002fa04: 10 80 00 25 b 4002fa98 4002fa08: b0 20 00 1c neg %i4, %i0 } else { rtems_libio_free( diop ); 4002fa0c: 7f ff 60 59 call 40007b70 <== NOT EXECUTED 4002fa10: 90 10 00 1c mov %i4, %o0 <== NOT EXECUTED /* * If we got this far successfully, then we give the optional * filesystem specific handler a chance to process this. */ if (ret >= 0) { 4002fa14: 10 80 00 22 b 4002fa9c <== NOT EXECUTED 4002fa18: 80 a6 20 00 cmp %i0, 0 <== NOT EXECUTED fd2 = va_arg( ap, int ); ret = duplicate_iop( iop, fd2 ); break; case F_GETFD: /* get f_flags */ ret = ((iop->flags & LIBIO_FLAGS_CLOSE_ON_EXEC) != 0); 4002fa1c: b1 32 20 0b srl %o0, 0xb, %i0 4002fa20: 10 80 00 21 b 4002faa4 4002fa24: b0 0e 20 01 and %i0, 1, %i0 * 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 ) ) 4002fa28: c2 00 40 00 ld [ %g1 ], %g1 4002fa2c: 80 a0 60 00 cmp %g1, 0 4002fa30: 22 80 00 0e be,a 4002fa68 4002fa34: 90 0a 37 ff and %o0, -2049, %o0 iop->flags |= LIBIO_FLAGS_CLOSE_ON_EXEC; 4002fa38: 10 80 00 0c b 4002fa68 4002fa3c: 90 12 28 00 or %o0, 0x800, %o0 else iop->flags &= ~LIBIO_FLAGS_CLOSE_ON_EXEC; break; case F_GETFL: /* more flags (cloexec) */ ret = rtems_libio_to_fcntl_flags( iop->flags ); 4002fa40: 7f ff 60 1f call 40007abc 4002fa44: 01 00 00 00 nop 4002fa48: 10 80 00 14 b 4002fa98 4002fa4c: b0 10 00 08 mov %o0, %i0 break; case F_SETFL: flags = rtems_libio_fcntl_flags( va_arg( ap, int ) ); 4002fa50: 7f ff 60 0e call 40007a88 4002fa54: d0 00 40 00 ld [ %g1 ], %o0 /* * XXX If we are turning on append, should we seek to the end? */ iop->flags = (iop->flags & ~mask) | (flags & mask); 4002fa58: c2 07 60 10 ld [ %i5 + 0x10 ], %g1 4002fa5c: 90 0a 22 01 and %o0, 0x201, %o0 4002fa60: 82 08 7d fe and %g1, -514, %g1 4002fa64: 90 12 00 01 or %o0, %g1, %o0 4002fa68: d0 27 60 10 st %o0, [ %i5 + 0x10 ] { rtems_libio_t *iop; int fd2; int flags; int mask; int ret = 0; 4002fa6c: 10 80 00 0e b 4002faa4 4002fa70: b0 10 20 00 clr %i0 errno = ENOTSUP; ret = -1; break; case F_GETOWN: /* for sockets. */ errno = ENOTSUP; 4002fa74: 7f ff be 14 call 4001f2c4 <__errno> 4002fa78: 01 00 00 00 nop 4002fa7c: 10 80 00 05 b 4002fa90 4002fa80: 82 10 20 86 mov 0x86, %g1 ! 86 ret = -1; break; default: errno = EINVAL; 4002fa84: 7f ff be 10 call 4001f2c4 <__errno> 4002fa88: 01 00 00 00 nop 4002fa8c: 82 10 20 16 mov 0x16, %g1 ! 16 4002fa90: 10 80 00 10 b 4002fad0 4002fa94: c2 22 00 00 st %g1, [ %o0 ] /* * If we got this far successfully, then we give the optional * filesystem specific handler a chance to process this. */ if (ret >= 0) { 4002fa98: 80 a6 20 00 cmp %i0, 0 4002fa9c: 06 80 00 0e bl 4002fad4 <== NEVER TAKEN 4002faa0: 01 00 00 00 nop int err = (*iop->pathinfo.handlers->fcntl_h)( iop, cmd ); 4002faa4: c2 07 60 24 ld [ %i5 + 0x24 ], %g1 4002faa8: 90 10 00 1d mov %i5, %o0 4002faac: c2 00 60 28 ld [ %g1 + 0x28 ], %g1 4002fab0: 9f c0 40 00 call %g1 4002fab4: 92 10 00 19 mov %i1, %o1 if (err) { 4002fab8: ba 92 20 00 orcc %o0, 0, %i5 4002fabc: 02 80 00 06 be 4002fad4 <== ALWAYS TAKEN 4002fac0: 01 00 00 00 nop errno = err; 4002fac4: 7f ff be 00 call 4001f2c4 <__errno> <== NOT EXECUTED 4002fac8: 01 00 00 00 nop <== NOT EXECUTED 4002facc: fa 22 00 00 st %i5, [ %o0 ] <== NOT EXECUTED int mask; int ret = 0; rtems_libio_check_fd( fd ); iop = rtems_libio_iop( fd ); rtems_libio_check_is_open(iop); 4002fad0: b0 10 3f ff mov -1, %i0 va_list ap; va_start( ap, cmd ); ret = vfcntl(fd,cmd,ap); va_end(ap); return ret; } 4002fad4: 81 c7 e0 08 ret 4002fad8: 81 e8 00 00 restore =============================================================================== 40003934 : #include int fdatasync( int fd ) { 40003934: 9d e3 bf a0 save %sp, -96, %sp rtems_libio_t *iop; rtems_libio_check_fd( fd ); 40003938: 03 10 00 54 sethi %hi(0x40015000), %g1 4000393c: c2 00 62 84 ld [ %g1 + 0x284 ], %g1 ! 40015284 40003940: 80 a6 00 01 cmp %i0, %g1 40003944: 1a 80 00 0d bcc 40003978 40003948: 83 2e 20 03 sll %i0, 3, %g1 iop = rtems_libio_iop( fd ); 4000394c: b1 2e 20 06 sll %i0, 6, %i0 40003950: b0 26 00 01 sub %i0, %g1, %i0 40003954: 03 10 00 56 sethi %hi(0x40015800), %g1 40003958: d0 00 63 64 ld [ %g1 + 0x364 ], %o0 ! 40015b64 4000395c: 90 02 00 18 add %o0, %i0, %o0 rtems_libio_check_is_open(iop); 40003960: c2 02 20 10 ld [ %o0 + 0x10 ], %g1 40003964: 80 88 61 00 btst 0x100, %g1 40003968: 02 80 00 04 be 40003978 <== NEVER TAKEN 4000396c: 80 88 60 04 btst 4, %g1 rtems_libio_check_permissions_with_error( iop, LIBIO_FLAGS_WRITE, EBADF ); 40003970: 32 80 00 08 bne,a 40003990 40003974: c2 02 20 24 ld [ %o0 + 0x24 ], %g1 40003978: 40 00 2b cf call 4000e8b4 <__errno> 4000397c: b0 10 3f ff mov -1, %i0 40003980: 82 10 20 09 mov 9, %g1 40003984: c2 22 00 00 st %g1, [ %o0 ] 40003988: 81 c7 e0 08 ret 4000398c: 81 e8 00 00 restore /* * Now process the fdatasync(). */ return (*iop->pathinfo.handlers->fdatasync_h)( iop ); 40003990: c2 00 60 24 ld [ %g1 + 0x24 ], %g1 40003994: 9f c0 40 00 call %g1 40003998: 01 00 00 00 nop } 4000399c: 81 c7 e0 08 ret 400039a0: 91 e8 00 08 restore %g0, %o0, %o0 =============================================================================== 4000ce08 : int fifo_open( pipe_control_t **pipep, rtems_libio_t *iop ) { 4000ce08: 9d e3 bf 98 save %sp, -104, %sp static int pipe_lock(void) { rtems_status_code sc = RTEMS_SUCCESSFUL; if (pipe_semaphore == RTEMS_ID_NONE) { 4000ce0c: 3b 10 00 84 sethi %hi(0x40021000), %i5 4000ce10: c2 07 63 20 ld [ %i5 + 0x320 ], %g1 ! 40021320 int fifo_open( pipe_control_t **pipep, rtems_libio_t *iop ) { 4000ce14: b6 10 00 18 mov %i0, %i3 static int pipe_lock(void) { rtems_status_code sc = RTEMS_SUCCESSFUL; if (pipe_semaphore == RTEMS_ID_NONE) { 4000ce18: 80 a0 60 00 cmp %g1, 0 4000ce1c: 02 80 00 0c be 4000ce4c 4000ce20: b8 17 63 20 or %i5, 0x320, %i4 rtems_libio_unlock(); } if (sc == RTEMS_SUCCESSFUL) { sc = rtems_semaphore_obtain(pipe_semaphore, RTEMS_WAIT, RTEMS_NO_TIMEOUT); 4000ce24: 03 10 00 84 sethi %hi(0x40021000), %g1 4000ce28: d0 00 63 20 ld [ %g1 + 0x320 ], %o0 ! 40021320 4000ce2c: 92 10 20 00 clr %o1 4000ce30: 7f ff ed 5f call 400083ac 4000ce34: 94 10 20 00 clr %o2 } if (sc == RTEMS_SUCCESSFUL) { 4000ce38: 80 a2 20 00 cmp %o0, 0 4000ce3c: 22 80 00 ee be,a 4000d1f4 <== ALWAYS TAKEN 4000ce40: fa 06 c0 00 ld [ %i3 ], %i5 return 0; } else { return -ENOMEM; 4000ce44: 81 c7 e0 08 ret <== NOT EXECUTED 4000ce48: 91 e8 3f f4 restore %g0, -12, %o0 <== NOT EXECUTED */ #include static inline void rtems_libio_lock( void ) { rtems_semaphore_obtain( rtems_libio_semaphore, RTEMS_WAIT, RTEMS_NO_TIMEOUT ); 4000ce4c: 03 10 00 85 sethi %hi(0x40021400), %g1 4000ce50: d0 00 60 a0 ld [ %g1 + 0xa0 ], %o0 ! 400214a0 4000ce54: 92 10 20 00 clr %o1 4000ce58: 7f ff ed 55 call 400083ac 4000ce5c: 94 10 20 00 clr %o2 rtems_status_code sc = RTEMS_SUCCESSFUL; if (pipe_semaphore == RTEMS_ID_NONE) { rtems_libio_lock(); if (pipe_semaphore == RTEMS_ID_NONE) { 4000ce60: c2 07 63 20 ld [ %i5 + 0x320 ], %g1 4000ce64: 80 a0 60 00 cmp %g1, 0 4000ce68: 12 80 00 0a bne 4000ce90 <== NEVER TAKEN 4000ce6c: ba 10 20 00 clr %i5 sc = rtems_semaphore_create( 4000ce70: 11 14 12 54 sethi %hi(0x50495000), %o0 4000ce74: 92 10 20 01 mov 1, %o1 4000ce78: 90 12 20 45 or %o0, 0x45, %o0 4000ce7c: 94 10 20 54 mov 0x54, %o2 4000ce80: 96 10 20 00 clr %o3 4000ce84: 7f ff ec ad call 40008138 4000ce88: 98 10 00 1c mov %i4, %o4 4000ce8c: ba 10 00 08 mov %o0, %i5 } static inline void rtems_libio_unlock( void ) { rtems_semaphore_release( rtems_libio_semaphore ); 4000ce90: 03 10 00 85 sethi %hi(0x40021400), %g1 4000ce94: 7f ff ed 8f call 400084d0 4000ce98: d0 00 60 a0 ld [ %g1 + 0xa0 ], %o0 ! 400214a0 } rtems_libio_unlock(); } if (sc == RTEMS_SUCCESSFUL) { 4000ce9c: 80 a7 60 00 cmp %i5, 0 4000cea0: 02 bf ff e1 be 4000ce24 4000cea4: b0 10 3f f4 mov -12, %i0 4000cea8: 81 c7 e0 08 ret 4000ceac: 81 e8 00 00 restore { static char c = 'a'; pipe_control_t *pipe; int err = -ENOMEM; pipe = malloc(sizeof(pipe_control_t)); 4000ceb0: 7f ff dd 0c call 400042e0 4000ceb4: 90 10 20 34 mov 0x34, %o0 if (pipe == NULL) 4000ceb8: ba 92 20 00 orcc %o0, 0, %i5 4000cebc: 02 80 00 d2 be 4000d204 <== NEVER TAKEN 4000cec0: 92 10 20 00 clr %o1 return err; memset(pipe, 0, sizeof(pipe_control_t)); 4000cec4: 40 00 0d 79 call 400104a8 4000cec8: 94 10 20 34 mov 0x34, %o2 pipe->Size = PIPE_BUF; 4000cecc: 82 10 22 00 mov 0x200, %g1 pipe->Buffer = malloc(pipe->Size); 4000ced0: 90 10 22 00 mov 0x200, %o0 4000ced4: 7f ff dd 03 call 400042e0 4000ced8: c2 27 60 04 st %g1, [ %i5 + 4 ] if (! pipe->Buffer) 4000cedc: 80 a2 20 00 cmp %o0, 0 4000cee0: 02 80 00 2e be 4000cf98 <== NEVER TAKEN 4000cee4: d0 27 40 00 st %o0, [ %i5 ] goto err_buf; err = -ENOMEM; if (rtems_barrier_create( rtems_build_name ('P', 'I', 'r', c), 4000cee8: 39 10 00 83 sethi %hi(0x40020c00), %i4 4000ceec: d0 4f 20 9c ldsb [ %i4 + 0x9c ], %o0 ! 40020c9c if (! pipe->Buffer) goto err_buf; err = -ENOMEM; if (rtems_barrier_create( 4000cef0: 35 14 12 5c sethi %hi(0x50497000), %i2 4000cef4: 82 16 a2 00 or %i2, 0x200, %g1 ! 50497200 4000cef8: 92 10 20 00 clr %o1 4000cefc: 90 12 00 01 or %o0, %g1, %o0 4000cf00: 94 10 20 00 clr %o2 4000cf04: 40 00 03 df call 4000de80 4000cf08: 96 07 60 2c add %i5, 0x2c, %o3 4000cf0c: 80 a2 20 00 cmp %o0, 0 4000cf10: 12 80 00 20 bne 4000cf90 4000cf14: d0 4f 20 9c ldsb [ %i4 + 0x9c ], %o0 rtems_build_name ('P', 'I', 'r', c), RTEMS_BARRIER_MANUAL_RELEASE, 0, &pipe->readBarrier) != RTEMS_SUCCESSFUL) goto err_rbar; if (rtems_barrier_create( 4000cf18: 03 14 12 5d sethi %hi(0x50497400), %g1 4000cf1c: 82 10 63 00 or %g1, 0x300, %g1 ! 50497700 4000cf20: 92 10 20 00 clr %o1 4000cf24: 90 12 00 01 or %o0, %g1, %o0 4000cf28: 94 10 20 00 clr %o2 4000cf2c: 40 00 03 d5 call 4000de80 4000cf30: 96 07 60 30 add %i5, 0x30, %o3 4000cf34: 80 a2 20 00 cmp %o0, 0 4000cf38: 12 80 00 14 bne 4000cf88 4000cf3c: d0 4f 20 9c ldsb [ %i4 + 0x9c ], %o0 rtems_build_name ('P', 'I', 'w', c), RTEMS_BARRIER_MANUAL_RELEASE, 0, &pipe->writeBarrier) != RTEMS_SUCCESSFUL) goto err_wbar; if (rtems_semaphore_create( 4000cf40: b4 16 a3 00 or %i2, 0x300, %i2 4000cf44: 92 10 20 01 mov 1, %o1 4000cf48: 90 12 00 1a or %o0, %i2, %o0 4000cf4c: 94 10 20 10 mov 0x10, %o2 4000cf50: 96 10 20 00 clr %o3 4000cf54: 7f ff ec 79 call 40008138 4000cf58: 98 07 60 28 add %i5, 0x28, %o4 4000cf5c: 80 a2 20 00 cmp %o0, 0 4000cf60: 12 80 00 08 bne 4000cf80 4000cf64: c2 0f 20 9c ldub [ %i4 + 0x9c ], %g1 #ifdef RTEMS_POSIX_API pipe_interruptible(pipe); #endif *pipep = pipe; if (c ++ == 'z') 4000cf68: c4 4f 20 9c ldsb [ %i4 + 0x9c ], %g2 4000cf6c: 80 a0 a0 7a cmp %g2, 0x7a 4000cf70: 12 80 00 a7 bne 4000d20c 4000cf74: 82 00 60 01 inc %g1 c = 'a'; 4000cf78: 10 80 00 a5 b 4000d20c 4000cf7c: 82 10 20 61 mov 0x61, %g1 return 0; err_sem: rtems_barrier_delete(pipe->writeBarrier); 4000cf80: 40 00 03 ef call 4000df3c 4000cf84: d0 07 60 30 ld [ %i5 + 0x30 ], %o0 err_wbar: rtems_barrier_delete(pipe->readBarrier); 4000cf88: 40 00 03 ed call 4000df3c 4000cf8c: d0 07 60 2c ld [ %i5 + 0x2c ], %o0 err_rbar: free(pipe->Buffer); 4000cf90: 7f ff db c4 call 40003ea0 4000cf94: d0 07 40 00 ld [ %i5 ], %o0 err_buf: free(pipe); 4000cf98: 7f ff db c2 call 40003ea0 4000cf9c: 90 10 00 1d mov %i5, %o0 if (err) goto out; } if (! PIPE_LOCK(pipe)) err = -EINTR; 4000cfa0: 10 80 00 13 b 4000cfec 4000cfa4: b0 10 3f f4 mov -12, %i0 err = pipe_alloc(&pipe); if (err) goto out; } if (! PIPE_LOCK(pipe)) 4000cfa8: d0 07 60 28 ld [ %i5 + 0x28 ], %o0 4000cfac: 92 10 20 00 clr %o1 4000cfb0: 7f ff ec ff call 400083ac 4000cfb4: 94 10 20 00 clr %o2 err = -EINTR; if (*pipep == NULL) { 4000cfb8: c2 06 c0 00 ld [ %i3 ], %g1 err = pipe_alloc(&pipe); if (err) goto out; } if (! PIPE_LOCK(pipe)) 4000cfbc: 80 a0 00 08 cmp %g0, %o0 4000cfc0: b0 60 20 00 subx %g0, 0, %i0 err = -EINTR; if (*pipep == NULL) { 4000cfc4: 80 a0 60 00 cmp %g1, 0 4000cfc8: 12 80 00 09 bne 4000cfec 4000cfcc: b0 0e 3f fc and %i0, -4, %i0 if (err) 4000cfd0: 80 a6 20 00 cmp %i0, 0 4000cfd4: 22 80 00 06 be,a 4000cfec <== ALWAYS TAKEN 4000cfd8: fa 26 c0 00 st %i5, [ %i3 ] pipe_free(pipe); 4000cfdc: 7f ff ff 53 call 4000cd28 <== NOT EXECUTED 4000cfe0: 90 10 00 1d mov %i5, %o0 <== NOT EXECUTED #ifdef RTEMS_DEBUG rtems_status_code sc = RTEMS_SUCCESSFUL; sc = #endif rtems_semaphore_release(pipe_semaphore); 4000cfe4: 10 80 00 03 b 4000cff0 <== NOT EXECUTED 4000cfe8: 03 10 00 84 sethi %hi(0x40021000), %g1 <== NOT EXECUTED 4000cfec: 03 10 00 84 sethi %hi(0x40021000), %g1 4000cff0: 7f ff ed 38 call 400084d0 4000cff4: d0 00 63 20 ld [ %g1 + 0x320 ], %o0 ! 40021320 pipe_control_t *pipe; unsigned int prevCounter; int err; err = pipe_new(pipep); if (err) 4000cff8: 80 a6 20 00 cmp %i0, 0 4000cffc: 12 80 00 86 bne 4000d214 4000d000: 01 00 00 00 nop return err; pipe = *pipep; switch (LIBIO_ACCMODE(iop)) { 4000d004: c2 06 60 10 ld [ %i1 + 0x10 ], %g1 4000d008: 82 08 60 06 and %g1, 6, %g1 4000d00c: 80 a0 60 04 cmp %g1, 4 4000d010: 02 80 00 2e be 4000d0c8 4000d014: fa 06 c0 00 ld [ %i3 ], %i5 4000d018: 80 a0 60 06 cmp %g1, 6 4000d01c: 02 80 00 56 be 4000d174 4000d020: 80 a0 60 02 cmp %g1, 2 4000d024: 12 80 00 6a bne 4000d1cc <== NEVER TAKEN 4000d028: 01 00 00 00 nop case LIBIO_FLAGS_READ: pipe->readerCounter ++; 4000d02c: c2 07 60 20 ld [ %i5 + 0x20 ], %g1 4000d030: 82 00 60 01 inc %g1 4000d034: c2 27 60 20 st %g1, [ %i5 + 0x20 ] if (pipe->Readers ++ == 0) 4000d038: c2 07 60 10 ld [ %i5 + 0x10 ], %g1 4000d03c: 84 00 60 01 add %g1, 1, %g2 4000d040: 80 a0 60 00 cmp %g1, 0 4000d044: 12 80 00 05 bne 4000d058 <== NEVER TAKEN 4000d048: c4 27 60 10 st %g2, [ %i5 + 0x10 ] PIPE_WAKEUPWRITERS(pipe); 4000d04c: d0 07 60 30 ld [ %i5 + 0x30 ], %o0 4000d050: 40 00 03 e4 call 4000dfe0 4000d054: 92 07 bf fc add %fp, -4, %o1 if (pipe->Writers == 0) { 4000d058: c2 07 60 14 ld [ %i5 + 0x14 ], %g1 4000d05c: 80 a0 60 00 cmp %g1, 0 4000d060: 12 80 00 5b bne 4000d1cc 4000d064: 01 00 00 00 nop /* Not an error */ if (LIBIO_NODELAY(iop)) 4000d068: c2 06 60 10 ld [ %i1 + 0x10 ], %g1 4000d06c: 80 88 60 01 btst 1, %g1 4000d070: 12 80 00 57 bne 4000d1cc 4000d074: 01 00 00 00 nop break; prevCounter = pipe->writerCounter; 4000d078: f8 07 60 24 ld [ %i5 + 0x24 ], %i4 err = -EINTR; /* Wait until a writer opens the pipe */ do { PIPE_UNLOCK(pipe); 4000d07c: 7f ff ed 15 call 400084d0 4000d080: d0 07 60 28 ld [ %i5 + 0x28 ], %o0 if (! PIPE_READWAIT(pipe)) 4000d084: d0 07 60 2c ld [ %i5 + 0x2c ], %o0 4000d088: 40 00 03 ec call 4000e038 4000d08c: 92 10 20 00 clr %o1 4000d090: 80 a2 20 00 cmp %o0, 0 4000d094: 12 80 00 52 bne 4000d1dc <== NEVER TAKEN 4000d098: 92 10 20 00 clr %o1 goto out_error; if (! PIPE_LOCK(pipe)) 4000d09c: d0 07 60 28 ld [ %i5 + 0x28 ], %o0 4000d0a0: 7f ff ec c3 call 400083ac 4000d0a4: 94 10 20 00 clr %o2 4000d0a8: 80 a2 20 00 cmp %o0, 0 4000d0ac: 32 80 00 4d bne,a 4000d1e0 <== NEVER TAKEN 4000d0b0: b0 10 3f fc mov -4, %i0 <== NOT EXECUTED goto out_error; } while (prevCounter == pipe->writerCounter); 4000d0b4: c2 07 60 24 ld [ %i5 + 0x24 ], %g1 4000d0b8: 80 a7 00 01 cmp %i4, %g1 4000d0bc: 02 bf ff f0 be 4000d07c <== NEVER TAKEN 4000d0c0: 01 00 00 00 nop 4000d0c4: 30 80 00 42 b,a 4000d1cc } break; case LIBIO_FLAGS_WRITE: pipe->writerCounter ++; 4000d0c8: c2 07 60 24 ld [ %i5 + 0x24 ], %g1 4000d0cc: 82 00 60 01 inc %g1 4000d0d0: c2 27 60 24 st %g1, [ %i5 + 0x24 ] if (pipe->Writers ++ == 0) 4000d0d4: c2 07 60 14 ld [ %i5 + 0x14 ], %g1 4000d0d8: 84 00 60 01 add %g1, 1, %g2 4000d0dc: 80 a0 60 00 cmp %g1, 0 4000d0e0: 12 80 00 05 bne 4000d0f4 <== NEVER TAKEN 4000d0e4: c4 27 60 14 st %g2, [ %i5 + 0x14 ] PIPE_WAKEUPREADERS(pipe); 4000d0e8: d0 07 60 2c ld [ %i5 + 0x2c ], %o0 4000d0ec: 40 00 03 bd call 4000dfe0 4000d0f0: 92 07 bf fc add %fp, -4, %o1 if (pipe->Readers == 0 && LIBIO_NODELAY(iop)) { 4000d0f4: c2 07 60 10 ld [ %i5 + 0x10 ], %g1 4000d0f8: 80 a0 60 00 cmp %g1, 0 4000d0fc: 12 80 00 34 bne 4000d1cc 4000d100: 01 00 00 00 nop 4000d104: c2 06 60 10 ld [ %i1 + 0x10 ], %g1 4000d108: 80 88 60 01 btst 1, %g1 4000d10c: 22 80 00 07 be,a 4000d128 4000d110: f8 07 60 20 ld [ %i5 + 0x20 ], %i4 PIPE_UNLOCK(pipe); 4000d114: d0 07 60 28 ld [ %i5 + 0x28 ], %o0 4000d118: 7f ff ec ee call 400084d0 4000d11c: b0 10 3f fa mov -6, %i0 err = -ENXIO; goto out_error; 4000d120: 10 80 00 31 b 4000d1e4 4000d124: 90 10 00 1b mov %i3, %o0 if (pipe->Readers == 0) { prevCounter = pipe->readerCounter; err = -EINTR; do { PIPE_UNLOCK(pipe); 4000d128: 7f ff ec ea call 400084d0 4000d12c: d0 07 60 28 ld [ %i5 + 0x28 ], %o0 if (! PIPE_WRITEWAIT(pipe)) 4000d130: d0 07 60 30 ld [ %i5 + 0x30 ], %o0 4000d134: 40 00 03 c1 call 4000e038 4000d138: 92 10 20 00 clr %o1 4000d13c: 80 a2 20 00 cmp %o0, 0 4000d140: 12 80 00 27 bne 4000d1dc <== NEVER TAKEN 4000d144: 92 10 20 00 clr %o1 goto out_error; if (! PIPE_LOCK(pipe)) 4000d148: d0 07 60 28 ld [ %i5 + 0x28 ], %o0 4000d14c: 7f ff ec 98 call 400083ac 4000d150: 94 10 20 00 clr %o2 4000d154: 80 a2 20 00 cmp %o0, 0 4000d158: 32 80 00 22 bne,a 4000d1e0 <== NEVER TAKEN 4000d15c: b0 10 3f fc mov -4, %i0 <== NOT EXECUTED goto out_error; } while (prevCounter == pipe->readerCounter); 4000d160: c2 07 60 20 ld [ %i5 + 0x20 ], %g1 4000d164: 80 a7 00 01 cmp %i4, %g1 4000d168: 02 bf ff f0 be 4000d128 <== NEVER TAKEN 4000d16c: 01 00 00 00 nop 4000d170: 30 80 00 17 b,a 4000d1cc } break; case LIBIO_FLAGS_READ_WRITE: pipe->readerCounter ++; 4000d174: c2 07 60 20 ld [ %i5 + 0x20 ], %g1 4000d178: 82 00 60 01 inc %g1 4000d17c: c2 27 60 20 st %g1, [ %i5 + 0x20 ] if (pipe->Readers ++ == 0) 4000d180: c2 07 60 10 ld [ %i5 + 0x10 ], %g1 4000d184: 84 00 60 01 add %g1, 1, %g2 4000d188: 80 a0 60 00 cmp %g1, 0 4000d18c: 12 80 00 05 bne 4000d1a0 <== NEVER TAKEN 4000d190: c4 27 60 10 st %g2, [ %i5 + 0x10 ] PIPE_WAKEUPWRITERS(pipe); 4000d194: d0 07 60 30 ld [ %i5 + 0x30 ], %o0 4000d198: 40 00 03 92 call 4000dfe0 4000d19c: 92 07 bf fc add %fp, -4, %o1 pipe->writerCounter ++; 4000d1a0: c2 07 60 24 ld [ %i5 + 0x24 ], %g1 4000d1a4: 82 00 60 01 inc %g1 4000d1a8: c2 27 60 24 st %g1, [ %i5 + 0x24 ] if (pipe->Writers ++ == 0) 4000d1ac: c2 07 60 14 ld [ %i5 + 0x14 ], %g1 4000d1b0: 84 00 60 01 add %g1, 1, %g2 4000d1b4: 80 a0 60 00 cmp %g1, 0 4000d1b8: 12 80 00 05 bne 4000d1cc <== NEVER TAKEN 4000d1bc: c4 27 60 14 st %g2, [ %i5 + 0x14 ] PIPE_WAKEUPREADERS(pipe); 4000d1c0: d0 07 60 2c ld [ %i5 + 0x2c ], %o0 4000d1c4: 40 00 03 87 call 4000dfe0 4000d1c8: 92 07 bf fc add %fp, -4, %o1 break; } PIPE_UNLOCK(pipe); 4000d1cc: 7f ff ec c1 call 400084d0 4000d1d0: d0 07 60 28 ld [ %i5 + 0x28 ], %o0 return 0; 4000d1d4: 81 c7 e0 08 ret 4000d1d8: 81 e8 00 00 restore /* Not an error */ if (LIBIO_NODELAY(iop)) break; prevCounter = pipe->writerCounter; err = -EINTR; 4000d1dc: b0 10 3f fc mov -4, %i0 <== NOT EXECUTED PIPE_UNLOCK(pipe); return 0; out_error: pipe_release(pipep, iop); 4000d1e0: 90 10 00 1b mov %i3, %o0 <== NOT EXECUTED 4000d1e4: 7f ff fe dc call 4000cd54 4000d1e8: 92 10 00 19 mov %i1, %o1 return err; 4000d1ec: 81 c7 e0 08 ret 4000d1f0: 81 e8 00 00 restore err = pipe_lock(); if (err) return err; pipe = *pipep; if (pipe == NULL) { 4000d1f4: 80 a7 60 00 cmp %i5, 0 4000d1f8: 32 bf ff 6d bne,a 4000cfac 4000d1fc: d0 07 60 28 ld [ %i5 + 0x28 ], %o0 4000d200: 30 bf ff 2c b,a 4000ceb0 if (err) goto out; } if (! PIPE_LOCK(pipe)) err = -EINTR; 4000d204: 10 bf ff 7a b 4000cfec <== NOT EXECUTED 4000d208: b0 10 3f f4 mov -12, %i0 <== NOT EXECUTED #ifdef RTEMS_POSIX_API pipe_interruptible(pipe); #endif *pipep = pipe; if (c ++ == 'z') 4000d20c: 10 bf ff 67 b 4000cfa8 4000d210: c2 2f 20 9c stb %g1, [ %i4 + 0x9c ] return 0; out_error: pipe_release(pipep, iop); return err; } 4000d214: 81 c7 e0 08 ret 4000d218: 81 e8 00 00 restore =============================================================================== 400092e0 : */ long fpathconf( int fd, int name ) { 400092e0: 9d e3 bf a0 save %sp, -96, %sp long return_value; rtems_libio_t *iop; const rtems_filesystem_limits_and_options_t *the_limits; rtems_libio_check_fd(fd); 400092e4: 03 10 00 4e sethi %hi(0x40013800), %g1 400092e8: c2 00 60 98 ld [ %g1 + 0x98 ], %g1 ! 40013898 400092ec: 80 a6 00 01 cmp %i0, %g1 400092f0: 2a 80 00 03 bcs,a 400092fc 400092f4: 83 2e 20 03 sll %i0, 3, %g1 400092f8: 30 80 00 0a b,a 40009320 iop = rtems_libio_iop(fd); 400092fc: b1 2e 20 06 sll %i0, 6, %i0 40009300: b0 26 00 01 sub %i0, %g1, %i0 40009304: 03 10 00 50 sethi %hi(0x40014000), %g1 40009308: c2 00 61 50 ld [ %g1 + 0x150 ], %g1 ! 40014150 4000930c: b0 00 40 18 add %g1, %i0, %i0 rtems_libio_check_is_open(iop); 40009310: c2 06 20 10 ld [ %i0 + 0x10 ], %g1 40009314: 80 88 61 00 btst 0x100, %g1 40009318: 32 80 00 06 bne,a 40009330 <== ALWAYS TAKEN 4000931c: c2 06 20 28 ld [ %i0 + 0x28 ], %g1 40009320: 40 00 05 76 call 4000a8f8 <__errno> 40009324: 01 00 00 00 nop 40009328: 10 80 00 32 b 400093f0 4000932c: 82 10 20 09 mov 9, %g1 ! 9 * Now process the information request. */ the_limits = iop->pathinfo.mt_entry->pathconf_limits_and_options; switch ( name ) { 40009330: 80 a6 60 0b cmp %i1, 0xb 40009334: 18 80 00 2c bgu 400093e4 40009338: c2 00 60 2c ld [ %g1 + 0x2c ], %g1 4000933c: b3 2e 60 02 sll %i1, 2, %i1 40009340: 05 10 00 24 sethi %hi(0x40009000), %g2 40009344: 84 10 a2 b0 or %g2, 0x2b0, %g2 ! 400092b0 <_close_r+0x10> 40009348: c4 00 80 19 ld [ %g2 + %i1 ], %g2 4000934c: 81 c0 80 00 jmp %g2 40009350: 01 00 00 00 nop case _PC_LINK_MAX: return_value = the_limits->link_max; 40009354: f0 00 40 00 ld [ %g1 ], %i0 break; 40009358: 81 c7 e0 08 ret 4000935c: 81 e8 00 00 restore case _PC_MAX_CANON: return_value = the_limits->max_canon; 40009360: f0 00 60 04 ld [ %g1 + 4 ], %i0 break; 40009364: 81 c7 e0 08 ret 40009368: 81 e8 00 00 restore case _PC_MAX_INPUT: return_value = the_limits->max_input; 4000936c: f0 00 60 08 ld [ %g1 + 8 ], %i0 break; 40009370: 81 c7 e0 08 ret 40009374: 81 e8 00 00 restore case _PC_NAME_MAX: return_value = the_limits->name_max; 40009378: f0 00 60 0c ld [ %g1 + 0xc ], %i0 break; 4000937c: 81 c7 e0 08 ret 40009380: 81 e8 00 00 restore case _PC_PATH_MAX: return_value = the_limits->path_max; 40009384: f0 00 60 10 ld [ %g1 + 0x10 ], %i0 break; 40009388: 81 c7 e0 08 ret 4000938c: 81 e8 00 00 restore case _PC_PIPE_BUF: return_value = the_limits->pipe_buf; 40009390: f0 00 60 14 ld [ %g1 + 0x14 ], %i0 break; 40009394: 81 c7 e0 08 ret 40009398: 81 e8 00 00 restore case _PC_CHOWN_RESTRICTED: return_value = the_limits->posix_chown_restrictions; 4000939c: f0 00 60 1c ld [ %g1 + 0x1c ], %i0 break; 400093a0: 81 c7 e0 08 ret 400093a4: 81 e8 00 00 restore case _PC_NO_TRUNC: return_value = the_limits->posix_no_trunc; 400093a8: f0 00 60 20 ld [ %g1 + 0x20 ], %i0 break; 400093ac: 81 c7 e0 08 ret 400093b0: 81 e8 00 00 restore case _PC_VDISABLE: return_value = the_limits->posix_vdisable; 400093b4: f0 00 60 2c ld [ %g1 + 0x2c ], %i0 break; 400093b8: 81 c7 e0 08 ret 400093bc: 81 e8 00 00 restore case _PC_ASYNC_IO: return_value = the_limits->posix_async_io; 400093c0: f0 00 60 18 ld [ %g1 + 0x18 ], %i0 break; 400093c4: 81 c7 e0 08 ret 400093c8: 81 e8 00 00 restore case _PC_PRIO_IO: return_value = the_limits->posix_prio_io; 400093cc: f0 00 60 24 ld [ %g1 + 0x24 ], %i0 break; 400093d0: 81 c7 e0 08 ret 400093d4: 81 e8 00 00 restore case _PC_SYNC_IO: return_value = the_limits->posix_sync_io; 400093d8: f0 00 60 28 ld [ %g1 + 0x28 ], %i0 break; 400093dc: 81 c7 e0 08 ret 400093e0: 81 e8 00 00 restore default: rtems_set_errno_and_return_minus_one( EINVAL ); 400093e4: 40 00 05 45 call 4000a8f8 <__errno> 400093e8: 01 00 00 00 nop 400093ec: 82 10 20 16 mov 0x16, %g1 ! 16 400093f0: c2 22 00 00 st %g1, [ %o0 ] break; } return return_value; } 400093f4: 81 c7 e0 08 ret 400093f8: 91 e8 3f ff restore %g0, -1, %o0 =============================================================================== 40002fcc : #include void free( void *ptr ) { 40002fcc: 9d e3 bf a0 save %sp, -96, %sp MSBUMP(free_calls, 1); 40002fd0: 03 10 00 72 sethi %hi(0x4001c800), %g1 40002fd4: 82 10 63 38 or %g1, 0x338, %g1 ! 4001cb38 40002fd8: c4 00 60 0c ld [ %g1 + 0xc ], %g2 #include void free( void *ptr ) { 40002fdc: b2 10 00 18 mov %i0, %i1 MSBUMP(free_calls, 1); 40002fe0: 84 00 a0 01 inc %g2 if ( !ptr ) 40002fe4: 80 a6 20 00 cmp %i0, 0 40002fe8: 02 80 00 21 be 4000306c 40002fec: c4 20 60 0c st %g2, [ %g1 + 0xc ] return; /* * Do not attempt to free memory if in a critical section or ISR. */ if ( _System_state_Is_up(_System_state_Get()) && 40002ff0: 03 10 00 73 sethi %hi(0x4001cc00), %g1 40002ff4: c2 00 62 bc ld [ %g1 + 0x2bc ], %g1 ! 4001cebc <_System_state_Current> 40002ff8: 80 a0 60 03 cmp %g1, 3 40002ffc: 12 80 00 09 bne 40003020 <== NEVER TAKEN 40003000: 03 10 00 72 sethi %hi(0x4001c800), %g1 !malloc_is_system_state_OK() ) { 40003004: 40 00 00 78 call 400031e4 40003008: 01 00 00 00 nop return; /* * Do not attempt to free memory if in a critical section or ISR. */ if ( _System_state_Is_up(_System_state_Get()) && 4000300c: 80 8a 20 ff btst 0xff, %o0 40003010: 12 80 00 04 bne 40003020 40003014: 03 10 00 72 sethi %hi(0x4001c800), %g1 !malloc_is_system_state_OK() ) { malloc_deferred_free(ptr); 40003018: 40 00 00 8c call 40003248 4000301c: 81 e8 00 00 restore } /* * If configured, update the statistics */ if ( rtems_malloc_statistics_helpers ) 40003020: c2 00 60 84 ld [ %g1 + 0x84 ], %g1 40003024: 80 a0 60 00 cmp %g1, 0 40003028: 02 80 00 06 be 40003040 4000302c: 3b 10 00 70 sethi %hi(0x4001c000), %i5 (*rtems_malloc_statistics_helpers->at_free)(ptr); 40003030: c2 00 60 08 ld [ %g1 + 8 ], %g1 40003034: 9f c0 40 00 call %g1 40003038: 90 10 00 19 mov %i1, %o0 if ( !_Protected_heap_Free( RTEMS_Malloc_Heap, ptr ) ) { 4000303c: 3b 10 00 70 sethi %hi(0x4001c000), %i5 40003040: d0 07 61 e0 ld [ %i5 + 0x1e0 ], %o0 ! 4001c1e0 40003044: 40 00 16 f1 call 40008c08 <_Protected_heap_Free> 40003048: 92 10 00 19 mov %i1, %o1 4000304c: 80 8a 20 ff btst 0xff, %o0 40003050: 12 80 00 07 bne 4000306c 40003054: c2 07 61 e0 ld [ %i5 + 0x1e0 ], %g1 printk( "Program heap: free of bad pointer %p -- range %p - %p \n", 40003058: 31 10 00 6b sethi %hi(0x4001ac00), %i0 4000305c: f4 00 60 18 ld [ %g1 + 0x18 ], %i2 40003060: f6 00 60 1c ld [ %g1 + 0x1c ], %i3 40003064: 40 00 03 68 call 40003e04 40003068: 91 ee 23 00 restore %i0, 0x300, %o0 4000306c: 81 c7 e0 08 ret 40003070: 81 e8 00 00 restore =============================================================================== 40019b5c : int fstat( int fd, struct stat *sbuf ) { 40019b5c: 9d e3 bf a0 save %sp, -96, %sp rtems_libio_t *iop; /* * Check to see if we were passed a valid pointer. */ if ( !sbuf ) 40019b60: 80 a6 60 00 cmp %i1, 0 40019b64: 32 80 00 06 bne,a 40019b7c <== ALWAYS TAKEN 40019b68: 03 10 00 70 sethi %hi(0x4001c000), %g1 rtems_set_errno_and_return_minus_one( EFAULT ); 40019b6c: 7f ff d0 58 call 4000dccc <__errno> <== NOT EXECUTED 40019b70: 01 00 00 00 nop <== NOT EXECUTED 40019b74: 10 80 00 12 b 40019bbc <== NOT EXECUTED 40019b78: 82 10 20 0e mov 0xe, %g1 ! e <== NOT EXECUTED /* * Now process the stat() request. */ iop = rtems_libio_iop( fd ); 40019b7c: c2 00 62 24 ld [ %g1 + 0x224 ], %g1 40019b80: 80 a6 00 01 cmp %i0, %g1 40019b84: 1a 80 00 0b bcc 40019bb0 40019b88: 83 2e 20 03 sll %i0, 3, %g1 40019b8c: b1 2e 20 06 sll %i0, 6, %i0 40019b90: b0 26 00 01 sub %i0, %g1, %i0 40019b94: 03 10 00 72 sethi %hi(0x4001c800), %g1 40019b98: c2 00 63 28 ld [ %g1 + 0x328 ], %g1 ! 4001cb28 40019b9c: b0 00 40 18 add %g1, %i0, %i0 rtems_libio_check_fd( fd ); rtems_libio_check_is_open(iop); 40019ba0: c2 06 20 10 ld [ %i0 + 0x10 ], %g1 40019ba4: 80 88 61 00 btst 0x100, %g1 40019ba8: 12 80 00 08 bne 40019bc8 40019bac: 94 10 20 48 mov 0x48, %o2 /* * Now process the stat() request. */ iop = rtems_libio_iop( fd ); rtems_libio_check_fd( fd ); 40019bb0: 7f ff d0 47 call 4000dccc <__errno> 40019bb4: 01 00 00 00 nop 40019bb8: 82 10 20 09 mov 9, %g1 ! 9 40019bbc: c2 22 00 00 st %g1, [ %o0 ] 40019bc0: 81 c7 e0 08 ret 40019bc4: 91 e8 3f ff restore %g0, -1, %o0 /* * Zero out the stat structure so the various support * versions of stat don't have to. */ memset( sbuf, 0, sizeof(struct stat) ); 40019bc8: 90 10 00 19 mov %i1, %o0 40019bcc: 7f ff d2 ce call 4000e704 40019bd0: 92 10 20 00 clr %o1 return (*iop->pathinfo.handlers->fstat_h)( &iop->pathinfo, sbuf ); 40019bd4: c2 06 20 24 ld [ %i0 + 0x24 ], %g1 40019bd8: 90 06 20 14 add %i0, 0x14, %o0 40019bdc: c2 00 60 18 ld [ %g1 + 0x18 ], %g1 40019be0: 9f c0 40 00 call %g1 40019be4: 92 10 00 19 mov %i1, %o1 } 40019be8: 81 c7 e0 08 ret 40019bec: 91 e8 00 08 restore %g0, %o0, %o0 =============================================================================== 40002f18 : 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) { 40002f18: 03 10 00 63 sethi %hi(0x40018c00), %g1 40002f1c: c2 00 62 70 ld [ %g1 + 0x270 ], %g1 ! 40018e70 40002f20: 80 a2 00 01 cmp %o0, %g1 40002f24: 1a 80 00 1e bcc 40002f9c <== NEVER TAKEN 40002f28: 03 10 00 63 sethi %hi(0x40018c00), %g1 40002f2c: c2 00 62 74 ld [ %g1 + 0x274 ], %g1 ! 40018e74 40002f30: 80 a0 60 00 cmp %g1, 0 40002f34: 22 80 00 1b be,a 40002fa0 <== NEVER TAKEN 40002f38: 90 10 20 00 clr %o0 <== NOT EXECUTED rtems_disk_device_table *dtab = disktab + major; 40002f3c: 91 2a 20 03 sll %o0, 3, %o0 40002f40: 84 00 40 08 add %g1, %o0, %g2 if (minor < dtab->size && dtab->minor != NULL) { 40002f44: c4 00 a0 04 ld [ %g2 + 4 ], %g2 40002f48: 80 a2 40 02 cmp %o1, %g2 40002f4c: 3a 80 00 15 bcc,a 40002fa0 <== NEVER TAKEN 40002f50: 90 10 20 00 clr %o0 <== NOT EXECUTED 40002f54: c2 00 40 08 ld [ %g1 + %o0 ], %g1 40002f58: 80 a0 60 00 cmp %g1, 0 40002f5c: 02 80 00 10 be 40002f9c <== NEVER TAKEN 40002f60: 93 2a 60 02 sll %o1, 2, %o1 rtems_disk_device *dd = dtab->minor [minor]; if (dd != NULL && !lookup_only) { 40002f64: 80 a2 a0 01 cmp %o2, 1 40002f68: 02 80 00 0e be 40002fa0 40002f6c: d0 00 40 09 ld [ %g1 + %o1 ], %o0 40002f70: 80 a2 20 00 cmp %o0, 0 40002f74: 02 80 00 0b be 40002fa0 <== NEVER TAKEN 40002f78: 01 00 00 00 nop if (!dd->deleted) { 40002f7c: c2 0a 20 40 ldub [ %o0 + 0x40 ], %g1 40002f80: 80 a0 60 00 cmp %g1, 0 40002f84: 32 80 00 07 bne,a 40002fa0 40002f88: 90 10 20 00 clr %o0 ++dd->uses; 40002f8c: c2 02 20 14 ld [ %o0 + 0x14 ], %g1 40002f90: 82 00 60 01 inc %g1 40002f94: 81 c3 e0 08 retl 40002f98: c2 22 20 14 st %g1, [ %o0 + 0x14 ] return dd; } } return NULL; 40002f9c: 90 10 20 00 clr %o0 <== NOT EXECUTED } 40002fa0: 81 c3 e0 08 retl =============================================================================== 40004280 : * NOTES: * get_sector() operates with device via bdbuf library, * and does not support devices with sector size other than 512 bytes */ static rtems_status_code get_sector(int fd, 40004280: 9d e3 bf a0 save %sp, -96, %sp 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); 40004284: 40 00 04 fd call 40005678 40004288: 90 10 22 04 mov 0x204, %o0 if (s == NULL) { return RTEMS_NO_MEMORY; 4000428c: 82 10 20 1a mov 0x1a, %g1 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) 40004290: 80 a2 20 00 cmp %o0, 0 40004294: 02 80 00 0f be 400042d0 <== NEVER TAKEN 40004298: ba 10 00 08 mov %o0, %i5 { return RTEMS_NO_MEMORY; } n = read(fd, s->data, RTEMS_IDE_SECTOR_SIZE); 4000429c: 90 10 00 18 mov %i0, %o0 400042a0: 92 07 60 04 add %i5, 4, %o1 400042a4: 40 00 07 97 call 40006100 400042a8: 94 10 22 00 mov 0x200, %o2 if (n != RTEMS_IDE_SECTOR_SIZE) 400042ac: 80 a2 22 00 cmp %o0, 0x200 400042b0: 22 80 00 06 be,a 400042c8 <== ALWAYS TAKEN 400042b4: f2 27 40 00 st %i1, [ %i5 ] { free(s); 400042b8: 40 00 03 5f call 40005034 <== NOT EXECUTED 400042bc: 90 10 00 1d mov %i5, %o0 <== NOT EXECUTED return RTEMS_IO_ERROR; 400042c0: 10 80 00 04 b 400042d0 <== NOT EXECUTED 400042c4: 82 10 20 1b mov 0x1b, %g1 <== NOT EXECUTED } s->sector_num = sector_num; *sector = s; 400042c8: fa 26 80 00 st %i5, [ %i2 ] return RTEMS_SUCCESSFUL; 400042cc: 82 10 20 00 clr %g1 } 400042d0: 81 c7 e0 08 ret 400042d4: 91 e8 00 01 restore %g0, %g1, %o0 =============================================================================== 4002fb04 : int getdents( int dd_fd, char *dd_buf, int dd_len ) { 4002fb04: 9d e3 bf a0 save %sp, -96, %sp rtems_filesystem_node_types_t type; /* * Get the file control block structure associated with the file descriptor */ iop = rtems_libio_iop( dd_fd ); 4002fb08: 03 10 00 d4 sethi %hi(0x40035000), %g1 4002fb0c: c2 00 63 bc ld [ %g1 + 0x3bc ], %g1 ! 400353bc 4002fb10: 80 a6 00 01 cmp %i0, %g1 4002fb14: 1a 80 00 08 bcc 4002fb34 <== NEVER TAKEN 4002fb18: ba 10 20 00 clr %i5 4002fb1c: 83 2e 20 03 sll %i0, 3, %g1 4002fb20: b1 2e 20 06 sll %i0, 6, %i0 4002fb24: b0 26 00 01 sub %i0, %g1, %i0 4002fb28: 03 10 01 17 sethi %hi(0x40045c00), %g1 4002fb2c: fa 00 62 28 ld [ %g1 + 0x228 ], %i5 ! 40045e28 4002fb30: ba 07 40 18 add %i5, %i0, %i5 /* * Make sure we are working on a directory */ type = rtems_filesystem_node_type( &iop->pathinfo ); 4002fb34: 7f ff 66 b0 call 400095f4 4002fb38: 90 07 60 14 add %i5, 0x14, %o0 if ( type != RTEMS_FILESYSTEM_DIRECTORY ) 4002fb3c: 80 a2 20 00 cmp %o0, 0 4002fb40: 22 80 00 08 be,a 4002fb60 4002fb44: c2 07 60 24 ld [ %i5 + 0x24 ], %g1 rtems_set_errno_and_return_minus_one( ENOTDIR ); 4002fb48: 7f ff bd df call 4001f2c4 <__errno> 4002fb4c: b0 10 3f ff mov -1, %i0 4002fb50: 82 10 20 14 mov 0x14, %g1 4002fb54: c2 22 00 00 st %g1, [ %o0 ] 4002fb58: 81 c7 e0 08 ret 4002fb5c: 81 e8 00 00 restore /* * 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 ); 4002fb60: 90 10 00 1d mov %i5, %o0 4002fb64: c2 00 60 08 ld [ %g1 + 8 ], %g1 4002fb68: 92 10 00 19 mov %i1, %o1 4002fb6c: 9f c0 40 00 call %g1 4002fb70: 94 10 00 1a mov %i2, %o2 } 4002fb74: 81 c7 e0 08 ret 4002fb78: 91 e8 00 08 restore %g0, %o0, %o0 =============================================================================== 40003074 : */ int gettimeofday( struct timeval *tp, void * __tz __attribute__((unused)) ) { 40003074: 9d e3 bf 98 save %sp, -104, %sp /* struct timezone* tzp = (struct timezone*) __tz; */ if ( !tp ) 40003078: 80 a6 20 00 cmp %i0, 0 4000307c: 12 80 00 08 bne 4000309c <== ALWAYS TAKEN 40003080: 90 07 bf f8 add %fp, -8, %o0 rtems_set_errno_and_return_minus_one( EFAULT ); 40003084: 40 00 2b 12 call 4000dccc <__errno> <== NOT EXECUTED 40003088: b0 10 3f ff mov -1, %i0 <== NOT EXECUTED 4000308c: 82 10 20 0e mov 0xe, %g1 <== NOT EXECUTED 40003090: c2 22 00 00 st %g1, [ %o0 ] <== NOT EXECUTED 40003094: 81 c7 e0 08 ret <== NOT EXECUTED 40003098: 81 e8 00 00 restore <== NOT EXECUTED ) { Timestamp_Control snapshot_as_timestamp; Timestamp_Control *snapshot_as_timestamp_ptr; snapshot_as_timestamp_ptr = 4000309c: 13 10 00 73 sethi %hi(0x4001cc00), %o1 400030a0: 40 00 13 72 call 40007e68 <_TOD_Get_with_nanoseconds> 400030a4: 92 12 60 08 or %o1, 8, %o1 ! 4001cc08 <_TOD> struct timeval *tp, struct timezone *tzp ) { return gettimeofday( tp, tzp ); } 400030a8: f8 1a 00 00 ldd [ %o0 ], %i4 static inline void _Timestamp64_implementation_To_timeval( const Timestamp64_Control *_timestamp, struct timeval *_timeval ) { _timeval->tv_sec = (time_t) (*_timestamp / 1000000000U); 400030ac: 94 10 20 00 clr %o2 400030b0: 90 10 00 1c mov %i4, %o0 400030b4: 92 10 00 1d mov %i5, %o1 400030b8: 17 0e e6 b2 sethi %hi(0x3b9ac800), %o3 400030bc: 40 00 50 cb call 400173e8 <__divdi3> 400030c0: 96 12 e2 00 or %o3, 0x200, %o3 ! 3b9aca00 _timeval->tv_usec = (suseconds_t) ((*_timestamp % 1000000000U) / 1000U); 400030c4: 90 10 00 1c mov %i4, %o0 static inline void _Timestamp64_implementation_To_timeval( const Timestamp64_Control *_timestamp, struct timeval *_timeval ) { _timeval->tv_sec = (time_t) (*_timestamp / 1000000000U); 400030c8: d2 26 00 00 st %o1, [ %i0 ] _timeval->tv_usec = (suseconds_t) ((*_timestamp % 1000000000U) / 1000U); 400030cc: 94 10 20 00 clr %o2 400030d0: 92 10 00 1d mov %i5, %o1 400030d4: 17 0e e6 b2 sethi %hi(0x3b9ac800), %o3 400030d8: 40 00 51 af call 40017794 <__moddi3> 400030dc: 96 12 e2 00 or %o3, 0x200, %o3 ! 3b9aca00 400030e0: 94 10 20 00 clr %o2 400030e4: 40 00 50 c1 call 400173e8 <__divdi3> 400030e8: 96 10 23 e8 mov 0x3e8, %o3 400030ec: d2 26 20 04 st %o1, [ %i0 + 4 ] * with Eric Norum, this is how GNU/Linux, Solaris, and MacOS X * do it. This puts us in good company. */ return 0; } 400030f0: 81 c7 e0 08 ret 400030f4: 91 e8 20 00 restore %g0, 0, %o0 =============================================================================== 40022f28 : /** * Initialize useable but dummy databases */ void init_etc_passwd_group(void) { 40022f28: 9d e3 bf a0 save %sp, -96, %sp FILE *fp; static char etc_passwd_initted = 0; if (etc_passwd_initted) 40022f2c: 03 10 01 85 sethi %hi(0x40061400), %g1 40022f30: c4 48 60 80 ldsb [ %g1 + 0x80 ], %g2 ! 40061480 40022f34: 80 a0 a0 00 cmp %g2, 0 40022f38: 12 80 00 2f bne 40022ff4 40022f3c: 84 10 20 01 mov 1, %g2 return; etc_passwd_initted = 1; mkdir("/etc", 0777); 40022f40: 92 10 21 ff mov 0x1ff, %o1 FILE *fp; static char etc_passwd_initted = 0; if (etc_passwd_initted) return; etc_passwd_initted = 1; 40022f44: c4 28 60 80 stb %g2, [ %g1 + 0x80 ] mkdir("/etc", 0777); 40022f48: 11 10 01 62 sethi %hi(0x40058800), %o0 40022f4c: 7f ff 7f fa call 40002f34 40022f50: 90 12 23 78 or %o0, 0x378, %o0 ! 40058b78 /* * Initialize /etc/passwd */ if ((fp = fopen("/etc/passwd", "r")) != NULL) { 40022f54: 3b 10 01 62 sethi %hi(0x40058800), %i5 40022f58: 13 10 01 74 sethi %hi(0x4005d000), %o1 40022f5c: 90 17 63 80 or %i5, 0x380, %o0 40022f60: 40 00 4c 15 call 40035fb4 40022f64: 92 12 62 88 or %o1, 0x288, %o1 40022f68: 80 a2 20 00 cmp %o0, 0 40022f6c: 22 80 00 03 be,a 40022f78 40022f70: 90 17 63 80 or %i5, 0x380, %o0 40022f74: 30 80 00 0b b,a 40022fa0 fclose(fp); } else if ((fp = fopen("/etc/passwd", "w")) != NULL) { 40022f78: 13 10 01 59 sethi %hi(0x40056400), %o1 40022f7c: 40 00 4c 0e call 40035fb4 40022f80: 92 12 62 48 or %o1, 0x248, %o1 ! 40056648 40022f84: ba 92 20 00 orcc %o0, 0, %i5 40022f88: 02 80 00 08 be 40022fa8 <== NEVER TAKEN 40022f8c: 11 10 01 62 sethi %hi(0x40058800), %o0 fprintf(fp, "root:*:0:0:root::/:/bin/sh\n" 40022f90: 92 10 00 1d mov %i5, %o1 40022f94: 40 00 4c 6b call 40036140 40022f98: 90 12 23 90 or %o0, 0x390, %o0 "rtems:*:1:1:RTEMS Application::/:/bin/sh\n" "tty:!:2:2:tty owner::/:/bin/false\n" ); fclose(fp); 40022f9c: 90 10 00 1d mov %i5, %o0 40022fa0: 40 00 49 a7 call 4003563c 40022fa4: 01 00 00 00 nop } /* * Initialize /etc/group */ if ((fp = fopen("/etc/group", "r")) != NULL) { 40022fa8: 3b 10 01 62 sethi %hi(0x40058800), %i5 40022fac: 13 10 01 74 sethi %hi(0x4005d000), %o1 40022fb0: 90 17 63 f8 or %i5, 0x3f8, %o0 40022fb4: 40 00 4c 00 call 40035fb4 40022fb8: 92 12 62 88 or %o1, 0x288, %o1 40022fbc: b0 92 20 00 orcc %o0, 0, %i0 40022fc0: 12 80 00 0b bne 40022fec 40022fc4: 90 17 63 f8 or %i5, 0x3f8, %o0 fclose(fp); } else if ((fp = fopen("/etc/group", "w")) != NULL) { 40022fc8: 13 10 01 59 sethi %hi(0x40056400), %o1 40022fcc: 40 00 4b fa call 40035fb4 40022fd0: 92 12 62 48 or %o1, 0x248, %o1 ! 40056648 40022fd4: b0 92 20 00 orcc %o0, 0, %i0 40022fd8: 02 80 00 07 be 40022ff4 <== NEVER TAKEN 40022fdc: 11 10 01 63 sethi %hi(0x40058c00), %o0 fprintf( fp, "root:x:0:root\n" 40022fe0: 92 10 00 18 mov %i0, %o1 40022fe4: 40 00 4c 57 call 40036140 40022fe8: 90 12 20 08 or %o0, 8, %o0 "rtems:x:1:rtems\n" "tty:x:2:tty\n" ); fclose(fp); 40022fec: 40 00 49 94 call 4003563c 40022ff0: 81 e8 00 00 restore 40022ff4: 81 c7 e0 08 ret 40022ff8: 81 e8 00 00 restore =============================================================================== 40005a34 : /* * Process a single input character */ static int iproc (unsigned char c, struct rtems_termios_tty *tty) { 40005a34: 9d e3 bf a0 save %sp, -96, %sp if (tty->termios.c_iflag & ISTRIP) 40005a38: c2 06 60 30 ld [ %i1 + 0x30 ], %g1 40005a3c: 80 88 60 20 btst 0x20, %g1 40005a40: 32 80 00 02 bne,a 40005a48 <== NEVER TAKEN 40005a44: b0 0e 20 7f and %i0, 0x7f, %i0 <== NOT EXECUTED c &= 0x7f; if (tty->termios.c_iflag & IUCLC) 40005a48: 80 88 62 00 btst 0x200, %g1 40005a4c: 02 80 00 0c be 40005a7c 40005a50: 80 a6 20 0d cmp %i0, 0xd c = tolower (c); 40005a54: 05 10 00 70 sethi %hi(0x4001c000), %g2 40005a58: c4 00 a3 90 ld [ %g2 + 0x390 ], %g2 ! 4001c390 <__ctype_ptr__> 40005a5c: 84 00 80 18 add %g2, %i0, %g2 40005a60: c4 08 a0 01 ldub [ %g2 + 1 ], %g2 40005a64: 84 08 a0 03 and %g2, 3, %g2 40005a68: 80 a0 a0 01 cmp %g2, 1 40005a6c: 22 80 00 02 be,a 40005a74 40005a70: b0 06 20 20 add %i0, 0x20, %i0 40005a74: b0 0e 20 ff and %i0, 0xff, %i0 if (c == '\r') { 40005a78: 80 a6 20 0d cmp %i0, 0xd 40005a7c: 12 80 00 0b bne 40005aa8 40005a80: 80 a6 20 0a cmp %i0, 0xa if (tty->termios.c_iflag & IGNCR) 40005a84: 80 88 60 80 btst 0x80, %g1 40005a88: 02 80 00 04 be 40005a98 <== ALWAYS TAKEN 40005a8c: 80 88 61 00 btst 0x100, %g1 if (tty->ccount < (CBUFSIZE-1)) { if (tty->termios.c_lflag & ECHO) echo (c, tty); tty->cbuf[tty->ccount++] = c; } return 0; 40005a90: 81 c7 e0 08 ret <== NOT EXECUTED 40005a94: 91 e8 20 00 restore %g0, 0, %o0 <== NOT EXECUTED c = tolower (c); if (c == '\r') { if (tty->termios.c_iflag & IGNCR) return 0; if (tty->termios.c_iflag & ICRNL) 40005a98: 32 80 00 0d bne,a 40005acc <== ALWAYS TAKEN 40005a9c: b0 10 20 0a mov 0xa, %i0 c = '\n'; } else if ((c == '\n') && (tty->termios.c_iflag & INLCR)) { c = '\r'; } if ((c != '\0') && (tty->termios.c_lflag & ICANON)) { 40005aa0: 10 80 00 0c b 40005ad0 <== NOT EXECUTED 40005aa4: c2 06 60 3c ld [ %i1 + 0x3c ], %g1 <== 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)) { 40005aa8: 12 80 00 07 bne 40005ac4 40005aac: 80 a6 20 00 cmp %i0, 0 40005ab0: 80 88 60 40 btst 0x40, %g1 40005ab4: 32 80 00 06 bne,a 40005acc <== NEVER TAKEN 40005ab8: b0 10 20 0d mov 0xd, %i0 <== NOT EXECUTED c = '\r'; } if ((c != '\0') && (tty->termios.c_lflag & ICANON)) { 40005abc: 10 80 00 05 b 40005ad0 40005ac0: c2 06 60 3c ld [ %i1 + 0x3c ], %g1 40005ac4: 02 80 00 51 be 40005c08 <== NEVER TAKEN 40005ac8: 03 10 00 70 sethi %hi(0x4001c000), %g1 40005acc: c2 06 60 3c ld [ %i1 + 0x3c ], %g1 40005ad0: 80 88 60 02 btst 2, %g1 40005ad4: 22 80 00 4d be,a 40005c08 40005ad8: 03 10 00 70 sethi %hi(0x4001c000), %g1 if (c == tty->termios.c_cc[VERASE]) { 40005adc: c4 0e 60 43 ldub [ %i1 + 0x43 ], %g2 40005ae0: 80 a0 80 18 cmp %g2, %i0 40005ae4: 32 80 00 08 bne,a 40005b04 40005ae8: c4 0e 60 44 ldub [ %i1 + 0x44 ], %g2 * FIXME: Some of the tests should check for IEXTEN, too. */ static void erase (struct rtems_termios_tty *tty, int lineFlag) { if (tty->ccount == 0) 40005aec: c2 06 60 20 ld [ %i1 + 0x20 ], %g1 40005af0: 80 a0 60 00 cmp %g1, 0 40005af4: 02 80 00 57 be 40005c50 40005af8: 90 10 00 19 mov %i1, %o0 40005afc: 10 80 00 1d b 40005b70 40005b00: 92 10 20 00 clr %o1 if ((c != '\0') && (tty->termios.c_lflag & ICANON)) { if (c == tty->termios.c_cc[VERASE]) { erase (tty, 0); return 0; } else if (c == tty->termios.c_cc[VKILL]) { 40005b04: 80 a0 80 18 cmp %g2, %i0 40005b08: 32 80 00 1d bne,a 40005b7c 40005b0c: c4 0e 60 45 ldub [ %i1 + 0x45 ], %g2 * FIXME: Some of the tests should check for IEXTEN, too. */ static void erase (struct rtems_termios_tty *tty, int lineFlag) { if (tty->ccount == 0) 40005b10: c4 06 60 20 ld [ %i1 + 0x20 ], %g2 40005b14: 80 a0 a0 00 cmp %g2, 0 40005b18: 02 80 00 4e be 40005c50 <== NEVER TAKEN 40005b1c: 80 88 60 08 btst 8, %g1 return; if (lineFlag) { if (!(tty->termios.c_lflag & ECHO)) { 40005b20: 12 80 00 04 bne 40005b30 <== ALWAYS TAKEN 40005b24: 90 10 00 19 mov %i1, %o0 tty->ccount = 0; 40005b28: 10 80 00 4a b 40005c50 <== NOT EXECUTED 40005b2c: c0 26 60 20 clr [ %i1 + 0x20 ] <== NOT EXECUTED return; } if (!(tty->termios.c_lflag & ECHOE)) { 40005b30: 80 88 60 10 btst 0x10, %g1 40005b34: 12 80 00 0f bne 40005b70 <== ALWAYS TAKEN 40005b38: 92 10 20 01 mov 1, %o1 tty->ccount = 0; 40005b3c: c0 26 60 20 clr [ %i1 + 0x20 ] <== NOT EXECUTED echo (tty->termios.c_cc[VKILL], tty); 40005b40: 90 10 00 18 mov %i0, %o0 <== NOT EXECUTED 40005b44: 7f ff ff 2d call 400057f8 <== NOT EXECUTED 40005b48: 92 10 00 19 mov %i1, %o1 <== NOT EXECUTED if (tty->termios.c_lflag & ECHOK) 40005b4c: c2 06 60 3c ld [ %i1 + 0x3c ], %g1 <== NOT EXECUTED 40005b50: 80 88 60 20 btst 0x20, %g1 <== NOT EXECUTED 40005b54: 22 80 00 42 be,a 40005c5c <== NOT EXECUTED 40005b58: b0 10 20 00 clr %i0 <== NOT EXECUTED echo ('\n', tty); 40005b5c: 90 10 20 0a mov 0xa, %o0 <== NOT EXECUTED 40005b60: 7f ff ff 26 call 400057f8 <== NOT EXECUTED 40005b64: 92 10 00 19 mov %i1, %o1 <== NOT EXECUTED if (tty->ccount < (CBUFSIZE-1)) { if (tty->termios.c_lflag & ECHO) echo (c, tty); tty->cbuf[tty->ccount++] = c; } return 0; 40005b68: 81 c7 e0 08 ret <== NOT EXECUTED 40005b6c: 91 e8 20 00 restore %g0, 0, %o0 <== NOT EXECUTED 40005b70: 7f ff ff 43 call 4000587c 40005b74: b0 10 20 00 clr %i0 40005b78: 30 80 00 39 b,a 40005c5c } else if (c == tty->termios.c_cc[VKILL]) { erase (tty, 1); return 0; } else if (c == tty->termios.c_cc[VEOF]) { 40005b7c: 80 a0 80 18 cmp %g2, %i0 40005b80: 02 80 00 36 be 40005c58 <== NEVER TAKEN 40005b84: 80 a6 20 0a cmp %i0, 0xa return 1; } else if (c == '\n') { 40005b88: 32 80 00 0d bne,a 40005bbc 40005b8c: c4 0e 60 4c ldub [ %i1 + 0x4c ], %g2 if (tty->termios.c_lflag & (ECHO | ECHONL)) 40005b90: 80 88 60 48 btst 0x48, %g1 40005b94: 22 80 00 06 be,a 40005bac <== NEVER TAKEN 40005b98: c2 06 60 20 ld [ %i1 + 0x20 ], %g1 <== NOT EXECUTED echo (c, tty); 40005b9c: 90 10 20 0a mov 0xa, %o0 40005ba0: 7f ff ff 16 call 400057f8 40005ba4: 92 10 00 19 mov %i1, %o1 tty->cbuf[tty->ccount++] = c; 40005ba8: c2 06 60 20 ld [ %i1 + 0x20 ], %g1 40005bac: c4 06 60 1c ld [ %i1 + 0x1c ], %g2 40005bb0: 86 10 20 0a mov 0xa, %g3 40005bb4: 10 80 00 12 b 40005bfc 40005bb8: c6 28 80 01 stb %g3, [ %g2 + %g1 ] return 1; } else if ((c == tty->termios.c_cc[VEOL]) || 40005bbc: 80 a0 80 18 cmp %g2, %i0 40005bc0: 02 80 00 07 be 40005bdc <== NEVER TAKEN 40005bc4: 80 88 60 08 btst 8, %g1 40005bc8: c4 0e 60 51 ldub [ %i1 + 0x51 ], %g2 40005bcc: 80 a0 80 18 cmp %g2, %i0 40005bd0: 32 80 00 0e bne,a 40005c08 <== ALWAYS TAKEN 40005bd4: 03 10 00 70 sethi %hi(0x4001c000), %g1 (c == tty->termios.c_cc[VEOL2])) { if (tty->termios.c_lflag & ECHO) 40005bd8: 80 88 60 08 btst 8, %g1 <== NOT EXECUTED 40005bdc: 22 80 00 06 be,a 40005bf4 <== NOT EXECUTED 40005be0: c2 06 60 20 ld [ %i1 + 0x20 ], %g1 <== NOT EXECUTED echo (c, tty); 40005be4: 90 10 00 18 mov %i0, %o0 <== NOT EXECUTED 40005be8: 7f ff ff 04 call 400057f8 <== NOT EXECUTED 40005bec: 92 10 00 19 mov %i1, %o1 <== NOT EXECUTED tty->cbuf[tty->ccount++] = c; 40005bf0: c2 06 60 20 ld [ %i1 + 0x20 ], %g1 <== NOT EXECUTED 40005bf4: c4 06 60 1c ld [ %i1 + 0x1c ], %g2 <== NOT EXECUTED 40005bf8: f0 28 80 01 stb %i0, [ %g2 + %g1 ] <== NOT EXECUTED 40005bfc: 82 00 60 01 inc %g1 40005c00: 10 80 00 16 b 40005c58 40005c04: c2 26 60 20 st %g1, [ %i1 + 0x20 ] } /* * FIXME: Should do IMAXBEL handling somehow */ if (tty->ccount < (CBUFSIZE-1)) { 40005c08: c4 06 60 20 ld [ %i1 + 0x20 ], %g2 40005c0c: c2 00 62 64 ld [ %g1 + 0x264 ], %g1 40005c10: 82 00 7f ff add %g1, -1, %g1 40005c14: 80 a0 80 01 cmp %g2, %g1 40005c18: 3a 80 00 11 bcc,a 40005c5c <== NEVER TAKEN 40005c1c: b0 10 20 00 clr %i0 <== NOT EXECUTED if (tty->termios.c_lflag & ECHO) 40005c20: c2 06 60 3c ld [ %i1 + 0x3c ], %g1 40005c24: 80 88 60 08 btst 8, %g1 40005c28: 22 80 00 06 be,a 40005c40 <== NEVER TAKEN 40005c2c: c2 06 60 20 ld [ %i1 + 0x20 ], %g1 <== NOT EXECUTED echo (c, tty); 40005c30: 90 10 00 18 mov %i0, %o0 40005c34: 7f ff fe f1 call 400057f8 40005c38: 92 10 00 19 mov %i1, %o1 tty->cbuf[tty->ccount++] = c; 40005c3c: c2 06 60 20 ld [ %i1 + 0x20 ], %g1 40005c40: c4 06 60 1c ld [ %i1 + 0x1c ], %g2 40005c44: f0 28 80 01 stb %i0, [ %g2 + %g1 ] 40005c48: 82 00 60 01 inc %g1 40005c4c: c2 26 60 20 st %g1, [ %i1 + 0x20 ] } return 0; 40005c50: 81 c7 e0 08 ret 40005c54: 91 e8 20 00 restore %g0, 0, %o0 else if (c == tty->termios.c_cc[VKILL]) { erase (tty, 1); return 0; } else if (c == tty->termios.c_cc[VEOF]) { return 1; 40005c58: b0 10 20 01 mov 1, %i0 if (tty->termios.c_lflag & ECHO) echo (c, tty); tty->cbuf[tty->ccount++] = c; } return 0; } 40005c5c: 81 c7 e0 08 ret 40005c60: 81 e8 00 00 restore =============================================================================== 40019c24 : #if !defined(RTEMS_POSIX_API) int kill( pid_t pid, int sig ) { return 0; } 40019c24: 81 c3 e0 08 retl <== NOT EXECUTED 40019c28: 90 10 20 00 clr %o0 <== NOT EXECUTED =============================================================================== 4000384c : extern void _wrapup_reent(struct _reent *); extern void _reclaim_reent(struct _reent *); void libc_wrapup(void) { 4000384c: 9d e3 bf a0 save %sp, -96, %sp /* * In case RTEMS is already down, don't do this. It could be * dangerous. */ if (!_System_state_Is_up(_System_state_Get())) 40003850: 03 10 00 73 sethi %hi(0x4001cc00), %g1 40003854: c2 00 62 bc ld [ %g1 + 0x2bc ], %g1 ! 4001cebc <_System_state_Current> 40003858: 80 a0 60 03 cmp %g1, 3 4000385c: 12 80 00 16 bne 400038b4 <== NEVER TAKEN 40003860: 03 10 00 6d sethi %hi(0x4001b400), %g1 /* * This was already done if the user called exit() directly . _wrapup_reent(0); */ if (_REENT != _global_impure_ptr) { 40003864: 39 10 00 70 sethi %hi(0x4001c000), %i4 40003868: fa 00 63 28 ld [ %g1 + 0x328 ], %i5 4000386c: c2 07 23 98 ld [ %i4 + 0x398 ], %g1 40003870: 80 a0 40 1d cmp %g1, %i5 40003874: 22 80 00 06 be,a 4000388c 40003878: 3b 10 00 70 sethi %hi(0x4001c000), %i5 _wrapup_reent(_global_impure_ptr); 4000387c: 40 00 2c 43 call 4000e988 <_wrapup_reent> 40003880: 90 10 00 1d mov %i5, %o0 /* 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; 40003884: fa 27 23 98 st %i5, [ %i4 + 0x398 ] * * Should this be changed to do *all* file streams? * _fwalk (_REENT, fclose); */ fclose (stdin); 40003888: 3b 10 00 70 sethi %hi(0x4001c000), %i5 4000388c: c2 07 63 98 ld [ %i5 + 0x398 ], %g1 ! 4001c398 <_impure_ptr> 40003890: 40 00 29 61 call 4000de14 40003894: d0 00 60 04 ld [ %g1 + 4 ], %o0 fclose (stdout); 40003898: c2 07 63 98 ld [ %i5 + 0x398 ], %g1 4000389c: 40 00 29 5e call 4000de14 400038a0: d0 00 60 08 ld [ %g1 + 8 ], %o0 fclose (stderr); 400038a4: c2 07 63 98 ld [ %i5 + 0x398 ], %g1 400038a8: f0 00 60 0c ld [ %g1 + 0xc ], %i0 400038ac: 40 00 29 5a call 4000de14 400038b0: 81 e8 00 00 restore 400038b4: 81 c7 e0 08 ret <== NOT EXECUTED 400038b8: 81 e8 00 00 restore <== NOT EXECUTED =============================================================================== 4000331c : #include "malloc_p.h" void *malloc( size_t size ) { 4000331c: 9d e3 bf a0 save %sp, -96, %sp void *return_this; MSBUMP(malloc_calls, 1); 40003320: 03 10 00 72 sethi %hi(0x4001c800), %g1 40003324: 82 10 63 38 or %g1, 0x338, %g1 ! 4001cb38 40003328: c4 00 60 04 ld [ %g1 + 4 ], %g2 4000332c: 84 00 a0 01 inc %g2 /* * If some free's have been deferred, then do them now. */ malloc_deferred_frees_process(); 40003330: 7f ff ff b9 call 40003214 40003334: c4 20 60 04 st %g2, [ %g1 + 4 ] /* * Validate the parameters */ if ( !size ) 40003338: 80 a6 20 00 cmp %i0, 0 4000333c: 12 80 00 04 bne 4000334c 40003340: 03 10 00 73 sethi %hi(0x4001cc00), %g1 return (void *) 0; 40003344: 10 80 00 32 b 4000340c 40003348: ba 10 20 00 clr %i5 /* * Do not attempt to allocate memory if not in correct system state. */ if ( _System_state_Is_up(_System_state_Get()) && 4000334c: c2 00 62 bc ld [ %g1 + 0x2bc ], %g1 40003350: 80 a0 60 03 cmp %g1, 3 40003354: 02 80 00 0c be 40003384 40003358: 39 10 00 70 sethi %hi(0x4001c000), %i4 RTEMS_INLINE_ROUTINE void *_Protected_heap_Allocate( Heap_Control *heap, uintptr_t size ) { return _Protected_heap_Allocate_aligned_with_boundary( heap, size, 0, 0 ); 4000335c: d0 07 21 e0 ld [ %i4 + 0x1e0 ], %o0 ! 4001c1e0 40003360: 92 10 00 18 mov %i0, %o1 40003364: 94 10 20 00 clr %o2 40003368: 40 00 16 1a call 40008bd0 <_Protected_heap_Allocate_aligned_with_boundary> 4000336c: 96 10 20 00 clr %o3 * If this fails then return a NULL pointer. */ return_this = _Protected_heap_Allocate( RTEMS_Malloc_Heap, size ); if ( !return_this ) { 40003370: ba 92 20 00 orcc %o0, 0, %i5 40003374: 12 80 00 18 bne 400033d4 40003378: 03 10 00 72 sethi %hi(0x4001c800), %g1 return_this = (*rtems_malloc_extend_handler)( RTEMS_Malloc_Heap, size ); 4000337c: 10 80 00 09 b 400033a0 40003380: d0 07 21 e0 ld [ %i4 + 0x1e0 ], %o0 /* * 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() ) 40003384: 7f ff ff 98 call 400031e4 40003388: 01 00 00 00 nop return (void *) 0; /* * Do not attempt to allocate memory if not in correct system state. */ if ( _System_state_Is_up(_System_state_Get()) && 4000338c: 80 8a 20 ff btst 0xff, %o0 40003390: 12 bf ff f3 bne 4000335c <== ALWAYS TAKEN 40003394: 01 00 00 00 nop 40003398: 10 80 00 1d b 4000340c <== NOT EXECUTED 4000339c: ba 10 20 00 clr %i5 ! 0 <== NOT EXECUTED */ return_this = _Protected_heap_Allocate( RTEMS_Malloc_Heap, size ); if ( !return_this ) { return_this = (*rtems_malloc_extend_handler)( RTEMS_Malloc_Heap, size ); 400033a0: 03 10 00 69 sethi %hi(0x4001a400), %g1 400033a4: c2 00 60 a0 ld [ %g1 + 0xa0 ], %g1 ! 4001a4a0 400033a8: 9f c0 40 00 call %g1 400033ac: 92 10 00 18 mov %i0, %o1 if ( !return_this ) { 400033b0: ba 92 20 00 orcc %o0, 0, %i5 400033b4: 12 80 00 08 bne 400033d4 <== NEVER TAKEN 400033b8: 03 10 00 72 sethi %hi(0x4001c800), %g1 errno = ENOMEM; 400033bc: 40 00 2a 44 call 4000dccc <__errno> 400033c0: b0 10 00 1d mov %i5, %i0 400033c4: 82 10 20 0c mov 0xc, %g1 400033c8: c2 22 00 00 st %g1, [ %o0 ] 400033cc: 81 c7 e0 08 ret 400033d0: 81 e8 00 00 restore } /* * If the user wants us to dirty the allocated memory, then do it. */ if ( rtems_malloc_dirty_helper ) 400033d4: c2 00 60 80 ld [ %g1 + 0x80 ], %g1 400033d8: 80 a0 60 00 cmp %g1, 0 400033dc: 02 80 00 04 be 400033ec 400033e0: 90 10 00 1d mov %i5, %o0 (*rtems_malloc_dirty_helper)( return_this, size ); 400033e4: 9f c0 40 00 call %g1 400033e8: 92 10 00 18 mov %i0, %o1 /* * If configured, update the statistics */ if ( rtems_malloc_statistics_helpers ) 400033ec: 03 10 00 72 sethi %hi(0x4001c800), %g1 400033f0: c2 00 60 84 ld [ %g1 + 0x84 ], %g1 ! 4001c884 400033f4: 80 a0 60 00 cmp %g1, 0 400033f8: 22 80 00 06 be,a 40003410 400033fc: b0 10 00 1d mov %i5, %i0 (*rtems_malloc_statistics_helpers->at_malloc)(return_this); 40003400: c2 00 60 04 ld [ %g1 + 4 ], %g1 40003404: 9f c0 40 00 call %g1 40003408: 90 10 00 1d mov %i5, %o0 return return_this; } 4000340c: b0 10 00 1d mov %i5, %i0 40003410: 81 c7 e0 08 ret 40003414: 81 e8 00 00 restore =============================================================================== 4000c81c : * Allocate a block for an in-memory file. */ int memfile_blocks_allocated = 0; void *memfile_alloc_block(void) { 4000c81c: 9d e3 bf a0 save %sp, -96, %sp void *memory; memory = (void *)calloc(1, IMFS_MEMFILE_BYTES_PER_BLOCK); 4000c820: 03 10 00 72 sethi %hi(0x4001c800), %g1 4000c824: d2 00 60 98 ld [ %g1 + 0x98 ], %o1 ! 4001c898 4000c828: 7f ff d9 36 call 40002d00 4000c82c: 90 10 20 01 mov 1, %o0 if ( memory ) 4000c830: b0 92 20 00 orcc %o0, 0, %i0 4000c834: 02 80 00 05 be 4000c848 <== NEVER TAKEN 4000c838: 03 10 00 72 sethi %hi(0x4001c800), %g1 memfile_blocks_allocated++; 4000c83c: c4 00 61 ac ld [ %g1 + 0x1ac ], %g2 ! 4001c9ac 4000c840: 84 00 a0 01 inc %g2 4000c844: c4 20 61 ac st %g2, [ %g1 + 0x1ac ] return memory; } 4000c848: 81 c7 e0 08 ret 4000c84c: 81 e8 00 00 restore =============================================================================== 4000d344 : int memfile_ftruncate( rtems_libio_t *iop, off_t length ) { 4000d344: 9d e3 bf 98 save %sp, -104, %sp <== NOT EXECUTED IMFS_jnode_t *the_jnode; the_jnode = iop->pathinfo.node_access; 4000d348: fa 06 20 1c ld [ %i0 + 0x1c ], %i5 <== NOT EXECUTED * POSIX 1003.1b does not specify what happens if you truncate a file * and the new length is greater than the current size. We treat this * as an extend operation. */ if ( length > the_jnode->info.file.size ) 4000d34c: c2 07 60 50 ld [ %i5 + 0x50 ], %g1 <== NOT EXECUTED 4000d350: 80 a0 40 19 cmp %g1, %i1 <== NOT EXECUTED 4000d354: 06 80 00 09 bl 4000d378 <== NOT EXECUTED 4000d358: 90 10 00 1d mov %i5, %o0 <== NOT EXECUTED 4000d35c: 32 80 00 0d bne,a 4000d390 <== NOT EXECUTED 4000d360: f2 27 60 50 st %i1, [ %i5 + 0x50 ] <== NOT EXECUTED 4000d364: c2 07 60 54 ld [ %i5 + 0x54 ], %g1 <== NOT EXECUTED 4000d368: 80 a0 40 1a cmp %g1, %i2 <== NOT EXECUTED 4000d36c: 3a 80 00 09 bcc,a 4000d390 <== NOT EXECUTED 4000d370: f2 27 60 50 st %i1, [ %i5 + 0x50 ] <== NOT EXECUTED return IMFS_memfile_extend( the_jnode, true, length ); 4000d374: 90 10 00 1d mov %i5, %o0 <== NOT EXECUTED 4000d378: 92 10 20 01 mov 1, %o1 <== NOT EXECUTED 4000d37c: 94 10 00 19 mov %i1, %o2 <== NOT EXECUTED 4000d380: 7f ff fe df call 4000cefc <== NOT EXECUTED 4000d384: 96 10 00 1a mov %i2, %o3 <== NOT EXECUTED 4000d388: 81 c7 e0 08 ret <== NOT EXECUTED 4000d38c: 91 e8 00 08 restore %g0, %o0, %o0 <== NOT EXECUTED /* * The in-memory files do not currently reclaim memory until the file is * deleted. So we leave the previously allocated blocks in place for * future use and just set the length. */ the_jnode->info.file.size = length; 4000d390: f4 27 60 54 st %i2, [ %i5 + 0x54 ] <== NOT EXECUTED IMFS_update_atime( the_jnode ); 4000d394: 90 07 bf f8 add %fp, -8, %o0 <== NOT EXECUTED 4000d398: 7f ff d7 37 call 40003074 <== NOT EXECUTED 4000d39c: 92 10 20 00 clr %o1 <== NOT EXECUTED 4000d3a0: c2 07 bf f8 ld [ %fp + -8 ], %g1 <== NOT EXECUTED 4000d3a4: c2 27 60 40 st %g1, [ %i5 + 0x40 ] <== NOT EXECUTED return 0; } 4000d3a8: 81 c7 e0 08 ret <== NOT EXECUTED 4000d3ac: 91 e8 20 00 restore %g0, 0, %o0 <== NOT EXECUTED =============================================================================== 4000d2c8 : rtems_libio_t *iop, const char *pathname, int oflag, mode_t mode ) { 4000d2c8: 9d e3 bf a0 save %sp, -96, %sp the_jnode = iop->pathinfo.node_access; /* * Perform 'copy on write' for linear files */ if ((iop->flags & LIBIO_FLAGS_WRITE) 4000d2cc: c2 06 20 10 ld [ %i0 + 0x10 ], %g1 4000d2d0: 80 88 60 04 btst 4, %g1 4000d2d4: 12 80 00 04 bne 4000d2e4 4000d2d8: d0 06 20 1c ld [ %i0 + 0x1c ], %o0 if ((count != 0) && (IMFS_memfile_write(the_jnode, 0, buffer, count) == -1)) return -1; } return 0; 4000d2dc: 81 c7 e0 08 ret 4000d2e0: 91 e8 20 00 restore %g0, 0, %o0 4000d2e4: c2 02 20 4c ld [ %o0 + 0x4c ], %g1 /* * Perform 'copy on write' for linear files */ if ((iop->flags & LIBIO_FLAGS_WRITE) && (IMFS_type( the_jnode ) == IMFS_LINEAR_FILE)) { 4000d2e8: c2 00 40 00 ld [ %g1 ], %g1 4000d2ec: 80 a0 60 05 cmp %g1, 5 4000d2f0: 12 bf ff fb bne 4000d2dc <== ALWAYS TAKEN 4000d2f4: 03 10 00 6c sethi %hi(0x4001b000), %g1 uint32_t count = the_jnode->info.linearfile.size; 4000d2f8: d8 02 20 54 ld [ %o0 + 0x54 ], %o4 <== NOT EXECUTED const unsigned char *buffer = the_jnode->info.linearfile.direct; 4000d2fc: d6 02 20 58 ld [ %o0 + 0x58 ], %o3 <== NOT EXECUTED the_jnode->control = &IMFS_node_control_memfile; the_jnode->info.file.size = 0; 4000d300: c0 22 20 50 clr [ %o0 + 0x50 ] <== NOT EXECUTED 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; the_jnode->control = &IMFS_node_control_memfile; 4000d304: 82 10 63 14 or %g1, 0x314, %g1 <== NOT EXECUTED the_jnode->info.file.size = 0; 4000d308: c0 22 20 54 clr [ %o0 + 0x54 ] <== NOT EXECUTED 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; the_jnode->control = &IMFS_node_control_memfile; 4000d30c: c2 22 20 4c st %g1, [ %o0 + 0x4c ] <== NOT EXECUTED the_jnode->info.file.size = 0; the_jnode->info.file.indirect = 0; 4000d310: c0 22 20 58 clr [ %o0 + 0x58 ] <== NOT EXECUTED the_jnode->info.file.doubly_indirect = 0; 4000d314: c0 22 20 5c clr [ %o0 + 0x5c ] <== NOT EXECUTED the_jnode->info.file.triply_indirect = 0; if ((count != 0) 4000d318: 80 a3 20 00 cmp %o4, 0 <== NOT EXECUTED 4000d31c: 02 bf ff f0 be 4000d2dc <== NOT EXECUTED 4000d320: c0 22 20 60 clr [ %o0 + 0x60 ] <== NOT EXECUTED && (IMFS_memfile_write(the_jnode, 0, buffer, count) == -1)) 4000d324: 92 10 20 00 clr %o1 <== NOT EXECUTED 4000d328: 7f ff ff 5d call 4000d09c <== NOT EXECUTED 4000d32c: 94 10 20 00 clr %o2 <== NOT EXECUTED return -1; 4000d330: 90 38 00 08 xnor %g0, %o0, %o0 <== NOT EXECUTED 4000d334: 80 a0 00 08 cmp %g0, %o0 <== NOT EXECUTED 4000d338: b0 40 3f ff addx %g0, -1, %i0 <== NOT EXECUTED } return 0; } 4000d33c: 81 c7 e0 08 ret <== NOT EXECUTED 4000d340: 81 e8 00 00 restore <== NOT EXECUTED =============================================================================== 40003538 : const char *target, const char *filesystemtype, rtems_filesystem_options_t options, const void *data ) { 40003538: 9d e3 bf 50 save %sp, -176, %sp int rv = 0; if ( 4000353c: 80 a6 e0 01 cmp %i3, 1 40003540: 18 80 00 b4 bgu 40003810 40003544: 01 00 00 00 nop options == RTEMS_FILESYSTEM_READ_ONLY || options == RTEMS_FILESYSTEM_READ_WRITE ) { rtems_filesystem_fsmount_me_t fsmount_me_h = 40003548: 40 00 20 46 call 4000b660 4000354c: 90 10 00 1a mov %i2, %o0 rtems_filesystem_get_mount_handler( filesystemtype ); if ( fsmount_me_h != NULL ) { 40003550: a6 92 20 00 orcc %o0, 0, %l3 40003554: 02 80 00 af be 40003810 40003558: a2 96 60 00 orcc %i1, 0, %l1 const char *target_or_null, const char *filesystemtype, size_t *target_length_ptr ) { const char *target = target_or_null != NULL ? target_or_null : "/"; 4000355c: 12 80 00 04 bne 4000356c 40003560: 01 00 00 00 nop 40003564: 23 10 00 6b sethi %hi(0x4001ac00), %l1 40003568: a2 14 63 38 or %l1, 0x338, %l1 ! 4001af38 size_t filesystemtype_size = strlen( filesystemtype ) + 1; 4000356c: 40 00 2f 5f call 4000f2e8 40003570: 90 10 00 1a mov %i2, %o0 size_t source_size = source_or_null != NULL ? strlen( source_or_null ) + 1 : 0; 40003574: 80 a6 20 00 cmp %i0, 0 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; 40003578: ba 10 00 08 mov %o0, %i5 size_t source_size = source_or_null != NULL ? strlen( source_or_null ) + 1 : 0; 4000357c: 02 80 00 06 be 40003594 40003580: ac 02 20 01 add %o0, 1, %l6 40003584: 40 00 2f 59 call 4000f2e8 40003588: 90 10 00 18 mov %i0, %o0 4000358c: 10 80 00 03 b 40003598 40003590: a0 02 20 01 add %o0, 1, %l0 40003594: a0 10 20 00 clr %l0 size_t target_size = strlen( target ) + 1; size_t size = sizeof( rtems_filesystem_mount_table_entry_t ) + filesystemtype_size + source_size + target_size 40003598: ba 07 60 65 add %i5, 0x65, %i5 { const char *target = target_or_null != NULL ? target_or_null : "/"; size_t filesystemtype_size = strlen( filesystemtype ) + 1; size_t source_size = source_or_null != NULL ? strlen( source_or_null ) + 1 : 0; size_t target_size = strlen( target ) + 1; 4000359c: 40 00 2f 53 call 4000f2e8 400035a0: 90 10 00 11 mov %l1, %o0 size_t size = sizeof( rtems_filesystem_mount_table_entry_t ) + filesystemtype_size + source_size + target_size 400035a4: 92 07 40 10 add %i5, %l0, %o1 { const char *target = target_or_null != NULL ? target_or_null : "/"; size_t filesystemtype_size = strlen( filesystemtype ) + 1; size_t source_size = source_or_null != NULL ? strlen( source_or_null ) + 1 : 0; size_t target_size = strlen( target ) + 1; 400035a8: aa 02 20 01 add %o0, 1, %l5 size_t size = sizeof( rtems_filesystem_mount_table_entry_t ) + filesystemtype_size + source_size + target_size + sizeof( rtems_filesystem_global_location_t ); rtems_filesystem_mount_table_entry_t *mt_entry = calloc( 1, size ); 400035ac: 90 10 20 01 mov 1, %o0 400035b0: 7f ff fd d4 call 40002d00 400035b4: 92 02 40 15 add %o1, %l5, %o1 if ( mt_entry != NULL ) { 400035b8: ba 92 20 00 orcc %o0, 0, %i5 400035bc: 02 80 00 9d be 40003830 <== NEVER TAKEN 400035c0: a4 07 60 64 add %i5, 0x64, %l2 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 ); memcpy( str, filesystemtype, filesystemtype_size ); 400035c4: 92 10 00 1a mov %i2, %o1 400035c8: 90 10 00 12 mov %l2, %o0 400035cc: 40 00 2c 11 call 4000e610 400035d0: 94 10 00 16 mov %l6, %o2 mt_entry->type = str; 400035d4: e4 27 60 34 st %l2, [ %i5 + 0x34 ] + 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 = 400035d8: a8 07 60 40 add %i5, 0x40, %l4 memcpy( str, filesystemtype, filesystemtype_size ); mt_entry->type = str; str += filesystemtype_size; if ( source_or_null != NULL ) { 400035dc: 80 a6 20 00 cmp %i0, 0 400035e0: 02 80 00 08 be 40003600 400035e4: b4 04 80 16 add %l2, %l6, %i2 memcpy( str, source_or_null, source_size ); 400035e8: 90 10 00 1a mov %i2, %o0 400035ec: 92 10 00 18 mov %i0, %o1 400035f0: 40 00 2c 08 call 4000e610 400035f4: 94 10 00 10 mov %l0, %o2 mt_entry->dev = str; 400035f8: f4 27 60 38 st %i2, [ %i5 + 0x38 ] str += source_size; 400035fc: b4 06 80 10 add %i2, %l0, %i2 } memcpy( str, target, target_size ); 40003600: 92 10 00 11 mov %l1, %o1 40003604: 94 10 00 15 mov %l5, %o2 40003608: 40 00 2c 02 call 4000e610 4000360c: 90 10 00 1a mov %i2, %o0 mt_entry->target = str; str += target_size; mt_entry->mounted = true; 40003610: 82 10 20 01 mov 1, %g1 40003614: c2 2f 60 28 stb %g1, [ %i5 + 0x28 ] mt_entry->mt_fs_root = mt_fs_root; mt_entry->pathconf_limits_and_options = &rtems_filesystem_default_pathconf; 40003618: 03 10 00 6b sethi %hi(0x4001ac00), %g1 4000361c: 82 10 63 3c or %g1, 0x33c, %g1 ! 4001af3c 40003620: c2 27 60 2c st %g1, [ %i5 + 0x2c ] mt_fs_root->location.mt_entry = mt_entry; mt_fs_root->reference_count = 1; 40003624: 82 10 20 01 mov 1, %g1 void *starting_address, size_t number_nodes, size_t node_size ) { _Chain_Initialize( the_chain, starting_address, number_nodes, node_size ); 40003628: 90 07 60 14 add %i5, 0x14, %o0 4000362c: c2 27 60 58 st %g1, [ %i5 + 0x58 ] 40003630: 92 10 00 14 mov %l4, %o1 40003634: 94 10 20 01 mov 1, %o2 40003638: 96 10 20 24 mov 0x24, %o3 mt_entry->dev = str; str += source_size; } memcpy( str, target, target_size ); mt_entry->target = str; 4000363c: f4 27 60 30 st %i2, [ %i5 + 0x30 ] str += target_size; mt_entry->mounted = true; mt_entry->mt_fs_root = mt_fs_root; 40003640: e8 27 60 24 st %l4, [ %i5 + 0x24 ] 40003644: 40 00 11 06 call 40007a5c <_Chain_Initialize> 40003648: fa 27 60 54 st %i5, [ %i5 + 0x54 ] filesystemtype, &target_length ); if ( mt_entry != NULL ) { mt_entry->writeable = options == RTEMS_FILESYSTEM_READ_WRITE; 4000364c: b6 0e e0 01 and %i3, 1, %i3 rv = (*fsmount_me_h)( mt_entry, data ); 40003650: 90 10 00 1d mov %i5, %o0 filesystemtype, &target_length ); if ( mt_entry != NULL ) { mt_entry->writeable = options == RTEMS_FILESYSTEM_READ_WRITE; 40003654: f6 2f 60 29 stb %i3, [ %i5 + 0x29 ] rv = (*fsmount_me_h)( mt_entry, data ); 40003658: 9f c4 c0 00 call %l3 4000365c: 92 10 00 1c mov %i4, %o1 if ( rv == 0 ) { 40003660: b0 92 20 00 orcc %o0, 0, %i0 40003664: 12 80 00 6f bne 40003820 40003668: 80 a6 60 00 cmp %i1, 0 if ( target != NULL ) { 4000366c: 02 80 00 38 be 4000374c 40003670: 92 10 00 19 mov %i1, %o1 { 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 = 40003674: 94 10 20 1f mov 0x1f, %o2 40003678: 40 00 02 b0 call 40004138 4000367c: 90 07 bf c8 add %fp, -56, %o0 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; 40003680: c2 02 20 14 ld [ %o0 + 0x14 ], %g1 return (*mt_entry->ops->are_nodes_equal_h)( 40003684: c4 00 60 0c ld [ %g1 + 0xc ], %g2 40003688: c4 00 a0 10 ld [ %g2 + 0x10 ], %g2 4000368c: 9f c0 80 00 call %g2 40003690: d2 00 60 24 ld [ %g1 + 0x24 ], %o1 rtems_filesystem_eval_path_start( &ctx, target, eval_flags ); if ( !rtems_filesystem_location_is_instance_root( currentloc ) ) { 40003694: 80 8a 20 ff btst 0xff, %o0 40003698: 12 80 00 22 bne 40003720 4000369c: 92 07 bf e0 add %fp, -32, %o1 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( 400036a0: 40 00 03 a0 call 40004520 400036a4: 90 07 bf b0 add %fp, -80, %o0 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 ); 400036a8: 40 00 04 16 call 40004700 400036ac: 90 07 bf b0 add %fp, -80, %o0 mt_entry->mt_point_node = mt_point_node; rv = (*mt_point_node->location.mt_entry->ops->mount_h)( mt_entry ); 400036b0: c2 02 20 14 ld [ %o0 + 0x14 ], %g1 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 ); mt_entry->mt_point_node = mt_point_node; 400036b4: d0 27 60 20 st %o0, [ %i5 + 0x20 ] rv = (*mt_point_node->location.mt_entry->ops->mount_h)( mt_entry ); 400036b8: c2 00 60 0c ld [ %g1 + 0xc ], %g1 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 ); 400036bc: b8 10 00 08 mov %o0, %i4 mt_entry->mt_point_node = mt_point_node; rv = (*mt_point_node->location.mt_entry->ops->mount_h)( mt_entry ); 400036c0: c2 00 60 30 ld [ %g1 + 0x30 ], %g1 400036c4: 9f c0 40 00 call %g1 400036c8: 90 10 00 1d mov %i5, %o0 if ( rv == 0 ) { 400036cc: b0 92 20 00 orcc %o0, 0, %i0 400036d0: 12 80 00 11 bne 40003714 400036d4: 92 10 20 00 clr %o1 */ #include static inline void rtems_libio_lock( void ) { rtems_semaphore_obtain( rtems_libio_semaphore, RTEMS_WAIT, RTEMS_NO_TIMEOUT ); 400036d8: 39 10 00 72 sethi %hi(0x4001c800), %i4 400036dc: d0 07 23 30 ld [ %i4 + 0x330 ], %o0 ! 4001cb30 400036e0: 40 00 0e 24 call 40006f70 400036e4: 94 10 20 00 clr %o2 Chain_Control *the_chain, Chain_Node *the_node ) { Chain_Node *tail = _Chain_Tail( the_chain ); Chain_Node *old_last = tail->previous; 400036e8: 03 10 00 70 sethi %hi(0x4001c000), %g1 } static inline void rtems_libio_unlock( void ) { rtems_semaphore_release( rtems_libio_semaphore ); 400036ec: d0 07 23 30 ld [ %i4 + 0x330 ], %o0 400036f0: 82 10 62 4c or %g1, 0x24c, %g1 400036f4: c4 00 60 08 ld [ %g1 + 8 ], %g2 the_node->next = tail; 400036f8: 86 00 60 04 add %g1, 4, %g3 400036fc: c6 27 40 00 st %g3, [ %i5 ] tail->previous = the_node; 40003700: fa 20 60 08 st %i5, [ %g1 + 8 ] old_last->next = the_node; 40003704: fa 20 80 00 st %i5, [ %g2 ] 40003708: 40 00 0e 63 call 40007094 4000370c: c4 27 60 04 st %g2, [ %i5 + 4 ] 40003710: 30 80 00 08 b,a 40003730 &rtems_filesystem_mount_table, &mt_entry->mt_node ); rtems_filesystem_mt_unlock(); } else { rtems_filesystem_global_location_release( mt_point_node ); 40003714: 40 00 03 a8 call 400045b4 40003718: 90 10 00 1c mov %i4, %o0 4000371c: 30 80 00 05 b,a 40003730 } } else { rtems_filesystem_eval_path_error( &ctx, EBUSY ); 40003720: 90 07 bf c8 add %fp, -56, %o0 40003724: 92 10 20 10 mov 0x10, %o1 40003728: 40 00 01 ee call 40003ee0 4000372c: b0 10 3f ff mov -1, %i0 rv = -1; } rtems_filesystem_eval_path_cleanup( &ctx ); 40003730: 40 00 02 be call 40004228 40003734: 90 07 bf c8 add %fp, -56, %o0 rv = register_subordinate_file_system( mt_entry, target ); } else { rv = register_root_file_system( mt_entry ); } if ( rv != 0 ) { 40003738: 80 a6 20 00 cmp %i0, 0 4000373c: 02 80 00 42 be 40003844 40003740: 01 00 00 00 nop (*mt_entry->ops->fsunmount_me_h)( mt_entry ); 40003744: 10 80 00 2f b 40003800 40003748: c2 07 60 0c ld [ %i5 + 0xc ], %g1 */ #include static inline void rtems_libio_lock( void ) { rtems_semaphore_obtain( rtems_libio_semaphore, RTEMS_WAIT, RTEMS_NO_TIMEOUT ); 4000374c: 03 10 00 72 sethi %hi(0x4001c800), %g1 40003750: d0 00 63 30 ld [ %g1 + 0x330 ], %o0 ! 4001cb30 40003754: 92 10 20 00 clr %o1 40003758: 40 00 0e 06 call 40006f70 4000375c: 94 10 20 00 clr %o2 */ RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_first( const Chain_Control *the_chain ) { return _Chain_Immutable_head( the_chain )->next; 40003760: 05 10 00 70 sethi %hi(0x4001c000), %g2 ) { int rv = 0; rtems_filesystem_mt_lock(); if ( rtems_chain_is_empty( &rtems_filesystem_mount_table ) ) { 40003764: c6 00 a2 4c ld [ %g2 + 0x24c ], %g3 ! 4001c24c 40003768: 82 10 a2 4c or %g2, 0x24c, %g1 4000376c: 84 00 60 04 add %g1, 4, %g2 40003770: 80 a0 c0 02 cmp %g3, %g2 40003774: 12 80 00 08 bne 40003794 <== NEVER TAKEN 40003778: 01 00 00 00 nop Chain_Control *the_chain, Chain_Node *the_node ) { Chain_Node *tail = _Chain_Tail( the_chain ); Chain_Node *old_last = tail->previous; 4000377c: c4 00 60 08 ld [ %g1 + 8 ], %g2 the_node->next = tail; 40003780: c6 27 40 00 st %g3, [ %i5 ] tail->previous = the_node; 40003784: fa 20 60 08 st %i5, [ %g1 + 8 ] old_last->next = the_node; 40003788: fa 20 80 00 st %i5, [ %g2 ] the_node->previous = old_last; 4000378c: 10 80 00 06 b 400037a4 40003790: c4 27 60 04 st %g2, [ %i5 + 4 ] rtems_chain_append_unprotected( &rtems_filesystem_mount_table, &mt_entry->mt_node ); } else { errno = EINVAL; 40003794: 40 00 29 4e call 4000dccc <__errno> <== NOT EXECUTED 40003798: b0 10 3f ff mov -1, %i0 <== NOT EXECUTED 4000379c: 82 10 20 16 mov 0x16, %g1 <== NOT EXECUTED 400037a0: c2 22 00 00 st %g1, [ %o0 ] <== NOT EXECUTED } static inline void rtems_libio_unlock( void ) { rtems_semaphore_release( rtems_libio_semaphore ); 400037a4: 03 10 00 72 sethi %hi(0x4001c800), %g1 400037a8: 40 00 0e 3b call 40007094 400037ac: d0 00 63 30 ld [ %g1 + 0x330 ], %o0 ! 4001cb30 rv = -1; } rtems_filesystem_mt_unlock(); if ( rv == 0 ) { 400037b0: 80 a6 20 00 cmp %i0, 0 400037b4: 32 80 00 13 bne,a 40003800 <== NEVER TAKEN 400037b8: c2 07 60 0c ld [ %i5 + 0xc ], %g1 <== NOT EXECUTED rtems_filesystem_global_location_t *new_fs_root = rtems_filesystem_global_location_obtain( &mt_entry->mt_fs_root ); 400037bc: ba 07 60 24 add %i5, 0x24, %i5 rv = -1; } rtems_filesystem_mt_unlock(); if ( rv == 0 ) { rtems_filesystem_global_location_t *new_fs_root = 400037c0: 40 00 03 9e call 40004638 400037c4: 90 10 00 1d mov %i5, %o0 400037c8: b6 10 00 08 mov %o0, %i3 rtems_filesystem_global_location_obtain( &mt_entry->mt_fs_root ); rtems_filesystem_global_location_t *new_fs_current = 400037cc: 40 00 03 9b call 40004638 400037d0: 90 10 00 1d mov %i5, %o0 rtems_filesystem_global_location_obtain( &mt_entry->mt_fs_root ); rtems_filesystem_global_location_assign( 400037d4: 3b 10 00 70 sethi %hi(0x4001c000), %i5 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 = 400037d8: b8 10 00 08 mov %o0, %i4 rtems_filesystem_global_location_obtain( &mt_entry->mt_fs_root ); rtems_filesystem_global_location_assign( 400037dc: d0 07 62 6c ld [ %i5 + 0x26c ], %o0 400037e0: 92 10 00 1b mov %i3, %o1 400037e4: 40 00 03 8c call 40004614 400037e8: 90 02 20 04 add %o0, 4, %o0 &rtems_filesystem_root, new_fs_root ); rtems_filesystem_global_location_assign( 400037ec: d0 07 62 6c ld [ %i5 + 0x26c ], %o0 400037f0: 40 00 03 89 call 40004614 400037f4: 92 10 00 1c mov %i4, %o1 400037f8: 81 c7 e0 08 ret 400037fc: 81 e8 00 00 restore } else { rv = register_root_file_system( mt_entry ); } if ( rv != 0 ) { (*mt_entry->ops->fsunmount_me_h)( mt_entry ); 40003800: c2 00 60 3c ld [ %g1 + 0x3c ], %g1 40003804: 9f c0 40 00 call %g1 40003808: 90 10 00 1d mov %i5, %o0 4000380c: 30 80 00 05 b,a 40003820 } else { errno = EINVAL; rv = -1; } } else { errno = EINVAL; 40003810: 40 00 29 2f call 4000dccc <__errno> 40003814: 01 00 00 00 nop 40003818: 10 80 00 09 b 4000383c 4000381c: 82 10 20 16 mov 0x16, %g1 ! 16 (*mt_entry->ops->fsunmount_me_h)( mt_entry ); } } if ( rv != 0 ) { free( mt_entry ); 40003820: 7f ff fd eb call 40002fcc 40003824: 90 10 00 1d mov %i5, %o0 40003828: 81 c7 e0 08 ret 4000382c: 81 e8 00 00 restore } } else { errno = ENOMEM; 40003830: 40 00 29 27 call 4000dccc <__errno> <== NOT EXECUTED 40003834: 01 00 00 00 nop <== NOT EXECUTED 40003838: 82 10 20 0c mov 0xc, %g1 ! c <== NOT EXECUTED 4000383c: c2 22 00 00 st %g1, [ %o0 ] rv = -1; 40003840: b0 10 3f ff mov -1, %i0 errno = EINVAL; rv = -1; } return rv; } 40003844: 81 c7 e0 08 ret 40003848: 81 e8 00 00 restore =============================================================================== 40007fa4 : const char *target, const char *filesystemtype, rtems_filesystem_options_t options, const void *data ) { 40007fa4: 9d e3 bf a0 save %sp, -96, %sp int rv = -1; if (target != NULL) { 40007fa8: 90 96 60 00 orcc %i1, 0, %o0 40007fac: 02 80 00 09 be 40007fd0 40007fb0: 01 00 00 00 nop rv = rtems_mkdir(target, S_IRWXU | S_IRWXG | S_IRWXO); 40007fb4: 40 00 02 cd call 40008ae8 40007fb8: 92 10 21 ff mov 0x1ff, %o1 ! 1ff if (rv == 0) { 40007fbc: 80 a2 20 00 cmp %o0, 0 40007fc0: 12 80 00 09 bne 40007fe4 <== NEVER TAKEN 40007fc4: 01 00 00 00 nop rv = mount( 40007fc8: 40 00 00 09 call 40007fec 40007fcc: 81 e8 00 00 restore options, data ); } } else { errno = EINVAL; 40007fd0: 40 00 5c bd call 4001f2c4 <__errno> 40007fd4: 01 00 00 00 nop 40007fd8: 82 10 20 16 mov 0x16, %g1 ! 16 40007fdc: c2 22 00 00 st %g1, [ %o0 ] const char *filesystemtype, rtems_filesystem_options_t options, const void *data ) { int rv = -1; 40007fe0: 90 10 3f ff mov -1, %o0 } else { errno = EINVAL; } return rv; } 40007fe4: 81 c7 e0 08 ret 40007fe8: 91 e8 00 08 restore %g0, %o0, %o0 =============================================================================== 40016188 : msdos_node_type_t type, const char *name, int name_len, mode_t mode, const fat_file_fd_t *link_fd) { 40016188: 9d e3 bf 00 save %sp, -256, %sp int rc = RC_OK; ssize_t ret = 0; msdos_fs_info_t *fs_info = parent_loc->mt_entry->fs_info; 4001618c: c2 06 20 14 ld [ %i0 + 0x14 ], %g1 uint32_t sec = 0; uint32_t byte = 0; fat_dir_pos_init(&dir_pos); memset(short_node, 0, MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE); 40016190: 92 10 20 00 clr %o1 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; 40016194: f8 00 60 08 ld [ %g1 + 8 ], %i4 fat_dir_pos_t *dir_pos ) { dir_pos->sname.cln = 0; dir_pos->sname.ofs = 0; dir_pos->lname.cln = FAT_FILE_SHORT_NAME; 40016198: 82 10 3f ff mov -1, %g1 uint32_t sec = 0; uint32_t byte = 0; fat_dir_pos_init(&dir_pos); memset(short_node, 0, MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE); 4001619c: 94 10 20 20 mov 0x20, %o2 400161a0: c2 27 bf 78 st %g1, [ %fp + -136 ] dir_pos->lname.ofs = FAT_FILE_SHORT_NAME; 400161a4: c2 27 bf 7c st %g1, [ %fp + -132 ] const fat_file_fd_t *link_fd) { int rc = RC_OK; ssize_t ret = 0; msdos_fs_info_t *fs_info = parent_loc->mt_entry->fs_info; fat_file_fd_t *parent_fat_fd = parent_loc->node_access; 400161a8: e0 06 20 08 ld [ %i0 + 8 ], %l0 fat_file_fd_t *fat_fd = NULL; 400161ac: c0 27 bf 6c clr [ %fp + -148 ] time_t time_ret = 0; uint16_t time_val = 0; 400161b0: c0 37 bf 68 clrh [ %fp + -152 ] uint16_t date = 0; 400161b4: c0 37 bf 6a clrh [ %fp + -150 ] static inline void fat_dir_pos_init( fat_dir_pos_t *dir_pos ) { dir_pos->sname.cln = 0; 400161b8: c0 27 bf 70 clr [ %fp + -144 ] dir_pos->sname.ofs = 0; 400161bc: c0 27 bf 74 clr [ %fp + -140 ] uint32_t sec = 0; uint32_t byte = 0; fat_dir_pos_init(&dir_pos); memset(short_node, 0, MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE); 400161c0: 40 00 11 3d call 4001a6b4 400161c4: 90 07 bf 80 add %fp, -128, %o0 memset(dot_dotdot, 0, MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE * 2); 400161c8: 90 07 bf c0 add %fp, -64, %o0 400161cc: 92 10 20 00 clr %o1 400161d0: 40 00 11 39 call 4001a6b4 400161d4: 94 10 20 40 mov 0x40, %o2 if (name_len > MSDOS_NAME_MAX_LFN_WITH_DOT) { 400161d8: 80 a6 e1 04 cmp %i3, 0x104 400161dc: 24 80 00 06 ble,a 400161f4 <== ALWAYS TAKEN 400161e0: 90 10 00 1a mov %i2, %o0 rtems_set_errno_and_return_minus_one(ENAMETOOLONG); 400161e4: 40 00 0e 52 call 40019b2c <__errno> <== NOT EXECUTED 400161e8: 01 00 00 00 nop <== NOT EXECUTED 400161ec: 10 80 00 0c b 4001621c <== NOT EXECUTED 400161f0: 82 10 20 5b mov 0x5b, %g1 ! 5b <== NOT EXECUTED } name_type = msdos_long_to_short (name, name_len, 400161f4: 92 10 00 1b mov %i3, %o1 400161f8: 94 07 bf 80 add %fp, -128, %o2 400161fc: 40 00 01 45 call 40016710 40016200: 96 10 20 0b mov 0xb, %o3 MSDOS_DIR_NAME(short_node), MSDOS_NAME_MAX); if (name_type == MSDOS_NAME_INVALID) { 40016204: a4 92 20 00 orcc %o0, 0, %l2 40016208: 32 80 00 08 bne,a 40016228 <== ALWAYS TAKEN 4001620c: c0 2f bf 8c clrb [ %fp + -116 ] rtems_set_errno_and_return_minus_one(EINVAL); 40016210: 40 00 0e 47 call 40019b2c <__errno> <== NOT EXECUTED 40016214: 01 00 00 00 nop <== NOT EXECUTED 40016218: 82 10 20 16 mov 0x16, %g1 ! 16 <== NOT EXECUTED 4001621c: c2 22 00 00 st %g1, [ %o0 ] <== NOT EXECUTED 40016220: 10 80 00 ce b 40016558 <== NOT EXECUTED 40016224: ba 10 3f ff mov -1, %i5 <== NOT EXECUTED /* fill reserved field */ *MSDOS_DIR_NT_RES(short_node) = MSDOS_RES_NT_VALUE; /* set up last write date and time */ time_ret = time(NULL); 40016228: 40 00 1f e6 call 4001e1c0