=============================================================================== 4000ac5c : int IMFS_chown( const rtems_filesystem_location_info_t *loc, uid_t owner, gid_t group ) { 4000ac5c: 9d e3 bf 98 save %sp, -104, %sp /* * Verify I am the owner of the node or the super user. */ #if defined(RTEMS_POSIX_API) st_uid = geteuid(); 4000ac60: 40 00 02 4a call 4000b588 4000ac64: fa 06 20 08 ld [ %i0 + 8 ], %i5 if ( ( st_uid != jnode->st_uid ) && ( st_uid != 0 ) ) 4000ac68: c2 17 60 3c lduh [ %i5 + 0x3c ], %g1 4000ac6c: 91 2a 20 10 sll %o0, 0x10, %o0 4000ac70: 91 32 20 10 srl %o0, 0x10, %o0 4000ac74: 80 a2 00 01 cmp %o0, %g1 4000ac78: 02 80 00 0a be 4000aca0 4000ac7c: 80 a2 20 00 cmp %o0, 0 4000ac80: 22 80 00 09 be,a 4000aca4 <== NEVER TAKEN 4000ac84: f2 37 60 3c sth %i1, [ %i5 + 0x3c ] <== NOT EXECUTED rtems_set_errno_and_return_minus_one( EPERM ); 4000ac88: 40 00 0f 79 call 4000ea6c <__errno> 4000ac8c: b0 10 3f ff mov -1, %i0 4000ac90: 82 10 20 01 mov 1, %g1 4000ac94: c2 22 00 00 st %g1, [ %o0 ] 4000ac98: 81 c7 e0 08 ret 4000ac9c: 81 e8 00 00 restore #endif jnode->st_uid = owner; 4000aca0: f2 37 60 3c sth %i1, [ %i5 + 0x3c ] jnode->st_gid = group; 4000aca4: f4 37 60 3e sth %i2, [ %i5 + 0x3e ] IMFS_update_ctime( jnode ); 4000aca8: 90 07 bf f8 add %fp, -8, %o0 4000acac: 7f ff e0 f2 call 40003074 4000acb0: 92 10 20 00 clr %o1 4000acb4: c2 07 bf f8 ld [ %fp + -8 ], %g1 4000acb8: c2 27 60 48 st %g1, [ %i5 + 0x48 ] return 0; } 4000acbc: 81 c7 e0 08 ret 4000acc0: 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 8b sethi %hi(0x40022c00), %i2 40005064: 39 10 00 93 sethi %hi(0x40024c00), %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 8b sethi %hi(0x40022c00), %l0 return; } puts(""); 4000506c: 23 10 00 8b sethi %hi(0x40022c00), %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 8b sethi %hi(0x40022c00), %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 a1 b0 or %i2, 0x1b0, %i2 4000507c: b8 17 20 88 or %i4, 0x88, %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 22 20 or %l0, 0x220, %l0 return; } puts(""); 40005084: a2 14 60 a0 or %l1, 0xa0, %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 08 or %l2, 0x208, %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 37 7d call 40012e88 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 37 75 call 40012e88 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 37 32 call 40012db8 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 8b sethi %hi(0x40022c00), %o1 40005104: d0 00 60 08 ld [ %g1 + 8 ], %o0 40005108: 92 12 61 b8 or %o1, 0x1b8, %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 8b sethi %hi(0x40022c00), %o1 40005128: 92 12 61 d0 or %o1, 0x1d0, %o1 ! 40022dd0 <__FUNCTION__.6193+0x278> 4000512c: 40 00 37 07 call 40012d48 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 8b sethi %hi(0x40022c00), %o1 40005148: 40 00 37 00 call 40012d48 4000514c: 92 12 61 e0 or %o1, 0x1e0, %o1 ! 40022de0 <__FUNCTION__.6193+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 8b sethi %hi(0x40022c00), %o0 40005158: c2 07 00 00 ld [ %i4 ], %g1 4000515c: 10 80 00 04 b 4000516c 40005160: 90 12 21 f0 or %o0, 0x1f0, %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 37 47 call 40012e88 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 36 f2 call 40012d48 <== 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 3e 25 call 40014a24 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 =============================================================================== 4000ae00 : rtems_filesystem_eval_path_context_t *ctx, void *arg, const char *token, size_t tokenlen ) { 4000ae00: 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; 4000ae04: f8 06 20 20 ld [ %i0 + 0x20 ], %i4 bool access_ok = rtems_filesystem_eval_path_check_access( 4000ae08: 90 10 00 18 mov %i0, %o0 4000ae0c: d4 07 20 30 ld [ %i4 + 0x30 ], %o2 4000ae10: d6 17 20 3c lduh [ %i4 + 0x3c ], %o3 4000ae14: d8 17 20 3e lduh [ %i4 + 0x3e ], %o4 4000ae18: 40 00 02 f3 call 4000b9e4 4000ae1c: 92 10 20 01 mov 1, %o1 dir->st_mode, dir->st_uid, dir->st_gid ); if ( access_ok ) { 4000ae20: 80 8a 20 ff btst 0xff, %o0 4000ae24: 12 80 00 04 bne 4000ae34 4000ae28: 80 a6 e0 01 cmp %i3, 1 void *arg, const char *token, size_t tokenlen ) { rtems_filesystem_eval_path_generic_status status = 4000ae2c: 81 c7 e0 08 ret 4000ae30: 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] == '.'; 4000ae34: 12 80 00 06 bne 4000ae4c 4000ae38: 82 10 20 00 clr %g1 4000ae3c: c2 4e 80 00 ldsb [ %i2 ], %g1 4000ae40: 82 18 60 2e xor %g1, 0x2e, %g1 4000ae44: 80 a0 00 01 cmp %g0, %g1 4000ae48: 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 ) ) { 4000ae4c: 80 a0 60 00 cmp %g1, 0 4000ae50: 12 80 00 2b bne 4000aefc 4000ae54: 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] == '.'; 4000ae58: 12 80 00 0b bne 4000ae84 4000ae5c: 80 a0 60 00 cmp %g1, 0 4000ae60: c4 4e 80 00 ldsb [ %i2 ], %g2 4000ae64: 80 a0 a0 2e cmp %g2, 0x2e 4000ae68: 12 80 00 07 bne 4000ae84 4000ae6c: 80 a0 60 00 cmp %g1, 0 4000ae70: c2 4e a0 01 ldsb [ %i2 + 1 ], %g1 4000ae74: 82 18 60 2e xor %g1, 0x2e, %g1 4000ae78: 80 a0 00 01 cmp %g0, %g1 4000ae7c: 82 60 3f ff subx %g0, -1, %g1 return dir; } else { if ( rtems_filesystem_is_parent_directory( token, tokenlen ) ) { 4000ae80: 80 a0 60 00 cmp %g1, 0 4000ae84: 22 80 00 04 be,a 4000ae94 4000ae88: fa 07 20 50 ld [ %i4 + 0x50 ], %i5 return dir->Parent; 4000ae8c: 10 80 00 17 b 4000aee8 4000ae90: 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 ); 4000ae94: 10 80 00 10 b 4000aed4 4000ae98: 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 4000ae9c: 92 10 00 1a mov %i2, %o1 4000aea0: 40 00 14 ac call 40010150 4000aea4: 94 10 00 1b mov %i3, %o2 && entry->name [tokenlen] == '\0'; 4000aea8: 80 a2 20 00 cmp %o0, 0 4000aeac: 12 80 00 06 bne 4000aec4 4000aeb0: 82 10 20 00 clr %g1 4000aeb4: 82 07 40 1b add %i5, %i3, %g1 4000aeb8: c2 48 60 0c ldsb [ %g1 + 0xc ], %g1 4000aebc: 80 a0 00 01 cmp %g0, %g1 4000aec0: 82 60 3f ff subx %g0, -1, %g1 if ( match ) { 4000aec4: 80 a0 60 00 cmp %g1, 0 4000aec8: 12 80 00 09 bne 4000aeec 4000aecc: 80 a7 60 00 cmp %i5, 0 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Next( Chain_Node *the_node ) { return the_node->next; 4000aed0: 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 ) { 4000aed4: 80 a7 40 19 cmp %i5, %i1 4000aed8: 12 bf ff f1 bne 4000ae9c 4000aedc: 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; 4000aee0: 81 c7 e0 08 ret 4000aee4: 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 ) { 4000aee8: 80 a7 60 00 cmp %i5, 0 4000aeec: 32 80 00 06 bne,a 4000af04 4000aef0: 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; 4000aef4: 81 c7 e0 08 ret 4000aef8: 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 ) ) { 4000aefc: 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 ); 4000af00: 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; 4000af04: c6 06 20 10 ld [ %i0 + 0x10 ], %g3 4000af08: 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; 4000af0c: c2 07 60 4c ld [ %i5 + 0x4c ], %g1 4000af10: 84 60 3f ff subx %g0, -1, %g2 4000af14: 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; 4000af18: 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)) { 4000af1c: 80 a0 60 02 cmp %g1, 2 4000af20: 12 80 00 0a bne 4000af48 4000af24: 88 10 00 02 mov %g2, %g4 4000af28: 80 a0 a0 00 cmp %g2, 0 4000af2c: 22 80 00 2b be,a 4000afd8 4000af30: fa 07 60 50 ld [ %i5 + 0x50 ], %i5 4000af34: 80 88 e0 08 btst 8, %g3 4000af38: 22 80 00 29 be,a 4000afdc 4000af3c: c2 17 20 34 lduh [ %i4 + 0x34 ], %g1 entry = entry->info.hard_link.link_node; 4000af40: 10 80 00 26 b 4000afd8 4000af44: fa 07 60 50 ld [ %i5 + 0x50 ], %i5 } if ( type == IMFS_SYM_LINK && (follow_sym_link || !terminal)) { 4000af48: 80 a0 60 03 cmp %g1, 3 4000af4c: 12 80 00 10 bne 4000af8c 4000af50: 80 a0 60 00 cmp %g1, 0 4000af54: 80 a0 a0 00 cmp %g2, 0 4000af58: 02 80 00 04 be 4000af68 4000af5c: 80 88 e0 10 btst 0x10, %g3 4000af60: 22 80 00 1f be,a 4000afdc 4000af64: c2 17 20 34 lduh [ %i4 + 0x34 ], %g1 const char *target = entry->info.sym_link.name; 4000af68: fa 07 60 50 ld [ %i5 + 0x50 ], %i5 rtems_filesystem_eval_path_recursive( ctx, target, strlen( target ) ); 4000af6c: 40 00 14 47 call 40010088 4000af70: 90 10 00 1d mov %i5, %o0 4000af74: 92 10 00 1d mov %i5, %o1 4000af78: 94 10 00 08 mov %o0, %o2 4000af7c: 7f ff e4 d7 call 400042d8 4000af80: 90 10 00 18 mov %i0, %o0 void *arg, const char *token, size_t tokenlen ) { rtems_filesystem_eval_path_generic_status status = 4000af84: 81 c7 e0 08 ret 4000af88: 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 ) { 4000af8c: 32 80 00 14 bne,a 4000afdc 4000af90: c2 17 20 34 lduh [ %i4 + 0x34 ], %g1 if ( node->info.directory.mt_fs != NULL ) { 4000af94: d2 07 60 5c ld [ %i5 + 0x5c ], %o1 4000af98: 80 a2 60 00 cmp %o1, 0 4000af9c: 02 80 00 0f be 4000afd8 4000afa0: 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( 4000afa4: d4 07 60 30 ld [ %i5 + 0x30 ], %o2 4000afa8: d6 17 60 3c lduh [ %i5 + 0x3c ], %o3 4000afac: 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; 4000afb0: 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( 4000afb4: 40 00 02 8c call 4000b9e4 4000afb8: 92 10 20 01 mov 1, %o1 RTEMS_FS_PERMS_EXEC, entry->st_mode, entry->st_uid, entry->st_gid ); if ( access_ok ) { 4000afbc: 80 8a 20 ff btst 0xff, %o0 4000afc0: 02 80 00 04 be 4000afd0 <== NEVER TAKEN 4000afc4: 90 10 00 18 mov %i0, %o0 rtems_filesystem_eval_path_restart( ctx, fs_root_ptr ); 4000afc8: 7f ff e4 ab call 40004274 4000afcc: 92 10 00 1c mov %i4, %o1 void *arg, const char *token, size_t tokenlen ) { rtems_filesystem_eval_path_generic_status status = 4000afd0: 81 c7 e0 08 ret 4000afd4: 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; 4000afd8: c2 17 20 34 lduh [ %i4 + 0x34 ], %g1 4000afdc: 82 00 7f ff add %g1, -1, %g1 4000afe0: c2 37 20 34 sth %g1, [ %i4 + 0x34 ] ++entry->reference_count; 4000afe4: c2 17 60 34 lduh [ %i5 + 0x34 ], %g1 4000afe8: 82 00 60 01 inc %g1 4000afec: 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; 4000aff0: c2 07 60 4c ld [ %i5 + 0x4c ], %g1 currentloc->node_access = entry; 4000aff4: fa 26 20 20 st %i5, [ %i0 + 0x20 ] 4000aff8: c2 00 60 04 ld [ %g1 + 4 ], %g1 4000affc: c2 26 20 28 st %g1, [ %i0 + 0x28 ] void *arg, const char *token, size_t tokenlen ) { rtems_filesystem_eval_path_generic_status status = 4000b000: b0 09 20 ff and %g4, 0xff, %i0 status = RTEMS_FILESYSTEM_EVAL_PATH_GENERIC_NO_ENTRY; } } return status; } 4000b004: 81 c7 e0 08 ret 4000b008: 81 e8 00 00 restore =============================================================================== 4000b024 : int IMFS_fchmod( const rtems_filesystem_location_info_t *loc, mode_t mode ) { 4000b024: 9d e3 bf 98 save %sp, -104, %sp /* * Verify I am the owner of the node or the super user. */ #if defined(RTEMS_POSIX_API) st_uid = geteuid(); 4000b028: 40 00 01 58 call 4000b588 4000b02c: fa 06 20 08 ld [ %i0 + 8 ], %i5 if ( ( st_uid != jnode->st_uid ) && ( st_uid != 0 ) ) 4000b030: c2 17 60 3c lduh [ %i5 + 0x3c ], %g1 4000b034: 91 2a 20 10 sll %o0, 0x10, %o0 4000b038: 91 32 20 10 srl %o0, 0x10, %o0 4000b03c: 80 a2 00 01 cmp %o0, %g1 4000b040: 02 80 00 0a be 4000b068 4000b044: 80 a2 20 00 cmp %o0, 0 4000b048: 22 80 00 09 be,a 4000b06c <== NEVER TAKEN 4000b04c: c2 07 60 30 ld [ %i5 + 0x30 ], %g1 <== NOT EXECUTED rtems_set_errno_and_return_minus_one( EPERM ); 4000b050: 40 00 0e 87 call 4000ea6c <__errno> 4000b054: b0 10 3f ff mov -1, %i0 4000b058: 82 10 20 01 mov 1, %g1 4000b05c: c2 22 00 00 st %g1, [ %o0 ] 4000b060: 81 c7 e0 08 ret 4000b064: 81 e8 00 00 restore /* * Change only the RWX permissions on the jnode to mode. */ jnode->st_mode &= ~(S_IRWXU | S_IRWXG | S_IRWXO | S_ISUID | S_ISGID | S_ISVTX); 4000b068: c2 07 60 30 ld [ %i5 + 0x30 ], %g1 jnode->st_mode |= mode & (S_IRWXU | S_IRWXG | S_IRWXO | S_ISUID | S_ISGID | S_ISVTX); IMFS_update_ctime( jnode ); 4000b06c: 90 07 bf f8 add %fp, -8, %o0 /* * Change only the RWX permissions on the jnode to mode. */ jnode->st_mode &= ~(S_IRWXU | S_IRWXG | S_IRWXO | S_ISUID | S_ISGID | S_ISVTX); 4000b070: 82 08 70 00 and %g1, -4096, %g1 jnode->st_mode |= mode & (S_IRWXU | S_IRWXG | S_IRWXO | S_ISUID | S_ISGID | S_ISVTX); IMFS_update_ctime( jnode ); 4000b074: 92 10 20 00 clr %o1 /* * Change only the RWX permissions on the jnode to mode. */ jnode->st_mode &= ~(S_IRWXU | S_IRWXG | S_IRWXO | S_ISUID | S_ISGID | S_ISVTX); jnode->st_mode |= mode & (S_IRWXU | S_IRWXG | S_IRWXO | S_ISUID | S_ISGID | S_ISVTX); 4000b078: b2 0e 6f ff and %i1, 0xfff, %i1 4000b07c: b2 16 40 01 or %i1, %g1, %i1 IMFS_update_ctime( jnode ); 4000b080: 7f ff df fd call 40003074 4000b084: f2 27 60 30 st %i1, [ %i5 + 0x30 ] 4000b088: c2 07 bf f8 ld [ %fp + -8 ], %g1 4000b08c: c2 27 60 48 st %g1, [ %i5 + 0x48 ] return 0; } 4000b090: 81 c7 e0 08 ret 4000b094: 91 e8 20 00 restore %g0, 0, %o0 =============================================================================== 4000325c : static ssize_t IMFS_fifo_write( rtems_libio_t *iop, const void *buffer, size_t count ) { 4000325c: 9d e3 bf 98 save %sp, -104, %sp IMFS_jnode_t *jnode = iop->pathinfo.node_access; 40003260: fa 06 20 1c ld [ %i0 + 0x1c ], %i5 int err = pipe_write(JNODE2PIPE(jnode), buffer, count, iop); 40003264: 96 10 00 18 mov %i0, %o3 40003268: d0 07 60 50 ld [ %i5 + 0x50 ], %o0 4000326c: 92 10 00 19 mov %i1, %o1 40003270: 40 00 28 ed call 4000d624 40003274: 94 10 00 1a mov %i2, %o2 if (err > 0) { 40003278: b0 92 20 00 orcc %o0, 0, %i0 4000327c: 04 80 00 09 ble 400032a0 40003280: 90 07 bf f8 add %fp, -8, %o0 IMFS_mtime_ctime_update(jnode); 40003284: 40 00 03 86 call 4000409c 40003288: 92 10 20 00 clr %o1 4000328c: c2 07 bf f8 ld [ %fp + -8 ], %g1 40003290: c2 27 60 44 st %g1, [ %i5 + 0x44 ] 40003294: c2 27 60 48 st %g1, [ %i5 + 0x48 ] 40003298: 81 c7 e0 08 ret 4000329c: 81 e8 00 00 restore } IMFS_FIFO_RETURN(err); 400032a0: 80 a6 20 00 cmp %i0, 0 400032a4: 02 80 00 06 be 400032bc <== NEVER TAKEN 400032a8: 01 00 00 00 nop 400032ac: 40 00 34 f3 call 40010678 <__errno> 400032b0: b0 20 00 18 neg %i0 400032b4: f0 22 00 00 st %i0, [ %o0 ] 400032b8: b0 10 3f ff mov -1, %i0 } 400032bc: 81 c7 e0 08 ret 400032c0: 81 e8 00 00 restore =============================================================================== 4000b098 : ((IMFS_jnode_t *)( rtems_chain_head( jnode_get_control( jnode ) )->next)) void IMFS_fsunmount( rtems_filesystem_mount_table_entry_t *temp_mt_entry ) { 4000b098: 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; 4000b09c: f6 06 20 24 ld [ %i0 + 0x24 ], %i3 4000b0a0: b8 07 bf e8 add %fp, -24, %i4 4000b0a4: 92 10 00 1b mov %i3, %o1 4000b0a8: 90 10 00 1c mov %i4, %o0 4000b0ac: 40 00 10 c1 call 4000f3b0 4000b0b0: 94 10 20 18 mov 0x18, %o2 jnode = (IMFS_jnode_t *)loc.node_access; 4000b0b4: 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; 4000b0b8: c0 26 e0 08 clr [ %i3 + 8 ] 4000b0bc: b6 10 00 1c mov %i4, %i3 4000b0c0: c2 07 60 4c ld [ %i5 + 0x4c ], %g1 do { next = jnode->Parent; 4000b0c4: f8 07 60 08 ld [ %i5 + 8 ], %i4 4000b0c8: 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 ) ) { 4000b0cc: 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; 4000b0d0: fa 27 bf f0 st %i5, [ %fp + -16 ] IMFS_Set_handlers( &loc ); if ( !IMFS_is_directory( jnode ) || jnode_has_no_children( jnode ) ) { 4000b0d4: 80 a0 60 00 cmp %g1, 0 4000b0d8: 12 80 00 07 bne 4000b0f4 4000b0dc: c4 27 bf f8 st %g2, [ %fp + -8 ] 4000b0e0: 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 ); 4000b0e4: 82 07 60 54 add %i5, 0x54, %g1 4000b0e8: 80 a0 80 01 cmp %g2, %g1 4000b0ec: 32 80 00 10 bne,a 4000b12c 4000b0f0: c2 07 60 4c ld [ %i5 + 0x4c ], %g1 result = IMFS_rmnod( NULL, &loc ); 4000b0f4: 90 10 20 00 clr %o0 4000b0f8: 7f ff de 55 call 40002a4c 4000b0fc: 92 10 00 1b mov %i3, %o1 if ( result != 0 ) 4000b100: 80 a2 20 00 cmp %o0, 0 4000b104: 02 80 00 04 be 4000b114 <== ALWAYS TAKEN 4000b108: 11 37 ab 6f sethi %hi(0xdeadbc00), %o0 rtems_fatal_error_occurred( 0xdeadbeef ); 4000b10c: 7f ff f1 76 call 400076e4 <== NOT EXECUTED 4000b110: 90 12 22 ef or %o0, 0x2ef, %o0 ! deadbeef <== NOT EXECUTED IMFS_node_destroy( jnode ); 4000b114: 7f ff dd 7c call 40002704 4000b118: 90 10 00 1d mov %i5, %o0 jnode = next; } if ( jnode != NULL ) { 4000b11c: 80 a7 20 00 cmp %i4, 0 4000b120: 02 80 00 0e be 4000b158 4000b124: 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; 4000b128: c2 07 60 4c ld [ %i5 + 0x4c ], %g1 if ( IMFS_is_directory( jnode ) ) { 4000b12c: c2 00 40 00 ld [ %g1 ], %g1 4000b130: 80 a0 60 00 cmp %g1, 0 4000b134: 32 bf ff e4 bne,a 4000b0c4 <== NEVER TAKEN 4000b138: 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; 4000b13c: 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 ); 4000b140: 84 07 60 54 add %i5, 0x54, %g2 if ( jnode_has_children( jnode ) ) 4000b144: 80 a0 40 02 cmp %g1, %g2 4000b148: 02 bf ff de be 4000b0c0 4000b14c: 80 a0 60 00 cmp %g1, 0 jnode = jnode_get_first_child( jnode ); } } } while (jnode != NULL); 4000b150: 12 bf ff dc bne 4000b0c0 <== ALWAYS TAKEN 4000b154: ba 10 00 01 mov %g1, %i5 4000b158: 81 c7 e0 08 ret 4000b15c: 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 77 sethi %hi(0x4001dc00), %g1 IMFS_jnode_t *root_node; fs_info->instance = imfs_instance++; 40002614: c4 00 61 e4 ld [ %g1 + 0x1e4 ], %g2 ! 4001dde4 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 61 e4 st %g2, [ %g1 + 0x1e4 ] memcpy( 4000262c: 40 00 33 61 call 4000f3b0 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 6e sethi %hi(0x4001b800), %o2 40002640: 96 10 20 00 clr %o3 40002644: 94 12 a3 30 or %o2, 0x330, %o2 40002648: 19 00 00 10 sethi %hi(0x4000), %o4 4000264c: 9a 10 20 00 clr %o5 40002650: 40 00 21 9d call 4000acc4 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 71 sethi %hi(0x4001c400), %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 60 fc or %g1, 0xfc, %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 75 sethi %hi(0x4001d400), %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 e0 ld [ %g1 + 0x2e0 ], %g1 } else { errno = ENOMEM; rv = -1; } } else { errno = ENOMEM; 4000269c: 40 00 30 f4 call 4000ea6c <__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 77 sethi %hi(0x4001dc00), %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 77 sethi %hi(0x4001dc00), %g2 400026dc: c2 20 a1 e0 st %g1, [ %g2 + 0x1e0 ] ! 4001dde0 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 67 sethi %hi(0x40019c00), %g1 400042cc: c2 00 61 f8 ld [ %g1 + 0x1f8 ], %g1 ! 40019df8 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 4c call 4000f484 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 3c 0c call 400133e4 <__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 =============================================================================== 4000d5fc : */ MEMFILE_STATIC int IMFS_memfile_addblock( IMFS_jnode_t *the_jnode, unsigned int block ) { 4000d5fc: 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 ); 4000d600: 94 10 20 01 mov 1, %o2 4000d604: 90 10 00 18 mov %i0, %o0 4000d608: 7f ff fe d7 call 4000d164 4000d60c: 92 10 00 19 mov %i1, %o1 if ( *block_entry_ptr ) 4000d610: 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 ); 4000d614: ba 10 00 08 mov %o0, %i5 if ( *block_entry_ptr ) 4000d618: 80 a0 60 00 cmp %g1, 0 4000d61c: 12 80 00 08 bne 4000d63c 4000d620: b0 10 20 00 clr %i0 return 0; /* * There is no memory for this block number so allocate it. */ memory = memfile_alloc_block(); 4000d624: 7f ff fe c3 call 4000d130 4000d628: 01 00 00 00 nop if ( !memory ) 4000d62c: 80 a2 20 00 cmp %o0, 0 4000d630: 22 80 00 03 be,a 4000d63c <== NEVER TAKEN 4000d634: b0 10 20 01 mov 1, %i0 <== NOT EXECUTED return 1; *block_entry_ptr = memory; 4000d638: d0 27 40 00 st %o0, [ %i5 ] return 0; 4000d63c: 81 c7 e0 08 ret 4000d640: 81 e8 00 00 restore =============================================================================== 4000d810 : MEMFILE_STATIC int IMFS_memfile_extend( IMFS_jnode_t *the_jnode, bool zero_fill, off_t new_length ) { 4000d810: 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 ) 4000d814: 03 10 00 77 sethi %hi(0x4001dc00), %g1 4000d818: fa 00 61 e0 ld [ %g1 + 0x1e0 ], %i5 ! 4001dde0 4000d81c: b9 37 60 02 srl %i5, 2, %i4 4000d820: 92 10 00 1c mov %i4, %o1 4000d824: 40 00 28 c7 call 40017b40 <.umul> 4000d828: 90 07 20 01 add %i4, 1, %o0 4000d82c: 92 10 00 1c mov %i4, %o1 4000d830: 40 00 28 c4 call 40017b40 <.umul> 4000d834: 90 02 20 01 inc %o0 4000d838: 92 10 00 1d mov %i5, %o1 4000d83c: 40 00 28 c1 call 40017b40 <.umul> 4000d840: 90 02 3f ff add %o0, -1, %o0 4000d844: 82 10 20 00 clr %g1 4000d848: 80 a0 40 1a cmp %g1, %i2 4000d84c: 34 80 00 0b bg,a 4000d878 <== NEVER TAKEN 4000d850: f8 06 20 50 ld [ %i0 + 0x50 ], %i4 <== NOT EXECUTED 4000d854: 80 a0 40 1a cmp %g1, %i2 4000d858: 12 80 00 04 bne 4000d868 <== NEVER TAKEN 4000d85c: 80 a2 00 1b cmp %o0, %i3 4000d860: 38 80 00 06 bgu,a 4000d878 4000d864: f8 06 20 50 ld [ %i0 + 0x50 ], %i4 rtems_set_errno_and_return_minus_one( EFBIG ); 4000d868: 40 00 04 81 call 4000ea6c <__errno> 4000d86c: 01 00 00 00 nop 4000d870: 10 80 00 3c b 4000d960 4000d874: 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 ) 4000d878: 80 a6 80 1c cmp %i2, %i4 4000d87c: 14 80 00 07 bg 4000d898 <== NEVER TAKEN 4000d880: e0 06 20 54 ld [ %i0 + 0x54 ], %l0 4000d884: 80 a6 80 1c cmp %i2, %i4 4000d888: 12 80 00 48 bne 4000d9a8 <== NEVER TAKEN 4000d88c: 80 a6 c0 10 cmp %i3, %l0 4000d890: 08 80 00 46 bleu 4000d9a8 <== NEVER TAKEN 4000d894: 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; 4000d898: a3 3f 60 1f sra %i5, 0x1f, %l1 4000d89c: 96 10 00 1d mov %i5, %o3 4000d8a0: 94 10 00 11 mov %l1, %o2 4000d8a4: 90 10 00 1a mov %i2, %o0 4000d8a8: 40 00 2a 38 call 40018188 <__divdi3> 4000d8ac: 92 10 00 1b mov %i3, %o1 old_blocks = the_jnode->info.file.size / IMFS_MEMFILE_BYTES_PER_BLOCK; 4000d8b0: 94 10 00 11 mov %l1, %o2 4000d8b4: 90 10 00 1c mov %i4, %o0 4000d8b8: 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; 4000d8bc: a4 10 00 09 mov %o1, %l2 old_blocks = the_jnode->info.file.size / IMFS_MEMFILE_BYTES_PER_BLOCK; 4000d8c0: 40 00 2a 32 call 40018188 <__divdi3> 4000d8c4: 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++ ) { 4000d8c8: 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; 4000d8cc: 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; 4000d8d0: 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; 4000d8d4: 27 10 00 77 sethi %hi(0x4001dc00), %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; 4000d8d8: 40 00 28 9a call 40017b40 <.umul> 4000d8dc: 92 10 00 1d mov %i5, %o1 /* * Now allocate each of those blocks. */ for ( block=old_blocks ; block<=new_blocks ; block++ ) { 4000d8e0: 10 80 00 23 b 4000d96c 4000d8e4: a0 24 00 08 sub %l0, %o0, %l0 if ( !IMFS_memfile_addblock( the_jnode, block ) ) { 4000d8e8: 7f ff ff 45 call 4000d5fc 4000d8ec: 92 10 00 1d mov %i5, %o1 4000d8f0: 80 a2 20 00 cmp %o0, 0 4000d8f4: 12 80 00 15 bne 4000d948 <== NEVER TAKEN 4000d8f8: 80 a6 60 00 cmp %i1, 0 if ( zero_fill ) { 4000d8fc: 22 80 00 1c be,a 4000d96c 4000d900: a2 04 60 01 inc %l1 size_t count = IMFS_MEMFILE_BYTES_PER_BLOCK - offset; 4000d904: e8 04 e1 e0 ld [ %l3 + 0x1e0 ], %l4 block_p *block_ptr = 4000d908: 92 10 00 1d mov %i5, %o1 4000d90c: 94 10 20 00 clr %o2 4000d910: 7f ff fe 15 call 4000d164 4000d914: 90 10 00 18 mov %i0, %o0 IMFS_memfile_get_block_pointer( the_jnode, block, 0 ); memset( &(*block_ptr) [offset], 0, count); 4000d918: 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; 4000d91c: 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); 4000d920: 90 02 00 10 add %o0, %l0, %o0 4000d924: 92 10 20 00 clr %o1 4000d928: 94 10 00 14 mov %l4, %o2 4000d92c: 40 00 06 de call 4000f4a4 4000d930: a0 10 20 00 clr %l0 4000d934: 10 80 00 0e b 4000d96c 4000d938: a2 04 60 01 inc %l1 offset = 0; } } else { for ( ; block>=old_blocks ; block-- ) { IMFS_memfile_remove_block( the_jnode, block ); 4000d93c: 90 10 00 18 mov %i0, %o0 <== NOT EXECUTED 4000d940: 7f ff ff a8 call 4000d7e0 <== NOT EXECUTED 4000d944: ba 07 7f ff add %i5, -1, %i5 <== NOT EXECUTED memset( &(*block_ptr) [offset], 0, count); offset = 0; } } else { for ( ; block>=old_blocks ; block-- ) { 4000d948: 80 a7 40 1c cmp %i5, %i4 <== NOT EXECUTED 4000d94c: 1a bf ff fc bcc 4000d93c <== NOT EXECUTED 4000d950: 92 10 00 1d mov %i5, %o1 <== NOT EXECUTED IMFS_memfile_remove_block( the_jnode, block ); } rtems_set_errno_and_return_minus_one( ENOSPC ); 4000d954: 40 00 04 46 call 4000ea6c <__errno> <== NOT EXECUTED 4000d958: 01 00 00 00 nop <== NOT EXECUTED 4000d95c: 82 10 20 1c mov 0x1c, %g1 ! 1c <== NOT EXECUTED 4000d960: c2 22 00 00 st %g1, [ %o0 ] 4000d964: 81 c7 e0 08 ret 4000d968: 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( 4000d96c: 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++ ) { 4000d970: 80 a7 40 12 cmp %i5, %l2 4000d974: 08 bf ff dd bleu 4000d8e8 4000d978: 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); 4000d97c: 92 10 20 00 clr %o1 } /* * Set the new length of the file. */ the_jnode->info.file.size = new_length; 4000d980: f4 3e 20 50 std %i2, [ %i0 + 0x50 ] IMFS_update_ctime(the_jnode); 4000d984: 7f ff d5 bc call 40003074 4000d988: 90 07 bf f8 add %fp, -8, %o0 4000d98c: c2 07 bf f8 ld [ %fp + -8 ], %g1 IMFS_update_mtime(the_jnode); 4000d990: 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); 4000d994: c2 26 20 48 st %g1, [ %i0 + 0x48 ] IMFS_update_mtime(the_jnode); 4000d998: 7f ff d5 b7 call 40003074 4000d99c: 92 10 20 00 clr %o1 4000d9a0: c2 07 bf f8 ld [ %fp + -8 ], %g1 4000d9a4: c2 26 20 44 st %g1, [ %i0 + 0x44 ] return 0; } 4000d9a8: 81 c7 e0 08 ret 4000d9ac: 91 e8 20 00 restore %g0, 0, %o0 =============================================================================== 4000d164 : #endif IMFS_jnode_t *the_jnode, unsigned int block, int malloc_it ) { 4000d164: 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 ) { 4000d168: 03 10 00 77 sethi %hi(0x4001dc00), %g1 4000d16c: fa 00 61 e0 ld [ %g1 + 0x1e0 ], %i5 ! 4001dde0 4000d170: bb 37 60 02 srl %i5, 2, %i5 4000d174: 82 07 7f ff add %i5, -1, %g1 4000d178: 80 a6 40 01 cmp %i1, %g1 4000d17c: 18 80 00 18 bgu 4000d1dc 4000d180: 90 07 60 01 add %i5, 1, %o0 p = info->indirect; if ( malloc_it ) { 4000d184: 80 a6 a0 00 cmp %i2, 0 4000d188: 02 80 00 10 be 4000d1c8 4000d18c: c2 06 20 58 ld [ %i0 + 0x58 ], %g1 if ( !p ) { 4000d190: 80 a0 60 00 cmp %g1, 0 4000d194: 32 80 00 0a bne,a 4000d1bc 4000d198: f0 06 20 58 ld [ %i0 + 0x58 ], %i0 p = memfile_alloc_block(); 4000d19c: 7f ff ff e5 call 4000d130 4000d1a0: 01 00 00 00 nop if ( !p ) 4000d1a4: 80 a2 20 00 cmp %o0, 0 4000d1a8: 32 80 00 04 bne,a 4000d1b8 <== ALWAYS TAKEN 4000d1ac: d0 26 20 58 st %o0, [ %i0 + 0x58 ] return 0; 4000d1b0: 81 c7 e0 08 ret <== NOT EXECUTED 4000d1b4: 91 e8 20 00 restore %g0, 0, %o0 <== NOT EXECUTED info->indirect = p; } return &info->indirect[ my_block ]; 4000d1b8: f0 06 20 58 ld [ %i0 + 0x58 ], %i0 4000d1bc: b3 2e 60 02 sll %i1, 2, %i1 4000d1c0: 81 c7 e0 08 ret 4000d1c4: 91 ee 00 19 restore %i0, %i1, %o0 } if ( !p ) 4000d1c8: 80 a0 60 00 cmp %g1, 0 4000d1cc: 02 bf ff f9 be 4000d1b0 <== NEVER TAKEN 4000d1d0: b3 2e 60 02 sll %i1, 2, %i1 return 0; return &info->indirect[ my_block ]; 4000d1d4: 81 c7 e0 08 ret 4000d1d8: 91 e8 40 19 restore %g1, %i1, %o0 /* * Is the block number in the doubly indirect portion? */ if ( my_block <= LAST_DOUBLY_INDIRECT ) { 4000d1dc: 40 00 2a 59 call 40017b40 <.umul> 4000d1e0: 92 10 00 1d mov %i5, %o1 4000d1e4: 82 02 3f ff add %o0, -1, %g1 4000d1e8: 80 a6 40 01 cmp %i1, %g1 4000d1ec: 18 80 00 2c bgu 4000d29c 4000d1f0: b8 10 00 08 mov %o0, %i4 my_block -= FIRST_DOUBLY_INDIRECT; 4000d1f4: b2 26 40 1d sub %i1, %i5, %i1 singly = my_block % IMFS_MEMFILE_BLOCK_SLOTS; 4000d1f8: 92 10 00 1d mov %i5, %o1 4000d1fc: 40 00 2b 37 call 40017ed8 <.urem> 4000d200: 90 10 00 19 mov %i1, %o0 doubly = my_block / IMFS_MEMFILE_BLOCK_SLOTS; 4000d204: 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; 4000d208: b8 10 00 08 mov %o0, %i4 doubly = my_block / IMFS_MEMFILE_BLOCK_SLOTS; 4000d20c: 40 00 2a 87 call 40017c28 <.udiv> 4000d210: 90 10 00 19 mov %i1, %o0 p = info->doubly_indirect; if ( malloc_it ) { 4000d214: 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; 4000d218: ba 10 00 08 mov %o0, %i5 p = info->doubly_indirect; if ( malloc_it ) { 4000d21c: 02 80 00 17 be 4000d278 4000d220: d0 06 20 5c ld [ %i0 + 0x5c ], %o0 if ( !p ) { 4000d224: 80 a2 20 00 cmp %o0, 0 4000d228: 12 80 00 08 bne 4000d248 4000d22c: bb 2f 60 02 sll %i5, 2, %i5 p = memfile_alloc_block(); 4000d230: 7f ff ff c0 call 4000d130 4000d234: 01 00 00 00 nop if ( !p ) 4000d238: 80 a2 20 00 cmp %o0, 0 4000d23c: 02 bf ff dd be 4000d1b0 <== NEVER TAKEN 4000d240: 01 00 00 00 nop return 0; info->doubly_indirect = p; 4000d244: d0 26 20 5c st %o0, [ %i0 + 0x5c ] } p1 = (block_p *)p[ doubly ]; 4000d248: b6 02 00 1d add %o0, %i5, %i3 4000d24c: d0 02 00 1d ld [ %o0 + %i5 ], %o0 if ( !p1 ) { 4000d250: 80 a2 20 00 cmp %o0, 0 4000d254: 12 80 00 4a bne 4000d37c 4000d258: b1 2f 20 02 sll %i4, 2, %i0 p1 = memfile_alloc_block(); 4000d25c: 7f ff ff b5 call 4000d130 4000d260: 01 00 00 00 nop if ( !p1 ) 4000d264: 80 a2 20 00 cmp %o0, 0 4000d268: 02 bf ff d2 be 4000d1b0 <== NEVER TAKEN 4000d26c: 01 00 00 00 nop return 0; p[ doubly ] = (block_p) p1; 4000d270: 10 80 00 43 b 4000d37c 4000d274: d0 26 c0 00 st %o0, [ %i3 ] } return (block_p *)&p1[ singly ]; } if ( !p ) 4000d278: 80 a2 20 00 cmp %o0, 0 4000d27c: 02 bf ff cd be 4000d1b0 <== NEVER TAKEN 4000d280: bb 2f 60 02 sll %i5, 2, %i5 return 0; p = (block_p *)p[ doubly ]; 4000d284: c2 02 00 1d ld [ %o0 + %i5 ], %g1 if ( !p ) 4000d288: 80 a0 60 00 cmp %g1, 0 4000d28c: 02 bf ff c9 be 4000d1b0 <== NEVER TAKEN 4000d290: 01 00 00 00 nop return 0; return (block_p *)&p[ singly ]; 4000d294: 10 80 00 48 b 4000d3b4 4000d298: b1 2f 20 02 sll %i4, 2, %i0 } /* * Is the block number in the triply indirect portion? */ if ( my_block <= LAST_TRIPLY_INDIRECT ) { 4000d29c: 90 02 20 01 inc %o0 4000d2a0: 40 00 2a 28 call 40017b40 <.umul> 4000d2a4: 92 10 00 1d mov %i5, %o1 4000d2a8: 90 02 3f ff add %o0, -1, %o0 4000d2ac: 80 a6 40 08 cmp %i1, %o0 4000d2b0: 18 bf ff c0 bgu 4000d1b0 <== NEVER TAKEN 4000d2b4: b2 26 40 1c sub %i1, %i4, %i1 my_block -= FIRST_TRIPLY_INDIRECT; singly = my_block % IMFS_MEMFILE_BLOCK_SLOTS; 4000d2b8: 92 10 00 1d mov %i5, %o1 4000d2bc: 40 00 2b 07 call 40017ed8 <.urem> 4000d2c0: 90 10 00 19 mov %i1, %o0 doubly = my_block / IMFS_MEMFILE_BLOCK_SLOTS; 4000d2c4: 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; 4000d2c8: b6 10 00 08 mov %o0, %i3 doubly = my_block / IMFS_MEMFILE_BLOCK_SLOTS; 4000d2cc: 40 00 2a 57 call 40017c28 <.udiv> 4000d2d0: 90 10 00 19 mov %i1, %o0 triply = doubly / IMFS_MEMFILE_BLOCK_SLOTS; 4000d2d4: 92 10 00 1d mov %i5, %o1 4000d2d8: 40 00 2a 54 call 40017c28 <.udiv> 4000d2dc: b2 10 00 08 mov %o0, %i1 doubly %= IMFS_MEMFILE_BLOCK_SLOTS; 4000d2e0: 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; 4000d2e4: b8 10 00 08 mov %o0, %i4 doubly %= IMFS_MEMFILE_BLOCK_SLOTS; 4000d2e8: 40 00 2a fc call 40017ed8 <.urem> 4000d2ec: 90 10 00 19 mov %i1, %o0 p = info->triply_indirect; if ( malloc_it ) { 4000d2f0: 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; 4000d2f4: ba 10 00 08 mov %o0, %i5 p = info->triply_indirect; if ( malloc_it ) { 4000d2f8: 02 80 00 23 be 4000d384 4000d2fc: d0 06 20 60 ld [ %i0 + 0x60 ], %o0 if ( !p ) { 4000d300: 80 a2 20 00 cmp %o0, 0 4000d304: 12 80 00 08 bne 4000d324 4000d308: b9 2f 20 02 sll %i4, 2, %i4 p = memfile_alloc_block(); 4000d30c: 7f ff ff 89 call 4000d130 4000d310: 01 00 00 00 nop if ( !p ) 4000d314: 80 a2 20 00 cmp %o0, 0 4000d318: 02 bf ff a6 be 4000d1b0 <== NEVER TAKEN 4000d31c: 01 00 00 00 nop return 0; info->triply_indirect = p; 4000d320: d0 26 20 60 st %o0, [ %i0 + 0x60 ] } p1 = (block_p *) p[ triply ]; 4000d324: b4 02 00 1c add %o0, %i4, %i2 4000d328: d0 02 00 1c ld [ %o0 + %i4 ], %o0 if ( !p1 ) { 4000d32c: 80 a2 20 00 cmp %o0, 0 4000d330: 12 80 00 08 bne 4000d350 4000d334: bb 2f 60 02 sll %i5, 2, %i5 p1 = memfile_alloc_block(); 4000d338: 7f ff ff 7e call 4000d130 4000d33c: 01 00 00 00 nop if ( !p1 ) 4000d340: 80 a2 20 00 cmp %o0, 0 4000d344: 02 bf ff 9b be 4000d1b0 <== NEVER TAKEN 4000d348: 01 00 00 00 nop return 0; p[ triply ] = (block_p) p1; 4000d34c: d0 26 80 00 st %o0, [ %i2 ] } p2 = (block_p *)p1[ doubly ]; 4000d350: b8 02 00 1d add %o0, %i5, %i4 4000d354: d0 02 00 1d ld [ %o0 + %i5 ], %o0 if ( !p2 ) { 4000d358: 80 a2 20 00 cmp %o0, 0 4000d35c: 12 80 00 08 bne 4000d37c 4000d360: b1 2e e0 02 sll %i3, 2, %i0 p2 = memfile_alloc_block(); 4000d364: 7f ff ff 73 call 4000d130 4000d368: 01 00 00 00 nop if ( !p2 ) 4000d36c: 80 a2 20 00 cmp %o0, 0 4000d370: 02 bf ff 90 be 4000d1b0 <== NEVER TAKEN 4000d374: 01 00 00 00 nop return 0; p1[ doubly ] = (block_p) p2; 4000d378: d0 27 00 00 st %o0, [ %i4 ] } return (block_p *)&p2[ singly ]; 4000d37c: 81 c7 e0 08 ret 4000d380: 91 ea 00 18 restore %o0, %i0, %o0 } if ( !p ) 4000d384: 80 a2 20 00 cmp %o0, 0 4000d388: 02 bf ff 8a be 4000d1b0 <== NEVER TAKEN 4000d38c: b9 2f 20 02 sll %i4, 2, %i4 return 0; p1 = (block_p *) p[ triply ]; 4000d390: c2 02 00 1c ld [ %o0 + %i4 ], %g1 if ( !p1 ) 4000d394: 80 a0 60 00 cmp %g1, 0 4000d398: 02 bf ff 86 be 4000d1b0 <== NEVER TAKEN 4000d39c: bb 2f 60 02 sll %i5, 2, %i5 return 0; p2 = (block_p *)p1[ doubly ]; 4000d3a0: c2 00 40 1d ld [ %g1 + %i5 ], %g1 if ( !p2 ) 4000d3a4: 80 a0 60 00 cmp %g1, 0 4000d3a8: 02 bf ff 82 be 4000d1b0 <== NEVER TAKEN 4000d3ac: 01 00 00 00 nop return 0; return (block_p *)&p2[ singly ]; 4000d3b0: b1 2e e0 02 sll %i3, 2, %i0 /* * This means the requested block number is out of range. */ return 0; } 4000d3b4: 81 c7 e0 08 ret 4000d3b8: 91 e8 40 18 restore %g1, %i0, %o0 =============================================================================== 4000d3bc : IMFS_jnode_t *the_jnode, off_t start, unsigned char *destination, unsigned int length ) { 4000d3bc: 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; 4000d3c0: c2 06 20 4c ld [ %i0 + 0x4c ], %g1 4000d3c4: 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 ) { 4000d3c8: c2 00 40 00 ld [ %g1 ], %g1 IMFS_jnode_t *the_jnode, off_t start, unsigned char *destination, unsigned int length ) { 4000d3cc: a0 10 00 19 mov %i1, %l0 4000d3d0: 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 ) { 4000d3d4: 80 a0 60 05 cmp %g1, 5 4000d3d8: 12 80 00 17 bne 4000d434 4000d3dc: 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)) 4000d3e0: f4 1e 20 50 ldd [ %i0 + 0x50 ], %i2 4000d3e4: 82 10 20 00 clr %g1 4000d3e8: 86 a6 c0 11 subcc %i3, %l1, %g3 4000d3ec: 84 66 80 19 subx %i2, %i1, %g2 4000d3f0: 80 a0 40 02 cmp %g1, %g2 4000d3f4: 14 80 00 07 bg 4000d410 <== NEVER TAKEN 4000d3f8: d2 06 20 58 ld [ %i0 + 0x58 ], %o1 4000d3fc: 80 a0 40 02 cmp %g1, %g2 4000d400: 12 80 00 06 bne 4000d418 <== NEVER TAKEN 4000d404: 80 a7 00 03 cmp %i4, %g3 4000d408: 28 80 00 05 bleu,a 4000d41c <== NEVER TAKEN 4000d40c: b0 10 00 1c mov %i4, %i0 <== NOT EXECUTED my_length = the_jnode->info.linearfile.size - start; 4000d410: 10 80 00 03 b 4000d41c 4000d414: 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; 4000d418: 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); 4000d41c: 90 10 00 12 mov %l2, %o0 4000d420: 92 02 40 11 add %o1, %l1, %o1 4000d424: 40 00 07 e3 call 4000f3b0 4000d428: 94 10 00 18 mov %i0, %o2 return copied; memcpy( dest, &(*block_ptr)[ 0 ], my_length ); copied += my_length; } IMFS_update_atime( the_jnode ); 4000d42c: 10 80 00 5d b 4000d5a0 4000d430: 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 ) 4000d434: c6 06 20 50 ld [ %i0 + 0x50 ], %g3 4000d438: 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; 4000d43c: 82 10 00 1a mov %i2, %g1 if ( last_byte > the_jnode->info.file.size ) 4000d440: c4 06 20 54 ld [ %i0 + 0x54 ], %g2 4000d444: 80 a1 00 03 cmp %g4, %g3 4000d448: 14 80 00 08 bg 4000d468 <== NEVER TAKEN 4000d44c: b6 07 00 1a add %i4, %i2, %i3 4000d450: 80 a1 00 03 cmp %g4, %g3 4000d454: 32 80 00 07 bne,a 4000d470 <== NEVER TAKEN 4000d458: 03 10 00 77 sethi %hi(0x4001dc00), %g1 <== NOT EXECUTED 4000d45c: 80 a6 c0 02 cmp %i3, %g2 4000d460: 28 80 00 04 bleu,a 4000d470 4000d464: 03 10 00 77 sethi %hi(0x4001dc00), %g1 my_length = the_jnode->info.file.size - start; 4000d468: 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; 4000d46c: 03 10 00 77 sethi %hi(0x4001dc00), %g1 4000d470: f6 00 61 e0 ld [ %g1 + 0x1e0 ], %i3 ! 4001dde0 4000d474: 90 10 00 10 mov %l0, %o0 4000d478: b5 3e e0 1f sra %i3, 0x1f, %i2 4000d47c: 96 10 00 1b mov %i3, %o3 4000d480: 94 10 00 1a mov %i2, %o2 4000d484: 40 00 2c 2c call 40018534 <__moddi3> 4000d488: 92 10 00 11 mov %l1, %o1 block = start / IMFS_MEMFILE_BYTES_PER_BLOCK; 4000d48c: 94 10 00 1a mov %i2, %o2 */ /* * Phase 1: possibly the last part of one block */ start_offset = start % IMFS_MEMFILE_BYTES_PER_BLOCK; 4000d490: a6 10 00 09 mov %o1, %l3 block = start / IMFS_MEMFILE_BYTES_PER_BLOCK; 4000d494: 90 10 00 10 mov %l0, %o0 4000d498: 92 10 00 11 mov %l1, %o1 4000d49c: 40 00 2b 3b call 40018188 <__divdi3> 4000d4a0: 96 10 00 1b mov %i3, %o3 if ( start_offset ) { 4000d4a4: 80 a4 e0 00 cmp %l3, 0 4000d4a8: 02 80 00 18 be 4000d508 4000d4ac: b4 10 00 09 mov %o1, %i2 to_copy = IMFS_MEMFILE_BYTES_PER_BLOCK - start_offset; 4000d4b0: b6 26 c0 13 sub %i3, %l3, %i3 4000d4b4: 80 a7 00 1b cmp %i4, %i3 4000d4b8: 08 80 00 03 bleu 4000d4c4 4000d4bc: b2 10 00 1c mov %i4, %i1 4000d4c0: 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 ); 4000d4c4: 90 10 00 1d mov %i5, %o0 4000d4c8: 92 10 00 1a mov %i2, %o1 4000d4cc: 94 10 20 00 clr %o2 4000d4d0: 7f ff ff 25 call 4000d164 4000d4d4: b0 10 20 00 clr %i0 if ( !block_ptr ) 4000d4d8: 80 a2 20 00 cmp %o0, 0 4000d4dc: 02 80 00 35 be 4000d5b0 <== NEVER TAKEN 4000d4e0: 94 10 00 19 mov %i1, %o2 return copied; memcpy( dest, &(*block_ptr)[ start_offset ], to_copy ); 4000d4e4: d2 02 00 00 ld [ %o0 ], %o1 4000d4e8: 90 10 00 12 mov %l2, %o0 4000d4ec: 92 02 40 13 add %o1, %l3, %o1 4000d4f0: 40 00 07 b0 call 4000f3b0 4000d4f4: a4 04 80 19 add %l2, %i1, %l2 dest += to_copy; block++; 4000d4f8: b4 06 a0 01 inc %i2 my_length -= to_copy; 4000d4fc: b8 27 00 19 sub %i4, %i1, %i4 copied += to_copy; 4000d500: 10 80 00 03 b 4000d50c 4000d504: 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; 4000d508: b0 10 20 00 clr %i0 } /* * Phase 2: all of zero of more blocks */ to_copy = IMFS_MEMFILE_BYTES_PER_BLOCK; 4000d50c: 03 10 00 77 sethi %hi(0x4001dc00), %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( 4000d510: a4 24 80 18 sub %l2, %i0, %l2 } /* * Phase 2: all of zero of more blocks */ to_copy = IMFS_MEMFILE_BYTES_PER_BLOCK; 4000d514: f6 00 61 e0 ld [ %g1 + 0x1e0 ], %i3 while ( my_length >= IMFS_MEMFILE_BYTES_PER_BLOCK ) { 4000d518: 10 80 00 0f b 4000d554 4000d51c: a0 10 00 01 mov %g1, %l0 block_ptr = IMFS_memfile_get_block_pointer( the_jnode, block, 0 ); 4000d520: 90 10 00 1d mov %i5, %o0 4000d524: 92 10 00 1a mov %i2, %o1 4000d528: 7f ff ff 0f call 4000d164 4000d52c: 94 10 20 00 clr %o2 if ( !block_ptr ) 4000d530: 82 92 20 00 orcc %o0, 0, %g1 4000d534: 02 80 00 1f be 4000d5b0 <== NEVER TAKEN 4000d538: 90 10 00 19 mov %i1, %o0 return copied; memcpy( dest, &(*block_ptr)[ 0 ], to_copy ); 4000d53c: d2 00 40 00 ld [ %g1 ], %o1 4000d540: 94 10 00 1b mov %i3, %o2 4000d544: 40 00 07 9b call 4000f3b0 4000d548: b4 06 a0 01 inc %i2 dest += to_copy; block++; my_length -= to_copy; 4000d54c: b8 27 00 1b sub %i4, %i3, %i4 copied += to_copy; 4000d550: 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 ) { 4000d554: c2 04 21 e0 ld [ %l0 + 0x1e0 ], %g1 4000d558: 80 a7 00 01 cmp %i4, %g1 4000d55c: 1a bf ff f1 bcc 4000d520 4000d560: 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 ) { 4000d564: 80 a7 20 00 cmp %i4, 0 4000d568: 02 80 00 0e be 4000d5a0 4000d56c: 90 07 bf f8 add %fp, -8, %o0 block_ptr = IMFS_memfile_get_block_pointer( the_jnode, block, 0 ); 4000d570: 90 10 00 1d mov %i5, %o0 4000d574: 92 10 00 1a mov %i2, %o1 4000d578: 7f ff fe fb call 4000d164 4000d57c: 94 10 20 00 clr %o2 if ( !block_ptr ) 4000d580: 82 92 20 00 orcc %o0, 0, %g1 4000d584: 02 80 00 0b be 4000d5b0 <== NEVER TAKEN 4000d588: 90 10 00 19 mov %i1, %o0 return copied; memcpy( dest, &(*block_ptr)[ 0 ], my_length ); 4000d58c: d2 00 40 00 ld [ %g1 ], %o1 4000d590: 94 10 00 1c mov %i4, %o2 4000d594: 40 00 07 87 call 4000f3b0 4000d598: b0 07 00 18 add %i4, %i0, %i0 copied += my_length; } IMFS_update_atime( the_jnode ); 4000d59c: 90 07 bf f8 add %fp, -8, %o0 4000d5a0: 7f ff d6 b5 call 40003074 4000d5a4: 92 10 20 00 clr %o1 4000d5a8: c2 07 bf f8 ld [ %fp + -8 ], %g1 4000d5ac: c2 27 60 40 st %g1, [ %i5 + 0x40 ] return copied; } 4000d5b0: 81 c7 e0 08 ret 4000d5b4: 81 e8 00 00 restore =============================================================================== 4000d6b4 : * is better to stick to simple, easy to understand algorithms. */ IMFS_jnode_t *IMFS_memfile_remove( IMFS_jnode_t *the_jnode ) { 4000d6b4: 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; 4000d6b8: 03 10 00 77 sethi %hi(0x4001dc00), %g1 4000d6bc: fa 00 61 e0 ld [ %g1 + 0x1e0 ], %i5 ! 4001dde0 * + doubly indirect * + triply indirect */ info = &the_jnode->info.file; if ( info->indirect ) { 4000d6c0: c2 06 20 58 ld [ %i0 + 0x58 ], %g1 4000d6c4: 80 a0 60 00 cmp %g1, 0 4000d6c8: 02 80 00 05 be 4000d6dc 4000d6cc: bb 37 60 02 srl %i5, 2, %i5 memfile_free_blocks_in_table( &info->indirect, to_free ); 4000d6d0: 90 06 20 58 add %i0, 0x58, %o0 4000d6d4: 7f ff ff e5 call 4000d668 4000d6d8: 92 10 00 1d mov %i5, %o1 } if ( info->doubly_indirect ) { 4000d6dc: c2 06 20 5c ld [ %i0 + 0x5c ], %g1 4000d6e0: b8 10 20 00 clr %i4 4000d6e4: 80 a0 60 00 cmp %g1, 0 4000d6e8: 12 80 00 0d bne 4000d71c 4000d6ec: 37 10 00 77 sethi %hi(0x4001dc00), %i3 } memfile_free_blocks_in_table( &info->doubly_indirect, to_free ); } if ( info->triply_indirect ) { 4000d6f0: 10 80 00 15 b 4000d744 4000d6f4: 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( 4000d6f8: 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] ) { 4000d6fc: 90 00 80 01 add %g2, %g1, %o0 4000d700: c2 00 80 01 ld [ %g2 + %g1 ], %g1 4000d704: 80 a0 60 00 cmp %g1, 0 4000d708: 22 80 00 05 be,a 4000d71c <== NEVER TAKEN 4000d70c: b8 07 20 01 inc %i4 <== NOT EXECUTED memfile_free_blocks_in_table( 4000d710: 7f ff ff d6 call 4000d668 4000d714: 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 4000d72c: 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 ); 4000d730: 90 06 20 5c add %i0, 0x5c, %o0 4000d734: 7f ff ff cd call 4000d668 4000d738: 92 10 00 1d mov %i5, %o1 } if ( info->triply_indirect ) { 4000d73c: c2 06 20 60 ld [ %i0 + 0x60 ], %g1 4000d740: b8 10 20 00 clr %i4 4000d744: 80 a0 60 00 cmp %g1, 0 4000d748: 12 80 00 1c bne 4000d7b8 4000d74c: 33 10 00 77 sethi %hi(0x4001dc00), %i1 4000d750: 81 c7 e0 08 ret 4000d754: 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( 4000d758: a1 2f 20 02 sll %i4, 2, %l0 } if ( info->triply_indirect ) { for ( i=0 ; itriply_indirect[i]; 4000d75c: f6 00 40 10 ld [ %g1 + %l0 ], %i3 if ( !p ) /* ensure we have a valid pointer */ 4000d760: 80 a6 e0 00 cmp %i3, 0 4000d764: 02 80 00 1b be 4000d7d0 <== NEVER TAKEN 4000d768: 90 06 20 60 add %i0, 0x60, %o0 4000d76c: 10 80 00 09 b 4000d790 4000d770: b4 10 20 00 clr %i2 break; for ( j=0 ; j <== NEVER TAKEN 4000d77c: 90 10 00 1b mov %i3, %o0 memfile_free_blocks_in_table( (block_p **)&p[j], to_free); 4000d780: 7f ff ff ba call 4000d668 4000d784: 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 4000d7a0: 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( 4000d7a4: d0 06 20 60 ld [ %i0 + 0x60 ], %o0 4000d7a8: 92 10 00 1d mov %i5, %o1 4000d7ac: 90 02 00 10 add %o0, %l0, %o0 4000d7b0: 7f ff ff ae call 4000d668 4000d7b4: b8 07 20 01 inc %i4 memfile_free_blocks_in_table( &info->doubly_indirect, to_free ); } if ( info->triply_indirect ) { for ( i=0 ; i 4000d7c8: 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( 4000d7cc: 90 06 20 60 add %i0, 0x60, %o0 4000d7d0: 7f ff ff a6 call 4000d668 4000d7d4: 92 10 00 1d mov %i5, %o1 (block_p **)&info->triply_indirect, to_free ); } return the_jnode; } 4000d7d8: 81 c7 e0 08 ret 4000d7dc: 81 e8 00 00 restore =============================================================================== 4000d7e0 : */ MEMFILE_STATIC int IMFS_memfile_remove_block( IMFS_jnode_t *the_jnode, unsigned int block ) { 4000d7e0: 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 ); 4000d7e4: 94 10 20 00 clr %o2 <== NOT EXECUTED 4000d7e8: 92 10 00 19 mov %i1, %o1 <== NOT EXECUTED 4000d7ec: 7f ff fe 5e call 4000d164 <== NOT EXECUTED 4000d7f0: 90 10 00 18 mov %i0, %o0 <== NOT EXECUTED 4000d7f4: 82 10 00 08 mov %o0, %g1 <== NOT EXECUTED IMFS_assert( block_ptr ); ptr = *block_ptr; 4000d7f8: d0 02 00 00 ld [ %o0 ], %o0 <== NOT EXECUTED *block_ptr = 0; memfile_free_block( ptr ); return 1; } 4000d7fc: 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 ); 4000d800: 7f ff ff 91 call 4000d644 <== NOT EXECUTED 4000d804: c0 20 40 00 clr [ %g1 ] <== NOT EXECUTED return 1; } 4000d808: 81 c7 e0 08 ret <== NOT EXECUTED 4000d80c: 81 e8 00 00 restore <== NOT EXECUTED =============================================================================== 4000d9b0 : IMFS_jnode_t *the_jnode, off_t start, const unsigned char *source, unsigned int length ) { 4000d9b0: 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 ) { 4000d9b4: c2 06 20 50 ld [ %i0 + 0x50 ], %g1 4000d9b8: 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; 4000d9bc: 96 07 00 1a add %i4, %i2, %o3 if ( last_byte > the_jnode->info.file.size ) { 4000d9c0: 80 a0 c0 01 cmp %g3, %g1 4000d9c4: 14 80 00 1b bg 4000da30 <== NEVER TAKEN 4000d9c8: c4 06 20 54 ld [ %i0 + 0x54 ], %g2 4000d9cc: 80 a0 c0 01 cmp %g3, %g1 4000d9d0: 32 80 00 06 bne,a 4000d9e8 <== NEVER TAKEN 4000d9d4: 03 10 00 77 sethi %hi(0x4001dc00), %g1 <== NOT EXECUTED 4000d9d8: 80 a2 c0 02 cmp %o3, %g2 4000d9dc: 18 80 00 16 bgu 4000da34 4000d9e0: 80 a6 40 01 cmp %i1, %g1 */ /* * Phase 1: possibly the last part of one block */ start_offset = start % IMFS_MEMFILE_BYTES_PER_BLOCK; 4000d9e4: 03 10 00 77 sethi %hi(0x4001dc00), %g1 4000d9e8: fa 00 61 e0 ld [ %g1 + 0x1e0 ], %i5 ! 4001dde0 4000d9ec: 92 10 00 1a mov %i2, %o1 4000d9f0: a3 3f 60 1f sra %i5, 0x1f, %l1 4000d9f4: 96 10 00 1d mov %i5, %o3 4000d9f8: 94 10 00 11 mov %l1, %o2 4000d9fc: 40 00 2a ce call 40018534 <__moddi3> 4000da00: 90 10 00 19 mov %i1, %o0 block = start / IMFS_MEMFILE_BYTES_PER_BLOCK; 4000da04: 90 10 00 19 mov %i1, %o0 */ /* * Phase 1: possibly the last part of one block */ start_offset = start % IMFS_MEMFILE_BYTES_PER_BLOCK; 4000da08: a0 10 00 09 mov %o1, %l0 block = start / IMFS_MEMFILE_BYTES_PER_BLOCK; 4000da0c: 94 10 00 11 mov %l1, %o2 4000da10: 92 10 00 1a mov %i2, %o1 4000da14: 40 00 29 dd call 40018188 <__divdi3> 4000da18: 96 10 00 1d mov %i5, %o3 if ( start_offset ) { 4000da1c: 80 a4 20 00 cmp %l0, 0 4000da20: 12 80 00 17 bne 4000da7c 4000da24: b4 10 00 09 mov %o1, %i2 status = IMFS_memfile_extend( the_jnode, zero_fill, last_byte ); if ( status ) return status; } copied = 0; 4000da28: 10 80 00 28 b 4000dac8 4000da2c: 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; 4000da30: 80 a6 40 01 cmp %i1, %g1 <== NOT EXECUTED 4000da34: 14 80 00 09 bg 4000da58 <== NEVER TAKEN 4000da38: 92 10 20 01 mov 1, %o1 4000da3c: 80 a6 40 01 cmp %i1, %g1 4000da40: 32 80 00 06 bne,a 4000da58 <== NEVER TAKEN 4000da44: 92 10 20 00 clr %o1 <== NOT EXECUTED 4000da48: 80 a6 80 02 cmp %i2, %g2 4000da4c: 18 80 00 04 bgu 4000da5c 4000da50: 90 10 00 18 mov %i0, %o0 4000da54: 92 10 20 00 clr %o1 status = IMFS_memfile_extend( the_jnode, zero_fill, last_byte ); 4000da58: 90 10 00 18 mov %i0, %o0 4000da5c: 92 0a 60 01 and %o1, 1, %o1 4000da60: 7f ff ff 6c call 4000d810 4000da64: 94 10 20 00 clr %o2 if ( status ) 4000da68: 82 92 20 00 orcc %o0, 0, %g1 4000da6c: 22 bf ff df be,a 4000d9e8 4000da70: 03 10 00 77 sethi %hi(0x4001dc00), %g1 } IMFS_mtime_ctime_update( the_jnode ); return copied; } 4000da74: 81 c7 e0 08 ret 4000da78: 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; 4000da7c: ba 27 40 10 sub %i5, %l0, %i5 4000da80: 80 a7 40 1c cmp %i5, %i4 4000da84: 38 80 00 02 bgu,a 4000da8c 4000da88: 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 ); 4000da8c: 90 10 00 18 mov %i0, %o0 4000da90: 92 10 00 1a mov %i2, %o1 4000da94: 7f ff fd b4 call 4000d164 4000da98: 94 10 20 00 clr %o2 if ( !block_ptr ) 4000da9c: 80 a2 20 00 cmp %o0, 0 4000daa0: 02 80 00 36 be 4000db78 <== NEVER TAKEN 4000daa4: 82 10 20 00 clr %g1 block, to_copy, src ); #endif memcpy( &(*block_ptr)[ start_offset ], src, to_copy ); 4000daa8: d0 02 00 00 ld [ %o0 ], %o0 4000daac: 92 10 00 1b mov %i3, %o1 4000dab0: 90 02 00 10 add %o0, %l0, %o0 4000dab4: 94 10 00 1d mov %i5, %o2 4000dab8: 40 00 06 3e call 4000f3b0 4000dabc: b6 06 c0 1d add %i3, %i5, %i3 src += to_copy; block++; 4000dac0: b4 06 a0 01 inc %i2 my_length -= to_copy; 4000dac4: b8 27 00 1d sub %i4, %i5, %i4 /* * Phase 2: all of zero of more blocks */ to_copy = IMFS_MEMFILE_BYTES_PER_BLOCK; 4000dac8: 03 10 00 77 sethi %hi(0x4001dc00), %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( 4000dacc: b6 26 c0 1d sub %i3, %i5, %i3 /* * Phase 2: all of zero of more blocks */ to_copy = IMFS_MEMFILE_BYTES_PER_BLOCK; 4000dad0: f2 00 61 e0 ld [ %g1 + 0x1e0 ], %i1 while ( my_length >= IMFS_MEMFILE_BYTES_PER_BLOCK ) { 4000dad4: 10 80 00 0f b 4000db10 4000dad8: a2 10 00 01 mov %g1, %l1 block_ptr = IMFS_memfile_get_block_pointer( the_jnode, block, 0 ); 4000dadc: 90 10 00 18 mov %i0, %o0 4000dae0: 92 10 00 1a mov %i2, %o1 4000dae4: 7f ff fd a0 call 4000d164 4000dae8: 94 10 20 00 clr %o2 if ( !block_ptr ) 4000daec: 80 a2 20 00 cmp %o0, 0 4000daf0: 02 80 00 21 be 4000db74 <== NEVER TAKEN 4000daf4: 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 ); 4000daf8: d0 02 00 00 ld [ %o0 ], %o0 4000dafc: 92 10 00 10 mov %l0, %o1 4000db00: 40 00 06 2c call 4000f3b0 4000db04: b4 06 a0 01 inc %i2 src += to_copy; block++; my_length -= to_copy; 4000db08: 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( 4000db0c: 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 ) { 4000db10: c2 04 61 e0 ld [ %l1 + 0x1e0 ], %g1 4000db14: 80 a7 00 01 cmp %i4, %g1 4000db18: 1a bf ff f1 bcc 4000dadc 4000db1c: 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 ) { 4000db20: 80 a7 20 00 cmp %i4, 0 4000db24: 02 80 00 0f be 4000db60 4000db28: 90 07 bf f8 add %fp, -8, %o0 block_ptr = IMFS_memfile_get_block_pointer( the_jnode, block, 0 ); 4000db2c: 90 10 00 18 mov %i0, %o0 4000db30: 92 10 00 1a mov %i2, %o1 4000db34: 7f ff fd 8c call 4000d164 4000db38: 94 10 20 00 clr %o2 if ( !block_ptr ) 4000db3c: 80 a2 20 00 cmp %o0, 0 4000db40: 02 80 00 0e be 4000db78 <== NEVER TAKEN 4000db44: 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 ); 4000db48: d0 02 00 00 ld [ %o0 ], %o0 4000db4c: 92 10 00 10 mov %l0, %o1 4000db50: 94 10 00 1c mov %i4, %o2 4000db54: 40 00 06 17 call 4000f3b0 4000db58: ba 07 40 1c add %i5, %i4, %i5 my_length = 0; copied += to_copy; } IMFS_mtime_ctime_update( the_jnode ); 4000db5c: 90 07 bf f8 add %fp, -8, %o0 4000db60: 7f ff d5 45 call 40003074 4000db64: 92 10 20 00 clr %o1 4000db68: c2 07 bf f8 ld [ %fp + -8 ], %g1 4000db6c: c2 26 20 44 st %g1, [ %i0 + 0x44 ] 4000db70: 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 ) 4000db74: 82 10 00 1d mov %i5, %g1 } IMFS_mtime_ctime_update( the_jnode ); return copied; } 4000db78: b0 10 00 01 mov %g1, %i0 4000db7c: 81 c7 e0 08 ret 4000db80: 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 21 46 call 4000ad90 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 30 5b call 4000ea6c <__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 30 57 call 4000ea6c <__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 =============================================================================== 4000b1e0 : } static IMFS_jnode_t *IMFS_node_remove_directory( IMFS_jnode_t *node ) { 4000b1e0: 9d e3 bf a0 save %sp, -96, %sp if ( !rtems_chain_is_empty( &node->info.directory.Entries ) ) { 4000b1e4: 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 ); 4000b1e8: 82 06 20 54 add %i0, 0x54, %g1 4000b1ec: 80 a0 80 01 cmp %g2, %g1 4000b1f0: 22 80 00 06 be,a 4000b208 4000b1f4: c2 06 20 5c ld [ %i0 + 0x5c ], %g1 errno = ENOTEMPTY; 4000b1f8: 40 00 0e 1d call 4000ea6c <__errno> 4000b1fc: 01 00 00 00 nop 4000b200: 10 80 00 08 b 4000b220 4000b204: 82 10 20 5a mov 0x5a, %g1 ! 5a node = NULL; } else if ( IMFS_is_mount_point( node ) ) { 4000b208: 80 a0 60 00 cmp %g1, 0 4000b20c: 02 80 00 07 be 4000b228 <== ALWAYS TAKEN 4000b210: 01 00 00 00 nop errno = EBUSY; 4000b214: 40 00 0e 16 call 4000ea6c <__errno> <== NOT EXECUTED 4000b218: 01 00 00 00 nop <== NOT EXECUTED 4000b21c: 82 10 20 10 mov 0x10, %g1 ! 10 <== NOT EXECUTED 4000b220: c2 22 00 00 st %g1, [ %o0 ] 4000b224: b0 10 20 00 clr %i0 node = NULL; } return node; } 4000b228: 81 c7 e0 08 ret 4000b22c: 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 32 79 call 4000f3b0 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 30 12 call 4000ea6c <__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 30 0e call 4000ea6c <__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 2f c3 call 4000ea6c <__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 2f bf call 4000ea6c <__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 75 sethi %hi(0x4001d400), %g1 40003268: f6 00 62 a0 ld [ %g1 + 0x2a0 ], %i3 ! 4001d6a0 if ( !rtems_configuration_get_unified_work_area() ) { 4000326c: 03 10 00 6d sethi %hi(0x4001b400), %g1 40003270: c2 08 63 89 ldub [ %g1 + 0x389 ], %g1 ! 4001b789 40003274: 80 a0 60 00 cmp %g1, 0 40003278: 12 80 00 1b bne 400032e4 4000327c: 03 10 00 77 sethi %hi(0x4001dc00), %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 61 5c or %i5, 0x15c, %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 61 5c or %g1, 0x15c, %g1 ! 4000815c <_Heap_Initialize> 400032c8: 80 a7 40 01 cmp %i5, %g1 400032cc: 12 80 00 06 bne 400032e4 400032d0: 03 10 00 77 sethi %hi(0x4001dc00), %g1 _Internal_error_Occurred( 400032d4: 90 10 20 00 clr %o0 400032d8: 92 10 20 01 mov 1, %o1 400032dc: 40 00 14 33 call 400083a8 <_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 61 d0 ld [ %g1 + 0x1d0 ], %g1 400032e8: 80 a0 60 00 cmp %g1, 0 400032ec: 02 80 00 05 be 40003300 400032f0: 3b 10 00 78 sethi %hi(0x4001e000), %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 60 80 ld [ %i5 + 0x80 ], %i4 40003304: 40 00 16 73 call 40008cd0 <_Protected_heap_Get_size> 40003308: 90 10 00 1b mov %i3, %o0 4000330c: 90 02 00 1c add %o0, %i4, %o0 40003310: d0 27 60 80 st %o0, [ %i5 + 0x80 ] 40003314: 81 c7 e0 08 ret 40003318: 81 e8 00 00 restore =============================================================================== 400217d4 : static rtems_printk_plugin_t print_handler; static void Stack_check_Dump_threads_usage( Thread_Control *the_thread ) { 400217d4: 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) { 400217d8: 80 a6 3f ff cmp %i0, -1 <== NOT EXECUTED 400217dc: 32 80 00 0a bne,a 40021804 <== NOT EXECUTED 400217e0: e0 06 21 38 ld [ %i0 + 0x138 ], %l0 <== NOT EXECUTED if (!Stack_check_Interrupt_stack.area) 400217e4: 3b 10 01 8f sethi %hi(0x40063c00), %i5 <== NOT EXECUTED 400217e8: ba 17 60 0c or %i5, 0xc, %i5 ! 40063c0c <== NOT EXECUTED 400217ec: c2 07 60 04 ld [ %i5 + 4 ], %g1 <== NOT EXECUTED 400217f0: 80 a0 60 00 cmp %g1, 0 <== NOT EXECUTED 400217f4: 02 80 00 4c be 40021924 <== NOT EXECUTED 400217f8: a0 10 20 00 clr %l0 <== NOT EXECUTED return; stack = &Stack_check_Interrupt_stack; the_thread = 0; 400217fc: 10 80 00 04 b 4002180c <== NOT EXECUTED 40021800: b0 10 20 00 clr %i0 <== NOT EXECUTED current = 0; } else #endif { stack = &the_thread->Start.Initial_stack; 40021804: ba 06 20 b4 add %i0, 0xb4, %i5 <== NOT EXECUTED current = (void *)_CPU_Context_Get_SP( &the_thread->Registers ); } low = Stack_check_usable_stack_start(stack); 40021808: c2 07 60 04 ld [ %i5 + 4 ], %g1 <== NOT EXECUTED size = Stack_check_usable_stack_size(stack); 4002180c: 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); 40021810: 84 00 60 10 add %g1, 0x10, %g2 <== NOT EXECUTED size = Stack_check_usable_stack_size(stack); 40021814: 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; 40021818: 82 00 60 20 add %g1, 0x20, %g1 <== NOT EXECUTED for (ebase = base + length; base < ebase; base++) 4002181c: 86 0e 7f fc and %i1, -4, %g3 <== NOT EXECUTED if (*base != U32_PATTERN) 40021820: 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++) 40021824: 86 00 40 03 add %g1, %g3, %g3 <== NOT EXECUTED if (*base != U32_PATTERN) 40021828: 10 80 00 06 b 40021840 <== NOT EXECUTED 4002182c: 88 11 21 a5 or %g4, 0x1a5, %g4 <== NOT EXECUTED 40021830: 80 a7 00 04 cmp %i4, %g4 <== NOT EXECUTED 40021834: 12 80 00 08 bne 40021854 <== NOT EXECUTED 40021838: 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++) 4002183c: 82 00 60 04 add %g1, 4, %g1 <== NOT EXECUTED 40021840: 80 a0 40 03 cmp %g1, %g3 <== NOT EXECUTED 40021844: 2a bf ff fb bcs,a 40021830 <== NOT EXECUTED 40021848: 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; 4002184c: 10 80 00 06 b 40021864 <== NOT EXECUTED 40021850: 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 ) 40021854: 02 80 00 04 be 40021864 <== NOT EXECUTED 40021858: b8 10 20 00 clr %i4 <== NOT EXECUTED used = Stack_check_Calculate_used( low, size, high_water_mark ); 4002185c: b8 00 80 19 add %g2, %i1, %i4 <== NOT EXECUTED 40021860: b8 27 00 01 sub %i4, %g1, %i4 <== NOT EXECUTED else used = 0; #if (CPU_ALLOCATE_INTERRUPT_STACK == TRUE) if ( the_thread ) 40021864: 80 a6 20 00 cmp %i0, 0 <== NOT EXECUTED 40021868: 02 80 00 12 be 400218b0 <== NOT EXECUTED 4002186c: 03 10 01 8a sethi %hi(0x40062800), %g1 <== NOT EXECUTED #endif { (*print_handler)( 40021870: f6 06 20 08 ld [ %i0 + 8 ], %i3 <== NOT EXECUTED 40021874: f4 00 62 20 ld [ %g1 + 0x220 ], %i2 <== NOT EXECUTED 40021878: 03 10 01 8a sethi %hi(0x40062800), %g1 <== NOT EXECUTED 4002187c: e2 00 62 1c ld [ %g1 + 0x21c ], %l1 ! 40062a1c <== NOT EXECUTED 40021880: 94 07 bf f8 add %fp, -8, %o2 <== NOT EXECUTED 40021884: 90 10 00 1b mov %i3, %o0 <== NOT EXECUTED 40021888: 7f ff b2 92 call 4000e2d0 <== NOT EXECUTED 4002188c: 92 10 20 05 mov 5, %o1 <== NOT EXECUTED 40021890: 13 10 01 65 sethi %hi(0x40059400), %o1 <== NOT EXECUTED 40021894: 96 10 00 08 mov %o0, %o3 <== NOT EXECUTED 40021898: 92 12 63 90 or %o1, 0x390, %o1 <== NOT EXECUTED 4002189c: 90 10 00 11 mov %l1, %o0 <== NOT EXECUTED 400218a0: 9f c6 80 00 call %i2 <== NOT EXECUTED 400218a4: 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, 400218a8: 10 80 00 0a b 400218d0 <== NOT EXECUTED 400218ac: 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 ); 400218b0: 05 10 01 8a sethi %hi(0x40062800), %g2 <== NOT EXECUTED 400218b4: c2 00 62 20 ld [ %g1 + 0x220 ], %g1 <== NOT EXECUTED 400218b8: d0 00 a2 1c ld [ %g2 + 0x21c ], %o0 <== NOT EXECUTED 400218bc: 13 10 01 65 sethi %hi(0x40059400), %o1 <== NOT EXECUTED 400218c0: 94 10 3f ff mov -1, %o2 <== NOT EXECUTED 400218c4: 9f c0 40 00 call %g1 <== NOT EXECUTED 400218c8: 92 12 63 a0 or %o1, 0x3a0, %o1 <== NOT EXECUTED (*print_handler)( print_context, " %010p - %010p %010p %8" PRId32 " ", stack->area, stack->area + stack->size - 1, 400218cc: d4 07 60 04 ld [ %i5 + 4 ], %o2 <== NOT EXECUTED else { (*print_handler)( print_context, "0x%08" PRIx32 " INTR", ~0 ); } #endif (*print_handler)( 400218d0: 35 10 01 8a sethi %hi(0x40062800), %i2 <== NOT EXECUTED 400218d4: 37 10 01 8a sethi %hi(0x40062800), %i3 <== NOT EXECUTED print_context, " %010p - %010p %010p %8" PRId32 " ", stack->area, stack->area + stack->size - 1, 400218d8: d6 07 40 00 ld [ %i5 ], %o3 <== NOT EXECUTED else { (*print_handler)( print_context, "0x%08" PRIx32 " INTR", ~0 ); } #endif (*print_handler)( 400218dc: c2 06 a2 20 ld [ %i2 + 0x220 ], %g1 <== NOT EXECUTED 400218e0: d0 06 e2 1c ld [ %i3 + 0x21c ], %o0 <== NOT EXECUTED print_context, " %010p - %010p %010p %8" PRId32 " ", stack->area, stack->area + stack->size - 1, 400218e4: 96 02 ff ff add %o3, -1, %o3 <== NOT EXECUTED else { (*print_handler)( print_context, "0x%08" PRIx32 " INTR", ~0 ); } #endif (*print_handler)( 400218e8: 13 10 01 65 sethi %hi(0x40059400), %o1 <== NOT EXECUTED 400218ec: 96 02 80 0b add %o2, %o3, %o3 <== NOT EXECUTED 400218f0: 92 12 63 b0 or %o1, 0x3b0, %o1 <== NOT EXECUTED 400218f4: 98 10 00 10 mov %l0, %o4 <== NOT EXECUTED 400218f8: 9f c0 40 00 call %g1 <== NOT EXECUTED 400218fc: 9a 10 00 19 mov %i1, %o5 <== NOT EXECUTED stack->area + stack->size - 1, current, size ); if (Stack_check_Initialized == 0) { 40021900: 03 10 01 8a sethi %hi(0x40062800), %g1 <== NOT EXECUTED 40021904: c2 00 62 18 ld [ %g1 + 0x218 ], %g1 ! 40062a18 <== NOT EXECUTED (*print_handler)( print_context, "Unavailable\n" ); 40021908: d0 06 e2 1c ld [ %i3 + 0x21c ], %o0 <== NOT EXECUTED stack->area + stack->size - 1, current, size ); if (Stack_check_Initialized == 0) { 4002190c: 80 a0 60 00 cmp %g1, 0 <== NOT EXECUTED 40021910: 12 80 00 07 bne 4002192c <== NOT EXECUTED 40021914: c2 06 a2 20 ld [ %i2 + 0x220 ], %g1 <== NOT EXECUTED (*print_handler)( print_context, "Unavailable\n" ); 40021918: 13 10 01 65 sethi %hi(0x40059400), %o1 <== NOT EXECUTED 4002191c: 9f c0 40 00 call %g1 <== NOT EXECUTED 40021920: 92 12 63 d0 or %o1, 0x3d0, %o1 ! 400597d0 <== NOT EXECUTED 40021924: 81 c7 e0 08 ret <== NOT EXECUTED 40021928: 81 e8 00 00 restore <== NOT EXECUTED } else { (*print_handler)( print_context, "%8" PRId32 "\n", used ); 4002192c: 13 10 01 65 sethi %hi(0x40059400), %o1 <== NOT EXECUTED 40021930: 94 10 00 1c mov %i4, %o2 <== NOT EXECUTED 40021934: 9f c0 40 00 call %g1 <== NOT EXECUTED 40021938: 92 12 63 e0 or %o1, 0x3e0, %o1 <== NOT EXECUTED 4002193c: 81 c7 e0 08 ret <== NOT EXECUTED 40021940: 81 e8 00 00 restore <== NOT EXECUTED =============================================================================== 40021a2c : Thread_Control *running, bool pattern_ok ) RTEMS_COMPILER_NO_RETURN_ATTRIBUTE; void Stack_check_report_blown_task(Thread_Control *running, bool pattern_ok) { 40021a2c: 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"); 40021a30: 11 10 01 65 sethi %hi(0x40059400), %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); 40021a34: fa 06 20 b8 ld [ %i0 + 0xb8 ], %i5 <== NOT EXECUTED char name[32]; printk("BLOWN STACK!!!\n"); 40021a38: 7f ff 87 96 call 40003890 <== NOT EXECUTED 40021a3c: 90 12 23 e8 or %o0, 0x3e8, %o0 <== NOT EXECUTED printk("task control block: 0x%08" PRIxPTR "\n", running); 40021a40: 92 10 00 18 mov %i0, %o1 <== NOT EXECUTED 40021a44: 11 10 01 65 sethi %hi(0x40059400), %o0 <== NOT EXECUTED 40021a48: 7f ff 87 92 call 40003890 <== NOT EXECUTED 40021a4c: 90 12 23 f8 or %o0, 0x3f8, %o0 ! 400597f8 <== NOT EXECUTED printk("task ID: 0x%08lx\n", (unsigned long) running->Object.id); 40021a50: d2 06 20 08 ld [ %i0 + 8 ], %o1 <== NOT EXECUTED 40021a54: 11 10 01 66 sethi %hi(0x40059800), %o0 <== NOT EXECUTED 40021a58: 7f ff 87 8e call 40003890 <== NOT EXECUTED 40021a5c: 90 12 20 18 or %o0, 0x18, %o0 ! 40059818 <== NOT EXECUTED printk( 40021a60: d2 06 20 0c ld [ %i0 + 0xc ], %o1 <== NOT EXECUTED 40021a64: 11 10 01 66 sethi %hi(0x40059800), %o0 <== NOT EXECUTED 40021a68: 7f ff 87 8a call 40003890 <== NOT EXECUTED 40021a6c: 90 12 20 30 or %o0, 0x30, %o0 ! 40059830 <== NOT EXECUTED "task name: 0x%08" PRIx32 "\n", running->Object.name.name_u32 ); printk( 40021a70: d0 06 20 08 ld [ %i0 + 8 ], %o0 <== NOT EXECUTED 40021a74: 94 07 bf e0 add %fp, -32, %o2 <== NOT EXECUTED 40021a78: 7f ff b2 16 call 4000e2d0 <== NOT EXECUTED 40021a7c: 92 10 20 20 mov 0x20, %o1 <== NOT EXECUTED 40021a80: 92 10 00 08 mov %o0, %o1 <== NOT EXECUTED 40021a84: 11 10 01 66 sethi %hi(0x40059800), %o0 <== NOT EXECUTED 40021a88: 7f ff 87 82 call 40003890 <== NOT EXECUTED 40021a8c: 90 12 20 48 or %o0, 0x48, %o0 ! 40059848 <== 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) 40021a90: d4 06 20 b8 ld [ %i0 + 0xb8 ], %o2 <== NOT EXECUTED 40021a94: d2 06 20 b4 ld [ %i0 + 0xb4 ], %o1 <== NOT EXECUTED ); printk( "task name string: %s\n", rtems_object_get_name(running->Object.id, sizeof(name), name) ); printk( 40021a98: 11 10 01 66 sethi %hi(0x40059800), %o0 <== NOT EXECUTED 40021a9c: 96 02 80 09 add %o2, %o1, %o3 <== NOT EXECUTED 40021aa0: 7f ff 87 7c call 40003890 <== NOT EXECUTED 40021aa4: 90 12 20 60 or %o0, 0x60, %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) { 40021aa8: 80 a6 60 00 cmp %i1, 0 <== NOT EXECUTED 40021aac: 32 80 00 09 bne,a 40021ad0 <== NOT EXECUTED 40021ab0: d2 06 20 0c ld [ %i0 + 0xc ], %o1 <== NOT EXECUTED printk( 40021ab4: 11 10 01 66 sethi %hi(0x40059800), %o0 <== NOT EXECUTED 40021ab8: 92 10 20 10 mov 0x10, %o1 <== NOT EXECUTED 40021abc: 90 12 20 90 or %o0, 0x90, %o0 <== NOT EXECUTED 40021ac0: 94 07 60 08 add %i5, 8, %o2 <== NOT EXECUTED 40021ac4: 7f ff 87 73 call 40003890 <== NOT EXECUTED 40021ac8: 96 07 60 18 add %i5, 0x18, %o3 <== NOT EXECUTED rtems_configuration_get_user_multiprocessing_table()->node ); } #endif rtems_fatal( 40021acc: d2 06 20 0c ld [ %i0 + 0xc ], %o1 <== NOT EXECUTED 40021ad0: 7f ff 95 78 call 400070b0 <== NOT EXECUTED 40021ad4: 90 10 20 09 mov 9, %o0 <== NOT EXECUTED =============================================================================== 40009cf4 <_CORE_RWLock_Release>: #include CORE_RWLock_Status _CORE_RWLock_Release( CORE_RWLock_Control *the_rwlock ) { 40009cf4: 9d e3 bf a0 save %sp, -96, %sp ISR_Level level; Thread_Control *executing = _Thread_Executing; 40009cf8: 03 10 00 68 sethi %hi(0x4001a000), %g1 * Otherwise, we have to block. * If locked for reading and no waiters, then OK to read. * If any thread is waiting, then we wait. */ _ISR_Disable( level ); 40009cfc: 7f ff e6 32 call 400035c4 40009d00: fa 00 61 a0 ld [ %g1 + 0x1a0 ], %i5 ! 4001a1a0 <_Per_CPU_Information+0x10> 40009d04: 84 10 00 08 mov %o0, %g2 if ( the_rwlock->current_state == CORE_RWLOCK_UNLOCKED){ 40009d08: c2 06 20 44 ld [ %i0 + 0x44 ], %g1 40009d0c: 80 a0 60 00 cmp %g1, 0 40009d10: 12 80 00 08 bne 40009d30 <_CORE_RWLock_Release+0x3c> 40009d14: 80 a0 60 01 cmp %g1, 1 _ISR_Enable( level ); 40009d18: 7f ff e6 2f call 400035d4 40009d1c: b0 10 20 00 clr %i0 executing->Wait.return_code = CORE_RWLOCK_UNAVAILABLE; 40009d20: 82 10 20 02 mov 2, %g1 40009d24: c2 27 60 34 st %g1, [ %i5 + 0x34 ] 40009d28: 81 c7 e0 08 ret 40009d2c: 81 e8 00 00 restore return CORE_RWLOCK_SUCCESSFUL; } if ( the_rwlock->current_state == CORE_RWLOCK_LOCKED_FOR_READING ) { 40009d30: 32 80 00 0b bne,a 40009d5c <_CORE_RWLock_Release+0x68> 40009d34: c0 27 60 34 clr [ %i5 + 0x34 ] the_rwlock->number_of_readers -= 1; 40009d38: c2 06 20 48 ld [ %i0 + 0x48 ], %g1 40009d3c: 82 00 7f ff add %g1, -1, %g1 if ( the_rwlock->number_of_readers != 0 ) { 40009d40: 80 a0 60 00 cmp %g1, 0 40009d44: 02 80 00 05 be 40009d58 <_CORE_RWLock_Release+0x64> 40009d48: c2 26 20 48 st %g1, [ %i0 + 0x48 ] /* must be unlocked again */ _ISR_Enable( level ); 40009d4c: 7f ff e6 22 call 400035d4 40009d50: b0 10 20 00 clr %i0 return CORE_RWLOCK_SUCCESSFUL; 40009d54: 30 80 00 24 b,a 40009de4 <_CORE_RWLock_Release+0xf0> } } /* CORE_RWLOCK_LOCKED_FOR_WRITING or READING with readers */ executing->Wait.return_code = CORE_RWLOCK_SUCCESSFUL; 40009d58: c0 27 60 34 clr [ %i5 + 0x34 ] /* * Implicitly transition to "unlocked" and find another thread interested * in obtaining this rwlock. */ the_rwlock->current_state = CORE_RWLOCK_UNLOCKED; 40009d5c: c0 26 20 44 clr [ %i0 + 0x44 ] _ISR_Enable( level ); 40009d60: 7f ff e6 1d call 400035d4 40009d64: 90 10 00 02 mov %g2, %o0 next = _Thread_queue_Dequeue( &the_rwlock->Wait_queue ); 40009d68: 40 00 07 6d call 4000bb1c <_Thread_queue_Dequeue> 40009d6c: 90 10 00 18 mov %i0, %o0 if ( next ) { 40009d70: 80 a2 20 00 cmp %o0, 0 40009d74: 22 80 00 1c be,a 40009de4 <_CORE_RWLock_Release+0xf0> 40009d78: b0 10 20 00 clr %i0 if ( next->Wait.option == CORE_RWLOCK_THREAD_WAITING_FOR_WRITE ) { 40009d7c: c2 02 20 30 ld [ %o0 + 0x30 ], %g1 40009d80: 80 a0 60 01 cmp %g1, 1 40009d84: 32 80 00 05 bne,a 40009d98 <_CORE_RWLock_Release+0xa4> 40009d88: c2 06 20 48 ld [ %i0 + 0x48 ], %g1 the_rwlock->current_state = CORE_RWLOCK_LOCKED_FOR_WRITING; 40009d8c: 82 10 20 02 mov 2, %g1 return CORE_RWLOCK_SUCCESSFUL; 40009d90: 10 80 00 14 b 40009de0 <_CORE_RWLock_Release+0xec> 40009d94: c2 26 20 44 st %g1, [ %i0 + 0x44 ] } /* * Must be CORE_RWLOCK_THREAD_WAITING_FOR_READING */ the_rwlock->number_of_readers += 1; 40009d98: 82 00 60 01 inc %g1 40009d9c: c2 26 20 48 st %g1, [ %i0 + 0x48 ] the_rwlock->current_state = CORE_RWLOCK_LOCKED_FOR_READING; 40009da0: 82 10 20 01 mov 1, %g1 40009da4: c2 26 20 44 st %g1, [ %i0 + 0x44 ] /* * Now see if more readers can be let go. */ while ( 1 ) { next = _Thread_queue_First( &the_rwlock->Wait_queue ); 40009da8: 40 00 08 99 call 4000c00c <_Thread_queue_First> 40009dac: 90 10 00 18 mov %i0, %o0 if ( !next || 40009db0: 92 92 20 00 orcc %o0, 0, %o1 40009db4: 22 80 00 0c be,a 40009de4 <_CORE_RWLock_Release+0xf0> 40009db8: b0 10 20 00 clr %i0 40009dbc: c2 02 60 30 ld [ %o1 + 0x30 ], %g1 40009dc0: 80 a0 60 01 cmp %g1, 1 40009dc4: 02 80 00 07 be 40009de0 <_CORE_RWLock_Release+0xec> <== NEVER TAKEN 40009dc8: 90 10 00 18 mov %i0, %o0 next->Wait.option == CORE_RWLOCK_THREAD_WAITING_FOR_WRITE ) return CORE_RWLOCK_SUCCESSFUL; the_rwlock->number_of_readers += 1; 40009dcc: c2 06 20 48 ld [ %i0 + 0x48 ], %g1 40009dd0: 82 00 60 01 inc %g1 _Thread_queue_Extract( &the_rwlock->Wait_queue, next ); 40009dd4: 40 00 08 3f call 4000bed0 <_Thread_queue_Extract> 40009dd8: c2 26 20 48 st %g1, [ %i0 + 0x48 ] } 40009ddc: 30 bf ff f3 b,a 40009da8 <_CORE_RWLock_Release+0xb4> } /* indentation is to match _ISR_Disable at top */ return CORE_RWLOCK_SUCCESSFUL; } 40009de0: b0 10 20 00 clr %i0 40009de4: 81 c7 e0 08 ret 40009de8: 81 e8 00 00 restore =============================================================================== 40009dec <_CORE_RWLock_Timeout>: void _CORE_RWLock_Timeout( Objects_Id id, void *ignored ) { 40009dec: 9d e3 bf 98 save %sp, -104, %sp Thread_Control *the_thread; Objects_Locations location; the_thread = _Thread_Get( id, &location ); 40009df0: 90 10 00 18 mov %i0, %o0 40009df4: 40 00 06 7e call 4000b7ec <_Thread_Get> 40009df8: 92 07 bf fc add %fp, -4, %o1 switch ( location ) { 40009dfc: c2 07 bf fc ld [ %fp + -4 ], %g1 40009e00: 80 a0 60 00 cmp %g1, 0 40009e04: 12 80 00 08 bne 40009e24 <_CORE_RWLock_Timeout+0x38> <== NEVER TAKEN 40009e08: 01 00 00 00 nop #if defined(RTEMS_MULTIPROCESSING) case OBJECTS_REMOTE: /* impossible */ #endif break; case OBJECTS_LOCAL: _Thread_queue_Process_timeout( the_thread ); 40009e0c: 40 00 08 bd call 4000c100 <_Thread_queue_Process_timeout> 40009e10: 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; 40009e14: 03 10 00 67 sethi %hi(0x40019c00), %g1 40009e18: c4 00 60 80 ld [ %g1 + 0x80 ], %g2 ! 40019c80 <_Thread_Dispatch_disable_level> --level; 40009e1c: 84 00 bf ff add %g2, -1, %g2 _Thread_Dispatch_disable_level = level; 40009e20: c4 20 60 80 st %g2, [ %g1 + 0x80 ] 40009e24: 81 c7 e0 08 ret 40009e28: 81 e8 00 00 restore =============================================================================== 40007e84 <_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 ) { 40007e84: 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)) ) { 40007e88: 90 10 00 18 mov %i0, %o0 40007e8c: 40 00 07 3d call 40009b80 <_Thread_queue_Dequeue> 40007e90: ba 10 00 18 mov %i0, %i5 40007e94: 80 a2 20 00 cmp %o0, 0 40007e98: 12 80 00 0e bne 40007ed0 <_CORE_semaphore_Surrender+0x4c> 40007e9c: 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 ); 40007ea0: 7f ff e8 82 call 400020a8 40007ea4: 01 00 00 00 nop if ( the_semaphore->count < the_semaphore->Attributes.maximum_count ) 40007ea8: c2 07 60 48 ld [ %i5 + 0x48 ], %g1 40007eac: c4 07 60 40 ld [ %i5 + 0x40 ], %g2 40007eb0: 80 a0 40 02 cmp %g1, %g2 40007eb4: 1a 80 00 05 bcc 40007ec8 <_CORE_semaphore_Surrender+0x44> <== NEVER TAKEN 40007eb8: b0 10 20 04 mov 4, %i0 the_semaphore->count += 1; 40007ebc: 82 00 60 01 inc %g1 { Thread_Control *the_thread; ISR_Level level; CORE_semaphore_Status status; status = CORE_SEMAPHORE_STATUS_SUCCESSFUL; 40007ec0: b0 10 20 00 clr %i0 #endif } else { _ISR_Disable( level ); if ( the_semaphore->count < the_semaphore->Attributes.maximum_count ) the_semaphore->count += 1; 40007ec4: c2 27 60 48 st %g1, [ %i5 + 0x48 ] else status = CORE_SEMAPHORE_MAXIMUM_COUNT_EXCEEDED; _ISR_Enable( level ); 40007ec8: 7f ff e8 7c call 400020b8 40007ecc: 01 00 00 00 nop } return status; } 40007ed0: 81 c7 e0 08 ret 40007ed4: 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 79 sethi %hi(0x4001e400), %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 e3 10 or %g3, 0x310, %g3 ! 4001e710 <_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 6a call 4000a5bc <_Watchdog_Remove> 40006c18: 90 07 60 48 add %i5, 0x48, %o0 40006c1c: b2 16 63 f8 or %i1, 0x3f8, %i1 40006c20: 40 00 0a 2a call 400094c8 <_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 0b 06 call 40009850 <_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 79 sethi %hi(0x4001e400), %g1 return; } #endif the_thread->Wait.count = 0; if ( _Thread_Is_executing( the_thread ) ) { 40006c5c: c2 00 63 20 ld [ %g1 + 0x320 ], %g1 ! 4001e720 <_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 0a 0b call 400094c8 <_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 78 sethi %hi(0x4001e000), %g1 40006ca8: c4 00 62 00 ld [ %g1 + 0x200 ], %g2 ! 4001e200 <_Thread_Dispatch_disable_level> --level; 40006cac: 84 00 bf ff add %g2, -1, %g2 _Thread_Dispatch_disable_level = level; 40006cb0: c4 20 62 00 st %g2, [ %g1 + 0x200 ] 40006cb4: 81 c7 e0 08 ret 40006cb8: 81 e8 00 00 restore =============================================================================== 4000cba4 <_Heap_Free>: return do_free; } #endif bool _Heap_Free( Heap_Control *heap, void *alloc_begin_ptr ) { 4000cba4: 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 ) { 4000cba8: 80 a6 60 00 cmp %i1, 0 4000cbac: 02 80 00 7a be 4000cd94 <_Heap_Free+0x1f0> 4000cbb0: 88 10 20 01 mov 1, %g4 4000cbb4: d2 06 20 10 ld [ %i0 + 0x10 ], %o1 4000cbb8: 40 00 2c c8 call 40017ed8 <.urem> 4000cbbc: 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 4000cbc0: 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); 4000cbc4: 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); 4000cbc8: 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; 4000cbcc: 80 a2 00 1b cmp %o0, %i3 4000cbd0: 0a 80 00 05 bcs 4000cbe4 <_Heap_Free+0x40> 4000cbd4: 82 10 20 00 clr %g1 4000cbd8: c2 06 20 24 ld [ %i0 + 0x24 ], %g1 4000cbdc: 80 a0 40 08 cmp %g1, %o0 4000cbe0: 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 ) ) { 4000cbe4: 80 a0 60 00 cmp %g1, 0 4000cbe8: 02 80 00 6b be 4000cd94 <_Heap_Free+0x1f0> 4000cbec: 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; 4000cbf0: f8 02 20 04 ld [ %o0 + 4 ], %i4 4000cbf4: 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); 4000cbf8: 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; 4000cbfc: 80 a0 40 1b cmp %g1, %i3 4000cc00: 0a 80 00 05 bcs 4000cc14 <_Heap_Free+0x70> <== NEVER TAKEN 4000cc04: 86 10 20 00 clr %g3 4000cc08: c6 06 20 24 ld [ %i0 + 0x24 ], %g3 4000cc0c: 80 a0 c0 01 cmp %g3, %g1 4000cc10: 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 ) ) { 4000cc14: 80 a0 e0 00 cmp %g3, 0 4000cc18: 02 80 00 5f be 4000cd94 <_Heap_Free+0x1f0> <== NEVER TAKEN 4000cc1c: 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; 4000cc20: fa 00 60 04 ld [ %g1 + 4 ], %i5 return false; } _Heap_Protection_block_check( heap, next_block ); if ( !_Heap_Is_prev_used( next_block ) ) { 4000cc24: 80 8f 60 01 btst 1, %i5 4000cc28: 22 80 00 5c be,a 4000cd98 <_Heap_Free+0x1f4> <== NEVER TAKEN 4000cc2c: 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 4000cc30: c8 06 20 24 ld [ %i0 + 0x24 ], %g4 && !_Heap_Is_prev_used( _Heap_Block_at( next_block, next_block_size )); 4000cc34: 80 a0 40 04 cmp %g1, %g4 4000cc38: 02 80 00 07 be 4000cc54 <_Heap_Free+0xb0> 4000cc3c: ba 0f 7f fe and %i5, -2, %i5 4000cc40: 86 00 40 1d add %g1, %i5, %g3 4000cc44: f4 00 e0 04 ld [ %g3 + 4 ], %i2 4000cc48: b4 1e a0 01 xor %i2, 1, %i2 4000cc4c: 10 80 00 03 b 4000cc58 <_Heap_Free+0xb4> 4000cc50: b4 0e a0 01 and %i2, 1, %i2 4000cc54: b4 10 20 00 clr %i2 if ( !_Heap_Is_prev_used( block ) ) { 4000cc58: 80 8f 20 01 btst 1, %i4 4000cc5c: 12 80 00 26 bne 4000ccf4 <_Heap_Free+0x150> 4000cc60: 80 8e a0 ff btst 0xff, %i2 uintptr_t const prev_size = block->prev_size; 4000cc64: 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); 4000cc68: 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; 4000cc6c: 80 a0 c0 1b cmp %g3, %i3 4000cc70: 0a 80 00 04 bcs 4000cc80 <_Heap_Free+0xdc> <== NEVER TAKEN 4000cc74: b2 10 20 00 clr %i1 4000cc78: 80 a1 00 03 cmp %g4, %g3 4000cc7c: 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 ) ) { 4000cc80: 80 a6 60 00 cmp %i1, 0 4000cc84: 02 80 00 44 be 4000cd94 <_Heap_Free+0x1f0> <== NEVER TAKEN 4000cc88: 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; 4000cc8c: 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) ) { 4000cc90: 80 8e e0 01 btst 1, %i3 4000cc94: 02 80 00 40 be 4000cd94 <_Heap_Free+0x1f0> <== NEVER TAKEN 4000cc98: 80 8e a0 ff btst 0xff, %i2 _HAssert( false ); return( false ); } if ( next_is_free ) { /* coalesce both */ 4000cc9c: 22 80 00 0f be,a 4000ccd8 <_Heap_Free+0x134> 4000cca0: 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; 4000cca4: c8 00 60 08 ld [ %g1 + 8 ], %g4 Heap_Block *prev = block->prev; 4000cca8: c2 00 60 0c ld [ %g1 + 0xc ], %g1 uintptr_t const size = block_size + prev_size + next_block_size; 4000ccac: ba 00 80 1d add %g2, %i5, %i5 prev->next = next; 4000ccb0: c8 20 60 08 st %g4, [ %g1 + 8 ] next->prev = prev; 4000ccb4: c2 21 20 0c st %g1, [ %g4 + 0xc ] _Heap_Free_list_remove( next_block ); stats->free_blocks -= 1; 4000ccb8: 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; 4000ccbc: b8 07 40 1c add %i5, %i4, %i4 _Heap_Free_list_remove( next_block ); stats->free_blocks -= 1; 4000ccc0: 82 00 7f ff add %g1, -1, %g1 4000ccc4: 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; 4000ccc8: 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; 4000cccc: 82 17 20 01 or %i4, 1, %g1 4000ccd0: 10 80 00 27 b 4000cd6c <_Heap_Free+0x1c8> 4000ccd4: 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; 4000ccd8: 88 17 20 01 or %i4, 1, %g4 4000ccdc: c8 20 e0 04 st %g4, [ %g3 + 4 ] next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED; 4000cce0: c6 00 60 04 ld [ %g1 + 4 ], %g3 next_block->prev_size = size; 4000cce4: 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; 4000cce8: 86 08 ff fe and %g3, -2, %g3 4000ccec: 10 80 00 20 b 4000cd6c <_Heap_Free+0x1c8> 4000ccf0: c6 20 60 04 st %g3, [ %g1 + 4 ] next_block->prev_size = size; } } else if ( next_is_free ) { /* coalesce next */ 4000ccf4: 22 80 00 0d be,a 4000cd28 <_Heap_Free+0x184> 4000ccf8: 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; 4000ccfc: c8 00 60 08 ld [ %g1 + 8 ], %g4 Heap_Block *prev = old_block->prev; 4000cd00: c2 00 60 0c ld [ %g1 + 0xc ], %g1 new_block->next = next; 4000cd04: c8 22 20 08 st %g4, [ %o0 + 8 ] new_block->prev = prev; 4000cd08: c2 22 20 0c st %g1, [ %o0 + 0xc ] uintptr_t const size = block_size + next_block_size; 4000cd0c: 86 07 40 02 add %i5, %g2, %g3 next->prev = new_block; prev->next = new_block; 4000cd10: 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; 4000cd14: d0 21 20 0c st %o0, [ %g4 + 0xc ] _Heap_Free_list_replace( next_block, block ); block->size_and_flag = size | HEAP_PREV_BLOCK_USED; 4000cd18: 82 10 e0 01 or %g3, 1, %g1 next_block = _Heap_Block_at( block, size ); next_block->prev_size = size; 4000cd1c: 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; 4000cd20: 10 80 00 13 b 4000cd6c <_Heap_Free+0x1c8> 4000cd24: c2 22 20 04 st %g1, [ %o0 + 4 ] ) { Heap_Block *next = block_before->next; new_block->next = next; new_block->prev = block_before; 4000cd28: f0 22 20 0c st %i0, [ %o0 + 0xc ] Heap_Block *new_block ) { Heap_Block *next = block_before->next; new_block->next = next; 4000cd2c: c6 22 20 08 st %g3, [ %o0 + 8 ] new_block->prev = block_before; block_before->next = new_block; next->prev = new_block; 4000cd30: 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; 4000cd34: 86 10 a0 01 or %g2, 1, %g3 4000cd38: c6 22 20 04 st %g3, [ %o0 + 4 ] next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED; 4000cd3c: c6 00 60 04 ld [ %g1 + 4 ], %g3 next_block->prev_size = block_size; 4000cd40: 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; 4000cd44: 86 08 ff fe and %g3, -2, %g3 4000cd48: c6 20 60 04 st %g3, [ %g1 + 4 ] next_block->prev_size = block_size; /* Statistics */ ++stats->free_blocks; 4000cd4c: c2 06 20 38 ld [ %i0 + 0x38 ], %g1 if ( stats->max_free_blocks < stats->free_blocks ) { 4000cd50: 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; 4000cd54: 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; 4000cd58: d0 26 20 08 st %o0, [ %i0 + 8 ] if ( stats->max_free_blocks < stats->free_blocks ) { 4000cd5c: 80 a0 c0 01 cmp %g3, %g1 4000cd60: 1a 80 00 03 bcc 4000cd6c <_Heap_Free+0x1c8> 4000cd64: c2 26 20 38 st %g1, [ %i0 + 0x38 ] stats->max_free_blocks = stats->free_blocks; 4000cd68: c2 26 20 3c st %g1, [ %i0 + 0x3c ] } } /* Statistics */ --stats->used_blocks; 4000cd6c: c2 06 20 40 ld [ %i0 + 0x40 ], %g1 4000cd70: 82 00 7f ff add %g1, -1, %g1 4000cd74: c2 26 20 40 st %g1, [ %i0 + 0x40 ] ++stats->frees; 4000cd78: c2 06 20 50 ld [ %i0 + 0x50 ], %g1 4000cd7c: 82 00 60 01 inc %g1 4000cd80: c2 26 20 50 st %g1, [ %i0 + 0x50 ] stats->free_size += block_size; 4000cd84: c2 06 20 30 ld [ %i0 + 0x30 ], %g1 4000cd88: 84 00 40 02 add %g1, %g2, %g2 4000cd8c: 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; 4000cd90: 88 10 20 01 mov 1, %g4 --stats->used_blocks; ++stats->frees; stats->free_size += block_size; return( true ); } 4000cd94: b0 09 20 01 and %g4, 1, %i0 4000cd98: 81 c7 e0 08 ret 4000cd9c: 81 e8 00 00 restore =============================================================================== 40009e6c <_Heap_Greedy_allocate>: Heap_Block *_Heap_Greedy_allocate( Heap_Control *heap, const uintptr_t *block_sizes, size_t block_count ) { 40009e6c: 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) { 40009e70: b6 10 20 00 clr %i3 Heap_Block *_Heap_Greedy_allocate( Heap_Control *heap, const uintptr_t *block_sizes, size_t block_count ) { 40009e74: 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) { 40009e78: 10 80 00 11 b 40009ebc <_Heap_Greedy_allocate+0x50> 40009e7c: 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 ); 40009e80: d2 06 40 01 ld [ %i1 + %g1 ], %o1 40009e84: 90 10 00 1d mov %i5, %o0 40009e88: 94 10 20 00 clr %o2 40009e8c: 40 00 1d 02 call 40011294 <_Heap_Allocate_aligned_with_boundary> 40009e90: 96 10 20 00 clr %o3 void *next = _Heap_Allocate( heap, block_sizes [i] ); if ( next != NULL ) { 40009e94: 82 92 20 00 orcc %o0, 0, %g1 40009e98: 22 80 00 09 be,a 40009ebc <_Heap_Greedy_allocate+0x50> <== NEVER TAKEN 40009e9c: 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); 40009ea0: d2 07 60 10 ld [ %i5 + 0x10 ], %o1 40009ea4: 40 00 34 08 call 40016ec4 <.urem> 40009ea8: 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); 40009eac: 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; 40009eb0: f8 22 20 08 st %i4, [ %o0 + 8 ] 40009eb4: 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) { 40009eb8: b6 06 e0 01 inc %i3 40009ebc: 80 a6 c0 1a cmp %i3, %i2 40009ec0: 12 bf ff f0 bne 40009e80 <_Heap_Greedy_allocate+0x14> 40009ec4: 83 2e e0 02 sll %i3, 2, %g1 40009ec8: 10 80 00 0a b 40009ef0 <_Heap_Greedy_allocate+0x84> 40009ecc: b0 10 20 00 clr %i0 allocated_blocks = next_block; } } while ( (current = _Heap_Free_list_first( heap )) != free_list_tail ) { _Heap_Block_allocate( 40009ed0: 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; 40009ed4: 96 0a ff fe and %o3, -2, %o3 40009ed8: 92 10 00 1b mov %i3, %o1 40009edc: 94 06 e0 08 add %i3, 8, %o2 40009ee0: 40 00 00 cb call 4000a20c <_Heap_Block_allocate> 40009ee4: 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; 40009ee8: f0 26 e0 08 st %i0, [ %i3 + 8 ] 40009eec: 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; 40009ef0: 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 ) { 40009ef4: 80 a6 c0 1d cmp %i3, %i5 40009ef8: 32 bf ff f6 bne,a 40009ed0 <_Heap_Greedy_allocate+0x64> 40009efc: d6 06 e0 04 ld [ %i3 + 4 ], %o3 current->next = blocks; blocks = current; } while ( allocated_blocks != NULL ) { 40009f00: 10 80 00 07 b 40009f1c <_Heap_Greedy_allocate+0xb0> 40009f04: 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 ) ); 40009f08: 92 07 20 08 add %i4, 8, %o1 40009f0c: 90 10 00 1d mov %i5, %o0 40009f10: 40 00 1d 52 call 40011458 <_Heap_Free> 40009f14: b8 10 00 1b mov %i3, %i4 current->next = blocks; blocks = current; } while ( allocated_blocks != NULL ) { 40009f18: 80 a7 20 00 cmp %i4, 0 40009f1c: 32 bf ff fb bne,a 40009f08 <_Heap_Greedy_allocate+0x9c> 40009f20: 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; } 40009f24: 81 c7 e0 08 ret 40009f28: 81 e8 00 00 restore =============================================================================== 40012608 <_Heap_Iterate>: void _Heap_Iterate( Heap_Control *heap, Heap_Block_visitor visitor, void *visitor_arg ) { 40012608: 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; 4001260c: 90 10 20 00 clr %o0 <== NOT EXECUTED Heap_Control *heap, Heap_Block_visitor visitor, void *visitor_arg ) { Heap_Block *current = heap->first_block; 40012610: c2 06 20 20 ld [ %i0 + 0x20 ], %g1 <== NOT EXECUTED Heap_Block *end = heap->last_block; bool stop = false; while ( !stop && current != end ) { 40012614: 10 80 00 0a b 4001263c <_Heap_Iterate+0x34> <== NOT EXECUTED 40012618: 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 ); 4001261c: 90 10 00 01 mov %g1, %o0 <== NOT EXECUTED 40012620: 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); 40012624: 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; 40012628: d4 07 60 04 ld [ %i5 + 4 ], %o2 <== NOT EXECUTED 4001262c: 96 10 00 1a mov %i2, %o3 <== NOT EXECUTED 40012630: 9f c6 40 00 call %i1 <== NOT EXECUTED 40012634: 94 0a a0 01 and %o2, 1, %o2 <== NOT EXECUTED 40012638: 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 ) { 4001263c: 80 a0 40 1c cmp %g1, %i4 <== NOT EXECUTED 40012640: 02 80 00 05 be 40012654 <_Heap_Iterate+0x4c> <== NOT EXECUTED 40012644: 90 1a 20 01 xor %o0, 1, %o0 <== NOT EXECUTED 40012648: 80 8a 20 ff btst 0xff, %o0 <== NOT EXECUTED 4001264c: 32 bf ff f4 bne,a 4001261c <_Heap_Iterate+0x14> <== NOT EXECUTED 40012650: d2 00 60 04 ld [ %g1 + 4 ], %o1 <== NOT EXECUTED 40012654: 81 c7 e0 08 ret <== NOT EXECUTED 40012658: 81 e8 00 00 restore <== NOT EXECUTED =============================================================================== 4001b440 <_Heap_Size_of_alloc_area>: bool _Heap_Size_of_alloc_area( Heap_Control *heap, void *alloc_begin_ptr, uintptr_t *alloc_size ) { 4001b440: 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); 4001b444: d2 06 20 10 ld [ %i0 + 0x10 ], %o1 4001b448: 7f ff f2 a4 call 40017ed8 <.urem> 4001b44c: 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 4001b450: 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); 4001b454: 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); 4001b458: 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; 4001b45c: 80 a2 00 04 cmp %o0, %g4 4001b460: 0a 80 00 05 bcs 4001b474 <_Heap_Size_of_alloc_area+0x34> 4001b464: 82 10 20 00 clr %g1 4001b468: c2 06 20 24 ld [ %i0 + 0x24 ], %g1 4001b46c: 80 a0 40 08 cmp %g1, %o0 4001b470: 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 ) ) { 4001b474: 80 a0 60 00 cmp %g1, 0 4001b478: 02 80 00 15 be 4001b4cc <_Heap_Size_of_alloc_area+0x8c> 4001b47c: 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; 4001b480: c2 02 20 04 ld [ %o0 + 4 ], %g1 4001b484: 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); 4001b488: 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; 4001b48c: 80 a0 40 04 cmp %g1, %g4 4001b490: 0a 80 00 05 bcs 4001b4a4 <_Heap_Size_of_alloc_area+0x64> <== NEVER TAKEN 4001b494: 84 10 20 00 clr %g2 4001b498: c4 06 20 24 ld [ %i0 + 0x24 ], %g2 4001b49c: 80 a0 80 01 cmp %g2, %g1 4001b4a0: 84 60 3f ff subx %g0, -1, %g2 } block_size = _Heap_Block_size( block ); next_block = _Heap_Block_at( block, block_size ); if ( 4001b4a4: 80 a0 a0 00 cmp %g2, 0 4001b4a8: 02 80 00 09 be 4001b4cc <_Heap_Size_of_alloc_area+0x8c> <== NEVER TAKEN 4001b4ac: 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; 4001b4b0: c4 00 60 04 ld [ %g1 + 4 ], %g2 !_Heap_Is_block_in_heap( heap, next_block ) || !_Heap_Is_prev_used( next_block ) 4001b4b4: 80 88 a0 01 btst 1, %g2 4001b4b8: 02 80 00 05 be 4001b4cc <_Heap_Size_of_alloc_area+0x8c> <== NEVER TAKEN 4001b4bc: 82 20 40 19 sub %g1, %i1, %g1 return false; } *alloc_size = (uintptr_t) next_block + HEAP_ALLOC_BONUS - alloc_begin; return true; 4001b4c0: 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; 4001b4c4: 82 00 60 04 add %g1, 4, %g1 4001b4c8: c2 26 80 00 st %g1, [ %i2 ] return true; } 4001b4cc: b0 08 e0 01 and %g3, 1, %i0 4001b4d0: 81 c7 e0 08 ret 4001b4d4: 81 e8 00 00 restore =============================================================================== 40008c6c <_Heap_Walk>: bool _Heap_Walk( Heap_Control *heap, int source, bool dump ) { 40008c6c: 9d e3 bf 80 save %sp, -128, %sp 40008c70: ac 10 00 19 mov %i1, %l6 uintptr_t const page_size = heap->page_size; 40008c74: f8 06 20 10 ld [ %i0 + 0x10 ], %i4 uintptr_t const min_block_size = heap->min_block_size; 40008c78: f6 06 20 14 ld [ %i0 + 0x14 ], %i3 Heap_Block *const first_block = heap->first_block; 40008c7c: 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; 40008c80: 80 a6 a0 00 cmp %i2, 0 40008c84: 02 80 00 05 be 40008c98 <_Heap_Walk+0x2c> 40008c88: e0 06 20 24 ld [ %i0 + 0x24 ], %l0 40008c8c: 3b 10 00 23 sethi %hi(0x40008c00), %i5 40008c90: 10 80 00 04 b 40008ca0 <_Heap_Walk+0x34> 40008c94: ba 17 60 1c or %i5, 0x1c, %i5 ! 40008c1c <_Heap_Walk_print> 40008c98: 3b 10 00 23 sethi %hi(0x40008c00), %i5 40008c9c: ba 17 60 14 or %i5, 0x14, %i5 ! 40008c14 <_Heap_Walk_print_nothing> if ( !_System_state_Is_up( _System_state_Get() ) ) { 40008ca0: 05 10 00 61 sethi %hi(0x40018400), %g2 40008ca4: c4 00 a3 48 ld [ %g2 + 0x348 ], %g2 ! 40018748 <_System_state_Current> 40008ca8: 80 a0 a0 03 cmp %g2, 3 40008cac: 22 80 00 04 be,a 40008cbc <_Heap_Walk+0x50> 40008cb0: c4 06 20 1c ld [ %i0 + 0x1c ], %g2 return true; 40008cb4: 10 80 01 2a b 4000915c <_Heap_Walk+0x4f0> 40008cb8: 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)( 40008cbc: da 06 20 18 ld [ %i0 + 0x18 ], %o5 40008cc0: c4 23 a0 5c st %g2, [ %sp + 0x5c ] 40008cc4: f2 23 a0 60 st %i1, [ %sp + 0x60 ] 40008cc8: e0 23 a0 64 st %l0, [ %sp + 0x64 ] 40008ccc: c4 06 20 08 ld [ %i0 + 8 ], %g2 40008cd0: 90 10 00 16 mov %l6, %o0 40008cd4: c4 23 a0 68 st %g2, [ %sp + 0x68 ] 40008cd8: c4 06 20 0c ld [ %i0 + 0xc ], %g2 40008cdc: 92 10 20 00 clr %o1 40008ce0: c4 23 a0 6c st %g2, [ %sp + 0x6c ] 40008ce4: 15 10 00 56 sethi %hi(0x40015800), %o2 40008ce8: 96 10 00 1c mov %i4, %o3 40008cec: 94 12 a1 08 or %o2, 0x108, %o2 40008cf0: 9f c7 40 00 call %i5 40008cf4: 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 ) { 40008cf8: 80 a7 20 00 cmp %i4, 0 40008cfc: 12 80 00 07 bne 40008d18 <_Heap_Walk+0xac> 40008d00: 80 8f 20 07 btst 7, %i4 (*printer)( source, true, "page size is zero\n" ); 40008d04: 15 10 00 56 sethi %hi(0x40015800), %o2 40008d08: 90 10 00 16 mov %l6, %o0 40008d0c: 92 10 20 01 mov 1, %o1 40008d10: 10 80 00 37 b 40008dec <_Heap_Walk+0x180> 40008d14: 94 12 a1 a0 or %o2, 0x1a0, %o2 return false; } if ( !_Addresses_Is_aligned( (void *) page_size ) ) { 40008d18: 22 80 00 08 be,a 40008d38 <_Heap_Walk+0xcc> 40008d1c: 90 10 00 1b mov %i3, %o0 (*printer)( 40008d20: 15 10 00 56 sethi %hi(0x40015800), %o2 40008d24: 90 10 00 16 mov %l6, %o0 40008d28: 92 10 20 01 mov 1, %o1 40008d2c: 94 12 a1 b8 or %o2, 0x1b8, %o2 40008d30: 10 80 01 12 b 40009178 <_Heap_Walk+0x50c> 40008d34: 96 10 00 1c mov %i4, %o3 RTEMS_INLINE_ROUTINE bool _Heap_Is_aligned( uintptr_t value, uintptr_t alignment ) { return (value % alignment) == 0; 40008d38: 7f ff e3 93 call 40001b84 <.urem> 40008d3c: 92 10 00 1c mov %i4, %o1 ); return false; } if ( !_Heap_Is_aligned( min_block_size, page_size ) ) { 40008d40: 80 a2 20 00 cmp %o0, 0 40008d44: 22 80 00 08 be,a 40008d64 <_Heap_Walk+0xf8> 40008d48: 90 06 60 08 add %i1, 8, %o0 (*printer)( 40008d4c: 15 10 00 56 sethi %hi(0x40015800), %o2 40008d50: 90 10 00 16 mov %l6, %o0 40008d54: 92 10 20 01 mov 1, %o1 40008d58: 94 12 a1 d8 or %o2, 0x1d8, %o2 40008d5c: 10 80 01 07 b 40009178 <_Heap_Walk+0x50c> 40008d60: 96 10 00 1b mov %i3, %o3 40008d64: 7f ff e3 88 call 40001b84 <.urem> 40008d68: 92 10 00 1c mov %i4, %o1 ); return false; } if ( 40008d6c: 80 a2 20 00 cmp %o0, 0 40008d70: 22 80 00 07 be,a 40008d8c <_Heap_Walk+0x120> 40008d74: c4 06 60 04 ld [ %i1 + 4 ], %g2 !_Heap_Is_aligned( _Heap_Alloc_area_of_block( first_block ), page_size ) ) { (*printer)( 40008d78: 15 10 00 56 sethi %hi(0x40015800), %o2 40008d7c: 90 10 00 16 mov %l6, %o0 40008d80: 92 10 20 01 mov 1, %o1 40008d84: 10 80 00 fc b 40009174 <_Heap_Walk+0x508> 40008d88: 94 12 a2 00 or %o2, 0x200, %o2 ); return false; } if ( !_Heap_Is_prev_used( first_block ) ) { 40008d8c: 80 88 a0 01 btst 1, %g2 40008d90: 32 80 00 07 bne,a 40008dac <_Heap_Walk+0x140> 40008d94: f4 04 20 04 ld [ %l0 + 4 ], %i2 (*printer)( 40008d98: 15 10 00 56 sethi %hi(0x40015800), %o2 40008d9c: 90 10 00 16 mov %l6, %o0 40008da0: 92 10 20 01 mov 1, %o1 40008da4: 10 80 00 12 b 40008dec <_Heap_Walk+0x180> 40008da8: 94 12 a2 38 or %o2, 0x238, %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; 40008dac: 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); 40008db0: 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; 40008db4: c4 06 a0 04 ld [ %i2 + 4 ], %g2 ); return false; } if ( _Heap_Is_free( last_block ) ) { 40008db8: 80 88 a0 01 btst 1, %g2 40008dbc: 12 80 00 07 bne 40008dd8 <_Heap_Walk+0x16c> 40008dc0: 80 a6 80 19 cmp %i2, %i1 (*printer)( 40008dc4: 15 10 00 56 sethi %hi(0x40015800), %o2 40008dc8: 90 10 00 16 mov %l6, %o0 40008dcc: 92 10 20 01 mov 1, %o1 40008dd0: 10 80 00 07 b 40008dec <_Heap_Walk+0x180> 40008dd4: 94 12 a2 68 or %o2, 0x268, %o2 ); return false; } if ( 40008dd8: 02 80 00 0a be 40008e00 <_Heap_Walk+0x194> 40008ddc: 15 10 00 56 sethi %hi(0x40015800), %o2 _Heap_Block_at( last_block, _Heap_Block_size( last_block ) ) != first_block ) { (*printer)( 40008de0: 90 10 00 16 mov %l6, %o0 40008de4: 92 10 20 01 mov 1, %o1 40008de8: 94 12 a2 80 or %o2, 0x280, %o2 40008dec: 9f c7 40 00 call %i5 40008df0: b0 10 20 00 clr %i0 40008df4: b0 0e 20 ff and %i0, 0xff, %i0 40008df8: 81 c7 e0 08 ret 40008dfc: 81 e8 00 00 restore int source, Heap_Walk_printer printer, Heap_Control *heap ) { uintptr_t const page_size = heap->page_size; 40008e00: 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; 40008e04: d6 06 20 08 ld [ %i0 + 8 ], %o3 const Heap_Block *const free_list_tail = _Heap_Free_list_tail( heap ); 40008e08: 10 80 00 30 b 40008ec8 <_Heap_Walk+0x25c> 40008e0c: 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; 40008e10: 80 a0 c0 0b cmp %g3, %o3 40008e14: 18 80 00 05 bgu 40008e28 <_Heap_Walk+0x1bc> 40008e18: 84 10 20 00 clr %g2 40008e1c: c4 06 20 24 ld [ %i0 + 0x24 ], %g2 40008e20: 80 a0 80 0b cmp %g2, %o3 40008e24: 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 ) ) { 40008e28: 80 a0 a0 00 cmp %g2, 0 40008e2c: 32 80 00 07 bne,a 40008e48 <_Heap_Walk+0x1dc> 40008e30: 90 02 e0 08 add %o3, 8, %o0 (*printer)( 40008e34: 15 10 00 56 sethi %hi(0x40015800), %o2 40008e38: 90 10 00 16 mov %l6, %o0 40008e3c: 92 10 20 01 mov 1, %o1 40008e40: 10 80 00 ce b 40009178 <_Heap_Walk+0x50c> 40008e44: 94 12 a2 b0 or %o2, 0x2b0, %o2 RTEMS_INLINE_ROUTINE bool _Heap_Is_aligned( uintptr_t value, uintptr_t alignment ) { return (value % alignment) == 0; 40008e48: d6 27 bf fc st %o3, [ %fp + -4 ] 40008e4c: 7f ff e3 4e call 40001b84 <.urem> 40008e50: 92 10 00 11 mov %l1, %o1 ); return false; } if ( 40008e54: 80 a2 20 00 cmp %o0, 0 40008e58: 02 80 00 07 be 40008e74 <_Heap_Walk+0x208> 40008e5c: d6 07 bf fc ld [ %fp + -4 ], %o3 !_Heap_Is_aligned( _Heap_Alloc_area_of_block( free_block ), page_size ) ) { (*printer)( 40008e60: 15 10 00 56 sethi %hi(0x40015800), %o2 40008e64: 90 10 00 16 mov %l6, %o0 40008e68: 92 10 20 01 mov 1, %o1 40008e6c: 10 80 00 c3 b 40009178 <_Heap_Walk+0x50c> 40008e70: 94 12 a2 d0 or %o2, 0x2d0, %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; 40008e74: c4 02 e0 04 ld [ %o3 + 4 ], %g2 40008e78: 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; 40008e7c: 84 02 c0 02 add %o3, %g2, %g2 40008e80: c4 00 a0 04 ld [ %g2 + 4 ], %g2 ); return false; } if ( _Heap_Is_used( free_block ) ) { 40008e84: 80 88 a0 01 btst 1, %g2 40008e88: 22 80 00 07 be,a 40008ea4 <_Heap_Walk+0x238> 40008e8c: d8 02 e0 0c ld [ %o3 + 0xc ], %o4 (*printer)( 40008e90: 15 10 00 56 sethi %hi(0x40015800), %o2 40008e94: 90 10 00 16 mov %l6, %o0 40008e98: 92 10 20 01 mov 1, %o1 40008e9c: 10 80 00 b7 b 40009178 <_Heap_Walk+0x50c> 40008ea0: 94 12 a3 00 or %o2, 0x300, %o2 ); return false; } if ( free_block->prev != prev_block ) { 40008ea4: 80 a3 00 19 cmp %o4, %i1 40008ea8: 02 80 00 07 be 40008ec4 <_Heap_Walk+0x258> 40008eac: b2 10 00 0b mov %o3, %i1 (*printer)( 40008eb0: 15 10 00 56 sethi %hi(0x40015800), %o2 40008eb4: 90 10 00 16 mov %l6, %o0 40008eb8: 92 10 20 01 mov 1, %o1 40008ebc: 10 80 00 4d b 40008ff0 <_Heap_Walk+0x384> 40008ec0: 94 12 a3 20 or %o2, 0x320, %o2 return false; } prev_block = free_block; free_block = free_block->next; 40008ec4: 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 ) { 40008ec8: 80 a2 c0 18 cmp %o3, %i0 40008ecc: 32 bf ff d1 bne,a 40008e10 <_Heap_Walk+0x1a4> 40008ed0: 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)( 40008ed4: 2b 10 00 57 sethi %hi(0x40015c00), %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 ) { 40008ed8: 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)( 40008edc: aa 15 60 20 or %l5, 0x20, %l5 " (= first free)" : (block->prev == free_list_head ? " (= head)" : ""), block->next, block->next == last_free_block ? " (= last free)" : (block->next == free_list_tail ? " (= tail)" : "") 40008ee0: 23 10 00 57 sethi %hi(0x40015c00), %l1 40008ee4: 2f 10 00 56 sethi %hi(0x40015800), %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; 40008ee8: 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; 40008eec: 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; 40008ef0: 9e 1e 40 10 xor %i1, %l0, %o7 40008ef4: 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; 40008ef8: a8 0c bf fe and %l2, -2, %l4 40008efc: 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); 40008f00: 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; 40008f04: 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; 40008f08: 80 a3 00 13 cmp %o4, %l3 40008f0c: 18 80 00 05 bgu 40008f20 <_Heap_Walk+0x2b4> <== NEVER TAKEN 40008f10: 9e 10 20 00 clr %o7 40008f14: de 06 20 24 ld [ %i0 + 0x24 ], %o7 40008f18: 80 a3 c0 13 cmp %o7, %l3 40008f1c: 9e 60 3f ff subx %g0, -1, %o7 if ( !_Heap_Is_block_in_heap( heap, next_block ) ) { 40008f20: 80 a3 e0 00 cmp %o7, 0 40008f24: 32 80 00 07 bne,a 40008f40 <_Heap_Walk+0x2d4> 40008f28: da 27 bf f8 st %o5, [ %fp + -8 ] (*printer)( 40008f2c: 15 10 00 56 sethi %hi(0x40015800), %o2 40008f30: 90 10 00 16 mov %l6, %o0 40008f34: 92 10 20 01 mov 1, %o1 40008f38: 10 80 00 2c b 40008fe8 <_Heap_Walk+0x37c> 40008f3c: 94 12 a3 58 or %o2, 0x358, %o2 RTEMS_INLINE_ROUTINE bool _Heap_Is_aligned( uintptr_t value, uintptr_t alignment ) { return (value % alignment) == 0; 40008f40: 90 10 00 14 mov %l4, %o0 40008f44: 7f ff e3 10 call 40001b84 <.urem> 40008f48: 92 10 00 1c mov %i4, %o1 40008f4c: da 07 bf f8 ld [ %fp + -8 ], %o5 ); return false; } if ( !_Heap_Is_aligned( block_size, page_size ) && is_not_last_block ) { 40008f50: 80 a2 20 00 cmp %o0, 0 40008f54: 02 80 00 0c be 40008f84 <_Heap_Walk+0x318> 40008f58: 9e 0b 60 ff and %o5, 0xff, %o7 40008f5c: 80 a3 e0 00 cmp %o7, 0 40008f60: 02 80 00 19 be 40008fc4 <_Heap_Walk+0x358> 40008f64: 80 a6 40 13 cmp %i1, %l3 (*printer)( 40008f68: 15 10 00 56 sethi %hi(0x40015800), %o2 40008f6c: 90 10 00 16 mov %l6, %o0 40008f70: 92 10 20 01 mov 1, %o1 40008f74: 94 12 a3 88 or %o2, 0x388, %o2 40008f78: 96 10 00 19 mov %i1, %o3 40008f7c: 10 80 00 1d b 40008ff0 <_Heap_Walk+0x384> 40008f80: 98 10 00 14 mov %l4, %o4 ); return false; } if ( block_size < min_block_size && is_not_last_block ) { 40008f84: 80 a3 e0 00 cmp %o7, 0 40008f88: 02 80 00 0f be 40008fc4 <_Heap_Walk+0x358> 40008f8c: 80 a6 40 13 cmp %i1, %l3 40008f90: 80 a5 00 1b cmp %l4, %i3 40008f94: 1a 80 00 0c bcc 40008fc4 <_Heap_Walk+0x358> 40008f98: 80 a6 40 13 cmp %i1, %l3 (*printer)( 40008f9c: 90 10 00 16 mov %l6, %o0 40008fa0: 92 10 20 01 mov 1, %o1 40008fa4: 15 10 00 56 sethi %hi(0x40015800), %o2 40008fa8: 96 10 00 19 mov %i1, %o3 40008fac: 94 12 a3 b8 or %o2, 0x3b8, %o2 40008fb0: 98 10 00 14 mov %l4, %o4 40008fb4: 9f c7 40 00 call %i5 40008fb8: 9a 10 00 1b mov %i3, %o5 "block 0x%08x: next block 0x%08x is not a successor\n", block, next_block ); return false; 40008fbc: 10 80 00 68 b 4000915c <_Heap_Walk+0x4f0> 40008fc0: b0 10 20 00 clr %i0 ); return false; } if ( next_block_begin <= block_begin && is_not_last_block ) { 40008fc4: 2a 80 00 10 bcs,a 40009004 <_Heap_Walk+0x398> 40008fc8: de 04 e0 04 ld [ %l3 + 4 ], %o7 40008fcc: 80 8b 60 ff btst 0xff, %o5 40008fd0: 22 80 00 0d be,a 40009004 <_Heap_Walk+0x398> 40008fd4: de 04 e0 04 ld [ %l3 + 4 ], %o7 (*printer)( 40008fd8: 15 10 00 56 sethi %hi(0x40015800), %o2 40008fdc: 90 10 00 16 mov %l6, %o0 40008fe0: 92 10 20 01 mov 1, %o1 40008fe4: 94 12 a3 e8 or %o2, 0x3e8, %o2 40008fe8: 96 10 00 19 mov %i1, %o3 40008fec: 98 10 00 13 mov %l3, %o4 40008ff0: 9f c7 40 00 call %i5 40008ff4: b0 10 20 00 clr %i0 40008ff8: b0 0e 20 ff and %i0, 0xff, %i0 40008ffc: 81 c7 e0 08 ret 40009000: 81 e8 00 00 restore ); return false; } if ( !_Heap_Is_prev_used( next_block ) ) { 40009004: 80 8b e0 01 btst 1, %o7 40009008: 12 80 00 3f bne 40009104 <_Heap_Walk+0x498> 4000900c: 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 ? 40009010: 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)( 40009014: d8 06 20 08 ld [ %i0 + 8 ], %o4 40009018: 80 a3 40 0c cmp %o5, %o4 4000901c: 02 80 00 08 be 4000903c <_Heap_Walk+0x3d0> 40009020: 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)" : ""), 40009024: 80 a3 40 18 cmp %o5, %i0 40009028: 12 80 00 07 bne 40009044 <_Heap_Walk+0x3d8> 4000902c: 96 14 60 90 or %l1, 0x90, %o3 40009030: 17 10 00 56 sethi %hi(0x40015800), %o3 40009034: 10 80 00 04 b 40009044 <_Heap_Walk+0x3d8> 40009038: 96 12 e0 d8 or %o3, 0xd8, %o3 ! 400158d8 <__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)( 4000903c: 03 10 00 56 sethi %hi(0x40015800), %g1 40009040: 96 10 60 c8 or %g1, 0xc8, %o3 ! 400158c8 <__log2table+0x120> block->prev, block->prev == first_free_block ? " (= first free)" : (block->prev == free_list_head ? " (= head)" : ""), block->next, block->next == last_free_block ? 40009044: 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)( 40009048: 80 a3 00 0f cmp %o4, %o7 4000904c: 02 80 00 06 be 40009064 <_Heap_Walk+0x3f8> 40009050: 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)" : "") 40009054: 12 80 00 06 bne 4000906c <_Heap_Walk+0x400> 40009058: 9e 14 60 90 or %l1, 0x90, %o7 4000905c: 10 80 00 04 b 4000906c <_Heap_Walk+0x400> 40009060: 9e 15 e0 f8 or %l7, 0xf8, %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)( 40009064: 03 10 00 56 sethi %hi(0x40015800), %g1 40009068: 9e 10 60 e8 or %g1, 0xe8, %o7 ! 400158e8 <__log2table+0x140> 4000906c: d6 23 a0 5c st %o3, [ %sp + 0x5c ] 40009070: d8 23 a0 60 st %o4, [ %sp + 0x60 ] 40009074: de 23 a0 64 st %o7, [ %sp + 0x64 ] 40009078: 90 10 00 16 mov %l6, %o0 4000907c: 92 10 20 00 clr %o1 40009080: 94 10 00 15 mov %l5, %o2 40009084: 96 10 00 19 mov %i1, %o3 40009088: 9f c7 40 00 call %i5 4000908c: 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 ) { 40009090: da 04 c0 00 ld [ %l3 ], %o5 40009094: 80 a5 00 0d cmp %l4, %o5 40009098: 02 80 00 0c be 400090c8 <_Heap_Walk+0x45c> 4000909c: 80 a4 a0 00 cmp %l2, 0 (*printer)( 400090a0: e6 23 a0 5c st %l3, [ %sp + 0x5c ] 400090a4: 90 10 00 16 mov %l6, %o0 400090a8: 92 10 20 01 mov 1, %o1 400090ac: 15 10 00 57 sethi %hi(0x40015c00), %o2 400090b0: 96 10 00 19 mov %i1, %o3 400090b4: 94 12 a0 58 or %o2, 0x58, %o2 400090b8: 9f c7 40 00 call %i5 400090bc: 98 10 00 14 mov %l4, %o4 "block 0x%08x: next block 0x%08x is not a successor\n", block, next_block ); return false; 400090c0: 10 bf ff ce b 40008ff8 <_Heap_Walk+0x38c> 400090c4: b0 10 20 00 clr %i0 ); return false; } if ( !prev_used ) { 400090c8: 32 80 00 0a bne,a 400090f0 <_Heap_Walk+0x484> 400090cc: c6 06 20 08 ld [ %i0 + 8 ], %g3 (*printer)( 400090d0: 15 10 00 57 sethi %hi(0x40015c00), %o2 400090d4: 90 10 00 16 mov %l6, %o0 400090d8: 92 10 20 01 mov 1, %o1 400090dc: 10 80 00 26 b 40009174 <_Heap_Walk+0x508> 400090e0: 94 12 a0 98 or %o2, 0x98, %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 ) { 400090e4: 22 80 00 19 be,a 40009148 <_Heap_Walk+0x4dc> 400090e8: b2 10 00 13 mov %l3, %i1 return true; } free_block = free_block->next; 400090ec: 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 ) { 400090f0: 80 a0 c0 18 cmp %g3, %i0 400090f4: 12 bf ff fc bne 400090e4 <_Heap_Walk+0x478> 400090f8: 80 a0 c0 19 cmp %g3, %i1 return false; } if ( !_Heap_Walk_is_in_free_list( heap, block ) ) { (*printer)( 400090fc: 10 80 00 1b b 40009168 <_Heap_Walk+0x4fc> 40009100: 15 10 00 57 sethi %hi(0x40015c00), %o2 if ( !_Heap_Is_prev_used( next_block ) ) { if ( !_Heap_Walk_check_free_block( source, printer, heap, block ) ) { return false; } } else if (prev_used) { 40009104: 80 a4 a0 00 cmp %l2, 0 40009108: 02 80 00 09 be 4000912c <_Heap_Walk+0x4c0> 4000910c: 92 10 20 00 clr %o1 (*printer)( 40009110: 15 10 00 57 sethi %hi(0x40015c00), %o2 40009114: 96 10 00 19 mov %i1, %o3 40009118: 94 12 a0 c8 or %o2, 0xc8, %o2 4000911c: 9f c7 40 00 call %i5 40009120: 98 10 00 14 mov %l4, %o4 40009124: 10 80 00 09 b 40009148 <_Heap_Walk+0x4dc> 40009128: b2 10 00 13 mov %l3, %i1 "block 0x%08x: size %u\n", block, block_size ); } else { (*printer)( 4000912c: da 06 40 00 ld [ %i1 ], %o5 40009130: 15 10 00 57 sethi %hi(0x40015c00), %o2 40009134: 96 10 00 19 mov %i1, %o3 40009138: 94 12 a0 e0 or %o2, 0xe0, %o2 4000913c: 9f c7 40 00 call %i5 40009140: 98 10 00 14 mov %l4, %o4 40009144: b2 10 00 13 mov %l3, %i1 block->prev_size ); } block = next_block; } while ( block != first_block ); 40009148: 80 a4 c0 1a cmp %l3, %i2 4000914c: 32 bf ff 68 bne,a 40008eec <_Heap_Walk+0x280> 40009150: e4 06 60 04 ld [ %i1 + 4 ], %l2 40009154: 10 80 00 02 b 4000915c <_Heap_Walk+0x4f0> 40009158: b0 10 20 01 mov 1, %i0 4000915c: b0 0e 20 ff and %i0, 0xff, %i0 40009160: 81 c7 e0 08 ret 40009164: 81 e8 00 00 restore return false; } if ( !_Heap_Walk_is_in_free_list( heap, block ) ) { (*printer)( 40009168: 90 10 00 16 mov %l6, %o0 4000916c: 92 10 20 01 mov 1, %o1 40009170: 94 12 a1 08 or %o2, 0x108, %o2 40009174: 96 10 00 19 mov %i1, %o3 40009178: 9f c7 40 00 call %i5 4000917c: b0 10 20 00 clr %i0 40009180: b0 0e 20 ff and %i0, 0xff, %i0 40009184: 81 c7 e0 08 ret 40009188: 81 e8 00 00 restore =============================================================================== 400083a8 <_Internal_error_Occurred>: void _Internal_error_Occurred( Internal_errors_Source the_source, bool is_internal, Internal_errors_t the_error ) { 400083a8: 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 ); 400083ac: 13 10 00 28 sethi %hi(0x4000a000), %o1 400083b0: 90 07 bf f4 add %fp, -12, %o0 400083b4: 92 12 63 30 or %o1, 0x330, %o1 Internal_errors_Source source, bool is_internal, Internal_errors_t error ) { User_extensions_Fatal_context ctx = { source, is_internal, error }; 400083b8: f0 27 bf f4 st %i0, [ %fp + -12 ] 400083bc: f2 2f bf f8 stb %i1, [ %fp + -8 ] _User_extensions_Iterate( &ctx, _User_extensions_Fatal_visitor ); 400083c0: 40 00 07 e7 call 4000a35c <_User_extensions_Iterate> 400083c4: 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; 400083c8: 05 10 00 79 sethi %hi(0x4001e400), %g2 <== NOT EXECUTED 400083cc: 82 10 a2 fc or %g2, 0x2fc, %g1 ! 4001e6fc <_Internal_errors_What_happened><== NOT EXECUTED 400083d0: f0 20 a2 fc st %i0, [ %g2 + 0x2fc ] <== NOT EXECUTED _Internal_errors_What_happened.is_internal = is_internal; 400083d4: f2 28 60 04 stb %i1, [ %g1 + 4 ] <== NOT EXECUTED _Internal_errors_What_happened.the_error = the_error; 400083d8: 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; 400083dc: 84 10 20 05 mov 5, %g2 <== NOT EXECUTED 400083e0: 03 10 00 79 sethi %hi(0x4001e400), %g1 <== NOT EXECUTED _System_state_Set( SYSTEM_STATE_FAILED ); _CPU_Fatal_halt( the_error ); 400083e4: 7f ff e7 31 call 400020a8 <== NOT EXECUTED 400083e8: c4 20 63 08 st %g2, [ %g1 + 0x308 ] ! 4001e708 <_System_state_Current><== NOT EXECUTED 400083ec: 82 10 00 08 mov %o0, %g1 <== NOT EXECUTED 400083f0: 30 80 00 00 b,a 400083f0 <_Internal_error_Occurred+0x48> <== NOT EXECUTED =============================================================================== 4000845c <_Objects_Allocate>: #endif Objects_Control *_Objects_Allocate( Objects_Information *information ) { 4000845c: 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 ) 40008460: c2 06 20 18 ld [ %i0 + 0x18 ], %g1 40008464: 80 a0 60 00 cmp %g1, 0 40008468: 12 80 00 04 bne 40008478 <_Objects_Allocate+0x1c> <== ALWAYS TAKEN 4000846c: ba 10 00 18 mov %i0, %i5 return NULL; 40008470: 81 c7 e0 08 ret 40008474: 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 ); 40008478: b8 06 20 20 add %i0, 0x20, %i4 4000847c: 7f ff fd 85 call 40007a90 <_Chain_Get> 40008480: 90 10 00 1c mov %i4, %o0 if ( information->auto_extend ) { 40008484: c2 0f 60 12 ldub [ %i5 + 0x12 ], %g1 40008488: 80 a0 60 00 cmp %g1, 0 4000848c: 02 80 00 1d be 40008500 <_Objects_Allocate+0xa4> 40008490: 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 ) { 40008494: 80 a2 20 00 cmp %o0, 0 40008498: 32 80 00 0a bne,a 400084c0 <_Objects_Allocate+0x64> 4000849c: c4 07 60 08 ld [ %i5 + 8 ], %g2 _Objects_Extend_information( information ); 400084a0: 40 00 00 21 call 40008524 <_Objects_Extend_information> 400084a4: 90 10 00 1d mov %i5, %o0 the_object = (Objects_Control *) _Chain_Get( &information->Inactive ); 400084a8: 7f ff fd 7a call 40007a90 <_Chain_Get> 400084ac: 90 10 00 1c mov %i4, %o0 } if ( the_object ) { 400084b0: b0 92 20 00 orcc %o0, 0, %i0 400084b4: 02 bf ff ef be 40008470 <_Objects_Allocate+0x14> 400084b8: 01 00 00 00 nop uint32_t block; block = (uint32_t) _Objects_Get_index( the_object->id ) - 400084bc: c4 07 60 08 ld [ %i5 + 8 ], %g2 400084c0: d0 06 20 08 ld [ %i0 + 8 ], %o0 _Objects_Get_index( information->minimum_id ); block /= information->allocation_size; 400084c4: d2 17 60 14 lduh [ %i5 + 0x14 ], %o1 } if ( the_object ) { uint32_t block; block = (uint32_t) _Objects_Get_index( the_object->id ) - 400084c8: 03 00 00 3f sethi %hi(0xfc00), %g1 400084cc: 82 10 63 ff or %g1, 0x3ff, %g1 ! ffff 400084d0: 90 0a 00 01 and %o0, %g1, %o0 400084d4: 82 08 80 01 and %g2, %g1, %g1 _Objects_Get_index( information->minimum_id ); block /= information->allocation_size; 400084d8: 40 00 3d d4 call 40017c28 <.udiv> 400084dc: 90 22 00 01 sub %o0, %g1, %o0 information->inactive_per_block[ block ]--; 400084e0: c2 07 60 30 ld [ %i5 + 0x30 ], %g1 400084e4: 91 2a 20 02 sll %o0, 2, %o0 400084e8: c4 00 40 08 ld [ %g1 + %o0 ], %g2 400084ec: 84 00 bf ff add %g2, -1, %g2 400084f0: c4 20 40 08 st %g2, [ %g1 + %o0 ] information->inactive--; 400084f4: c2 17 60 2c lduh [ %i5 + 0x2c ], %g1 400084f8: 82 00 7f ff add %g1, -1, %g1 400084fc: c2 37 60 2c sth %g1, [ %i5 + 0x2c ] ); } #endif return the_object; } 40008500: 81 c7 e0 08 ret 40008504: 81 e8 00 00 restore =============================================================================== 4000888c <_Objects_Get_information>: Objects_Information *_Objects_Get_information( Objects_APIs the_api, uint16_t the_class ) { 4000888c: 9d e3 bf a0 save %sp, -96, %sp Objects_Information *info; int the_class_api_maximum; if ( !the_class ) 40008890: 80 a6 60 00 cmp %i1, 0 40008894: 12 80 00 04 bne 400088a4 <_Objects_Get_information+0x18> 40008898: 01 00 00 00 nop return NULL; 4000889c: 81 c7 e0 08 ret 400088a0: 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 ); 400088a4: 40 00 11 3f call 4000cda0 <_Objects_API_maximum_class> 400088a8: 90 10 00 18 mov %i0, %o0 if ( the_class_api_maximum == 0 ) 400088ac: 80 a2 20 00 cmp %o0, 0 400088b0: 02 bf ff fb be 4000889c <_Objects_Get_information+0x10> 400088b4: 80 a6 40 08 cmp %i1, %o0 return NULL; if ( the_class > (uint32_t) the_class_api_maximum ) 400088b8: 18 bf ff f9 bgu 4000889c <_Objects_Get_information+0x10> 400088bc: 03 10 00 78 sethi %hi(0x4001e000), %g1 return NULL; if ( !_Objects_Information_table[ the_api ] ) 400088c0: b1 2e 20 02 sll %i0, 2, %i0 400088c4: 82 10 61 64 or %g1, 0x164, %g1 400088c8: c2 00 40 18 ld [ %g1 + %i0 ], %g1 400088cc: 80 a0 60 00 cmp %g1, 0 400088d0: 02 bf ff f3 be 4000889c <_Objects_Get_information+0x10> <== NEVER TAKEN 400088d4: b3 2e 60 02 sll %i1, 2, %i1 return NULL; info = _Objects_Information_table[ the_api ][ the_class ]; 400088d8: f0 00 40 19 ld [ %g1 + %i1 ], %i0 if ( !info ) 400088dc: 80 a6 20 00 cmp %i0, 0 400088e0: 02 bf ff ef be 4000889c <_Objects_Get_information+0x10> <== NEVER TAKEN 400088e4: 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 ) 400088e8: c2 16 20 10 lduh [ %i0 + 0x10 ], %g1 400088ec: 80 a0 60 00 cmp %g1, 0 400088f0: 02 bf ff eb be 4000889c <_Objects_Get_information+0x10> 400088f4: 01 00 00 00 nop return NULL; #endif return info; } 400088f8: 81 c7 e0 08 ret 400088fc: 81 e8 00 00 restore =============================================================================== 4001ac84 <_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; 4001ac84: c2 02 20 08 ld [ %o0 + 8 ], %g1 4001ac88: 92 22 40 01 sub %o1, %g1, %o1 if ( information->maximum >= index ) { 4001ac8c: 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; 4001ac90: 92 02 60 01 inc %o1 if ( information->maximum >= index ) { 4001ac94: 80 a0 40 09 cmp %g1, %o1 4001ac98: 0a 80 00 09 bcs 4001acbc <_Objects_Get_no_protection+0x38> 4001ac9c: 93 2a 60 02 sll %o1, 2, %o1 if ( (the_object = information->local_table[ index ]) != NULL ) { 4001aca0: c2 02 20 1c ld [ %o0 + 0x1c ], %g1 4001aca4: d0 00 40 09 ld [ %g1 + %o1 ], %o0 4001aca8: 80 a2 20 00 cmp %o0, 0 4001acac: 02 80 00 05 be 4001acc0 <_Objects_Get_no_protection+0x3c> <== NEVER TAKEN 4001acb0: 82 10 20 01 mov 1, %g1 *location = OBJECTS_LOCAL; return the_object; 4001acb4: 81 c3 e0 08 retl 4001acb8: 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; 4001acbc: 82 10 20 01 mov 1, %g1 return NULL; 4001acc0: 90 10 20 00 clr %o0 } 4001acc4: 81 c3 e0 08 retl 4001acc8: c2 22 80 00 st %g1, [ %o2 ] =============================================================================== 4000c9b0 <_Objects_Id_to_name>: Objects_Name_or_id_lookup_errors _Objects_Id_to_name ( Objects_Id id, Objects_Name *name ) { 4000c9b0: 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; 4000c9b4: 80 a6 20 00 cmp %i0, 0 4000c9b8: 12 80 00 06 bne 4000c9d0 <_Objects_Id_to_name+0x20> 4000c9bc: 83 36 20 18 srl %i0, 0x18, %g1 4000c9c0: 03 10 00 bb sethi %hi(0x4002ec00), %g1 4000c9c4: c2 00 60 40 ld [ %g1 + 0x40 ], %g1 ! 4002ec40 <_Per_CPU_Information+0x10> 4000c9c8: f0 00 60 08 ld [ %g1 + 8 ], %i0 4000c9cc: 83 36 20 18 srl %i0, 0x18, %g1 4000c9d0: 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 ) 4000c9d4: 84 00 7f ff add %g1, -1, %g2 4000c9d8: 80 a0 a0 02 cmp %g2, 2 4000c9dc: 08 80 00 18 bleu 4000ca3c <_Objects_Id_to_name+0x8c> 4000c9e0: 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; 4000c9e4: 81 c7 e0 08 ret 4000c9e8: 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 ]; 4000c9ec: 85 28 a0 02 sll %g2, 2, %g2 4000c9f0: d0 00 40 02 ld [ %g1 + %g2 ], %o0 if ( !information ) 4000c9f4: 80 a2 20 00 cmp %o0, 0 4000c9f8: 02 bf ff fb be 4000c9e4 <_Objects_Id_to_name+0x34> <== NEVER TAKEN 4000c9fc: 01 00 00 00 nop return OBJECTS_INVALID_ID; #if defined(RTEMS_SCORE_OBJECT_ENABLE_STRING_NAMES) if ( information->is_string ) 4000ca00: c2 0a 20 38 ldub [ %o0 + 0x38 ], %g1 4000ca04: 80 a0 60 00 cmp %g1, 0 4000ca08: 12 bf ff f7 bne 4000c9e4 <_Objects_Id_to_name+0x34> <== NEVER TAKEN 4000ca0c: 92 10 00 18 mov %i0, %o1 return OBJECTS_INVALID_ID; #endif the_object = _Objects_Get( information, tmpId, &ignored_location ); 4000ca10: 7f ff ff cb call 4000c93c <_Objects_Get> 4000ca14: 94 07 bf fc add %fp, -4, %o2 if ( !the_object ) 4000ca18: 80 a2 20 00 cmp %o0, 0 4000ca1c: 02 bf ff f2 be 4000c9e4 <_Objects_Id_to_name+0x34> 4000ca20: 01 00 00 00 nop return OBJECTS_INVALID_ID; *name = the_object->name; 4000ca24: c2 02 20 0c ld [ %o0 + 0xc ], %g1 _Thread_Enable_dispatch(); return OBJECTS_NAME_OR_ID_LOOKUP_SUCCESSFUL; 4000ca28: 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(); 4000ca2c: 40 00 03 99 call 4000d890 <_Thread_Enable_dispatch> 4000ca30: c2 26 40 00 st %g1, [ %i1 ] 4000ca34: 81 c7 e0 08 ret 4000ca38: 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 ] ) 4000ca3c: 05 10 00 b9 sethi %hi(0x4002e400), %g2 4000ca40: 84 10 a2 44 or %g2, 0x244, %g2 ! 4002e644 <_Objects_Information_table> 4000ca44: c2 00 80 01 ld [ %g2 + %g1 ], %g1 4000ca48: 80 a0 60 00 cmp %g1, 0 4000ca4c: 12 bf ff e8 bne 4000c9ec <_Objects_Id_to_name+0x3c> 4000ca50: 85 36 20 1b srl %i0, 0x1b, %g2 4000ca54: 30 bf ff e4 b,a 4000c9e4 <_Objects_Id_to_name+0x34> =============================================================================== 4000e2c0 <_POSIX_Keys_Run_destructors>: */ void _POSIX_Keys_Run_destructors( Thread_Control *thread ) { 4000e2c0: 9d e3 bf a0 save %sp, -96, %sp Objects_Maximum thread_index = _Objects_Get_index( thread->Object.id ); 4000e2c4: c2 06 20 08 ld [ %i0 + 8 ], %g1 for ( index = 1 ; index <= max ; ++index ) { POSIX_Keys_Control *key = (POSIX_Keys_Control *) _POSIX_Keys_Information.local_table [ index ]; if ( key != NULL && key->destructor != NULL ) { void *value = key->Values [ thread_api ][ thread_index ]; 4000e2c8: 39 00 00 3f sethi %hi(0xfc00), %i4 4000e2cc: b5 30 60 18 srl %g1, 0x18, %i2 4000e2d0: b8 17 23 ff or %i4, 0x3ff, %i4 4000e2d4: b4 0e a0 07 and %i2, 7, %i2 4000e2d8: b8 08 40 1c and %g1, %i4, %i4 4000e2dc: b4 06 a0 04 add %i2, 4, %i2 4000e2e0: b9 2f 20 02 sll %i4, 2, %i4 * * Reference: 17.1.1.2 P1003.1c/Draft 10, p. 163, line 99. */ while ( !done ) { Objects_Maximum index = 0; Objects_Maximum max = _POSIX_Keys_Information.maximum; 4000e2e4: 37 10 00 79 sethi %hi(0x4001e400), %i3 for ( index = 1 ; index <= max ; ++index ) { POSIX_Keys_Control *key = (POSIX_Keys_Control *) _POSIX_Keys_Information.local_table [ index ]; if ( key != NULL && key->destructor != NULL ) { void *value = key->Values [ thread_api ][ thread_index ]; 4000e2e8: b5 2e a0 02 sll %i2, 2, %i2 * * Reference: 17.1.1.2 P1003.1c/Draft 10, p. 163, line 99. */ while ( !done ) { Objects_Maximum index = 0; Objects_Maximum max = _POSIX_Keys_Information.maximum; 4000e2ec: 82 16 e1 dc or %i3, 0x1dc, %g1 done = true; for ( index = 1 ; index <= max ; ++index ) { 4000e2f0: ba 10 20 01 mov 1, %i5 */ while ( !done ) { Objects_Maximum index = 0; Objects_Maximum max = _POSIX_Keys_Information.maximum; done = true; 4000e2f4: 84 10 20 01 mov 1, %g2 for ( index = 1 ; index <= max ; ++index ) { 4000e2f8: 10 80 00 18 b 4000e358 <_POSIX_Keys_Run_destructors+0x98> 4000e2fc: f2 10 60 10 lduh [ %g1 + 0x10 ], %i1 POSIX_Keys_Control *key = (POSIX_Keys_Control *) _POSIX_Keys_Information.local_table [ index ]; 4000e300: 86 16 e1 dc or %i3, 0x1dc, %g3 Objects_Maximum max = _POSIX_Keys_Information.maximum; done = true; for ( index = 1 ; index <= max ; ++index ) { POSIX_Keys_Control *key = (POSIX_Keys_Control *) 4000e304: c6 00 e0 1c ld [ %g3 + 0x1c ], %g3 4000e308: 83 28 60 02 sll %g1, 2, %g1 4000e30c: c2 00 c0 01 ld [ %g3 + %g1 ], %g1 _POSIX_Keys_Information.local_table [ index ]; if ( key != NULL && key->destructor != NULL ) { 4000e310: 80 a0 60 00 cmp %g1, 0 4000e314: 22 80 00 11 be,a 4000e358 <_POSIX_Keys_Run_destructors+0x98> 4000e318: ba 07 60 01 inc %i5 4000e31c: c6 00 60 10 ld [ %g1 + 0x10 ], %g3 4000e320: 80 a0 e0 00 cmp %g3, 0 4000e324: 02 80 00 0c be 4000e354 <_POSIX_Keys_Run_destructors+0x94> 4000e328: 86 00 40 1a add %g1, %i2, %g3 void *value = key->Values [ thread_api ][ thread_index ]; 4000e32c: c6 00 e0 04 ld [ %g3 + 4 ], %g3 4000e330: d0 00 c0 1c ld [ %g3 + %i4 ], %o0 if ( value != NULL ) { 4000e334: 80 a2 20 00 cmp %o0, 0 4000e338: 22 80 00 08 be,a 4000e358 <_POSIX_Keys_Run_destructors+0x98><== ALWAYS TAKEN 4000e33c: ba 07 60 01 inc %i5 key->Values [ thread_api ][ thread_index ] = NULL; 4000e340: c0 20 c0 1c clr [ %g3 + %i4 ] <== NOT EXECUTED (*key->destructor)( value ); 4000e344: c2 00 60 10 ld [ %g1 + 0x10 ], %g1 <== NOT EXECUTED 4000e348: 9f c0 40 00 call %g1 <== NOT EXECUTED 4000e34c: 01 00 00 00 nop <== NOT EXECUTED done = false; 4000e350: 84 10 20 00 clr %g2 ! 0 <== NOT EXECUTED Objects_Maximum index = 0; Objects_Maximum max = _POSIX_Keys_Information.maximum; done = true; for ( index = 1 ; index <= max ; ++index ) { 4000e354: ba 07 60 01 inc %i5 4000e358: 83 2f 60 10 sll %i5, 0x10, %g1 4000e35c: 83 30 60 10 srl %g1, 0x10, %g1 4000e360: 80 a0 40 19 cmp %g1, %i1 4000e364: 08 bf ff e7 bleu 4000e300 <_POSIX_Keys_Run_destructors+0x40> 4000e368: 80 88 a0 ff btst 0xff, %g2 * number of iterations. An infinite loop may happen if destructors set * thread specific data. This can be considered dubious. * * Reference: 17.1.1.2 P1003.1c/Draft 10, p. 163, line 99. */ while ( !done ) { 4000e36c: 02 bf ff e1 be 4000e2f0 <_POSIX_Keys_Run_destructors+0x30><== NEVER TAKEN 4000e370: 82 16 e1 dc or %i3, 0x1dc, %g1 done = false; } } } } } 4000e374: 81 c7 e0 08 ret 4000e378: 81 e8 00 00 restore =============================================================================== 4000bdfc <_POSIX_Message_queue_Receive_support>: size_t msg_len, unsigned int *msg_prio, bool wait, Watchdog_Interval timeout ) { 4000bdfc: 9d e3 bf 98 save %sp, -104, %sp RTEMS_INLINE_ROUTINE POSIX_Message_queue_Control_fd *_POSIX_Message_queue_Get_fd ( mqd_t id, Objects_Locations *location ) { return (POSIX_Message_queue_Control_fd *) _Objects_Get( 4000be00: 11 10 00 a0 sethi %hi(0x40028000), %o0 4000be04: 92 10 00 18 mov %i0, %o1 4000be08: 90 12 21 a0 or %o0, 0x1a0, %o0 4000be0c: 40 00 0c c3 call 4000f118 <_Objects_Get> 4000be10: 94 07 bf f8 add %fp, -8, %o2 Objects_Locations location; size_t length_out; bool do_wait; the_mq_fd = _POSIX_Message_queue_Get_fd( mqdes, &location ); switch ( location ) { 4000be14: c2 07 bf f8 ld [ %fp + -8 ], %g1 4000be18: 80 a0 60 00 cmp %g1, 0 4000be1c: 12 80 00 40 bne 4000bf1c <_POSIX_Message_queue_Receive_support+0x120> 4000be20: 01 00 00 00 nop case OBJECTS_LOCAL: if ( (the_mq_fd->oflag & O_ACCMODE) == O_WRONLY ) { 4000be24: c2 02 20 14 ld [ %o0 + 0x14 ], %g1 4000be28: 84 08 60 03 and %g1, 3, %g2 4000be2c: 80 a0 a0 01 cmp %g2, 1 4000be30: 32 80 00 05 bne,a 4000be44 <_POSIX_Message_queue_Receive_support+0x48> 4000be34: d0 02 20 10 ld [ %o0 + 0x10 ], %o0 _Thread_Enable_dispatch(); 4000be38: 40 00 10 5f call 4000ffb4 <_Thread_Enable_dispatch> 4000be3c: 01 00 00 00 nop 4000be40: 30 80 00 37 b,a 4000bf1c <_POSIX_Message_queue_Receive_support+0x120> rtems_set_errno_and_return_minus_one( EBADF ); } the_mq = the_mq_fd->Queue; if ( msg_len < the_mq->Message_queue.maximum_message_size ) { 4000be44: c4 02 20 68 ld [ %o0 + 0x68 ], %g2 4000be48: 80 a6 80 02 cmp %i2, %g2 4000be4c: 1a 80 00 08 bcc 4000be6c <_POSIX_Message_queue_Receive_support+0x70> 4000be50: 84 10 3f ff mov -1, %g2 _Thread_Enable_dispatch(); 4000be54: 40 00 10 58 call 4000ffb4 <_Thread_Enable_dispatch> 4000be58: 01 00 00 00 nop rtems_set_errno_and_return_minus_one( EMSGSIZE ); 4000be5c: 40 00 26 b4 call 4001592c <__errno> 4000be60: 01 00 00 00 nop 4000be64: 10 80 00 31 b 4000bf28 <_POSIX_Message_queue_Receive_support+0x12c> 4000be68: 82 10 20 7a mov 0x7a, %g1 ! 7a /* * Now if something goes wrong, we return a "length" of -1 * to indicate an error. */ length_out = -1; 4000be6c: c4 27 bf fc st %g2, [ %fp + -4 ] /* * A timed receive with a bad time will do a poll regardless. */ if ( wait ) 4000be70: 80 a7 20 00 cmp %i4, 0 4000be74: 02 80 00 05 be 4000be88 <_POSIX_Message_queue_Receive_support+0x8c> 4000be78: 98 10 20 00 clr %o4 do_wait = (the_mq_fd->oflag & O_NONBLOCK) ? false : true; 4000be7c: 99 30 60 0e srl %g1, 0xe, %o4 4000be80: 98 1b 20 01 xor %o4, 1, %o4 4000be84: 98 0b 20 01 and %o4, 1, %o4 do_wait = wait; /* * Now perform the actual message receive */ _CORE_message_queue_Seize( 4000be88: 90 02 20 1c add %o0, 0x1c, %o0 4000be8c: 92 10 00 18 mov %i0, %o1 4000be90: 94 10 00 19 mov %i1, %o2 4000be94: 96 07 bf fc add %fp, -4, %o3 4000be98: 98 0b 20 01 and %o4, 1, %o4 4000be9c: 40 00 08 6c call 4000e04c <_CORE_message_queue_Seize> 4000bea0: 9a 10 00 1d mov %i5, %o5 &length_out, do_wait, timeout ); _Thread_Enable_dispatch(); 4000bea4: 40 00 10 44 call 4000ffb4 <_Thread_Enable_dispatch> 4000bea8: 01 00 00 00 nop if (msg_prio) { 4000beac: 80 a6 e0 00 cmp %i3, 0 4000beb0: 02 80 00 08 be 4000bed0 <_POSIX_Message_queue_Receive_support+0xd4><== NEVER TAKEN 4000beb4: 03 10 00 a0 sethi %hi(0x40028000), %g1 *msg_prio = _POSIX_Message_queue_Priority_from_core( _Thread_Executing->Wait.count 4000beb8: c2 00 62 30 ld [ %g1 + 0x230 ], %g1 ! 40028230 <_Per_CPU_Information+0x10> RTEMS_INLINE_ROUTINE unsigned int _POSIX_Message_queue_Priority_from_core( CORE_message_queue_Submit_types priority ) { /* absolute value without a library dependency */ return (unsigned int) ((priority >= 0) ? priority : -priority); 4000bebc: c4 00 60 24 ld [ %g1 + 0x24 ], %g2 4000bec0: 83 38 a0 1f sra %g2, 0x1f, %g1 4000bec4: 84 18 40 02 xor %g1, %g2, %g2 4000bec8: 82 20 80 01 sub %g2, %g1, %g1 timeout ); _Thread_Enable_dispatch(); if (msg_prio) { *msg_prio = _POSIX_Message_queue_Priority_from_core( 4000becc: c2 26 c0 00 st %g1, [ %i3 ] _Thread_Executing->Wait.count ); } if ( !_Thread_Executing->Wait.return_code ) 4000bed0: 3b 10 00 a0 sethi %hi(0x40028000), %i5 4000bed4: ba 17 62 20 or %i5, 0x220, %i5 ! 40028220 <_Per_CPU_Information> 4000bed8: c2 07 60 10 ld [ %i5 + 0x10 ], %g1 4000bedc: c2 00 60 34 ld [ %g1 + 0x34 ], %g1 4000bee0: 80 a0 60 00 cmp %g1, 0 4000bee4: 12 80 00 05 bne 4000bef8 <_POSIX_Message_queue_Receive_support+0xfc> 4000bee8: 01 00 00 00 nop return length_out; 4000beec: f0 07 bf fc ld [ %fp + -4 ], %i0 4000bef0: 81 c7 e0 08 ret 4000bef4: 81 e8 00 00 restore rtems_set_errno_and_return_minus_one( 4000bef8: 40 00 26 8d call 4001592c <__errno> 4000befc: b0 10 3f ff mov -1, %i0 4000bf00: c2 07 60 10 ld [ %i5 + 0x10 ], %g1 4000bf04: b8 10 00 08 mov %o0, %i4 4000bf08: 40 00 00 96 call 4000c160 <_POSIX_Message_queue_Translate_core_message_queue_return_code> 4000bf0c: d0 00 60 34 ld [ %g1 + 0x34 ], %o0 4000bf10: d0 27 00 00 st %o0, [ %i4 ] 4000bf14: 81 c7 e0 08 ret 4000bf18: 81 e8 00 00 restore #endif case OBJECTS_ERROR: break; } rtems_set_errno_and_return_minus_one( EBADF ); 4000bf1c: 40 00 26 84 call 4001592c <__errno> 4000bf20: 01 00 00 00 nop 4000bf24: 82 10 20 09 mov 9, %g1 ! 9 4000bf28: c2 22 00 00 st %g1, [ %o0 ] 4000bf2c: b0 10 3f ff mov -1, %i0 } 4000bf30: 81 c7 e0 08 ret 4000bf34: 81 e8 00 00 restore =============================================================================== 4000e2cc <_POSIX_Semaphore_Create_support>: size_t name_len, int pshared, unsigned int value, POSIX_Semaphore_Control **the_sem ) { 4000e2cc: 9d e3 bf a0 save %sp, -96, %sp POSIX_Semaphore_Control *the_semaphore; CORE_semaphore_Attributes *the_sem_attr; char *name; /* Sharing semaphores among processes is not currently supported */ if (pshared != 0) 4000e2d0: 80 a6 a0 00 cmp %i2, 0 4000e2d4: 22 80 00 06 be,a 4000e2ec <_POSIX_Semaphore_Create_support+0x20> 4000e2d8: 03 10 00 8b sethi %hi(0x40022c00), %g1 rtems_set_errno_and_return_minus_one( ENOSYS ); 4000e2dc: 40 00 09 ad call 40010990 <__errno> 4000e2e0: 01 00 00 00 nop 4000e2e4: 10 80 00 10 b 4000e324 <_POSIX_Semaphore_Create_support+0x58> 4000e2e8: 82 10 20 58 mov 0x58, %g1 ! 58 * * 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; 4000e2ec: c4 00 60 10 ld [ %g1 + 0x10 ], %g2 ++level; 4000e2f0: 84 00 a0 01 inc %g2 _Thread_Dispatch_disable_level = level; 4000e2f4: c4 20 60 10 st %g2, [ %g1 + 0x10 ] * _POSIX_Semaphore_Allocate */ RTEMS_INLINE_ROUTINE POSIX_Semaphore_Control *_POSIX_Semaphore_Allocate( void ) { return (POSIX_Semaphore_Control *) 4000e2f8: 21 10 00 8b sethi %hi(0x40022c00), %l0 4000e2fc: 7f ff ef 6f call 4000a0b8 <_Objects_Allocate> 4000e300: 90 14 22 d4 or %l0, 0x2d4, %o0 ! 40022ed4 <_POSIX_Semaphore_Information> _Thread_Disable_dispatch(); the_semaphore = _POSIX_Semaphore_Allocate(); if ( !the_semaphore ) { 4000e304: ba 92 20 00 orcc %o0, 0, %i5 4000e308: 12 80 00 0a bne 4000e330 <_POSIX_Semaphore_Create_support+0x64> 4000e30c: 80 a6 20 00 cmp %i0, 0 _Thread_Enable_dispatch(); 4000e310: 7f ff f4 6a call 4000b4b8 <_Thread_Enable_dispatch> 4000e314: 01 00 00 00 nop rtems_set_errno_and_return_minus_one( ENOSPC ); 4000e318: 40 00 09 9e call 40010990 <__errno> 4000e31c: 01 00 00 00 nop 4000e320: 82 10 20 1c mov 0x1c, %g1 ! 1c 4000e324: c2 22 00 00 st %g1, [ %o0 ] 4000e328: 81 c7 e0 08 ret 4000e32c: 91 e8 3f ff restore %g0, -1, %o0 /* * Make a copy of the user's string for name just in case it was * dynamically constructed. */ if ( name_arg != NULL ) { 4000e330: 02 80 00 10 be 4000e370 <_POSIX_Semaphore_Create_support+0xa4> 4000e334: 90 10 00 18 mov %i0, %o0 name = _Workspace_String_duplicate( name_arg, name_len ); 4000e338: 40 00 03 ca call 4000f260 <_Workspace_String_duplicate> 4000e33c: 92 10 00 19 mov %i1, %o1 if ( !name ) { 4000e340: b4 92 20 00 orcc %o0, 0, %i2 4000e344: 12 80 00 0d bne 4000e378 <_POSIX_Semaphore_Create_support+0xac><== ALWAYS TAKEN 4000e348: 80 a6 a0 00 cmp %i2, 0 RTEMS_INLINE_ROUTINE void _POSIX_Semaphore_Free ( POSIX_Semaphore_Control *the_semaphore ) { _Objects_Free( &_POSIX_Semaphore_Information, &the_semaphore->Object ); 4000e34c: 90 14 22 d4 or %l0, 0x2d4, %o0 <== NOT EXECUTED 4000e350: 7f ff f0 39 call 4000a434 <_Objects_Free> <== NOT EXECUTED 4000e354: 92 10 00 1d mov %i5, %o1 <== NOT EXECUTED _POSIX_Semaphore_Free( the_semaphore ); _Thread_Enable_dispatch(); 4000e358: 7f ff f4 58 call 4000b4b8 <_Thread_Enable_dispatch> <== NOT EXECUTED 4000e35c: 01 00 00 00 nop <== NOT EXECUTED rtems_set_errno_and_return_minus_one( ENOMEM ); 4000e360: 40 00 09 8c call 40010990 <__errno> <== NOT EXECUTED 4000e364: 01 00 00 00 nop <== NOT EXECUTED 4000e368: 10 bf ff ef b 4000e324 <_POSIX_Semaphore_Create_support+0x58><== NOT EXECUTED 4000e36c: 82 10 20 0c mov 0xc, %g1 ! c <== NOT EXECUTED } } else { name = NULL; 4000e370: b4 10 20 00 clr %i2 } the_semaphore->process_shared = pshared; if ( name ) { 4000e374: 80 a6 a0 00 cmp %i2, 0 4000e378: 02 80 00 08 be 4000e398 <_POSIX_Semaphore_Create_support+0xcc> 4000e37c: c0 27 60 10 clr [ %i5 + 0x10 ] the_semaphore->named = true; 4000e380: 82 10 20 01 mov 1, %g1 4000e384: c2 2f 60 14 stb %g1, [ %i5 + 0x14 ] the_semaphore->open_count = 1; 4000e388: 82 10 20 01 mov 1, %g1 4000e38c: c2 27 60 18 st %g1, [ %i5 + 0x18 ] the_semaphore->linked = true; 4000e390: 10 80 00 05 b 4000e3a4 <_POSIX_Semaphore_Create_support+0xd8> 4000e394: c2 2f 60 15 stb %g1, [ %i5 + 0x15 ] } else { the_semaphore->named = false; 4000e398: c0 2f 60 14 clrb [ %i5 + 0x14 ] the_semaphore->open_count = 0; 4000e39c: c0 27 60 18 clr [ %i5 + 0x18 ] the_semaphore->linked = false; 4000e3a0: c0 2f 60 15 clrb [ %i5 + 0x15 ] the_sem_attr->discipline = CORE_SEMAPHORE_DISCIPLINES_FIFO; /* * This effectively disables limit checking. */ the_sem_attr->maximum_count = 0xFFFFFFFF; 4000e3a4: 82 10 3f ff mov -1, %g1 _CORE_semaphore_Initialize( &the_semaphore->Semaphore, the_sem_attr, value ); 4000e3a8: 90 07 60 1c add %i5, 0x1c, %o0 the_sem_attr->discipline = CORE_SEMAPHORE_DISCIPLINES_FIFO; /* * This effectively disables limit checking. */ the_sem_attr->maximum_count = 0xFFFFFFFF; 4000e3ac: c2 27 60 5c st %g1, [ %i5 + 0x5c ] _CORE_semaphore_Initialize( &the_semaphore->Semaphore, the_sem_attr, value ); 4000e3b0: 92 07 60 5c add %i5, 0x5c, %o1 4000e3b4: 94 10 00 1b mov %i3, %o2 4000e3b8: 7f ff ed b5 call 40009a8c <_CORE_semaphore_Initialize> 4000e3bc: c0 27 60 60 clr [ %i5 + 0x60 ] Objects_Information *information, Objects_Control *the_object, const char *name ) { _Objects_Set_local_object( 4000e3c0: c2 17 60 0a lduh [ %i5 + 0xa ], %g1 #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 4000e3c4: 05 10 00 8b sethi %hi(0x40022c00), %g2 4000e3c8: c4 00 a2 f0 ld [ %g2 + 0x2f0 ], %g2 ! 40022ef0 <_POSIX_Semaphore_Information+0x1c> 4000e3cc: 83 28 60 02 sll %g1, 2, %g1 4000e3d0: fa 20 80 01 st %i5, [ %g2 + %g1 ] the_object ); #if defined(RTEMS_SCORE_OBJECT_ENABLE_STRING_NAMES) /* ASSERT: information->is_string */ the_object->name.name_p = name; 4000e3d4: f4 27 60 0c st %i2, [ %i5 + 0xc ] &_POSIX_Semaphore_Information, &the_semaphore->Object, name ); *the_sem = the_semaphore; 4000e3d8: fa 27 00 00 st %i5, [ %i4 ] _Thread_Enable_dispatch(); 4000e3dc: 7f ff f4 37 call 4000b4b8 <_Thread_Enable_dispatch> 4000e3e0: b0 10 20 00 clr %i0 return 0; } 4000e3e4: 81 c7 e0 08 ret 4000e3e8: 81 e8 00 00 restore =============================================================================== 4000b9d4 <_POSIX_Thread_Evaluate_cancellation_and_enable_dispatch>: Thread_Control *the_thread ) { POSIX_API_Control *thread_support; thread_support = the_thread->API_Extensions[ THREAD_API_POSIX ]; 4000b9d4: c2 02 21 50 ld [ %o0 + 0x150 ], %g1 if ( thread_support->cancelability_state == PTHREAD_CANCEL_ENABLE && 4000b9d8: c4 00 60 d8 ld [ %g1 + 0xd8 ], %g2 4000b9dc: 80 a0 a0 00 cmp %g2, 0 4000b9e0: 12 80 00 12 bne 4000ba28 <_POSIX_Thread_Evaluate_cancellation_and_enable_dispatch+0x54><== NEVER TAKEN 4000b9e4: 01 00 00 00 nop 4000b9e8: c4 00 60 dc ld [ %g1 + 0xdc ], %g2 4000b9ec: 80 a0 a0 01 cmp %g2, 1 4000b9f0: 12 80 00 0e bne 4000ba28 <_POSIX_Thread_Evaluate_cancellation_and_enable_dispatch+0x54> 4000b9f4: 01 00 00 00 nop thread_support->cancelability_type == PTHREAD_CANCEL_ASYNCHRONOUS && 4000b9f8: c2 00 60 e0 ld [ %g1 + 0xe0 ], %g1 4000b9fc: 80 a0 60 00 cmp %g1, 0 4000ba00: 02 80 00 0a be 4000ba28 <_POSIX_Thread_Evaluate_cancellation_and_enable_dispatch+0x54> 4000ba04: 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; 4000ba08: 03 10 00 5b sethi %hi(0x40016c00), %g1 4000ba0c: c4 00 63 d0 ld [ %g1 + 0x3d0 ], %g2 ! 40016fd0 <_Thread_Dispatch_disable_level> thread_support->cancelation_requested ) { _Thread_Unnest_dispatch(); _POSIX_Thread_Exit( the_thread, PTHREAD_CANCELED ); 4000ba10: 92 10 3f ff mov -1, %o1 --level; 4000ba14: 84 00 bf ff add %g2, -1, %g2 _Thread_Dispatch_disable_level = level; 4000ba18: c4 20 63 d0 st %g2, [ %g1 + 0x3d0 ] 4000ba1c: 82 13 c0 00 mov %o7, %g1 4000ba20: 40 00 01 b5 call 4000c0f4 <_POSIX_Thread_Exit> 4000ba24: 9e 10 40 00 mov %g1, %o7 } else _Thread_Enable_dispatch(); 4000ba28: 82 13 c0 00 mov %o7, %g1 4000ba2c: 7f ff f6 d8 call 4000958c <_Thread_Enable_dispatch> 4000ba30: 9e 10 40 00 mov %g1, %o7 =============================================================================== 4000cd84 <_POSIX_Thread_Translate_sched_param>: int policy, struct sched_param *param, Thread_CPU_budget_algorithms *budget_algorithm, Thread_CPU_budget_algorithm_callout *budget_callout ) { 4000cd84: 9d e3 bf a0 save %sp, -96, %sp if ( !_POSIX_Priority_Is_valid( param->sched_priority ) ) 4000cd88: 7f ff ff f4 call 4000cd58 <_POSIX_Priority_Is_valid> 4000cd8c: d0 06 40 00 ld [ %i1 ], %o0 4000cd90: 80 8a 20 ff btst 0xff, %o0 4000cd94: 32 80 00 04 bne,a 4000cda4 <_POSIX_Thread_Translate_sched_param+0x20><== ALWAYS TAKEN 4000cd98: c0 26 80 00 clr [ %i2 ] return EINVAL; 4000cd9c: 81 c7 e0 08 ret 4000cda0: 91 e8 20 16 restore %g0, 0x16, %o0 *budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_NONE; *budget_callout = NULL; if ( policy == SCHED_OTHER ) { 4000cda4: 80 a6 20 00 cmp %i0, 0 4000cda8: 12 80 00 06 bne 4000cdc0 <_POSIX_Thread_Translate_sched_param+0x3c> 4000cdac: c0 26 c0 00 clr [ %i3 ] *budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE; 4000cdb0: 82 10 20 01 mov 1, %g1 4000cdb4: c2 26 80 00 st %g1, [ %i2 ] return 0; 4000cdb8: 81 c7 e0 08 ret 4000cdbc: 81 e8 00 00 restore } if ( policy == SCHED_FIFO ) { 4000cdc0: 80 a6 20 01 cmp %i0, 1 4000cdc4: 02 80 00 29 be 4000ce68 <_POSIX_Thread_Translate_sched_param+0xe4> 4000cdc8: 80 a6 20 02 cmp %i0, 2 *budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_NONE; return 0; } if ( policy == SCHED_RR ) { 4000cdcc: 12 80 00 04 bne 4000cddc <_POSIX_Thread_Translate_sched_param+0x58> 4000cdd0: 80 a6 20 04 cmp %i0, 4 *budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_EXHAUST_TIMESLICE; 4000cdd4: 10 80 00 25 b 4000ce68 <_POSIX_Thread_Translate_sched_param+0xe4> 4000cdd8: f0 26 80 00 st %i0, [ %i2 ] return 0; } if ( policy == SCHED_SPORADIC ) { 4000cddc: 12 bf ff f0 bne 4000cd9c <_POSIX_Thread_Translate_sched_param+0x18> 4000cde0: 01 00 00 00 nop if ( (param->sched_ss_repl_period.tv_sec == 0) && 4000cde4: c2 06 60 08 ld [ %i1 + 8 ], %g1 4000cde8: 80 a0 60 00 cmp %g1, 0 4000cdec: 32 80 00 07 bne,a 4000ce08 <_POSIX_Thread_Translate_sched_param+0x84> 4000cdf0: c2 06 60 10 ld [ %i1 + 0x10 ], %g1 4000cdf4: c2 06 60 0c ld [ %i1 + 0xc ], %g1 4000cdf8: 80 a0 60 00 cmp %g1, 0 4000cdfc: 02 bf ff e8 be 4000cd9c <_POSIX_Thread_Translate_sched_param+0x18> 4000ce00: 01 00 00 00 nop (param->sched_ss_repl_period.tv_nsec == 0) ) return EINVAL; if ( (param->sched_ss_init_budget.tv_sec == 0) && 4000ce04: c2 06 60 10 ld [ %i1 + 0x10 ], %g1 4000ce08: 80 a0 60 00 cmp %g1, 0 4000ce0c: 12 80 00 06 bne 4000ce24 <_POSIX_Thread_Translate_sched_param+0xa0> 4000ce10: 01 00 00 00 nop 4000ce14: c2 06 60 14 ld [ %i1 + 0x14 ], %g1 4000ce18: 80 a0 60 00 cmp %g1, 0 4000ce1c: 02 bf ff e0 be 4000cd9c <_POSIX_Thread_Translate_sched_param+0x18> 4000ce20: 01 00 00 00 nop (param->sched_ss_init_budget.tv_nsec == 0) ) return EINVAL; if ( _Timespec_To_ticks( ¶m->sched_ss_repl_period ) < 4000ce24: 7f ff f7 d9 call 4000ad88 <_Timespec_To_ticks> 4000ce28: 90 06 60 08 add %i1, 8, %o0 4000ce2c: ba 10 00 08 mov %o0, %i5 _Timespec_To_ticks( ¶m->sched_ss_init_budget ) ) 4000ce30: 7f ff f7 d6 call 4000ad88 <_Timespec_To_ticks> 4000ce34: 90 06 60 10 add %i1, 0x10, %o0 if ( (param->sched_ss_init_budget.tv_sec == 0) && (param->sched_ss_init_budget.tv_nsec == 0) ) return EINVAL; if ( _Timespec_To_ticks( ¶m->sched_ss_repl_period ) < 4000ce38: 80 a7 40 08 cmp %i5, %o0 4000ce3c: 0a bf ff d8 bcs 4000cd9c <_POSIX_Thread_Translate_sched_param+0x18> 4000ce40: 01 00 00 00 nop _Timespec_To_ticks( ¶m->sched_ss_init_budget ) ) return EINVAL; if ( !_POSIX_Priority_Is_valid( param->sched_ss_low_priority ) ) 4000ce44: 7f ff ff c5 call 4000cd58 <_POSIX_Priority_Is_valid> 4000ce48: d0 06 60 04 ld [ %i1 + 4 ], %o0 4000ce4c: 80 8a 20 ff btst 0xff, %o0 4000ce50: 02 bf ff d3 be 4000cd9c <_POSIX_Thread_Translate_sched_param+0x18> 4000ce54: 82 10 20 03 mov 3, %g1 return EINVAL; *budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_CALLOUT; 4000ce58: c2 26 80 00 st %g1, [ %i2 ] *budget_callout = _POSIX_Threads_Sporadic_budget_callout; 4000ce5c: 03 10 00 1c sethi %hi(0x40007000), %g1 4000ce60: 82 10 61 a0 or %g1, 0x1a0, %g1 ! 400071a0 <_POSIX_Threads_Sporadic_budget_callout> 4000ce64: c2 26 c0 00 st %g1, [ %i3 ] return 0; } return EINVAL; } 4000ce68: 81 c7 e0 08 ret 4000ce6c: 91 e8 20 00 restore %g0, 0, %o0 =============================================================================== 4000c11c <_POSIX_Threads_Delete_extension>: */ static void _POSIX_Threads_Delete_extension( Thread_Control *executing __attribute__((unused)), Thread_Control *deleted ) { 4000c11c: 9d e3 bf a0 save %sp, -96, %sp Thread_Control *the_thread; POSIX_API_Control *api; void **value_ptr; api = deleted->API_Extensions[ THREAD_API_POSIX ]; 4000c120: f0 06 61 50 ld [ %i1 + 0x150 ], %i0 /* * Run the POSIX cancellation handlers */ _POSIX_Threads_cancel_run( deleted ); 4000c124: 40 00 08 4d call 4000e258 <_POSIX_Threads_cancel_run> 4000c128: 90 10 00 19 mov %i1, %o0 /* * Run all the key destructors */ _POSIX_Keys_Run_destructors( deleted ); 4000c12c: 90 10 00 19 mov %i1, %o0 4000c130: 40 00 08 64 call 4000e2c0 <_POSIX_Keys_Run_destructors> 4000c134: ba 06 20 44 add %i0, 0x44, %i5 /* * Wakeup all the tasks which joined with this one */ value_ptr = (void **) deleted->Wait.return_argument; while ( (the_thread = _Thread_queue_Dequeue( &api->Join_List )) ) 4000c138: 10 80 00 03 b 4000c144 <_POSIX_Threads_Delete_extension+0x28> 4000c13c: f8 06 60 28 ld [ %i1 + 0x28 ], %i4 *(void **)the_thread->Wait.return_argument = value_ptr; 4000c140: f8 20 40 00 st %i4, [ %g1 ] <== NOT EXECUTED /* * Wakeup all the tasks which joined with this one */ value_ptr = (void **) deleted->Wait.return_argument; while ( (the_thread = _Thread_queue_Dequeue( &api->Join_List )) ) 4000c144: 7f ff f6 8f call 40009b80 <_Thread_queue_Dequeue> 4000c148: 90 10 00 1d mov %i5, %o0 4000c14c: 80 a2 20 00 cmp %o0, 0 4000c150: 32 bf ff fc bne,a 4000c140 <_POSIX_Threads_Delete_extension+0x24><== NEVER TAKEN 4000c154: c2 02 20 28 ld [ %o0 + 0x28 ], %g1 <== NOT EXECUTED *(void **)the_thread->Wait.return_argument = value_ptr; if ( api->schedpolicy == SCHED_SPORADIC ) 4000c158: c2 06 20 84 ld [ %i0 + 0x84 ], %g1 4000c15c: 80 a0 60 04 cmp %g1, 4 4000c160: 32 80 00 05 bne,a 4000c174 <_POSIX_Threads_Delete_extension+0x58> 4000c164: c0 26 61 50 clr [ %i1 + 0x150 ] (void) _Watchdog_Remove( &api->Sporadic_timer ); 4000c168: 7f ff f9 15 call 4000a5bc <_Watchdog_Remove> 4000c16c: 90 06 20 a8 add %i0, 0xa8, %o0 deleted->API_Extensions[ THREAD_API_POSIX ] = NULL; 4000c170: c0 26 61 50 clr [ %i1 + 0x150 ] _Workspace_Free( api ); 4000c174: 7f ff f9 b3 call 4000a840 <_Workspace_Free> 4000c178: 81 e8 00 00 restore =============================================================================== 40006efc <_POSIX_Threads_Initialize_user_threads_body>: #include #include #include void _POSIX_Threads_Initialize_user_threads_body(void) { 40006efc: 9d e3 bf 58 save %sp, -168, %sp uint32_t maximum; posix_initialization_threads_table *user_threads; pthread_t thread_id; pthread_attr_t attr; user_threads = Configuration_POSIX_API.User_initialization_threads_table; 40006f00: 03 10 00 78 sethi %hi(0x4001e000), %g1 40006f04: 82 10 60 b4 or %g1, 0xb4, %g1 ! 4001e0b4 maximum = Configuration_POSIX_API.number_of_initialization_threads; 40006f08: f6 00 60 30 ld [ %g1 + 0x30 ], %i3 if ( !user_threads || maximum == 0 ) 40006f0c: 80 a6 e0 00 cmp %i3, 0 40006f10: 02 80 00 1d be 40006f84 <_POSIX_Threads_Initialize_user_threads_body+0x88><== NEVER TAKEN 40006f14: fa 00 60 34 ld [ %g1 + 0x34 ], %i5 40006f18: 80 a7 60 00 cmp %i5, 0 40006f1c: 02 80 00 1a be 40006f84 <_POSIX_Threads_Initialize_user_threads_body+0x88><== NEVER TAKEN 40006f20: b8 10 20 00 clr %i4 for ( index=0 ; index < maximum ; index++ ) { /* * There is no way for these calls to fail in this situation. */ (void) pthread_attr_init( &attr ); 40006f24: 40 00 17 d3 call 4000ce70 40006f28: 90 07 bf c0 add %fp, -64, %o0 (void) pthread_attr_setinheritsched( &attr, PTHREAD_EXPLICIT_SCHED ); 40006f2c: 92 10 20 02 mov 2, %o1 40006f30: 40 00 17 dc call 4000cea0 40006f34: 90 07 bf c0 add %fp, -64, %o0 (void) pthread_attr_setstacksize(&attr, user_threads[ index ].stack_size); 40006f38: d2 07 60 04 ld [ %i5 + 4 ], %o1 40006f3c: 40 00 17 e8 call 4000cedc 40006f40: 90 07 bf c0 add %fp, -64, %o0 status = pthread_create( 40006f44: d4 07 40 00 ld [ %i5 ], %o2 40006f48: 90 07 bf bc add %fp, -68, %o0 40006f4c: 92 07 bf c0 add %fp, -64, %o1 40006f50: 96 10 20 00 clr %o3 40006f54: 7f ff ff 18 call 40006bb4 40006f58: ba 07 60 08 add %i5, 8, %i5 &thread_id, &attr, user_threads[ index ].thread_entry, NULL ); if ( status ) 40006f5c: 80 a2 20 00 cmp %o0, 0 40006f60: 02 80 00 05 be 40006f74 <_POSIX_Threads_Initialize_user_threads_body+0x78> 40006f64: 94 10 00 08 mov %o0, %o2 _Internal_error_Occurred( INTERNAL_ERROR_POSIX_API, true, status ); 40006f68: 90 10 20 02 mov 2, %o0 40006f6c: 40 00 07 f8 call 40008f4c <_Internal_error_Occurred> 40006f70: 92 10 20 01 mov 1, %o1 * * Setting the attributes explicitly is critical, since we don't want * to inherit the idle tasks attributes. */ for ( index=0 ; index < maximum ; index++ ) { 40006f74: b8 07 20 01 inc %i4 40006f78: 80 a7 00 1b cmp %i4, %i3 40006f7c: 12 bf ff ea bne 40006f24 <_POSIX_Threads_Initialize_user_threads_body+0x28><== NEVER TAKEN 40006f80: 01 00 00 00 nop 40006f84: 81 c7 e0 08 ret 40006f88: 81 e8 00 00 restore =============================================================================== 4000c270 <_POSIX_Threads_Sporadic_budget_TSR>: */ void _POSIX_Threads_Sporadic_budget_TSR( Objects_Id id __attribute__((unused)), void *argument ) { 4000c270: 9d e3 bf a0 save %sp, -96, %sp Thread_Control *the_thread; POSIX_API_Control *api; the_thread = argument; api = the_thread->API_Extensions[ THREAD_API_POSIX ]; 4000c274: fa 06 61 50 ld [ %i1 + 0x150 ], %i5 /* ticks is guaranteed to be at least one */ ticks = _Timespec_To_ticks( &api->schedparam.sched_ss_init_budget ); 4000c278: 40 00 03 82 call 4000d080 <_Timespec_To_ticks> 4000c27c: 90 07 60 98 add %i5, 0x98, %o0 RTEMS_INLINE_ROUTINE Priority_Control _POSIX_Priority_To_core( int priority ) { return (Priority_Control) (POSIX_SCHEDULER_MAXIMUM_PRIORITY - priority + 1); 4000c280: 03 10 00 75 sethi %hi(0x4001d400), %g1 4000c284: d2 08 62 1c ldub [ %g1 + 0x21c ], %o1 ! 4001d61c 4000c288: c2 07 60 88 ld [ %i5 + 0x88 ], %g1 the_thread->cpu_time_budget = ticks; 4000c28c: d0 26 60 74 st %o0, [ %i1 + 0x74 ] 4000c290: 92 22 40 01 sub %o1, %g1, %o1 */ #if 0 printk( "TSR %d %d %d\n", the_thread->resource_count, the_thread->current_priority, new_priority ); #endif if ( the_thread->resource_count == 0 ) { 4000c294: c2 06 60 1c ld [ %i1 + 0x1c ], %g1 4000c298: 80 a0 60 00 cmp %g1, 0 4000c29c: 12 80 00 09 bne 4000c2c0 <_POSIX_Threads_Sporadic_budget_TSR+0x50><== NEVER TAKEN 4000c2a0: d2 26 60 18 st %o1, [ %i1 + 0x18 ] /* * If this would make them less important, then do not change it. */ if ( the_thread->current_priority > new_priority ) { 4000c2a4: c2 06 60 14 ld [ %i1 + 0x14 ], %g1 4000c2a8: 80 a0 40 09 cmp %g1, %o1 4000c2ac: 08 80 00 06 bleu 4000c2c4 <_POSIX_Threads_Sporadic_budget_TSR+0x54> 4000c2b0: 90 07 60 90 add %i5, 0x90, %o0 _Thread_Change_priority( the_thread, new_priority, true ); 4000c2b4: 90 10 00 19 mov %i1, %o0 4000c2b8: 7f ff f4 40 call 400093b8 <_Thread_Change_priority> 4000c2bc: 94 10 20 01 mov 1, %o2 #endif } } /* ticks is guaranteed to be at least one */ ticks = _Timespec_To_ticks( &api->schedparam.sched_ss_repl_period ); 4000c2c0: 90 07 60 90 add %i5, 0x90, %o0 4000c2c4: 40 00 03 6f call 4000d080 <_Timespec_To_ticks> 4000c2c8: 31 10 00 78 sethi %hi(0x4001e000), %i0 ) { the_watchdog->initial = units; _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 4000c2cc: b0 16 22 98 or %i0, 0x298, %i0 ! 4001e298 <_Watchdog_Ticks_chain> Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 4000c2d0: d0 27 60 b4 st %o0, [ %i5 + 0xb4 ] _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 4000c2d4: 7f ff f8 62 call 4000a45c <_Watchdog_Insert> 4000c2d8: 93 ef 60 a8 restore %i5, 0xa8, %o1 =============================================================================== 4000c2dc <_POSIX_Threads_Sporadic_budget_callout>: ) { POSIX_API_Control *api; uint32_t new_priority; api = the_thread->API_Extensions[ THREAD_API_POSIX ]; 4000c2dc: c4 02 21 50 ld [ %o0 + 0x150 ], %g2 /* * This will prevent the thread from consuming its entire "budget" * while at low priority. */ the_thread->cpu_time_budget = 0xFFFFFFFF; /* XXX should be based on MAX_U32 */ 4000c2e0: 86 10 3f ff mov -1, %g3 4000c2e4: c4 00 a0 8c ld [ %g2 + 0x8c ], %g2 4000c2e8: c6 22 20 74 st %g3, [ %o0 + 0x74 ] 4000c2ec: 07 10 00 75 sethi %hi(0x4001d400), %g3 4000c2f0: d2 08 e2 1c ldub [ %g3 + 0x21c ], %o1 ! 4001d61c 4000c2f4: 92 22 40 02 sub %o1, %g2, %o1 */ #if 0 printk( "callout %d %d %d\n", the_thread->resource_count, the_thread->current_priority, new_priority ); #endif if ( the_thread->resource_count == 0 ) { 4000c2f8: c4 02 20 1c ld [ %o0 + 0x1c ], %g2 4000c2fc: 80 a0 a0 00 cmp %g2, 0 4000c300: 12 80 00 09 bne 4000c324 <_POSIX_Threads_Sporadic_budget_callout+0x48><== NEVER TAKEN 4000c304: d2 22 20 18 st %o1, [ %o0 + 0x18 ] /* * Make sure we are actually lowering it. If they have lowered it * to logically lower than sched_ss_low_priority, then we do not want to * change it. */ if ( the_thread->current_priority < new_priority ) { 4000c308: c2 02 20 14 ld [ %o0 + 0x14 ], %g1 4000c30c: 80 a0 40 09 cmp %g1, %o1 4000c310: 1a 80 00 05 bcc 4000c324 <_POSIX_Threads_Sporadic_budget_callout+0x48><== NEVER TAKEN 4000c314: 94 10 20 01 mov 1, %o2 _Thread_Change_priority( the_thread, new_priority, true ); 4000c318: 82 13 c0 00 mov %o7, %g1 4000c31c: 7f ff f4 27 call 400093b8 <_Thread_Change_priority> 4000c320: 9e 10 40 00 mov %g1, %o7 4000c324: 81 c3 e0 08 retl <== NOT EXECUTED =============================================================================== 40006cb4 <_POSIX_Timer_TSR>: * This is the operation that is run when a timer expires */ void _POSIX_Timer_TSR( Objects_Id timer __attribute__((unused)), void *data) { 40006cb4: 9d e3 bf 98 save %sp, -104, %sp bool activated; ptimer = (POSIX_Timer_Control *)data; /* Increment the number of expirations. */ ptimer->overrun = ptimer->overrun + 1; 40006cb8: c2 06 60 68 ld [ %i1 + 0x68 ], %g1 40006cbc: 82 00 60 01 inc %g1 40006cc0: c2 26 60 68 st %g1, [ %i1 + 0x68 ] /* The timer must be reprogrammed */ if ( ( ptimer->timer_data.it_interval.tv_sec != 0 ) || 40006cc4: c2 06 60 54 ld [ %i1 + 0x54 ], %g1 40006cc8: 80 a0 60 00 cmp %g1, 0 40006ccc: 32 80 00 07 bne,a 40006ce8 <_POSIX_Timer_TSR+0x34> 40006cd0: d2 06 60 64 ld [ %i1 + 0x64 ], %o1 40006cd4: c2 06 60 58 ld [ %i1 + 0x58 ], %g1 40006cd8: 80 a0 60 00 cmp %g1, 0 40006cdc: 02 80 00 1f be 40006d58 <_POSIX_Timer_TSR+0xa4> <== NEVER TAKEN 40006ce0: 82 10 20 04 mov 4, %g1 ( ptimer->timer_data.it_interval.tv_nsec != 0 ) ) { activated = _POSIX_Timer_Insert_helper( 40006ce4: d2 06 60 64 ld [ %i1 + 0x64 ], %o1 40006ce8: d4 06 60 08 ld [ %i1 + 8 ], %o2 40006cec: 90 06 60 10 add %i1, 0x10, %o0 40006cf0: 17 10 00 1b sethi %hi(0x40006c00), %o3 40006cf4: 98 10 00 19 mov %i1, %o4 40006cf8: 40 00 17 a5 call 4000cb8c <_POSIX_Timer_Insert_helper> 40006cfc: 96 12 e0 b4 or %o3, 0xb4, %o3 ptimer->ticks, ptimer->Object.id, _POSIX_Timer_TSR, ptimer ); if ( !activated ) 40006d00: 80 8a 20 ff btst 0xff, %o0 40006d04: 02 80 00 1a be 40006d6c <_POSIX_Timer_TSR+0xb8> <== NEVER TAKEN 40006d08: 90 07 bf f8 add %fp, -8, %o0 40006d0c: 13 10 00 7a sethi %hi(0x4001e800), %o1 40006d10: 40 00 05 ed call 400084c4 <_TOD_Get_with_nanoseconds> 40006d14: 92 12 63 b8 or %o1, 0x3b8, %o1 ! 4001ebb8 <_TOD> /* After the signal handler returns, the count of expirations of the * timer must be set to 0. */ ptimer->overrun = 0; } 40006d18: f8 1a 00 00 ldd [ %o0 ], %i4 static inline void _Timestamp64_implementation_To_timespec( const Timestamp64_Control *_timestamp, struct timespec *_timespec ) { _timespec->tv_sec = (time_t) (*_timestamp / 1000000000L); 40006d1c: 94 10 20 00 clr %o2 40006d20: 90 10 00 1c mov %i4, %o0 40006d24: 92 10 00 1d mov %i5, %o1 40006d28: 17 0e e6 b2 sethi %hi(0x3b9ac800), %o3 40006d2c: 40 00 48 0b call 40018d58 <__divdi3> 40006d30: 96 12 e2 00 or %o3, 0x200, %o3 ! 3b9aca00 _timespec->tv_nsec = (long) (*_timestamp % 1000000000L); 40006d34: 90 10 00 1c mov %i4, %o0 static inline void _Timestamp64_implementation_To_timespec( const Timestamp64_Control *_timestamp, struct timespec *_timespec ) { _timespec->tv_sec = (time_t) (*_timestamp / 1000000000L); 40006d38: d2 26 60 6c st %o1, [ %i1 + 0x6c ] _timespec->tv_nsec = (long) (*_timestamp % 1000000000L); 40006d3c: 94 10 20 00 clr %o2 40006d40: 92 10 00 1d mov %i5, %o1 40006d44: 17 0e e6 b2 sethi %hi(0x3b9ac800), %o3 40006d48: 40 00 48 ef call 40019104 <__moddi3> 40006d4c: 96 12 e2 00 or %o3, 0x200, %o3 ! 3b9aca00 /* Store the time when the timer was started again */ _TOD_Get( &ptimer->time ); /* The state really did not change but just to be safe */ ptimer->state = POSIX_TIMER_STATE_CREATE_RUN; 40006d50: 82 10 20 03 mov 3, %g1 40006d54: d2 26 60 70 st %o1, [ %i1 + 0x70 ] /* * The sending of the signal to the process running the handling function * specified for that signal is simulated */ if ( pthread_kill ( ptimer->thread_id, ptimer->inf.sigev_signo ) ) { 40006d58: d0 06 60 38 ld [ %i1 + 0x38 ], %o0 40006d5c: d2 06 60 44 ld [ %i1 + 0x44 ], %o1 40006d60: 40 00 16 7a call 4000c748 40006d64: c2 2e 60 3c stb %g1, [ %i1 + 0x3c ] } /* After the signal handler returns, the count of expirations of the * timer must be set to 0. */ ptimer->overrun = 0; 40006d68: c0 26 60 68 clr [ %i1 + 0x68 ] 40006d6c: 81 c7 e0 08 ret 40006d70: 81 e8 00 00 restore =============================================================================== 4000e37c <_POSIX_signals_Check_signal>: bool _POSIX_signals_Check_signal( POSIX_API_Control *api, int signo, bool is_global ) { 4000e37c: 9d e3 bf 68 save %sp, -152, %sp siginfo_t siginfo_struct; sigset_t saved_signals_blocked; Thread_Wait_information stored_thread_wait_information; if ( ! _POSIX_signals_Clear_signals( api, signo, &siginfo_struct, 4000e380: 98 10 20 01 mov 1, %o4 4000e384: 90 10 00 18 mov %i0, %o0 4000e388: 92 10 00 19 mov %i1, %o1 4000e38c: 94 07 bf cc add %fp, -52, %o2 4000e390: 40 00 00 2e call 4000e448 <_POSIX_signals_Clear_signals> 4000e394: 96 10 00 1a mov %i2, %o3 4000e398: 80 8a 20 ff btst 0xff, %o0 4000e39c: 02 80 00 28 be 4000e43c <_POSIX_signals_Check_signal+0xc0> 4000e3a0: 82 10 20 00 clr %g1 #endif /* * Just to prevent sending a signal which is currently being ignored. */ if ( _POSIX_signals_Vectors[ signo ].sa_handler == SIG_IGN ) 4000e3a4: 85 2e 60 02 sll %i1, 2, %g2 4000e3a8: 35 10 00 79 sethi %hi(0x4001e400), %i2 4000e3ac: b7 2e 60 04 sll %i1, 4, %i3 4000e3b0: b4 16 a3 70 or %i2, 0x370, %i2 4000e3b4: b6 26 c0 02 sub %i3, %g2, %i3 4000e3b8: 84 06 80 1b add %i2, %i3, %g2 4000e3bc: fa 00 a0 08 ld [ %g2 + 8 ], %i5 4000e3c0: 80 a7 60 01 cmp %i5, 1 4000e3c4: 02 80 00 1e be 4000e43c <_POSIX_signals_Check_signal+0xc0><== NEVER TAKEN 4000e3c8: 90 07 bf d8 add %fp, -40, %o0 return false; /* * Block the signals requested in sa_mask */ saved_signals_blocked = api->signals_blocked; 4000e3cc: f8 06 20 d0 ld [ %i0 + 0xd0 ], %i4 api->signals_blocked |= _POSIX_signals_Vectors[ signo ].sa_mask; 4000e3d0: c2 00 a0 04 ld [ %g2 + 4 ], %g1 4000e3d4: 82 10 40 1c or %g1, %i4, %g1 4000e3d8: c2 26 20 d0 st %g1, [ %i0 + 0xd0 ] /* * We have to save the blocking information of the current wait queue * because the signal handler may subsequently go on and put the thread * on a wait queue, for its own purposes. */ memcpy( &stored_thread_wait_information, &_Thread_Executing->Wait, 4000e3dc: 03 10 00 79 sethi %hi(0x4001e400), %g1 4000e3e0: d2 00 63 20 ld [ %g1 + 0x320 ], %o1 ! 4001e720 <_Per_CPU_Information+0x10> 4000e3e4: 94 10 20 28 mov 0x28, %o2 4000e3e8: 40 00 03 f2 call 4000f3b0 4000e3ec: 92 02 60 20 add %o1, 0x20, %o1 sizeof( Thread_Wait_information )); /* * Here, the signal handler function executes */ switch ( _POSIX_signals_Vectors[ signo ].sa_flags ) { 4000e3f0: c2 06 80 1b ld [ %i2 + %i3 ], %g1 4000e3f4: 80 a0 60 02 cmp %g1, 2 4000e3f8: 12 80 00 07 bne 4000e414 <_POSIX_signals_Check_signal+0x98> 4000e3fc: 90 10 00 19 mov %i1, %o0 case SA_SIGINFO: (*_POSIX_signals_Vectors[ signo ].sa_sigaction)( 4000e400: 92 07 bf cc add %fp, -52, %o1 4000e404: 9f c7 40 00 call %i5 4000e408: 94 10 20 00 clr %o2 signo, &siginfo_struct, NULL /* context is undefined per 1003.1b-1993, p. 66 */ ); break; 4000e40c: 10 80 00 05 b 4000e420 <_POSIX_signals_Check_signal+0xa4> 4000e410: 03 10 00 79 sethi %hi(0x4001e400), %g1 default: (*_POSIX_signals_Vectors[ signo ].sa_handler)( signo ); 4000e414: 9f c7 40 00 call %i5 4000e418: 01 00 00 00 nop } /* * Restore the blocking information */ memcpy( &_Thread_Executing->Wait, &stored_thread_wait_information, 4000e41c: 03 10 00 79 sethi %hi(0x4001e400), %g1 4000e420: d0 00 63 20 ld [ %g1 + 0x320 ], %o0 ! 4001e720 <_Per_CPU_Information+0x10> 4000e424: 92 07 bf d8 add %fp, -40, %o1 4000e428: 90 02 20 20 add %o0, 0x20, %o0 4000e42c: 40 00 03 e1 call 4000f3b0 4000e430: 94 10 20 28 mov 0x28, %o2 /* * Restore the previous set of blocked signals */ api->signals_blocked = saved_signals_blocked; return true; 4000e434: 82 10 20 01 mov 1, %g1 sizeof( Thread_Wait_information )); /* * Restore the previous set of blocked signals */ api->signals_blocked = saved_signals_blocked; 4000e438: f8 26 20 d0 st %i4, [ %i0 + 0xd0 ] return true; } 4000e43c: b0 08 60 01 and %g1, 1, %i0 4000e440: 81 c7 e0 08 ret 4000e444: 81 e8 00 00 restore =============================================================================== 4000e9c8 <_POSIX_signals_Clear_process_signals>: */ void _POSIX_signals_Clear_process_signals( int signo ) { 4000e9c8: 9d e3 bf a0 save %sp, -96, %sp 4000e9cc: 82 06 3f ff add %i0, -1, %g1 4000e9d0: ba 10 20 01 mov 1, %i5 clear_signal = true; mask = signo_to_mask( signo ); ISR_Level level; _ISR_Disable( level ); 4000e9d4: 7f ff cd b5 call 400020a8 4000e9d8: bb 2f 40 01 sll %i5, %g1, %i5 if ( _POSIX_signals_Vectors[ signo ].sa_flags == SA_SIGINFO ) { 4000e9dc: 05 10 00 79 sethi %hi(0x4001e400), %g2 4000e9e0: 83 2e 20 02 sll %i0, 2, %g1 4000e9e4: 84 10 a3 70 or %g2, 0x370, %g2 4000e9e8: b1 2e 20 04 sll %i0, 4, %i0 4000e9ec: 82 26 00 01 sub %i0, %g1, %g1 4000e9f0: c4 00 80 01 ld [ %g2 + %g1 ], %g2 4000e9f4: 80 a0 a0 02 cmp %g2, 2 4000e9f8: 32 80 00 0c bne,a 4000ea28 <_POSIX_signals_Clear_process_signals+0x60> 4000e9fc: 03 10 00 7a sethi %hi(0x4001e800), %g1 if ( !_Chain_Is_empty( &_POSIX_signals_Siginfo[ signo ] ) ) 4000ea00: 05 10 00 7a sethi %hi(0x4001e800), %g2 4000ea04: 84 10 a1 68 or %g2, 0x168, %g2 ! 4001e968 <_POSIX_signals_Siginfo> 4000ea08: 86 00 40 02 add %g1, %g2, %g3 4000ea0c: c2 00 40 02 ld [ %g1 + %g2 ], %g1 RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( const Chain_Control *the_chain ) { return _Chain_Immutable_first( the_chain ) == _Chain_Immutable_tail( the_chain ); 4000ea10: 86 00 e0 04 add %g3, 4, %g3 4000ea14: 80 a0 40 03 cmp %g1, %g3 4000ea18: 02 80 00 04 be 4000ea28 <_POSIX_signals_Clear_process_signals+0x60><== ALWAYS TAKEN 4000ea1c: 03 10 00 7a sethi %hi(0x4001e800), %g1 clear_signal = false; } if ( clear_signal ) { _POSIX_signals_Pending &= ~mask; } _ISR_Enable( level ); 4000ea20: 7f ff cd a6 call 400020b8 4000ea24: 91 e8 00 08 restore %g0, %o0, %o0 if ( _POSIX_signals_Vectors[ signo ].sa_flags == SA_SIGINFO ) { if ( !_Chain_Is_empty( &_POSIX_signals_Siginfo[ signo ] ) ) clear_signal = false; } if ( clear_signal ) { _POSIX_signals_Pending &= ~mask; 4000ea28: c4 00 61 64 ld [ %g1 + 0x164 ], %g2 4000ea2c: ba 28 80 1d andn %g2, %i5, %i5 4000ea30: 10 bf ff fc b 4000ea20 <_POSIX_signals_Clear_process_signals+0x58> 4000ea34: fa 20 61 64 st %i5, [ %g1 + 0x164 ] =============================================================================== 400077ac <_POSIX_signals_Get_lowest>: sigset_t set ) { int signo; for ( signo = SIGRTMIN ; signo <= SIGRTMAX ; signo++ ) { 400077ac: 82 10 20 1b mov 0x1b, %g1 400077b0: 84 10 20 01 mov 1, %g2 #include #include #include #include static int _POSIX_signals_Get_lowest( 400077b4: 86 00 7f ff add %g1, -1, %g3 400077b8: 87 28 80 03 sll %g2, %g3, %g3 ) { int signo; for ( signo = SIGRTMIN ; signo <= SIGRTMAX ; signo++ ) { if ( set & signo_to_mask( signo ) ) { 400077bc: 80 88 c0 08 btst %g3, %o0 400077c0: 12 80 00 11 bne 40007804 <_POSIX_signals_Get_lowest+0x58> <== NEVER TAKEN 400077c4: 01 00 00 00 nop sigset_t set ) { int signo; for ( signo = SIGRTMIN ; signo <= SIGRTMAX ; signo++ ) { 400077c8: 82 00 60 01 inc %g1 400077cc: 80 a0 60 20 cmp %g1, 0x20 400077d0: 12 bf ff fa bne 400077b8 <_POSIX_signals_Get_lowest+0xc> 400077d4: 86 00 7f ff add %g1, -1, %g3 400077d8: 82 10 20 01 mov 1, %g1 400077dc: 84 10 20 01 mov 1, %g2 #include #include #include #include static int _POSIX_signals_Get_lowest( 400077e0: 86 00 7f ff add %g1, -1, %g3 400077e4: 87 28 80 03 sll %g2, %g3, %g3 #if (SIGHUP != 1) #error "Assumption that SIGHUP==1 violated!!" #endif for ( signo = SIGHUP ; signo <= __SIGLASTNOTRT ; signo++ ) { if ( set & signo_to_mask( signo ) ) { 400077e8: 80 88 c0 08 btst %g3, %o0 400077ec: 12 80 00 06 bne 40007804 <_POSIX_signals_Get_lowest+0x58> 400077f0: 01 00 00 00 nop */ #if (SIGHUP != 1) #error "Assumption that SIGHUP==1 violated!!" #endif for ( signo = SIGHUP ; signo <= __SIGLASTNOTRT ; signo++ ) { 400077f4: 82 00 60 01 inc %g1 400077f8: 80 a0 60 1b cmp %g1, 0x1b 400077fc: 12 bf ff fa bne 400077e4 <_POSIX_signals_Get_lowest+0x38> <== ALWAYS TAKEN 40007800: 86 00 7f ff add %g1, -1, %g3 * a return 0. This routine will NOT be called unless a signal * is pending in the set passed in. */ found_it: return signo; } 40007804: 81 c3 e0 08 retl 40007808: 90 10 00 01 mov %g1, %o0 =============================================================================== 4000bea8 <_POSIX_signals_Post_switch_hook>: */ static void _POSIX_signals_Post_switch_hook( Thread_Control *the_thread ) { 4000bea8: 9d e3 bf a0 save %sp, -96, %sp /* * We need to ensure that if the signal handler executes a call * which overwrites the unblocking status, we restore it. */ hold_errno = _Thread_Executing->Wait.return_code; 4000beac: 03 10 00 79 sethi %hi(0x4001e400), %g1 POSIX_API_Control *api; int signo; ISR_Level level; int hold_errno; api = the_thread->API_Extensions[ THREAD_API_POSIX ]; 4000beb0: fa 06 21 50 ld [ %i0 + 0x150 ], %i5 /* * We need to ensure that if the signal handler executes a call * which overwrites the unblocking status, we restore it. */ hold_errno = _Thread_Executing->Wait.return_code; 4000beb4: c2 00 63 20 ld [ %g1 + 0x320 ], %g1 /* * api may be NULL in case of a thread close in progress */ if ( !api ) 4000beb8: 80 a7 60 00 cmp %i5, 0 4000bebc: 02 80 00 11 be 4000bf00 <_POSIX_signals_Post_switch_hook+0x58><== NEVER TAKEN 4000bec0: f6 00 60 34 ld [ %g1 + 0x34 ], %i3 * processed at all. No point in doing this loop otherwise. */ while (1) { _ISR_Disable( level ); if ( !(~api->signals_blocked & (api->signals_pending | _POSIX_signals_Pending)) ) { 4000bec4: 35 10 00 7a sethi %hi(0x4001e800), %i2 * * The first thing done is to check there are any signals to be * processed at all. No point in doing this loop otherwise. */ while (1) { _ISR_Disable( level ); 4000bec8: 7f ff d8 78 call 400020a8 4000becc: 01 00 00 00 nop if ( !(~api->signals_blocked & (api->signals_pending | _POSIX_signals_Pending)) ) { 4000bed0: c4 06 a1 64 ld [ %i2 + 0x164 ], %g2 4000bed4: c2 07 60 d4 ld [ %i5 + 0xd4 ], %g1 4000bed8: 82 10 80 01 or %g2, %g1, %g1 * The first thing done is to check there are any signals to be * processed at all. No point in doing this loop otherwise. */ while (1) { _ISR_Disable( level ); if ( !(~api->signals_blocked & 4000bedc: c4 07 60 d0 ld [ %i5 + 0xd0 ], %g2 4000bee0: 80 a8 40 02 andncc %g1, %g2, %g0 4000bee4: 12 80 00 09 bne 4000bf08 <_POSIX_signals_Post_switch_hook+0x60> 4000bee8: 01 00 00 00 nop (api->signals_pending | _POSIX_signals_Pending)) ) { _ISR_Enable( level ); 4000beec: 7f ff d8 73 call 400020b8 4000bef0: 01 00 00 00 nop _POSIX_signals_Check_signal( api, signo, false ); _POSIX_signals_Check_signal( api, signo, true ); } } _Thread_Executing->Wait.return_code = hold_errno; 4000bef4: 03 10 00 79 sethi %hi(0x4001e400), %g1 4000bef8: c2 00 63 20 ld [ %g1 + 0x320 ], %g1 ! 4001e720 <_Per_CPU_Information+0x10> 4000befc: f6 20 60 34 st %i3, [ %g1 + 0x34 ] 4000bf00: 81 c7 e0 08 ret 4000bf04: 81 e8 00 00 restore if ( !(~api->signals_blocked & (api->signals_pending | _POSIX_signals_Pending)) ) { _ISR_Enable( level ); break; } _ISR_Enable( level ); 4000bf08: 7f ff d8 6c call 400020b8 4000bf0c: b8 10 20 1b mov 0x1b, %i4 for ( signo = SIGRTMIN ; signo <= SIGRTMAX ; signo++ ) { _POSIX_signals_Check_signal( api, signo, false ); 4000bf10: 92 10 00 1c mov %i4, %o1 4000bf14: 94 10 20 00 clr %o2 4000bf18: 40 00 09 19 call 4000e37c <_POSIX_signals_Check_signal> 4000bf1c: 90 10 00 1d mov %i5, %o0 _POSIX_signals_Check_signal( api, signo, true ); 4000bf20: 92 10 00 1c mov %i4, %o1 4000bf24: 90 10 00 1d mov %i5, %o0 4000bf28: 40 00 09 15 call 4000e37c <_POSIX_signals_Check_signal> 4000bf2c: 94 10 20 01 mov 1, %o2 _ISR_Enable( level ); break; } _ISR_Enable( level ); for ( signo = SIGRTMIN ; signo <= SIGRTMAX ; signo++ ) { 4000bf30: b8 07 20 01 inc %i4 4000bf34: 80 a7 20 20 cmp %i4, 0x20 4000bf38: 12 bf ff f7 bne 4000bf14 <_POSIX_signals_Post_switch_hook+0x6c> 4000bf3c: 92 10 00 1c mov %i4, %o1 4000bf40: b8 10 20 01 mov 1, %i4 _POSIX_signals_Check_signal( api, signo, true ); } /* Unfortunately - nothing like __SIGFIRSTNOTRT in newlib signal .h */ for ( signo = SIGHUP ; signo <= __SIGLASTNOTRT ; signo++ ) { _POSIX_signals_Check_signal( api, signo, false ); 4000bf44: 92 10 00 1c mov %i4, %o1 4000bf48: 94 10 20 00 clr %o2 4000bf4c: 40 00 09 0c call 4000e37c <_POSIX_signals_Check_signal> 4000bf50: 90 10 00 1d mov %i5, %o0 _POSIX_signals_Check_signal( api, signo, true ); 4000bf54: 92 10 00 1c mov %i4, %o1 4000bf58: 90 10 00 1d mov %i5, %o0 4000bf5c: 40 00 09 08 call 4000e37c <_POSIX_signals_Check_signal> 4000bf60: 94 10 20 01 mov 1, %o2 _POSIX_signals_Check_signal( api, signo, false ); _POSIX_signals_Check_signal( api, signo, true ); } /* Unfortunately - nothing like __SIGFIRSTNOTRT in newlib signal .h */ for ( signo = SIGHUP ; signo <= __SIGLASTNOTRT ; signo++ ) { 4000bf64: b8 07 20 01 inc %i4 4000bf68: 80 a7 20 1b cmp %i4, 0x1b 4000bf6c: 12 bf ff f7 bne 4000bf48 <_POSIX_signals_Post_switch_hook+0xa0> 4000bf70: 92 10 00 1c mov %i4, %o1 4000bf74: 30 bf ff d5 b,a 4000bec8 <_POSIX_signals_Post_switch_hook+0x20> =============================================================================== 4001b050 <_POSIX_signals_Unblock_thread>: bool _POSIX_signals_Unblock_thread( Thread_Control *the_thread, int signo, siginfo_t *info ) { 4001b050: 9d e3 bf a0 save %sp, -96, %sp /* * Is the thread is specifically waiting for a signal? */ if ( _States_Is_interruptible_signal( the_thread->current_state ) ) { 4001b054: c2 06 20 10 ld [ %i0 + 0x10 ], %g1 4001b058: 3b 04 00 20 sethi %hi(0x10008000), %i5 4001b05c: 84 06 7f ff add %i1, -1, %g2 4001b060: 86 10 20 01 mov 1, %g3 4001b064: b8 08 40 1d and %g1, %i5, %i4 { POSIX_API_Control *api; sigset_t mask; siginfo_t *the_info = NULL; api = the_thread->API_Extensions[ THREAD_API_POSIX ]; 4001b068: c8 06 21 50 ld [ %i0 + 0x150 ], %g4 /* * Is the thread is specifically waiting for a signal? */ if ( _States_Is_interruptible_signal( the_thread->current_state ) ) { 4001b06c: 80 a7 00 1d cmp %i4, %i5 4001b070: 12 80 00 1e bne 4001b0e8 <_POSIX_signals_Unblock_thread+0x98> 4001b074: 85 28 c0 02 sll %g3, %g2, %g2 if ( (the_thread->Wait.option & mask) || (~api->signals_blocked & mask) ) { 4001b078: c2 06 20 30 ld [ %i0 + 0x30 ], %g1 4001b07c: 80 88 80 01 btst %g2, %g1 4001b080: 12 80 00 08 bne 4001b0a0 <_POSIX_signals_Unblock_thread+0x50> 4001b084: 82 10 20 04 mov 4, %g1 4001b088: c2 01 20 d0 ld [ %g4 + 0xd0 ], %g1 4001b08c: 80 a8 80 01 andncc %g2, %g1, %g0 4001b090: 32 80 00 04 bne,a 4001b0a0 <_POSIX_signals_Unblock_thread+0x50> 4001b094: 82 10 20 04 mov 4, %g1 } else if ( the_thread->current_state == STATES_READY ) { if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) ) _Thread_Dispatch_necessary = true; } } return false; 4001b098: 10 80 00 3d b 4001b18c <_POSIX_signals_Unblock_thread+0x13c> 4001b09c: b0 10 20 00 clr %i0 */ if ( _States_Is_interruptible_signal( the_thread->current_state ) ) { if ( (the_thread->Wait.option & mask) || (~api->signals_blocked & mask) ) { the_thread->Wait.return_code = EINTR; 4001b0a0: c2 26 20 34 st %g1, [ %i0 + 0x34 ] the_info = (siginfo_t *) the_thread->Wait.return_argument; if ( !info ) { 4001b0a4: 80 a6 a0 00 cmp %i2, 0 4001b0a8: 12 80 00 07 bne 4001b0c4 <_POSIX_signals_Unblock_thread+0x74> 4001b0ac: d0 06 20 28 ld [ %i0 + 0x28 ], %o0 the_info->si_signo = signo; the_info->si_code = SI_USER; 4001b0b0: 82 10 20 01 mov 1, %g1 the_thread->Wait.return_code = EINTR; the_info = (siginfo_t *) the_thread->Wait.return_argument; if ( !info ) { the_info->si_signo = signo; 4001b0b4: f2 22 00 00 st %i1, [ %o0 ] the_info->si_code = SI_USER; 4001b0b8: c2 22 20 04 st %g1, [ %o0 + 4 ] the_info->si_value.sival_int = 0; 4001b0bc: 10 80 00 05 b 4001b0d0 <_POSIX_signals_Unblock_thread+0x80> 4001b0c0: c0 22 20 08 clr [ %o0 + 8 ] } else { *the_info = *info; 4001b0c4: 92 10 00 1a mov %i2, %o1 4001b0c8: 7f ff d0 ba call 4000f3b0 4001b0cc: 94 10 20 0c mov 0xc, %o2 } _Thread_queue_Extract_with_proxy( the_thread ); 4001b0d0: 90 10 00 18 mov %i0, %o0 4001b0d4: 7f ff bb 98 call 40009f34 <_Thread_queue_Extract_with_proxy> 4001b0d8: b0 10 20 01 mov 1, %i0 4001b0dc: b0 0e 20 01 and %i0, 1, %i0 4001b0e0: 81 c7 e0 08 ret 4001b0e4: 81 e8 00 00 restore } /* * Thread is not waiting due to a sigwait. */ if ( ~api->signals_blocked & mask ) { 4001b0e8: c8 01 20 d0 ld [ %g4 + 0xd0 ], %g4 4001b0ec: 80 a8 80 04 andncc %g2, %g4, %g0 4001b0f0: 02 80 00 26 be 4001b188 <_POSIX_signals_Unblock_thread+0x138> 4001b0f4: 05 04 00 00 sethi %hi(0x10000000), %g2 * it is not blocked, THEN * we need to dispatch at the end of this ISR. * + Any other combination, do nothing. */ if ( _States_Is_interruptible_by_signal( the_thread->current_state ) ) { 4001b0f8: 80 88 40 02 btst %g1, %g2 4001b0fc: 02 80 00 17 be 4001b158 <_POSIX_signals_Unblock_thread+0x108> 4001b100: 80 a0 60 00 cmp %g1, 0 the_thread->Wait.return_code = EINTR; 4001b104: 84 10 20 04 mov 4, %g2 4001b108: c4 26 20 34 st %g2, [ %i0 + 0x34 ] /* * In pthread_cond_wait, a thread will be blocking on a thread * queue, but is also interruptible by a POSIX signal. */ if ( _States_Is_waiting_on_thread_queue(the_thread->current_state) ) 4001b10c: 05 00 00 ef sethi %hi(0x3bc00), %g2 4001b110: 84 10 a2 e0 or %g2, 0x2e0, %g2 ! 3bee0 4001b114: 80 88 40 02 btst %g1, %g2 4001b118: 02 80 00 06 be 4001b130 <_POSIX_signals_Unblock_thread+0xe0> 4001b11c: 80 88 60 08 btst 8, %g1 _Thread_queue_Extract_with_proxy( the_thread ); 4001b120: 7f ff bb 85 call 40009f34 <_Thread_queue_Extract_with_proxy> 4001b124: 90 10 00 18 mov %i0, %o0 } else if ( the_thread->current_state == STATES_READY ) { if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) ) _Thread_Dispatch_necessary = true; } } return false; 4001b128: 10 80 00 19 b 4001b18c <_POSIX_signals_Unblock_thread+0x13c> 4001b12c: b0 10 20 00 clr %i0 * In pthread_cond_wait, a thread will be blocking on a thread * queue, but is also interruptible by a POSIX signal. */ if ( _States_Is_waiting_on_thread_queue(the_thread->current_state) ) _Thread_queue_Extract_with_proxy( the_thread ); else if ( _States_Is_delaying(the_thread->current_state) ) { 4001b130: 22 80 00 17 be,a 4001b18c <_POSIX_signals_Unblock_thread+0x13c><== NEVER TAKEN 4001b134: b0 10 20 00 clr %i0 <== NOT EXECUTED (void) _Watchdog_Remove( &the_thread->Timer ); 4001b138: 7f ff bd 21 call 4000a5bc <_Watchdog_Remove> 4001b13c: 90 06 20 48 add %i0, 0x48, %o0 RTEMS_INLINE_ROUTINE void _Thread_Unblock ( Thread_Control *the_thread ) { _Thread_Clear_state( the_thread, STATES_BLOCKED ); 4001b140: 90 10 00 18 mov %i0, %o0 4001b144: 13 04 01 ff sethi %hi(0x1007fc00), %o1 4001b148: 7f ff b8 e0 call 400094c8 <_Thread_Clear_state> 4001b14c: 92 12 63 f8 or %o1, 0x3f8, %o1 ! 1007fff8 } else if ( the_thread->current_state == STATES_READY ) { if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) ) _Thread_Dispatch_necessary = true; } } return false; 4001b150: 10 80 00 0f b 4001b18c <_POSIX_signals_Unblock_thread+0x13c> 4001b154: b0 10 20 00 clr %i0 else if ( _States_Is_delaying(the_thread->current_state) ) { (void) _Watchdog_Remove( &the_thread->Timer ); _Thread_Unblock( the_thread ); } } else if ( the_thread->current_state == STATES_READY ) { 4001b158: 32 80 00 0d bne,a 4001b18c <_POSIX_signals_Unblock_thread+0x13c><== NEVER TAKEN 4001b15c: b0 10 20 00 clr %i0 <== NOT EXECUTED if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) ) 4001b160: 03 10 00 79 sethi %hi(0x4001e400), %g1 4001b164: 82 10 63 10 or %g1, 0x310, %g1 ! 4001e710 <_Per_CPU_Information> 4001b168: c4 00 60 08 ld [ %g1 + 8 ], %g2 4001b16c: 80 a0 a0 00 cmp %g2, 0 4001b170: 22 80 00 07 be,a 4001b18c <_POSIX_signals_Unblock_thread+0x13c> 4001b174: b0 10 20 00 clr %i0 4001b178: c4 00 60 10 ld [ %g1 + 0x10 ], %g2 4001b17c: 80 a6 00 02 cmp %i0, %g2 4001b180: 22 80 00 02 be,a 4001b188 <_POSIX_signals_Unblock_thread+0x138><== ALWAYS TAKEN 4001b184: c6 28 60 0c stb %g3, [ %g1 + 0xc ] _Thread_Dispatch_necessary = true; } } return false; 4001b188: b0 10 20 00 clr %i0 } 4001b18c: b0 0e 20 01 and %i0, 1, %i0 4001b190: 81 c7 e0 08 ret 4001b194: 81 e8 00 00 restore =============================================================================== 400096d8 <_RBTree_Extract_unprotected>: */ void _RBTree_Extract_unprotected( RBTree_Control *the_rbtree, RBTree_Node *the_node ) { 400096d8: 9d e3 bf a0 save %sp, -96, %sp RBTree_Node *leaf, *target; RBTree_Color victim_color; RBTree_Direction dir; if (!the_node) return; 400096dc: 80 a6 60 00 cmp %i1, 0 400096e0: 02 80 00 69 be 40009884 <_RBTree_Extract_unprotected+0x1ac> 400096e4: 01 00 00 00 nop /* check if min needs to be updated */ if (the_node == the_rbtree->first[RBT_LEFT]) { 400096e8: c2 06 20 08 ld [ %i0 + 8 ], %g1 400096ec: 80 a6 40 01 cmp %i1, %g1 400096f0: 32 80 00 07 bne,a 4000970c <_RBTree_Extract_unprotected+0x34> 400096f4: 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 ); 400096f8: 90 10 00 19 mov %i1, %o0 400096fc: 40 00 01 31 call 40009bc0 <_RBTree_Next_unprotected> 40009700: 92 10 20 01 mov 1, %o1 RBTree_Node *next; next = _RBTree_Successor_unprotected(the_node); the_rbtree->first[RBT_LEFT] = next; 40009704: 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]) { 40009708: c2 06 20 0c ld [ %i0 + 0xc ], %g1 4000970c: 80 a6 40 01 cmp %i1, %g1 40009710: 32 80 00 07 bne,a 4000972c <_RBTree_Extract_unprotected+0x54> 40009714: 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 ); 40009718: 90 10 00 19 mov %i1, %o0 4000971c: 40 00 01 29 call 40009bc0 <_RBTree_Next_unprotected> 40009720: 92 10 20 00 clr %o1 RBTree_Node *previous; previous = _RBTree_Predecessor_unprotected(the_node); the_rbtree->first[RBT_RIGHT] = previous; 40009724: 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]) { 40009728: fa 06 60 04 ld [ %i1 + 4 ], %i5 4000972c: 80 a7 60 00 cmp %i5, 0 40009730: 02 80 00 36 be 40009808 <_RBTree_Extract_unprotected+0x130> 40009734: f8 06 60 08 ld [ %i1 + 8 ], %i4 40009738: 80 a7 20 00 cmp %i4, 0 4000973c: 32 80 00 05 bne,a 40009750 <_RBTree_Extract_unprotected+0x78> 40009740: c2 07 60 08 ld [ %i5 + 8 ], %g1 40009744: 10 80 00 35 b 40009818 <_RBTree_Extract_unprotected+0x140> 40009748: 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]; 4000974c: c2 07 60 08 ld [ %i5 + 8 ], %g1 40009750: 80 a0 60 00 cmp %g1, 0 40009754: 32 bf ff fe bne,a 4000974c <_RBTree_Extract_unprotected+0x74> 40009758: 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]; 4000975c: f8 07 60 04 ld [ %i5 + 4 ], %i4 if(leaf) { 40009760: 80 a7 20 00 cmp %i4, 0 40009764: 02 80 00 05 be 40009778 <_RBTree_Extract_unprotected+0xa0> 40009768: 01 00 00 00 nop leaf->parent = target->parent; 4000976c: c2 07 40 00 ld [ %i5 ], %g1 40009770: 10 80 00 04 b 40009780 <_RBTree_Extract_unprotected+0xa8> 40009774: c2 27 00 00 st %g1, [ %i4 ] } else { /* fix the tree here if the child is a null leaf. */ _RBTree_Extract_validate_unprotected(target); 40009778: 7f ff ff 73 call 40009544 <_RBTree_Extract_validate_unprotected> 4000977c: 90 10 00 1d mov %i5, %o0 } victim_color = target->color; dir = target != target->parent->child[0]; 40009780: 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; 40009784: c2 07 60 0c ld [ %i5 + 0xc ], %g1 dir = target != target->parent->child[0]; 40009788: c6 00 a0 04 ld [ %g2 + 4 ], %g3 4000978c: 86 1f 40 03 xor %i5, %g3, %g3 40009790: 80 a0 00 03 cmp %g0, %g3 40009794: 86 40 20 00 addx %g0, 0, %g3 target->parent->child[dir] = leaf; 40009798: 87 28 e0 02 sll %g3, 2, %g3 4000979c: 84 00 80 03 add %g2, %g3, %g2 400097a0: f8 20 a0 04 st %i4, [ %g2 + 4 ] /* now replace the_node with target */ dir = the_node != the_node->parent->child[0]; 400097a4: c4 06 40 00 ld [ %i1 ], %g2 400097a8: c6 00 a0 04 ld [ %g2 + 4 ], %g3 400097ac: 86 1e 40 03 xor %i1, %g3, %g3 400097b0: 80 a0 00 03 cmp %g0, %g3 400097b4: 86 40 20 00 addx %g0, 0, %g3 the_node->parent->child[dir] = target; 400097b8: 87 28 e0 02 sll %g3, 2, %g3 400097bc: 84 00 80 03 add %g2, %g3, %g2 400097c0: 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]; 400097c4: c4 06 60 08 ld [ %i1 + 8 ], %g2 400097c8: c4 27 60 08 st %g2, [ %i5 + 8 ] if (the_node->child[RBT_RIGHT]) 400097cc: c4 06 60 08 ld [ %i1 + 8 ], %g2 400097d0: 80 a0 a0 00 cmp %g2, 0 400097d4: 32 80 00 02 bne,a 400097dc <_RBTree_Extract_unprotected+0x104><== ALWAYS TAKEN 400097d8: fa 20 80 00 st %i5, [ %g2 ] the_node->child[RBT_RIGHT]->parent = target; target->child[RBT_LEFT] = the_node->child[RBT_LEFT]; 400097dc: c4 06 60 04 ld [ %i1 + 4 ], %g2 400097e0: c4 27 60 04 st %g2, [ %i5 + 4 ] if (the_node->child[RBT_LEFT]) 400097e4: c4 06 60 04 ld [ %i1 + 4 ], %g2 400097e8: 80 a0 a0 00 cmp %g2, 0 400097ec: 32 80 00 02 bne,a 400097f4 <_RBTree_Extract_unprotected+0x11c> 400097f0: 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; 400097f4: c4 06 40 00 ld [ %i1 ], %g2 400097f8: c4 27 40 00 st %g2, [ %i5 ] target->color = the_node->color; 400097fc: c4 06 60 0c ld [ %i1 + 0xc ], %g2 40009800: 10 80 00 14 b 40009850 <_RBTree_Extract_unprotected+0x178> 40009804: 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 ) { 40009808: 80 a7 20 00 cmp %i4, 0 4000980c: 32 80 00 04 bne,a 4000981c <_RBTree_Extract_unprotected+0x144> 40009810: c2 06 40 00 ld [ %i1 ], %g1 40009814: 30 80 00 04 b,a 40009824 <_RBTree_Extract_unprotected+0x14c> leaf->parent = the_node->parent; 40009818: c2 06 40 00 ld [ %i1 ], %g1 4000981c: 10 80 00 04 b 4000982c <_RBTree_Extract_unprotected+0x154> 40009820: 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); 40009824: 7f ff ff 48 call 40009544 <_RBTree_Extract_validate_unprotected> 40009828: 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]; 4000982c: 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; 40009830: c2 06 60 0c ld [ %i1 + 0xc ], %g1 /* remove the_node from the tree */ dir = the_node != the_node->parent->child[0]; 40009834: c6 00 a0 04 ld [ %g2 + 4 ], %g3 40009838: 86 1e 40 03 xor %i1, %g3, %g3 4000983c: 80 a0 00 03 cmp %g0, %g3 40009840: 86 40 20 00 addx %g0, 0, %g3 the_node->parent->child[dir] = leaf; 40009844: 87 28 e0 02 sll %g3, 2, %g3 40009848: 84 00 80 03 add %g2, %g3, %g2 4000984c: 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 */ 40009850: 80 a0 60 00 cmp %g1, 0 40009854: 32 80 00 06 bne,a 4000986c <_RBTree_Extract_unprotected+0x194> 40009858: c2 06 20 04 ld [ %i0 + 4 ], %g1 if (leaf) { 4000985c: 80 a7 20 00 cmp %i4, 0 40009860: 32 80 00 02 bne,a 40009868 <_RBTree_Extract_unprotected+0x190> 40009864: 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; 40009868: 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; 4000986c: c0 26 60 08 clr [ %i1 + 8 ] 40009870: c0 26 60 04 clr [ %i1 + 4 ] 40009874: 80 a0 60 00 cmp %g1, 0 40009878: 02 80 00 03 be 40009884 <_RBTree_Extract_unprotected+0x1ac> 4000987c: c0 26 40 00 clr [ %i1 ] 40009880: c0 20 60 0c clr [ %g1 + 0xc ] 40009884: 81 c7 e0 08 ret 40009888: 81 e8 00 00 restore =============================================================================== 4000a950 <_RBTree_Initialize>: void *starting_address, size_t number_nodes, size_t node_size, bool is_unique ) { 4000a950: 9d e3 bf a0 save %sp, -96, %sp size_t count; RBTree_Node *next; /* TODO: Error message? */ if (!the_rbtree) return; 4000a954: 80 a6 20 00 cmp %i0, 0 4000a958: 02 80 00 10 be 4000a998 <_RBTree_Initialize+0x48> <== NEVER TAKEN 4000a95c: 01 00 00 00 nop RBTree_Control *the_rbtree, RBTree_Compare_function compare_function, bool is_unique ) { the_rbtree->permanent_null = NULL; 4000a960: c0 26 00 00 clr [ %i0 ] the_rbtree->root = NULL; 4000a964: c0 26 20 04 clr [ %i0 + 4 ] the_rbtree->first[0] = NULL; 4000a968: c0 26 20 08 clr [ %i0 + 8 ] the_rbtree->first[1] = NULL; 4000a96c: c0 26 20 0c clr [ %i0 + 0xc ] the_rbtree->compare_function = compare_function; 4000a970: 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-- ) { 4000a974: 10 80 00 06 b 4000a98c <_RBTree_Initialize+0x3c> 4000a978: fa 2e 20 14 stb %i5, [ %i0 + 0x14 ] _RBTree_Insert_unprotected(the_rbtree, next); 4000a97c: 90 10 00 18 mov %i0, %o0 4000a980: 7f ff ff 2e call 4000a638 <_RBTree_Insert_unprotected> 4000a984: b4 06 80 1c add %i2, %i4, %i2 4000a988: 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-- ) { 4000a98c: 80 a6 e0 00 cmp %i3, 0 4000a990: 12 bf ff fb bne 4000a97c <_RBTree_Initialize+0x2c> 4000a994: 92 10 00 1a mov %i2, %o1 4000a998: 81 c7 e0 08 ret 4000a99c: 81 e8 00 00 restore =============================================================================== 4000992c <_RBTree_Insert_unprotected>: */ RBTree_Node *_RBTree_Insert_unprotected( RBTree_Control *the_rbtree, RBTree_Node *the_node ) { 4000992c: 9d e3 bf a0 save %sp, -96, %sp if(!the_node) return (RBTree_Node*)-1; 40009930: 80 a6 60 00 cmp %i1, 0 40009934: 02 80 00 7c be 40009b24 <_RBTree_Insert_unprotected+0x1f8> 40009938: ba 10 00 18 mov %i0, %i5 RBTree_Node *iter_node = the_rbtree->root; 4000993c: f0 06 20 04 ld [ %i0 + 4 ], %i0 int compare_result; if (!iter_node) { /* special case: first node inserted */ 40009940: b6 96 20 00 orcc %i0, 0, %i3 40009944: 32 80 00 0c bne,a 40009974 <_RBTree_Insert_unprotected+0x48> 40009948: c2 07 60 10 ld [ %i5 + 0x10 ], %g1 the_node->color = RBT_BLACK; 4000994c: c0 26 60 0c clr [ %i1 + 0xc ] the_rbtree->root = the_node; 40009950: f2 27 60 04 st %i1, [ %i5 + 4 ] the_rbtree->first[0] = the_rbtree->first[1] = the_node; 40009954: f2 27 60 0c st %i1, [ %i5 + 0xc ] 40009958: f2 27 60 08 st %i1, [ %i5 + 8 ] the_node->parent = (RBTree_Node *) the_rbtree; 4000995c: fa 26 40 00 st %i5, [ %i1 ] the_node->child[RBT_LEFT] = the_node->child[RBT_RIGHT] = NULL; 40009960: c0 26 60 08 clr [ %i1 + 8 ] 40009964: c0 26 60 04 clr [ %i1 + 4 ] 40009968: 81 c7 e0 08 ret 4000996c: 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); 40009970: c2 07 60 10 ld [ %i5 + 0x10 ], %g1 40009974: 90 10 00 19 mov %i1, %o0 40009978: 9f c0 40 00 call %g1 4000997c: 92 10 00 18 mov %i0, %o1 if ( the_rbtree->is_unique && _RBTree_Is_equal( compare_result ) ) 40009980: c2 0f 60 14 ldub [ %i5 + 0x14 ], %g1 40009984: 80 a0 60 00 cmp %g1, 0 40009988: 02 80 00 05 be 4000999c <_RBTree_Insert_unprotected+0x70> 4000998c: b8 38 00 08 xnor %g0, %o0, %i4 40009990: 80 a2 20 00 cmp %o0, 0 40009994: 02 80 00 65 be 40009b28 <_RBTree_Insert_unprotected+0x1fc> 40009998: 01 00 00 00 nop return iter_node; RBTree_Direction dir = !_RBTree_Is_lesser( compare_result ); 4000999c: b9 37 20 1f srl %i4, 0x1f, %i4 if (!iter_node->child[dir]) { 400099a0: 83 2f 20 02 sll %i4, 2, %g1 400099a4: 82 06 00 01 add %i0, %g1, %g1 400099a8: f0 00 60 04 ld [ %g1 + 4 ], %i0 400099ac: 80 a6 20 00 cmp %i0, 0 400099b0: 32 bf ff f0 bne,a 40009970 <_RBTree_Insert_unprotected+0x44> 400099b4: b6 10 00 18 mov %i0, %i3 the_node->child[RBT_LEFT] = the_node->child[RBT_RIGHT] = NULL; 400099b8: c0 26 60 08 clr [ %i1 + 8 ] 400099bc: c0 26 60 04 clr [ %i1 + 4 ] the_node->color = RBT_RED; 400099c0: 84 10 20 01 mov 1, %g2 iter_node->child[dir] = the_node; 400099c4: 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; 400099c8: c4 26 60 0c st %g2, [ %i1 + 0xc ] iter_node->child[dir] = the_node; the_node->parent = iter_node; 400099cc: f6 26 40 00 st %i3, [ %i1 ] /* update min/max */ compare_result = the_rbtree->compare_function( 400099d0: 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]; 400099d4: b6 07 20 02 add %i4, 2, %i3 400099d8: 85 2e e0 02 sll %i3, 2, %g2 400099dc: d2 07 40 02 ld [ %i5 + %g2 ], %o1 400099e0: 9f c0 40 00 call %g1 400099e4: 90 10 00 19 mov %i1, %o0 the_node, _RBTree_First(the_rbtree, dir) ); if ( (!dir && _RBTree_Is_lesser(compare_result)) || 400099e8: 80 a7 20 00 cmp %i4, 0 400099ec: 12 80 00 06 bne 40009a04 <_RBTree_Insert_unprotected+0xd8> 400099f0: 80 a2 20 00 cmp %o0, 0 400099f4: 36 80 00 3c bge,a 40009ae4 <_RBTree_Insert_unprotected+0x1b8> 400099f8: d0 06 40 00 ld [ %i1 ], %o0 (dir && _RBTree_Is_greater(compare_result)) ) { the_rbtree->first[dir] = the_node; 400099fc: 10 80 00 04 b 40009a0c <_RBTree_Insert_unprotected+0xe0> 40009a00: 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)) ) { 40009a04: 04 80 00 37 ble 40009ae0 <_RBTree_Insert_unprotected+0x1b4> 40009a08: b7 2e e0 02 sll %i3, 2, %i3 the_rbtree->first[dir] = the_node; 40009a0c: 10 80 00 35 b 40009ae0 <_RBTree_Insert_unprotected+0x1b4> 40009a10: 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; 40009a14: 02 80 00 13 be 40009a60 <_RBTree_Insert_unprotected+0x134><== NEVER TAKEN 40009a18: 82 10 20 00 clr %g1 if(!(the_node->parent->parent->parent)) return NULL; 40009a1c: c2 07 40 00 ld [ %i5 ], %g1 40009a20: 80 a0 60 00 cmp %g1, 0 40009a24: 02 80 00 0f be 40009a60 <_RBTree_Insert_unprotected+0x134><== NEVER TAKEN 40009a28: 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]) 40009a2c: c2 07 60 04 ld [ %i5 + 4 ], %g1 40009a30: 80 a2 00 01 cmp %o0, %g1 40009a34: 22 80 00 02 be,a 40009a3c <_RBTree_Insert_unprotected+0x110> 40009a38: 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); 40009a3c: 80 a0 60 00 cmp %g1, 0 40009a40: 02 80 00 09 be 40009a64 <_RBTree_Insert_unprotected+0x138> 40009a44: 84 10 20 00 clr %g2 40009a48: c4 00 60 0c ld [ %g1 + 0xc ], %g2 40009a4c: 80 a0 a0 01 cmp %g2, 1 40009a50: 32 80 00 05 bne,a 40009a64 <_RBTree_Insert_unprotected+0x138> 40009a54: 84 10 20 00 clr %g2 40009a58: 10 80 00 03 b 40009a64 <_RBTree_Insert_unprotected+0x138> 40009a5c: 84 10 20 01 mov 1, %g2 40009a60: 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)) { 40009a64: 80 a0 a0 00 cmp %g2, 0 40009a68: 22 80 00 08 be,a 40009a88 <_RBTree_Insert_unprotected+0x15c> 40009a6c: c2 07 60 04 ld [ %i5 + 4 ], %g1 the_node->parent->color = RBT_BLACK; 40009a70: c0 22 20 0c clr [ %o0 + 0xc ] u->color = RBT_BLACK; 40009a74: c0 20 60 0c clr [ %g1 + 0xc ] g->color = RBT_RED; 40009a78: b2 10 00 1d mov %i5, %i1 40009a7c: 82 10 20 01 mov 1, %g1 40009a80: 10 80 00 18 b 40009ae0 <_RBTree_Insert_unprotected+0x1b4> 40009a84: 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]; 40009a88: 82 1a 00 01 xor %o0, %g1, %g1 40009a8c: 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]; 40009a90: c2 02 20 04 ld [ %o0 + 4 ], %g1 RBTree_Direction pdir = the_node->parent != g->child[0]; 40009a94: 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]; 40009a98: 82 1e 40 01 xor %i1, %g1, %g1 40009a9c: 80 a0 00 01 cmp %g0, %g1 40009aa0: 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) { 40009aa4: 80 a0 40 1c cmp %g1, %i4 40009aa8: 22 80 00 08 be,a 40009ac8 <_RBTree_Insert_unprotected+0x19c> 40009aac: c2 06 40 00 ld [ %i1 ], %g1 _RBTree_Rotate(the_node->parent, pdir); 40009ab0: 7f ff ff 80 call 400098b0 <_RBTree_Rotate> 40009ab4: 92 10 00 1c mov %i4, %o1 the_node = the_node->child[pdir]; 40009ab8: 83 2f 20 02 sll %i4, 2, %g1 40009abc: b2 06 40 01 add %i1, %g1, %i1 40009ac0: f2 06 60 04 ld [ %i1 + 4 ], %i1 } the_node->parent->color = RBT_BLACK; 40009ac4: c2 06 40 00 ld [ %i1 ], %g1 g->color = RBT_RED; 40009ac8: 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; 40009acc: c0 20 60 0c clr [ %g1 + 0xc ] g->color = RBT_RED; 40009ad0: d2 27 60 0c st %o1, [ %i5 + 0xc ] /* now rotate grandparent in the other branch direction (toward uncle) */ _RBTree_Rotate(g, (1-pdir)); 40009ad4: 90 10 00 1d mov %i5, %o0 40009ad8: 7f ff ff 76 call 400098b0 <_RBTree_Rotate> 40009adc: 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; 40009ae0: d0 06 40 00 ld [ %i1 ], %o0 40009ae4: fa 02 00 00 ld [ %o0 ], %i5 40009ae8: 80 a7 60 00 cmp %i5, 0 40009aec: 22 80 00 06 be,a 40009b04 <_RBTree_Insert_unprotected+0x1d8> 40009af0: 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); 40009af4: c2 02 20 0c ld [ %o0 + 0xc ], %g1 40009af8: 82 18 60 01 xor %g1, 1, %g1 40009afc: 80 a0 00 01 cmp %g0, %g1 40009b00: 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))) { 40009b04: 80 a0 60 00 cmp %g1, 0 40009b08: 12 bf ff c3 bne 40009a14 <_RBTree_Insert_unprotected+0xe8> 40009b0c: 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; 40009b10: 12 80 00 06 bne 40009b28 <_RBTree_Insert_unprotected+0x1fc> 40009b14: 01 00 00 00 nop 40009b18: c0 26 60 0c clr [ %i1 + 0xc ] 40009b1c: 81 c7 e0 08 ret 40009b20: 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; 40009b24: b0 10 3f ff mov -1, %i0 /* verify red-black properties */ _RBTree_Validate_insert_unprotected(the_node); } return (RBTree_Node*)0; } 40009b28: 81 c7 e0 08 ret 40009b2c: 81 e8 00 00 restore =============================================================================== 40009b60 <_RBTree_Iterate_unprotected>: const RBTree_Control *rbtree, RBTree_Direction dir, RBTree_Visitor visitor, void *visitor_arg ) { 40009b60: 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; 40009b64: b8 10 20 00 clr %i4 */ RTEMS_INLINE_ROUTINE RBTree_Direction _RBTree_Opposite_direction( RBTree_Direction the_dir ) { return (RBTree_Direction) !((int) the_dir); 40009b68: 80 a0 00 19 cmp %g0, %i1 40009b6c: 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]; 40009b70: 82 00 60 02 add %g1, 2, %g1 40009b74: 83 28 60 02 sll %g1, 2, %g1 while ( !stop && current != NULL ) { 40009b78: 10 80 00 0a b 40009ba0 <_RBTree_Iterate_unprotected+0x40> 40009b7c: fa 06 00 01 ld [ %i0 + %g1 ], %i5 stop = (*visitor)( current, dir, visitor_arg ); 40009b80: 92 10 00 19 mov %i1, %o1 40009b84: 9f c6 80 00 call %i2 40009b88: 94 10 00 1b mov %i3, %o2 current = _RBTree_Next_unprotected( current, dir ); 40009b8c: 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 ); 40009b90: b8 10 00 08 mov %o0, %i4 current = _RBTree_Next_unprotected( current, dir ); 40009b94: 40 00 00 0b call 40009bc0 <_RBTree_Next_unprotected> 40009b98: 90 10 00 1d mov %i5, %o0 40009b9c: 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 ) { 40009ba0: 80 a7 60 00 cmp %i5, 0 40009ba4: 02 80 00 05 be 40009bb8 <_RBTree_Iterate_unprotected+0x58> 40009ba8: b8 1f 20 01 xor %i4, 1, %i4 40009bac: 80 8f 20 ff btst 0xff, %i4 40009bb0: 12 bf ff f4 bne 40009b80 <_RBTree_Iterate_unprotected+0x20><== ALWAYS TAKEN 40009bb4: 90 10 00 1d mov %i5, %o0 40009bb8: 81 c7 e0 08 ret 40009bbc: 81 e8 00 00 restore =============================================================================== 400094c8 <_RBTree_Rotate>: RBTree_Node *the_node, RBTree_Direction dir ) { RBTree_Node *c; if (the_node == NULL) return; 400094c8: 80 a2 20 00 cmp %o0, 0 400094cc: 02 80 00 1c be 4000953c <_RBTree_Rotate+0x74> <== NEVER TAKEN 400094d0: 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); 400094d4: 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; 400094d8: 87 28 e0 02 sll %g3, 2, %g3 400094dc: 86 02 00 03 add %o0, %g3, %g3 400094e0: c2 00 e0 04 ld [ %g3 + 4 ], %g1 400094e4: 80 a0 60 00 cmp %g1, 0 400094e8: 02 80 00 15 be 4000953c <_RBTree_Rotate+0x74> <== NEVER TAKEN 400094ec: 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]; 400094f0: 84 00 40 09 add %g1, %o1, %g2 400094f4: c8 00 a0 04 ld [ %g2 + 4 ], %g4 400094f8: c8 20 e0 04 st %g4, [ %g3 + 4 ] if (c->child[dir]) 400094fc: c4 00 a0 04 ld [ %g2 + 4 ], %g2 40009500: 80 a0 a0 00 cmp %g2, 0 40009504: 32 80 00 02 bne,a 4000950c <_RBTree_Rotate+0x44> 40009508: 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; 4000950c: 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; 40009510: 92 00 40 09 add %g1, %o1, %o1 40009514: d0 22 60 04 st %o0, [ %o1 + 4 ] the_node->parent->child[the_node != the_node->parent->child[0]] = c; 40009518: c6 00 a0 04 ld [ %g2 + 4 ], %g3 c->parent = the_node->parent; 4000951c: 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; 40009520: 86 1a 00 03 xor %o0, %g3, %g3 c->parent = the_node->parent; the_node->parent = c; 40009524: 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; 40009528: 80 a0 00 03 cmp %g0, %g3 4000952c: 86 40 20 00 addx %g0, 0, %g3 40009530: 87 28 e0 02 sll %g3, 2, %g3 40009534: 86 00 80 03 add %g2, %g3, %g3 40009538: c2 20 e0 04 st %g1, [ %g3 + 4 ] 4000953c: 81 c3 e0 08 retl =============================================================================== 40009478 <_RBTree_Sibling>: */ RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_Sibling( const RBTree_Node *the_node ) { if(!the_node) return NULL; 40009478: 80 a2 20 00 cmp %o0, 0 4000947c: 02 80 00 10 be 400094bc <_RBTree_Sibling+0x44> <== NEVER TAKEN 40009480: 82 10 20 00 clr %g1 if(!(the_node->parent)) return NULL; 40009484: c4 02 00 00 ld [ %o0 ], %g2 40009488: 80 a0 a0 00 cmp %g2, 0 4000948c: 22 80 00 0d be,a 400094c0 <_RBTree_Sibling+0x48> <== NEVER TAKEN 40009490: 90 10 00 01 mov %g1, %o0 <== NOT EXECUTED if(!(the_node->parent->parent)) return NULL; 40009494: c2 00 80 00 ld [ %g2 ], %g1 40009498: 80 a0 60 00 cmp %g1, 0 4000949c: 02 80 00 08 be 400094bc <_RBTree_Sibling+0x44> 400094a0: 82 10 20 00 clr %g1 if(the_node == the_node->parent->child[RBT_LEFT]) 400094a4: c2 00 a0 04 ld [ %g2 + 4 ], %g1 400094a8: 80 a2 00 01 cmp %o0, %g1 400094ac: 22 80 00 04 be,a 400094bc <_RBTree_Sibling+0x44> 400094b0: c2 00 a0 08 ld [ %g2 + 8 ], %g1 return the_node->parent->child[RBT_RIGHT]; 400094b4: 81 c3 e0 08 retl 400094b8: 90 10 00 01 mov %g1, %o0 else return the_node->parent->child[RBT_LEFT]; } 400094bc: 90 10 00 01 mov %g1, %o0 400094c0: 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 =============================================================================== 40032610 <_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 ) { 40032610: 9d e3 bf 98 save %sp, -104, %sp */ static inline void _TOD_Get_uptime( Timestamp_Control *time ) { _TOD_Get_with_nanoseconds( time, &_TOD.uptime ); 40032614: 13 10 01 8c sethi %hi(0x40063000), %o1 #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ Timestamp_Control uptime; #endif Thread_Control *owning_thread = the_period->owner; 40032618: f6 06 20 40 ld [ %i0 + 0x40 ], %i3 4003261c: 90 07 bf f8 add %fp, -8, %o0 40032620: 7f ff 54 a7 call 400078bc <_TOD_Get_with_nanoseconds> 40032624: 92 12 61 10 or %o1, 0x110, %o1 /* * Determine elapsed wall time since period initiated. */ #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ _TOD_Get_uptime( &uptime ); _Timestamp_Subtract( 40032628: c4 1f bf f8 ldd [ %fp + -8 ], %g2 const Timestamp64_Control *_start, const Timestamp64_Control *_end, Timestamp64_Control *_result ) { *_result = *_end - *_start; 4003262c: 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) { 40032630: 09 10 01 8d sethi %hi(0x40063400), %g4 40032634: ba a0 c0 1d subcc %g3, %i5, %i5 40032638: 88 11 22 d0 or %g4, 0x2d0, %g4 4003263c: b8 60 80 1c subx %g2, %i4, %i4 40032640: f8 3e 40 00 std %i4, [ %i1 ] 40032644: fa 01 20 10 ld [ %g4 + 0x10 ], %i5 #endif /* * Determine cpu usage since period initiated. */ used = owning_thread->cpu_time_used; 40032648: d8 1e e0 80 ldd [ %i3 + 0x80 ], %o4 #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ if (owning_thread == _Thread_Executing) { 4003264c: 80 a6 c0 1d cmp %i3, %i5 40032650: 12 80 00 15 bne 400326a4 <_Rate_monotonic_Get_status+0x94> 40032654: 82 10 20 01 mov 1, %g1 40032658: f8 19 20 20 ldd [ %g4 + 0x20 ], %i4 4003265c: 86 a0 c0 1d subcc %g3, %i5, %g3 40032660: 84 60 80 1c subx %g2, %i4, %g2 static inline void _Timestamp64_implementation_Add_to( Timestamp64_Control *_time, const Timestamp64_Control *_add ) { *_time += *_add; 40032664: ba 83 40 03 addcc %o5, %g3, %i5 40032668: b8 43 00 02 addx %o4, %g2, %i4 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 4003266c: 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)) 40032670: 80 a0 80 1c cmp %g2, %i4 40032674: 34 80 00 0c bg,a 400326a4 <_Rate_monotonic_Get_status+0x94><== NEVER TAKEN 40032678: 82 10 20 00 clr %g1 <== NOT EXECUTED 4003267c: 32 80 00 06 bne,a 40032694 <_Rate_monotonic_Get_status+0x84> 40032680: 86 a7 40 03 subcc %i5, %g3, %g3 40032684: 80 a0 c0 1d cmp %g3, %i5 40032688: 18 80 00 06 bgu 400326a0 <_Rate_monotonic_Get_status+0x90> 4003268c: 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; 40032690: 82 10 20 01 mov 1, %g1 const Timestamp64_Control *_start, const Timestamp64_Control *_end, Timestamp64_Control *_result ) { *_result = *_end - *_start; 40032694: 84 67 00 02 subx %i4, %g2, %g2 40032698: 10 80 00 03 b 400326a4 <_Rate_monotonic_Get_status+0x94> 4003269c: 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; 400326a0: 82 10 20 00 clr %g1 return false; *cpu_since_last_period = used - the_period->cpu_usage_period_initiated; #endif return true; } 400326a4: b0 08 60 01 and %g1, 1, %i0 400326a8: 81 c7 e0 08 ret 400326ac: 81 e8 00 00 restore =============================================================================== 40032a18 <_Rate_monotonic_Timeout>: void _Rate_monotonic_Timeout( Objects_Id id, void *ignored ) { 40032a18: 9d e3 bf 98 save %sp, -104, %sp 40032a1c: 11 10 01 8f sethi %hi(0x40063c00), %o0 40032a20: 92 10 00 18 mov %i0, %o1 40032a24: 90 12 20 98 or %o0, 0x98, %o0 40032a28: 7f ff 56 4c call 40008358 <_Objects_Get> 40032a2c: 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 ) { 40032a30: c2 07 bf fc ld [ %fp + -4 ], %g1 40032a34: 80 a0 60 00 cmp %g1, 0 40032a38: 12 80 00 24 bne 40032ac8 <_Rate_monotonic_Timeout+0xb0> <== NEVER TAKEN 40032a3c: ba 10 00 08 mov %o0, %i5 case OBJECTS_LOCAL: the_thread = the_period->owner; 40032a40: d0 02 20 40 ld [ %o0 + 0x40 ], %o0 if ( _States_Is_waiting_for_period( the_thread->current_state ) && 40032a44: 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); 40032a48: c4 02 20 10 ld [ %o0 + 0x10 ], %g2 40032a4c: 80 88 80 01 btst %g2, %g1 40032a50: 22 80 00 0b be,a 40032a7c <_Rate_monotonic_Timeout+0x64> 40032a54: c2 07 60 38 ld [ %i5 + 0x38 ], %g1 40032a58: c4 02 20 20 ld [ %o0 + 0x20 ], %g2 40032a5c: c2 07 60 08 ld [ %i5 + 8 ], %g1 40032a60: 80 a0 80 01 cmp %g2, %g1 40032a64: 32 80 00 06 bne,a 40032a7c <_Rate_monotonic_Timeout+0x64> 40032a68: 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 ); 40032a6c: 13 04 01 ff sethi %hi(0x1007fc00), %o1 40032a70: 7f ff 58 e5 call 40008e04 <_Thread_Clear_state> 40032a74: 92 12 63 f8 or %o1, 0x3f8, %o1 ! 1007fff8 40032a78: 30 80 00 06 b,a 40032a90 <_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 ) { 40032a7c: 80 a0 60 01 cmp %g1, 1 40032a80: 12 80 00 0d bne 40032ab4 <_Rate_monotonic_Timeout+0x9c> 40032a84: 82 10 20 04 mov 4, %g1 the_period->state = RATE_MONOTONIC_EXPIRED_WHILE_BLOCKING; 40032a88: 82 10 20 03 mov 3, %g1 40032a8c: c2 27 60 38 st %g1, [ %i5 + 0x38 ] _Rate_monotonic_Initiate_statistics( the_period ); 40032a90: 7f ff ff 51 call 400327d4 <_Rate_monotonic_Initiate_statistics> 40032a94: 90 10 00 1d mov %i5, %o0 Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 40032a98: c2 07 60 3c ld [ %i5 + 0x3c ], %g1 _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 40032a9c: 11 10 01 8c sethi %hi(0x40063000), %o0 Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 40032aa0: c2 27 60 1c st %g1, [ %i5 + 0x1c ] _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 40032aa4: 90 12 22 58 or %o0, 0x258, %o0 40032aa8: 7f ff 5c bc call 40009d98 <_Watchdog_Insert> 40032aac: 92 07 60 10 add %i5, 0x10, %o1 40032ab0: 30 80 00 02 b,a 40032ab8 <_Rate_monotonic_Timeout+0xa0> _Watchdog_Insert_ticks( &the_period->Timer, the_period->next_length ); } else the_period->state = RATE_MONOTONIC_EXPIRED; 40032ab4: 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; 40032ab8: 03 10 01 8c sethi %hi(0x40063000), %g1 40032abc: c4 00 61 c0 ld [ %g1 + 0x1c0 ], %g2 ! 400631c0 <_Thread_Dispatch_disable_level> --level; 40032ac0: 84 00 bf ff add %g2, -1, %g2 _Thread_Dispatch_disable_level = level; 40032ac4: c4 20 61 c0 st %g2, [ %g1 + 0x1c0 ] 40032ac8: 81 c7 e0 08 ret 40032acc: 81 e8 00 00 restore =============================================================================== 400326b0 <_Rate_monotonic_Update_statistics>: } static void _Rate_monotonic_Update_statistics( Rate_monotonic_Control *the_period ) { 400326b0: 9d e3 bf 90 save %sp, -112, %sp /* * Update the counts. */ stats = &the_period->Statistics; stats->count++; 400326b4: c2 06 20 58 ld [ %i0 + 0x58 ], %g1 400326b8: 82 00 60 01 inc %g1 400326bc: c2 26 20 58 st %g1, [ %i0 + 0x58 ] if ( the_period->state == RATE_MONOTONIC_EXPIRED ) 400326c0: c2 06 20 38 ld [ %i0 + 0x38 ], %g1 400326c4: 80 a0 60 04 cmp %g1, 4 400326c8: 12 80 00 05 bne 400326dc <_Rate_monotonic_Update_statistics+0x2c> 400326cc: 90 10 00 18 mov %i0, %o0 stats->missed_count++; 400326d0: c2 06 20 5c ld [ %i0 + 0x5c ], %g1 400326d4: 82 00 60 01 inc %g1 400326d8: c2 26 20 5c st %g1, [ %i0 + 0x5c ] /* * Grab status for time statistics. */ valid_status = 400326dc: 92 07 bf f8 add %fp, -8, %o1 400326e0: 7f ff ff cc call 40032610 <_Rate_monotonic_Get_status> 400326e4: 94 07 bf f0 add %fp, -16, %o2 _Rate_monotonic_Get_status( the_period, &since_last_period, &executed ); if (!valid_status) 400326e8: 80 8a 20 ff btst 0xff, %o0 400326ec: 02 80 00 38 be 400327cc <_Rate_monotonic_Update_statistics+0x11c> 400326f0: c4 1f bf f0 ldd [ %fp + -16 ], %g2 static inline void _Timestamp64_implementation_Add_to( Timestamp64_Control *_time, const Timestamp64_Control *_add ) { *_time += *_add; 400326f4: 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 ) ) 400326f8: c2 06 20 60 ld [ %i0 + 0x60 ], %g1 400326fc: b6 87 40 03 addcc %i5, %g3, %i3 40032700: b4 47 00 02 addx %i4, %g2, %i2 40032704: 80 a0 40 02 cmp %g1, %g2 40032708: 14 80 00 09 bg 4003272c <_Rate_monotonic_Update_statistics+0x7c> 4003270c: f4 3e 20 70 std %i2, [ %i0 + 0x70 ] 40032710: 80 a0 40 02 cmp %g1, %g2 40032714: 32 80 00 08 bne,a 40032734 <_Rate_monotonic_Update_statistics+0x84><== NEVER TAKEN 40032718: c2 06 20 68 ld [ %i0 + 0x68 ], %g1 <== NOT EXECUTED 4003271c: c2 06 20 64 ld [ %i0 + 0x64 ], %g1 40032720: 80 a0 40 03 cmp %g1, %g3 40032724: 28 80 00 04 bleu,a 40032734 <_Rate_monotonic_Update_statistics+0x84> 40032728: c2 06 20 68 ld [ %i0 + 0x68 ], %g1 stats->min_cpu_time = executed; 4003272c: c4 3e 20 60 std %g2, [ %i0 + 0x60 ] if ( _Timestamp_Greater_than( &executed, &stats->max_cpu_time ) ) 40032730: c2 06 20 68 ld [ %i0 + 0x68 ], %g1 40032734: 80 a0 40 02 cmp %g1, %g2 40032738: 26 80 00 0a bl,a 40032760 <_Rate_monotonic_Update_statistics+0xb0><== NEVER TAKEN 4003273c: c4 3e 20 68 std %g2, [ %i0 + 0x68 ] <== NOT EXECUTED 40032740: 80 a0 40 02 cmp %g1, %g2 40032744: 32 80 00 08 bne,a 40032764 <_Rate_monotonic_Update_statistics+0xb4><== NEVER TAKEN 40032748: c4 1f bf f8 ldd [ %fp + -8 ], %g2 <== NOT EXECUTED 4003274c: c2 06 20 6c ld [ %i0 + 0x6c ], %g1 40032750: 80 a0 40 03 cmp %g1, %g3 40032754: 3a 80 00 04 bcc,a 40032764 <_Rate_monotonic_Update_statistics+0xb4> 40032758: c4 1f bf f8 ldd [ %fp + -8 ], %g2 stats->max_cpu_time = executed; 4003275c: 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 ); 40032760: c4 1f bf f8 ldd [ %fp + -8 ], %g2 40032764: f8 1e 20 88 ldd [ %i0 + 0x88 ], %i4 if ( _Timestamp_Less_than( &since_last_period, &stats->min_wall_time ) ) 40032768: c2 06 20 78 ld [ %i0 + 0x78 ], %g1 4003276c: b6 87 40 03 addcc %i5, %g3, %i3 40032770: b4 47 00 02 addx %i4, %g2, %i2 40032774: 80 a0 40 02 cmp %g1, %g2 40032778: 14 80 00 09 bg 4003279c <_Rate_monotonic_Update_statistics+0xec> 4003277c: f4 3e 20 88 std %i2, [ %i0 + 0x88 ] 40032780: 80 a0 40 02 cmp %g1, %g2 40032784: 32 80 00 08 bne,a 400327a4 <_Rate_monotonic_Update_statistics+0xf4><== NEVER TAKEN 40032788: c2 06 20 80 ld [ %i0 + 0x80 ], %g1 <== NOT EXECUTED 4003278c: c2 06 20 7c ld [ %i0 + 0x7c ], %g1 40032790: 80 a0 40 03 cmp %g1, %g3 40032794: 28 80 00 04 bleu,a 400327a4 <_Rate_monotonic_Update_statistics+0xf4> 40032798: c2 06 20 80 ld [ %i0 + 0x80 ], %g1 stats->min_wall_time = since_last_period; 4003279c: c4 3e 20 78 std %g2, [ %i0 + 0x78 ] if ( _Timestamp_Greater_than( &since_last_period, &stats->max_wall_time ) ) 400327a0: c2 06 20 80 ld [ %i0 + 0x80 ], %g1 400327a4: 80 a0 40 02 cmp %g1, %g2 400327a8: 26 80 00 09 bl,a 400327cc <_Rate_monotonic_Update_statistics+0x11c><== NEVER TAKEN 400327ac: c4 3e 20 80 std %g2, [ %i0 + 0x80 ] <== NOT EXECUTED 400327b0: 80 a0 40 02 cmp %g1, %g2 400327b4: 12 80 00 06 bne 400327cc <_Rate_monotonic_Update_statistics+0x11c><== NEVER TAKEN 400327b8: 01 00 00 00 nop 400327bc: c2 06 20 84 ld [ %i0 + 0x84 ], %g1 400327c0: 80 a0 40 03 cmp %g1, %g3 400327c4: 2a 80 00 02 bcs,a 400327cc <_Rate_monotonic_Update_statistics+0x11c> 400327c8: c4 3e 20 80 std %g2, [ %i0 + 0x80 ] 400327cc: 81 c7 e0 08 ret 400327d0: 81 e8 00 00 restore =============================================================================== 40009828 <_Scheduler_CBS_Allocate>: #include void *_Scheduler_CBS_Allocate( Thread_Control *the_thread ) { 40009828: 9d e3 bf a0 save %sp, -96, %sp void *sched; Scheduler_CBS_Per_thread *schinfo; sched = _Workspace_Allocate(sizeof(Scheduler_CBS_Per_thread)); 4000982c: 40 00 06 8d call 4000b260 <_Workspace_Allocate> 40009830: 90 10 20 1c mov 0x1c, %o0 if ( sched ) { 40009834: 80 a2 20 00 cmp %o0, 0 40009838: 02 80 00 06 be 40009850 <_Scheduler_CBS_Allocate+0x28> <== NEVER TAKEN 4000983c: 82 10 20 02 mov 2, %g1 the_thread->scheduler_info = sched; 40009840: d0 26 20 88 st %o0, [ %i0 + 0x88 ] schinfo = (Scheduler_CBS_Per_thread *)(the_thread->scheduler_info); schinfo->edf_per_thread.thread = the_thread; 40009844: f0 22 00 00 st %i0, [ %o0 ] schinfo->edf_per_thread.queue_state = SCHEDULER_EDF_QUEUE_STATE_NEVER_HAS_BEEN; 40009848: c2 22 20 14 st %g1, [ %o0 + 0x14 ] schinfo->cbs_server = NULL; 4000984c: c0 22 20 18 clr [ %o0 + 0x18 ] } return sched; } 40009850: 81 c7 e0 08 ret 40009854: 91 e8 00 08 restore %g0, %o0, %o0 =============================================================================== 4000ab68 <_Scheduler_CBS_Budget_callout>: Scheduler_CBS_Server **_Scheduler_CBS_Server_list; void _Scheduler_CBS_Budget_callout( Thread_Control *the_thread ) { 4000ab68: 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; 4000ab6c: d2 06 20 ac ld [ %i0 + 0xac ], %o1 if ( the_thread->real_priority != new_priority ) 4000ab70: c2 06 20 18 ld [ %i0 + 0x18 ], %g1 4000ab74: 80 a0 40 09 cmp %g1, %o1 4000ab78: 32 80 00 02 bne,a 4000ab80 <_Scheduler_CBS_Budget_callout+0x18><== ALWAYS TAKEN 4000ab7c: d2 26 20 18 st %o1, [ %i0 + 0x18 ] the_thread->real_priority = new_priority; if ( the_thread->current_priority != new_priority ) 4000ab80: c2 06 20 14 ld [ %i0 + 0x14 ], %g1 4000ab84: 80 a0 40 09 cmp %g1, %o1 4000ab88: 02 80 00 04 be 4000ab98 <_Scheduler_CBS_Budget_callout+0x30><== NEVER TAKEN 4000ab8c: 90 10 00 18 mov %i0, %o0 _Thread_Change_priority(the_thread, new_priority, true); 4000ab90: 40 00 01 83 call 4000b19c <_Thread_Change_priority> 4000ab94: 94 10 20 01 mov 1, %o2 /* Invoke callback function if any. */ sched_info = (Scheduler_CBS_Per_thread *) the_thread->scheduler_info; 4000ab98: fa 06 20 88 ld [ %i0 + 0x88 ], %i5 if ( sched_info->cbs_server->cbs_budget_overrun ) { 4000ab9c: c2 07 60 18 ld [ %i5 + 0x18 ], %g1 4000aba0: c4 00 60 0c ld [ %g1 + 0xc ], %g2 4000aba4: 80 a0 a0 00 cmp %g2, 0 4000aba8: 02 80 00 09 be 4000abcc <_Scheduler_CBS_Budget_callout+0x64><== NEVER TAKEN 4000abac: 01 00 00 00 nop _Scheduler_CBS_Get_server_id( 4000abb0: d0 00 40 00 ld [ %g1 ], %o0 4000abb4: 7f ff ff d7 call 4000ab10 <_Scheduler_CBS_Get_server_id> 4000abb8: 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 ); 4000abbc: c2 07 60 18 ld [ %i5 + 0x18 ], %g1 4000abc0: c2 00 60 0c ld [ %g1 + 0xc ], %g1 4000abc4: 9f c0 40 00 call %g1 4000abc8: d0 07 bf fc ld [ %fp + -4 ], %o0 4000abcc: 81 c7 e0 08 ret 4000abd0: 81 e8 00 00 restore =============================================================================== 4000a770 <_Scheduler_CBS_Create_server>: int _Scheduler_CBS_Create_server ( Scheduler_CBS_Parameters *params, Scheduler_CBS_Budget_overrun budget_overrun_callback, rtems_id *server_id ) { 4000a770: 9d e3 bf a0 save %sp, -96, %sp unsigned int i; Scheduler_CBS_Server *the_server; if ( params->budget <= 0 || 4000a774: c2 06 20 04 ld [ %i0 + 4 ], %g1 4000a778: 80 a0 60 00 cmp %g1, 0 4000a77c: 04 80 00 1d ble 4000a7f0 <_Scheduler_CBS_Create_server+0x80> 4000a780: 01 00 00 00 nop 4000a784: c2 06 00 00 ld [ %i0 ], %g1 4000a788: 80 a0 60 00 cmp %g1, 0 4000a78c: 04 80 00 19 ble 4000a7f0 <_Scheduler_CBS_Create_server+0x80> 4000a790: 03 10 00 83 sethi %hi(0x40020c00), %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++ ) { 4000a794: c4 00 61 70 ld [ %g1 + 0x170 ], %g2 ! 40020d70 <_Scheduler_CBS_Maximum_servers> if ( !_Scheduler_CBS_Server_list[i] ) 4000a798: 03 10 00 87 sethi %hi(0x40021c00), %g1 4000a79c: c6 00 62 88 ld [ %g1 + 0x288 ], %g3 ! 40021e88 <_Scheduler_CBS_Server_list> 4000a7a0: 10 80 00 07 b 4000a7bc <_Scheduler_CBS_Create_server+0x4c> 4000a7a4: 82 10 20 00 clr %g1 4000a7a8: c8 00 c0 1c ld [ %g3 + %i4 ], %g4 4000a7ac: 80 a1 20 00 cmp %g4, 0 4000a7b0: 02 80 00 14 be 4000a800 <_Scheduler_CBS_Create_server+0x90> 4000a7b4: 3b 10 00 87 sethi %hi(0x40021c00), %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++ ) { 4000a7b8: 82 00 60 01 inc %g1 4000a7bc: 80 a0 40 02 cmp %g1, %g2 4000a7c0: 12 bf ff fa bne 4000a7a8 <_Scheduler_CBS_Create_server+0x38> 4000a7c4: 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; 4000a7c8: 81 c7 e0 08 ret 4000a7cc: 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; 4000a7d0: c4 20 60 04 st %g2, [ %g1 + 4 ] 4000a7d4: c4 06 20 04 ld [ %i0 + 4 ], %g2 the_server->task_id = -1; the_server->cbs_budget_overrun = budget_overrun_callback; 4000a7d8: 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; 4000a7dc: c4 20 60 08 st %g2, [ %g1 + 8 ] the_server->task_id = -1; 4000a7e0: 84 10 3f ff mov -1, %g2 4000a7e4: c4 20 40 00 st %g2, [ %g1 ] the_server->cbs_budget_overrun = budget_overrun_callback; return SCHEDULER_CBS_OK; 4000a7e8: 81 c7 e0 08 ret 4000a7ec: 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; 4000a7f0: 81 c7 e0 08 ret 4000a7f4: 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; 4000a7f8: 81 c7 e0 08 ret <== NOT EXECUTED 4000a7fc: 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 *) 4000a800: f6 07 62 88 ld [ %i5 + 0x288 ], %i3 } if ( i == _Scheduler_CBS_Maximum_servers ) return SCHEDULER_CBS_ERROR_FULL; *server_id = i; 4000a804: c2 26 80 00 st %g1, [ %i2 ] _Scheduler_CBS_Server_list[*server_id] = (Scheduler_CBS_Server *) _Workspace_Allocate( sizeof(Scheduler_CBS_Server) ); 4000a808: 40 00 07 7f call 4000c604 <_Workspace_Allocate> 4000a80c: 90 10 20 10 mov 0x10, %o0 the_server = _Scheduler_CBS_Server_list[*server_id]; 4000a810: 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 *) 4000a814: d0 26 c0 1c st %o0, [ %i3 + %i4 ] _Workspace_Allocate( sizeof(Scheduler_CBS_Server) ); the_server = _Scheduler_CBS_Server_list[*server_id]; 4000a818: c4 07 62 88 ld [ %i5 + 0x288 ], %g2 4000a81c: 83 28 60 02 sll %g1, 2, %g1 4000a820: c2 00 80 01 ld [ %g2 + %g1 ], %g1 if ( !the_server ) 4000a824: 80 a0 60 00 cmp %g1, 0 4000a828: 32 bf ff ea bne,a 4000a7d0 <_Scheduler_CBS_Create_server+0x60><== ALWAYS TAKEN 4000a82c: c4 06 00 00 ld [ %i0 ], %g2 4000a830: 30 bf ff f2 b,a 4000a7f8 <_Scheduler_CBS_Create_server+0x88><== NOT EXECUTED =============================================================================== 4000a8a8 <_Scheduler_CBS_Detach_thread>: int _Scheduler_CBS_Detach_thread ( Scheduler_CBS_Server_id server_id, rtems_id task_id ) { 4000a8a8: 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); 4000a8ac: 90 10 00 19 mov %i1, %o0 4000a8b0: 40 00 03 61 call 4000b634 <_Thread_Get> 4000a8b4: 92 07 bf fc add %fp, -4, %o1 /* The routine _Thread_Get may disable dispatch and not enable again. */ if ( the_thread ) { 4000a8b8: ba 92 20 00 orcc %o0, 0, %i5 4000a8bc: 02 80 00 05 be 4000a8d0 <_Scheduler_CBS_Detach_thread+0x28> 4000a8c0: 03 10 00 83 sethi %hi(0x40020c00), %g1 _Thread_Enable_dispatch(); 4000a8c4: 40 00 03 50 call 4000b604 <_Thread_Enable_dispatch> 4000a8c8: 01 00 00 00 nop } if ( server_id >= _Scheduler_CBS_Maximum_servers ) 4000a8cc: 03 10 00 83 sethi %hi(0x40020c00), %g1 4000a8d0: c2 00 61 70 ld [ %g1 + 0x170 ], %g1 ! 40020d70 <_Scheduler_CBS_Maximum_servers> 4000a8d4: 80 a6 00 01 cmp %i0, %g1 4000a8d8: 1a 80 00 1b bcc 4000a944 <_Scheduler_CBS_Detach_thread+0x9c> 4000a8dc: 80 a7 60 00 cmp %i5, 0 return SCHEDULER_CBS_ERROR_INVALID_PARAMETER; if ( !the_thread ) 4000a8e0: 02 80 00 19 be 4000a944 <_Scheduler_CBS_Detach_thread+0x9c> 4000a8e4: 03 10 00 87 sethi %hi(0x40021c00), %g1 return SCHEDULER_CBS_ERROR_INVALID_PARAMETER; /* Server is not valid. */ if ( !_Scheduler_CBS_Server_list[server_id] ) 4000a8e8: c2 00 62 88 ld [ %g1 + 0x288 ], %g1 ! 40021e88 <_Scheduler_CBS_Server_list> 4000a8ec: b1 2e 20 02 sll %i0, 2, %i0 4000a8f0: c2 00 40 18 ld [ %g1 + %i0 ], %g1 4000a8f4: 80 a0 60 00 cmp %g1, 0 4000a8f8: 02 80 00 11 be 4000a93c <_Scheduler_CBS_Detach_thread+0x94> 4000a8fc: 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 ) 4000a900: c4 00 40 00 ld [ %g1 ], %g2 4000a904: 80 a0 80 19 cmp %g2, %i1 4000a908: 12 80 00 0f bne 4000a944 <_Scheduler_CBS_Detach_thread+0x9c><== NEVER TAKEN 4000a90c: 84 10 3f ff mov -1, %g2 return SCHEDULER_CBS_ERROR_INVALID_PARAMETER; _Scheduler_CBS_Server_list[server_id]->task_id = -1; 4000a910: c4 20 40 00 st %g2, [ %g1 ] sched_info = (Scheduler_CBS_Per_thread *) the_thread->scheduler_info; sched_info->cbs_server = NULL; 4000a914: c2 07 60 88 ld [ %i5 + 0x88 ], %g1 4000a918: c0 20 60 18 clr [ %g1 + 0x18 ] the_thread->budget_algorithm = the_thread->Start.budget_algorithm; 4000a91c: c2 07 60 a0 ld [ %i5 + 0xa0 ], %g1 4000a920: c2 27 60 78 st %g1, [ %i5 + 0x78 ] the_thread->budget_callout = the_thread->Start.budget_callout; 4000a924: c2 07 60 a4 ld [ %i5 + 0xa4 ], %g1 4000a928: c2 27 60 7c st %g1, [ %i5 + 0x7c ] the_thread->is_preemptible = the_thread->Start.is_preemptible; 4000a92c: c2 0f 60 9c ldub [ %i5 + 0x9c ], %g1 4000a930: c2 2f 60 70 stb %g1, [ %i5 + 0x70 ] return SCHEDULER_CBS_OK; 4000a934: 81 c7 e0 08 ret 4000a938: 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; 4000a93c: 81 c7 e0 08 ret 4000a940: 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; } 4000a944: 81 c7 e0 08 ret 4000a948: 91 e8 3f ee restore %g0, -18, %o0 =============================================================================== 4000abd4 <_Scheduler_CBS_Initialize>: } } int _Scheduler_CBS_Initialize(void) { 4000abd4: 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*) ); 4000abd8: 3b 10 00 83 sethi %hi(0x40020c00), %i5 4000abdc: d0 07 61 70 ld [ %i5 + 0x170 ], %o0 ! 40020d70 <_Scheduler_CBS_Maximum_servers> } int _Scheduler_CBS_Initialize(void) { unsigned int i; _Scheduler_CBS_Server_list = (Scheduler_CBS_Server **) _Workspace_Allocate( 4000abe0: 40 00 06 89 call 4000c604 <_Workspace_Allocate> 4000abe4: 91 2a 20 02 sll %o0, 2, %o0 4000abe8: 05 10 00 87 sethi %hi(0x40021c00), %g2 _Scheduler_CBS_Maximum_servers * sizeof(Scheduler_CBS_Server*) ); if ( !_Scheduler_CBS_Server_list ) 4000abec: 80 a2 20 00 cmp %o0, 0 4000abf0: 02 80 00 0d be 4000ac24 <_Scheduler_CBS_Initialize+0x50> <== NEVER TAKEN 4000abf4: d0 20 a2 88 st %o0, [ %g2 + 0x288 ] return SCHEDULER_CBS_ERROR_NO_MEMORY; for (i = 0; i<_Scheduler_CBS_Maximum_servers; i++) { 4000abf8: c6 07 61 70 ld [ %i5 + 0x170 ], %g3 4000abfc: 10 80 00 05 b 4000ac10 <_Scheduler_CBS_Initialize+0x3c> 4000ac00: 82 10 20 00 clr %g1 _Scheduler_CBS_Server_list[i] = NULL; 4000ac04: 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++) { 4000ac08: 82 00 60 01 inc %g1 _Scheduler_CBS_Server_list[i] = NULL; 4000ac0c: 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++) { 4000ac10: 80 a0 40 03 cmp %g1, %g3 4000ac14: 12 bf ff fc bne 4000ac04 <_Scheduler_CBS_Initialize+0x30> 4000ac18: fa 00 a2 88 ld [ %g2 + 0x288 ], %i5 _Scheduler_CBS_Server_list[i] = NULL; } return SCHEDULER_CBS_OK; 4000ac1c: 81 c7 e0 08 ret 4000ac20: 91 e8 20 00 restore %g0, 0, %o0 } 4000ac24: 81 c7 e0 08 ret <== NOT EXECUTED 4000ac28: 91 e8 3f ef restore %g0, -17, %o0 <== NOT EXECUTED =============================================================================== 40009858 <_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; 40009858: c2 02 20 88 ld [ %o0 + 0x88 ], %g1 if (deadline) { 4000985c: 80 a2 60 00 cmp %o1, 0 40009860: 02 80 00 10 be 400098a0 <_Scheduler_CBS_Release_job+0x48> 40009864: c2 00 60 18 ld [ %g1 + 0x18 ], %g1 /* Initializing or shifting deadline. */ if (serv_info) 40009868: 80 a0 60 00 cmp %g1, 0 4000986c: 02 80 00 08 be 4000988c <_Scheduler_CBS_Release_job+0x34> 40009870: 05 10 00 7f sethi %hi(0x4001fc00), %g2 new_priority = (_Watchdog_Ticks_since_boot + serv_info->parameters.deadline) 40009874: d2 00 a2 e8 ld [ %g2 + 0x2e8 ], %o1 ! 4001fee8 <_Watchdog_Ticks_since_boot> 40009878: c4 00 60 04 ld [ %g1 + 4 ], %g2 4000987c: 92 02 40 02 add %o1, %g2, %o1 40009880: 05 20 00 00 sethi %hi(0x80000000), %g2 40009884: 10 80 00 0a b 400098ac <_Scheduler_CBS_Release_job+0x54> 40009888: 92 2a 40 02 andn %o1, %g2, %o1 & ~SCHEDULER_EDF_PRIO_MSB; else new_priority = (_Watchdog_Ticks_since_boot + deadline) 4000988c: c2 00 a2 e8 ld [ %g2 + 0x2e8 ], %g1 40009890: 92 02 40 01 add %o1, %g1, %o1 40009894: 03 20 00 00 sethi %hi(0x80000000), %g1 40009898: 10 80 00 07 b 400098b4 <_Scheduler_CBS_Release_job+0x5c> 4000989c: 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) 400098a0: 80 a0 60 00 cmp %g1, 0 400098a4: 02 80 00 04 be 400098b4 <_Scheduler_CBS_Release_job+0x5c> <== NEVER TAKEN 400098a8: d2 02 20 ac ld [ %o0 + 0xac ], %o1 the_thread->cpu_time_budget = serv_info->parameters.budget; 400098ac: c2 00 60 08 ld [ %g1 + 8 ], %g1 400098b0: c2 22 20 74 st %g1, [ %o0 + 0x74 ] the_thread->real_priority = new_priority; 400098b4: d2 22 20 18 st %o1, [ %o0 + 0x18 ] _Thread_Change_priority(the_thread, new_priority, true); 400098b8: 94 10 20 01 mov 1, %o2 400098bc: 82 13 c0 00 mov %o7, %g1 400098c0: 40 00 01 26 call 40009d58 <_Thread_Change_priority> 400098c4: 9e 10 40 00 mov %g1, %o7 =============================================================================== 400098c8 <_Scheduler_CBS_Unblock>: #include void _Scheduler_CBS_Unblock( Thread_Control *the_thread ) { 400098c8: 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); 400098cc: 40 00 00 4c call 400099fc <_Scheduler_EDF_Enqueue> 400098d0: 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; 400098d4: c2 06 20 88 ld [ %i0 + 0x88 ], %g1 400098d8: 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) { 400098dc: 80 a7 60 00 cmp %i5, 0 400098e0: 02 80 00 18 be 40009940 <_Scheduler_CBS_Unblock+0x78> 400098e4: 03 10 00 7f sethi %hi(0x4001fc00), %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 ) { 400098e8: 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 - 400098ec: d0 00 62 e8 ld [ %g1 + 0x2e8 ], %o0 400098f0: f8 06 20 18 ld [ %i0 + 0x18 ], %i4 _Watchdog_Ticks_since_boot; if ( deadline*budget_left > budget*deadline_left ) { 400098f4: 40 00 3e fa call 400194dc <.umul> 400098f8: 90 27 00 08 sub %i4, %o0, %o0 400098fc: d2 06 20 74 ld [ %i0 + 0x74 ], %o1 40009900: b6 10 00 08 mov %o0, %i3 40009904: 40 00 3e f6 call 400194dc <.umul> 40009908: d0 07 60 08 ld [ %i5 + 8 ], %o0 4000990c: 80 a6 c0 08 cmp %i3, %o0 40009910: 24 80 00 0d ble,a 40009944 <_Scheduler_CBS_Unblock+0x7c> 40009914: 3b 10 00 80 sethi %hi(0x40020000), %i5 /* Put late unblocked task to background until the end of period. */ new_priority = the_thread->Start.initial_priority; 40009918: d2 06 20 ac ld [ %i0 + 0xac ], %o1 if ( the_thread->real_priority != new_priority ) 4000991c: 80 a7 00 09 cmp %i4, %o1 40009920: 32 80 00 02 bne,a 40009928 <_Scheduler_CBS_Unblock+0x60> 40009924: d2 26 20 18 st %o1, [ %i0 + 0x18 ] the_thread->real_priority = new_priority; if ( the_thread->current_priority != new_priority ) 40009928: c2 06 20 14 ld [ %i0 + 0x14 ], %g1 4000992c: 80 a0 40 09 cmp %g1, %o1 40009930: 02 80 00 04 be 40009940 <_Scheduler_CBS_Unblock+0x78> 40009934: 90 10 00 18 mov %i0, %o0 _Thread_Change_priority(the_thread, new_priority, true); 40009938: 40 00 01 08 call 40009d58 <_Thread_Change_priority> 4000993c: 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, 40009940: 3b 10 00 80 sethi %hi(0x40020000), %i5 40009944: ba 17 63 10 or %i5, 0x310, %i5 ! 40020310 <_Per_CPU_Information> 40009948: c4 07 60 14 ld [ %i5 + 0x14 ], %g2 4000994c: 03 10 00 7c sethi %hi(0x4001f000), %g1 40009950: d0 06 20 14 ld [ %i0 + 0x14 ], %o0 40009954: c2 00 62 54 ld [ %g1 + 0x254 ], %g1 40009958: 9f c0 40 00 call %g1 4000995c: d2 00 a0 14 ld [ %g2 + 0x14 ], %o1 40009960: 80 a2 20 00 cmp %o0, 0 40009964: 04 80 00 0f ble 400099a0 <_Scheduler_CBS_Unblock+0xd8> 40009968: 01 00 00 00 nop _Thread_Heir->current_priority)) { _Thread_Heir = the_thread; if ( _Thread_Executing->is_preemptible || 4000996c: 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; 40009970: f0 27 60 14 st %i0, [ %i5 + 0x14 ] if ( _Thread_Executing->is_preemptible || 40009974: c2 08 60 70 ldub [ %g1 + 0x70 ], %g1 40009978: 80 a0 60 00 cmp %g1, 0 4000997c: 12 80 00 06 bne 40009994 <_Scheduler_CBS_Unblock+0xcc> 40009980: 84 10 20 01 mov 1, %g2 40009984: c2 06 20 14 ld [ %i0 + 0x14 ], %g1 40009988: 80 a0 60 00 cmp %g1, 0 4000998c: 12 80 00 05 bne 400099a0 <_Scheduler_CBS_Unblock+0xd8> <== ALWAYS TAKEN 40009990: 01 00 00 00 nop the_thread->current_priority == 0 ) _Thread_Dispatch_necessary = true; 40009994: 03 10 00 80 sethi %hi(0x40020000), %g1 40009998: 82 10 63 10 or %g1, 0x310, %g1 ! 40020310 <_Per_CPU_Information> 4000999c: c4 28 60 0c stb %g2, [ %g1 + 0xc ] 400099a0: 81 c7 e0 08 ret 400099a4: 81 e8 00 00 restore =============================================================================== 40009828 <_Scheduler_EDF_Allocate>: #include void *_Scheduler_EDF_Allocate( Thread_Control *the_thread ) { 40009828: 9d e3 bf a0 save %sp, -96, %sp void *sched; Scheduler_EDF_Per_thread *schinfo; sched = _Workspace_Allocate( sizeof(Scheduler_EDF_Per_thread) ); 4000982c: 40 00 06 62 call 4000b1b4 <_Workspace_Allocate> 40009830: 90 10 20 18 mov 0x18, %o0 if ( sched ) { 40009834: 80 a2 20 00 cmp %o0, 0 40009838: 02 80 00 05 be 4000984c <_Scheduler_EDF_Allocate+0x24> <== NEVER TAKEN 4000983c: 82 10 20 02 mov 2, %g1 the_thread->scheduler_info = sched; 40009840: d0 26 20 88 st %o0, [ %i0 + 0x88 ] schinfo = (Scheduler_EDF_Per_thread *)(the_thread->scheduler_info); schinfo->thread = the_thread; 40009844: f0 22 00 00 st %i0, [ %o0 ] schinfo->queue_state = SCHEDULER_EDF_QUEUE_STATE_NEVER_HAS_BEEN; 40009848: c2 22 20 14 st %g1, [ %o0 + 0x14 ] } return sched; } 4000984c: 81 c7 e0 08 ret 40009850: 91 e8 00 08 restore %g0, %o0, %o0 =============================================================================== 400099f0 <_Scheduler_EDF_Unblock>: #include void _Scheduler_EDF_Unblock( Thread_Control *the_thread ) { 400099f0: 9d e3 bf a0 save %sp, -96, %sp _Scheduler_EDF_Enqueue(the_thread); 400099f4: 7f ff ff ad call 400098a8 <_Scheduler_EDF_Enqueue> 400099f8: 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( 400099fc: 3b 10 00 80 sethi %hi(0x40020000), %i5 40009a00: ba 17 62 60 or %i5, 0x260, %i5 ! 40020260 <_Per_CPU_Information> 40009a04: c4 07 60 14 ld [ %i5 + 0x14 ], %g2 40009a08: 03 10 00 7c sethi %hi(0x4001f000), %g1 40009a0c: d0 00 a0 14 ld [ %g2 + 0x14 ], %o0 40009a10: c2 00 61 a4 ld [ %g1 + 0x1a4 ], %g1 40009a14: 9f c0 40 00 call %g1 40009a18: d2 06 20 14 ld [ %i0 + 0x14 ], %o1 40009a1c: 80 a2 20 00 cmp %o0, 0 40009a20: 16 80 00 0f bge 40009a5c <_Scheduler_EDF_Unblock+0x6c> 40009a24: 01 00 00 00 nop _Thread_Heir->current_priority, the_thread->current_priority )) { _Thread_Heir = the_thread; if ( _Thread_Executing->is_preemptible || 40009a28: 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; 40009a2c: f0 27 60 14 st %i0, [ %i5 + 0x14 ] if ( _Thread_Executing->is_preemptible || 40009a30: c2 08 60 70 ldub [ %g1 + 0x70 ], %g1 40009a34: 80 a0 60 00 cmp %g1, 0 40009a38: 12 80 00 06 bne 40009a50 <_Scheduler_EDF_Unblock+0x60> 40009a3c: 84 10 20 01 mov 1, %g2 40009a40: c2 06 20 14 ld [ %i0 + 0x14 ], %g1 40009a44: 80 a0 60 00 cmp %g1, 0 40009a48: 12 80 00 05 bne 40009a5c <_Scheduler_EDF_Unblock+0x6c> <== ALWAYS TAKEN 40009a4c: 01 00 00 00 nop the_thread->current_priority == 0 ) _Thread_Dispatch_necessary = true; 40009a50: 03 10 00 80 sethi %hi(0x40020000), %g1 40009a54: 82 10 62 60 or %g1, 0x260, %g1 ! 40020260 <_Per_CPU_Information> 40009a58: c4 28 60 0c stb %g2, [ %g1 + 0xc ] 40009a5c: 81 c7 e0 08 ret 40009a60: 81 e8 00 00 restore =============================================================================== 400090fc <_Scheduler_priority_Tick>: #include #include void _Scheduler_priority_Tick( void ) { 400090fc: 9d e3 bf a0 save %sp, -96, %sp Thread_Control *executing; executing = _Thread_Executing; 40009100: 03 10 00 79 sethi %hi(0x4001e400), %g1 40009104: fa 00 63 20 ld [ %g1 + 0x320 ], %i5 ! 4001e720 <_Per_CPU_Information+0x10> /* * If the thread is not preemptible or is not ready, then * just return. */ if ( !executing->is_preemptible ) 40009108: c2 0f 60 70 ldub [ %i5 + 0x70 ], %g1 4000910c: 80 a0 60 00 cmp %g1, 0 40009110: 02 80 00 25 be 400091a4 <_Scheduler_priority_Tick+0xa8> 40009114: 01 00 00 00 nop return; if ( !_States_Is_ready( executing->current_state ) ) 40009118: c2 07 60 10 ld [ %i5 + 0x10 ], %g1 4000911c: 80 a0 60 00 cmp %g1, 0 40009120: 12 80 00 21 bne 400091a4 <_Scheduler_priority_Tick+0xa8> 40009124: 01 00 00 00 nop /* * The cpu budget algorithm determines what happens next. */ switch ( executing->budget_algorithm ) { 40009128: c2 07 60 78 ld [ %i5 + 0x78 ], %g1 4000912c: 80 a0 60 01 cmp %g1, 1 40009130: 0a 80 00 14 bcs 40009180 <_Scheduler_priority_Tick+0x84> 40009134: 80 a0 60 02 cmp %g1, 2 40009138: 28 80 00 07 bleu,a 40009154 <_Scheduler_priority_Tick+0x58> 4000913c: c2 07 60 74 ld [ %i5 + 0x74 ], %g1 40009140: 80 a0 60 03 cmp %g1, 3 40009144: 12 80 00 18 bne 400091a4 <_Scheduler_priority_Tick+0xa8> <== NEVER TAKEN 40009148: 01 00 00 00 nop } break; #if defined(RTEMS_SCORE_THREAD_ENABLE_SCHEDULER_CALLOUT) case THREAD_CPU_BUDGET_ALGORITHM_CALLOUT: if ( --executing->cpu_time_budget == 0 ) 4000914c: 10 80 00 0f b 40009188 <_Scheduler_priority_Tick+0x8c> 40009150: c2 07 60 74 ld [ %i5 + 0x74 ], %g1 case THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE: #if defined(RTEMS_SCORE_THREAD_ENABLE_EXHAUST_TIMESLICE) case THREAD_CPU_BUDGET_ALGORITHM_EXHAUST_TIMESLICE: #endif if ( (int)(--executing->cpu_time_budget) <= 0 ) { 40009154: 82 00 7f ff add %g1, -1, %g1 40009158: 80 a0 60 00 cmp %g1, 0 4000915c: 14 80 00 09 bg 40009180 <_Scheduler_priority_Tick+0x84> 40009160: c2 27 60 74 st %g1, [ %i5 + 0x74 ] * always operates on the scheduler that 'owns' the currently executing * thread. */ RTEMS_INLINE_ROUTINE void _Scheduler_Yield( void ) { _Scheduler.Operations.yield(); 40009164: 03 10 00 75 sethi %hi(0x4001d400), %g1 40009168: c2 00 62 b0 ld [ %g1 + 0x2b0 ], %g1 ! 4001d6b0 <_Scheduler+0xc> 4000916c: 9f c0 40 00 call %g1 40009170: 01 00 00 00 nop * executing thread's timeslice is reset. Otherwise, the * currently executing thread is placed at the rear of the * FIFO for this priority and a new heir is selected. */ _Scheduler_Yield(); executing->cpu_time_budget = _Thread_Ticks_per_timeslice; 40009174: 03 10 00 78 sethi %hi(0x4001e000), %g1 40009178: c2 00 61 60 ld [ %g1 + 0x160 ], %g1 ! 4001e160 <_Thread_Ticks_per_timeslice> 4000917c: c2 27 60 74 st %g1, [ %i5 + 0x74 ] 40009180: 81 c7 e0 08 ret 40009184: 81 e8 00 00 restore } break; #if defined(RTEMS_SCORE_THREAD_ENABLE_SCHEDULER_CALLOUT) case THREAD_CPU_BUDGET_ALGORITHM_CALLOUT: if ( --executing->cpu_time_budget == 0 ) 40009188: 82 00 7f ff add %g1, -1, %g1 4000918c: 80 a0 60 00 cmp %g1, 0 40009190: 12 bf ff fc bne 40009180 <_Scheduler_priority_Tick+0x84> 40009194: c2 27 60 74 st %g1, [ %i5 + 0x74 ] (*executing->budget_callout)( executing ); 40009198: c2 07 60 7c ld [ %i5 + 0x7c ], %g1 4000919c: 9f c0 40 00 call %g1 400091a0: 90 10 00 1d mov %i5, %o0 400091a4: 81 c7 e0 08 ret 400091a8: 81 e8 00 00 restore =============================================================================== 40007d3c <_TOD_Validate>: }; bool _TOD_Validate( const rtems_time_of_day *the_tod ) { 40007d3c: 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 / 40007d40: 03 10 00 76 sethi %hi(0x4001d800), %g1 40007d44: d2 00 61 dc ld [ %g1 + 0x1dc ], %o1 ! 4001d9dc 40007d48: 11 00 03 d0 sethi %hi(0xf4000), %o0 40007d4c: 40 00 48 2b call 40019df8 <.udiv> 40007d50: 90 12 22 40 or %o0, 0x240, %o0 ! f4240 rtems_configuration_get_microseconds_per_tick(); if ((!the_tod) || 40007d54: 80 a6 20 00 cmp %i0, 0 40007d58: 02 80 00 28 be 40007df8 <_TOD_Validate+0xbc> <== NEVER TAKEN 40007d5c: 84 10 20 00 clr %g2 40007d60: c2 06 20 18 ld [ %i0 + 0x18 ], %g1 40007d64: 80 a0 40 08 cmp %g1, %o0 40007d68: 3a 80 00 25 bcc,a 40007dfc <_TOD_Validate+0xc0> 40007d6c: b0 08 a0 01 and %g2, 1, %i0 (the_tod->ticks >= ticks_per_second) || 40007d70: c2 06 20 14 ld [ %i0 + 0x14 ], %g1 40007d74: 80 a0 60 3b cmp %g1, 0x3b 40007d78: 38 80 00 21 bgu,a 40007dfc <_TOD_Validate+0xc0> 40007d7c: b0 08 a0 01 and %g2, 1, %i0 (the_tod->second >= TOD_SECONDS_PER_MINUTE) || 40007d80: c2 06 20 10 ld [ %i0 + 0x10 ], %g1 40007d84: 80 a0 60 3b cmp %g1, 0x3b 40007d88: 38 80 00 1d bgu,a 40007dfc <_TOD_Validate+0xc0> 40007d8c: b0 08 a0 01 and %g2, 1, %i0 (the_tod->minute >= TOD_MINUTES_PER_HOUR) || 40007d90: c2 06 20 0c ld [ %i0 + 0xc ], %g1 40007d94: 80 a0 60 17 cmp %g1, 0x17 40007d98: 38 80 00 19 bgu,a 40007dfc <_TOD_Validate+0xc0> 40007d9c: b0 08 a0 01 and %g2, 1, %i0 (the_tod->hour >= TOD_HOURS_PER_DAY) || (the_tod->month == 0) || 40007da0: 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) || 40007da4: 80 a0 60 00 cmp %g1, 0 40007da8: 02 80 00 14 be 40007df8 <_TOD_Validate+0xbc> <== NEVER TAKEN 40007dac: 80 a0 60 0c cmp %g1, 0xc (the_tod->month == 0) || 40007db0: 38 80 00 13 bgu,a 40007dfc <_TOD_Validate+0xc0> 40007db4: b0 08 a0 01 and %g2, 1, %i0 (the_tod->month > TOD_MONTHS_PER_YEAR) || (the_tod->year < TOD_BASE_YEAR) || 40007db8: 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) || 40007dbc: 80 a1 27 c3 cmp %g4, 0x7c3 40007dc0: 28 80 00 0f bleu,a 40007dfc <_TOD_Validate+0xc0> 40007dc4: b0 08 a0 01 and %g2, 1, %i0 (the_tod->year < TOD_BASE_YEAR) || (the_tod->day == 0) ) 40007dc8: 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) || 40007dcc: 80 a0 e0 00 cmp %g3, 0 40007dd0: 02 80 00 0a be 40007df8 <_TOD_Validate+0xbc> <== NEVER TAKEN 40007dd4: 80 89 20 03 btst 3, %g4 40007dd8: 05 10 00 7a sethi %hi(0x4001e800), %g2 (the_tod->day == 0) ) return false; if ( (the_tod->year % 4) == 0 ) 40007ddc: 12 80 00 03 bne 40007de8 <_TOD_Validate+0xac> 40007de0: 84 10 a2 d0 or %g2, 0x2d0, %g2 ! 4001ead0 <_TOD_Days_per_month> days_in_month = _TOD_Days_per_month[ 1 ][ the_tod->month ]; 40007de4: 82 00 60 0d add %g1, 0xd, %g1 else days_in_month = _TOD_Days_per_month[ 0 ][ the_tod->month ]; 40007de8: 83 28 60 02 sll %g1, 2, %g1 40007dec: c2 00 80 01 ld [ %g2 + %g1 ], %g1 if ( the_tod->day > days_in_month ) 40007df0: 80 a0 40 03 cmp %g1, %g3 40007df4: 84 60 3f ff subx %g0, -1, %g2 return false; return true; } 40007df8: b0 08 a0 01 and %g2, 1, %i0 40007dfc: 81 c7 e0 08 ret 40007e00: 81 e8 00 00 restore =============================================================================== 400093b8 <_Thread_Change_priority>: void _Thread_Change_priority( Thread_Control *the_thread, Priority_Control new_priority, bool prepend_it ) { 400093b8: 9d e3 bf a0 save %sp, -96, %sp 400093bc: ba 10 00 18 mov %i0, %i5 States_Control state, original_state; /* * Save original state */ original_state = the_thread->current_state; 400093c0: 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 ); 400093c4: 40 00 03 51 call 4000a108 <_Thread_Set_transient> 400093c8: 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 ) 400093cc: c2 07 60 14 ld [ %i5 + 0x14 ], %g1 400093d0: 80 a0 40 19 cmp %g1, %i1 400093d4: 02 80 00 04 be 400093e4 <_Thread_Change_priority+0x2c> 400093d8: 90 10 00 1d mov %i5, %o0 _Thread_Set_priority( the_thread, new_priority ); 400093dc: 40 00 03 32 call 4000a0a4 <_Thread_Set_priority> 400093e0: 92 10 00 19 mov %i1, %o1 _ISR_Disable( level ); 400093e4: 7f ff e3 31 call 400020a8 400093e8: 01 00 00 00 nop 400093ec: 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; 400093f0: f8 07 60 10 ld [ %i5 + 0x10 ], %i4 if ( state != STATES_TRANSIENT ) { 400093f4: 80 a7 20 04 cmp %i4, 4 400093f8: 02 80 00 10 be 40009438 <_Thread_Change_priority+0x80> 400093fc: 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 ) ) 40009400: 80 a0 60 00 cmp %g1, 0 40009404: 12 80 00 03 bne 40009410 <_Thread_Change_priority+0x58> <== NEVER TAKEN 40009408: 82 0f 3f fb and %i4, -5, %g1 the_thread->current_state = _States_Clear( STATES_TRANSIENT, state ); 4000940c: c2 27 60 10 st %g1, [ %i5 + 0x10 ] _ISR_Enable( level ); 40009410: 7f ff e3 2a call 400020b8 40009414: 90 10 00 1b mov %i3, %o0 if ( _States_Is_waiting_on_thread_queue( state ) ) { 40009418: 03 00 00 ef sethi %hi(0x3bc00), %g1 4000941c: 82 10 62 e0 or %g1, 0x2e0, %g1 ! 3bee0 40009420: 80 8f 00 01 btst %i4, %g1 40009424: 02 80 00 27 be 400094c0 <_Thread_Change_priority+0x108> 40009428: 01 00 00 00 nop _Thread_queue_Requeue( the_thread->Wait.queue, the_thread ); 4000942c: f0 07 60 44 ld [ %i5 + 0x44 ], %i0 40009430: 40 00 02 f0 call 40009ff0 <_Thread_queue_Requeue> 40009434: 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 ) ) { 40009438: 80 a0 60 00 cmp %g1, 0 4000943c: 12 80 00 0b bne 40009468 <_Thread_Change_priority+0xb0> <== NEVER TAKEN 40009440: 03 10 00 75 sethi %hi(0x4001d400), %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 ); 40009444: c0 27 60 10 clr [ %i5 + 0x10 ] if ( prepend_it ) 40009448: 80 a6 a0 00 cmp %i2, 0 4000944c: 02 80 00 04 be 4000945c <_Thread_Change_priority+0xa4> 40009450: 82 10 62 a4 or %g1, 0x2a4, %g1 */ RTEMS_INLINE_ROUTINE void _Scheduler_Enqueue_first( Thread_Control *the_thread ) { _Scheduler.Operations.enqueue_first( the_thread ); 40009454: 10 80 00 03 b 40009460 <_Thread_Change_priority+0xa8> 40009458: c2 00 60 28 ld [ %g1 + 0x28 ], %g1 */ RTEMS_INLINE_ROUTINE void _Scheduler_Enqueue( Thread_Control *the_thread ) { _Scheduler.Operations.enqueue( the_thread ); 4000945c: c2 00 60 24 ld [ %g1 + 0x24 ], %g1 40009460: 9f c0 40 00 call %g1 40009464: 90 10 00 1d mov %i5, %o0 _Scheduler_Enqueue_first( the_thread ); else _Scheduler_Enqueue( the_thread ); } _ISR_Flash( level ); 40009468: 7f ff e3 14 call 400020b8 4000946c: 90 10 00 1b mov %i3, %o0 40009470: 7f ff e3 0e call 400020a8 40009474: 01 00 00 00 nop 40009478: 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(); 4000947c: 03 10 00 75 sethi %hi(0x4001d400), %g1 40009480: c2 00 62 ac ld [ %g1 + 0x2ac ], %g1 ! 4001d6ac <_Scheduler+0x8> 40009484: 9f c0 40 00 call %g1 40009488: 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 ); 4000948c: 03 10 00 79 sethi %hi(0x4001e400), %g1 40009490: 82 10 63 10 or %g1, 0x310, %g1 ! 4001e710 <_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() && 40009494: c4 18 60 10 ldd [ %g1 + 0x10 ], %g2 40009498: 80 a0 80 03 cmp %g2, %g3 4000949c: 02 80 00 07 be 400094b8 <_Thread_Change_priority+0x100> 400094a0: 01 00 00 00 nop 400094a4: c4 08 a0 70 ldub [ %g2 + 0x70 ], %g2 400094a8: 80 a0 a0 00 cmp %g2, 0 400094ac: 02 80 00 03 be 400094b8 <_Thread_Change_priority+0x100> 400094b0: 84 10 20 01 mov 1, %g2 _Thread_Executing->is_preemptible ) _Thread_Dispatch_necessary = true; 400094b4: c4 28 60 0c stb %g2, [ %g1 + 0xc ] _ISR_Enable( level ); 400094b8: 7f ff e3 00 call 400020b8 400094bc: 81 e8 00 00 restore 400094c0: 81 c7 e0 08 ret 400094c4: 81 e8 00 00 restore =============================================================================== 40009688 <_Thread_Delay_ended>: void _Thread_Delay_ended( Objects_Id id, void *ignored __attribute__((unused)) ) { 40009688: 9d e3 bf 98 save %sp, -104, %sp Thread_Control *the_thread; Objects_Locations location; the_thread = _Thread_Get( id, &location ); 4000968c: 90 10 00 18 mov %i0, %o0 40009690: 40 00 00 70 call 40009850 <_Thread_Get> 40009694: 92 07 bf fc add %fp, -4, %o1 switch ( location ) { 40009698: c2 07 bf fc ld [ %fp + -4 ], %g1 4000969c: 80 a0 60 00 cmp %g1, 0 400096a0: 12 80 00 08 bne 400096c0 <_Thread_Delay_ended+0x38> <== NEVER TAKEN 400096a4: 13 04 00 00 sethi %hi(0x10000000), %o1 #if defined(RTEMS_MULTIPROCESSING) case OBJECTS_REMOTE: /* impossible */ #endif break; case OBJECTS_LOCAL: _Thread_Clear_state( 400096a8: 7f ff ff 88 call 400094c8 <_Thread_Clear_state> 400096ac: 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; 400096b0: 03 10 00 78 sethi %hi(0x4001e000), %g1 400096b4: c4 00 62 00 ld [ %g1 + 0x200 ], %g2 ! 4001e200 <_Thread_Dispatch_disable_level> --level; 400096b8: 84 00 bf ff add %g2, -1, %g2 _Thread_Dispatch_disable_level = level; 400096bc: c4 20 62 00 st %g2, [ %g1 + 0x200 ] 400096c0: 81 c7 e0 08 ret 400096c4: 81 e8 00 00 restore =============================================================================== 400096c8 <_Thread_Dispatch>: #if defined(RTEMS_SMP) #include #endif void _Thread_Dispatch( void ) { 400096c8: 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; 400096cc: 35 10 00 79 sethi %hi(0x4001e400), %i2 400096d0: 82 16 a3 10 or %i2, 0x310, %g1 ! 4001e710 <_Per_CPU_Information> _ISR_Disable( level ); 400096d4: 7f ff e2 75 call 400020a8 400096d8: f6 00 60 10 ld [ %g1 + 0x10 ], %i3 */ static inline void _TOD_Get_uptime( Timestamp_Control *time ) { _TOD_Get_with_nanoseconds( time, &_TOD.uptime ); 400096dc: 21 10 00 78 sethi %hi(0x4001e000), %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 ) { 400096e0: 27 10 00 75 sethi %hi(0x4001d400), %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; 400096e4: 33 10 00 78 sethi %hi(0x4001e000), %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; 400096e8: 31 10 00 78 sethi %hi(0x4001e000), %i0 400096ec: a0 14 21 50 or %l0, 0x150, %l0 #endif /* * Switch libc's task specific data. */ if ( _Thread_libc_reent ) { 400096f0: 23 10 00 78 sethi %hi(0x4001e000), %l1 */ RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_first( const Chain_Control *the_chain ) { return _Chain_Immutable_head( the_chain )->next; 400096f4: 25 10 00 75 sethi %hi(0x4001d400), %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 ) { 400096f8: 10 80 00 3b b 400097e4 <_Thread_Dispatch+0x11c> 400096fc: a6 14 e3 d0 or %l3, 0x3d0, %l3 40009700: 84 10 20 01 mov 1, %g2 40009704: c4 26 62 00 st %g2, [ %i1 + 0x200 ] heir = _Thread_Heir; #ifndef RTEMS_SMP _Thread_Dispatch_set_disable_level( 1 ); #endif _Thread_Dispatch_necessary = false; 40009708: 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 ) 4000970c: 80 a5 00 1b cmp %l4, %i3 40009710: 12 80 00 0a bne 40009738 <_Thread_Dispatch+0x70> 40009714: e8 20 60 10 st %l4, [ %g1 + 0x10 ] 40009718: 03 10 00 78 sethi %hi(0x4001e000), %g1 4000971c: c0 20 62 00 clr [ %g1 + 0x200 ] ! 4001e200 <_Thread_Dispatch_disable_level> post_switch: #ifndef RTEMS_SMP _Thread_Dispatch_set_disable_level( 0 ); #endif _ISR_Enable( level ); 40009720: 7f ff e2 66 call 400020b8 40009724: 39 10 00 78 sethi %hi(0x4001e000), %i4 40009728: 03 10 00 78 sethi %hi(0x4001e000), %g1 4000972c: fa 00 62 70 ld [ %g1 + 0x270 ], %i5 ! 4001e270 <_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 ) { 40009730: 10 80 00 37 b 4000980c <_Thread_Dispatch+0x144> 40009734: b8 17 22 74 or %i4, 0x274, %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 ) 40009738: c2 05 20 78 ld [ %l4 + 0x78 ], %g1 4000973c: 80 a0 60 01 cmp %g1, 1 40009740: 12 80 00 03 bne 4000974c <_Thread_Dispatch+0x84> 40009744: c2 06 21 60 ld [ %i0 + 0x160 ], %g1 heir->cpu_time_budget = _Thread_Ticks_per_timeslice; 40009748: c2 25 20 74 st %g1, [ %l4 + 0x74 ] _ISR_Enable( level ); 4000974c: 7f ff e2 5b call 400020b8 40009750: 01 00 00 00 nop 40009754: 90 07 bf f8 add %fp, -8, %o0 40009758: 7f ff f9 e0 call 40007ed8 <_TOD_Get_with_nanoseconds> 4000975c: 92 10 00 10 mov %l0, %o1 #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ { Timestamp_Control uptime, ran; _TOD_Get_uptime( &uptime ); _Timestamp_Subtract( 40009760: c4 1f bf f8 ldd [ %fp + -8 ], %g2 40009764: 82 16 a3 10 or %i2, 0x310, %g1 const Timestamp64_Control *_start, const Timestamp64_Control *_end, Timestamp64_Control *_result ) { *_result = *_end - *_start; 40009768: f8 18 60 20 ldd [ %g1 + 0x20 ], %i4 4000976c: 96 a0 c0 1d subcc %g3, %i5, %o3 40009770: 94 60 80 1c subx %g2, %i4, %o2 static inline void _Timestamp64_implementation_Add_to( Timestamp64_Control *_time, const Timestamp64_Control *_add ) { *_time += *_add; 40009774: f8 1e e0 80 ldd [ %i3 + 0x80 ], %i4 40009778: 9a 87 40 0b addcc %i5, %o3, %o5 4000977c: 98 47 00 0a addx %i4, %o2, %o4 40009780: 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; 40009784: c4 38 60 20 std %g2, [ %g1 + 0x20 ] #endif /* * Switch libc's task specific data. */ if ( _Thread_libc_reent ) { 40009788: c2 04 62 6c ld [ %l1 + 0x26c ], %g1 4000978c: 80 a0 60 00 cmp %g1, 0 40009790: 22 80 00 0c be,a 400097c0 <_Thread_Dispatch+0xf8> <== NEVER TAKEN 40009794: fa 04 a3 cc ld [ %l2 + 0x3cc ], %i5 <== NOT EXECUTED executing->libc_reent = *_Thread_libc_reent; 40009798: c4 00 40 00 ld [ %g1 ], %g2 4000979c: c4 26 e1 48 st %g2, [ %i3 + 0x148 ] *_Thread_libc_reent = heir->libc_reent; 400097a0: c4 05 21 48 ld [ %l4 + 0x148 ], %g2 400097a4: c4 20 40 00 st %g2, [ %g1 ] 400097a8: 10 80 00 06 b 400097c0 <_Thread_Dispatch+0xf8> 400097ac: fa 04 a3 cc ld [ %l2 + 0x3cc ], %i5 const User_extensions_Switch_control *extension = (const User_extensions_Switch_control *) node; (*extension->thread_switch)( executing, heir ); 400097b0: 90 10 00 1b mov %i3, %o0 400097b4: 9f c0 40 00 call %g1 400097b8: 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; 400097bc: 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 ) { 400097c0: 80 a7 40 13 cmp %i5, %l3 400097c4: 32 bf ff fb bne,a 400097b0 <_Thread_Dispatch+0xe8> 400097c8: 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 ); 400097cc: 90 06 e0 c0 add %i3, 0xc0, %o0 400097d0: 40 00 04 30 call 4000a890 <_CPU_Context_switch> 400097d4: 92 05 20 c0 add %l4, 0xc0, %o1 if ( executing->fp_context != NULL ) _Context_Restore_fp( &executing->fp_context ); #endif #endif executing = _Thread_Executing; 400097d8: 82 16 a3 10 or %i2, 0x310, %g1 _ISR_Disable( level ); 400097dc: 7f ff e2 33 call 400020a8 400097e0: 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 ) { 400097e4: 82 16 a3 10 or %i2, 0x310, %g1 400097e8: c4 08 60 0c ldub [ %g1 + 0xc ], %g2 400097ec: 80 a0 a0 00 cmp %g2, 0 400097f0: 32 bf ff c4 bne,a 40009700 <_Thread_Dispatch+0x38> 400097f4: e8 00 60 14 ld [ %g1 + 0x14 ], %l4 400097f8: 10 bf ff c9 b 4000971c <_Thread_Dispatch+0x54> 400097fc: 03 10 00 78 sethi %hi(0x4001e000), %g1 const API_extensions_Post_switch_control *post_switch = (const API_extensions_Post_switch_control *) node; (*post_switch->hook)( executing ); 40009800: 9f c0 40 00 call %g1 40009804: 90 10 00 1b mov %i3, %o0 40009808: 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 ) { 4000980c: 80 a7 40 1c cmp %i5, %i4 40009810: 32 bf ff fc bne,a 40009800 <_Thread_Dispatch+0x138> 40009814: c2 07 60 08 ld [ %i5 + 8 ], %g1 #ifdef RTEMS_SMP _Thread_Unnest_dispatch(); #endif _API_extensions_Run_post_switch( executing ); } 40009818: 81 c7 e0 08 ret 4000981c: 81 e8 00 00 restore =============================================================================== 4000e848 <_Thread_Handler>: #define INIT_NAME __main #define EXECUTE_GLOBAL_CONSTRUCTORS #endif void _Thread_Handler( void ) { 4000e848: 9d e3 bf a0 save %sp, -96, %sp #if defined(EXECUTE_GLOBAL_CONSTRUCTORS) static bool doneConstructors; bool doCons; #endif executing = _Thread_Executing; 4000e84c: 03 10 00 79 sethi %hi(0x4001e400), %g1 4000e850: fa 00 63 20 ld [ %g1 + 0x320 ], %i5 ! 4001e720 <_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(); 4000e854: 3f 10 00 3a sethi %hi(0x4000e800), %i7 4000e858: be 17 e0 48 or %i7, 0x48, %i7 ! 4000e848 <_Thread_Handler> /* * have to put level into a register for those cpu's that use * inline asm here */ level = executing->Start.isr_level; 4000e85c: d0 07 60 a8 ld [ %i5 + 0xa8 ], %o0 _ISR_Set_level(level); 4000e860: 7f ff ce 16 call 400020b8 4000e864: 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; 4000e868: 03 10 00 77 sethi %hi(0x4001dc00), %g1 doneConstructors = true; 4000e86c: 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; 4000e870: f8 08 62 f8 ldub [ %g1 + 0x2f8 ], %i4 ); } static inline void _User_extensions_Thread_begin( Thread_Control *executing ) { _User_extensions_Iterate( 4000e874: 90 10 00 1d mov %i5, %o0 4000e878: 13 10 00 28 sethi %hi(0x4000a000), %o1 4000e87c: 92 12 62 e8 or %o1, 0x2e8, %o1 ! 4000a2e8 <_User_extensions_Thread_begin_visitor> 4000e880: 7f ff ee b7 call 4000a35c <_User_extensions_Iterate> 4000e884: c4 28 62 f8 stb %g2, [ %g1 + 0x2f8 ] _User_extensions_Thread_begin( executing ); /* * At this point, the dispatch disable level BETTER be 1. */ _Thread_Enable_dispatch(); 4000e888: 7f ff eb e6 call 40009820 <_Thread_Enable_dispatch> 4000e88c: 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) */ { 4000e890: 80 8f 20 ff btst 0xff, %i4 4000e894: 32 80 00 05 bne,a 4000e8a8 <_Thread_Handler+0x60> 4000e898: c2 07 60 90 ld [ %i5 + 0x90 ], %g1 INIT_NAME (); 4000e89c: 40 00 3b 4f call 4001d5d8 <_init> 4000e8a0: 01 00 00 00 nop _Thread_Enable_dispatch(); #endif } #endif if ( executing->Start.prototype == THREAD_START_NUMERIC ) { 4000e8a4: c2 07 60 90 ld [ %i5 + 0x90 ], %g1 4000e8a8: 80 a0 60 00 cmp %g1, 0 4000e8ac: 12 80 00 05 bne 4000e8c0 <_Thread_Handler+0x78> 4000e8b0: 80 a0 60 01 cmp %g1, 1 executing->Wait.return_argument = (*(Thread_Entry_numeric) executing->Start.entry_point)( 4000e8b4: c2 07 60 8c ld [ %i5 + 0x8c ], %g1 4000e8b8: 10 80 00 06 b 4000e8d0 <_Thread_Handler+0x88> 4000e8bc: d0 07 60 98 ld [ %i5 + 0x98 ], %o0 executing->Start.numeric_argument ); } #if defined(RTEMS_POSIX_API) else if ( executing->Start.prototype == THREAD_START_POINTER ) { 4000e8c0: 12 80 00 08 bne 4000e8e0 <_Thread_Handler+0x98> <== NEVER TAKEN 4000e8c4: 90 10 00 1d mov %i5, %o0 executing->Wait.return_argument = (*(Thread_Entry_pointer) executing->Start.entry_point)( 4000e8c8: c2 07 60 8c ld [ %i5 + 0x8c ], %g1 4000e8cc: d0 07 60 94 ld [ %i5 + 0x94 ], %o0 4000e8d0: 9f c0 40 00 call %g1 4000e8d4: 01 00 00 00 nop executing->Start.numeric_argument ); } #if defined(RTEMS_POSIX_API) else if ( executing->Start.prototype == THREAD_START_POINTER ) { executing->Wait.return_argument = 4000e8d8: d0 27 60 28 st %o0, [ %i5 + 0x28 ] } } static inline void _User_extensions_Thread_exitted( Thread_Control *executing ) { _User_extensions_Iterate( 4000e8dc: 90 10 00 1d mov %i5, %o0 4000e8e0: 13 10 00 28 sethi %hi(0x4000a000), %o1 4000e8e4: 7f ff ee 9e call 4000a35c <_User_extensions_Iterate> 4000e8e8: 92 12 63 0c or %o1, 0x30c, %o1 ! 4000a30c <_User_extensions_Thread_exitted_visitor> * able to fit in a (void *). */ _User_extensions_Thread_exitted( executing ); _Internal_error_Occurred( 4000e8ec: 90 10 20 00 clr %o0 4000e8f0: 92 10 20 01 mov 1, %o1 4000e8f4: 7f ff e6 ad call 400083a8 <_Internal_error_Occurred> 4000e8f8: 94 10 20 05 mov 5, %o2 =============================================================================== 40009ad8 <_Thread_Handler_initialization>: #if defined(RTEMS_SMP) #include #endif void _Thread_Handler_initialization(void) { 40009ad8: 9d e3 bf 98 save %sp, -104, %sp uint32_t ticks_per_timeslice = 40009adc: 03 10 00 6d sethi %hi(0x4001b400), %g1 40009ae0: 82 10 63 58 or %g1, 0x358, %g1 ! 4001b758 #if defined(RTEMS_MULTIPROCESSING) uint32_t maximum_proxies = _Configuration_MP_table->maximum_proxies; #endif if ( rtems_configuration_get_stack_allocate_hook() == NULL || 40009ae4: c6 00 60 28 ld [ %g1 + 0x28 ], %g3 #include #endif void _Thread_Handler_initialization(void) { uint32_t ticks_per_timeslice = 40009ae8: fa 00 60 14 ld [ %g1 + 0x14 ], %i5 rtems_configuration_get_ticks_per_timeslice(); uint32_t maximum_extensions = 40009aec: 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 || 40009af0: 80 a0 e0 00 cmp %g3, 0 40009af4: 02 80 00 06 be 40009b0c <_Thread_Handler_initialization+0x34><== NEVER TAKEN 40009af8: c4 00 60 24 ld [ %g1 + 0x24 ], %g2 40009afc: c6 00 60 2c ld [ %g1 + 0x2c ], %g3 40009b00: 80 a0 e0 00 cmp %g3, 0 40009b04: 12 80 00 06 bne 40009b1c <_Thread_Handler_initialization+0x44> 40009b08: 80 a0 a0 00 cmp %g2, 0 rtems_configuration_get_stack_free_hook() == NULL) _Internal_error_Occurred( 40009b0c: 90 10 20 00 clr %o0 40009b10: 92 10 20 01 mov 1, %o1 40009b14: 7f ff fa 25 call 400083a8 <_Internal_error_Occurred> 40009b18: 94 10 20 0e mov 0xe, %o2 INTERNAL_ERROR_CORE, true, INTERNAL_ERROR_BAD_STACK_HOOK ); if ( stack_allocate_init_hook != NULL ) 40009b1c: 22 80 00 05 be,a 40009b30 <_Thread_Handler_initialization+0x58> 40009b20: 03 10 00 79 sethi %hi(0x4001e400), %g1 (*stack_allocate_init_hook)( rtems_configuration_get_stack_space_size() ); 40009b24: 9f c0 80 00 call %g2 40009b28: d0 00 60 04 ld [ %g1 + 4 ], %o0 ! 4001e404 <_POSIX_Threads_Information> _Thread_Dispatch_necessary = false; 40009b2c: 03 10 00 79 sethi %hi(0x4001e400), %g1 40009b30: 82 10 63 10 or %g1, 0x310, %g1 ! 4001e710 <_Per_CPU_Information> 40009b34: c0 28 60 0c clrb [ %g1 + 0xc ] _Thread_Executing = NULL; 40009b38: c0 20 60 10 clr [ %g1 + 0x10 ] _Thread_Heir = NULL; 40009b3c: 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; 40009b40: 03 10 00 78 sethi %hi(0x4001e000), %g1 40009b44: f8 20 62 7c st %i4, [ %g1 + 0x27c ] ! 4001e27c <_Thread_Maximum_extensions> _Thread_Ticks_per_timeslice = ticks_per_timeslice; 40009b48: 03 10 00 78 sethi %hi(0x4001e000), %g1 40009b4c: fa 20 61 60 st %i5, [ %g1 + 0x160 ] ! 4001e160 <_Thread_Ticks_per_timeslice> #if defined(RTEMS_MULTIPROCESSING) if ( _System_state_Is_multiprocessing ) maximum_internal_threads += 1; #endif _Objects_Initialize_information( 40009b50: 82 10 20 08 mov 8, %g1 40009b54: 11 10 00 78 sethi %hi(0x4001e000), %o0 40009b58: c2 23 a0 5c st %g1, [ %sp + 0x5c ] 40009b5c: 90 12 22 f0 or %o0, 0x2f0, %o0 40009b60: 92 10 20 01 mov 1, %o1 40009b64: 94 10 20 01 mov 1, %o2 40009b68: 96 10 20 01 mov 1, %o3 40009b6c: 98 10 21 60 mov 0x160, %o4 40009b70: 7f ff fb 9e call 400089e8 <_Objects_Initialize_information> 40009b74: 9a 10 20 00 clr %o5 40009b78: 81 c7 e0 08 ret 40009b7c: 81 e8 00 00 restore =============================================================================== 40009900 <_Thread_Initialize>: Thread_CPU_budget_algorithms budget_algorithm, Thread_CPU_budget_algorithm_callout budget_callout, uint32_t isr_level, Objects_Name name ) { 40009900: 9d e3 bf 98 save %sp, -104, %sp 40009904: c2 07 a0 6c ld [ %fp + 0x6c ], %g1 /* * Zero out all the allocated memory fields */ for ( i=0 ; i <= THREAD_API_LAST ; i++ ) the_thread->API_Extensions[i] = NULL; 40009908: c0 26 61 4c clr [ %i1 + 0x14c ] 4000990c: c0 26 61 50 clr [ %i1 + 0x150 ] extensions_area = NULL; the_thread->libc_reent = NULL; 40009910: c0 26 61 48 clr [ %i1 + 0x148 ] Thread_CPU_budget_algorithms budget_algorithm, Thread_CPU_budget_algorithm_callout budget_callout, uint32_t isr_level, Objects_Name name ) { 40009914: e0 07 a0 60 ld [ %fp + 0x60 ], %l0 40009918: e2 00 40 00 ld [ %g1 ], %l1 if ( !actual_stack_size || actual_stack_size < stack_size ) return false; /* stack allocation failed */ stack = the_thread->Start.stack; #else if ( !stack_area ) { 4000991c: 80 a6 a0 00 cmp %i2, 0 40009920: 12 80 00 0d bne 40009954 <_Thread_Initialize+0x54> 40009924: e4 0f a0 5f ldub [ %fp + 0x5f ], %l2 actual_stack_size = _Thread_Stack_Allocate( the_thread, stack_size ); 40009928: 90 10 00 19 mov %i1, %o0 4000992c: 40 00 02 06 call 4000a144 <_Thread_Stack_Allocate> 40009930: 92 10 00 1b mov %i3, %o1 if ( !actual_stack_size || actual_stack_size < stack_size ) 40009934: 80 a2 00 1b cmp %o0, %i3 40009938: 0a 80 00 64 bcs 40009ac8 <_Thread_Initialize+0x1c8> 4000993c: 80 a2 20 00 cmp %o0, 0 40009940: 02 80 00 62 be 40009ac8 <_Thread_Initialize+0x1c8> <== NEVER TAKEN 40009944: 82 10 20 01 mov 1, %g1 return false; /* stack allocation failed */ stack = the_thread->Start.stack; 40009948: f4 06 60 bc ld [ %i1 + 0xbc ], %i2 the_thread->Start.core_allocated_stack = true; 4000994c: 10 80 00 04 b 4000995c <_Thread_Initialize+0x5c> 40009950: c2 2e 60 b0 stb %g1, [ %i1 + 0xb0 ] } else { stack = stack_area; actual_stack_size = stack_size; the_thread->Start.core_allocated_stack = false; 40009954: c0 2e 60 b0 clrb [ %i1 + 0xb0 ] 40009958: 90 10 00 1b mov %i3, %o0 void *starting_address, size_t size ) { the_stack->area = starting_address; the_stack->size = size; 4000995c: d0 26 60 b4 st %o0, [ %i1 + 0xb4 ] #endif /* * Allocate the extensions area for this thread */ if ( _Thread_Maximum_extensions ) { 40009960: 03 10 00 78 sethi %hi(0x4001e000), %g1 40009964: d0 00 62 7c ld [ %g1 + 0x27c ], %o0 ! 4001e27c <_Thread_Maximum_extensions> Stack_Control *the_stack, void *starting_address, size_t size ) { the_stack->area = starting_address; 40009968: f4 26 60 b8 st %i2, [ %i1 + 0xb8 ] Watchdog_Service_routine_entry routine, Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; 4000996c: c0 26 60 50 clr [ %i1 + 0x50 ] the_watchdog->routine = routine; 40009970: c0 26 60 64 clr [ %i1 + 0x64 ] the_watchdog->id = id; 40009974: c0 26 60 68 clr [ %i1 + 0x68 ] the_watchdog->user_data = user_data; 40009978: c0 26 60 6c clr [ %i1 + 0x6c ] 4000997c: 80 a2 20 00 cmp %o0, 0 40009980: 02 80 00 08 be 400099a0 <_Thread_Initialize+0xa0> 40009984: b8 10 20 00 clr %i4 extensions_area = _Workspace_Allocate( 40009988: 90 02 20 01 inc %o0 4000998c: 40 00 03 a5 call 4000a820 <_Workspace_Allocate> 40009990: 91 2a 20 02 sll %o0, 2, %o0 (_Thread_Maximum_extensions + 1) * sizeof( void * ) ); if ( !extensions_area ) 40009994: b8 92 20 00 orcc %o0, 0, %i4 40009998: 02 80 00 40 be 40009a98 <_Thread_Initialize+0x198> 4000999c: 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 ) { 400099a0: 80 a7 20 00 cmp %i4, 0 400099a4: 12 80 00 0a bne 400099cc <_Thread_Initialize+0xcc> 400099a8: f8 26 61 54 st %i4, [ %i1 + 0x154 ] * General initialization */ the_thread->Start.is_preemptible = is_preemptible; the_thread->Start.budget_algorithm = budget_algorithm; the_thread->Start.budget_callout = budget_callout; 400099ac: c2 07 a0 64 ld [ %fp + 0x64 ], %g1 /* * General initialization */ the_thread->Start.is_preemptible = is_preemptible; 400099b0: e4 2e 60 9c stb %l2, [ %i1 + 0x9c ] the_thread->Start.budget_algorithm = budget_algorithm; 400099b4: e0 26 60 a0 st %l0, [ %i1 + 0xa0 ] the_thread->Start.budget_callout = budget_callout; switch ( budget_algorithm ) { 400099b8: 80 a4 20 02 cmp %l0, 2 400099bc: 12 80 00 12 bne 40009a04 <_Thread_Initialize+0x104> 400099c0: c2 26 60 a4 st %g1, [ %i1 + 0xa4 ] case THREAD_CPU_BUDGET_ALGORITHM_NONE: case THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE: break; #if defined(RTEMS_SCORE_THREAD_ENABLE_EXHAUST_TIMESLICE) case THREAD_CPU_BUDGET_ALGORITHM_EXHAUST_TIMESLICE: the_thread->cpu_time_budget = _Thread_Ticks_per_timeslice; 400099c4: 10 80 00 0e b 400099fc <_Thread_Initialize+0xfc> 400099c8: 03 10 00 78 sethi %hi(0x4001e000), %g1 * 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++ ) 400099cc: 03 10 00 78 sethi %hi(0x4001e000), %g1 400099d0: c4 00 62 7c ld [ %g1 + 0x27c ], %g2 ! 4001e27c <_Thread_Maximum_extensions> 400099d4: 10 80 00 05 b 400099e8 <_Thread_Initialize+0xe8> 400099d8: 82 10 20 00 clr %g1 the_thread->extensions[i] = NULL; 400099dc: 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++ ) 400099e0: 82 00 60 01 inc %g1 the_thread->extensions[i] = NULL; 400099e4: 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++ ) 400099e8: 80 a0 40 02 cmp %g1, %g2 400099ec: 28 bf ff fc bleu,a 400099dc <_Thread_Initialize+0xdc> 400099f0: c8 06 61 54 ld [ %i1 + 0x154 ], %g4 * General initialization */ the_thread->Start.is_preemptible = is_preemptible; the_thread->Start.budget_algorithm = budget_algorithm; the_thread->Start.budget_callout = budget_callout; 400099f4: 10 bf ff ef b 400099b0 <_Thread_Initialize+0xb0> 400099f8: c2 07 a0 64 ld [ %fp + 0x64 ], %g1 case THREAD_CPU_BUDGET_ALGORITHM_NONE: case THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE: break; #if defined(RTEMS_SCORE_THREAD_ENABLE_EXHAUST_TIMESLICE) case THREAD_CPU_BUDGET_ALGORITHM_EXHAUST_TIMESLICE: the_thread->cpu_time_budget = _Thread_Ticks_per_timeslice; 400099fc: c2 00 61 60 ld [ %g1 + 0x160 ], %g1 40009a00: c2 26 60 74 st %g1, [ %i1 + 0x74 ] case THREAD_CPU_BUDGET_ALGORITHM_CALLOUT: break; #endif } the_thread->Start.isr_level = isr_level; 40009a04: c2 07 a0 68 ld [ %fp + 0x68 ], %g1 the_thread->current_state = STATES_DORMANT; 40009a08: b4 10 20 01 mov 1, %i2 case THREAD_CPU_BUDGET_ALGORITHM_CALLOUT: break; #endif } the_thread->Start.isr_level = isr_level; 40009a0c: c2 26 60 a8 st %g1, [ %i1 + 0xa8 ] */ RTEMS_INLINE_ROUTINE void* _Scheduler_Allocate( Thread_Control *the_thread ) { return _Scheduler.Operations.allocate( the_thread ); 40009a10: 03 10 00 75 sethi %hi(0x4001d400), %g1 40009a14: c2 00 62 bc ld [ %g1 + 0x2bc ], %g1 ! 4001d6bc <_Scheduler+0x18> the_thread->current_state = STATES_DORMANT; 40009a18: f4 26 60 10 st %i2, [ %i1 + 0x10 ] the_thread->Wait.queue = NULL; 40009a1c: c0 26 60 44 clr [ %i1 + 0x44 ] the_thread->resource_count = 0; 40009a20: c0 26 60 1c clr [ %i1 + 0x1c ] the_thread->real_priority = priority; 40009a24: fa 26 60 18 st %i5, [ %i1 + 0x18 ] the_thread->Start.initial_priority = priority; 40009a28: fa 26 60 ac st %i5, [ %i1 + 0xac ] 40009a2c: 9f c0 40 00 call %g1 40009a30: 90 10 00 19 mov %i1, %o0 sched =_Scheduler_Allocate( the_thread ); if ( !sched ) 40009a34: b6 92 20 00 orcc %o0, 0, %i3 40009a38: 02 80 00 18 be 40009a98 <_Thread_Initialize+0x198> 40009a3c: 90 10 00 19 mov %i1, %o0 goto failed; _Thread_Set_priority( the_thread, priority ); 40009a40: 40 00 01 99 call 4000a0a4 <_Thread_Set_priority> 40009a44: 92 10 00 1d mov %i5, %o1 #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 40009a48: c4 06 20 1c ld [ %i0 + 0x1c ], %g2 Objects_Information *information, Objects_Control *the_object, Objects_Name name ) { _Objects_Set_local_object( 40009a4c: c2 16 60 0a lduh [ %i1 + 0xa ], %g1 static inline void _Timestamp64_implementation_Set_to_zero( Timestamp64_Control *_time ) { *_time = 0; 40009a50: c0 26 60 80 clr [ %i1 + 0x80 ] 40009a54: c0 26 60 84 clr [ %i1 + 0x84 ] #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 40009a58: 83 28 60 02 sll %g1, 2, %g1 40009a5c: f2 20 80 01 st %i1, [ %g2 + %g1 ] information, _Objects_Get_index( the_object->id ), the_object ); the_object->name = name; 40009a60: e2 26 60 0c st %l1, [ %i1 + 0xc ] * @{ */ static inline bool _User_extensions_Thread_create( Thread_Control *created ) { User_extensions_Thread_create_context ctx = { created, true }; 40009a64: f2 27 bf f8 st %i1, [ %fp + -8 ] 40009a68: f4 2f bf fc stb %i2, [ %fp + -4 ] _User_extensions_Iterate( &ctx, _User_extensions_Thread_create_visitor ); 40009a6c: 90 07 bf f8 add %fp, -8, %o0 40009a70: 13 10 00 28 sethi %hi(0x4000a000), %o1 40009a74: 40 00 02 3a call 4000a35c <_User_extensions_Iterate> 40009a78: 92 12 62 38 or %o1, 0x238, %o1 ! 4000a238 <_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 ) 40009a7c: c2 0f bf fc ldub [ %fp + -4 ], %g1 40009a80: 80 a0 60 00 cmp %g1, 0 40009a84: 02 80 00 05 be 40009a98 <_Thread_Initialize+0x198> 40009a88: b0 10 20 01 mov 1, %i0 40009a8c: b0 0e 20 01 and %i0, 1, %i0 40009a90: 81 c7 e0 08 ret 40009a94: 81 e8 00 00 restore return true; failed: _Workspace_Free( the_thread->libc_reent ); 40009a98: 40 00 03 6a call 4000a840 <_Workspace_Free> 40009a9c: d0 06 61 48 ld [ %i1 + 0x148 ], %o0 for ( i=0 ; i <= THREAD_API_LAST ; i++ ) _Workspace_Free( the_thread->API_Extensions[i] ); 40009aa0: 40 00 03 68 call 4000a840 <_Workspace_Free> 40009aa4: d0 06 61 4c ld [ %i1 + 0x14c ], %o0 40009aa8: 40 00 03 66 call 4000a840 <_Workspace_Free> 40009aac: d0 06 61 50 ld [ %i1 + 0x150 ], %o0 _Workspace_Free( extensions_area ); 40009ab0: 40 00 03 64 call 4000a840 <_Workspace_Free> 40009ab4: 90 10 00 1c mov %i4, %o0 #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) _Workspace_Free( fp_area ); #endif _Workspace_Free( sched ); 40009ab8: 40 00 03 62 call 4000a840 <_Workspace_Free> 40009abc: 90 10 00 1b mov %i3, %o0 _Thread_Stack_Free( the_thread ); 40009ac0: 40 00 01 b1 call 4000a184 <_Thread_Stack_Free> 40009ac4: 90 10 00 19 mov %i1, %o0 stack = the_thread->Start.stack; #else if ( !stack_area ) { actual_stack_size = _Thread_Stack_Allocate( the_thread, stack_size ); if ( !actual_stack_size || actual_stack_size < stack_size ) return false; /* stack allocation failed */ 40009ac8: b0 10 20 00 clr %i0 _Workspace_Free( sched ); _Thread_Stack_Free( the_thread ); return false; } 40009acc: b0 0e 20 01 and %i0, 1, %i0 40009ad0: 81 c7 e0 08 ret 40009ad4: 81 e8 00 00 restore =============================================================================== 4000a184 <_Thread_Stack_Free>: #include void _Thread_Stack_Free( Thread_Control *the_thread ) { 4000a184: 9d e3 bf a0 save %sp, -96, %sp #if defined(RTEMS_SCORE_THREAD_ENABLE_USER_PROVIDED_STACK_VIA_API) /* * If the API provided the stack space, then don't free it. */ if ( !the_thread->Start.core_allocated_stack ) 4000a188: c4 0e 20 b0 ldub [ %i0 + 0xb0 ], %g2 void _Thread_Stack_Free( Thread_Control *the_thread ) { rtems_stack_free_hook stack_free_hook = 4000a18c: 03 10 00 6d sethi %hi(0x4001b400), %g1 #if defined(RTEMS_SCORE_THREAD_ENABLE_USER_PROVIDED_STACK_VIA_API) /* * If the API provided the stack space, then don't free it. */ if ( !the_thread->Start.core_allocated_stack ) 4000a190: 80 a0 a0 00 cmp %g2, 0 4000a194: 02 80 00 04 be 4000a1a4 <_Thread_Stack_Free+0x20> <== NEVER TAKEN 4000a198: c2 00 63 84 ld [ %g1 + 0x384 ], %g1 * Call ONLY the CPU table stack free hook, or the * the RTEMS workspace free. This is so the free * routine properly matches the allocation of the stack. */ (*stack_free_hook)( the_thread->Start.Initial_stack.area ); 4000a19c: 9f c0 40 00 call %g1 4000a1a0: d0 06 20 b8 ld [ %i0 + 0xb8 ], %o0 4000a1a4: 81 c7 e0 08 ret 4000a1a8: 81 e8 00 00 restore =============================================================================== 4000e900 <_Thread_queue_Extract_fifo>: void _Thread_queue_Extract_fifo( Thread_queue_Control *the_thread_queue __attribute__((unused)), Thread_Control *the_thread ) { 4000e900: 9d e3 bf a0 save %sp, -96, %sp <== NOT EXECUTED ISR_Level level; _ISR_Disable( level ); 4000e904: 7f ff cd e9 call 400020a8 <== NOT EXECUTED 4000e908: 01 00 00 00 nop <== NOT EXECUTED 4000e90c: b0 10 00 08 mov %o0, %i0 <== NOT EXECUTED 4000e910: c4 06 60 10 ld [ %i1 + 0x10 ], %g2 <== NOT EXECUTED if ( !_States_Is_waiting_on_thread_queue( the_thread->current_state ) ) { 4000e914: 03 00 00 ef sethi %hi(0x3bc00), %g1 <== NOT EXECUTED 4000e918: 82 10 62 e0 or %g1, 0x2e0, %g1 ! 3bee0 <== NOT EXECUTED 4000e91c: 80 88 80 01 btst %g2, %g1 <== NOT EXECUTED 4000e920: 32 80 00 04 bne,a 4000e930 <_Thread_queue_Extract_fifo+0x30><== NOT EXECUTED 4000e924: c2 06 60 04 ld [ %i1 + 4 ], %g1 <== NOT EXECUTED _ISR_Enable( level ); 4000e928: 7f ff cd e4 call 400020b8 <== NOT EXECUTED 4000e92c: 81 e8 00 00 restore <== NOT EXECUTED ) { Chain_Node *next; Chain_Node *previous; next = the_node->next; 4000e930: c4 06 40 00 ld [ %i1 ], %g2 <== NOT EXECUTED previous = the_node->previous; next->previous = previous; 4000e934: c2 20 a0 04 st %g1, [ %g2 + 4 ] <== NOT EXECUTED previous->next = next; 4000e938: 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 ) ) { 4000e93c: c2 06 60 50 ld [ %i1 + 0x50 ], %g1 <== NOT EXECUTED 4000e940: 80 a0 60 02 cmp %g1, 2 <== NOT EXECUTED 4000e944: 02 80 00 06 be 4000e95c <_Thread_queue_Extract_fifo+0x5c> <== NOT EXECUTED 4000e948: c0 26 60 44 clr [ %i1 + 0x44 ] <== NOT EXECUTED _ISR_Enable( level ); 4000e94c: 7f ff cd db call 400020b8 <== NOT EXECUTED 4000e950: b0 10 00 19 mov %i1, %i0 <== NOT EXECUTED 4000e954: 10 80 00 09 b 4000e978 <_Thread_queue_Extract_fifo+0x78> <== NOT EXECUTED 4000e958: 33 04 01 ff sethi %hi(0x1007fc00), %i1 <== NOT EXECUTED 4000e95c: 82 10 20 03 mov 3, %g1 <== NOT EXECUTED 4000e960: c2 26 60 50 st %g1, [ %i1 + 0x50 ] <== NOT EXECUTED } else { _Watchdog_Deactivate( &the_thread->Timer ); _ISR_Enable( level ); 4000e964: 7f ff cd d5 call 400020b8 <== NOT EXECUTED 4000e968: b0 10 00 19 mov %i1, %i0 <== NOT EXECUTED (void) _Watchdog_Remove( &the_thread->Timer ); 4000e96c: 7f ff ef 14 call 4000a5bc <_Watchdog_Remove> <== NOT EXECUTED 4000e970: 90 06 60 48 add %i1, 0x48, %o0 <== NOT EXECUTED 4000e974: 33 04 01 ff sethi %hi(0x1007fc00), %i1 <== NOT EXECUTED 4000e978: b2 16 63 f8 or %i1, 0x3f8, %i1 ! 1007fff8 <== NOT EXECUTED 4000e97c: 7f ff ea d3 call 400094c8 <_Thread_Clear_state> <== NOT EXECUTED 4000e980: 81 e8 00 00 restore <== NOT EXECUTED =============================================================================== 40009ff0 <_Thread_queue_Requeue>: void _Thread_queue_Requeue( Thread_queue_Control *the_thread_queue, Thread_Control *the_thread ) { 40009ff0: 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 ) 40009ff4: 80 a6 20 00 cmp %i0, 0 40009ff8: 02 80 00 19 be 4000a05c <_Thread_queue_Requeue+0x6c> <== NEVER TAKEN 40009ffc: 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 ) { 4000a000: fa 06 20 34 ld [ %i0 + 0x34 ], %i5 4000a004: 80 a7 60 01 cmp %i5, 1 4000a008: 12 80 00 15 bne 4000a05c <_Thread_queue_Requeue+0x6c> <== NEVER TAKEN 4000a00c: 01 00 00 00 nop Thread_queue_Control *tq = the_thread_queue; ISR_Level level; ISR_Level level_ignored; _ISR_Disable( level ); 4000a010: 7f ff e0 26 call 400020a8 4000a014: 01 00 00 00 nop 4000a018: b8 10 00 08 mov %o0, %i4 4000a01c: c4 06 60 10 ld [ %i1 + 0x10 ], %g2 if ( _States_Is_waiting_on_thread_queue( the_thread->current_state ) ) { 4000a020: 03 00 00 ef sethi %hi(0x3bc00), %g1 4000a024: 82 10 62 e0 or %g1, 0x2e0, %g1 ! 3bee0 4000a028: 80 88 80 01 btst %g2, %g1 4000a02c: 02 80 00 0a be 4000a054 <_Thread_queue_Requeue+0x64> <== NEVER TAKEN 4000a030: 90 10 00 18 mov %i0, %o0 _Thread_queue_Enter_critical_section( tq ); _Thread_queue_Extract_priority_helper( tq, the_thread, true ); 4000a034: 92 10 00 19 mov %i1, %o1 4000a038: 94 10 20 01 mov 1, %o2 4000a03c: 40 00 0b b6 call 4000cf14 <_Thread_queue_Extract_priority_helper> 4000a040: fa 26 20 30 st %i5, [ %i0 + 0x30 ] (void) _Thread_queue_Enqueue_priority( tq, the_thread, &level_ignored ); 4000a044: 90 10 00 18 mov %i0, %o0 4000a048: 92 10 00 19 mov %i1, %o1 4000a04c: 7f ff ff 50 call 40009d8c <_Thread_queue_Enqueue_priority> 4000a050: 94 07 bf fc add %fp, -4, %o2 } _ISR_Enable( level ); 4000a054: 7f ff e0 19 call 400020b8 4000a058: 90 10 00 1c mov %i4, %o0 4000a05c: 81 c7 e0 08 ret 4000a060: 81 e8 00 00 restore =============================================================================== 4000a064 <_Thread_queue_Timeout>: void _Thread_queue_Timeout( Objects_Id id, void *ignored __attribute__((unused)) ) { 4000a064: 9d e3 bf 98 save %sp, -104, %sp Thread_Control *the_thread; Objects_Locations location; the_thread = _Thread_Get( id, &location ); 4000a068: 90 10 00 18 mov %i0, %o0 4000a06c: 7f ff fd f9 call 40009850 <_Thread_Get> 4000a070: 92 07 bf fc add %fp, -4, %o1 switch ( location ) { 4000a074: c2 07 bf fc ld [ %fp + -4 ], %g1 4000a078: 80 a0 60 00 cmp %g1, 0 4000a07c: 12 80 00 08 bne 4000a09c <_Thread_queue_Timeout+0x38> <== NEVER TAKEN 4000a080: 01 00 00 00 nop #if defined(RTEMS_MULTIPROCESSING) case OBJECTS_REMOTE: /* impossible */ #endif break; case OBJECTS_LOCAL: _Thread_queue_Process_timeout( the_thread ); 4000a084: 40 00 0b db call 4000cff0 <_Thread_queue_Process_timeout> 4000a088: 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; 4000a08c: 03 10 00 78 sethi %hi(0x4001e000), %g1 4000a090: c4 00 62 00 ld [ %g1 + 0x200 ], %g2 ! 4001e200 <_Thread_Dispatch_disable_level> --level; 4000a094: 84 00 bf ff add %g2, -1, %g2 _Thread_Dispatch_disable_level = level; 4000a098: c4 20 62 00 st %g2, [ %g1 + 0x200 ] 4000a09c: 81 c7 e0 08 ret 4000a0a0: 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 f5 sethi %hi(0x4003d400), %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 f5 sethi %hi(0x4003d400), %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 e2 78 ld [ %l3 + 0x278 ], %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 79 call 4001c8c8 <_Watchdog_Adjust_to_chain> 400182e8: 94 10 00 1c mov %i4, %o2 400182ec: d0 1d 20 d8 ldd [ %l4 + 0xd8 ], %o0 400182f0: 94 10 20 00 clr %o2 400182f4: 17 0e e6 b2 sethi %hi(0x3b9ac800), %o3 400182f8: 40 00 4f 75 call 4002c0cc <__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 6c call 4001c8c8 <_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 11 3e call 4001c828 <_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 f4 call 40018f10 <_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 80 call 4001c970 <_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 f5 sethi %hi(0x4003d400), %g1 40018418: c4 00 61 90 ld [ %g1 + 0x190 ], %g2 ! 4003d590 <_Thread_Dispatch_disable_level> ++level; 4001841c: 84 00 a0 01 inc %g2 _Thread_Dispatch_disable_level = level; 40018420: c4 20 61 90 st %g2, [ %g1 + 0x190 ] /* * 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 10 1a call 4001c490 <_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 ce call 4001bb78 <_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 9f call 4001cad0 <_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 9d call 4001cad0 <_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 f5 sethi %hi(0x4003d400), %g1 40018480: c4 00 61 90 ld [ %g1 + 0x190 ], %g2 ! 4003d590 <_Thread_Dispatch_disable_level> ++level; 40018484: 84 00 a0 01 inc %g2 _Thread_Dispatch_disable_level = level; 40018488: c4 20 61 90 st %g2, [ %g1 + 0x190 ] * 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 f5 sethi %hi(0x4003d400), %g1 400184a8: c4 00 62 78 ld [ %g1 + 0x278 ], %g2 ! 4003d678 <_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 11 21 call 4001c970 <_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 f5 sethi %hi(0x4003d400), %g1 40018528: d0 18 60 d8 ldd [ %g1 + 0xd8 ], %o0 ! 4003d4d8 <_TOD> 4001852c: 94 10 20 00 clr %o2 40018530: 17 0e e6 b2 sethi %hi(0x3b9ac800), %o3 40018534: 40 00 4e e6 call 4002c0cc <__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 f8 call 4001c970 <_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 72 call 4001bb78 <_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 49 call 40018ee0 <_Chain_Append> 400185c0: 81 e8 00 00 restore =============================================================================== 4000bb2c <_Timestamp64_Divide>: const Timestamp64_Control *_lhs, const Timestamp64_Control *_rhs, uint32_t *_ival_percentage, uint32_t *_fval_percentage ) { 4000bb2c: 9d e3 bf a0 save %sp, -96, %sp Timestamp64_Control answer; if ( *_rhs == 0 ) { 4000bb30: d4 1e 40 00 ldd [ %i1 ], %o2 4000bb34: 80 92 80 0b orcc %o2, %o3, %g0 4000bb38: 32 80 00 06 bne,a 4000bb50 <_Timestamp64_Divide+0x24> <== ALWAYS TAKEN 4000bb3c: d8 1e 00 00 ldd [ %i0 ], %o4 *_ival_percentage = 0; 4000bb40: c0 26 80 00 clr [ %i2 ] <== NOT EXECUTED *_fval_percentage = 0; 4000bb44: c0 26 c0 00 clr [ %i3 ] <== NOT EXECUTED return; 4000bb48: 81 c7 e0 08 ret <== NOT EXECUTED 4000bb4c: 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; 4000bb50: 83 2b 20 02 sll %o4, 2, %g1 4000bb54: 87 2b 60 02 sll %o5, 2, %g3 4000bb58: 89 33 60 1e srl %o5, 0x1e, %g4 4000bb5c: bb 28 e0 05 sll %g3, 5, %i5 4000bb60: 84 11 00 01 or %g4, %g1, %g2 4000bb64: 83 30 e0 1b srl %g3, 0x1b, %g1 4000bb68: b9 28 a0 05 sll %g2, 5, %i4 4000bb6c: 86 a7 40 03 subcc %i5, %g3, %g3 4000bb70: b8 10 40 1c or %g1, %i4, %i4 4000bb74: 84 67 00 02 subx %i4, %g2, %g2 4000bb78: b2 80 c0 0d addcc %g3, %o5, %i1 4000bb7c: b0 40 80 0c addx %g2, %o4, %i0 4000bb80: 83 36 60 1e srl %i1, 0x1e, %g1 4000bb84: 87 2e 60 02 sll %i1, 2, %g3 4000bb88: 85 2e 20 02 sll %i0, 2, %g2 4000bb8c: 84 10 40 02 or %g1, %g2, %g2 4000bb90: ba 86 40 03 addcc %i1, %g3, %i5 4000bb94: b8 46 00 02 addx %i0, %g2, %i4 4000bb98: 83 37 60 1e srl %i5, 0x1e, %g1 4000bb9c: 87 2f 60 02 sll %i5, 2, %g3 4000bba0: 85 2f 20 02 sll %i4, 2, %g2 4000bba4: 84 10 40 02 or %g1, %g2, %g2 4000bba8: 92 87 40 03 addcc %i5, %g3, %o1 4000bbac: 90 47 00 02 addx %i4, %g2, %o0 4000bbb0: 87 32 60 1b srl %o1, 0x1b, %g3 4000bbb4: 85 2a 20 05 sll %o0, 5, %g2 4000bbb8: 83 2a 60 05 sll %o1, 5, %g1 4000bbbc: 90 10 c0 02 or %g3, %g2, %o0 4000bbc0: 40 00 39 e6 call 4001a358 <__divdi3> 4000bbc4: 92 10 00 01 mov %g1, %o1 *_ival_percentage = answer / 1000; 4000bbc8: 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; 4000bbcc: b8 10 00 08 mov %o0, %i4 4000bbd0: ba 10 00 09 mov %o1, %i5 *_ival_percentage = answer / 1000; 4000bbd4: 40 00 39 e1 call 4001a358 <__divdi3> 4000bbd8: 96 10 23 e8 mov 0x3e8, %o3 *_fval_percentage = answer % 1000; 4000bbdc: 90 10 00 1c mov %i4, %o0 * TODO: Rounding on the last digit of the fval. */ answer = (*_lhs * 100000) / *_rhs; *_ival_percentage = answer / 1000; 4000bbe0: d2 26 80 00 st %o1, [ %i2 ] *_fval_percentage = answer % 1000; 4000bbe4: 94 10 20 00 clr %o2 4000bbe8: 92 10 00 1d mov %i5, %o1 4000bbec: 40 00 3a c6 call 4001a704 <__moddi3> 4000bbf0: 96 10 23 e8 mov 0x3e8, %o3 4000bbf4: d2 26 c0 00 st %o1, [ %i3 ] 4000bbf8: 81 c7 e0 08 ret 4000bbfc: 81 e8 00 00 restore =============================================================================== 4000a41c <_User_extensions_Handler_initialization>: } } void _User_extensions_Handler_initialization(void) { 4000a41c: 9d e3 bf 98 save %sp, -104, %sp uint32_t number_of_initial_extensions = 4000a420: 03 10 00 6d sethi %hi(0x4001b400), %g1 4000a424: c2 00 63 98 ld [ %g1 + 0x398 ], %g1 ! 4001b798 rtems_configuration_get_number_of_initial_extensions(); if ( number_of_initial_extensions > 0 ) { 4000a428: 80 a0 60 00 cmp %g1, 0 4000a42c: 02 80 00 0a be 4000a454 <_User_extensions_Handler_initialization+0x38><== NEVER TAKEN 4000a430: 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 ) 4000a434: 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 = 4000a438: 40 00 01 08 call 4000a858 <_Workspace_Allocate_or_fatal_error> 4000a43c: 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 ); 4000a440: 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 }; 4000a444: d0 27 bf fc st %o0, [ %fp + -4 ] _User_extensions_Iterate( &ctx, _User_extensions_Switch_visitor ); 4000a448: 92 12 63 d8 or %o1, 0x3d8, %o1 4000a44c: 7f ff ff c4 call 4000a35c <_User_extensions_Iterate> 4000a450: 90 07 bf fc add %fp, -4, %o0 4000a454: 81 c7 e0 08 ret 4000a458: 81 e8 00 00 restore =============================================================================== 4000be64 <_Watchdog_Adjust>: void _Watchdog_Adjust( Chain_Control *header, Watchdog_Adjust_directions direction, Watchdog_Interval units ) { 4000be64: 9d e3 bf a0 save %sp, -96, %sp ISR_Level level; _ISR_Disable( level ); 4000be68: 7f ff dc 22 call 40002ef0 4000be6c: 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; 4000be70: 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 ); 4000be74: 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 ) ) { 4000be78: 80 a0 40 1c cmp %g1, %i4 4000be7c: 02 80 00 20 be 4000befc <_Watchdog_Adjust+0x98> 4000be80: 80 a6 60 00 cmp %i1, 0 switch ( direction ) { 4000be84: 02 80 00 1b be 4000bef0 <_Watchdog_Adjust+0x8c> 4000be88: b6 10 20 01 mov 1, %i3 4000be8c: 80 a6 60 01 cmp %i1, 1 4000be90: 12 80 00 1b bne 4000befc <_Watchdog_Adjust+0x98> <== NEVER TAKEN 4000be94: 01 00 00 00 nop case WATCHDOG_BACKWARD: _Watchdog_First( header )->delta_interval += units; 4000be98: c4 00 60 10 ld [ %g1 + 0x10 ], %g2 4000be9c: 10 80 00 07 b 4000beb8 <_Watchdog_Adjust+0x54> 4000bea0: b4 00 80 1a add %g2, %i2, %i2 break; case WATCHDOG_FORWARD: while ( units ) { if ( units < _Watchdog_First( header )->delta_interval ) { 4000bea4: c4 00 60 10 ld [ %g1 + 0x10 ], %g2 4000bea8: 80 a6 80 02 cmp %i2, %g2 4000beac: 3a 80 00 05 bcc,a 4000bec0 <_Watchdog_Adjust+0x5c> 4000beb0: f6 20 60 10 st %i3, [ %g1 + 0x10 ] _Watchdog_First( header )->delta_interval -= units; 4000beb4: b4 20 80 1a sub %g2, %i2, %i2 break; 4000beb8: 10 80 00 11 b 4000befc <_Watchdog_Adjust+0x98> 4000bebc: f4 20 60 10 st %i2, [ %g1 + 0x10 ] } else { units -= _Watchdog_First( header )->delta_interval; 4000bec0: b4 26 80 02 sub %i2, %g2, %i2 _Watchdog_First( header )->delta_interval = 1; _ISR_Enable( level ); 4000bec4: 7f ff dc 0f call 40002f00 4000bec8: 01 00 00 00 nop _Watchdog_Tickle( header ); 4000becc: 40 00 00 90 call 4000c10c <_Watchdog_Tickle> 4000bed0: 90 10 00 18 mov %i0, %o0 _ISR_Disable( level ); 4000bed4: 7f ff dc 07 call 40002ef0 4000bed8: 01 00 00 00 nop if ( _Chain_Is_empty( header ) ) 4000bedc: c2 06 00 00 ld [ %i0 ], %g1 4000bee0: 80 a0 40 1c cmp %g1, %i4 4000bee4: 12 80 00 04 bne 4000bef4 <_Watchdog_Adjust+0x90> 4000bee8: 80 a6 a0 00 cmp %i2, 0 4000beec: 30 80 00 04 b,a 4000befc <_Watchdog_Adjust+0x98> switch ( direction ) { case WATCHDOG_BACKWARD: _Watchdog_First( header )->delta_interval += units; break; case WATCHDOG_FORWARD: while ( units ) { 4000bef0: 80 a6 a0 00 cmp %i2, 0 4000bef4: 32 bf ff ec bne,a 4000bea4 <_Watchdog_Adjust+0x40> <== ALWAYS TAKEN 4000bef8: c2 06 00 00 ld [ %i0 ], %g1 } break; } } _ISR_Enable( level ); 4000befc: 7f ff dc 01 call 40002f00 4000bf00: 91 e8 00 08 restore %g0, %o0, %o0 =============================================================================== 4000a5bc <_Watchdog_Remove>: #include Watchdog_States _Watchdog_Remove( Watchdog_Control *the_watchdog ) { 4000a5bc: 9d e3 bf a0 save %sp, -96, %sp ISR_Level level; Watchdog_States previous_state; Watchdog_Control *next_watchdog; _ISR_Disable( level ); 4000a5c0: 7f ff de ba call 400020a8 4000a5c4: ba 10 00 18 mov %i0, %i5 previous_state = the_watchdog->state; 4000a5c8: f0 06 20 08 ld [ %i0 + 8 ], %i0 switch ( previous_state ) { 4000a5cc: 80 a6 20 01 cmp %i0, 1 4000a5d0: 22 80 00 1e be,a 4000a648 <_Watchdog_Remove+0x8c> 4000a5d4: c0 27 60 08 clr [ %i5 + 8 ] 4000a5d8: 0a 80 00 1d bcs 4000a64c <_Watchdog_Remove+0x90> 4000a5dc: 03 10 00 78 sethi %hi(0x4001e000), %g1 4000a5e0: 80 a6 20 03 cmp %i0, 3 4000a5e4: 18 80 00 1a bgu 4000a64c <_Watchdog_Remove+0x90> <== NEVER TAKEN 4000a5e8: 01 00 00 00 nop RTEMS_INLINE_ROUTINE Watchdog_Control *_Watchdog_Next( Watchdog_Control *the_watchdog ) { return ( (Watchdog_Control *) the_watchdog->Node.next ); 4000a5ec: 10 80 00 02 b 4000a5f4 <_Watchdog_Remove+0x38> 4000a5f0: c2 07 40 00 ld [ %i5 ], %g1 break; case WATCHDOG_ACTIVE: case WATCHDOG_REMOVE_IT: the_watchdog->state = WATCHDOG_INACTIVE; 4000a5f4: c0 27 60 08 clr [ %i5 + 8 ] next_watchdog = _Watchdog_Next( the_watchdog ); if ( _Watchdog_Next(next_watchdog) ) 4000a5f8: c4 00 40 00 ld [ %g1 ], %g2 4000a5fc: 80 a0 a0 00 cmp %g2, 0 4000a600: 02 80 00 07 be 4000a61c <_Watchdog_Remove+0x60> 4000a604: 05 10 00 78 sethi %hi(0x4001e000), %g2 next_watchdog->delta_interval += the_watchdog->delta_interval; 4000a608: c6 00 60 10 ld [ %g1 + 0x10 ], %g3 4000a60c: c4 07 60 10 ld [ %i5 + 0x10 ], %g2 4000a610: 84 00 c0 02 add %g3, %g2, %g2 4000a614: c4 20 60 10 st %g2, [ %g1 + 0x10 ] if ( _Watchdog_Sync_count ) 4000a618: 05 10 00 78 sethi %hi(0x4001e000), %g2 4000a61c: c4 00 a2 e4 ld [ %g2 + 0x2e4 ], %g2 ! 4001e2e4 <_Watchdog_Sync_count> 4000a620: 80 a0 a0 00 cmp %g2, 0 4000a624: 22 80 00 07 be,a 4000a640 <_Watchdog_Remove+0x84> 4000a628: c4 07 60 04 ld [ %i5 + 4 ], %g2 _Watchdog_Sync_level = _ISR_Nest_level; 4000a62c: 05 10 00 79 sethi %hi(0x4001e400), %g2 4000a630: c6 00 a3 18 ld [ %g2 + 0x318 ], %g3 ! 4001e718 <_Per_CPU_Information+0x8> 4000a634: 05 10 00 78 sethi %hi(0x4001e000), %g2 4000a638: c6 20 a2 84 st %g3, [ %g2 + 0x284 ] ! 4001e284 <_Watchdog_Sync_level> { Chain_Node *next; Chain_Node *previous; next = the_node->next; previous = the_node->previous; 4000a63c: c4 07 60 04 ld [ %i5 + 4 ], %g2 next->previous = previous; 4000a640: c4 20 60 04 st %g2, [ %g1 + 4 ] previous->next = next; 4000a644: c2 20 80 00 st %g1, [ %g2 ] _Chain_Extract_unprotected( &the_watchdog->Node ); break; } the_watchdog->stop_time = _Watchdog_Ticks_since_boot; 4000a648: 03 10 00 78 sethi %hi(0x4001e000), %g1 4000a64c: c2 00 62 e8 ld [ %g1 + 0x2e8 ], %g1 ! 4001e2e8 <_Watchdog_Ticks_since_boot> 4000a650: c2 27 60 18 st %g1, [ %i5 + 0x18 ] _ISR_Enable( level ); 4000a654: 7f ff de 99 call 400020b8 4000a658: 01 00 00 00 nop return( previous_state ); } 4000a65c: 81 c7 e0 08 ret 4000a660: 81 e8 00 00 restore =============================================================================== 4000b810 <_Watchdog_Report_chain>: void _Watchdog_Report_chain( const char *name, Chain_Control *header ) { 4000b810: 9d e3 bf a0 save %sp, -96, %sp ISR_Level level; Chain_Node *node; _ISR_Disable( level ); 4000b814: 7f ff dc 94 call 40002a64 4000b818: b8 10 00 18 mov %i0, %i4 4000b81c: b0 10 00 08 mov %o0, %i0 printk( "Watchdog Chain: %s %p\n", name, header ); 4000b820: 11 10 00 78 sethi %hi(0x4001e000), %o0 4000b824: 94 10 00 19 mov %i1, %o2 4000b828: 90 12 23 50 or %o0, 0x350, %o0 4000b82c: 7f ff e3 e5 call 400047c0 4000b830: 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; 4000b834: 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 ); 4000b838: b2 06 60 04 add %i1, 4, %i1 if ( !_Chain_Is_empty( header ) ) { 4000b83c: 80 a7 40 19 cmp %i5, %i1 4000b840: 12 80 00 04 bne 4000b850 <_Watchdog_Report_chain+0x40> 4000b844: 92 10 00 1d mov %i5, %o1 _Watchdog_Report( NULL, watch ); } printk( "== end of %s \n", name ); } else { printk( "Chain is empty\n" ); 4000b848: 10 80 00 0d b 4000b87c <_Watchdog_Report_chain+0x6c> 4000b84c: 11 10 00 78 sethi %hi(0x4001e000), %o0 node != _Chain_Tail(header) ; node = node->next ) { Watchdog_Control *watch = (Watchdog_Control *) node; _Watchdog_Report( NULL, watch ); 4000b850: 40 00 00 0f call 4000b88c <_Watchdog_Report> 4000b854: 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 ) 4000b858: 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 ) ; 4000b85c: 80 a7 40 19 cmp %i5, %i1 4000b860: 12 bf ff fc bne 4000b850 <_Watchdog_Report_chain+0x40> <== NEVER TAKEN 4000b864: 92 10 00 1d mov %i5, %o1 { Watchdog_Control *watch = (Watchdog_Control *) node; _Watchdog_Report( NULL, watch ); } printk( "== end of %s \n", name ); 4000b868: 11 10 00 78 sethi %hi(0x4001e000), %o0 4000b86c: 92 10 00 1c mov %i4, %o1 4000b870: 7f ff e3 d4 call 400047c0 4000b874: 90 12 23 68 or %o0, 0x368, %o0 4000b878: 30 80 00 03 b,a 4000b884 <_Watchdog_Report_chain+0x74> } else { printk( "Chain is empty\n" ); 4000b87c: 7f ff e3 d1 call 400047c0 4000b880: 90 12 23 78 or %o0, 0x378, %o0 } _ISR_Enable( level ); 4000b884: 7f ff dc 7c call 40002a74 4000b888: 81 e8 00 00 restore =============================================================================== 4000a664 <_Watchdog_Tickle>: #include void _Watchdog_Tickle( Chain_Control *header ) { 4000a664: 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 ); 4000a668: 7f ff de 90 call 400020a8 4000a66c: b8 10 00 18 mov %i0, %i4 4000a670: 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; 4000a674: 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 ); 4000a678: b6 07 20 04 add %i4, 4, %i3 if ( _Chain_Is_empty( header ) ) 4000a67c: 80 a7 40 1b cmp %i5, %i3 4000a680: 02 80 00 1f be 4000a6fc <_Watchdog_Tickle+0x98> 4000a684: 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) { 4000a688: c2 07 60 10 ld [ %i5 + 0x10 ], %g1 4000a68c: 80 a0 60 00 cmp %g1, 0 4000a690: 02 80 00 06 be 4000a6a8 <_Watchdog_Tickle+0x44> <== NEVER TAKEN 4000a694: 82 00 7f ff add %g1, -1, %g1 the_watchdog->delta_interval--; 4000a698: c2 27 60 10 st %g1, [ %i5 + 0x10 ] if ( the_watchdog->delta_interval != 0 ) 4000a69c: 80 a0 60 00 cmp %g1, 0 4000a6a0: 12 80 00 17 bne 4000a6fc <_Watchdog_Tickle+0x98> 4000a6a4: 01 00 00 00 nop goto leave; } do { watchdog_state = _Watchdog_Remove( the_watchdog ); 4000a6a8: 7f ff ff c5 call 4000a5bc <_Watchdog_Remove> 4000a6ac: 90 10 00 1d mov %i5, %o0 4000a6b0: b4 10 00 08 mov %o0, %i2 _ISR_Enable( level ); 4000a6b4: 7f ff de 81 call 400020b8 4000a6b8: 90 10 00 18 mov %i0, %o0 switch( watchdog_state ) { 4000a6bc: 80 a6 a0 02 cmp %i2, 2 4000a6c0: 12 80 00 06 bne 4000a6d8 <_Watchdog_Tickle+0x74> 4000a6c4: 01 00 00 00 nop case WATCHDOG_ACTIVE: (*the_watchdog->routine)( 4000a6c8: c2 07 60 1c ld [ %i5 + 0x1c ], %g1 4000a6cc: d0 07 60 20 ld [ %i5 + 0x20 ], %o0 4000a6d0: 9f c0 40 00 call %g1 4000a6d4: d2 07 60 24 ld [ %i5 + 0x24 ], %o1 case WATCHDOG_REMOVE_IT: break; } _ISR_Disable( level ); 4000a6d8: 7f ff de 74 call 400020a8 4000a6dc: 01 00 00 00 nop 4000a6e0: b0 10 00 08 mov %o0, %i0 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_First( Chain_Control *the_chain ) { return _Chain_Head( the_chain )->next; 4000a6e4: fa 07 00 00 ld [ %i4 ], %i5 the_watchdog = _Watchdog_First( header ); } while ( !_Chain_Is_empty( header ) && (the_watchdog->delta_interval == 0) ); 4000a6e8: 80 a7 40 1b cmp %i5, %i3 4000a6ec: 02 80 00 04 be 4000a6fc <_Watchdog_Tickle+0x98> 4000a6f0: 01 00 00 00 nop } _ISR_Disable( level ); the_watchdog = _Watchdog_First( header ); } while ( !_Chain_Is_empty( header ) && 4000a6f4: 10 bf ff ea b 4000a69c <_Watchdog_Tickle+0x38> 4000a6f8: c2 07 60 10 ld [ %i5 + 0x10 ], %g1 (the_watchdog->delta_interval == 0) ); leave: _ISR_Enable(level); 4000a6fc: 7f ff de 6f call 400020b8 4000a700: 81 e8 00 00 restore =============================================================================== 4000a704 <_Workspace_Handler_initialization>: void _Workspace_Handler_initialization( Heap_Area *areas, size_t area_count, Heap_Initialization_or_extend_handler extend ) { 4000a704: 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(); 4000a708: 05 10 00 6d sethi %hi(0x4001b400), %g2 4000a70c: 82 10 a3 58 or %g2, 0x358, %g1 ! 4001b758 4000a710: c6 08 60 32 ldub [ %g1 + 0x32 ], %g3 4000a714: fa 00 a3 58 ld [ %g2 + 0x358 ], %i5 4000a718: 80 a0 e0 00 cmp %g3, 0 4000a71c: 12 80 00 03 bne 4000a728 <_Workspace_Handler_initialization+0x24> 4000a720: 84 10 20 00 clr %g2 4000a724: 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; 4000a728: 21 10 00 20 sethi %hi(0x40008000), %l0 } else { size = 0; } } space_available = (*init_or_extend)( 4000a72c: 27 10 00 78 sethi %hi(0x4001e000), %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(); 4000a730: 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) { 4000a734: 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; 4000a738: a0 14 21 5c or %l0, 0x15c, %l0 size_t i; for (i = 0; i < area_count; ++i) { Heap_Area *area = &areas [i]; if ( do_zero ) { 4000a73c: e2 08 60 30 ldub [ %g1 + 0x30 ], %l1 if ( area->size > overhead ) { uintptr_t space_available; uintptr_t size; if ( unified ) { 4000a740: 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) { 4000a744: 10 80 00 2c b 4000a7f4 <_Workspace_Handler_initialization+0xf0> 4000a748: a6 14 e2 10 or %l3, 0x210, %l3 Heap_Area *area = &areas [i]; if ( do_zero ) { 4000a74c: 22 80 00 07 be,a 4000a768 <_Workspace_Handler_initialization+0x64> 4000a750: f8 06 20 04 ld [ %i0 + 4 ], %i4 memset( area->begin, 0, area->size ); 4000a754: d0 06 00 00 ld [ %i0 ], %o0 4000a758: d4 06 20 04 ld [ %i0 + 4 ], %o2 4000a75c: 40 00 13 52 call 4000f4a4 4000a760: 92 10 20 00 clr %o1 } if ( area->size > overhead ) { 4000a764: f8 06 20 04 ld [ %i0 + 4 ], %i4 4000a768: 80 a7 20 16 cmp %i4, 0x16 4000a76c: 28 80 00 21 bleu,a 4000a7f0 <_Workspace_Handler_initialization+0xec> 4000a770: b6 06 e0 01 inc %i3 uintptr_t space_available; uintptr_t size; if ( unified ) { 4000a774: 80 a4 a0 00 cmp %l2, 0 4000a778: 32 80 00 0c bne,a 4000a7a8 <_Workspace_Handler_initialization+0xa4> 4000a77c: d2 06 00 00 ld [ %i0 ], %o1 size = area->size; } else { if ( remaining > 0 ) { 4000a780: 80 a7 60 00 cmp %i5, 0 4000a784: 22 80 00 08 be,a 4000a7a4 <_Workspace_Handler_initialization+0xa0><== NEVER TAKEN 4000a788: b8 10 20 00 clr %i4 <== NOT EXECUTED size = remaining < area->size - overhead ? 4000a78c: 82 07 3f ea add %i4, -22, %g1 remaining + overhead : area->size; 4000a790: 80 a7 40 01 cmp %i5, %g1 4000a794: 2a 80 00 04 bcs,a 4000a7a4 <_Workspace_Handler_initialization+0xa0><== ALWAYS TAKEN 4000a798: b8 07 60 16 add %i5, 0x16, %i4 } else { size = 0; } } space_available = (*init_or_extend)( 4000a79c: 10 80 00 03 b 4000a7a8 <_Workspace_Handler_initialization+0xa4><== NOT EXECUTED 4000a7a0: d2 06 00 00 ld [ %i0 ], %o1 <== NOT EXECUTED 4000a7a4: d2 06 00 00 ld [ %i0 ], %o1 4000a7a8: 94 10 00 1c mov %i4, %o2 4000a7ac: 90 10 00 13 mov %l3, %o0 4000a7b0: 9f c4 00 00 call %l0 4000a7b4: 96 10 20 08 mov 8, %o3 area->begin, size, page_size ); area->begin = (char *) area->begin + size; 4000a7b8: c2 06 00 00 ld [ %i0 ], %g1 area->size -= size; if ( space_available < remaining ) { 4000a7bc: 80 a2 00 1d cmp %o0, %i5 area->begin, size, page_size ); area->begin = (char *) area->begin + size; 4000a7c0: 82 00 40 1c add %g1, %i4, %g1 4000a7c4: c2 26 00 00 st %g1, [ %i0 ] area->size -= size; 4000a7c8: c2 06 20 04 ld [ %i0 + 4 ], %g1 4000a7cc: b8 20 40 1c sub %g1, %i4, %i4 if ( space_available < remaining ) { 4000a7d0: 1a 80 00 05 bcc 4000a7e4 <_Workspace_Handler_initialization+0xe0><== ALWAYS TAKEN 4000a7d4: f8 26 20 04 st %i4, [ %i0 + 4 ] remaining -= space_available; 4000a7d8: ba 27 40 08 sub %i5, %o0, %i5 <== NOT EXECUTED } else { remaining = 0; } init_or_extend = extend; 4000a7dc: 10 80 00 04 b 4000a7ec <_Workspace_Handler_initialization+0xe8><== NOT EXECUTED 4000a7e0: a0 10 00 1a mov %i2, %l0 <== NOT EXECUTED 4000a7e4: a0 10 00 1a mov %i2, %l0 area->size -= size; if ( space_available < remaining ) { remaining -= space_available; } else { remaining = 0; 4000a7e8: 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) { 4000a7ec: b6 06 e0 01 inc %i3 4000a7f0: b0 06 20 08 add %i0, 8, %i0 4000a7f4: 80 a6 c0 19 cmp %i3, %i1 4000a7f8: 12 bf ff d5 bne 4000a74c <_Workspace_Handler_initialization+0x48> 4000a7fc: 80 a4 60 00 cmp %l1, 0 init_or_extend = extend; } } if ( remaining > 0 ) { 4000a800: 80 a7 60 00 cmp %i5, 0 4000a804: 02 80 00 05 be 4000a818 <_Workspace_Handler_initialization+0x114> 4000a808: 90 10 20 00 clr %o0 _Internal_error_Occurred( 4000a80c: 92 10 20 01 mov 1, %o1 4000a810: 7f ff f6 e6 call 400083a8 <_Internal_error_Occurred> 4000a814: 94 10 20 02 mov 2, %o2 4000a818: 81 c7 e0 08 ret 4000a81c: 81 e8 00 00 restore =============================================================================== 4001a854 <_calloc_r>: struct _reent *ignored __attribute__((unused)), size_t elements, size_t size ) { return calloc( elements, size ); 4001a854: 90 10 00 09 mov %o1, %o0 <== NOT EXECUTED 4001a858: 92 10 00 0a mov %o2, %o1 <== NOT EXECUTED 4001a85c: 82 13 c0 00 mov %o7, %g1 <== NOT EXECUTED 4001a860: 7f ff a1 28 call 40002d00 <== NOT EXECUTED 4001a864: 9e 10 40 00 mov %g1, %o7 <== NOT EXECUTED =============================================================================== 4001a8dc <_close_r>: int _close_r( struct _reent *ptr __attribute__((unused)), int fd ) { return close( fd ); 4001a8dc: 90 10 00 09 mov %o1, %o0 4001a8e0: 82 13 c0 00 mov %o7, %g1 4001a8e4: 7f ff ff e1 call 4001a868 4001a8e8: 9e 10 40 00 mov %g1, %o7 =============================================================================== 400124d4 <_fat_block_read>: uint32_t start, uint32_t offset, uint32_t count, void *buff ) { 400124d4: 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) 400124d8: 10 80 00 17 b 40012534 <_fat_block_read+0x60> 400124dc: ba 10 20 00 clr %i5 { rc = fat_buf_access(fs_info, sec_num, FAT_OP_TYPE_READ, &sec_buf); 400124e0: 92 10 00 19 mov %i1, %o1 400124e4: 94 10 20 01 mov 1, %o2 400124e8: 7f ff ff cc call 40012418 400124ec: 96 07 bf fc add %fp, -4, %o3 if (rc != RC_OK) 400124f0: 80 a2 20 00 cmp %o0, 0 400124f4: 32 80 00 15 bne,a 40012548 <_fat_block_read+0x74> <== NEVER TAKEN 400124f8: ba 10 3f ff mov -1, %i5 <== NOT EXECUTED return -1; c = MIN(count, (fs_info->vol.bps - ofs)); 400124fc: e0 16 00 00 lduh [ %i0 ], %l0 40012500: a0 24 00 1a sub %l0, %i2, %l0 40012504: 80 a4 00 1b cmp %l0, %i3 40012508: 38 80 00 02 bgu,a 40012510 <_fat_block_read+0x3c> 4001250c: a0 10 00 1b mov %i3, %l0 memcpy((buff + cmpltd), (sec_buf + ofs), c); 40012510: d2 07 bf fc ld [ %fp + -4 ], %o1 40012514: 90 07 00 1d add %i4, %i5, %o0 40012518: 92 02 40 1a add %o1, %i2, %o1 4001251c: 94 10 00 10 mov %l0, %o2 40012520: 40 00 23 90 call 4001b360 40012524: b6 26 c0 10 sub %i3, %l0, %i3 count -= c; cmpltd += c; 40012528: ba 04 00 1d add %l0, %i5, %i5 sec_num++; 4001252c: b2 06 60 01 inc %i1 ofs = 0; 40012530: 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) 40012534: 80 a6 e0 00 cmp %i3, 0 40012538: 12 bf ff ea bne 400124e0 <_fat_block_read+0xc> 4001253c: 90 10 00 18 mov %i0, %o0 cmpltd += c; sec_num++; ofs = 0; } return cmpltd; } 40012540: 81 c7 e0 08 ret 40012544: 91 e8 00 1d restore %g0, %i5, %o0 40012548: b0 10 00 1d mov %i5, %i0 <== NOT EXECUTED 4001254c: 81 c7 e0 08 ret <== NOT EXECUTED 40012550: 81 e8 00 00 restore <== 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 =============================================================================== 40006cfc : #include #include #include int aio_cancel(int fildes, struct aiocb *aiocbp) { 40006cfc: 9d e3 bf a0 save %sp, -96, %sp rtems_aio_request_chain *r_chain; int result; pthread_mutex_lock (&aio_request_queue.mutex); 40006d00: 3b 10 00 60 sethi %hi(0x40018000), %i5 40006d04: 40 00 04 68 call 40007ea4 40006d08: 90 17 62 74 or %i5, 0x274, %o0 ! 40018274 if (fcntl (fildes, F_GETFD) < 0) { 40006d0c: 90 10 00 18 mov %i0, %o0 40006d10: 40 00 1a 1d call 4000d584 40006d14: 92 10 20 01 mov 1, %o1 40006d18: 80 a2 20 00 cmp %o0, 0 40006d1c: 16 80 00 08 bge 40006d3c 40006d20: 80 a6 60 00 cmp %i1, 0 pthread_mutex_unlock(&aio_request_queue.mutex); 40006d24: 40 00 04 81 call 40007f28 40006d28: 90 17 62 74 or %i5, 0x274, %o0 rtems_set_errno_and_return_minus_one (EBADF); 40006d2c: 40 00 27 4d call 40010a60 <__errno> 40006d30: 01 00 00 00 nop 40006d34: 10 80 00 54 b 40006e84 40006d38: 82 10 20 09 mov 9, %g1 ! 9 } /* if aiocbp is NULL remove all request for given file descriptor */ if (aiocbp == NULL) { 40006d3c: 32 80 00 35 bne,a 40006e10 40006d40: f8 06 40 00 ld [ %i1 ], %i4 AIO_printf ("Cancel all requests\n"); r_chain = rtems_aio_search_fd (&aio_request_queue.work_req, fildes, 0); 40006d44: 11 10 00 60 sethi %hi(0x40018000), %o0 40006d48: 92 10 00 18 mov %i0, %o1 40006d4c: 90 12 22 bc or %o0, 0x2bc, %o0 40006d50: 40 00 01 71 call 40007314 40006d54: 94 10 20 00 clr %o2 if (r_chain == NULL) { 40006d58: b8 92 20 00 orcc %o0, 0, %i4 40006d5c: 12 80 00 20 bne 40006ddc 40006d60: b6 07 20 1c add %i4, 0x1c, %i3 */ RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_first( const Chain_Control *the_chain ) { return _Chain_Immutable_head( the_chain )->next; 40006d64: ba 17 62 74 or %i5, 0x274, %i5 AIO_printf ("Request chain not on [WQ]\n"); if (!rtems_chain_is_empty (&aio_request_queue.idle_req)) { 40006d68: c4 07 60 54 ld [ %i5 + 0x54 ], %g2 40006d6c: 82 07 60 58 add %i5, 0x58, %g1 40006d70: 80 a0 80 01 cmp %g2, %g1 40006d74: 02 80 00 08 be 40006d94 <== NEVER TAKEN 40006d78: 92 10 00 18 mov %i0, %o1 r_chain = rtems_aio_search_fd (&aio_request_queue.idle_req, fildes, 0); 40006d7c: 90 07 60 54 add %i5, 0x54, %o0 40006d80: 40 00 01 65 call 40007314 40006d84: 94 10 20 00 clr %o2 if (r_chain == NULL) { 40006d88: b8 92 20 00 orcc %o0, 0, %i4 40006d8c: 12 80 00 08 bne 40006dac 40006d90: 01 00 00 00 nop pthread_mutex_unlock(&aio_request_queue.mutex); 40006d94: 11 10 00 60 sethi %hi(0x40018000), %o0 return AIO_ALLDONE; 40006d98: b0 10 20 02 mov 2, %i0 AIO_printf ("Request chain not on [WQ]\n"); if (!rtems_chain_is_empty (&aio_request_queue.idle_req)) { r_chain = rtems_aio_search_fd (&aio_request_queue.idle_req, fildes, 0); if (r_chain == NULL) { pthread_mutex_unlock(&aio_request_queue.mutex); 40006d9c: 40 00 04 63 call 40007f28 40006da0: 90 12 22 74 or %o0, 0x274, %o0 return AIO_ALLDONE; 40006da4: 81 c7 e0 08 ret 40006da8: 81 e8 00 00 restore */ RTEMS_INLINE_ROUTINE void rtems_chain_extract( rtems_chain_node *the_node ) { _Chain_Extract( the_node ); 40006dac: 40 00 0a cf call 400098e8 <_Chain_Extract> 40006db0: b6 07 20 1c add %i4, 0x1c, %i3 } AIO_printf ("Request chain on [IQ]\n"); rtems_chain_extract (&r_chain->next_fd); rtems_aio_remove_fd (r_chain); 40006db4: 40 00 01 80 call 400073b4 40006db8: 90 10 00 1c mov %i4, %o0 pthread_mutex_destroy (&r_chain->mutex); 40006dbc: 40 00 03 8d call 40007bf0 40006dc0: 90 10 00 1b mov %i3, %o0 pthread_cond_destroy (&r_chain->mutex); 40006dc4: 40 00 02 ae call 4000787c 40006dc8: 90 10 00 1b mov %i3, %o0 free (r_chain); 40006dcc: 7f ff f1 45 call 400032e0 40006dd0: 90 10 00 1c mov %i4, %o0 pthread_mutex_unlock (&aio_request_queue.mutex); 40006dd4: 10 80 00 0b b 40006e00 40006dd8: 90 10 00 1d mov %i5, %o0 return AIO_ALLDONE; } AIO_printf ("Request chain on [WQ]\n"); pthread_mutex_lock (&r_chain->mutex); 40006ddc: 40 00 04 32 call 40007ea4 40006de0: 90 10 00 1b mov %i3, %o0 40006de4: 40 00 0a c1 call 400098e8 <_Chain_Extract> 40006de8: 90 10 00 1c mov %i4, %o0 rtems_chain_extract (&r_chain->next_fd); rtems_aio_remove_fd (r_chain); 40006dec: 40 00 01 72 call 400073b4 40006df0: 90 10 00 1c mov %i4, %o0 pthread_mutex_unlock (&r_chain->mutex); 40006df4: 40 00 04 4d call 40007f28 40006df8: 90 10 00 1b mov %i3, %o0 pthread_mutex_unlock (&aio_request_queue.mutex); 40006dfc: 90 17 62 74 or %i5, 0x274, %o0 40006e00: 40 00 04 4a call 40007f28 40006e04: b0 10 20 00 clr %i0 return AIO_CANCELED; 40006e08: 81 c7 e0 08 ret 40006e0c: 81 e8 00 00 restore } else { AIO_printf ("Cancel request\n"); if (aiocbp->aio_fildes != fildes) { 40006e10: 80 a7 00 18 cmp %i4, %i0 40006e14: 12 80 00 17 bne 40006e70 40006e18: 90 17 62 74 or %i5, 0x274, %o0 pthread_mutex_unlock (&aio_request_queue.mutex); rtems_set_errno_and_return_minus_one (EINVAL); } r_chain = rtems_aio_search_fd (&aio_request_queue.work_req, fildes, 0); 40006e1c: 11 10 00 60 sethi %hi(0x40018000), %o0 40006e20: 92 10 00 1c mov %i4, %o1 40006e24: 90 12 22 bc or %o0, 0x2bc, %o0 40006e28: 40 00 01 3b call 40007314 40006e2c: 94 10 20 00 clr %o2 if (r_chain == NULL) { 40006e30: b6 92 20 00 orcc %o0, 0, %i3 40006e34: 32 80 00 1c bne,a 40006ea4 40006e38: b8 06 e0 1c add %i3, 0x1c, %i4 40006e3c: ba 17 62 74 or %i5, 0x274, %i5 if (!rtems_chain_is_empty (&aio_request_queue.idle_req)) { 40006e40: c4 07 60 54 ld [ %i5 + 0x54 ], %g2 40006e44: 82 07 60 58 add %i5, 0x58, %g1 40006e48: 80 a0 80 01 cmp %g2, %g1 40006e4c: 02 bf ff d2 be 40006d94 <== NEVER TAKEN 40006e50: 92 10 00 1c mov %i4, %o1 r_chain = rtems_aio_search_fd (&aio_request_queue.idle_req, fildes, 0); 40006e54: 90 07 60 54 add %i5, 0x54, %o0 40006e58: 40 00 01 2f call 40007314 40006e5c: 94 10 20 00 clr %o2 if (r_chain == NULL) { 40006e60: 80 a2 20 00 cmp %o0, 0 40006e64: 12 80 00 0b bne 40006e90 40006e68: 90 02 20 08 add %o0, 8, %o0 pthread_mutex_unlock (&aio_request_queue.mutex); 40006e6c: 90 10 00 1d mov %i5, %o0 40006e70: 40 00 04 2e call 40007f28 40006e74: 01 00 00 00 nop rtems_set_errno_and_return_minus_one (EINVAL); 40006e78: 40 00 26 fa call 40010a60 <__errno> 40006e7c: 01 00 00 00 nop 40006e80: 82 10 20 16 mov 0x16, %g1 ! 16 40006e84: c2 22 00 00 st %g1, [ %o0 ] 40006e88: 81 c7 e0 08 ret 40006e8c: 91 e8 3f ff restore %g0, -1, %o0 } AIO_printf ("Request on [IQ]\n"); result = rtems_aio_remove_req (&r_chain->perfd, aiocbp); 40006e90: 40 00 01 5d call 40007404 40006e94: 92 10 00 19 mov %i1, %o1 40006e98: b0 10 00 08 mov %o0, %i0 pthread_mutex_unlock (&aio_request_queue.mutex); 40006e9c: 10 80 00 0b b 40006ec8 40006ea0: 90 10 00 1d mov %i5, %o0 return AIO_ALLDONE; } } AIO_printf ("Request on [WQ]\n"); pthread_mutex_lock (&r_chain->mutex); 40006ea4: 40 00 04 00 call 40007ea4 40006ea8: 90 10 00 1c mov %i4, %o0 result = rtems_aio_remove_req (&r_chain->perfd, aiocbp); 40006eac: 92 10 00 19 mov %i1, %o1 40006eb0: 40 00 01 55 call 40007404 40006eb4: 90 06 e0 08 add %i3, 8, %o0 40006eb8: b0 10 00 08 mov %o0, %i0 pthread_mutex_unlock (&r_chain->mutex); 40006ebc: 40 00 04 1b call 40007f28 40006ec0: 90 10 00 1c mov %i4, %o0 pthread_mutex_unlock (&aio_request_queue.mutex); 40006ec4: 90 17 62 74 or %i5, 0x274, %o0 40006ec8: 40 00 04 18 call 40007f28 40006ecc: 01 00 00 00 nop return result; } return AIO_ALLDONE; } 40006ed0: 81 c7 e0 08 ret 40006ed4: 81 e8 00 00 restore =============================================================================== 40006ee0 : int aio_fsync( int op, struct aiocb *aiocbp ) { 40006ee0: 9d e3 bf a0 save %sp, -96, %sp rtems_aio_request *req; int mode; if (op != O_SYNC) 40006ee4: 03 00 00 08 sethi %hi(0x2000), %g1 40006ee8: 80 a6 00 01 cmp %i0, %g1 40006eec: 12 80 00 10 bne 40006f2c 40006ef0: ba 10 20 16 mov 0x16, %i5 rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp); mode = fcntl (aiocbp->aio_fildes, F_GETFL); 40006ef4: d0 06 40 00 ld [ %i1 ], %o0 40006ef8: 40 00 19 a3 call 4000d584 40006efc: 92 10 20 03 mov 3, %o1 if (!(((mode & O_ACCMODE) == O_WRONLY) || ((mode & O_ACCMODE) == O_RDWR))) 40006f00: 90 0a 20 03 and %o0, 3, %o0 40006f04: 90 02 3f ff add %o0, -1, %o0 40006f08: 80 a2 20 01 cmp %o0, 1 40006f0c: 18 80 00 08 bgu 40006f2c 40006f10: ba 10 20 09 mov 9, %i5 rtems_aio_set_errno_return_minus_one (EBADF, aiocbp); req = malloc (sizeof (rtems_aio_request)); 40006f14: 7f ff f2 13 call 40003760 40006f18: 90 10 20 18 mov 0x18, %o0 if (req == NULL) 40006f1c: b0 92 20 00 orcc %o0, 0, %i0 40006f20: 32 80 00 09 bne,a 40006f44 <== ALWAYS TAKEN 40006f24: f2 26 20 14 st %i1, [ %i0 + 0x14 ] rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp); 40006f28: ba 10 20 0b mov 0xb, %i5 <== NOT EXECUTED 40006f2c: 82 10 3f ff mov -1, %g1 40006f30: fa 26 60 34 st %i5, [ %i1 + 0x34 ] 40006f34: 40 00 26 cb call 40010a60 <__errno> 40006f38: c2 26 60 38 st %g1, [ %i1 + 0x38 ] 40006f3c: 10 80 00 06 b 40006f54 40006f40: fa 22 00 00 st %i5, [ %o0 ] req->aiocbp = aiocbp; req->aiocbp->aio_lio_opcode = LIO_SYNC; 40006f44: 82 10 20 03 mov 3, %g1 40006f48: c2 26 60 30 st %g1, [ %i1 + 0x30 ] return rtems_aio_enqueue (req); 40006f4c: 40 00 01 4e call 40007484 40006f50: 81 e8 00 00 restore } 40006f54: 81 c7 e0 08 ret 40006f58: 91 e8 3f ff restore %g0, -1, %o0 =============================================================================== 4000769c : * 0 - otherwise */ int aio_read (struct aiocb *aiocbp) { 4000769c: 9d e3 bf a0 save %sp, -96, %sp rtems_aio_request *req; int mode; mode = fcntl (aiocbp->aio_fildes, F_GETFL); 400076a0: d0 06 00 00 ld [ %i0 ], %o0 400076a4: 92 10 20 03 mov 3, %o1 400076a8: 40 00 17 b7 call 4000d584 400076ac: ba 10 00 18 mov %i0, %i5 if (!(((mode & O_ACCMODE) == O_RDONLY) || ((mode & O_ACCMODE) == O_RDWR))) 400076b0: 80 8a 20 01 btst 1, %o0 400076b4: 12 80 00 11 bne 400076f8 400076b8: b8 10 20 09 mov 9, %i4 rtems_aio_set_errno_return_minus_one (EBADF, aiocbp); if (aiocbp->aio_reqprio < 0 || aiocbp->aio_reqprio > AIO_PRIO_DELTA_MAX) 400076bc: c2 06 20 18 ld [ %i0 + 0x18 ], %g1 400076c0: 80 a0 60 00 cmp %g1, 0 400076c4: 22 80 00 04 be,a 400076d4 400076c8: c2 06 20 08 ld [ %i0 + 8 ], %g1 rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp); if (aiocbp->aio_offset < 0) rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp); 400076cc: 10 80 00 0b b 400076f8 400076d0: b8 10 20 16 mov 0x16, %i4 rtems_aio_set_errno_return_minus_one (EBADF, aiocbp); if (aiocbp->aio_reqprio < 0 || aiocbp->aio_reqprio > AIO_PRIO_DELTA_MAX) rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp); if (aiocbp->aio_offset < 0) 400076d4: 80 a0 60 00 cmp %g1, 0 400076d8: 06 80 00 08 bl 400076f8 400076dc: b8 10 20 16 mov 0x16, %i4 rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp); req = malloc (sizeof (rtems_aio_request)); 400076e0: 7f ff f0 20 call 40003760 400076e4: 90 10 20 18 mov 0x18, %o0 if (req == NULL) 400076e8: b0 92 20 00 orcc %o0, 0, %i0 400076ec: 32 80 00 09 bne,a 40007710 <== ALWAYS TAKEN 400076f0: fa 26 20 14 st %i5, [ %i0 + 0x14 ] rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp); 400076f4: b8 10 20 0b mov 0xb, %i4 <== NOT EXECUTED 400076f8: 82 10 3f ff mov -1, %g1 400076fc: f8 27 60 34 st %i4, [ %i5 + 0x34 ] 40007700: 40 00 24 d8 call 40010a60 <__errno> 40007704: c2 27 60 38 st %g1, [ %i5 + 0x38 ] 40007708: 10 80 00 06 b 40007720 4000770c: f8 22 00 00 st %i4, [ %o0 ] req->aiocbp = aiocbp; req->aiocbp->aio_lio_opcode = LIO_READ; 40007710: 82 10 20 01 mov 1, %g1 40007714: c2 27 60 30 st %g1, [ %i5 + 0x30 ] return rtems_aio_enqueue (req); 40007718: 7f ff ff 5b call 40007484 4000771c: 81 e8 00 00 restore } 40007720: 81 c7 e0 08 ret 40007724: 91 e8 3f ff restore %g0, -1, %o0 =============================================================================== 40007730 : * 0 - otherwise */ int aio_write (struct aiocb *aiocbp) { 40007730: 9d e3 bf a0 save %sp, -96, %sp rtems_aio_request *req; int mode; mode = fcntl (aiocbp->aio_fildes, F_GETFL); 40007734: d0 06 00 00 ld [ %i0 ], %o0 40007738: 40 00 17 93 call 4000d584 4000773c: 92 10 20 03 mov 3, %o1 * 0 - otherwise */ int aio_write (struct aiocb *aiocbp) { 40007740: ba 10 00 18 mov %i0, %i5 rtems_aio_request *req; int mode; mode = fcntl (aiocbp->aio_fildes, F_GETFL); if (!(((mode & O_ACCMODE) == O_WRONLY) || ((mode & O_ACCMODE) == O_RDWR))) 40007744: 90 0a 20 03 and %o0, 3, %o0 40007748: 90 02 3f ff add %o0, -1, %o0 4000774c: 80 a2 20 01 cmp %o0, 1 40007750: 18 80 00 11 bgu 40007794 40007754: b8 10 20 09 mov 9, %i4 rtems_aio_set_errno_return_minus_one (EBADF, aiocbp); if (aiocbp->aio_reqprio < 0 || aiocbp->aio_reqprio > AIO_PRIO_DELTA_MAX) 40007758: c2 06 20 18 ld [ %i0 + 0x18 ], %g1 4000775c: 80 a0 60 00 cmp %g1, 0 40007760: 22 80 00 04 be,a 40007770 40007764: c2 06 20 08 ld [ %i0 + 8 ], %g1 rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp); if (aiocbp->aio_offset < 0) rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp); 40007768: 10 80 00 0b b 40007794 4000776c: b8 10 20 16 mov 0x16, %i4 rtems_aio_set_errno_return_minus_one (EBADF, aiocbp); if (aiocbp->aio_reqprio < 0 || aiocbp->aio_reqprio > AIO_PRIO_DELTA_MAX) rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp); if (aiocbp->aio_offset < 0) 40007770: 80 a0 60 00 cmp %g1, 0 40007774: 06 80 00 08 bl 40007794 40007778: b8 10 20 16 mov 0x16, %i4 rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp); req = malloc (sizeof (rtems_aio_request)); 4000777c: 7f ff ef f9 call 40003760 40007780: 90 10 20 18 mov 0x18, %o0 if (req == NULL) 40007784: b0 92 20 00 orcc %o0, 0, %i0 40007788: 32 80 00 09 bne,a 400077ac <== ALWAYS TAKEN 4000778c: fa 26 20 14 st %i5, [ %i0 + 0x14 ] rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp); 40007790: b8 10 20 0b mov 0xb, %i4 <== NOT EXECUTED 40007794: 82 10 3f ff mov -1, %g1 40007798: f8 27 60 34 st %i4, [ %i5 + 0x34 ] 4000779c: 40 00 24 b1 call 40010a60 <__errno> 400077a0: c2 27 60 38 st %g1, [ %i5 + 0x38 ] 400077a4: 10 80 00 06 b 400077bc 400077a8: f8 22 00 00 st %i4, [ %o0 ] req->aiocbp = aiocbp; req->aiocbp->aio_lio_opcode = LIO_WRITE; 400077ac: 82 10 20 02 mov 2, %g1 400077b0: c2 27 60 30 st %g1, [ %i5 + 0x30 ] return rtems_aio_enqueue (req); 400077b4: 7f ff ff 34 call 40007484 400077b8: 81 e8 00 00 restore } 400077bc: 81 c7 e0 08 ret 400077c0: 91 e8 3f ff restore %g0, -1, %o0 =============================================================================== 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 51 sethi %hi(0x40014400), %o3 400038d4: 96 12 e3 a4 or %o3, 0x3a4, %o3 ! 400147a4 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 4f sethi %hi(0x40013c00), %i4 400038fc: b8 17 20 54 or %i4, 0x54, %i4 ! 40013c54 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 51 sethi %hi(0x40014400), %i4 4000394c: d0 07 23 9c ld [ %i4 + 0x39c ], %o0 ! 4001479c 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 23 9c ld [ %i4 + 0x39c ], %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 1f 6b call 4000b724 <__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 1f 64 call 4000b724 <__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 =============================================================================== 40006918 : int clock_gettime( clockid_t clock_id, struct timespec *tp ) { 40006918: 9d e3 bf 98 save %sp, -104, %sp if ( !tp ) 4000691c: 80 a6 60 00 cmp %i1, 0 40006920: 02 80 00 26 be 400069b8 40006924: 80 a6 20 01 cmp %i0, 1 rtems_set_errno_and_return_minus_one( EINVAL ); if ( clock_id == CLOCK_REALTIME ) { 40006928: 12 80 00 16 bne 40006980 4000692c: 80 a6 20 04 cmp %i0, 4 ) { Timestamp_Control tod_as_timestamp; Timestamp_Control *tod_as_timestamp_ptr; tod_as_timestamp_ptr = 40006930: 90 07 bf f8 add %fp, -8, %o0 40006934: 13 10 00 65 sethi %hi(0x40019400), %o1 40006938: 40 00 08 1d call 400089ac <_TOD_Get_with_nanoseconds> 4000693c: 92 12 61 c8 or %o1, 0x1c8, %o1 ! 400195c8 <_TOD> #endif rtems_set_errno_and_return_minus_one( EINVAL ); return 0; } 40006940: f8 1a 00 00 ldd [ %o0 ], %i4 static inline void _Timestamp64_implementation_To_timespec( const Timestamp64_Control *_timestamp, struct timespec *_timespec ) { _timespec->tv_sec = (time_t) (*_timestamp / 1000000000L); 40006944: 94 10 20 00 clr %o2 40006948: 90 10 00 1c mov %i4, %o0 4000694c: 92 10 00 1d mov %i5, %o1 40006950: 17 0e e6 b2 sethi %hi(0x3b9ac800), %o3 40006954: 40 00 3c 14 call 400159a4 <__divdi3> 40006958: 96 12 e2 00 or %o3, 0x200, %o3 ! 3b9aca00 _timespec->tv_nsec = (long) (*_timestamp % 1000000000L); 4000695c: 90 10 00 1c mov %i4, %o0 static inline void _Timestamp64_implementation_To_timespec( const Timestamp64_Control *_timestamp, struct timespec *_timespec ) { _timespec->tv_sec = (time_t) (*_timestamp / 1000000000L); 40006960: d2 26 40 00 st %o1, [ %i1 ] _timespec->tv_nsec = (long) (*_timestamp % 1000000000L); 40006964: 94 10 20 00 clr %o2 40006968: 92 10 00 1d mov %i5, %o1 4000696c: 17 0e e6 b2 sethi %hi(0x3b9ac800), %o3 40006970: 40 00 3c f8 call 40015d50 <__moddi3> 40006974: 96 12 e2 00 or %o3, 0x200, %o3 ! 3b9aca00 40006978: 10 80 00 06 b 40006990 4000697c: d2 26 60 04 st %o1, [ %i1 + 4 ] if ( clock_id == CLOCK_REALTIME ) { _TOD_Get(tp); return 0; } #ifdef CLOCK_MONOTONIC if ( clock_id == CLOCK_MONOTONIC ) { 40006980: 12 80 00 06 bne 40006998 <== ALWAYS TAKEN 40006984: 80 a6 20 02 cmp %i0, 2 _TOD_Get_uptime_as_timespec( tp ); 40006988: 40 00 08 1a call 400089f0 <_TOD_Get_uptime_as_timespec> 4000698c: 90 10 00 19 mov %i1, %o0 return 0; 40006990: 81 c7 e0 08 ret 40006994: 91 e8 20 00 restore %g0, 0, %o0 } #endif #ifdef _POSIX_CPUTIME if ( clock_id == CLOCK_PROCESS_CPUTIME_ID ) { 40006998: 02 bf ff fc be 40006988 4000699c: 80 a6 20 03 cmp %i0, 3 return 0; } #endif #ifdef _POSIX_THREAD_CPUTIME if ( clock_id == CLOCK_THREAD_CPUTIME_ID ) 400069a0: 12 80 00 06 bne 400069b8 400069a4: 01 00 00 00 nop rtems_set_errno_and_return_minus_one( ENOSYS ); 400069a8: 40 00 23 6d call 4000f75c <__errno> 400069ac: 01 00 00 00 nop 400069b0: 10 80 00 05 b 400069c4 400069b4: 82 10 20 58 mov 0x58, %g1 ! 58 #endif rtems_set_errno_and_return_minus_one( EINVAL ); 400069b8: 40 00 23 69 call 4000f75c <__errno> 400069bc: 01 00 00 00 nop 400069c0: 82 10 20 16 mov 0x16, %g1 ! 16 400069c4: c2 22 00 00 st %g1, [ %o0 ] return 0; } 400069c8: 81 c7 e0 08 ret 400069cc: 91 e8 3f ff restore %g0, -1, %o0 =============================================================================== 40024e7c : int clock_settime( clockid_t clock_id, const struct timespec *tp ) { 40024e7c: 9d e3 bf 98 save %sp, -104, %sp if ( !tp ) 40024e80: 82 96 60 00 orcc %i1, 0, %g1 40024e84: 02 80 00 4b be 40024fb0 <== NEVER TAKEN 40024e88: 80 a6 20 01 cmp %i0, 1 rtems_set_errno_and_return_minus_one( EINVAL ); if ( clock_id == CLOCK_REALTIME ) { 40024e8c: 12 80 00 41 bne 40024f90 40024e90: 80 a6 20 02 cmp %i0, 2 if ( tp->tv_sec < TOD_SECONDS_1970_THROUGH_1988 ) 40024e94: c6 00 40 00 ld [ %g1 ], %g3 40024e98: 05 08 76 b9 sethi %hi(0x21dae400), %g2 40024e9c: 84 10 a0 ff or %g2, 0xff, %g2 ! 21dae4ff 40024ea0: 80 a0 c0 02 cmp %g3, %g2 40024ea4: 08 80 00 43 bleu 40024fb0 40024ea8: 05 10 01 8c sethi %hi(0x40063000), %g2 * * 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; 40024eac: c6 00 a1 c0 ld [ %g2 + 0x1c0 ], %g3 ! 400631c0 <_Thread_Dispatch_disable_level> ++level; 40024eb0: 86 00 e0 01 inc %g3 _Thread_Dispatch_disable_level = level; 40024eb4: c6 20 a1 c0 st %g3, [ %g2 + 0x1c0 ] const struct timespec *tod_as_timespec ) { Timestamp_Control tod_as_timestamp; _Timestamp_Set( 40024eb8: c6 00 40 00 ld [ %g1 ], %g3 &tod_as_timestamp, tod_as_timespec->tv_sec, tod_as_timespec->tv_nsec ); _TOD_Set_with_timestamp( &tod_as_timestamp ); 40024ebc: 90 07 bf f8 add %fp, -8, %o0 const struct timespec *tod_as_timespec ) { Timestamp_Control tod_as_timestamp; _Timestamp_Set( 40024ec0: 85 38 e0 1f sra %g3, 0x1f, %g2 Timestamp64_Control *_time, Timestamp64_Control _seconds, Timestamp64_Control _nanoseconds ) { *_time = _seconds * 1000000000L + _nanoseconds; 40024ec4: 89 28 a0 03 sll %g2, 3, %g4 40024ec8: bb 28 e0 03 sll %g3, 3, %i5 40024ecc: b7 30 e0 1d srl %g3, 0x1d, %i3 40024ed0: b8 16 c0 04 or %i3, %g4, %i4 40024ed4: 89 37 60 1b srl %i5, 0x1b, %g4 40024ed8: b5 2f 20 05 sll %i4, 5, %i2 40024edc: b7 2f 60 05 sll %i5, 5, %i3 40024ee0: b4 11 00 1a or %g4, %i2, %i2 40024ee4: ba a6 c0 1d subcc %i3, %i5, %i5 40024ee8: 89 37 60 1a srl %i5, 0x1a, %g4 40024eec: b8 66 80 1c subx %i2, %i4, %i4 40024ef0: b7 2f 60 06 sll %i5, 6, %i3 40024ef4: b5 2f 20 06 sll %i4, 6, %i2 40024ef8: b6 a6 c0 1d subcc %i3, %i5, %i3 40024efc: b4 11 00 1a or %g4, %i2, %i2 40024f00: b4 66 80 1c subx %i2, %i4, %i2 40024f04: b2 86 c0 03 addcc %i3, %g3, %i1 40024f08: b0 46 80 02 addx %i2, %g2, %i0 40024f0c: 89 36 60 1e srl %i1, 0x1e, %g4 40024f10: 85 2e 20 02 sll %i0, 2, %g2 40024f14: 84 11 00 02 or %g4, %g2, %g2 40024f18: 87 2e 60 02 sll %i1, 2, %g3 40024f1c: ba 86 40 03 addcc %i1, %g3, %i5 40024f20: b8 46 00 02 addx %i0, %g2, %i4 40024f24: 89 37 60 1e srl %i5, 0x1e, %g4 40024f28: 85 2f 20 02 sll %i4, 2, %g2 40024f2c: 84 11 00 02 or %g4, %g2, %g2 40024f30: 87 2f 60 02 sll %i5, 2, %g3 40024f34: b6 87 40 03 addcc %i5, %g3, %i3 40024f38: b4 47 00 02 addx %i4, %g2, %i2 40024f3c: bb 2e e0 02 sll %i3, 2, %i5 40024f40: 85 36 e0 1e srl %i3, 0x1e, %g2 40024f44: 86 86 c0 1d addcc %i3, %i5, %g3 40024f48: b9 2e a0 02 sll %i2, 2, %i4 40024f4c: b8 10 80 1c or %g2, %i4, %i4 40024f50: 84 46 80 1c addx %i2, %i4, %g2 40024f54: bb 28 a0 09 sll %g2, 9, %i5 40024f58: b9 30 e0 17 srl %g3, 0x17, %i4 40024f5c: 84 17 00 1d or %i4, %i5, %g2 40024f60: fa 00 60 04 ld [ %g1 + 4 ], %i5 40024f64: 89 28 e0 09 sll %g3, 9, %g4 40024f68: b6 81 00 1d addcc %g4, %i5, %i3 40024f6c: b9 3f 60 1f sra %i5, 0x1f, %i4 rtems_set_errno_and_return_minus_one( ENOSYS ); #endif else rtems_set_errno_and_return_minus_one( EINVAL ); return 0; 40024f70: b0 10 20 00 clr %i0 40024f74: b4 40 80 1c addx %g2, %i4, %i2 &tod_as_timestamp, tod_as_timespec->tv_sec, tod_as_timespec->tv_nsec ); _TOD_Set_with_timestamp( &tod_as_timestamp ); 40024f78: 40 00 04 4d call 400260ac <_TOD_Set_with_timestamp> 40024f7c: f4 3f bf f8 std %i2, [ %fp + -8 ] if ( tp->tv_sec < TOD_SECONDS_1970_THROUGH_1988 ) rtems_set_errno_and_return_minus_one( EINVAL ); _Thread_Disable_dispatch(); _TOD_Set( tp ); _Thread_Enable_dispatch(); 40024f80: 7f ff 90 77 call 4000915c <_Thread_Enable_dispatch> 40024f84: 01 00 00 00 nop rtems_set_errno_and_return_minus_one( ENOSYS ); #endif else rtems_set_errno_and_return_minus_one( EINVAL ); return 0; 40024f88: 81 c7 e0 08 ret 40024f8c: 81 e8 00 00 restore _Thread_Disable_dispatch(); _TOD_Set( tp ); _Thread_Enable_dispatch(); } #ifdef _POSIX_CPUTIME else if ( clock_id == CLOCK_PROCESS_CPUTIME_ID ) 40024f90: 02 80 00 04 be 40024fa0 40024f94: 80 a6 20 03 cmp %i0, 3 rtems_set_errno_and_return_minus_one( ENOSYS ); #endif #ifdef _POSIX_THREAD_CPUTIME else if ( clock_id == CLOCK_THREAD_CPUTIME_ID ) 40024f98: 12 80 00 06 bne 40024fb0 40024f9c: 01 00 00 00 nop rtems_set_errno_and_return_minus_one( ENOSYS ); 40024fa0: 40 00 44 a0 call 40036220 <__errno> 40024fa4: 01 00 00 00 nop 40024fa8: 10 80 00 05 b 40024fbc 40024fac: 82 10 20 58 mov 0x58, %g1 ! 58 #endif else rtems_set_errno_and_return_minus_one( EINVAL ); 40024fb0: 40 00 44 9c call 40036220 <__errno> 40024fb4: 01 00 00 00 nop 40024fb8: 82 10 20 16 mov 0x16, %g1 ! 16 40024fbc: c2 22 00 00 st %g1, [ %o0 ] return 0; } 40024fc0: 81 c7 e0 08 ret 40024fc4: 91 e8 3f ff restore %g0, -1, %o0 =============================================================================== 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 67 sethi %hi(0x40019c00), %g1 4000307c: e0 00 62 58 ld [ %g1 + 0x258 ], %l0 ! 40019e58 40003080: 80 a6 00 10 cmp %i0, %l0 40003084: 0a 80 00 16 bcs 400030dc 40003088: 03 10 00 67 sethi %hi(0x40019c00), %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 5c ld [ %g1 + 0x25c ], %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 41 bd call 400137b4 <== NOT EXECUTED 400030c4: 95 2a a0 03 sll %o2, 3, %o2 <== NOT EXECUTED disktab = table; 400030c8: 03 10 00 67 sethi %hi(0x40019c00), %g1 <== NOT EXECUTED 400030cc: e2 20 62 5c st %l1, [ %g1 + 0x25c ] ! 40019e5c <== NOT EXECUTED disktab_size = new_size; 400030d0: 03 10 00 67 sethi %hi(0x40019c00), %g1 <== NOT EXECUTED 400030d4: fa 20 62 58 st %i5, [ %g1 + 0x258 ] ! 40019e58 <== NOT EXECUTED } if (disktab [major].minor == NULL || minor >= disktab[major].size) { 400030d8: 03 10 00 67 sethi %hi(0x40019c00), %g1 <== NOT EXECUTED 400030dc: e4 00 62 5c ld [ %g1 + 0x25c ], %l2 ! 40019e5c 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 41 9d call 400137b4 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 42 61 call 40013b1c 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 41 b2 call 400149e0 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 41 ab call 400149e0 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 90 sethi %hi(0x40024000), %o0 4000435c: 92 0e e0 ff and %i3, 0xff, %o1 40004360: 90 12 23 98 or %o0, 0x398, %o0 40004364: 40 00 41 31 call 40014828 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 4a sethi %hi(0x40012800), %g1 40002410: c2 00 61 48 ld [ %g1 + 0x148 ], %g1 ! 40012948 if (rootloc->mt_entry->ops == &devFS_ops) { 40002414: 05 10 00 47 sethi %hi(0x40011c00), %g2 40002418: c2 00 60 04 ld [ %g1 + 4 ], %g1 4000241c: 84 10 a1 7c or %g2, 0x17c, %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 47 sethi %hi(0x40011c00), %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 47 sethi %hi(0x40011c00), %i0 } printk( 4000243c: 21 10 00 47 sethi %hi(0x40011c00), %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 61 d0 or %i1, 0x1d0, %i1 for (j = 0; j < m; ++j) { printk("%c", current->name [j]); 40002450: b0 16 21 d8 or %i0, 0x1d8, %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 21 e0 or %l0, 0x1e0, %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 =============================================================================== 4000bdcc : } void devFS_eval_path( rtems_filesystem_eval_path_context_t *ctx ) { 4000bdcc: 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; 4000bdd0: 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; 4000bdd4: f2 06 00 00 ld [ %i0 ], %i1 4000bdd8: 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; 4000bddc: 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; 4000bde0: e2 00 60 04 ld [ %g1 + 4 ], %l1 4000bde4: fa 00 40 00 ld [ %g1 ], %i5 devFS_node *nodes = data->nodes; devFS_node *node = NULL; 4000bde8: b8 10 20 00 clr %i4 devFS_node *free_node = NULL; 4000bdec: 82 10 20 00 clr %g1 for (i = 0; (free_node == NULL || node == NULL) && i < n; ++i) { 4000bdf0: 10 80 00 12 b 4000be38 4000bdf4: b4 10 20 00 clr %i2 devFS_node *current = nodes + i; if (current->name != NULL) { 4000bdf8: 80 a2 20 00 cmp %o0, 0 4000bdfc: 02 80 00 0c be 4000be2c 4000be00: a0 10 00 1d mov %i5, %l0 if ( 4000be04: c4 07 60 04 ld [ %i5 + 4 ], %g2 4000be08: 80 a0 80 1b cmp %g2, %i3 4000be0c: 12 80 00 08 bne 4000be2c 4000be10: a0 10 00 01 mov %g1, %l0 current->namelen == pathlen && memcmp(current->name, path, pathlen) == 0 4000be14: 92 10 00 19 mov %i1, %o1 4000be18: 40 00 0c c0 call 4000f118 4000be1c: 94 10 00 1b mov %i3, %o2 4000be20: 80 a2 20 00 cmp %o0, 0 4000be24: 22 80 00 02 be,a 4000be2c 4000be28: 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) { 4000be2c: b4 06 a0 01 inc %i2 4000be30: ba 07 60 14 add %i5, 0x14, %i5 4000be34: 82 10 00 10 mov %l0, %g1 4000be38: 80 a7 20 00 cmp %i4, 0 4000be3c: 02 80 00 0a be 4000be64 4000be40: 80 a6 80 11 cmp %i2, %l1 4000be44: 80 a0 60 00 cmp %g1, 0 4000be48: 02 80 00 07 be 4000be64 <== NEVER TAKEN 4000be4c: 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) { 4000be50: 80 a7 20 00 cmp %i4, 0 4000be54: 12 80 00 08 bne 4000be74 4000be58: 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) { 4000be5c: 10 80 00 0b b 4000be88 4000be60: 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) { 4000be64: 32 bf ff e5 bne,a 4000bdf8 4000be68: 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) { 4000be6c: 10 bf ff fa b 4000be54 4000be70: 80 a7 20 00 cmp %i4, 0 if ((eval_flags & RTEMS_FS_EXCLUSIVE) == 0) { 4000be74: 80 88 a0 40 btst 0x40, %g2 4000be78: 12 80 00 12 bne 4000bec0 4000be7c: b2 10 20 11 mov 0x11, %i1 currentloc->node_access = node; 4000be80: 10 80 00 0a b 4000bea8 4000be84: 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) { 4000be88: 02 80 00 0d be 4000bebc <== NEVER TAKEN 4000be8c: 80 a0 60 00 cmp %g1, 0 if (free_node != NULL) { 4000be90: 02 80 00 09 be 4000beb4 4000be94: 84 10 21 ff mov 0x1ff, %g2 free_node->mode = S_IRWXU | S_IRWXG | S_IRWXO; 4000be98: c4 20 60 10 st %g2, [ %g1 + 0x10 ] currentloc->node_access = free_node; 4000be9c: c2 26 20 20 st %g1, [ %i0 + 0x20 ] rtems_filesystem_eval_path_context_t *ctx, const char *token, size_t tokenlen ) { ctx->token = token; 4000bea0: f2 26 20 08 st %i1, [ %i0 + 8 ] ctx->tokenlen = tokenlen; 4000bea4: 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; 4000bea8: c0 26 20 04 clr [ %i0 + 4 ] 4000beac: 81 c7 e0 08 ret 4000beb0: 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); 4000beb4: 10 80 00 03 b 4000bec0 4000beb8: b2 10 20 1c mov 0x1c, %i1 } } else { rtems_filesystem_eval_path_error(ctx, ENOENT); 4000bebc: b2 10 20 02 mov 2, %i1 <== NOT EXECUTED 4000bec0: 7f ff e4 7f call 400050bc 4000bec4: 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 2c a7 call 4000f1c0 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 28 9e call 4000e1ac <__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 28 95 call 4000e1ac <__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 67 sethi %hi(0x40019c00), %g1 4000300c: d0 00 62 54 ld [ %g1 + 0x254 ], %o0 ! 40019e54 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 67 sethi %hi(0x40019c00), %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 50 stb %g2, [ %g1 + 0x250 ] 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 67 sethi %hi(0x40019c00), %g1 40003048: c0 28 62 50 clrb [ %g1 + 0x250 ] ! 40019e50 sc = rtems_semaphore_release(diskdevs_mutex); 4000304c: 03 10 00 67 sethi %hi(0x40019c00), %g1 40003050: 40 00 14 cc call 40008380 40003054: d0 00 62 54 ld [ %g1 + 0x254 ], %o0 ! 40019e54 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 31 call 40008928 <== 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 28 call 400076e4 <== 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 <== NOT EXECUTED 400034c0: 40 00 36 40 call 40010dc0 <== NOT EXECUTED 400034c4: 40 00 36 4c call 40010df4 <== NOT EXECUTED 400034c8: 40 00 36 64 call 40010e58 <== NOT EXECUTED 400034cc: 40 00 36 74 call 40010e9c <== NOT EXECUTED 400034d0: 40 00 36 98 call 40010f30 <_strdup_r+0x24> <== NOT EXECUTED 400034d4: 40 00 36 98 call 40010f34 <_strdup_r+0x28> <== NOT EXECUTED 400034d8: 40 00 36 98 call 40010f38 <_strdup_r+0x2c> <== NOT EXECUTED 400034dc: 40 00 36 98 call 40010f3c <_strdup_r+0x30> <== NOT EXECUTED 400034e0: 40 00 36 98 call 40010f40 <_strdup_r+0x34> <== 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 76 sethi %hi(0x4001d800), %g1 iscntrl(c) && (c != '\t') && (c != '\n')) { 4000580c: c2 00 60 a0 ld [ %g1 + 0xa0 ], %g1 ! 4001d8a0 <__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 =============================================================================== 40023d80 : } void endgrent(void) { if (group_fp != NULL) 40023d80: 03 10 01 8b sethi %hi(0x40062c00), %g1 40023d84: d0 00 60 00 ld [ %g1 ], %o0 40023d88: 80 a2 20 00 cmp %o0, 0 40023d8c: 02 80 00 05 be 40023da0 <== NEVER TAKEN 40023d90: 01 00 00 00 nop fclose(group_fp); 40023d94: 82 13 c0 00 mov %o7, %g1 40023d98: 40 00 49 74 call 40036368 40023d9c: 9e 10 40 00 mov %g1, %o7 40023da0: 81 c3 e0 08 retl <== NOT EXECUTED =============================================================================== 40023bdc : } void endpwent(void) { if (passwd_fp != NULL) 40023bdc: 03 10 01 8a sethi %hi(0x40062800), %g1 40023be0: d0 00 63 20 ld [ %g1 + 0x320 ], %o0 ! 40062b20 40023be4: 80 a2 20 00 cmp %o0, 0 40023be8: 02 80 00 05 be 40023bfc <== NEVER TAKEN 40023bec: 01 00 00 00 nop fclose(passwd_fp); 40023bf0: 82 13 c0 00 mov %o7, %g1 40023bf4: 40 00 49 dd call 40036368 40023bf8: 9e 10 40 00 mov %g1, %o7 40023bfc: 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 70 sethi %hi(0x4001c000), %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 76 sethi %hi(0x4001d800), %i3 /* * Back up over the tab */ while (tty->column > col) { rtems_termios_puts ("\b", 1, tty); 4000588c: 31 10 00 70 sethi %hi(0x4001c000), %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 a2 a0 or %i2, 0x2a0, %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 22 98 or %i0, 0x298, %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 e0 a0 ld [ %i3 + 0xa0 ], %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 e0 a0 ld [ %i3 + 0xa0 ], %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 e0 a0 ld [ %i3 + 0xa0 ], %g1 40005990: 80 88 62 00 btst 0x200, %g1 <== NOT EXECUTED 40005994: 02 80 00 0d be 400059c8 <== NOT EXECUTED 40005998: c2 06 e0 a0 ld [ %i3 + 0xa0 ], %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 e0 a0 ld [ %i3 + 0xa0 ], %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 e0 a0 ld [ %i3 + 0xa0 ], %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 2d 1c call 4000f4a4 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 2a 69 call 4000ea6c <__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 d8 call 4000b454 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 =============================================================================== 40012418 : int fat_buf_access(fat_fs_info_t *fs_info, const uint32_t sec_num, const int op_type, uint8_t **sec_buf) { 40012418: 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); 4001241c: c2 0e 20 02 ldub [ %i0 + 2 ], %g1 40012420: c4 0e 20 0c ldub [ %i0 + 0xc ], %g2 40012424: 84 20 80 01 sub %g2, %g1, %g2 40012428: 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); 4001242c: 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 - 40012430: 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); 40012434: 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) 40012438: c2 0e 20 89 ldub [ %i0 + 0x89 ], %g1 4001243c: 80 a0 60 00 cmp %g1, 0 40012440: 02 80 00 06 be 40012458 40012444: 01 00 00 00 nop 40012448: c2 06 20 84 ld [ %i0 + 0x84 ], %g1 4001244c: 80 a0 40 19 cmp %g1, %i1 40012450: 22 80 00 1c be,a 400124c0 40012454: c2 06 20 8c ld [ %i0 + 0x8c ], %g1 { fat_buf_release(fs_info); 40012458: 7f ff ff 7c call 40012248 4001245c: 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); 40012460: 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) 40012464: 80 a6 a0 01 cmp %i2, 1 40012468: d0 06 20 64 ld [ %i0 + 0x64 ], %o0 4001246c: 12 80 00 06 bne 40012484 40012470: 94 06 20 8c add %i0, 0x8c, %o2 sc = rtems_bdbuf_read(fs_info->vol.dd, blk, &fs_info->c.buf); 40012474: 7f ff f7 ae call 4001032c 40012478: 01 00 00 00 nop else sc = rtems_bdbuf_get(fs_info->vol.dd, blk, &fs_info->c.buf); if (sc != RTEMS_SUCCESSFUL) 4001247c: 10 80 00 05 b 40012490 40012480: 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); 40012484: 7f ff f7 79 call 40010268 40012488: 01 00 00 00 nop if (sc != RTEMS_SUCCESSFUL) 4001248c: 80 a2 20 00 cmp %o0, 0 40012490: 02 80 00 08 be 400124b0 <== ALWAYS TAKEN 40012494: 82 10 20 01 mov 1, %g1 rtems_set_errno_and_return_minus_one(EIO); 40012498: 40 00 21 0d call 4001a8cc <__errno> <== NOT EXECUTED 4001249c: b0 10 3f ff mov -1, %i0 <== NOT EXECUTED 400124a0: 82 10 20 05 mov 5, %g1 <== NOT EXECUTED 400124a4: c2 22 00 00 st %g1, [ %o0 ] <== NOT EXECUTED 400124a8: 81 c7 e0 08 ret <== NOT EXECUTED 400124ac: 81 e8 00 00 restore <== NOT EXECUTED fs_info->c.blk_num = sec_num; 400124b0: f2 26 20 84 st %i1, [ %i0 + 0x84 ] fs_info->c.modified = 0; 400124b4: c0 2e 20 88 clrb [ %i0 + 0x88 ] fs_info->c.state = FAT_CACHE_ACTUAL; 400124b8: c2 2e 20 89 stb %g1, [ %i0 + 0x89 ] } *sec_buf = &fs_info->c.buf->buffer[blk_ofs]; 400124bc: c2 06 20 8c ld [ %i0 + 0x8c ], %g1 400124c0: c2 00 60 1c ld [ %g1 + 0x1c ], %g1 400124c4: b8 00 40 1c add %g1, %i4, %i4 400124c8: f8 26 c0 00 st %i4, [ %i3 ] return RC_OK; } 400124cc: 81 c7 e0 08 ret 400124d0: 91 e8 20 00 restore %g0, 0, %o0 =============================================================================== 40012248 : return RC_OK; } int fat_buf_release(fat_fs_info_t *fs_info) { 40012248: 9d e3 bf 98 save %sp, -104, %sp rtems_status_code sc = RTEMS_SUCCESSFUL; if (fs_info->c.state == FAT_CACHE_EMPTY) 4001224c: c2 0e 20 89 ldub [ %i0 + 0x89 ], %g1 return RC_OK; } int fat_buf_release(fat_fs_info_t *fs_info) { 40012250: ba 10 00 18 mov %i0, %i5 rtems_status_code sc = RTEMS_SUCCESSFUL; if (fs_info->c.state == FAT_CACHE_EMPTY) 40012254: 80 a0 60 00 cmp %g1, 0 40012258: 02 80 00 6e be 40012410 4001225c: b0 10 20 00 clr %i0 return RC_OK; if (fs_info->c.modified) 40012260: c2 0f 60 88 ldub [ %i5 + 0x88 ], %g1 40012264: 80 a0 60 00 cmp %g1, 0 40012268: 02 80 00 5d be 400123dc 4001226c: 01 00 00 00 nop { uint32_t sec_num = fs_info->c.blk_num; 40012270: c2 07 60 84 ld [ %i5 + 0x84 ], %g1 bool sec_of_fat = ((sec_num >= fs_info->vol.fat_loc) && 40012274: c4 17 60 18 lduh [ %i5 + 0x18 ], %g2 40012278: 80 a0 40 02 cmp %g1, %g2 4001227c: 0a 80 00 05 bcs 40012290 40012280: b8 10 20 00 clr %i4 40012284: c4 07 60 20 ld [ %i5 + 0x20 ], %g2 40012288: 80 a0 40 02 cmp %g1, %g2 4001228c: b8 40 20 00 addx %g0, 0, %i4 uint32_t ino ) { return (ino >= fs_info->uino_base); } 40012290: 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) 40012294: 80 8f 20 ff btst 0xff, %i4 40012298: 02 80 00 12 be 400122e0 4001229c: c6 0f 60 0c ldub [ %i5 + 0xc ], %g3 400122a0: c8 0f 60 54 ldub [ %i5 + 0x54 ], %g4 400122a4: 80 a1 20 00 cmp %g4, 0 400122a8: 12 80 00 0e bne 400122e0 <== NEVER TAKEN 400122ac: 84 08 a0 ff and %g2, 0xff, %g2 memcpy(fs_info->sec_buf, fs_info->c.buf->buffer + blk_ofs, 400122b0: 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, 400122b4: d0 07 60 90 ld [ %i5 + 0x90 ], %o0 400122b8: d2 01 20 1c ld [ %g4 + 0x1c ], %o1 400122bc: d4 17 40 00 lduh [ %i5 ], %o2 400122c0: 86 08 e0 ff and %g3, 0xff, %g3 400122c4: 86 20 c0 02 sub %g3, %g2, %g3 400122c8: 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); 400122cc: 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 - 400122d0: 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); 400122d4: 85 28 40 02 sll %g1, %g2, %g2 400122d8: 40 00 24 22 call 4001b360 400122dc: 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); 400122e0: 7f ff f8 c4 call 400105f0 400122e4: d0 07 60 8c ld [ %i5 + 0x8c ], %o0 if (sc != RTEMS_SUCCESSFUL) 400122e8: 80 a2 20 00 cmp %o0, 0 400122ec: 12 80 00 41 bne 400123f0 <== NEVER TAKEN 400122f0: 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) 400122f4: 02 80 00 45 be 40012408 400122f8: c0 2f 60 88 clrb [ %i5 + 0x88 ] 400122fc: c2 0f 60 54 ldub [ %i5 + 0x54 ], %g1 40012300: 80 a0 60 00 cmp %g1, 0 40012304: 22 80 00 2f be,a 400123c0 <== ALWAYS TAKEN 40012308: 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; 4001230c: 10 80 00 40 b 4001240c <== NOT EXECUTED 40012310: 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, 40012314: 7f ff c0 cf call 40002650 <.umul> 40012318: d2 07 60 1c ld [ %i5 + 0x1c ], %o1 4001231c: 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); 40012320: c2 0f 60 02 ldub [ %i5 + 2 ], %g1 40012324: 90 02 00 1b add %o0, %i3, %o0 40012328: f6 0f 60 0c ldub [ %i5 + 0xc ], %i3 4001232c: b6 26 c0 01 sub %i3, %g1, %i3 40012330: 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); 40012334: 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 - 40012338: 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); 4001233c: 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 40012340: 80 a6 e0 00 cmp %i3, 0 40012344: 12 80 00 0b bne 40012370 40012348: d0 07 60 64 ld [ %i5 + 0x64 ], %o0 && fs_info->vol.bps == fs_info->vol.bytes_per_block) 4001234c: c4 17 40 00 lduh [ %i5 ], %g2 40012350: c2 17 60 0a lduh [ %i5 + 0xa ], %g1 40012354: 80 a0 80 01 cmp %g2, %g1 40012358: 12 80 00 06 bne 40012370 4001235c: 01 00 00 00 nop { sc = rtems_bdbuf_get(fs_info->vol.dd, blk, &bd); 40012360: 7f ff f7 c2 call 40010268 40012364: 94 07 bf fc add %fp, -4, %o2 } else { sc = rtems_bdbuf_read(fs_info->vol.dd, blk, &bd); } if ( sc != RTEMS_SUCCESSFUL) 40012368: 10 80 00 05 b 4001237c 4001236c: 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); 40012370: 7f ff f7 ef call 4001032c 40012374: 94 07 bf fc add %fp, -4, %o2 } if ( sc != RTEMS_SUCCESSFUL) 40012378: 80 a2 20 00 cmp %o0, 0 4001237c: 22 80 00 03 be,a 40012388 <== ALWAYS TAKEN 40012380: c2 07 bf fc ld [ %fp + -4 ], %g1 40012384: 30 80 00 0b b,a 400123b0 <== NOT EXECUTED rtems_set_errno_and_return_minus_one(ENOMEM); memcpy(bd->buffer + blk_ofs, fs_info->sec_buf, fs_info->vol.bps); 40012388: d2 07 60 90 ld [ %i5 + 0x90 ], %o1 4001238c: d0 00 60 1c ld [ %g1 + 0x1c ], %o0 40012390: d4 17 40 00 lduh [ %i5 ], %o2 40012394: 40 00 23 f3 call 4001b360 40012398: 90 02 00 1b add %o0, %i3, %o0 sc = rtems_bdbuf_release_modified(bd); 4001239c: 7f ff f8 95 call 400105f0 400123a0: d0 07 bf fc ld [ %fp + -4 ], %o0 if ( sc != RTEMS_SUCCESSFUL) 400123a4: 80 a2 20 00 cmp %o0, 0 400123a8: 22 80 00 06 be,a 400123c0 <== ALWAYS TAKEN 400123ac: b8 07 20 01 inc %i4 rtems_set_errno_and_return_minus_one(ENOMEM); 400123b0: 40 00 21 47 call 4001a8cc <__errno> <== NOT EXECUTED 400123b4: 01 00 00 00 nop <== NOT EXECUTED 400123b8: 10 80 00 11 b 400123fc <== NOT EXECUTED 400123bc: 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++) 400123c0: c2 0f 60 0d ldub [ %i5 + 0xd ], %g1 400123c4: 90 0f 20 ff and %i4, 0xff, %o0 400123c8: 80 a2 00 01 cmp %o0, %g1 400123cc: 0a bf ff d2 bcs 40012314 400123d0: 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; 400123d4: 10 80 00 0e b 4001240c 400123d8: c0 2f 60 89 clrb [ %i5 + 0x89 ] } } } else { sc = rtems_bdbuf_release(fs_info->c.buf); 400123dc: 7f ff f8 50 call 4001051c 400123e0: d0 07 60 8c ld [ %i5 + 0x8c ], %o0 if (sc != RTEMS_SUCCESSFUL) 400123e4: 80 a2 20 00 cmp %o0, 0 400123e8: 22 80 00 09 be,a 4001240c <== ALWAYS TAKEN 400123ec: c0 2f 60 89 clrb [ %i5 + 0x89 ] rtems_set_errno_and_return_minus_one(EIO); 400123f0: 40 00 21 37 call 4001a8cc <__errno> <== NOT EXECUTED 400123f4: 01 00 00 00 nop <== NOT EXECUTED 400123f8: 82 10 20 05 mov 5, %g1 ! 5 <== NOT EXECUTED 400123fc: c2 22 00 00 st %g1, [ %o0 ] <== NOT EXECUTED 40012400: 81 c7 e0 08 ret <== NOT EXECUTED 40012404: 91 e8 3f ff restore %g0, -1, %o0 <== NOT EXECUTED } fs_info->c.state = FAT_CACHE_EMPTY; 40012408: c0 2f 60 89 clrb [ %i5 + 0x89 ] return RC_OK; 4001240c: b0 10 20 00 clr %i0 } 40012410: 81 c7 e0 08 ret 40012414: 81 e8 00 00 restore =============================================================================== 400121ec : 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)) ) 400121ec: 80 a2 60 00 cmp %o1, 0 400121f0: 32 80 00 0c bne,a 40012220 400121f4: c2 0a 20 0c ldub [ %o0 + 0xc ], %g1 400121f8: c2 0a 20 0e ldub [ %o0 + 0xe ], %g1 400121fc: 80 88 60 03 btst 3, %g1 40012200: 22 80 00 08 be,a 40012220 <== NEVER TAKEN 40012204: 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); 40012208: c4 0a 20 0c ldub [ %o0 + 0xc ], %g2 4001220c: c2 0a 20 02 ldub [ %o0 + 2 ], %g1 40012210: d0 02 20 20 ld [ %o0 + 0x20 ], %o0 40012214: 82 20 80 01 sub %g2, %g1, %g1 40012218: 81 c3 e0 08 retl 4001221c: 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); 40012220: 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; 40012224: 92 02 7f fe add %o1, -2, %o1 blk = cln << (fs_info->vol.bpc_log2 - fs_info->vol.bytes_per_block_log2); 40012228: 84 20 80 01 sub %g2, %g1, %g2 4001222c: 93 2a 40 02 sll %o1, %g2, %o1 40012230: c4 0a 20 02 ldub [ %o0 + 2 ], %g2 40012234: d0 02 20 34 ld [ %o0 + 0x34 ], %o0 40012238: 82 20 40 02 sub %g1, %g2, %g1 4001223c: 91 32 00 01 srl %o0, %g1, %o0 blk += fat_sector_num_to_block_num(fs_info, fs_info->vol.data_fsec); } return blk; } 40012240: 81 c3 e0 08 retl 40012244: 90 02 00 09 add %o0, %o1, %o0 =============================================================================== 40011548 : 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)) ) 40011548: 80 a2 60 00 cmp %o1, 0 4001154c: 32 80 00 08 bne,a 4001156c 40011550: c2 0a 20 05 ldub [ %o0 + 5 ], %g1 40011554: c2 0a 20 0e ldub [ %o0 + 0xe ], %g1 40011558: 80 88 60 03 btst 3, %g1 4001155c: 22 80 00 04 be,a 4001156c <== NEVER TAKEN 40011560: c2 0a 20 05 ldub [ %o0 + 5 ], %g1 <== NOT EXECUTED return fs_info->vol.rdir_loc; 40011564: 81 c3 e0 08 retl 40011568: d0 02 20 20 ld [ %o0 + 0x20 ], %o0 return (((cln - FAT_RSRVD_CLN) << fs_info->vol.spc_log2) + 4001156c: 92 02 7f fe add %o1, -2, %o1 40011570: 93 2a 40 01 sll %o1, %g1, %o1 40011574: c2 02 20 34 ld [ %o0 + 0x34 ], %g1 fs_info->vol.data_fsec); } 40011578: 81 c3 e0 08 retl 4001157c: 90 02 40 01 add %o1, %g1, %o0 =============================================================================== 400125ec : fat_fs_info_t *fs_info, const uint32_t start_cln, const uint32_t offset, const uint32_t count, const uint8_t pattern) { 400125ec: 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)); 400125f0: c2 16 20 06 lduh [ %i0 + 6 ], %g1 400125f4: 82 20 40 1a sub %g1, %i2, %g1 400125f8: 80 a6 c0 01 cmp %i3, %g1 400125fc: 38 80 00 02 bgu,a 40012604 <== NEVER TAKEN 40012600: b6 10 00 01 mov %g1, %i3 <== NOT EXECUTED uint32_t cur_blk = fat_cluster_num_to_block_num(fs_info, start_cln); 40012604: 90 10 00 18 mov %i0, %o0 40012608: 7f ff fe f9 call 400121ec 4001260c: 92 10 00 19 mov %i1, %o1 uint32_t blocks_in_offset = offset >> fs_info->vol.bytes_per_block_log2; 40012610: 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; 40012614: 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; 40012618: a3 36 80 01 srl %i2, %g1, %l1 uint32_t ofs_blk = offset - (blocks_in_offset << fs_info->vol.bytes_per_block_log2); 4001261c: 83 2c 40 01 sll %l1, %g1, %g1 40012620: a4 10 20 01 mov 1, %l2 40012624: b4 26 80 01 sub %i2, %g1, %i2 ssize_t bytes_written = 0; ssize_t ret; cur_blk += blocks_in_offset; 40012628: a2 02 00 11 add %o0, %l1, %l1 while ( (RC_OK == rc) 4001262c: 10 80 00 2a b 400126d4 40012630: 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)); 40012634: 82 20 80 1a sub %g2, %i2, %g1 40012638: 80 a0 40 1b cmp %g1, %i3 4001263c: 08 80 00 03 bleu 40012648 <== ALWAYS TAKEN 40012640: ba 10 00 01 mov %g1, %i5 40012644: 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)); 40012648: 80 a7 40 01 cmp %i5, %g1 4001264c: 08 80 00 03 bleu 40012658 <== ALWAYS TAKEN 40012650: b2 10 00 1d mov %i5, %i1 40012654: b2 10 00 01 mov %g1, %i1 <== NOT EXECUTED uint32_t ino ) { return (ino >= fs_info->uino_base); } 40012658: 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) 4001265c: 80 a6 60 00 cmp %i1, 0 40012660: 02 80 00 27 be 400126fc <== NEVER TAKEN 40012664: 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); 40012668: 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); 4001266c: 90 10 00 18 mov %i0, %o0 40012670: 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) 40012674: 80 a6 40 02 cmp %i1, %g2 40012678: 02 80 00 03 be 40012684 4001267c: 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); 40012680: 94 10 20 01 mov 1, %o2 40012684: 7f ff ff 65 call 40012418 40012688: 96 07 bf fc add %fp, -4, %o3 if (RC_OK == rc) 4001268c: 80 a2 20 00 cmp %o0, 0 40012690: 12 80 00 0a bne 400126b8 <== NEVER TAKEN 40012694: 80 a7 40 08 cmp %i5, %o0 { memset(blk_buf + offset, pattern, bytes_to_write); 40012698: d0 07 bf fc ld [ %fp + -4 ], %o0 4001269c: 92 10 00 1c mov %i4, %o1 400126a0: 90 02 00 1a add %o0, %i2, %o0 400126a4: 40 00 23 6c call 4001b454 400126a8: 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; 400126ac: 10 80 00 14 b 400126fc 400126b0: e4 2e 20 88 stb %l2, [ %i0 + 0x88 ] fs_info, cur_blk, ofs_blk, c, pattern); if (c != ret) 400126b4: 80 a7 40 08 cmp %i5, %o0 400126b8: 12 80 00 06 bne 400126d0 <== NEVER TAKEN 400126bc: 82 10 3f ff mov -1, %g1 rc = -1; else { bytes_to_write -= ret; 400126c0: b6 26 c0 1d sub %i3, %i5, %i3 bytes_written += ret; 400126c4: a0 04 00 1d add %l0, %i5, %l0 ++cur_blk; 400126c8: a2 04 60 01 inc %l1 400126cc: 82 10 20 00 clr %g1 400126d0: b4 10 20 00 clr %i2 ssize_t bytes_written = 0; ssize_t ret; cur_blk += blocks_in_offset; while ( (RC_OK == rc) 400126d4: 80 a6 e0 00 cmp %i3, 0 400126d8: 02 80 00 04 be 400126e8 400126dc: 80 a0 60 00 cmp %g1, 0 400126e0: 22 bf ff d5 be,a 40012634 <== ALWAYS TAKEN 400126e4: c4 16 20 0a lduh [ %i0 + 0xa ], %g2 bytes_written += ret; ++cur_blk; } ofs_blk = 0; } if (RC_OK != rc) 400126e8: 80 a0 60 00 cmp %g1, 0 400126ec: 12 80 00 06 bne 40012704 <== NEVER TAKEN 400126f0: b0 10 3f ff mov -1, %i0 400126f4: 81 c7 e0 08 ret 400126f8: 91 e8 00 10 restore %g0, %l0, %o0 } } if (RC_OK != rc) return rc; else return bytes_to_write; 400126fc: 10 bf ff ee b 400126b4 40012700: 90 10 00 19 mov %i1, %o0 } if (RC_OK != rc) return rc; else return bytes_written; } 40012704: 81 c7 e0 08 ret <== NOT EXECUTED 40012708: 81 e8 00 00 restore <== NOT EXECUTED =============================================================================== 4001270c : const uint32_t start_cln, const uint32_t offset, const uint32_t count, const void *buff, const bool overwrite_cluster) { 4001270c: 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)); 40012710: c2 16 20 06 lduh [ %i0 + 6 ], %g1 40012714: 82 20 40 1a sub %g1, %i2, %g1 40012718: 80 a6 c0 01 cmp %i3, %g1 4001271c: 38 80 00 02 bgu,a 40012724 <== NEVER TAKEN 40012720: b6 10 00 01 mov %g1, %i3 <== NOT EXECUTED uint32_t cur_blk = fat_cluster_num_to_block_num(fs_info, start_cln); 40012724: 90 10 00 18 mov %i0, %o0 40012728: 7f ff fe b1 call 400121ec 4001272c: 92 10 00 19 mov %i1, %o1 uint32_t blocks_in_offset = (offset >> fs_info->vol.bytes_per_block_log2); 40012730: 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; 40012734: 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); 40012738: a5 36 80 01 srl %i2, %g1, %l2 uint32_t ofs_blk = offset - (blocks_in_offset << fs_info->vol.bytes_per_block_log2); 4001273c: 83 2c 80 01 sll %l2, %g1, %g1 40012740: a6 10 20 01 mov 1, %l3 40012744: 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; 40012748: a4 02 00 12 add %o0, %l2, %l2 while ( (RC_OK == rc) 4001274c: 10 80 00 2d b 40012800 40012750: 82 10 20 00 clr %g1 && (0 < bytes_to_write)) { c = MIN(bytes_to_write, (fs_info->vol.bytes_per_block - ofs_blk)); 40012754: 82 20 80 1a sub %g2, %i2, %g1 40012758: 80 a0 40 1b cmp %g1, %i3 4001275c: 08 80 00 03 bleu 40012768 40012760: b2 10 00 01 mov %g1, %i1 40012764: 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)); 40012768: 80 a6 40 01 cmp %i1, %g1 4001276c: 08 80 00 03 bleu 40012778 <== ALWAYS TAKEN 40012770: a0 10 00 19 mov %i1, %l0 40012774: a0 10 00 01 mov %g1, %l0 <== NOT EXECUTED uint32_t ino ) { return (ino >= fs_info->uino_base); } 40012778: 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) 4001277c: 80 a4 20 00 cmp %l0, 0 40012780: 02 80 00 2a be 40012828 <== NEVER TAKEN 40012784: 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); 40012788: 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); 4001278c: 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 40012790: 80 a7 60 00 cmp %i5, 0 40012794: 12 80 00 05 bne 400127a8 40012798: 93 2c 80 09 sll %l2, %o1, %o1 || (bytes_to_write == fs_info->vol.bytes_per_block)) 4001279c: 80 a4 00 02 cmp %l0, %g2 400127a0: 12 80 00 04 bne 400127b0 400127a4: 94 10 20 01 mov 1, %o2 { rc = fat_buf_access(fs_info, sec_num, FAT_OP_TYPE_GET, &blk_buf); 400127a8: 10 80 00 02 b 400127b0 400127ac: 94 10 20 02 mov 2, %o2 } else rc = fat_buf_access(fs_info, sec_num, FAT_OP_TYPE_READ, &blk_buf); 400127b0: 7f ff ff 1a call 40012418 400127b4: 96 07 bf fc add %fp, -4, %o3 if (RC_OK == rc) 400127b8: 80 a2 20 00 cmp %o0, 0 400127bc: 12 80 00 0a bne 400127e4 <== NEVER TAKEN 400127c0: 80 a6 40 08 cmp %i1, %o0 { memcpy(blk_buf + offset, buf, bytes_to_write); 400127c4: d0 07 bf fc ld [ %fp + -4 ], %o0 400127c8: 92 07 00 11 add %i4, %l1, %o1 400127cc: 90 02 00 1a add %o0, %i2, %o0 400127d0: 40 00 22 e4 call 4001b360 400127d4: 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; 400127d8: 10 80 00 14 b 40012828 400127dc: e6 2e 20 88 stb %l3, [ %i0 + 0x88 ] cur_blk, ofs_blk, c, &buffer[bytes_written], overwrite_cluster); if (c != ret) 400127e0: 80 a6 40 08 cmp %i1, %o0 400127e4: 12 80 00 06 bne 400127fc <== NEVER TAKEN 400127e8: 82 10 3f ff mov -1, %g1 rc = -1; else { bytes_to_write -= ret; 400127ec: b6 26 c0 19 sub %i3, %i1, %i3 bytes_written += ret; 400127f0: a2 04 40 19 add %l1, %i1, %l1 ++cur_blk; 400127f4: a4 04 a0 01 inc %l2 400127f8: 82 10 20 00 clr %g1 400127fc: b4 10 20 00 clr %i2 ssize_t ret; uint32_t c; cur_blk += blocks_in_offset; while ( (RC_OK == rc) 40012800: 80 a6 e0 00 cmp %i3, 0 40012804: 02 80 00 04 be 40012814 40012808: 80 a0 60 00 cmp %g1, 0 4001280c: 22 bf ff d2 be,a 40012754 <== ALWAYS TAKEN 40012810: c4 16 20 0a lduh [ %i0 + 0xa ], %g2 bytes_written += ret; ++cur_blk; } ofs_blk = 0; } if (RC_OK != rc) 40012814: 80 a0 60 00 cmp %g1, 0 40012818: 12 80 00 06 bne 40012830 <== NEVER TAKEN 4001281c: b0 10 3f ff mov -1, %i0 40012820: 81 c7 e0 08 ret 40012824: 91 e8 00 11 restore %g0, %l1, %o0 } } if (RC_OK != rc) return rc; else return bytes_to_write; 40012828: 10 bf ff ee b 400127e0 4001282c: 90 10 00 10 mov %l0, %o0 } if (RC_OK != rc) return rc; else return bytes_written; } 40012830: 81 c7 e0 08 ret <== NOT EXECUTED 40012834: 81 e8 00 00 restore <== NOT EXECUTED =============================================================================== 40011ab4 : int fat_file_close( fat_fs_info_t *fs_info, fat_file_fd_t *fat_fd ) { 40011ab4: 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) 40011ab8: c2 06 60 08 ld [ %i1 + 8 ], %g1 40011abc: 80 a0 60 01 cmp %g1, 1 40011ac0: 08 80 00 05 bleu 40011ad4 40011ac4: 82 00 7f ff add %g1, -1, %g1 { fat_fd->links_num--; return rc; 40011ac8: 90 10 20 00 clr %o0 40011acc: 10 80 00 25 b 40011b60 40011ad0: 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) 40011ad4: c2 0e 60 30 ldub [ %i1 + 0x30 ], %g1 40011ad8: 80 88 60 01 btst 1, %g1 40011adc: 02 80 00 14 be 40011b2c 40011ae0: 90 10 00 18 mov %i0, %o0 { rc = fat_file_truncate(fs_info, fat_fd, 0); 40011ae4: 92 10 00 19 mov %i1, %o1 40011ae8: 7f ff ff ae call 400119a0 40011aec: 94 10 20 00 clr %o2 if ( rc != RC_OK ) 40011af0: 80 a2 20 00 cmp %o0, 0 40011af4: 12 80 00 1b bne 40011b60 <== NEVER TAKEN 40011af8: 01 00 00 00 nop */ RTEMS_INLINE_ROUTINE void rtems_chain_extract( rtems_chain_node *the_node ) { _Chain_Extract( the_node ); 40011afc: 40 00 0e 6d call 400154b0 <_Chain_Extract> 40011b00: 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) ) 40011b04: d2 06 60 0c ld [ %i1 + 0xc ], %o1 40011b08: 40 00 06 01 call 4001330c 40011b0c: 90 10 00 18 mov %i0, %o0 40011b10: 80 8a 20 ff btst 0xff, %o0 40011b14: 02 80 00 0f be 40011b50 <== ALWAYS TAKEN 40011b18: 01 00 00 00 nop fat_free_unique_ino(fs_info, fat_fd->ino); 40011b1c: d2 06 60 0c ld [ %i1 + 0xc ], %o1 <== NOT EXECUTED 40011b20: 40 00 05 f0 call 400132e0 <== NOT EXECUTED 40011b24: 90 10 00 18 mov %i0, %o0 <== NOT EXECUTED 40011b28: 30 80 00 0a b,a 40011b50 <== NOT EXECUTED free(fat_fd); } else { if (fat_ino_is_unique(fs_info, fat_fd->ino)) 40011b2c: 40 00 05 f8 call 4001330c 40011b30: d2 06 60 0c ld [ %i1 + 0xc ], %o1 40011b34: 80 8a 20 ff btst 0xff, %o0 40011b38: 02 80 00 04 be 40011b48 40011b3c: 01 00 00 00 nop { fat_fd->links_num = 0; 40011b40: 10 80 00 06 b 40011b58 40011b44: c0 26 60 08 clr [ %i1 + 8 ] 40011b48: 40 00 0e 5a call 400154b0 <_Chain_Extract> 40011b4c: 90 10 00 19 mov %i1, %o0 } else { _hash_delete(fs_info->vhash, key, fat_fd->ino, fat_fd); free(fat_fd); 40011b50: 7f ff cb ec call 40004b00 40011b54: 90 10 00 19 mov %i1, %o0 } } /* * flush any modified "cached" buffer back to disk */ rc = fat_buf_release(fs_info); 40011b58: 40 00 01 bc call 40012248 40011b5c: 81 e8 00 00 restore return rc; } 40011b60: 81 c7 e0 08 ret 40011b64: 91 e8 00 08 restore %g0, %o0, %o0 =============================================================================== 40011c38 : fat_file_fd_t *fat_fd, bool zero_fill, uint32_t new_length, uint32_t *a_length ) { 40011c38: 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; 40011c3c: f6 27 00 00 st %i3, [ %i4 ] if (new_length <= fat_fd->fat_file_size) 40011c40: c2 06 60 18 ld [ %i1 + 0x18 ], %g1 uint32_t new_length, uint32_t *a_length ) { int rc = RC_OK; uint32_t chain = 0; 40011c44: 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; 40011c48: 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) 40011c4c: 80 a6 c0 01 cmp %i3, %g1 40011c50: 18 80 00 04 bgu 40011c60 40011c54: ba 10 00 18 mov %i0, %i5 return RC_OK; 40011c58: 81 c7 e0 08 ret 40011c5c: 91 e8 20 00 restore %g0, 0, %o0 if ((FAT_FD_OF_ROOT_DIR(fat_fd)) && 40011c60: c4 06 60 20 ld [ %i1 + 0x20 ], %g2 40011c64: 80 a0 a0 01 cmp %g2, 1 40011c68: 32 80 00 0b bne,a 40011c94 40011c6c: e0 17 60 06 lduh [ %i5 + 6 ], %l0 40011c70: c4 06 60 24 ld [ %i1 + 0x24 ], %g2 40011c74: 80 a0 a0 00 cmp %g2, 0 40011c78: 32 80 00 07 bne,a 40011c94 <== NEVER TAKEN 40011c7c: e0 17 60 06 lduh [ %i5 + 6 ], %l0 <== NOT EXECUTED (fs_info->vol.type & (FAT_FAT12 | FAT_FAT16))) 40011c80: 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)) && 40011c84: 80 88 a0 03 btst 3, %g2 40011c88: 22 80 00 03 be,a 40011c94 <== NEVER TAKEN 40011c8c: e0 17 60 06 lduh [ %i5 + 6 ], %l0 <== NOT EXECUTED 40011c90: 30 80 00 34 b,a 40011d60 (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))) & 40011c94: 84 04 3f ff add %l0, -1, %g2 40011c98: 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 - 40011c9c: a0 24 00 12 sub %l0, %l2, %l0 40011ca0: 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; 40011ca4: 84 26 c0 01 sub %i3, %g1, %g2 if (bytes2add > bytes_remain) 40011ca8: 80 a0 80 10 cmp %g2, %l0 40011cac: 08 80 00 03 bleu 40011cb8 40011cb0: a2 10 20 00 clr %l1 bytes2add -= bytes_remain; 40011cb4: a2 20 80 10 sub %g2, %l0, %l1 else bytes2add = 0; if (zero_fill && bytes_remain > 0) { 40011cb8: 80 a4 20 00 cmp %l0, 0 40011cbc: 02 80 00 17 be 40011d18 40011cc0: 80 a4 60 00 cmp %l1, 0 40011cc4: 80 a6 a0 00 cmp %i2, 0 40011cc8: 02 80 00 14 be 40011d18 40011ccc: 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; 40011cd0: 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); 40011cd4: 90 10 00 1d mov %i5, %o0 40011cd8: 92 10 00 19 mov %i1, %o1 40011cdc: 95 30 40 0a srl %g1, %o2, %o2 40011ce0: 7f ff fe 39 call 400115c4 40011ce4: 96 07 bf fc add %fp, -4, %o3 if (rc != RC_OK) 40011ce8: b0 92 60 00 orcc %o1, 0, %i0 40011cec: 12 80 00 21 bne 40011d70 <== NEVER TAKEN 40011cf0: d2 07 bf fc ld [ %fp + -4 ], %o1 return rc; bytes_written = fat_cluster_set (fs_info, cur_cln, ofs, bytes_remain, 0); 40011cf4: 90 10 00 1d mov %i5, %o0 40011cf8: 94 10 00 12 mov %l2, %o2 40011cfc: 96 10 00 10 mov %l0, %o3 40011d00: 98 10 20 00 clr %o4 40011d04: 40 00 02 3a call 400125ec 40011d08: b0 10 3f ff mov -1, %i0 if (bytes_remain != bytes_written) 40011d0c: 80 a4 00 08 cmp %l0, %o0 40011d10: 12 80 00 18 bne 40011d70 <== NEVER TAKEN 40011d14: 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) 40011d18: 02 bf ff d0 be 40011c58 40011d1c: a4 04 7f ff add %l1, -1, %l2 return RC_OK; cls2add = ((bytes2add - 1) >> fs_info->vol.bpc_log2) + 1; 40011d20: c2 0f 60 08 ldub [ %i5 + 8 ], %g1 rc = fat_scan_fat_for_free_clusters(fs_info, &chain, cls2add, 40011d24: 90 10 00 1d mov %i5, %o0 * file ) - return */ if (bytes2add == 0) return RC_OK; cls2add = ((bytes2add - 1) >> fs_info->vol.bpc_log2) + 1; 40011d28: a5 34 80 01 srl %l2, %g1, %l2 rc = fat_scan_fat_for_free_clusters(fs_info, &chain, cls2add, 40011d2c: 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; 40011d30: a4 04 a0 01 inc %l2 rc = fat_scan_fat_for_free_clusters(fs_info, &chain, cls2add, 40011d34: 96 07 bf fc add %fp, -4, %o3 40011d38: 94 10 00 12 mov %l2, %o2 40011d3c: 98 07 bf f8 add %fp, -8, %o4 40011d40: 40 00 1c 38 call 40018e20 40011d44: 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) 40011d48: b0 92 20 00 orcc %o0, 0, %i0 40011d4c: 12 80 00 09 bne 40011d70 <== NEVER TAKEN 40011d50: 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)) 40011d54: 80 94 00 01 orcc %l0, %g1, %g0 40011d58: 12 80 00 08 bne 40011d78 <== ALWAYS TAKEN 40011d5c: 80 a4 80 01 cmp %l2, %g1 rtems_set_errno_and_return_minus_one(ENOSPC); 40011d60: 40 00 22 db call 4001a8cc <__errno> 40011d64: b0 10 3f ff mov -1, %i0 40011d68: 82 10 20 1c mov 0x1c, %g1 40011d6c: c2 22 00 00 st %g1, [ %o0 ] 40011d70: 81 c7 e0 08 ret 40011d74: 81 e8 00 00 restore /* check wether we satisfied request for 'cls2add' clusters */ if (cls2add != cls_added) 40011d78: 02 80 00 09 be 40011d9c <== ALWAYS TAKEN 40011d7c: 82 24 80 01 sub %l2, %g1, %g1 { new_length -= bytes2add & (fs_info->vol.bpc - 1); 40011d80: c4 17 60 06 lduh [ %i5 + 6 ], %g2 <== NOT EXECUTED 40011d84: 84 00 bf ff add %g2, -1, %g2 <== NOT EXECUTED 40011d88: a2 0c 40 02 and %l1, %g2, %l1 <== NOT EXECUTED new_length -= (cls2add - cls_added) << fs_info->vol.bpc_log2; 40011d8c: 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); 40011d90: b6 26 c0 11 sub %i3, %l1, %i3 <== NOT EXECUTED new_length -= (cls2add - cls_added) << fs_info->vol.bpc_log2; 40011d94: 83 28 40 02 sll %g1, %g2, %g1 <== NOT EXECUTED 40011d98: 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 ) 40011d9c: d6 06 60 18 ld [ %i1 + 0x18 ], %o3 40011da0: 80 a2 e0 00 cmp %o3, 0 40011da4: 32 80 00 07 bne,a 40011dc0 40011da8: c2 06 60 3c ld [ %i1 + 0x3c ], %g1 { fat_fd->map.disk_cln = fat_fd->cln = chain; 40011dac: c2 07 bf f0 ld [ %fp + -16 ], %g1 fat_fd->map.file_cln = 0; 40011db0: 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; 40011db4: c2 26 60 1c st %g1, [ %i1 + 0x1c ] 40011db8: 10 80 00 1d b 40011e2c 40011dbc: c2 26 60 38 st %g1, [ %i1 + 0x38 ] fat_fd->map.file_cln = 0; } else { if (fat_fd->map.last_cln != FAT_UNDEFINED_VALUE) 40011dc0: 80 a0 7f ff cmp %g1, -1 40011dc4: 22 80 00 04 be,a 40011dd4 <== NEVER TAKEN 40011dc8: 90 10 00 1d mov %i5, %o0 <== NOT EXECUTED { old_last_cl = fat_fd->map.last_cln; 40011dcc: 10 80 00 0c b 40011dfc 40011dd0: c2 27 bf f4 st %g1, [ %fp + -12 ] } else { rc = fat_file_ioctl(fs_info, fat_fd, F_CLU_NUM, 40011dd4: 92 10 00 19 mov %i1, %o1 <== NOT EXECUTED 40011dd8: 94 10 20 01 mov 1, %o2 <== NOT EXECUTED 40011ddc: 96 02 ff ff add %o3, -1, %o3 <== NOT EXECUTED 40011de0: 7f ff ff 62 call 40011b68 <== NOT EXECUTED 40011de4: 98 07 bf f4 add %fp, -12, %o4 <== NOT EXECUTED (fat_fd->fat_file_size - 1), &old_last_cl); if ( rc != RC_OK ) 40011de8: b4 92 20 00 orcc %o0, 0, %i2 <== NOT EXECUTED 40011dec: 02 80 00 05 be 40011e00 <== NOT EXECUTED 40011df0: 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); 40011df4: 10 80 00 1f b 40011e70 <== NOT EXECUTED 40011df8: 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); 40011dfc: d2 07 bf f4 ld [ %fp + -12 ], %o1 40011e00: d4 07 bf f0 ld [ %fp + -16 ], %o2 40011e04: 40 00 1b 37 call 40018ae0 40011e08: 90 10 00 1d mov %i5, %o0 40011e0c: b4 10 00 08 mov %o0, %i2 if ( rc != RC_OK ) 40011e10: 80 a6 a0 00 cmp %i2, 0 40011e14: 02 80 00 04 be 40011e24 <== ALWAYS TAKEN 40011e18: 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); 40011e1c: 10 80 00 16 b 40011e74 <== NOT EXECUTED 40011e20: 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); 40011e24: 40 00 01 09 call 40012248 40011e28: 01 00 00 00 nop } /* update number of the last cluster of the file if it changed */ if (cls_added != 0) 40011e2c: c2 07 bf fc ld [ %fp + -4 ], %g1 40011e30: 80 a0 60 00 cmp %g1, 0 40011e34: 22 80 00 14 be,a 40011e84 <== NEVER TAKEN 40011e38: f6 27 00 00 st %i3, [ %i4 ] <== NOT EXECUTED { fat_fd->map.last_cln = last_cl; 40011e3c: c2 07 bf f8 ld [ %fp + -8 ], %g1 40011e40: c2 26 60 3c st %g1, [ %i1 + 0x3c ] if (fat_fd->fat_file_type == FAT_DIRECTORY) 40011e44: c2 06 60 10 ld [ %i1 + 0x10 ], %g1 40011e48: 80 a0 60 00 cmp %g1, 0 40011e4c: 32 80 00 0e bne,a 40011e84 40011e50: f6 27 00 00 st %i3, [ %i4 ] { rc = fat_init_clusters_chain(fs_info, chain); 40011e54: d2 07 bf f0 ld [ %fp + -16 ], %o1 40011e58: 40 00 04 d4 call 400131a8 40011e5c: 90 10 00 1d mov %i5, %o0 if ( rc != RC_OK ) 40011e60: b4 92 20 00 orcc %o0, 0, %i2 40011e64: 22 80 00 08 be,a 40011e84 <== ALWAYS TAKEN 40011e68: f6 27 00 00 st %i3, [ %i4 ] { fat_free_fat_clusters_chain(fs_info, chain); 40011e6c: 90 10 00 1d mov %i5, %o0 <== NOT EXECUTED 40011e70: d2 07 bf f0 ld [ %fp + -16 ], %o1 <== NOT EXECUTED 40011e74: 40 00 1b bc call 40018d64 <== NOT EXECUTED 40011e78: b0 10 00 1a mov %i2, %i0 <== NOT EXECUTED 40011e7c: 81 c7 e0 08 ret <== NOT EXECUTED 40011e80: 81 e8 00 00 restore <== NOT EXECUTED } } } *a_length = new_length; fat_fd->fat_file_size = new_length; 40011e84: f6 26 60 18 st %i3, [ %i1 + 0x18 ] return RC_OK; } 40011e88: 81 c7 e0 08 ret 40011e8c: 81 e8 00 00 restore =============================================================================== 40011b68 : fat_file_ioctl( fat_fs_info_t *fs_info, fat_file_fd_t *fat_fd, int cmd, ...) { 40011b68: 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); 40011b6c: 82 07 a0 50 add %fp, 0x50, %g1 40011b70: f6 27 a0 50 st %i3, [ %fp + 0x50 ] 40011b74: f8 27 a0 54 st %i4, [ %fp + 0x54 ] 40011b78: 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; 40011b7c: c0 27 bf f8 clr [ %fp + -8 ] uint32_t *ret; va_list ap; va_start(ap, cmd); switch (cmd) 40011b80: 80 a6 a0 01 cmp %i2, 1 40011b84: 12 80 00 26 bne 40011c1c <== NEVER TAKEN 40011b88: c2 27 bf fc st %g1, [ %fp + -4 ] { case F_CLU_NUM: pos = va_arg(ap, uint32_t); ret = va_arg(ap, uint32_t *); 40011b8c: 82 07 a0 58 add %fp, 0x58, %g1 40011b90: c2 27 bf fc st %g1, [ %fp + -4 ] /* sanity check */ if ( pos >= fat_fd->fat_file_size ) { 40011b94: c2 06 60 18 ld [ %i1 + 0x18 ], %g1 40011b98: 80 a6 c0 01 cmp %i3, %g1 40011b9c: 0a 80 00 06 bcs 40011bb4 <== ALWAYS TAKEN 40011ba0: ba 10 00 1c mov %i4, %i5 va_end(ap); rtems_set_errno_and_return_minus_one( EIO ); 40011ba4: 40 00 23 4a call 4001a8cc <__errno> <== NOT EXECUTED 40011ba8: 01 00 00 00 nop <== NOT EXECUTED 40011bac: 10 80 00 1f b 40011c28 <== NOT EXECUTED 40011bb0: 82 10 20 05 mov 5, %g1 ! 5 <== NOT EXECUTED } if ((FAT_FD_OF_ROOT_DIR(fat_fd)) && 40011bb4: c2 06 60 20 ld [ %i1 + 0x20 ], %g1 40011bb8: 80 a0 60 01 cmp %g1, 1 40011bbc: 32 80 00 0d bne,a 40011bf0 40011bc0: d4 0e 20 08 ldub [ %i0 + 8 ], %o2 40011bc4: c2 06 60 24 ld [ %i1 + 0x24 ], %g1 40011bc8: 80 a0 60 00 cmp %g1, 0 40011bcc: 32 80 00 09 bne,a 40011bf0 <== NEVER TAKEN 40011bd0: d4 0e 20 08 ldub [ %i0 + 8 ], %o2 <== NOT EXECUTED (fs_info->vol.type & (FAT_FAT12 | FAT_FAT16))) 40011bd4: 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)) && 40011bd8: 80 88 60 03 btst 3, %g1 40011bdc: 22 80 00 05 be,a 40011bf0 40011be0: 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; 40011be4: c0 27 00 00 clr [ %i4 ] rc = RC_OK; break; 40011be8: 81 c7 e0 08 ret 40011bec: 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); 40011bf0: 90 10 00 18 mov %i0, %o0 40011bf4: 92 10 00 19 mov %i1, %o1 40011bf8: 95 36 c0 0a srl %i3, %o2, %o2 40011bfc: 7f ff fe 72 call 400115c4 40011c00: 96 07 bf f8 add %fp, -8, %o3 if ( rc != RC_OK ) 40011c04: b0 92 60 00 orcc %o1, 0, %i0 40011c08: 12 80 00 03 bne 40011c14 <== NEVER TAKEN 40011c0c: c2 07 bf f8 ld [ %fp + -8 ], %g1 break; *ret = cur_cln; 40011c10: c2 27 40 00 st %g1, [ %i5 ] break; 40011c14: 81 c7 e0 08 ret 40011c18: 81 e8 00 00 restore default: errno = EINVAL; 40011c1c: 40 00 23 2c call 4001a8cc <__errno> <== NOT EXECUTED 40011c20: 01 00 00 00 nop <== NOT EXECUTED 40011c24: 82 10 20 16 mov 0x16, %g1 ! 16 <== NOT EXECUTED 40011c28: c2 22 00 00 st %g1, [ %o0 ] <== NOT EXECUTED rc = -1; 40011c2c: b0 10 3f ff mov -1, %i0 <== NOT EXECUTED break; } va_end(ap); return rc; } 40011c30: 81 c7 e0 08 ret <== NOT EXECUTED 40011c34: 81 e8 00 00 restore <== NOT EXECUTED =============================================================================== 400115c4 : fat_fs_info_t *fs_info, fat_file_fd_t *fat_fd, uint32_t file_cln, uint32_t *disk_cln ) { 400115c4: 9d e3 bf 98 save %sp, -104, %sp int rc = RC_OK; if (file_cln == fat_fd->map.file_cln) 400115c8: c2 06 60 34 ld [ %i1 + 0x34 ], %g1 400115cc: 80 a6 80 01 cmp %i2, %g1 400115d0: 12 80 00 05 bne 400115e4 400115d4: 01 00 00 00 nop *disk_cln = fat_fd->map.disk_cln; 400115d8: c2 06 60 38 ld [ %i1 + 0x38 ], %g1 400115dc: 10 80 00 1b b 40011648 400115e0: 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) 400115e4: 28 80 00 06 bleu,a 400115fc 400115e8: c2 06 60 1c ld [ %i1 + 0x1c ], %g1 { cur_cln = fat_fd->map.disk_cln; 400115ec: c4 06 60 38 ld [ %i1 + 0x38 ], %g2 count = file_cln - fat_fd->map.file_cln; 400115f0: 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; 400115f4: 10 80 00 04 b 40011604 400115f8: c4 27 bf fc st %g2, [ %fp + -4 ] count = file_cln - fat_fd->map.file_cln; } else { cur_cln = fat_fd->cln; 400115fc: b8 10 00 1a mov %i2, %i4 40011600: c2 27 bf fc st %g1, [ %fp + -4 ] count = file_cln; } /* skip over the clusters */ for (i = 0; i < count; i++) 40011604: 10 80 00 0b b 40011630 40011608: ba 10 20 00 clr %i5 { rc = fat_get_fat_cluster(fs_info, cur_cln, &cur_cln); 4001160c: 90 10 00 18 mov %i0, %o0 40011610: 40 00 1c c2 call 40018918 40011614: 94 07 bf fc add %fp, -4, %o2 if ( rc != RC_OK ) 40011618: 80 a2 20 00 cmp %o0, 0 4001161c: 22 80 00 05 be,a 40011630 <== ALWAYS TAKEN 40011620: ba 07 60 01 inc %i5 return rc; 40011624: 86 10 00 08 mov %o0, %g3 <== NOT EXECUTED 40011628: 10 80 00 0a b 40011650 <== NOT EXECUTED 4001162c: 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++) 40011630: 80 a7 40 1c cmp %i5, %i4 40011634: 12 bf ff f6 bne 4001160c 40011638: d2 07 bf fc ld [ %fp + -4 ], %o1 if ( rc != RC_OK ) return rc; } /* update cache */ fat_fd->map.file_cln = file_cln; 4001163c: f4 26 60 34 st %i2, [ %i1 + 0x34 ] fat_fd->map.disk_cln = cur_cln; 40011640: d2 26 60 38 st %o1, [ %i1 + 0x38 ] *disk_cln = cur_cln; 40011644: d2 26 c0 00 st %o1, [ %i3 ] } return RC_OK; 40011648: 84 10 20 00 clr %g2 4001164c: 86 10 20 00 clr %g3 } 40011650: b0 10 00 02 mov %g2, %i0 40011654: 81 c7 e0 08 ret 40011658: 93 e8 00 03 restore %g0, %g3, %o1 =============================================================================== 4001165c : fat_file_open( fat_fs_info_t *fs_info, fat_dir_pos_t *dir_pos, fat_file_fd_t **fat_fd ) { 4001165c: 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); 40011660: 90 10 00 18 mov %i0, %o0 40011664: 7f ff ff c7 call 40011580 40011668: 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; 4001166c: 82 0a 20 01 and %o0, 1, %g1 rtems_chain_node *the_node = rtems_chain_first(hash + mod); 40011670: 85 28 60 02 sll %g1, 2, %g2 40011674: b7 28 60 04 sll %g1, 4, %i3 40011678: c2 06 20 6c ld [ %i0 + 0x6c ], %g1 4001167c: 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); 40011680: 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); 40011684: 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; 40011688: 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 )); 4001168c: 10 80 00 0c b 400116bc 40011690: 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); 40011694: 7f ff ff bb call 40011580 40011698: 92 07 60 20 add %i5, 0x20, %o1 if ( (key1) == ck) 4001169c: 80 a7 00 08 cmp %i4, %o0 400116a0: 32 80 00 07 bne,a 400116bc 400116a4: 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++; 400116a8: 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; 400116ac: fa 26 80 00 st %i5, [ %i2 ] lfat_fd->links_num++; 400116b0: 82 00 60 01 inc %g1 400116b4: 10 80 00 42 b 400117bc 400116b8: 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) ; ) 400116bc: 80 a7 40 10 cmp %i5, %l0 400116c0: 12 bf ff f5 bne 40011694 400116c4: 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); 400116c8: 10 80 00 3f b 400117c4 400116cc: 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); 400116d0: 7f ff ff ac call 40011580 <== NOT EXECUTED 400116d4: 92 07 60 20 add %i5, 0x20, %o1 <== NOT EXECUTED if ( (key1) == ck) 400116d8: 80 a7 00 08 cmp %i4, %o0 <== NOT EXECUTED 400116dc: 32 80 00 0a bne,a 40011704 <== NOT EXECUTED 400116e0: fa 07 40 00 ld [ %i5 ], %i5 <== NOT EXECUTED { if ( ((key2) == 0) || ((key2) == ffd->ino) ) 400116e4: 80 a7 20 00 cmp %i4, 0 <== NOT EXECUTED 400116e8: 22 80 00 0b be,a 40011714 <== NOT EXECUTED 400116ec: a0 10 20 00 clr %l0 <== NOT EXECUTED 400116f0: c2 07 60 0c ld [ %i5 + 0xc ], %g1 <== NOT EXECUTED 400116f4: 80 a7 00 01 cmp %i4, %g1 <== NOT EXECUTED 400116f8: 22 80 00 07 be,a 40011714 <== NOT EXECUTED 400116fc: a0 10 20 00 clr %l0 <== NOT EXECUTED { *ret = (void *)the_node; return 0; } } the_node = the_node->next; 40011700: 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) ; ) 40011704: 80 a7 40 10 cmp %i5, %l0 40011708: 12 bf ff f2 bne 400116d0 <== NEVER TAKEN 4001170c: 90 10 00 18 mov %i0, %o0 40011710: 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)); 40011714: 7f ff ce 45 call 40005028 40011718: 90 10 20 44 mov 0x44, %o0 4001171c: d0 26 80 00 st %o0, [ %i2 ] if ( lfat_fd == NULL ) 40011720: 80 a2 20 00 cmp %o0, 0 40011724: 02 80 00 1c be 40011794 <== NEVER TAKEN 40011728: ba 10 00 08 mov %o0, %i5 rtems_set_errno_and_return_minus_one( ENOMEM ); memset(lfat_fd, 0, sizeof(fat_file_fd_t)); 4001172c: 92 10 20 00 clr %o1 40011730: 40 00 27 49 call 4001b454 40011734: 94 10 20 44 mov 0x44, %o2 lfat_fd->links_num = 1; 40011738: 82 10 20 01 mov 1, %g1 4001173c: c2 27 60 08 st %g1, [ %i5 + 8 ] lfat_fd->flags &= ~FAT_FILE_REMOVED; 40011740: c2 0f 60 30 ldub [ %i5 + 0x30 ], %g1 lfat_fd->map.last_cln = FAT_UNDEFINED_VALUE; lfat_fd->dir_pos = *dir_pos; 40011744: 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; 40011748: 82 08 7f fe and %g1, -2, %g1 4001174c: c2 2f 60 30 stb %g1, [ %i5 + 0x30 ] lfat_fd->map.last_cln = FAT_UNDEFINED_VALUE; 40011750: 82 10 3f ff mov -1, %g1 lfat_fd->dir_pos = *dir_pos; 40011754: 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; 40011758: c2 27 60 3c st %g1, [ %i5 + 0x3c ] lfat_fd->dir_pos = *dir_pos; 4001175c: 40 00 27 01 call 4001b360 40011760: 94 10 20 10 mov 0x10, %o2 if ( rc != RC_OK ) 40011764: 80 a4 20 00 cmp %l0, 0 40011768: 02 80 00 04 be 40011778 <== NEVER TAKEN 4001176c: 01 00 00 00 nop lfat_fd->ino = key; 40011770: 10 80 00 0f b 400117ac 40011774: f8 27 60 0c st %i4, [ %i5 + 0xc ] else { lfat_fd->ino = fat_get_unique_ino(fs_info); 40011778: 40 00 06 aa call 40013220 <== NOT EXECUTED 4001177c: 90 10 00 18 mov %i0, %o0 <== NOT EXECUTED if ( lfat_fd->ino == 0 ) 40011780: 80 a2 20 00 cmp %o0, 0 <== NOT EXECUTED 40011784: 12 80 00 0a bne 400117ac <== NOT EXECUTED 40011788: d0 27 60 0c st %o0, [ %i5 + 0xc ] <== NOT EXECUTED { free((*fat_fd)); 4001178c: 7f ff cc dd call 40004b00 <== NOT EXECUTED 40011790: 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 ); 40011794: 40 00 24 4e call 4001a8cc <__errno> <== NOT EXECUTED 40011798: b0 10 3f ff mov -1, %i0 <== NOT EXECUTED 4001179c: 82 10 20 0c mov 0xc, %g1 <== NOT EXECUTED 400117a0: c2 22 00 00 st %g1, [ %o0 ] <== NOT EXECUTED 400117a4: 81 c7 e0 08 ret <== NOT EXECUTED 400117a8: 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); 400117ac: 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 ); 400117b0: 92 10 00 1d mov %i5, %o1 400117b4: 7f ff e0 a4 call 40009a44 <_Chain_Append> 400117b8: 90 02 00 1b add %o0, %i3, %o0 /* * other fields of fat-file descriptor will be initialized on upper * level */ return RC_OK; 400117bc: 81 c7 e0 08 ret 400117c0: 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); 400117c4: 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; 400117c8: 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 )); 400117cc: 10 bf ff ce b 40011704 400117d0: a0 04 20 04 add %l0, 4, %l0 =============================================================================== 400117e8 : fat_file_fd_t *fat_fd, uint32_t start, uint32_t count, uint8_t *buf ) { 400117e8: 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; 400117ec: c0 27 bf fc clr [ %fp + -4 ] fat_file_fd_t *fat_fd, uint32_t start, uint32_t count, uint8_t *buf ) { 400117f0: 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) 400117f4: 80 a6 e0 00 cmp %i3, 0 400117f8: 02 80 00 68 be 40011998 <== NEVER TAKEN 400117fc: 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 ) 40011800: c2 06 60 18 ld [ %i1 + 0x18 ], %g1 40011804: 80 a6 80 01 cmp %i2, %g1 40011808: 1a 80 00 64 bcc 40011998 4001180c: 80 a6 c0 01 cmp %i3, %g1 return FAT_EOF; if ((count > fat_fd->fat_file_size) || 40011810: 38 80 00 07 bgu,a 4001182c <== NEVER TAKEN 40011814: b6 20 40 1a sub %g1, %i2, %i3 <== NOT EXECUTED (start > fat_fd->fat_file_size - count)) 40011818: 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) || 4001181c: 80 a6 80 02 cmp %i2, %g2 40011820: 28 80 00 04 bleu,a 40011830 40011824: c2 06 60 20 ld [ %i1 + 0x20 ], %g1 (start > fat_fd->fat_file_size - count)) count = fat_fd->fat_file_size - start; 40011828: b6 20 40 1a sub %g1, %i2, %i3 if ((FAT_FD_OF_ROOT_DIR(fat_fd)) && 4001182c: c2 06 60 20 ld [ %i1 + 0x20 ], %g1 40011830: 80 a0 60 01 cmp %g1, 1 40011834: 32 80 00 1c bne,a 400118a4 40011838: e4 0f 60 08 ldub [ %i5 + 8 ], %l2 4001183c: c2 06 60 24 ld [ %i1 + 0x24 ], %g1 40011840: 80 a0 60 00 cmp %g1, 0 40011844: 32 80 00 18 bne,a 400118a4 <== NEVER TAKEN 40011848: e4 0f 60 08 ldub [ %i5 + 8 ], %l2 <== NOT EXECUTED (fs_info->vol.type & (FAT_FAT12 | FAT_FAT16))) 4001184c: 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)) && 40011850: 80 88 60 03 btst 3, %g1 40011854: 22 80 00 14 be,a 400118a4 40011858: 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); 4001185c: d2 06 60 1c ld [ %i1 + 0x1c ], %o1 40011860: 7f ff ff 3a call 40011548 40011864: 90 10 00 1d mov %i5, %o0 sec += (start >> fs_info->vol.sec_log2); 40011868: d2 0f 60 02 ldub [ %i5 + 2 ], %o1 byte = start & (fs_info->vol.bps - 1); 4001186c: 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); 40011870: 93 36 80 09 srl %i2, %o1, %o1 byte = start & (fs_info->vol.bps - 1); 40011874: 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); 40011878: 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); 4001187c: 94 0e 80 0a and %i2, %o2, %o2 40011880: 90 10 00 1d mov %i5, %o0 40011884: 96 10 00 1b mov %i3, %o3 40011888: 40 00 03 13 call 400124d4 <_fat_block_read> 4001188c: 98 10 00 1c mov %i4, %o4 if ( ret < 0 ) 40011890: 80 a2 20 00 cmp %o0, 0 40011894: 16 80 00 41 bge 40011998 <== ALWAYS TAKEN 40011898: 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; 4001189c: 10 80 00 3f b 40011998 <== NOT EXECUTED 400118a0: 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); 400118a4: f0 17 60 06 lduh [ %i5 + 6 ], %i0 return -1; return ret; } cl_start = start >> fs_info->vol.bpc_log2; 400118a8: 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); 400118ac: a6 07 bf fc add %fp, -4, %l3 400118b0: 90 10 00 1d mov %i5, %o0 400118b4: 92 10 00 19 mov %i1, %o1 400118b8: 94 10 00 12 mov %l2, %o2 400118bc: 7f ff ff 42 call 400115c4 400118c0: 96 10 00 13 mov %l3, %o3 if (rc != RC_OK) 400118c4: 90 92 60 00 orcc %o1, 0, %o0 400118c8: 12 80 00 34 bne 40011998 <== NEVER TAKEN 400118cc: 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); 400118d0: b1 2e 20 10 sll %i0, 0x10, %i0 400118d4: b1 36 20 10 srl %i0, 0x10, %i0 400118d8: b0 06 3f ff add %i0, -1, %i0 400118dc: b4 0e 80 18 and %i2, %i0, %i2 400118e0: b0 10 20 00 clr %i0 400118e4: 10 80 00 20 b 40011964 400118e8: a2 10 00 1a mov %i2, %l1 if (rc != RC_OK) return rc; while (count > 0) { c = MIN(count, (fs_info->vol.bpc - ofs)); 400118ec: a0 24 00 11 sub %l0, %l1, %l0 400118f0: 80 a4 00 1b cmp %l0, %i3 400118f4: 38 80 00 02 bgu,a 400118fc 400118f8: a0 10 00 1b mov %i3, %l0 sec = fat_cluster_num_to_sector_num(fs_info, cur_cln); 400118fc: d2 07 bf fc ld [ %fp + -4 ], %o1 40011900: 7f ff ff 12 call 40011548 40011904: 90 10 00 1d mov %i5, %o0 sec += (ofs >> fs_info->vol.sec_log2); 40011908: d2 0f 60 02 ldub [ %i5 + 2 ], %o1 byte = ofs & (fs_info->vol.bps - 1); 4001190c: 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); 40011910: 93 34 40 09 srl %l1, %o1, %o1 byte = ofs & (fs_info->vol.bps - 1); 40011914: 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); 40011918: 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); 4001191c: 94 0c 40 0a and %l1, %o2, %o2 40011920: 90 10 00 1d mov %i5, %o0 40011924: 96 10 00 10 mov %l0, %o3 40011928: 40 00 02 eb call 400124d4 <_fat_block_read> 4001192c: 98 07 00 18 add %i4, %i0, %o4 if ( ret < 0 ) 40011930: 80 a2 20 00 cmp %o0, 0 40011934: 06 80 00 18 bl 40011994 <== NEVER TAKEN 40011938: b6 26 c0 10 sub %i3, %l0, %i3 return -1; count -= c; cmpltd += c; 4001193c: b0 06 00 10 add %i0, %l0, %i0 save_cln = cur_cln; 40011940: e0 07 bf fc ld [ %fp + -4 ], %l0 rc = fat_get_fat_cluster(fs_info, cur_cln, &cur_cln); 40011944: 90 10 00 1d mov %i5, %o0 40011948: 92 10 00 10 mov %l0, %o1 4001194c: 94 10 00 13 mov %l3, %o2 40011950: 40 00 1b f2 call 40018918 40011954: a2 10 20 00 clr %l1 if ( rc != RC_OK ) 40011958: 80 a2 20 00 cmp %o0, 0 4001195c: 12 80 00 0f bne 40011998 <== NEVER TAKEN 40011960: 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) 40011964: 80 a6 e0 00 cmp %i3, 0 40011968: 32 bf ff e1 bne,a 400118ec 4001196c: 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); 40011970: c2 0f 60 08 ldub [ %i5 + 8 ], %g1 40011974: b4 06 bf ff add %i2, -1, %i2 fat_fd->map.disk_cln = save_cln; 40011978: 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); 4001197c: b4 06 80 18 add %i2, %i0, %i2 fat_fd->map.disk_cln = save_cln; return cmpltd; 40011980: 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); 40011984: 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 + 40011988: a4 06 80 12 add %i2, %l2, %l2 4001198c: 10 80 00 03 b 40011998 40011990: 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; 40011994: 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; } 40011998: 81 c7 e0 08 ret 4001199c: 91 e8 00 08 restore %g0, %o0, %o0 =============================================================================== 40012110 : int fat_file_size( fat_fs_info_t *fs_info, fat_file_fd_t *fat_fd ) { 40012110: 9d e3 bf 98 save %sp, -104, %sp int rc = RC_OK; uint32_t cur_cln = fat_fd->cln; 40012114: c2 06 60 1c ld [ %i1 + 0x1c ], %g1 40012118: 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)) && 4001211c: c2 06 60 20 ld [ %i1 + 0x20 ], %g1 40012120: 80 a0 60 01 cmp %g1, 1 40012124: 12 80 00 0d bne 40012158 40012128: ba 10 00 18 mov %i0, %i5 4001212c: c2 06 60 24 ld [ %i1 + 0x24 ], %g1 40012130: 80 a0 60 00 cmp %g1, 0 40012134: 32 80 00 0a bne,a 4001215c <== NEVER TAKEN 40012138: c0 26 60 18 clr [ %i1 + 0x18 ] <== NOT EXECUTED (fs_info->vol.type & (FAT_FAT12 | FAT_FAT16))) 4001213c: 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)) && 40012140: 80 88 60 03 btst 3, %g1 40012144: 22 80 00 06 be,a 4001215c <== ALWAYS TAKEN 40012148: 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; 4001214c: c2 06 20 2c ld [ %i0 + 0x2c ], %g1 <== NOT EXECUTED 40012150: 10 80 00 18 b 400121b0 <== NOT EXECUTED 40012154: c2 26 60 18 st %g1, [ %i1 + 0x18 ] <== NOT EXECUTED return rc; } fat_fd->fat_file_size = 0; 40012158: c0 26 60 18 clr [ %i1 + 0x18 ] while ((cur_cln & fs_info->vol.mask) < fs_info->vol.eoc_val) 4001215c: 10 80 00 0d b 40012190 40012160: 82 10 20 00 clr %g1 { save_cln = cur_cln; rc = fat_get_fat_cluster(fs_info, cur_cln, &cur_cln); 40012164: 92 10 00 1c mov %i4, %o1 40012168: 40 00 19 ec call 40018918 4001216c: 94 07 bf fc add %fp, -4, %o2 if ( rc != RC_OK ) 40012170: b0 92 20 00 orcc %o0, 0, %i0 40012174: 12 80 00 10 bne 400121b4 <== NEVER TAKEN 40012178: 01 00 00 00 nop return rc; fat_fd->fat_file_size += fs_info->vol.bpc; 4001217c: c2 17 60 06 lduh [ %i5 + 6 ], %g1 40012180: c4 06 60 18 ld [ %i1 + 0x18 ], %g2 40012184: 82 00 80 01 add %g2, %g1, %g1 40012188: 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; 4001218c: 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) 40012190: f8 07 bf fc ld [ %fp + -4 ], %i4 40012194: c6 07 60 10 ld [ %i5 + 0x10 ], %g3 40012198: c4 07 60 14 ld [ %i5 + 0x14 ], %g2 4001219c: 86 0f 00 03 and %i4, %g3, %g3 400121a0: 80 a0 c0 02 cmp %g3, %g2 400121a4: 0a bf ff f0 bcs 40012164 400121a8: 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; 400121ac: c2 26 60 3c st %g1, [ %i1 + 0x3c ] 400121b0: b0 10 20 00 clr %i0 return rc; } 400121b4: 81 c7 e0 08 ret 400121b8: 81 e8 00 00 restore =============================================================================== 400119a0 : fat_file_truncate( fat_fs_info_t *fs_info, fat_file_fd_t *fat_fd, uint32_t new_length ) { 400119a0: 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; 400119a4: 82 10 3f ff mov -1, %g1 400119a8: c2 27 bf fc st %g1, [ %fp + -4 ] if ( new_length >= fat_fd->fat_file_size ) 400119ac: c2 06 60 18 ld [ %i1 + 0x18 ], %g1 400119b0: 80 a6 80 01 cmp %i2, %g1 400119b4: 0a 80 00 04 bcs 400119c4 400119b8: c0 27 bf f8 clr [ %fp + -8 ] return rc; 400119bc: 10 80 00 3b b 40011aa8 400119c0: 92 10 20 00 clr %o1 assert(fat_fd->fat_file_size); 400119c4: 80 a0 60 00 cmp %g1, 0 400119c8: 32 80 00 0a bne,a 400119f0 <== ALWAYS TAKEN 400119cc: c4 0e 20 08 ldub [ %i0 + 8 ], %g2 400119d0: 11 10 00 ac sethi %hi(0x4002b000), %o0 <== NOT EXECUTED 400119d4: 15 10 00 ac sethi %hi(0x4002b000), %o2 <== NOT EXECUTED 400119d8: 17 10 00 ac sethi %hi(0x4002b000), %o3 <== NOT EXECUTED 400119dc: 90 12 22 90 or %o0, 0x290, %o0 <== NOT EXECUTED 400119e0: 92 10 22 d1 mov 0x2d1, %o1 <== NOT EXECUTED 400119e4: 94 12 a2 f0 or %o2, 0x2f0, %o2 <== NOT EXECUTED 400119e8: 7f ff cb e0 call 40004968 <__assert_func> <== NOT EXECUTED 400119ec: 96 12 e2 d8 or %o3, 0x2d8, %o3 <== NOT EXECUTED cl_start = (new_length + fs_info->vol.bpc - 1) >> fs_info->vol.bpc_log2; 400119f0: c6 16 20 06 lduh [ %i0 + 6 ], %g3 400119f4: 86 00 ff ff add %g3, -1, %g3 400119f8: b4 00 c0 1a add %g3, %i2, %i2 400119fc: b5 36 80 02 srl %i2, %g2, %i2 if ((cl_start << fs_info->vol.bpc_log2) >= fat_fd->fat_file_size) 40011a00: 85 2e 80 02 sll %i2, %g2, %g2 40011a04: 80 a0 80 01 cmp %g2, %g1 40011a08: 1a bf ff ed bcc 400119bc 40011a0c: 80 a6 a0 00 cmp %i2, 0 return RC_OK; if (cl_start != 0) 40011a10: 12 80 00 0b bne 40011a3c 40011a14: 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); 40011a18: 92 10 00 19 mov %i1, %o1 40011a1c: 94 10 00 1a mov %i2, %o2 40011a20: 7f ff fe e9 call 400115c4 40011a24: 96 07 bf f8 add %fp, -8, %o3 if (rc != RC_OK) 40011a28: 80 a2 60 00 cmp %o1, 0 40011a2c: 32 80 00 20 bne,a 40011aac <== NEVER TAKEN 40011a30: b0 10 00 09 mov %o1, %i0 <== NOT EXECUTED return rc; rc = fat_free_fat_clusters_chain(fs_info, cur_cln); 40011a34: 10 80 00 0b b 40011a60 40011a38: 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); 40011a3c: 92 10 00 19 mov %i1, %o1 40011a40: 94 06 bf ff add %i2, -1, %o2 40011a44: 7f ff fe e0 call 400115c4 40011a48: 96 07 bf fc add %fp, -4, %o3 if (rc != RC_OK) 40011a4c: 80 a2 60 00 cmp %o1, 0 40011a50: 02 bf ff f2 be 40011a18 <== ALWAYS TAKEN 40011a54: 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; } 40011a58: 81 c7 e0 08 ret <== NOT EXECUTED 40011a5c: 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); 40011a60: 40 00 1c c1 call 40018d64 40011a64: 90 10 00 18 mov %i0, %o0 if (rc != RC_OK) 40011a68: 92 92 20 00 orcc %o0, 0, %o1 40011a6c: 12 80 00 0f bne 40011aa8 <== NEVER TAKEN 40011a70: 80 a6 a0 00 cmp %i2, 0 return rc; if (cl_start != 0) 40011a74: 02 80 00 0d be 40011aa8 40011a78: 92 10 20 00 clr %o1 { rc = fat_set_fat_cluster(fs_info, new_last_cln, FAT_GENFAT_EOC); 40011a7c: d2 07 bf fc ld [ %fp + -4 ], %o1 40011a80: 90 10 00 18 mov %i0, %o0 40011a84: 40 00 1c 17 call 40018ae0 40011a88: 94 10 3f ff mov -1, %o2 if ( rc != RC_OK ) 40011a8c: 92 92 20 00 orcc %o0, 0, %o1 40011a90: 12 80 00 06 bne 40011aa8 <== NEVER TAKEN 40011a94: c2 07 bf fc ld [ %fp + -4 ], %g1 return rc; fat_fd->map.file_cln = cl_start - 1; 40011a98: b4 06 bf ff add %i2, -1, %i2 fat_fd->map.disk_cln = new_last_cln; 40011a9c: 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; 40011aa0: f4 26 60 34 st %i2, [ %i1 + 0x34 ] fat_fd->map.disk_cln = new_last_cln; fat_fd->map.last_cln = new_last_cln; 40011aa4: c2 26 60 3c st %g1, [ %i1 + 0x3c ] } return RC_OK; } 40011aa8: b0 10 00 09 mov %o1, %i0 40011aac: 81 c7 e0 08 ret 40011ab0: 81 e8 00 00 restore =============================================================================== 40011e90 : fat_file_fd_t *fat_fd, uint32_t start, uint32_t count, const uint8_t *buf ) { 40011e90: 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; 40011e94: c0 27 bf f8 clr [ %fp + -8 ] fat_file_fd_t *fat_fd, uint32_t start, uint32_t count, const uint8_t *buf ) { 40011e98: 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; 40011e9c: c2 06 60 18 ld [ %i1 + 0x18 ], %g1 uint32_t file_cln_initial = fat_fd->map.file_cln; 40011ea0: e6 06 60 34 ld [ %i1 + 0x34 ], %l3 uint32_t cln; if ( count == 0 ) 40011ea4: 80 a6 e0 00 cmp %i3, 0 40011ea8: 02 80 00 84 be 400120b8 <== NEVER TAKEN 40011eac: 90 10 20 00 clr %o0 return cmpltd; if (start >= fat_fd->size_limit) 40011eb0: fa 06 60 14 ld [ %i1 + 0x14 ], %i5 40011eb4: 80 a6 80 1d cmp %i2, %i5 40011eb8: 2a 80 00 07 bcs,a 40011ed4 <== ALWAYS TAKEN 40011ebc: ba 27 40 1a sub %i5, %i2, %i5 rtems_set_errno_and_return_minus_one(EFBIG); 40011ec0: 40 00 22 83 call 4001a8cc <__errno> <== NOT EXECUTED 40011ec4: 01 00 00 00 nop <== NOT EXECUTED 40011ec8: 82 10 20 1b mov 0x1b, %g1 ! 1b <== NOT EXECUTED 40011ecc: 10 80 00 30 b 40011f8c <== NOT EXECUTED 40011ed0: c2 22 00 00 st %g1, [ %o0 ] <== NOT EXECUTED 40011ed4: 80 a7 40 1b cmp %i5, %i3 40011ed8: 38 80 00 02 bgu,a 40011ee0 <== ALWAYS TAKEN 40011edc: 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; 40011ee0: 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); 40011ee4: b6 07 40 1a add %i5, %i2, %i3 40011ee8: 94 40 20 00 addx %g0, 0, %o2 40011eec: 90 10 00 10 mov %l0, %o0 40011ef0: 92 10 00 19 mov %i1, %o1 40011ef4: 96 10 00 1b mov %i3, %o3 40011ef8: 7f ff ff 50 call 40011c38 40011efc: 98 07 bf f8 add %fp, -8, %o4 if (RC_OK == rc) 40011f00: 80 a2 20 00 cmp %o0, 0 40011f04: 12 80 00 6d bne 400120b8 40011f08: 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)) 40011f0c: 80 a0 40 1b cmp %g1, %i3 40011f10: 32 80 00 02 bne,a 40011f18 <== NEVER TAKEN 40011f14: 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)); 40011f18: 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)) 40011f1c: 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)); 40011f20: 80 a0 e0 01 cmp %g3, 1 40011f24: 12 80 00 09 bne 40011f48 40011f28: 82 10 20 00 clr %g1 40011f2c: c6 06 60 24 ld [ %i1 + 0x24 ], %g3 40011f30: 80 a0 e0 00 cmp %g3, 0 40011f34: 12 80 00 06 bne 40011f4c <== NEVER TAKEN 40011f38: 80 a0 60 00 cmp %g1, 0 40011f3c: 82 08 a0 03 and %g2, 3, %g1 40011f40: 80 a0 00 01 cmp %g0, %g1 40011f44: 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)) 40011f48: 80 a0 60 00 cmp %g1, 0 40011f4c: 02 80 00 12 be 40011f94 40011f50: f6 0c 20 08 ldub [ %l0 + 8 ], %i3 { cln = fat_fd->cln; 40011f54: d2 06 60 1c ld [ %i1 + 0x1c ], %o1 cln += (start >> fs_info->vol.bpc_log2); byte = start & (fs_info->vol.bpc -1); 40011f58: 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); 40011f5c: b7 36 80 1b srl %i2, %i3, %i3 byte = start & (fs_info->vol.bpc -1); 40011f60: 94 02 bf ff add %o2, -1, %o2 ret = fat_cluster_write(fs_info, 40011f64: 90 10 00 10 mov %l0, %o0 40011f68: 92 06 c0 09 add %i3, %o1, %o1 40011f6c: 94 0e 80 0a and %i2, %o2, %o2 40011f70: 96 10 00 1d mov %i5, %o3 40011f74: 98 10 00 1c mov %i4, %o4 40011f78: 40 00 01 e5 call 4001270c 40011f7c: 9a 10 20 00 clr %o5 cln, byte, count, buf, false); if (0 > ret) 40011f80: 80 a2 20 00 cmp %o0, 0 40011f84: 16 80 00 4d bge 400120b8 <== ALWAYS TAKEN 40011f88: 01 00 00 00 nop rc = -1; 40011f8c: 10 80 00 4b b 400120b8 <== NOT EXECUTED 40011f90: 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; 40011f94: 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; 40011f98: 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); 40011f9c: 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; 40011fa0: 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); 40011fa4: 90 10 00 10 mov %l0, %o0 40011fa8: 92 10 00 19 mov %i1, %o1 40011fac: 94 10 00 11 mov %l1, %o2 40011fb0: 7f ff fd 85 call 400115c4 40011fb4: 96 10 00 15 mov %l5, %o3 if (RC_OK == rc) 40011fb8: 80 a2 60 00 cmp %o1, 0 40011fbc: 12 80 00 34 bne 4001208c <== NEVER TAKEN 40011fc0: b7 2c 40 1b sll %l1, %i3, %i3 { file_cln_cnt = cur_cln - fat_fd->cln; 40011fc4: c2 06 60 1c ld [ %i1 + 0x1c ], %g1 40011fc8: e4 07 bf fc ld [ %fp + -4 ], %l2 40011fcc: 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); 40011fd0: 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; 40011fd4: 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); 40011fd8: 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; 40011fdc: 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 */ 40011fe0: 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; 40011fe4: 10 80 00 1a b 4001204c 40011fe8: 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)); 40011fec: 96 22 c0 18 sub %o3, %i0, %o3 40011ff0: 80 a2 c0 1d cmp %o3, %i5 40011ff4: 38 80 00 02 bgu,a 40011ffc 40011ff8: 96 10 00 1d mov %i5, %o3 if (file_cln_initial < file_cln_cnt) 40011ffc: 80 a4 c0 12 cmp %l3, %l2 40012000: 2a 80 00 02 bcs,a 40012008 40012004: a8 10 20 01 mov 1, %l4 overwrite_cluster = true; ret = fat_cluster_write(fs_info, 40012008: d2 07 bf fc ld [ %fp + -4 ], %o1 4001200c: 90 10 00 10 mov %l0, %o0 40012010: 94 10 00 18 mov %i0, %o2 40012014: 98 07 00 1b add %i4, %i3, %o4 40012018: 40 00 01 bd call 4001270c 4001201c: 9a 0d 20 01 and %l4, 1, %o5 40012020: 82 10 00 08 mov %o0, %g1 cur_cln, ofs_cln, c, &buf[cmpltd], overwrite_cluster); if (0 > ret) 40012024: 80 a0 60 00 cmp %g1, 0 40012028: 16 80 00 1d bge 4001209c <== ALWAYS TAKEN 4001202c: 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) 40012030: 10 80 00 08 b 40012050 <== NOT EXECUTED 40012034: 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); 40012038: 90 10 00 10 mov %l0, %o0 4001203c: 92 10 00 16 mov %l6, %o1 40012040: 40 00 1a 36 call 40018918 40012044: 94 10 00 15 mov %l5, %o2 ofs_cln = 0; 40012048: 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) 4001204c: 80 a7 60 00 cmp %i5, 0 40012050: 02 80 00 04 be 40012060 40012054: 80 a2 20 00 cmp %o0, 0 40012058: 22 bf ff e5 be,a 40011fec <== ALWAYS TAKEN 4001205c: 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); 40012060: c2 0c 20 08 ldub [ %l0 + 8 ], %g1 40012064: b4 06 bf ff add %i2, -1, %i2 fat_fd->map.disk_cln = save_cln; 40012068: 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); 4001206c: b4 06 80 1b add %i2, %i3, %i2 40012070: b5 36 80 01 srl %i2, %g1, %i2 } } /* update cache */ /* XXX: check this - I'm not sure :( */ fat_fd->map.file_cln = start_cln + 40012074: 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) 40012078: 92 92 20 00 orcc %o0, 0, %o1 4001207c: 12 80 00 03 bne 40012088 <== NEVER TAKEN 40012080: e2 26 60 34 st %l1, [ %i1 + 0x34 ] return rc; else return cmpltd; 40012084: 92 10 00 1b mov %i3, %o1 fat_fd, start, count, buf, file_cln_initial); if (0 > ret) 40012088: 80 a2 60 00 cmp %o1, 0 4001208c: 16 80 00 0b bge 400120b8 <== ALWAYS TAKEN 40012090: 90 10 00 09 mov %o1, %o0 40012094: 10 80 00 09 b 400120b8 <== NOT EXECUTED 40012098: 90 10 3f ff mov -1, %o0 <== NOT EXECUTED if (0 > ret) rc = -1; if (RC_OK == rc) { ++file_cln_cnt; 4001209c: a4 04 a0 01 inc %l2 bytes_to_write -= ret; cmpltd += ret; 400120a0: b6 06 c0 01 add %i3, %g1, %i3 save_cln = cur_cln; if (0 < bytes_to_write) 400120a4: ba a7 40 01 subcc %i5, %g1, %i5 400120a8: 12 bf ff e4 bne 40012038 400120ac: ec 07 bf fc ld [ %fp + -4 ], %l6 400120b0: 10 bf ff e6 b 40012048 400120b4: 90 10 20 00 clr %o0 } if (RC_OK != rc) return rc; else return cmpltd; } 400120b8: 81 c7 e0 08 ret 400120bc: 91 e8 00 08 restore %g0, %o0, %o0 =============================================================================== 40018d64 : int fat_free_fat_clusters_chain( fat_fs_info_t *fs_info, uint32_t chain ) { 40018d64: 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; 40018d68: b8 10 20 00 clr %i4 int fat_free_fat_clusters_chain( fat_fs_info_t *fs_info, uint32_t chain ) { 40018d6c: ba 10 00 18 mov %i0, %i5 int rc = RC_OK, rc1 = RC_OK; uint32_t cur_cln = chain; uint32_t next_cln = 0; 40018d70: 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; 40018d74: 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) 40018d78: 10 80 00 19 b 40018ddc 40018d7c: b4 10 20 00 clr %i2 { rc = fat_get_fat_cluster(fs_info, cur_cln, &next_cln); 40018d80: 92 10 00 1b mov %i3, %o1 40018d84: 7f ff fe e5 call 40018918 40018d88: 94 07 bf fc add %fp, -4, %o2 if ( rc != RC_OK ) 40018d8c: b0 92 20 00 orcc %o0, 0, %i0 40018d90: 02 80 00 0b be 40018dbc <== ALWAYS TAKEN 40018d94: 90 10 00 1d mov %i5, %o0 { if(fs_info->vol.free_cls != FAT_UNDEFINED_VALUE) 40018d98: c2 07 60 44 ld [ %i5 + 0x44 ], %g1 <== NOT EXECUTED 40018d9c: 80 a0 7f ff cmp %g1, -1 <== NOT EXECUTED 40018da0: 02 80 00 03 be 40018dac <== NOT EXECUTED 40018da4: b8 07 00 01 add %i4, %g1, %i4 <== NOT EXECUTED fs_info->vol.free_cls += freed_cls_cnt; 40018da8: f8 27 60 44 st %i4, [ %i5 + 0x44 ] <== NOT EXECUTED fat_buf_release(fs_info); 40018dac: 7f ff e5 27 call 40012248 <== NOT EXECUTED 40018db0: 90 10 00 1d mov %i5, %o0 <== NOT EXECUTED 40018db4: 81 c7 e0 08 ret <== NOT EXECUTED 40018db8: 81 e8 00 00 restore <== NOT EXECUTED return rc; } rc = fat_set_fat_cluster(fs_info, cur_cln, FAT_GENFAT_FREE); 40018dbc: 92 10 00 1b mov %i3, %o1 40018dc0: 7f ff ff 48 call 40018ae0 40018dc4: 94 10 20 00 clr %o2 if ( rc != RC_OK ) 40018dc8: 80 a2 20 00 cmp %o0, 0 40018dcc: 32 80 00 02 bne,a 40018dd4 <== NEVER TAKEN 40018dd0: b4 10 00 08 mov %o0, %i2 <== NOT EXECUTED rc1 = rc; freed_cls_cnt++; cur_cln = next_cln; 40018dd4: 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++; 40018dd8: 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) 40018ddc: c4 07 60 10 ld [ %i5 + 0x10 ], %g2 40018de0: c2 07 60 14 ld [ %i5 + 0x14 ], %g1 40018de4: 84 0e c0 02 and %i3, %g2, %g2 40018de8: 80 a0 80 01 cmp %g2, %g1 40018dec: 0a bf ff e5 bcs 40018d80 40018df0: 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) 40018df4: c2 07 60 44 ld [ %i5 + 0x44 ], %g1 40018df8: 80 a0 7f ff cmp %g1, -1 40018dfc: 02 80 00 05 be 40018e10 <== ALWAYS TAKEN 40018e00: f2 27 60 4c st %i1, [ %i5 + 0x4c ] fs_info->vol.free_cls += freed_cls_cnt; 40018e04: b8 07 00 01 add %i4, %g1, %i4 <== NOT EXECUTED 40018e08: f8 27 60 44 st %i4, [ %i5 + 0x44 ] <== NOT EXECUTED fat_buf_release(fs_info); 40018e0c: 90 10 00 1d mov %i5, %o0 <== NOT EXECUTED 40018e10: 7f ff e5 0e call 40012248 40018e14: b0 10 00 1a mov %i2, %i0 if (rc1 != RC_OK) return rc1; return RC_OK; } 40018e18: 81 c7 e0 08 ret 40018e1c: 81 e8 00 00 restore =============================================================================== 400132e0 : 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); 400132e0: c2 02 20 80 ld [ %o0 + 0x80 ], %g1 <== NOT EXECUTED 400132e4: c4 02 20 74 ld [ %o0 + 0x74 ], %g2 <== NOT EXECUTED 400132e8: 86 10 20 01 mov 1, %g3 <== NOT EXECUTED 400132ec: 92 22 40 01 sub %o1, %g1, %o1 <== NOT EXECUTED 400132f0: 83 32 60 03 srl %o1, 3, %g1 <== NOT EXECUTED 400132f4: 92 0a 60 07 and %o1, 7, %o1 <== NOT EXECUTED 400132f8: 93 28 c0 09 sll %g3, %o1, %o1 <== NOT EXECUTED 400132fc: c6 08 80 01 ldub [ %g2 + %g1 ], %g3 <== NOT EXECUTED 40013300: 92 28 c0 09 andn %g3, %o1, %o1 <== NOT EXECUTED 40013304: 81 c3 e0 08 retl <== NOT EXECUTED 40013308: d2 28 80 01 stb %o1, [ %g2 + %g1 ] <== NOT EXECUTED =============================================================================== 40018918 : fat_get_fat_cluster( fat_fs_info_t *fs_info, uint32_t cln, uint32_t *ret_val ) { 40018918: 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)) ) 4001891c: 80 a6 60 01 cmp %i1, 1 40018920: 08 80 00 67 bleu 40018abc <== NEVER TAKEN 40018924: ba 10 00 18 mov %i0, %i5 40018928: c2 06 20 38 ld [ %i0 + 0x38 ], %g1 4001892c: 82 00 60 01 inc %g1 40018930: 80 a6 40 01 cmp %i1, %g1 40018934: 28 80 00 03 bleu,a 40018940 <== ALWAYS TAKEN 40018938: c2 0e 20 0e ldub [ %i0 + 0xe ], %g1 4001893c: 30 80 00 60 b,a 40018abc <== NOT EXECUTED rtems_set_errno_and_return_minus_one(EIO); sec = (FAT_FAT_OFFSET(fs_info->vol.type, cln) >> fs_info->vol.sec_log2) + 40018940: 86 08 60 01 and %g1, 1, %g3 40018944: 80 88 e0 ff btst 0xff, %g3 40018948: 02 80 00 05 be 4001895c 4001894c: 88 08 60 02 and %g1, 2, %g4 40018950: 85 36 60 01 srl %i1, 1, %g2 40018954: 10 80 00 06 b 4001896c 40018958: 84 00 80 19 add %g2, %i1, %g2 4001895c: 80 89 20 ff btst 0xff, %g4 40018960: 02 80 00 03 be 4001896c 40018964: 85 2e 60 02 sll %i1, 2, %g2 40018968: 85 2e 60 01 sll %i1, 1, %g2 4001896c: f6 0f 60 02 ldub [ %i5 + 2 ], %i3 40018970: c8 07 60 58 ld [ %i5 + 0x58 ], %g4 40018974: 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); 40018978: 80 88 e0 ff btst 0xff, %g3 4001897c: 02 80 00 05 be 40018990 40018980: b6 00 80 04 add %g2, %g4, %i3 40018984: b9 36 60 01 srl %i1, 1, %i4 40018988: 10 80 00 07 b 400189a4 4001898c: b8 07 00 19 add %i4, %i1, %i4 40018990: 82 08 60 02 and %g1, 2, %g1 40018994: 80 88 60 ff btst 0xff, %g1 40018998: 02 80 00 03 be 400189a4 4001899c: b9 2e 60 02 sll %i1, 2, %i4 400189a0: b9 2e 60 01 sll %i1, 1, %i4 400189a4: e0 17 40 00 lduh [ %i5 ], %l0 rc = fat_buf_access(fs_info, sec, FAT_OP_TYPE_READ, &sec_buf); 400189a8: 90 10 00 1d mov %i5, %o0 400189ac: 92 10 00 1b mov %i3, %o1 400189b0: 94 10 20 01 mov 1, %o2 400189b4: 7f ff e6 99 call 40012418 400189b8: 96 07 bf fc add %fp, -4, %o3 if (rc != RC_OK) 400189bc: b0 92 20 00 orcc %o0, 0, %i0 400189c0: 12 80 00 37 bne 40018a9c <== NEVER TAKEN 400189c4: 83 2c 20 10 sll %l0, 0x10, %g1 return rc; switch ( fs_info->vol.type ) 400189c8: c4 0f 60 0e ldub [ %i5 + 0xe ], %g2 400189cc: 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); 400189d0: 83 30 60 10 srl %g1, 0x10, %g1 400189d4: 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 ) 400189d8: 02 80 00 27 be 40018a74 400189dc: 82 0f 00 01 and %i4, %g1, %g1 400189e0: 80 a0 a0 04 cmp %g2, 4 400189e4: 02 80 00 30 be 40018aa4 400189e8: 80 a0 a0 01 cmp %g2, 1 400189ec: 12 80 00 34 bne 40018abc <== NEVER TAKEN 400189f0: 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) ) 400189f4: 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)); 400189f8: c4 08 c0 01 ldub [ %g3 + %g1 ], %g2 if ( ofs == (fs_info->vol.bps - 1) ) 400189fc: 88 01 3f ff add %g4, -1, %g4 40018a00: 80 a0 40 04 cmp %g1, %g4 40018a04: 12 80 00 10 bne 40018a44 <== ALWAYS TAKEN 40018a08: c4 26 80 00 st %g2, [ %i2 ] { rc = fat_buf_access(fs_info, sec + 1, FAT_OP_TYPE_READ, 40018a0c: 90 10 00 1d mov %i5, %o0 <== NOT EXECUTED 40018a10: 92 06 e0 01 add %i3, 1, %o1 <== NOT EXECUTED 40018a14: 94 10 20 01 mov 1, %o2 <== NOT EXECUTED 40018a18: 7f ff e6 80 call 40012418 <== NOT EXECUTED 40018a1c: 96 07 bf fc add %fp, -4, %o3 <== NOT EXECUTED &sec_buf); if (rc != RC_OK) 40018a20: 80 a2 20 00 cmp %o0, 0 <== NOT EXECUTED 40018a24: 12 80 00 2c bne 40018ad4 <== NOT EXECUTED 40018a28: c2 07 bf fc ld [ %fp + -4 ], %g1 <== NOT EXECUTED return rc; *ret_val |= *sec_buf << 8; 40018a2c: c4 06 80 00 ld [ %i2 ], %g2 <== NOT EXECUTED 40018a30: c2 08 40 00 ldub [ %g1 ], %g1 <== NOT EXECUTED 40018a34: 83 28 60 08 sll %g1, 8, %g1 <== NOT EXECUTED 40018a38: 82 10 80 01 or %g2, %g1, %g1 <== NOT EXECUTED 40018a3c: 10 80 00 07 b 40018a58 <== NOT EXECUTED 40018a40: c2 26 80 00 st %g1, [ %i2 ] <== NOT EXECUTED } else { *ret_val |= *(sec_buf + ofs + 1) << 8; 40018a44: 82 00 c0 01 add %g3, %g1, %g1 40018a48: c2 08 60 01 ldub [ %g1 + 1 ], %g1 40018a4c: 83 28 60 08 sll %g1, 8, %g1 40018a50: 84 10 40 02 or %g1, %g2, %g2 40018a54: c4 26 80 00 st %g2, [ %i2 ] } if ( FAT_CLUSTER_IS_ODD(cln) ) 40018a58: 80 8e 60 01 btst 1, %i1 40018a5c: 02 80 00 04 be 40018a6c 40018a60: c2 06 80 00 ld [ %i2 ], %g1 *ret_val = (*ret_val) >> FAT12_SHIFT; 40018a64: 10 80 00 0d b 40018a98 40018a68: 83 30 60 04 srl %g1, 4, %g1 else *ret_val = (*ret_val) & FAT_FAT12_MASK; 40018a6c: 10 80 00 0b b 40018a98 40018a70: 82 08 6f ff and %g1, 0xfff, %g1 break; case FAT_FAT16: *ret_val = *((uint16_t *)(sec_buf + ofs)); 40018a74: c4 07 bf fc ld [ %fp + -4 ], %g2 *ret_val = CF_LE_W(*ret_val); 40018a78: 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)); 40018a7c: c2 10 80 01 lduh [ %g2 + %g1 ], %g1 *ret_val = CF_LE_W(*ret_val); 40018a80: 86 10 e3 ff or %g3, 0x3ff, %g3 40018a84: 83 28 60 10 sll %g1, 0x10, %g1 40018a88: 85 30 60 18 srl %g1, 0x18, %g2 40018a8c: 83 30 60 08 srl %g1, 8, %g1 40018a90: 82 08 40 03 and %g1, %g3, %g1 40018a94: 82 10 80 01 or %g2, %g1, %g1 40018a98: c2 26 80 00 st %g1, [ %i2 ] break; 40018a9c: 81 c7 e0 08 ret 40018aa0: 81 e8 00 00 restore case FAT_FAT32: *ret_val = *((uint32_t *)(sec_buf + ofs)); *ret_val = CF_LE_L(*ret_val); 40018aa4: c4 07 bf fc ld [ %fp + -4 ], %g2 40018aa8: 7f ff ff 90 call 400188e8 40018aac: d0 00 80 01 ld [ %g2 + %g1 ], %o0 40018ab0: d0 26 80 00 st %o0, [ %i2 ] break; 40018ab4: 81 c7 e0 08 ret 40018ab8: 81 e8 00 00 restore default: rtems_set_errno_and_return_minus_one(EIO); 40018abc: 40 00 07 84 call 4001a8cc <__errno> <== NOT EXECUTED 40018ac0: b0 10 3f ff mov -1, %i0 <== NOT EXECUTED 40018ac4: 82 10 20 05 mov 5, %g1 <== NOT EXECUTED 40018ac8: c2 22 00 00 st %g1, [ %o0 ] <== NOT EXECUTED 40018acc: 81 c7 e0 08 ret <== NOT EXECUTED 40018ad0: 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) 40018ad4: b0 10 00 08 mov %o0, %i0 <== NOT EXECUTED rtems_set_errno_and_return_minus_one(EIO); break; } return RC_OK; } 40018ad8: 81 c7 e0 08 ret <== NOT EXECUTED 40018adc: 81 e8 00 00 restore <== NOT EXECUTED =============================================================================== 40013220 : * 0 means FAILED !!! * */ uint32_t fat_get_unique_ino(fat_fs_info_t *fs_info) { 40013220: 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)) 40013224: 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) 40013228: 10 80 00 2b b 400132d4 <== NOT EXECUTED 4001322c: 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)) 40013230: c2 06 20 78 ld [ %i0 + 0x78 ], %g1 <== NOT EXECUTED 40013234: 85 30 60 03 srl %g1, 3, %g2 <== NOT EXECUTED 40013238: b6 00 c0 02 add %g3, %g2, %i3 <== NOT EXECUTED 4001323c: f4 08 c0 02 ldub [ %g3 + %g2 ], %i2 <== NOT EXECUTED 40013240: c4 48 c0 02 ldsb [ %g3 + %g2 ], %g2 <== NOT EXECUTED 40013244: ba 08 60 07 and %g1, 7, %i5 <== NOT EXECUTED 40013248: 85 38 80 1d sra %g2, %i5, %g2 <== NOT EXECUTED 4001324c: 80 88 a0 01 btst 1, %g2 <== NOT EXECUTED 40013250: 12 80 00 0a bne 40013278 <== NOT EXECUTED 40013254: 82 00 60 01 inc %g1 <== NOT EXECUTED { FAT_SET_UNIQ_INO_BUSY(fs_info->index, fs_info->uino); 40013258: 82 10 20 01 mov 1, %g1 <== NOT EXECUTED 4001325c: bb 28 40 1d sll %g1, %i5, %i5 <== NOT EXECUTED 40013260: ba 17 40 1a or %i5, %i2, %i5 <== NOT EXECUTED 40013264: fa 2e c0 00 stb %i5, [ %i3 ] <== NOT EXECUTED return (fs_info->uino_base + fs_info->index); 40013268: c4 06 20 78 ld [ %i0 + 0x78 ], %g2 <== NOT EXECUTED 4001326c: c2 06 20 80 ld [ %i0 + 0x80 ], %g1 <== NOT EXECUTED 40013270: 81 c7 e0 08 ret <== NOT EXECUTED 40013274: 91 e8 80 01 restore %g2, %g1, %o0 <== NOT EXECUTED } fs_info->index++; if (fs_info->index >= fs_info->uino_pool_size) 40013278: 80 a0 40 04 cmp %g1, %g4 <== NOT EXECUTED 4001327c: 3a 80 00 03 bcc,a 40013288 <== NOT EXECUTED 40013280: c0 26 20 78 clr [ %i0 + 0x78 ] <== NOT EXECUTED 40013284: 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++) 40013288: 92 02 60 01 inc %o1 <== NOT EXECUTED 4001328c: 80 a2 40 04 cmp %o1, %g4 <== NOT EXECUTED 40013290: 32 bf ff e8 bne,a 40013230 <== NOT EXECUTED 40013294: 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)) 40013298: c2 06 20 80 ld [ %i0 + 0x80 ], %g1 <== NOT EXECUTED 4001329c: 93 2a 60 01 sll %o1, 1, %o1 <== NOT EXECUTED 400132a0: 82 27 00 01 sub %i4, %g1, %g1 <== NOT EXECUTED 400132a4: 80 a2 40 01 cmp %o1, %g1 <== NOT EXECUTED 400132a8: 2a 80 00 04 bcs,a 400132b8 <== NOT EXECUTED 400132ac: d0 06 20 74 ld [ %i0 + 0x74 ], %o0 <== NOT EXECUTED resrc_unsuff = true; } else resrc_unsuff = true; } return 0; 400132b0: 81 c7 e0 08 ret <== NOT EXECUTED 400132b4: 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); 400132b8: 7f ff c9 fe call 40005ab0 <== NOT EXECUTED 400132bc: d2 26 20 7c st %o1, [ %i0 + 0x7c ] <== NOT EXECUTED if (fs_info->uino != NULL) 400132c0: 80 a2 20 00 cmp %o0, 0 <== NOT EXECUTED 400132c4: 02 bf ff fb be 400132b0 <== NOT EXECUTED 400132c8: d0 26 20 74 st %o0, [ %i0 + 0x74 ] <== NOT EXECUTED fs_info->index = fs_info->uino_pool_size; 400132cc: c2 06 20 7c ld [ %i0 + 0x7c ], %g1 <== NOT EXECUTED 400132d0: 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++) 400132d4: c8 06 20 7c ld [ %i0 + 0x7c ], %g4 <== NOT EXECUTED 400132d8: 10 bf ff ed b 4001328c <== NOT EXECUTED 400132dc: 92 10 20 00 clr %o1 <== NOT EXECUTED =============================================================================== 400131a8 : int fat_init_clusters_chain( fat_fs_info_t *fs_info, uint32_t start_cln ) { 400131a8: 9d e3 bf 98 save %sp, -104, %sp 400131ac: 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) 400131b0: 10 80 00 10 b 400131f0 400131b4: f2 27 bf fc st %i1, [ %fp + -4 ] { ret = fat_cluster_set(fs_info, cur_cln, 0, fs_info->vol.bpc, 0); 400131b8: 90 10 00 1d mov %i5, %o0 400131bc: 94 10 20 00 clr %o2 400131c0: 7f ff fd 0b call 400125ec 400131c4: 98 10 20 00 clr %o4 if ( ret != fs_info->vol.bpc ) 400131c8: c2 17 60 06 lduh [ %i5 + 6 ], %g1 400131cc: 80 a2 00 01 cmp %o0, %g1 400131d0: 12 80 00 11 bne 40013214 <== NEVER TAKEN 400131d4: d2 07 bf fc ld [ %fp + -4 ], %o1 { return -1; } rc = fat_get_fat_cluster(fs_info, cur_cln, &cur_cln); 400131d8: 90 10 00 1d mov %i5, %o0 400131dc: 40 00 15 cf call 40018918 400131e0: 94 07 bf fc add %fp, -4, %o2 if ( rc != RC_OK ) 400131e4: b0 92 20 00 orcc %o0, 0, %i0 400131e8: 12 80 00 0c bne 40013218 <== NEVER TAKEN 400131ec: 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) 400131f0: d2 07 bf fc ld [ %fp + -4 ], %o1 400131f4: c4 07 60 10 ld [ %i5 + 0x10 ], %g2 400131f8: c2 07 60 14 ld [ %i5 + 0x14 ], %g1 400131fc: 84 0a 40 02 and %o1, %g2, %g2 40013200: 80 a0 80 01 cmp %g2, %g1 40013204: 2a bf ff ed bcs,a 400131b8 40013208: d6 17 60 06 lduh [ %i5 + 6 ], %o3 return rc; } } return rc; 4001320c: 81 c7 e0 08 ret 40013210: 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; 40013214: b0 10 3f ff mov -1, %i0 <== NOT EXECUTED } } return rc; } 40013218: 81 c7 e0 08 ret <== NOT EXECUTED 4001321c: 81 e8 00 00 restore <== NOT EXECUTED =============================================================================== 40012838 : * 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) { 40012838: 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); 4001283c: 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) { 40012840: 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; 40012844: c0 27 bf a4 clr [ %fp + -92 ] vol->fd = open(device, O_RDWR); 40012848: 7f ff cb ff call 40005844 4001284c: 90 10 00 19 mov %i1, %o0 if (vol->fd < 0) 40012850: 80 a2 20 00 cmp %o0, 0 40012854: 06 80 00 17 bl 400128b0 <== NEVER TAKEN 40012858: d0 26 e0 60 st %o0, [ %i3 + 0x60 ] { rtems_set_errno_and_return_minus_one(ENXIO); } rc = fstat(vol->fd, &stat_buf); 4001285c: 7f ff c8 d3 call 40004ba8 40012860: 92 07 bf b8 add %fp, -72, %o1 if (rc != 0) 40012864: 80 a2 20 00 cmp %o0, 0 40012868: 12 80 00 10 bne 400128a8 <== NEVER TAKEN 4001286c: 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)) 40012870: c6 07 bf c4 ld [ %fp + -60 ], %g3 40012874: 05 00 00 3c sethi %hi(0xf000), %g2 40012878: 86 08 c0 02 and %g3, %g2, %g3 4001287c: 05 00 00 18 sethi %hi(0x6000), %g2 40012880: 80 a0 c0 02 cmp %g3, %g2 40012884: 12 80 00 09 bne 400128a8 <== NEVER TAKEN 40012888: 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); 4001288c: 94 06 20 64 add %i0, 0x64, %o2 40012890: 40 00 05 5e call 40013e08 40012894: 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) { 40012898: 80 a2 20 00 cmp %o0, 0 4001289c: 22 80 00 09 be,a 400128c0 <== ALWAYS TAKEN 400128a0: d0 06 20 64 ld [ %i0 + 0x64 ], %o0 close(vol->fd); 400128a4: d0 06 20 60 ld [ %i0 + 0x60 ], %o0 <== NOT EXECUTED 400128a8: 7f ff c8 75 call 40004a7c <== NOT EXECUTED 400128ac: 01 00 00 00 nop <== NOT EXECUTED rtems_set_errno_and_return_minus_one(ENXIO); 400128b0: 40 00 20 07 call 4001a8cc <__errno> <== NOT EXECUTED 400128b4: 01 00 00 00 nop <== NOT EXECUTED 400128b8: 10 80 01 af b 40012f74 <== NOT EXECUTED 400128bc: 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); 400128c0: 92 10 20 00 clr %o1 400128c4: 7f ff f6 9a call 4001032c 400128c8: 94 07 bf a4 add %fp, -92, %o2 if (sc != RTEMS_SUCCESSFUL) 400128cc: 80 a2 20 00 cmp %o0, 0 400128d0: 22 80 00 03 be,a 400128dc <== ALWAYS TAKEN 400128d4: d0 07 bf a4 ld [ %fp + -92 ], %o0 400128d8: 30 80 00 32 b,a 400129a0 <== NOT EXECUTED { close(vol->fd); rtems_set_errno_and_return_minus_one( EIO); } memcpy( boot_rec, block->buffer, FAT_MAX_BPB_SIZE); 400128dc: c6 02 20 1c ld [ %o0 + 0x1c ], %g3 400128e0: c2 08 e0 20 ldub [ %g3 + 0x20 ], %g1 400128e4: c4 08 e0 0b ldub [ %g3 + 0xb ], %g2 400128e8: c2 2f bf 9a stb %g1, [ %fp + -102 ] 400128ec: c2 08 e0 22 ldub [ %g3 + 0x22 ], %g1 400128f0: d2 08 e0 0c ldub [ %g3 + 0xc ], %o1 400128f4: c2 2f bf 9b stb %g1, [ %fp + -101 ] 400128f8: c2 08 e0 23 ldub [ %g3 + 0x23 ], %g1 400128fc: d8 08 e0 0e ldub [ %g3 + 0xe ], %o4 40012900: c2 2f bf 8f stb %g1, [ %fp + -113 ] 40012904: c2 08 e0 2c ldub [ %g3 + 0x2c ], %g1 40012908: d6 08 e0 0f ldub [ %g3 + 0xf ], %o3 4001290c: c2 2f bf 9e stb %g1, [ %fp + -98 ] 40012910: c2 08 e0 2d ldub [ %g3 + 0x2d ], %g1 40012914: c8 08 e0 11 ldub [ %g3 + 0x11 ], %g4 40012918: c2 2f bf 9d stb %g1, [ %fp + -99 ] 4001291c: c2 08 e0 2e ldub [ %g3 + 0x2e ], %g1 40012920: da 08 e0 12 ldub [ %g3 + 0x12 ], %o5 40012924: c2 2f bf 9c stb %g1, [ %fp + -100 ] 40012928: c2 08 e0 2f ldub [ %g3 + 0x2f ], %g1 4001292c: fa 08 e0 0d ldub [ %g3 + 0xd ], %i5 40012930: f4 08 e0 10 ldub [ %g3 + 0x10 ], %i2 40012934: e2 08 e0 13 ldub [ %g3 + 0x13 ], %l1 40012938: e4 08 e0 14 ldub [ %g3 + 0x14 ], %l2 4001293c: ee 08 e0 16 ldub [ %g3 + 0x16 ], %l7 40012940: f0 08 e0 17 ldub [ %g3 + 0x17 ], %i0 40012944: e0 08 e0 21 ldub [ %g3 + 0x21 ], %l0 40012948: e8 08 e0 24 ldub [ %g3 + 0x24 ], %l4 4001294c: ec 08 e0 25 ldub [ %g3 + 0x25 ], %l6 40012950: ea 08 e0 26 ldub [ %g3 + 0x26 ], %l5 40012954: e6 08 e0 27 ldub [ %g3 + 0x27 ], %l3 40012958: f8 08 e0 28 ldub [ %g3 + 0x28 ], %i4 4001295c: c2 2f bf 97 stb %g1, [ %fp + -105 ] 40012960: c2 08 e0 30 ldub [ %g3 + 0x30 ], %g1 40012964: f2 08 e0 31 ldub [ %g3 + 0x31 ], %i1 40012968: c2 2f bf 9f stb %g1, [ %fp + -97 ] sc = rtems_bdbuf_release( block); 4001296c: c4 27 bf 80 st %g2, [ %fp + -128 ] 40012970: c8 27 bf 7c st %g4, [ %fp + -132 ] 40012974: d2 27 bf 78 st %o1, [ %fp + -136 ] 40012978: d6 27 bf 74 st %o3, [ %fp + -140 ] 4001297c: 7f ff f6 e8 call 4001051c 40012980: d8 3f bf 68 std %o4, [ %fp + -152 ] if (sc != RTEMS_SUCCESSFUL) 40012984: c4 07 bf 80 ld [ %fp + -128 ], %g2 40012988: 80 a2 20 00 cmp %o0, 0 4001298c: c8 07 bf 7c ld [ %fp + -132 ], %g4 40012990: d2 07 bf 78 ld [ %fp + -136 ], %o1 40012994: d6 07 bf 74 ld [ %fp + -140 ], %o3 40012998: 02 80 00 08 be 400129b8 <== ALWAYS TAKEN 4001299c: d8 1f bf 68 ldd [ %fp + -152 ], %o4 { close(vol->fd); 400129a0: 7f ff c8 37 call 40004a7c <== NOT EXECUTED 400129a4: d0 06 e0 60 ld [ %i3 + 0x60 ], %o0 <== NOT EXECUTED rtems_set_errno_and_return_minus_one( EIO ); 400129a8: 40 00 1f c9 call 4001a8cc <__errno> <== NOT EXECUTED 400129ac: 01 00 00 00 nop <== NOT EXECUTED 400129b0: 10 80 01 71 b 40012f74 <== NOT EXECUTED 400129b4: 82 10 20 05 mov 5, %g1 ! 5 <== NOT EXECUTED } /* Evaluate boot record */ vol->bps = FAT_GET_BR_BYTES_PER_SECTOR(boot_rec); 400129b8: 84 08 a0 ff and %g2, 0xff, %g2 400129bc: 92 0a 60 ff and %o1, 0xff, %o1 400129c0: 93 2a 60 08 sll %o1, 8, %o1 400129c4: 92 12 40 02 or %o1, %g2, %o1 400129c8: d2 36 c0 00 sth %o1, [ %i3 ] if ( (vol->bps != 512) && 400129cc: 85 2a 60 10 sll %o1, 0x10, %g2 400129d0: 85 30 a0 10 srl %g2, 0x10, %g2 400129d4: 80 a0 a4 00 cmp %g2, 0x400 400129d8: 02 80 00 0c be 40012a08 <== NEVER TAKEN 400129dc: 86 10 00 09 mov %o1, %g3 400129e0: 80 a0 a2 00 cmp %g2, 0x200 400129e4: 22 80 00 0a be,a 40012a0c <== ALWAYS TAKEN 400129e8: 85 2a 60 10 sll %o1, 0x10, %g2 (vol->bps != 1024) && 400129ec: 80 a0 a8 00 cmp %g2, 0x800 <== NOT EXECUTED 400129f0: 02 80 00 06 be 40012a08 <== NOT EXECUTED 400129f4: 1f 00 00 04 sethi %hi(0x1000), %o7 <== NOT EXECUTED (vol->bps != 2048) && 400129f8: 80 a0 80 0f cmp %g2, %o7 <== NOT EXECUTED 400129fc: 02 80 00 04 be 40012a0c <== NOT EXECUTED 40012a00: 85 2a 60 10 sll %o1, 0x10, %g2 <== NOT EXECUTED 40012a04: 30 80 00 d6 b,a 40012d5c <== 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; 40012a08: 85 2a 60 10 sll %o1, 0x10, %g2 <== NOT EXECUTED 40012a0c: c0 2e e0 03 clrb [ %i3 + 3 ] 40012a10: 10 80 00 05 b 40012a24 40012a14: 85 30 a0 19 srl %g2, 0x19, %g2 i >>= 1, vol->sec_mul++); 40012a18: 85 38 a0 01 sra %g2, 1, %g2 <== NOT EXECUTED 40012a1c: 9e 03 e0 01 inc %o7 <== NOT EXECUTED 40012a20: 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; 40012a24: 80 88 a0 01 btst 1, %g2 40012a28: 22 bf ff fc be,a 40012a18 <== NEVER TAKEN 40012a2c: 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; 40012a30: 93 2a 60 10 sll %o1, 0x10, %o1 40012a34: c0 2e e0 02 clrb [ %i3 + 2 ] 40012a38: 93 32 60 10 srl %o1, 0x10, %o1 40012a3c: 10 80 00 05 b 40012a50 40012a40: 9e 10 00 09 mov %o1, %o7 i >>= 1, vol->sec_log2++); 40012a44: 84 00 a0 01 inc %g2 40012a48: 9f 3b e0 01 sra %o7, 1, %o7 40012a4c: 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; 40012a50: 80 8b e0 01 btst 1, %o7 40012a54: 02 bf ff fc be 40012a44 40012a58: c4 0e e0 02 ldub [ %i3 + 2 ], %g2 i >>= 1, vol->sec_log2++); vol->bytes_per_block = vol->bps; 40012a5c: c6 36 e0 0a sth %g3, [ %i3 + 0xa ] vol->bytes_per_block_log2 = vol->sec_log2; 40012a60: c4 2e e0 0c stb %g2, [ %i3 + 0xc ] vol->sectors_per_block = 1; 40012a64: 86 10 20 01 mov 1, %g3 vol->spc = FAT_GET_BR_SECTORS_PER_CLUSTER(boot_rec); 40012a68: 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) 40012a6c: 9e 8f 60 ff andcc %i5, 0xff, %o7 40012a70: 02 80 00 bb be 40012d5c <== NEVER TAKEN 40012a74: 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; 40012a78: 10 80 00 05 b 40012a8c 40012a7c: c0 2e e0 05 clrb [ %i3 + 5 ] i >>= 1, vol->spc_log2++); 40012a80: 86 00 e0 01 inc %g3 40012a84: 9f 3b e0 01 sra %o7, 1, %o7 40012a88: 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; 40012a8c: 80 8b e0 01 btst 1, %o7 40012a90: 02 bf ff fc be 40012a80 40012a94: 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) 40012a98: 87 2a 40 03 sll %o1, %g3, %g3 40012a9c: 95 28 e0 10 sll %g3, 0x10, %o2 40012aa0: 1f 20 00 00 sethi %hi(0x80000000), %o7 40012aa4: 80 a2 80 0f cmp %o2, %o7 40012aa8: 18 80 00 ad bgu 40012d5c <== NEVER TAKEN 40012aac: 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; 40012ab0: 1f 00 00 3f sethi %hi(0xfc00), %o7 40012ab4: c0 2e e0 08 clrb [ %i3 + 8 ] 40012ab8: 9e 13 e3 ff or %o7, 0x3ff, %o7 40012abc: 10 80 00 05 b 40012ad0 40012ac0: 86 08 c0 0f and %g3, %o7, %g3 i >>= 1, vol->bpc_log2++); 40012ac4: 87 38 e0 01 sra %g3, 1, %g3 40012ac8: 9e 03 e0 01 inc %o7 40012acc: 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; 40012ad0: 80 88 e0 01 btst 1, %g3 40012ad4: 22 bf ff fc be,a 40012ac4 40012ad8: de 0e e0 08 ldub [ %i3 + 8 ], %o7 i >>= 1, vol->bpc_log2++); vol->fats = FAT_GET_BR_FAT_NUM(boot_rec); 40012adc: 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)) / 40012ae0: 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); 40012ae4: 96 0a e0 ff and %o3, 0xff, %o3 40012ae8: 98 0b 20 ff and %o4, 0xff, %o4 40012aec: 97 2a e0 08 sll %o3, 8, %o3 vol->rdir_entrs = FAT_GET_BR_FILES_PER_ROOT_DIR(boot_rec); 40012af0: 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); 40012af4: 98 12 c0 0c or %o3, %o4, %o4 vol->rdir_entrs = FAT_GET_BR_FILES_PER_ROOT_DIR(boot_rec); 40012af8: 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); 40012afc: d8 36 e0 18 sth %o4, [ %i3 + 0x18 ] vol->rdir_entrs = FAT_GET_BR_FILES_PER_ROOT_DIR(boot_rec); 40012b00: 88 09 20 ff and %g4, 0xff, %g4 40012b04: 88 13 40 04 or %o5, %g4, %g4 40012b08: 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)) / 40012b0c: 89 29 20 10 sll %g4, 0x10, %g4 40012b10: c4 27 bf 80 st %g2, [ %fp + -128 ] 40012b14: 91 31 20 0b srl %g4, 0xb, %o0 40012b18: d8 27 bf 68 st %o4, [ %fp + -152 ] 40012b1c: 7f ff bf 09 call 40002740 <.div> 40012b20: 90 02 00 03 add %o0, %g3, %o0 vol->bps; vol->rdir_size = vol->rdir_secs << vol->sec_log2; 40012b24: 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)) / 40012b28: d0 26 e0 28 st %o0, [ %i3 + 0x28 ] vol->bps; vol->rdir_size = vol->rdir_secs << vol->sec_log2; 40012b2c: 85 2a 00 02 sll %o0, %g2, %g2 40012b30: c4 26 e0 2c st %g2, [ %i3 + 0x2c ] if ( (FAT_GET_BR_SECTORS_PER_FAT(boot_rec)) != 0) 40012b34: b0 0e 20 ff and %i0, 0xff, %i0 40012b38: ae 0d e0 ff and %l7, 0xff, %l7 40012b3c: 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)) / 40012b40: 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) 40012b44: ae 16 00 17 or %i0, %l7, %l7 40012b48: af 2d e0 10 sll %l7, 0x10, %l7 40012b4c: 80 a5 e0 00 cmp %l7, 0 40012b50: 02 80 00 05 be 40012b64 40012b54: d8 07 bf 68 ld [ %fp + -152 ], %o4 vol->fat_length = FAT_GET_BR_SECTORS_PER_FAT(boot_rec); 40012b58: af 35 e0 10 srl %l7, 0x10, %l7 40012b5c: 10 80 00 0c b 40012b8c 40012b60: ee 26 e0 1c st %l7, [ %i3 + 0x1c ] else vol->fat_length = FAT_GET_BR_SECTORS_PER_FAT32(boot_rec); 40012b64: ac 0d a0 ff and %l6, 0xff, %l6 40012b68: aa 0d 60 ff and %l5, 0xff, %l5 40012b6c: ad 2d a0 08 sll %l6, 8, %l6 40012b70: ab 2d 60 10 sll %l5, 0x10, %l5 40012b74: a8 0d 20 ff and %l4, 0xff, %l4 40012b78: aa 15 80 15 or %l6, %l5, %l5 40012b7c: a7 2c e0 18 sll %l3, 0x18, %l3 40012b80: a8 15 40 14 or %l5, %l4, %l4 40012b84: a6 15 00 13 or %l4, %l3, %l3 40012b88: e6 26 e0 1c st %l3, [ %i3 + 0x1c ] vol->data_fsec = vol->fat_loc + vol->fats * vol->fat_length + 40012b8c: d2 06 e0 1c ld [ %i3 + 0x1c ], %o1 40012b90: 99 2b 20 10 sll %o4, 0x10, %o4 40012b94: c6 27 bf 84 st %g3, [ %fp + -124 ] 40012b98: b1 33 20 10 srl %o4, 0x10, %i0 40012b9c: 7f ff be ad call 40002650 <.umul> 40012ba0: 90 0e a0 ff and %i2, 0xff, %o0 40012ba4: c6 07 bf 84 ld [ %fp + -124 ], %g3 40012ba8: 90 06 00 08 add %i0, %o0, %o0 40012bac: 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; 40012bb0: d0 26 e0 20 st %o0, [ %i3 + 0x20 ] if ( (FAT_GET_BR_TOTAL_SECTORS_NUM16(boot_rec)) != 0) 40012bb4: a4 0c a0 ff and %l2, 0xff, %l2 40012bb8: a2 0c 60 ff and %l1, 0xff, %l1 40012bbc: a5 2c a0 08 sll %l2, 8, %l2 40012bc0: a2 14 80 11 or %l2, %l1, %l1 40012bc4: a3 2c 60 10 sll %l1, 0x10, %l1 40012bc8: 80 a4 60 00 cmp %l1, 0 40012bcc: 02 80 00 05 be 40012be0 40012bd0: c6 26 e0 34 st %g3, [ %i3 + 0x34 ] vol->tot_secs = FAT_GET_BR_TOTAL_SECTORS_NUM16(boot_rec); 40012bd4: a3 34 60 10 srl %l1, 0x10, %l1 40012bd8: 10 80 00 0d b 40012c0c 40012bdc: e2 26 e0 30 st %l1, [ %i3 + 0x30 ] else vol->tot_secs = FAT_GET_BR_TOTAL_SECTORS_NUM32(boot_rec); 40012be0: c8 0f bf 9a ldub [ %fp + -102 ], %g4 40012be4: c4 0f bf 9b ldub [ %fp + -101 ], %g2 40012be8: c2 0f bf 8f ldub [ %fp + -113 ], %g1 40012bec: a0 0c 20 ff and %l0, 0xff, %l0 40012bf0: 85 28 a0 10 sll %g2, 0x10, %g2 40012bf4: a1 2c 20 08 sll %l0, 8, %l0 40012bf8: 84 14 00 02 or %l0, %g2, %g2 40012bfc: 84 10 80 04 or %g2, %g4, %g2 40012c00: 89 28 60 18 sll %g1, 0x18, %g4 40012c04: 84 10 80 04 or %g2, %g4, %g2 40012c08: c4 26 e0 30 st %g2, [ %i3 + 0x30 ] data_secs = vol->tot_secs - vol->data_fsec; 40012c0c: d0 06 e0 30 ld [ %i3 + 0x30 ], %o0 vol->data_cls = data_secs / vol->spc; 40012c10: 92 0f 60 ff and %i5, 0xff, %o1 40012c14: 7f ff be c9 call 40002738 <.udiv> 40012c18: 90 22 00 03 sub %o0, %g3, %o0 /* determine FAT type at least */ if ( vol->data_cls < FAT_FAT12_MAX_CLN) 40012c1c: 80 a2 2f f4 cmp %o0, 0xff4 40012c20: 18 80 00 08 bgu 40012c40 40012c24: d0 26 e0 38 st %o0, [ %i3 + 0x38 ] { vol->type = FAT_FAT12; 40012c28: 84 10 20 01 mov 1, %g2 40012c2c: c4 2e e0 0e stb %g2, [ %i3 + 0xe ] vol->mask = FAT_FAT12_MASK; 40012c30: 84 10 2f ff mov 0xfff, %g2 40012c34: c4 26 e0 10 st %g2, [ %i3 + 0x10 ] vol->eoc_val = FAT_FAT12_EOC; 40012c38: 10 80 00 0f b 40012c74 40012c3c: 84 10 2f f8 mov 0xff8, %g2 } else { if ( vol->data_cls < FAT_FAT16_MAX_CLN) 40012c40: 05 00 00 3f sethi %hi(0xfc00), %g2 40012c44: 86 10 a3 f4 or %g2, 0x3f4, %g3 ! fff4 40012c48: 80 a2 00 03 cmp %o0, %g3 40012c4c: 38 80 00 05 bgu,a 40012c60 40012c50: 84 10 20 04 mov 4, %g2 { vol->type = FAT_FAT16; 40012c54: 86 10 20 02 mov 2, %g3 40012c58: 10 80 00 04 b 40012c68 40012c5c: c6 2e e0 0e stb %g3, [ %i3 + 0xe ] vol->mask = FAT_FAT16_MASK; vol->eoc_val = FAT_FAT16_EOC; } else { vol->type = FAT_FAT32; 40012c60: c4 2e e0 0e stb %g2, [ %i3 + 0xe ] vol->mask = FAT_FAT32_MASK; 40012c64: 05 03 ff ff sethi %hi(0xffffc00), %g2 40012c68: 86 10 a3 ff or %g2, 0x3ff, %g3 ! fffffff vol->eoc_val = FAT_FAT32_EOC; 40012c6c: 84 10 a3 f8 or %g2, 0x3f8, %g2 vol->eoc_val = FAT_FAT16_EOC; } else { vol->type = FAT_FAT32; vol->mask = FAT_FAT32_MASK; 40012c70: c6 26 e0 10 st %g3, [ %i3 + 0x10 ] vol->eoc_val = FAT_FAT32_EOC; 40012c74: c4 26 e0 14 st %g2, [ %i3 + 0x14 ] } } if (vol->type == FAT_FAT32) 40012c78: c4 0e e0 0e ldub [ %i3 + 0xe ], %g2 40012c7c: 80 a0 a0 04 cmp %g2, 4 40012c80: 12 80 00 63 bne 40012e0c 40012c84: 82 10 3f ff mov -1, %g1 { vol->rdir_cl = FAT_GET_BR_FAT32_ROOT_CLUSTER(boot_rec); 40012c88: c6 0f bf 9d ldub [ %fp + -99 ], %g3 40012c8c: c4 0f bf 9c ldub [ %fp + -100 ], %g2 40012c90: 87 28 e0 08 sll %g3, 8, %g3 40012c94: 85 28 a0 10 sll %g2, 0x10, %g2 40012c98: c2 0f bf 97 ldub [ %fp + -105 ], %g1 40012c9c: 84 10 c0 02 or %g3, %g2, %g2 40012ca0: c6 0f bf 9e ldub [ %fp + -98 ], %g3 40012ca4: 84 10 80 03 or %g2, %g3, %g2 40012ca8: 87 28 60 18 sll %g1, 0x18, %g3 40012cac: 84 10 80 03 or %g2, %g3, %g2 40012cb0: c4 26 e0 3c st %g2, [ %i3 + 0x3c ] vol->mirror = FAT_GET_BR_EXT_FLAGS(boot_rec) & FAT_BR_EXT_FLAGS_MIRROR; 40012cb4: 84 0f 3f 80 and %i4, -128, %g2 if (vol->mirror) 40012cb8: 80 88 a0 80 btst 0x80, %g2 40012cbc: 02 80 00 05 be 40012cd0 <== ALWAYS TAKEN 40012cc0: c4 2e e0 54 stb %g2, [ %i3 + 0x54 ] vol->afat = FAT_GET_BR_EXT_FLAGS(boot_rec) & FAT_BR_EXT_FLAGS_FAT_NUM; 40012cc4: b8 0f 20 0f and %i4, 0xf, %i4 <== NOT EXECUTED 40012cc8: 10 80 00 03 b 40012cd4 <== NOT EXECUTED 40012ccc: f8 2e e0 5c stb %i4, [ %i3 + 0x5c ] <== NOT EXECUTED else vol->afat = 0; 40012cd0: c0 2e e0 5c clrb [ %i3 + 0x5c ] vol->info_sec = FAT_GET_BR_FAT32_FS_INFO_SECTOR(boot_rec); 40012cd4: f4 0f bf 9f ldub [ %fp + -97 ], %i2 40012cd8: b2 0e 60 ff and %i1, 0xff, %i1 40012cdc: b3 2e 60 08 sll %i1, 8, %i1 40012ce0: b4 16 40 1a or %i1, %i2, %i2 40012ce4: f4 36 e0 40 sth %i2, [ %i3 + 0x40 ] if( vol->info_sec == 0 ) 40012ce8: b5 2e a0 10 sll %i2, 0x10, %i2 40012cec: 93 36 a0 10 srl %i2, 0x10, %o1 40012cf0: 80 a2 60 00 cmp %o1, 0 40012cf4: 32 80 00 03 bne,a 40012d00 <== ALWAYS TAKEN 40012cf8: 90 10 00 1b mov %i3, %o0 40012cfc: 30 80 00 18 b,a 40012d5c <== NOT EXECUTED close(vol->fd); rtems_set_errno_and_return_minus_one( EINVAL ); } else { ret = _fat_block_read(fs_info, vol->info_sec , 0, 40012d00: 94 10 20 00 clr %o2 40012d04: 96 10 20 04 mov 4, %o3 40012d08: 7f ff fd f3 call 400124d4 <_fat_block_read> 40012d0c: 98 07 bf a8 add %fp, -88, %o4 FAT_FSI_LEADSIG_SIZE, fs_info_sector); if ( ret < 0 ) 40012d10: 80 a2 20 00 cmp %o0, 0 40012d14: 06 80 00 22 bl 40012d9c <== NEVER TAKEN 40012d18: c4 0f bf aa ldub [ %fp + -86 ], %g2 { close(vol->fd); return -1; } if (FAT_GET_FSINFO_LEAD_SIGNATURE(fs_info_sector) != 40012d1c: c6 0f bf a9 ldub [ %fp + -87 ], %g3 40012d20: 85 28 a0 10 sll %g2, 0x10, %g2 40012d24: 87 28 e0 08 sll %g3, 8, %g3 40012d28: 86 10 c0 02 or %g3, %g2, %g3 40012d2c: c4 0f bf a8 ldub [ %fp + -88 ], %g2 40012d30: 86 10 c0 02 or %g3, %g2, %g3 40012d34: c4 0f bf ab ldub [ %fp + -85 ], %g2 40012d38: 85 28 a0 18 sll %g2, 0x18, %g2 40012d3c: 86 10 c0 02 or %g3, %g2, %g3 40012d40: 05 10 58 54 sethi %hi(0x41615000), %g2 40012d44: 84 10 a2 52 or %g2, 0x252, %g2 ! 41615252 40012d48: 80 a0 c0 02 cmp %g3, %g2 40012d4c: 02 80 00 0a be 40012d74 <== ALWAYS TAKEN 40012d50: 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); 40012d54: 7f ff fd 3d call 40012248 <== NOT EXECUTED 40012d58: 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); 40012d5c: 7f ff c7 48 call 40004a7c <== NOT EXECUTED 40012d60: d0 06 e0 60 ld [ %i3 + 0x60 ], %o0 <== NOT EXECUTED rtems_set_errno_and_return_minus_one( EINVAL ); 40012d64: 40 00 1e da call 4001a8cc <__errno> <== NOT EXECUTED 40012d68: 01 00 00 00 nop <== NOT EXECUTED 40012d6c: 10 80 00 82 b 40012f74 <== NOT EXECUTED 40012d70: 82 10 20 16 mov 0x16, %g1 ! 16 <== NOT EXECUTED } else { ret = _fat_block_read(fs_info, vol->info_sec , FAT_FSI_INFO, 40012d74: d2 16 e0 40 lduh [ %i3 + 0x40 ], %o1 40012d78: 94 10 21 e4 mov 0x1e4, %o2 40012d7c: 96 10 20 0c mov 0xc, %o3 40012d80: 7f ff fd d5 call 400124d4 <_fat_block_read> 40012d84: 98 07 bf a8 add %fp, -88, %o4 FAT_USEFUL_INFO_SIZE, fs_info_sector); if ( ret < 0 ) 40012d88: 80 a2 20 00 cmp %o0, 0 40012d8c: 16 80 00 08 bge 40012dac <== ALWAYS TAKEN 40012d90: 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); 40012d94: 7f ff fd 2d call 40012248 <== NOT EXECUTED 40012d98: 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); 40012d9c: 7f ff c7 38 call 40004a7c <== NOT EXECUTED 40012da0: 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 ); 40012da4: 81 c7 e0 08 ret <== NOT EXECUTED 40012da8: 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); 40012dac: c4 0f bf ae ldub [ %fp + -82 ], %g2 40012db0: 87 28 e0 08 sll %g3, 8, %g3 40012db4: 85 28 a0 10 sll %g2, 0x10, %g2 40012db8: 84 10 c0 02 or %g3, %g2, %g2 40012dbc: c6 0f bf ac ldub [ %fp + -84 ], %g3 40012dc0: 84 10 80 03 or %g2, %g3, %g2 40012dc4: c6 0f bf af ldub [ %fp + -81 ], %g3 40012dc8: 87 28 e0 18 sll %g3, 0x18, %g3 40012dcc: 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); 40012dd0: c6 0f bf b1 ldub [ %fp + -79 ], %g3 _fat_block_release(fs_info); close(vol->fd); return -1; } vol->free_cls_in_fs_info = 40012dd4: 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; 40012dd8: c4 26 e0 44 st %g2, [ %i3 + 0x44 ] vol->next_cl_in_fs_info = FAT_GET_FSINFO_NEXT_FREE_CLUSTER(fs_info_sector); 40012ddc: c4 0f bf b2 ldub [ %fp + -78 ], %g2 40012de0: 87 28 e0 08 sll %g3, 8, %g3 40012de4: 85 28 a0 10 sll %g2, 0x10, %g2 40012de8: 84 10 c0 02 or %g3, %g2, %g2 40012dec: c6 0f bf b0 ldub [ %fp + -80 ], %g3 40012df0: 84 10 80 03 or %g2, %g3, %g2 40012df4: c6 0f bf b3 ldub [ %fp + -77 ], %g3 40012df8: 87 28 e0 18 sll %g3, 0x18, %g3 40012dfc: 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 = 40012e00: 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; 40012e04: 10 80 00 07 b 40012e20 40012e08: c4 26 e0 4c st %g2, [ %i3 + 0x4c ] } } } else { vol->rdir_cl = 0; 40012e0c: c0 26 e0 3c clr [ %i3 + 0x3c ] vol->mirror = 0; 40012e10: c0 2e e0 54 clrb [ %i3 + 0x54 ] vol->afat = 0; 40012e14: c0 2e e0 5c clrb [ %i3 + 0x5c ] vol->free_cls = FAT_UNDEFINED_VALUE; 40012e18: c2 26 e0 44 st %g1, [ %i3 + 0x44 ] vol->next_cl = FAT_UNDEFINED_VALUE; 40012e1c: 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); 40012e20: 7f ff fd 0a call 40012248 40012e24: 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; 40012e28: d2 06 e0 1c ld [ %i3 + 0x1c ], %o1 40012e2c: 7f ff be 09 call 40002650 <.umul> 40012e30: d0 0e e0 5c ldub [ %i3 + 0x5c ], %o0 40012e34: 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)); 40012e38: 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; 40012e3c: 90 02 00 02 add %o0, %g2, %o0 40012e40: 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)); 40012e44: 7f ff c6 f7 call 40004a20 40012e48: 90 10 20 02 mov 2, %o0 if ( fs_info->vhash == NULL ) 40012e4c: 80 a2 20 00 cmp %o0, 0 40012e50: 02 80 00 12 be 40012e98 <== NEVER TAKEN 40012e54: 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 ); 40012e58: 84 02 20 04 add %o0, 4, %g2 40012e5c: 86 02 20 10 add %o0, 0x10, %g3 head->next = tail; 40012e60: 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 ); 40012e64: 84 02 20 0c add %o0, 0xc, %g2 head->next = tail; head->previous = NULL; 40012e68: c0 22 20 04 clr [ %o0 + 4 ] tail->previous = head; 40012e6c: 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; 40012e70: c6 22 20 0c st %g3, [ %o0 + 0xc ] head->previous = NULL; 40012e74: c0 22 20 10 clr [ %o0 + 0x10 ] tail->previous = head; 40012e78: 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)); 40012e7c: 92 10 20 0c mov 0xc, %o1 40012e80: 7f ff c6 e8 call 40004a20 40012e84: 90 10 20 02 mov 2, %o0 if ( fs_info->rhash == NULL ) 40012e88: 80 a2 20 00 cmp %o0, 0 40012e8c: 12 80 00 06 bne 40012ea4 <== ALWAYS TAKEN 40012e90: d0 26 e0 70 st %o0, [ %i3 + 0x70 ] 40012e94: 30 80 00 1c b,a 40012f04 <== 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); 40012e98: 7f ff c6 f9 call 40004a7c <== NOT EXECUTED 40012e9c: d0 06 e0 60 ld [ %i3 + 0x60 ], %o0 <== NOT EXECUTED 40012ea0: 30 80 00 32 b,a 40012f68 <== 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 ); 40012ea4: 84 02 20 04 add %o0, 4, %g2 head->next = tail; 40012ea8: 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 ); 40012eac: 84 02 20 0c add %o0, 0xc, %g2 head->next = tail; head->previous = NULL; 40012eb0: c0 22 20 04 clr [ %o0 + 4 ] tail->previous = head; 40012eb4: c4 22 20 14 st %g2, [ %o0 + 0x14 ] 40012eb8: 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; 40012ebc: 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 ); 40012ec0: 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; 40012ec4: 84 10 21 00 mov 0x100, %g2 head->next = tail; 40012ec8: c6 22 20 0c st %g3, [ %o0 + 0xc ] 40012ecc: c4 26 e0 7c st %g2, [ %i3 + 0x7c ] fs_info->uino_base = (vol->tot_secs << vol->sec_mul) << 4; 40012ed0: c6 06 e0 30 ld [ %i3 + 0x30 ], %g3 40012ed4: c4 0e e0 03 ldub [ %i3 + 3 ], %g2 fs_info->index = 0; 40012ed8: 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; 40012edc: 85 28 c0 02 sll %g3, %g2, %g2 40012ee0: 85 28 a0 04 sll %g2, 4, %g2 fs_info->index = 0; fs_info->uino = (char *)calloc(fs_info->uino_pool_size, sizeof(char)); 40012ee4: 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; 40012ee8: c4 26 e0 80 st %g2, [ %i3 + 0x80 ] fs_info->index = 0; fs_info->uino = (char *)calloc(fs_info->uino_pool_size, sizeof(char)); 40012eec: 7f ff c6 cd call 40004a20 40012ef0: 92 10 20 01 mov 1, %o1 if ( fs_info->uino == NULL ) 40012ef4: 80 a2 20 00 cmp %o0, 0 40012ef8: 12 80 00 0d bne 40012f2c <== ALWAYS TAKEN 40012efc: d0 26 e0 74 st %o0, [ %i3 + 0x74 ] 40012f00: 30 80 00 05 b,a 40012f14 <== 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); 40012f04: 7f ff c6 de call 40004a7c <== NOT EXECUTED 40012f08: d0 06 e0 60 ld [ %i3 + 0x60 ], %o0 <== NOT EXECUTED free(fs_info->vhash); 40012f0c: 10 80 00 15 b 40012f60 <== NOT EXECUTED 40012f10: 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); 40012f14: 7f ff c6 da call 40004a7c <== NOT EXECUTED 40012f18: d0 06 e0 60 ld [ %i3 + 0x60 ], %o0 <== NOT EXECUTED free(fs_info->vhash); 40012f1c: 7f ff c6 f9 call 40004b00 <== NOT EXECUTED 40012f20: d0 06 e0 6c ld [ %i3 + 0x6c ], %o0 <== NOT EXECUTED free(fs_info->rhash); 40012f24: 10 80 00 0f b 40012f60 <== NOT EXECUTED 40012f28: 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)); 40012f2c: d0 16 c0 00 lduh [ %i3 ], %o0 40012f30: 7f ff c6 bc call 40004a20 40012f34: 92 10 20 01 mov 1, %o1 if (fs_info->sec_buf == NULL) 40012f38: 80 a2 20 00 cmp %o0, 0 40012f3c: 12 80 00 11 bne 40012f80 <== ALWAYS TAKEN 40012f40: d0 26 e0 90 st %o0, [ %i3 + 0x90 ] { close(vol->fd); 40012f44: 7f ff c6 ce call 40004a7c <== NOT EXECUTED 40012f48: d0 06 e0 60 ld [ %i3 + 0x60 ], %o0 <== NOT EXECUTED free(fs_info->vhash); 40012f4c: 7f ff c6 ed call 40004b00 <== NOT EXECUTED 40012f50: d0 06 e0 6c ld [ %i3 + 0x6c ], %o0 <== NOT EXECUTED free(fs_info->rhash); 40012f54: 7f ff c6 eb call 40004b00 <== NOT EXECUTED 40012f58: d0 06 e0 70 ld [ %i3 + 0x70 ], %o0 <== NOT EXECUTED free(fs_info->uino); 40012f5c: d0 06 e0 74 ld [ %i3 + 0x74 ], %o0 <== NOT EXECUTED 40012f60: 7f ff c6 e8 call 40004b00 <== NOT EXECUTED 40012f64: 01 00 00 00 nop <== NOT EXECUTED rtems_set_errno_and_return_minus_one( ENOMEM ); 40012f68: 40 00 1e 59 call 4001a8cc <__errno> <== NOT EXECUTED 40012f6c: 01 00 00 00 nop <== NOT EXECUTED 40012f70: 82 10 20 0c mov 0xc, %g1 ! c <== NOT EXECUTED 40012f74: c2 22 00 00 st %g1, [ %o0 ] <== NOT EXECUTED 40012f78: 81 c7 e0 08 ret <== NOT EXECUTED 40012f7c: 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; 40012f80: c4 0e e0 04 ldub [ %i3 + 4 ], %g2 40012f84: c6 06 e0 34 ld [ %i3 + 0x34 ], %g3 40012f88: 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) 40012f8c: 80 88 80 03 btst %g2, %g3 40012f90: 22 80 00 04 be,a 40012fa0 <== ALWAYS TAKEN 40012f94: 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; 40012f98: 81 c7 e0 08 ret <== NOT EXECUTED 40012f9c: 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))) 40012fa0: 80 a0 e0 04 cmp %g3, 4 40012fa4: 22 80 00 07 be,a 40012fc0 40012fa8: 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; 40012fac: 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))) 40012fb0: 80 88 80 03 btst %g2, %g3 40012fb4: 12 80 00 0f bne 40012ff0 <== NEVER TAKEN 40012fb8: b0 10 20 00 clr %i0 { sc = rtems_bdbuf_set_block_size (vol->dd, vol->bpc, true); 40012fbc: d0 06 e0 64 ld [ %i3 + 0x64 ], %o0 40012fc0: d2 16 e0 06 lduh [ %i3 + 6 ], %o1 40012fc4: 7f ff f6 78 call 400109a4 40012fc8: 94 10 20 01 mov 1, %o2 if (sc == RTEMS_SUCCESSFUL) 40012fcc: 80 a2 20 00 cmp %o0, 0 40012fd0: 12 80 00 08 bne 40012ff0 <== NEVER TAKEN 40012fd4: b0 10 20 00 clr %i0 { vol->bytes_per_block = vol->bpc; 40012fd8: c4 16 e0 06 lduh [ %i3 + 6 ], %g2 40012fdc: c4 36 e0 0a sth %g2, [ %i3 + 0xa ] vol->bytes_per_block_log2 = vol->bpc_log2; 40012fe0: c4 0e e0 08 ldub [ %i3 + 8 ], %g2 40012fe4: c4 2e e0 0c stb %g2, [ %i3 + 0xc ] vol->sectors_per_block = vol->spc; 40012fe8: c4 0e e0 04 ldub [ %i3 + 4 ], %g2 40012fec: c4 2e e0 09 stb %g2, [ %i3 + 9 ] } } return RC_OK; } 40012ff0: 81 c7 e0 08 ret 40012ff4: 81 e8 00 00 restore =============================================================================== 40018e20 : uint32_t count, uint32_t *cls_added, uint32_t *last_cl, bool zero_fill ) { 40018e20: 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; 40018e24: e8 06 20 38 ld [ %i0 + 0x38 ], %l4 bool zero_fill ) { int rc = RC_OK; uint32_t cl4find = 2; uint32_t next_cln = 0; 40018e28: 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; 40018e2c: c0 26 c0 00 clr [ %i3 ] if (count == 0) 40018e30: 80 a6 a0 00 cmp %i2, 0 40018e34: 02 80 00 7e be 4001902c <== NEVER TAKEN 40018e38: a2 10 20 00 clr %l1 return rc; if (fs_info->vol.next_cl != FAT_UNDEFINED_VALUE) 40018e3c: e0 06 20 4c ld [ %i0 + 0x4c ], %l0 40018e40: 80 a4 3f ff cmp %l0, -1 40018e44: 22 80 00 02 be,a 40018e4c 40018e48: 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; 40018e4c: a8 05 20 02 add %l4, 2, %l4 40018e50: a6 10 20 02 mov 2, %l3 40018e54: 10 80 00 5a b 40018fbc 40018e58: 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); 40018e5c: 92 10 00 10 mov %l0, %o1 40018e60: 7f ff fe ae call 40018918 40018e64: 94 07 bf fc add %fp, -4, %o2 if ( rc != RC_OK ) 40018e68: a2 92 20 00 orcc %o0, 0, %l1 40018e6c: 02 80 00 0b be 40018e98 <== ALWAYS TAKEN 40018e70: c2 07 bf fc ld [ %fp + -4 ], %g1 { if (*cls_added != 0) 40018e74: c2 06 c0 00 ld [ %i3 ], %g1 <== NOT EXECUTED 40018e78: 80 a0 60 00 cmp %g1, 0 <== NOT EXECUTED 40018e7c: 22 80 00 6d be,a 40019030 <== NOT EXECUTED 40018e80: b0 10 00 11 mov %l1, %i0 <== NOT EXECUTED fat_free_fat_clusters_chain(fs_info, (*chain)); 40018e84: d2 06 40 00 ld [ %i1 ], %o1 <== NOT EXECUTED 40018e88: 7f ff ff b7 call 40018d64 <== NOT EXECUTED 40018e8c: 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; } 40018e90: 81 c7 e0 08 ret <== NOT EXECUTED 40018e94: 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) 40018e98: 80 a0 60 00 cmp %g1, 0 40018e9c: 32 80 00 44 bne,a 40018fac 40018ea0: 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) 40018ea4: c2 06 c0 00 ld [ %i3 ], %g1 40018ea8: 80 a0 60 00 cmp %g1, 0 40018eac: 12 80 00 0e bne 40018ee4 40018eb0: 90 10 00 18 mov %i0, %o0 { *chain = cl4find; 40018eb4: e0 26 40 00 st %l0, [ %i1 ] rc = fat_set_fat_cluster(fs_info, cl4find, FAT_GENFAT_EOC); 40018eb8: 92 10 00 10 mov %l0, %o1 40018ebc: 7f ff ff 09 call 40018ae0 40018ec0: 94 10 3f ff mov -1, %o2 if ( rc != RC_OK ) 40018ec4: 80 a2 20 00 cmp %o0, 0 40018ec8: 32 80 00 59 bne,a 4001902c <== NEVER TAKEN 40018ecc: 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) 40018ed0: 80 a7 60 00 cmp %i5, 0 40018ed4: 22 80 00 18 be,a 40018f34 40018ed8: c2 06 c0 00 ld [ %i3 ], %g1 { bytes_written = fat_cluster_set (fs_info, cl4find, 0, fs_info->vol.bpc, 0); 40018edc: 10 80 00 1c b 40018f4c 40018ee0: 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); 40018ee4: 92 10 00 10 mov %l0, %o1 40018ee8: 7f ff fe fe call 40018ae0 40018eec: 94 10 3f ff mov -1, %o2 40018ef0: aa 10 00 08 mov %o0, %l5 if ( rc != RC_OK ) 40018ef4: 80 a5 60 00 cmp %l5, 0 40018ef8: 02 80 00 07 be 40018f14 <== ALWAYS TAKEN 40018efc: 90 10 00 18 mov %i0, %o0 { /* cleanup activity */ fat_free_fat_clusters_chain(fs_info, (*chain)); 40018f00: d2 06 40 00 ld [ %i1 ], %o1 <== NOT EXECUTED 40018f04: 7f ff ff 98 call 40018d64 <== NOT EXECUTED 40018f08: 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; } 40018f0c: 81 c7 e0 08 ret <== NOT EXECUTED 40018f10: 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); 40018f14: 92 10 00 12 mov %l2, %o1 40018f18: 7f ff fe f2 call 40018ae0 40018f1c: 94 10 00 10 mov %l0, %o2 if ( rc != RC_OK ) 40018f20: a4 92 20 00 orcc %o0, 0, %l2 40018f24: 02 bf ff ec be 40018ed4 <== ALWAYS TAKEN 40018f28: 80 a7 60 00 cmp %i5, 0 return RC_OK; cleanup: /* cleanup activity */ fat_free_fat_clusters_chain(fs_info, (*chain)); 40018f2c: 10 80 00 35 b 40019000 <== NOT EXECUTED 40018f30: d2 06 40 00 ld [ %i1 ], %o1 <== NOT EXECUTED goto cleanup; } } save_cln = cl4find; (*cls_added)++; 40018f34: 82 00 60 01 inc %g1 /* have we satisfied request ? */ if (*cls_added == count) 40018f38: 80 a0 40 1a cmp %g1, %i2 40018f3c: 02 80 00 0f be 40018f78 40018f40: c2 26 c0 00 st %g1, [ %i3 ] 40018f44: 10 80 00 19 b 40018fa8 40018f48: 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); 40018f4c: 90 10 00 18 mov %i0, %o0 40018f50: 92 10 00 10 mov %l0, %o1 40018f54: 94 10 20 00 clr %o2 40018f58: 7f ff e5 a5 call 400125ec 40018f5c: 98 10 20 00 clr %o4 if (fs_info->vol.bpc != bytes_written) 40018f60: c2 16 20 06 lduh [ %i0 + 6 ], %g1 40018f64: 80 a0 40 08 cmp %g1, %o0 40018f68: 22 bf ff f3 be,a 40018f34 <== ALWAYS TAKEN 40018f6c: c2 06 c0 00 ld [ %i3 ], %g1 { rc = -1; 40018f70: 10 80 00 23 b 40018ffc <== NOT EXECUTED 40018f74: 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) 40018f78: c2 06 20 44 ld [ %i0 + 0x44 ], %g1 40018f7c: 80 a0 7f ff cmp %g1, -1 40018f80: 02 80 00 05 be 40018f94 <== ALWAYS TAKEN 40018f84: e0 26 20 4c st %l0, [ %i0 + 0x4c ] fs_info->vol.free_cls -= (*cls_added); 40018f88: c4 06 c0 00 ld [ %i3 ], %g2 <== NOT EXECUTED 40018f8c: 82 20 40 02 sub %g1, %g2, %g1 <== NOT EXECUTED 40018f90: c2 26 20 44 st %g1, [ %i0 + 0x44 ] <== NOT EXECUTED *last_cl = save_cln; 40018f94: e0 27 00 00 st %l0, [ %i4 ] fat_buf_release(fs_info); 40018f98: 7f ff e4 ac call 40012248 40018f9c: 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; } 40018fa0: 81 c7 e0 08 ret 40018fa4: 91 e8 00 11 restore %g0, %l1, %o0 fat_buf_release(fs_info); return rc; } } i++; cl4find++; 40018fa8: a0 04 20 01 inc %l0 if (cl4find >= data_cls_val) 40018fac: 80 a4 00 14 cmp %l0, %l4 40018fb0: 0a 80 00 03 bcs 40018fbc <== ALWAYS TAKEN 40018fb4: a6 04 e0 01 inc %l3 cl4find = 2; 40018fb8: 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) 40018fbc: 80 a4 c0 14 cmp %l3, %l4 40018fc0: 0a bf ff a7 bcs 40018e5c <== ALWAYS TAKEN 40018fc4: 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) 40018fc8: c2 06 20 44 ld [ %i0 + 0x44 ], %g1 <== NOT EXECUTED 40018fcc: 80 a0 7f ff cmp %g1, -1 <== NOT EXECUTED 40018fd0: 02 80 00 05 be 40018fe4 <== NOT EXECUTED 40018fd4: e4 26 20 4c st %l2, [ %i0 + 0x4c ] <== NOT EXECUTED fs_info->vol.free_cls -= (*cls_added); 40018fd8: c4 06 c0 00 ld [ %i3 ], %g2 <== NOT EXECUTED 40018fdc: 82 20 40 02 sub %g1, %g2, %g1 <== NOT EXECUTED 40018fe0: c2 26 20 44 st %g1, [ %i0 + 0x44 ] <== NOT EXECUTED *last_cl = save_cln; 40018fe4: e4 27 00 00 st %l2, [ %i4 ] <== NOT EXECUTED fat_buf_release(fs_info); 40018fe8: 90 10 00 18 mov %i0, %o0 <== NOT EXECUTED 40018fec: 7f ff e4 97 call 40012248 <== NOT EXECUTED 40018ff0: 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; } 40018ff4: 81 c7 e0 08 ret <== NOT EXECUTED 40018ff8: 91 e8 00 11 restore %g0, %l1, %o0 <== NOT EXECUTED return RC_OK; cleanup: /* cleanup activity */ fat_free_fat_clusters_chain(fs_info, (*chain)); 40018ffc: d2 06 40 00 ld [ %i1 ], %o1 <== NOT EXECUTED 40019000: 7f ff ff 59 call 40018d64 <== NOT EXECUTED 40019004: 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); 40019008: 92 10 00 10 mov %l0, %o1 <== NOT EXECUTED 4001900c: 94 10 20 00 clr %o2 <== NOT EXECUTED 40019010: 7f ff fe b4 call 40018ae0 <== NOT EXECUTED 40019014: 90 10 00 18 mov %i0, %o0 <== NOT EXECUTED fat_buf_release(fs_info); 40019018: 90 10 00 18 mov %i0, %o0 <== NOT EXECUTED 4001901c: 7f ff e4 8b call 40012248 <== NOT EXECUTED 40019020: a2 10 00 12 mov %l2, %l1 <== NOT EXECUTED return rc; } 40019024: 81 c7 e0 08 ret <== NOT EXECUTED 40019028: 91 e8 00 11 restore %g0, %l1, %o0 <== NOT EXECUTED 4001902c: b0 10 00 11 mov %l1, %i0 <== NOT EXECUTED 40019030: 81 c7 e0 08 ret <== NOT EXECUTED 40019034: 81 e8 00 00 restore <== NOT EXECUTED =============================================================================== 40012554 : fat_fs_info_t *fs_info, uint32_t start, uint32_t offset, uint32_t count, const void *buff) { 40012554: 9d e3 bf 98 save %sp, -104, %sp int rc = RC_OK; ssize_t cmpltd = 0; 40012558: 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) 4001255c: 10 80 00 1b b 400125c8 40012560: a2 10 20 01 mov 1, %l1 { c = MIN(count, (fs_info->vol.bps - ofs)); 40012564: ba 27 40 1a sub %i5, %i2, %i5 40012568: 80 a7 40 1b cmp %i5, %i3 4001256c: 38 80 00 02 bgu,a 40012574 40012570: ba 10 00 1b mov %i3, %i5 if (c == fs_info->vol.bytes_per_block) 40012574: c2 16 20 0a lduh [ %i0 + 0xa ], %g1 rc = fat_buf_access(fs_info, sec_num, FAT_OP_TYPE_GET, &sec_buf); 40012578: 90 10 00 18 mov %i0, %o0 4001257c: 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) 40012580: 80 a7 40 01 cmp %i5, %g1 40012584: 02 80 00 03 be 40012590 <== NEVER TAKEN 40012588: 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); 4001258c: 94 10 20 01 mov 1, %o2 40012590: 7f ff ff a2 call 40012418 40012594: 96 07 bf fc add %fp, -4, %o3 if (rc != RC_OK) 40012598: 80 a2 20 00 cmp %o0, 0 4001259c: 12 80 00 10 bne 400125dc <== NEVER TAKEN 400125a0: d0 07 bf fc ld [ %fp + -4 ], %o0 return -1; memcpy((sec_buf + ofs), (buff + cmpltd), c); 400125a4: 92 07 00 10 add %i4, %l0, %o1 400125a8: 90 02 00 1a add %o0, %i2, %o0 400125ac: 94 10 00 1d mov %i5, %o2 400125b0: 40 00 23 6c call 4001b360 400125b4: b6 26 c0 1d sub %i3, %i5, %i3 fat_buf_mark_modified(fs_info); count -= c; cmpltd +=c; 400125b8: 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; 400125bc: e2 2e 20 88 stb %l1, [ %i0 + 0x88 ] sec_num++; 400125c0: b2 06 60 01 inc %i1 ofs = 0; 400125c4: 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) 400125c8: 80 a6 e0 00 cmp %i3, 0 400125cc: 32 bf ff e6 bne,a 40012564 400125d0: fa 16 00 00 lduh [ %i0 ], %i5 cmpltd +=c; sec_num++; ofs = 0; } return cmpltd; } 400125d4: 81 c7 e0 08 ret 400125d8: 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; 400125dc: a0 10 3f ff mov -1, %l0 <== NOT EXECUTED cmpltd +=c; sec_num++; ofs = 0; } return cmpltd; } 400125e0: b0 10 00 10 mov %l0, %i0 <== NOT EXECUTED 400125e4: 81 c7 e0 08 ret <== NOT EXECUTED 400125e8: 81 e8 00 00 restore <== NOT EXECUTED =============================================================================== 40018ae0 : fat_set_fat_cluster( fat_fs_info_t *fs_info, uint32_t cln, uint32_t in_val ) { 40018ae0: 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; 40018ae4: c0 27 bf fc clr [ %fp + -4 ] /* sanity check */ if ( (cln < 2) || (cln > (fs_info->vol.data_cls + 1)) ) 40018ae8: 80 a6 60 01 cmp %i1, 1 40018aec: 08 80 00 98 bleu 40018d4c <== NEVER TAKEN 40018af0: ba 10 00 18 mov %i0, %i5 40018af4: c2 06 20 38 ld [ %i0 + 0x38 ], %g1 40018af8: 82 00 60 01 inc %g1 40018afc: 80 a6 40 01 cmp %i1, %g1 40018b00: 28 80 00 03 bleu,a 40018b0c <== ALWAYS TAKEN 40018b04: c2 0e 20 0e ldub [ %i0 + 0xe ], %g1 40018b08: 30 80 00 91 b,a 40018d4c <== NOT EXECUTED rtems_set_errno_and_return_minus_one(EIO); sec = (FAT_FAT_OFFSET(fs_info->vol.type, cln) >> fs_info->vol.sec_log2) + 40018b0c: 84 08 60 01 and %g1, 1, %g2 40018b10: 80 88 a0 ff btst 0xff, %g2 40018b14: 02 80 00 05 be 40018b28 40018b18: 86 08 60 02 and %g1, 2, %g3 40018b1c: a1 36 60 01 srl %i1, 1, %l0 40018b20: 10 80 00 06 b 40018b38 40018b24: a0 04 00 19 add %l0, %i1, %l0 40018b28: 80 88 e0 ff btst 0xff, %g3 40018b2c: 02 80 00 03 be 40018b38 40018b30: a1 2e 60 02 sll %i1, 2, %l0 40018b34: a1 2e 60 01 sll %i1, 1, %l0 40018b38: 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); 40018b3c: 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) + 40018b40: a1 34 00 03 srl %l0, %g3, %l0 40018b44: 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); 40018b48: 02 80 00 05 be 40018b5c 40018b4c: a0 04 00 03 add %l0, %g3, %l0 40018b50: b7 36 60 01 srl %i1, 1, %i3 40018b54: 10 80 00 07 b 40018b70 40018b58: b6 06 c0 19 add %i3, %i1, %i3 40018b5c: 82 08 60 02 and %g1, 2, %g1 40018b60: 80 88 60 ff btst 0xff, %g1 40018b64: 02 80 00 03 be 40018b70 40018b68: b7 2e 60 02 sll %i1, 2, %i3 40018b6c: b7 2e 60 01 sll %i1, 1, %i3 40018b70: f8 17 40 00 lduh [ %i5 ], %i4 rc = fat_buf_access(fs_info, sec, FAT_OP_TYPE_READ, &sec_buf); 40018b74: 90 10 00 1d mov %i5, %o0 40018b78: 92 10 00 10 mov %l0, %o1 40018b7c: 94 10 20 01 mov 1, %o2 40018b80: 7f ff e6 26 call 40012418 40018b84: 96 07 bf fc add %fp, -4, %o3 if (rc != RC_OK) 40018b88: b0 92 20 00 orcc %o0, 0, %i0 40018b8c: 12 80 00 4c bne 40018cbc <== NEVER TAKEN 40018b90: 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); 40018b94: b9 37 20 10 srl %i4, 0x10, %i4 40018b98: b8 07 3f ff add %i4, -1, %i4 40018b9c: 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 ) 40018ba0: f6 0f 60 0e ldub [ %i5 + 0xe ], %i3 40018ba4: 80 a6 e0 02 cmp %i3, 2 40018ba8: 02 80 00 53 be 40018cf4 40018bac: 80 a6 e0 04 cmp %i3, 4 40018bb0: 02 80 00 5b be 40018d1c 40018bb4: 80 a6 e0 01 cmp %i3, 1 40018bb8: 12 80 00 65 bne 40018d4c <== NEVER TAKEN 40018bbc: 80 8e 60 01 btst 1, %i1 { case FAT_FAT12: if ( FAT_CLUSTER_IS_ODD(cln) ) 40018bc0: 02 80 00 23 be 40018c4c 40018bc4: c2 07 bf fc ld [ %fp + -4 ], %g1 { fat16_clv = ((uint16_t )in_val) << FAT_FAT12_SHIFT; *(sec_buf + ofs) &= 0x0F; 40018bc8: c4 08 40 1c ldub [ %g1 + %i4 ], %g2 40018bcc: 84 08 a0 0f and %g2, 0xf, %g2 40018bd0: c4 28 40 1c stb %g2, [ %g1 + %i4 ] *(sec_buf + ofs) |= (uint8_t)(fat16_clv & 0x00F0); 40018bd4: c2 07 bf fc ld [ %fp + -4 ], %g1 40018bd8: 85 2e a0 04 sll %i2, 4, %g2 40018bdc: c6 08 40 1c ldub [ %g1 + %i4 ], %g3 40018be0: 84 10 c0 02 or %g3, %g2, %g2 40018be4: c4 28 40 1c stb %g2, [ %g1 + %i4 ] fat_buf_mark_modified(fs_info); if ( ofs == (fs_info->vol.bps - 1) ) 40018be8: c2 17 40 00 lduh [ %i5 ], %g1 40018bec: 82 00 7f ff add %g1, -1, %g1 40018bf0: 80 a7 00 01 cmp %i4, %g1 40018bf4: 12 80 00 0f bne 40018c30 <== ALWAYS TAKEN 40018bf8: f6 2f 60 88 stb %i3, [ %i5 + 0x88 ] { rc = fat_buf_access(fs_info, sec + 1, FAT_OP_TYPE_READ, 40018bfc: 90 10 00 1d mov %i5, %o0 <== NOT EXECUTED 40018c00: 92 04 20 01 add %l0, 1, %o1 <== NOT EXECUTED 40018c04: 94 10 20 01 mov 1, %o2 <== NOT EXECUTED 40018c08: 7f ff e6 04 call 40012418 <== NOT EXECUTED 40018c0c: 96 07 bf fc add %fp, -4, %o3 <== NOT EXECUTED &sec_buf); if (rc != RC_OK) 40018c10: b0 92 20 00 orcc %o0, 0, %i0 <== NOT EXECUTED 40018c14: 12 80 00 2a bne 40018cbc <== NOT EXECUTED 40018c18: c2 07 bf fc ld [ %fp + -4 ], %g1 <== NOT EXECUTED return rc; *sec_buf &= 0x00; *sec_buf |= (uint8_t)((fat16_clv & 0xFF00)>>8); 40018c1c: 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; 40018c20: c0 28 40 00 clrb [ %g1 ] <== NOT EXECUTED *sec_buf |= (uint8_t)((fat16_clv & 0xFF00)>>8); 40018c24: b5 36 a0 18 srl %i2, 0x18, %i2 <== NOT EXECUTED 40018c28: 10 80 00 21 b 40018cac <== NOT EXECUTED 40018c2c: c2 07 bf fc ld [ %fp + -4 ], %g1 <== NOT EXECUTED fat_buf_mark_modified(fs_info); } else { *(sec_buf + ofs + 1) &= 0x00; 40018c30: c2 07 bf fc ld [ %fp + -4 ], %g1 40018c34: b8 07 20 01 inc %i4 *(sec_buf + ofs + 1) |= (uint8_t )((fat16_clv & 0xFF00)>>8); 40018c38: b5 2e a0 14 sll %i2, 0x14, %i2 fat_buf_mark_modified(fs_info); } else { *(sec_buf + ofs + 1) &= 0x00; 40018c3c: c0 28 40 1c clrb [ %g1 + %i4 ] *(sec_buf + ofs + 1) |= (uint8_t )((fat16_clv & 0xFF00)>>8); 40018c40: b5 36 a0 18 srl %i2, 0x18, %i2 40018c44: 10 80 00 27 b 40018ce0 40018c48: c2 07 bf fc ld [ %fp + -4 ], %g1 } } else { fat16_clv = ((uint16_t )in_val) & FAT_FAT12_MASK; *(sec_buf + ofs) &= 0x00; 40018c4c: c0 28 40 1c clrb [ %g1 + %i4 ] *(sec_buf + ofs) |= (uint8_t)(fat16_clv & 0x00FF); 40018c50: 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; 40018c54: b4 0e af ff and %i2, 0xfff, %i2 *(sec_buf + ofs) &= 0x00; *(sec_buf + ofs) |= (uint8_t)(fat16_clv & 0x00FF); 40018c58: c4 08 40 1c ldub [ %g1 + %i4 ], %g2 40018c5c: 84 10 80 1a or %g2, %i2, %g2 40018c60: c4 28 40 1c stb %g2, [ %g1 + %i4 ] fat_buf_mark_modified(fs_info); if ( ofs == (fs_info->vol.bps - 1) ) 40018c64: c2 17 40 00 lduh [ %i5 ], %g1 40018c68: 82 00 7f ff add %g1, -1, %g1 40018c6c: 80 a7 00 01 cmp %i4, %g1 40018c70: 12 80 00 15 bne 40018cc4 <== ALWAYS TAKEN 40018c74: f6 2f 60 88 stb %i3, [ %i5 + 0x88 ] { rc = fat_buf_access(fs_info, sec + 1, FAT_OP_TYPE_READ, 40018c78: 90 10 00 1d mov %i5, %o0 <== NOT EXECUTED 40018c7c: 92 04 20 01 add %l0, 1, %o1 <== NOT EXECUTED 40018c80: 94 10 20 01 mov 1, %o2 <== NOT EXECUTED 40018c84: 7f ff e5 e5 call 40012418 <== NOT EXECUTED 40018c88: 96 07 bf fc add %fp, -4, %o3 <== NOT EXECUTED &sec_buf); if (rc != RC_OK) 40018c8c: b0 92 20 00 orcc %o0, 0, %i0 <== NOT EXECUTED 40018c90: 12 80 00 0b bne 40018cbc <== NOT EXECUTED 40018c94: c2 07 bf fc ld [ %fp + -4 ], %g1 <== NOT EXECUTED return rc; *sec_buf &= 0xF0; *sec_buf |= (uint8_t)((fat16_clv & 0xFF00)>>8); 40018c98: 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; 40018c9c: c4 08 40 00 ldub [ %g1 ], %g2 <== NOT EXECUTED 40018ca0: 84 08 bf f0 and %g2, -16, %g2 <== NOT EXECUTED 40018ca4: c4 28 40 00 stb %g2, [ %g1 ] <== NOT EXECUTED *sec_buf |= (uint8_t)((fat16_clv & 0xFF00)>>8); 40018ca8: c2 07 bf fc ld [ %fp + -4 ], %g1 <== NOT EXECUTED 40018cac: c4 08 40 00 ldub [ %g1 ], %g2 <== NOT EXECUTED 40018cb0: b4 16 80 02 or %i2, %g2, %i2 <== NOT EXECUTED 40018cb4: 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; 40018cb8: f6 2f 60 88 stb %i3, [ %i5 + 0x88 ] <== NOT EXECUTED 40018cbc: 81 c7 e0 08 ret <== NOT EXECUTED 40018cc0: 81 e8 00 00 restore <== NOT EXECUTED fat_buf_mark_modified(fs_info); } else { *(sec_buf + ofs + 1) &= 0xF0; 40018cc4: c2 07 bf fc ld [ %fp + -4 ], %g1 40018cc8: b8 07 20 01 inc %i4 40018ccc: c4 08 40 1c ldub [ %g1 + %i4 ], %g2 *(sec_buf + ofs+1) |= (uint8_t)((fat16_clv & 0xFF00)>>8); 40018cd0: b5 36 a0 08 srl %i2, 8, %i2 fat_buf_mark_modified(fs_info); } else { *(sec_buf + ofs + 1) &= 0xF0; 40018cd4: 84 08 bf f0 and %g2, -16, %g2 40018cd8: c4 28 40 1c stb %g2, [ %g1 + %i4 ] *(sec_buf + ofs+1) |= (uint8_t)((fat16_clv & 0xFF00)>>8); 40018cdc: c2 07 bf fc ld [ %fp + -4 ], %g1 40018ce0: c4 08 40 1c ldub [ %g1 + %i4 ], %g2 40018ce4: b4 10 80 1a or %g2, %i2, %i2 40018ce8: f4 28 40 1c stb %i2, [ %g1 + %i4 ] 40018cec: 81 c7 e0 08 ret 40018cf0: 81 e8 00 00 restore break; } return RC_OK; } 40018cf4: 03 00 00 3f sethi %hi(0xfc00), %g1 40018cf8: 82 10 63 ff or %g1, 0x3ff, %g1 ! ffff 40018cfc: 82 0e 80 01 and %i2, %g1, %g1 } break; case FAT_FAT16: *((uint16_t *)(sec_buf + ofs)) = (uint16_t )(CT_LE_W(in_val)); 40018d00: 83 28 60 08 sll %g1, 8, %g1 40018d04: b5 2e a0 10 sll %i2, 0x10, %i2 40018d08: b5 36 a0 18 srl %i2, 0x18, %i2 40018d0c: b4 10 40 1a or %g1, %i2, %i2 } } break; case FAT_FAT16: *((uint16_t *)(sec_buf + ofs)) = 40018d10: c2 07 bf fc ld [ %fp + -4 ], %g1 40018d14: 10 80 00 0a b 40018d3c 40018d18: 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)); 40018d1c: 11 3c 00 00 sethi %hi(0xf0000000), %o0 40018d20: 7f ff fe f2 call 400188e8 40018d24: 90 2e 80 08 andn %i2, %o0, %o0 *((uint32_t *)(sec_buf + ofs)) &= CT_LE_L(0xF0000000); 40018d28: c2 07 bf fc ld [ %fp + -4 ], %g1 40018d2c: c4 00 40 1c ld [ %g1 + %i4 ], %g2 40018d30: 84 08 a0 f0 and %g2, 0xf0, %g2 *((uint32_t *)(sec_buf + ofs)) |= fat32_clv; 40018d34: 90 12 00 02 or %o0, %g2, %o0 40018d38: d0 20 40 1c st %o0, [ %g1 + %i4 ] 40018d3c: 82 10 20 01 mov 1, %g1 40018d40: c2 2f 60 88 stb %g1, [ %i5 + 0x88 ] 40018d44: 81 c7 e0 08 ret 40018d48: 81 e8 00 00 restore fat_buf_mark_modified(fs_info); break; default: rtems_set_errno_and_return_minus_one(EIO); 40018d4c: 40 00 06 e0 call 4001a8cc <__errno> <== NOT EXECUTED 40018d50: b0 10 3f ff mov -1, %i0 <== NOT EXECUTED 40018d54: 82 10 20 05 mov 5, %g1 <== NOT EXECUTED 40018d58: c2 22 00 00 st %g1, [ %o0 ] <== NOT EXECUTED break; } return RC_OK; } 40018d5c: 81 c7 e0 08 ret <== NOT EXECUTED 40018d60: 81 e8 00 00 restore <== NOT EXECUTED =============================================================================== 400130c8 : * RC_OK on success, or -1 if error occured * and errno set appropriately */ int fat_shutdown_drive(fat_fs_info_t *fs_info) { 400130c8: 9d e3 bf a0 save %sp, -96, %sp int rc = RC_OK; int i = 0; rc = fat_sync(fs_info); 400130cc: 90 10 00 18 mov %i0, %o0 400130d0: 7f ff ff ca call 40012ff8 400130d4: ba 10 00 18 mov %i0, %i5 if ( rc != RC_OK ) 400130d8: b0 92 20 00 orcc %o0, 0, %i0 400130dc: 32 80 00 02 bne,a 400130e4 <== NEVER TAKEN 400130e0: b0 10 3f ff mov -1, %i0 <== NOT EXECUTED rc = -1; 400130e4: 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; 400130e8: f6 07 60 6c ld [ %i5 + 0x6c ], %i3 while ( (node = rtems_chain_get(the_chain)) != NULL ) 400130ec: 10 80 00 04 b 400130fc 400130f0: b6 06 c0 1c add %i3, %i4, %i3 free(node); 400130f4: 7f ff c6 83 call 40004b00 400130f8: 01 00 00 00 nop */ RTEMS_INLINE_ROUTINE rtems_chain_node *rtems_chain_get( rtems_chain_control *the_chain ) { return _Chain_Get( the_chain ); 400130fc: 7f ff da 5e call 40009a74 <_Chain_Get> 40013100: 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 ) 40013104: 80 a2 20 00 cmp %o0, 0 40013108: 12 bf ff fb bne 400130f4 4001310c: 01 00 00 00 nop 40013110: 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++) 40013114: 80 a7 20 18 cmp %i4, 0x18 40013118: 32 bf ff f5 bne,a 400130ec 4001311c: f6 07 60 6c ld [ %i5 + 0x6c ], %i3 40013120: 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; 40013124: f6 07 60 70 ld [ %i5 + 0x70 ], %i3 while ( (node = rtems_chain_get(the_chain)) != NULL ) 40013128: 10 80 00 04 b 40013138 4001312c: b6 06 c0 1c add %i3, %i4, %i3 free(node); 40013130: 7f ff c6 74 call 40004b00 <== NOT EXECUTED 40013134: 01 00 00 00 nop <== NOT EXECUTED 40013138: 7f ff da 4f call 40009a74 <_Chain_Get> 4001313c: 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 ) 40013140: 80 a2 20 00 cmp %o0, 0 40013144: 12 bf ff fb bne 40013130 <== NEVER TAKEN 40013148: 01 00 00 00 nop 4001314c: 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++) 40013150: 80 a7 20 18 cmp %i4, 0x18 40013154: 32 bf ff f5 bne,a 40013128 40013158: f6 07 60 70 ld [ %i5 + 0x70 ], %i3 while ( (node = rtems_chain_get(the_chain)) != NULL ) free(node); } free(fs_info->vhash); 4001315c: 7f ff c6 69 call 40004b00 40013160: d0 07 60 6c ld [ %i5 + 0x6c ], %o0 free(fs_info->rhash); 40013164: 7f ff c6 67 call 40004b00 40013168: d0 07 60 70 ld [ %i5 + 0x70 ], %o0 free(fs_info->uino); 4001316c: 7f ff c6 65 call 40004b00 40013170: d0 07 60 74 ld [ %i5 + 0x74 ], %o0 free(fs_info->sec_buf); 40013174: 7f ff c6 63 call 40004b00 40013178: d0 07 60 90 ld [ %i5 + 0x90 ], %o0 close(fs_info->vol.fd); 4001317c: 7f ff c6 40 call 40004a7c 40013180: d0 07 60 60 ld [ %i5 + 0x60 ], %o0 if (rc) 40013184: 80 a6 20 00 cmp %i0, 0 40013188: 02 80 00 06 be 400131a0 <== ALWAYS TAKEN 4001318c: 01 00 00 00 nop errno = EIO; 40013190: 40 00 1d cf call 4001a8cc <__errno> <== NOT EXECUTED 40013194: 01 00 00 00 nop <== NOT EXECUTED 40013198: 82 10 20 05 mov 5, %g1 ! 5 <== NOT EXECUTED 4001319c: c2 22 00 00 st %g1, [ %o0 ] <== NOT EXECUTED return rc; } 400131a0: 81 c7 e0 08 ret 400131a4: 81 e8 00 00 restore =============================================================================== 40012ff8 : return RC_OK; } int fat_sync(fat_fs_info_t *fs_info) { 40012ff8: 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) 40012ffc: c4 0e 20 0e ldub [ %i0 + 0xe ], %g2 return RC_OK; } int fat_sync(fat_fs_info_t *fs_info) { 40013000: 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; 40013004: 90 10 20 00 clr %o0 if (fs_info->vol.type == FAT_FAT32) 40013008: 80 a0 a0 04 cmp %g2, 4 4001300c: 12 80 00 20 bne 4001308c 40013010: b4 10 20 00 clr %i2 { uint32_t free_count = fs_info->vol.free_cls; 40013014: 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) 40013018: c2 06 20 48 ld [ %i0 + 0x48 ], %g1 4001301c: 80 a6 c0 01 cmp %i3, %g1 40013020: 02 80 00 0d be 40013054 <== ALWAYS TAKEN 40013024: f8 06 20 4c ld [ %i0 + 0x4c ], %i4 { uint32_t le_free_count = CT_LE_L(free_count); 40013028: 7f ff fc 65 call 400121bc <== NOT EXECUTED 4001302c: 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, 40013030: 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); 40013034: d0 27 bf fc st %o0, [ %fp + -4 ] <== NOT EXECUTED fs_info->vol.free_cls_in_fs_info = free_count; 40013038: f6 26 20 48 st %i3, [ %i0 + 0x48 ] <== NOT EXECUTED ret1 = fat_sector_write(fs_info, 4001303c: 90 10 00 18 mov %i0, %o0 <== NOT EXECUTED 40013040: 94 10 21 e8 mov 0x1e8, %o2 <== NOT EXECUTED 40013044: 96 10 20 04 mov 4, %o3 <== NOT EXECUTED 40013048: 7f ff fd 43 call 40012554 <== NOT EXECUTED 4001304c: 98 07 bf fc add %fp, -4, %o4 <== NOT EXECUTED 40013050: 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) 40013054: c4 07 60 50 ld [ %i5 + 0x50 ], %g2 40013058: 80 a7 00 02 cmp %i4, %g2 4001305c: 02 80 00 0c be 4001308c <== NEVER TAKEN 40013060: 90 10 20 00 clr %o0 { uint32_t le_next_free = CT_LE_L(next_free); 40013064: 7f ff fc 56 call 400121bc 40013068: 90 10 00 1c mov %i4, %o0 fs_info->vol.next_cl_in_fs_info = next_free; ret2 = fat_sector_write(fs_info, 4001306c: 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); 40013070: d0 27 bf fc st %o0, [ %fp + -4 ] fs_info->vol.next_cl_in_fs_info = next_free; 40013074: f8 27 60 50 st %i4, [ %i5 + 0x50 ] ret2 = fat_sector_write(fs_info, 40013078: 90 10 00 1d mov %i5, %o0 4001307c: 94 10 21 ec mov 0x1ec, %o2 40013080: 96 10 20 04 mov 4, %o3 40013084: 7f ff fd 34 call 40012554 40013088: 98 07 bf fc add %fp, -4, %o4 sizeof(le_next_free), &le_next_free); } } if ( (ret1 < 0) || (ret2 < 0) ) 4001308c: 80 a2 20 00 cmp %o0, 0 40013090: 06 80 00 04 bl 400130a0 <== NEVER TAKEN 40013094: 80 a6 a0 00 cmp %i2, 0 40013098: 16 80 00 03 bge 400130a4 <== ALWAYS TAKEN 4001309c: b0 10 20 00 clr %i0 { int rc = RC_OK; rc = fat_fat32_update_fsinfo_sector(fs_info); if ( rc != RC_OK ) rc = -1; 400130a0: b0 10 3f ff mov -1, %i0 <== NOT EXECUTED fat_buf_release(fs_info); 400130a4: 7f ff fc 69 call 40012248 400130a8: 90 10 00 1d mov %i5, %o0 if (rtems_bdbuf_syncdev(fs_info->vol.dd) != RTEMS_SUCCESSFUL) 400130ac: 7f ff f5 bb call 40010798 400130b0: d0 07 60 64 ld [ %i5 + 0x64 ], %o0 400130b4: 80 a2 20 00 cmp %o0, 0 400130b8: 32 80 00 02 bne,a 400130c0 <== NEVER TAKEN 400130bc: b0 10 3f ff mov -1, %i0 <== NOT EXECUTED rc = -1; return rc; } 400130c0: 81 c7 e0 08 ret 400130c4: 81 e8 00 00 restore =============================================================================== 40031e84 : /** * compatible with SVr4, 4.4BSD and X/OPEN - Change Directory */ int fchdir( int fd ) { 40031e84: 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 ); 40031e88: 03 10 01 7b sethi %hi(0x4005ec00), %g1 <== NOT EXECUTED 40031e8c: c2 00 63 40 ld [ %g1 + 0x340 ], %g1 ! 4005ef40 <== NOT EXECUTED int rv = 0; rtems_libio_t *iop; struct stat st; rtems_filesystem_location_info_t loc; st.st_mode = 0; 40031e90: c0 27 bf c4 clr [ %fp + -60 ] <== NOT EXECUTED st.st_uid = 0; 40031e94: c0 37 bf ca clrh [ %fp + -54 ] <== NOT EXECUTED st.st_gid = 0; rtems_libio_check_fd( fd ); 40031e98: 80 a6 00 01 cmp %i0, %g1 <== NOT EXECUTED 40031e9c: 1a 80 00 0c bcc 40031ecc <== NOT EXECUTED 40031ea0: c0 37 bf cc clrh [ %fp + -52 ] <== NOT EXECUTED iop = rtems_libio_iop( fd ); 40031ea4: 83 2e 20 03 sll %i0, 3, %g1 <== NOT EXECUTED 40031ea8: b1 2e 20 06 sll %i0, 6, %i0 <== NOT EXECUTED 40031eac: b0 26 00 01 sub %i0, %g1, %i0 <== NOT EXECUTED 40031eb0: 03 10 01 8c sethi %hi(0x40063000), %g1 <== NOT EXECUTED 40031eb4: fa 00 60 2c ld [ %g1 + 0x2c ], %i5 ! 4006302c <== NOT EXECUTED 40031eb8: ba 07 40 18 add %i5, %i0, %i5 <== NOT EXECUTED rtems_libio_check_is_open( iop ); 40031ebc: c2 07 60 10 ld [ %i5 + 0x10 ], %g1 <== NOT EXECUTED 40031ec0: 80 88 61 00 btst 0x100, %g1 <== NOT EXECUTED 40031ec4: 32 80 00 08 bne,a 40031ee4 <== NOT EXECUTED 40031ec8: d0 07 60 28 ld [ %i5 + 0x28 ], %o0 <== NOT EXECUTED 40031ecc: 40 00 10 d5 call 40036220 <__errno> <== NOT EXECUTED 40031ed0: b0 10 3f ff mov -1, %i0 <== NOT EXECUTED 40031ed4: 82 10 20 09 mov 9, %g1 <== NOT EXECUTED 40031ed8: c2 22 00 00 st %g1, [ %o0 ] <== NOT EXECUTED 40031edc: 81 c7 e0 08 ret <== NOT EXECUTED 40031ee0: 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 ); 40031ee4: c2 02 20 0c ld [ %o0 + 0xc ], %g1 <== NOT EXECUTED 40031ee8: c2 00 40 00 ld [ %g1 ], %g1 <== NOT EXECUTED 40031eec: 9f c0 40 00 call %g1 <== NOT EXECUTED 40031ef0: 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 ); 40031ef4: c2 07 60 24 ld [ %i5 + 0x24 ], %g1 <== NOT EXECUTED 40031ef8: 90 10 00 1c mov %i4, %o0 <== NOT EXECUTED 40031efc: c2 00 60 18 ld [ %g1 + 0x18 ], %g1 <== NOT EXECUTED 40031f00: 9f c0 40 00 call %g1 <== NOT EXECUTED 40031f04: 92 07 bf b8 add %fp, -72, %o1 <== NOT EXECUTED if ( rv == 0 ) { 40031f08: b0 92 20 00 orcc %o0, 0, %i0 <== NOT EXECUTED 40031f0c: 32 80 00 13 bne,a 40031f58 <== NOT EXECUTED 40031f10: d0 07 60 28 ld [ %i5 + 0x28 ], %o0 <== NOT EXECUTED bool access_ok = rtems_filesystem_check_access( 40031f14: d2 07 bf c4 ld [ %fp + -60 ], %o1 <== NOT EXECUTED 40031f18: d4 17 bf ca lduh [ %fp + -54 ], %o2 <== NOT EXECUTED 40031f1c: d6 17 bf cc lduh [ %fp + -52 ], %o3 <== NOT EXECUTED 40031f20: 7f ff 6d e9 call 4000d6c4 <== NOT EXECUTED 40031f24: 90 10 20 01 mov 1, %o0 <== NOT EXECUTED st.st_mode, st.st_uid, st.st_gid ); if ( access_ok ) { 40031f28: 80 8a 20 ff btst 0xff, %o0 <== NOT EXECUTED 40031f2c: 02 80 00 06 be 40031f44 <== NOT EXECUTED 40031f30: 90 07 bf a0 add %fp, -96, %o0 <== NOT EXECUTED rtems_filesystem_location_clone( &loc, &iop->pathinfo ); 40031f34: 7f ff 6c 50 call 4000d074 <== NOT EXECUTED 40031f38: 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; 40031f3c: 10 80 00 07 b 40031f58 <== NOT EXECUTED 40031f40: d0 07 60 28 ld [ %i5 + 0x28 ], %o0 <== NOT EXECUTED } else { errno = EACCES; 40031f44: 40 00 10 b7 call 40036220 <__errno> <== NOT EXECUTED 40031f48: b0 10 3f ff mov -1, %i0 <== NOT EXECUTED 40031f4c: 82 10 20 0d mov 0xd, %g1 <== NOT EXECUTED 40031f50: c2 22 00 00 st %g1, [ %o0 ] <== NOT EXECUTED 40031f54: d0 07 60 28 ld [ %i5 + 0x28 ], %o0 <== NOT EXECUTED (*mt_entry->ops->unlock_h)( mt_entry ); 40031f58: c2 02 20 0c ld [ %o0 + 0xc ], %g1 <== NOT EXECUTED 40031f5c: c2 00 60 04 ld [ %g1 + 4 ], %g1 <== NOT EXECUTED 40031f60: 9f c0 40 00 call %g1 <== NOT EXECUTED 40031f64: 01 00 00 00 nop <== NOT EXECUTED rv = -1; } } rtems_filesystem_instance_unlock( &iop->pathinfo ); if ( rv == 0 ) { 40031f68: 80 a6 20 00 cmp %i0, 0 <== NOT EXECUTED 40031f6c: 12 80 00 05 bne 40031f80 <== NOT EXECUTED 40031f70: 01 00 00 00 nop <== NOT EXECUTED rv = rtems_filesystem_chdir( &loc ); 40031f74: 7f ff c3 1d call 40022be8 <== NOT EXECUTED 40031f78: 90 07 bf a0 add %fp, -96, %o0 <== NOT EXECUTED 40031f7c: b0 10 00 08 mov %o0, %i0 <== NOT EXECUTED } return rv; } 40031f80: 81 c7 e0 08 ret <== NOT EXECUTED 40031f84: 81 e8 00 00 restore <== NOT EXECUTED 40031f88: 40 03 20 30 call 400fa048 <__end+0x96118> <== NOT EXECUTED 40031f8c: 40 03 21 0c call 400fa3bc <__end+0x9648c> <== NOT EXECUTED 40031f90: 40 03 21 18 call 400fa3f0 <__end+0x964c0> <== NOT EXECUTED 40031f94: 40 03 21 30 call 400fa454 <__end+0x96524> <== NOT EXECUTED 40031f98: 40 03 21 40 call 400fa498 <__end+0x96568> <== NOT EXECUTED 40031f9c: 40 03 21 64 call 400fa52c <__end+0x965fc> <== NOT EXECUTED 40031fa0: 40 03 21 64 call 400fa530 <__end+0x96600> <== NOT EXECUTED 40031fa4: 40 03 21 64 call 400fa534 <__end+0x96604> <== NOT EXECUTED 40031fa8: 40 03 21 64 call 400fa538 <__end+0x96608> <== NOT EXECUTED 40031fac: 40 03 21 64 call 400fa53c <__end+0x9660c> <== NOT EXECUTED =============================================================================== 40023140 : /** * POSIX 1003.1b 5.6.4 - Change File Modes */ int fchmod( int fd, mode_t mode ) { 40023140: 9d e3 bf a0 save %sp, -96, %sp int rv; rtems_libio_t *iop; rtems_libio_check_fd( fd ); 40023144: 03 10 01 7b sethi %hi(0x4005ec00), %g1 40023148: c2 00 63 40 ld [ %g1 + 0x340 ], %g1 ! 4005ef40 4002314c: 80 a6 00 01 cmp %i0, %g1 40023150: 2a 80 00 03 bcs,a 4002315c 40023154: 83 2e 20 03 sll %i0, 3, %g1 40023158: 30 80 00 0a b,a 40023180 iop = rtems_libio_iop( fd ); 4002315c: b1 2e 20 06 sll %i0, 6, %i0 40023160: b0 26 00 01 sub %i0, %g1, %i0 40023164: 03 10 01 8c sethi %hi(0x40063000), %g1 40023168: fa 00 60 2c ld [ %g1 + 0x2c ], %i5 ! 4006302c 4002316c: ba 07 40 18 add %i5, %i0, %i5 rtems_libio_check_is_open(iop); 40023170: c2 07 60 10 ld [ %i5 + 0x10 ], %g1 40023174: 80 88 61 00 btst 0x100, %g1 40023178: 32 80 00 06 bne,a 40023190 4002317c: d0 07 60 28 ld [ %i5 + 0x28 ], %o0 40023180: 40 00 4c 28 call 40036220 <__errno> 40023184: 01 00 00 00 nop 40023188: 10 80 00 1b b 400231f4 4002318c: 82 10 20 09 mov 9, %g1 ! 9 if (iop->pathinfo.mt_entry->writeable) { 40023190: c2 0a 20 29 ldub [ %o0 + 0x29 ], %g1 40023194: 80 a0 60 00 cmp %g1, 0 40023198: 02 80 00 14 be 400231e8 <== NEVER TAKEN 4002319c: 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 ); 400231a0: c2 02 20 0c ld [ %o0 + 0xc ], %g1 400231a4: c2 00 40 00 ld [ %g1 ], %g1 400231a8: 9f c0 40 00 call %g1 400231ac: 01 00 00 00 nop rtems_filesystem_instance_lock( &iop->pathinfo ); rv = (*iop->pathinfo.mt_entry->ops->fchmod_h)( &iop->pathinfo, mode ); 400231b0: c2 07 60 28 ld [ %i5 + 0x28 ], %g1 400231b4: 90 07 60 14 add %i5, 0x14, %o0 400231b8: c2 00 60 0c ld [ %g1 + 0xc ], %g1 400231bc: c2 00 60 20 ld [ %g1 + 0x20 ], %g1 400231c0: 9f c0 40 00 call %g1 400231c4: 92 10 00 19 mov %i1, %o1 400231c8: 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; 400231cc: d0 07 60 28 ld [ %i5 + 0x28 ], %o0 (*mt_entry->ops->unlock_h)( mt_entry ); 400231d0: c2 02 20 0c ld [ %o0 + 0xc ], %g1 400231d4: c2 00 60 04 ld [ %g1 + 4 ], %g1 400231d8: 9f c0 40 00 call %g1 400231dc: 01 00 00 00 nop 400231e0: 81 c7 e0 08 ret 400231e4: 81 e8 00 00 restore rtems_filesystem_instance_unlock( &iop->pathinfo ); } else { errno = EROFS; 400231e8: 40 00 4c 0e call 40036220 <__errno> <== NOT EXECUTED 400231ec: 01 00 00 00 nop <== NOT EXECUTED 400231f0: 82 10 20 1e mov 0x1e, %g1 ! 1e <== NOT EXECUTED 400231f4: c2 22 00 00 st %g1, [ %o0 ] rv = -1; } return rv; } 400231f8: 81 c7 e0 08 ret 400231fc: 91 e8 3f ff restore %g0, -1, %o0 =============================================================================== 40023200 : /** * POSIX 1003.1b 5.6.5 - Change Owner and Group of a File */ int fchown( int fd, uid_t owner, gid_t group ) { 40023200: 9d e3 bf a0 save %sp, -96, %sp int rv = 0; rtems_libio_t *iop; rtems_libio_check_fd( fd ); 40023204: 03 10 01 7b sethi %hi(0x4005ec00), %g1 40023208: c2 00 63 40 ld [ %g1 + 0x340 ], %g1 ! 4005ef40 4002320c: 80 a6 00 01 cmp %i0, %g1 40023210: 2a 80 00 03 bcs,a 4002321c 40023214: 83 2e 20 03 sll %i0, 3, %g1 40023218: 30 80 00 0a b,a 40023240 iop = rtems_libio_iop( fd ); 4002321c: b1 2e 20 06 sll %i0, 6, %i0 40023220: b0 26 00 01 sub %i0, %g1, %i0 40023224: 03 10 01 8c sethi %hi(0x40063000), %g1 40023228: fa 00 60 2c ld [ %g1 + 0x2c ], %i5 ! 4006302c 4002322c: ba 07 40 18 add %i5, %i0, %i5 rtems_libio_check_is_open(iop); 40023230: c2 07 60 10 ld [ %i5 + 0x10 ], %g1 40023234: 80 88 61 00 btst 0x100, %g1 40023238: 32 80 00 06 bne,a 40023250 4002323c: d0 07 60 28 ld [ %i5 + 0x28 ], %o0 40023240: 40 00 4b f8 call 40036220 <__errno> 40023244: 01 00 00 00 nop 40023248: 10 80 00 1c b 400232b8 4002324c: 82 10 20 09 mov 9, %g1 ! 9 if (iop->pathinfo.mt_entry->writeable) { 40023250: c2 0a 20 29 ldub [ %o0 + 0x29 ], %g1 40023254: 80 a0 60 00 cmp %g1, 0 40023258: 02 80 00 15 be 400232ac <== NEVER TAKEN 4002325c: 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 ); 40023260: c2 02 20 0c ld [ %o0 + 0xc ], %g1 40023264: c2 00 40 00 ld [ %g1 ], %g1 40023268: 9f c0 40 00 call %g1 4002326c: 01 00 00 00 nop rtems_filesystem_instance_lock( &iop->pathinfo ); rv = (*iop->pathinfo.mt_entry->ops->chown_h)( 40023270: c2 07 60 28 ld [ %i5 + 0x28 ], %g1 40023274: 90 07 60 14 add %i5, 0x14, %o0 40023278: c2 00 60 0c ld [ %g1 + 0xc ], %g1 4002327c: 92 10 00 19 mov %i1, %o1 40023280: c2 00 60 24 ld [ %g1 + 0x24 ], %g1 40023284: 9f c0 40 00 call %g1 40023288: 94 10 00 1a mov %i2, %o2 4002328c: 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; 40023290: d0 07 60 28 ld [ %i5 + 0x28 ], %o0 (*mt_entry->ops->unlock_h)( mt_entry ); 40023294: c2 02 20 0c ld [ %o0 + 0xc ], %g1 40023298: c2 00 60 04 ld [ %g1 + 4 ], %g1 4002329c: 9f c0 40 00 call %g1 400232a0: 01 00 00 00 nop 400232a4: 81 c7 e0 08 ret 400232a8: 81 e8 00 00 restore owner, group ); rtems_filesystem_instance_unlock( &iop->pathinfo ); } else { errno = EROFS; 400232ac: 40 00 4b dd call 40036220 <__errno> <== NOT EXECUTED 400232b0: 01 00 00 00 nop <== NOT EXECUTED 400232b4: 82 10 20 1e mov 0x1e, %g1 ! 1e <== NOT EXECUTED 400232b8: c2 22 00 00 st %g1, [ %o0 ] rv = -1; } return rv; } 400232bc: 81 c7 e0 08 ret 400232c0: 91 e8 3f ff restore %g0, -1, %o0 =============================================================================== 40030740 : int fcntl( int fd, int cmd, ... ) { 40030740: 9d e3 bf 98 save %sp, -104, %sp int fd2; int flags; int mask; int ret = 0; rtems_libio_check_fd( fd ); 40030744: 05 10 00 da sethi %hi(0x40036800), %g2 40030748: c4 00 a1 6c ld [ %g2 + 0x16c ], %g2 ! 4003696c ... ) { int ret; va_list ap; va_start( ap, cmd ); 4003074c: 82 07 a0 4c add %fp, 0x4c, %g1 40030750: f4 27 a0 4c st %i2, [ %fp + 0x4c ] 40030754: f6 27 a0 50 st %i3, [ %fp + 0x50 ] 40030758: f8 27 a0 54 st %i4, [ %fp + 0x54 ] 4003075c: fa 27 a0 58 st %i5, [ %fp + 0x58 ] int fd2; int flags; int mask; int ret = 0; rtems_libio_check_fd( fd ); 40030760: 80 a6 00 02 cmp %i0, %g2 40030764: 1a 80 00 0c bcc 40030794 40030768: c2 27 bf fc st %g1, [ %fp + -4 ] iop = rtems_libio_iop( fd ); 4003076c: 85 2e 20 03 sll %i0, 3, %g2 40030770: b1 2e 20 06 sll %i0, 6, %i0 40030774: b0 26 00 02 sub %i0, %g2, %i0 40030778: 05 10 01 1d sethi %hi(0x40047400), %g2 4003077c: fa 00 a0 50 ld [ %g2 + 0x50 ], %i5 ! 40047450 40030780: ba 07 40 18 add %i5, %i0, %i5 rtems_libio_check_is_open(iop); 40030784: d0 07 60 10 ld [ %i5 + 0x10 ], %o0 40030788: 80 8a 21 00 btst 0x100, %o0 4003078c: 12 80 00 06 bne 400307a4 40030790: 80 a6 60 09 cmp %i1, 9 40030794: 7f ff be 6c call 40020144 <__errno> 40030798: 01 00 00 00 nop 4003079c: 10 80 00 5d b 40030910 400307a0: 82 10 20 09 mov 9, %g1 ! 9 /* * This switch should contain all the cases from POSIX. */ switch ( cmd ) { 400307a4: 18 80 00 58 bgu 40030904 400307a8: 85 2e 60 02 sll %i1, 2, %g2 400307ac: 07 10 00 c1 sethi %hi(0x40030400), %g3 400307b0: 86 10 e3 18 or %g3, 0x318, %g3 ! 40030718 <_calloc_r+0x14> 400307b4: c4 00 c0 02 ld [ %g3 + %g2 ], %g2 400307b8: 81 c0 80 00 jmp %g2 400307bc: 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(); 400307c0: 7f ff 5c d5 call 40007b14 400307c4: 01 00 00 00 nop if (diop != NULL) { 400307c8: b8 92 20 00 orcc %o0, 0, %i4 400307cc: 02 80 00 62 be 40030954 400307d0: b0 10 3f ff mov -1, %i0 int oflag = rtems_libio_to_fcntl_flags( iop->flags ); 400307d4: 7f ff 5c ba call 40007abc 400307d8: d0 07 60 10 ld [ %i5 + 0x10 ], %o0 oflag &= ~O_CREAT; diop->flags |= rtems_libio_fcntl_flags( oflag ); 400307dc: 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; 400307e0: b6 0a 3d ff and %o0, -513, %i3 diop->flags |= rtems_libio_fcntl_flags( oflag ); 400307e4: 7f ff 5c a9 call 40007a88 400307e8: 90 10 00 1b mov %i3, %o0 400307ec: 90 12 00 1a or %o0, %i2, %o0 400307f0: 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; 400307f4: d0 07 60 28 ld [ %i5 + 0x28 ], %o0 (*mt_entry->ops->lock_h)( mt_entry ); 400307f8: c2 02 20 0c ld [ %o0 + 0xc ], %g1 400307fc: c2 00 40 00 ld [ %g1 ], %g1 40030800: 9f c0 40 00 call %g1 40030804: 01 00 00 00 nop rtems_filesystem_instance_lock( &iop->pathinfo ); rtems_filesystem_location_clone( &diop->pathinfo, &iop->pathinfo ); 40030808: 92 07 60 14 add %i5, 0x14, %o1 4003080c: 7f ff 96 15 call 40016060 40030810: 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; 40030814: d0 07 60 28 ld [ %i5 + 0x28 ], %o0 (*mt_entry->ops->unlock_h)( mt_entry ); 40030818: c2 02 20 0c ld [ %o0 + 0xc ], %g1 4003081c: c2 00 60 04 ld [ %g1 + 4 ], %g1 40030820: 9f c0 40 00 call %g1 40030824: 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 ); 40030828: c2 07 20 24 ld [ %i4 + 0x24 ], %g1 4003082c: 90 10 00 1c mov %i4, %o0 40030830: c2 00 40 00 ld [ %g1 ], %g1 40030834: 92 10 20 00 clr %o1 40030838: 94 10 00 1b mov %i3, %o2 4003083c: 9f c0 40 00 call %g1 40030840: 96 10 20 00 clr %o3 if ( rv == 0 ) { 40030844: b0 92 20 00 orcc %o0, 0, %i0 40030848: 12 80 00 11 bne 4003088c <== NEVER TAKEN 4003084c: 03 10 01 1d sethi %hi(0x40047400), %g1 rv = diop - rtems_libio_iops; 40030850: f0 00 60 50 ld [ %g1 + 0x50 ], %i0 ! 40047450 40030854: b8 27 00 18 sub %i4, %i0, %i4 40030858: b9 3f 20 03 sra %i4, 3, %i4 4003085c: 85 2f 20 03 sll %i4, 3, %g2 40030860: 83 2f 20 06 sll %i4, 6, %g1 40030864: 82 00 80 01 add %g2, %g1, %g1 40030868: 85 28 60 06 sll %g1, 6, %g2 4003086c: 82 00 40 02 add %g1, %g2, %g1 40030870: 82 00 40 1c add %g1, %i4, %g1 40030874: b1 28 60 0f sll %g1, 0xf, %i0 40030878: 82 00 40 18 add %g1, %i0, %g1 4003087c: 83 28 60 03 sll %g1, 3, %g1 40030880: b8 00 40 1c add %g1, %i4, %i4 40030884: 10 80 00 25 b 40030918 40030888: b0 20 00 1c neg %i4, %i0 } else { rtems_libio_free( diop ); 4003088c: 7f ff 5c b9 call 40007b70 <== NOT EXECUTED 40030890: 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) { 40030894: 10 80 00 22 b 4003091c <== NOT EXECUTED 40030898: 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); 4003089c: b1 32 20 0b srl %o0, 0xb, %i0 400308a0: 10 80 00 21 b 40030924 400308a4: 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 ) ) 400308a8: c2 00 40 00 ld [ %g1 ], %g1 400308ac: 80 a0 60 00 cmp %g1, 0 400308b0: 22 80 00 0e be,a 400308e8 400308b4: 90 0a 37 ff and %o0, -2049, %o0 iop->flags |= LIBIO_FLAGS_CLOSE_ON_EXEC; 400308b8: 10 80 00 0c b 400308e8 400308bc: 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 ); 400308c0: 7f ff 5c 7f call 40007abc 400308c4: 01 00 00 00 nop 400308c8: 10 80 00 14 b 40030918 400308cc: b0 10 00 08 mov %o0, %i0 break; case F_SETFL: flags = rtems_libio_fcntl_flags( va_arg( ap, int ) ); 400308d0: 7f ff 5c 6e call 40007a88 400308d4: 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); 400308d8: c2 07 60 10 ld [ %i5 + 0x10 ], %g1 400308dc: 90 0a 22 01 and %o0, 0x201, %o0 400308e0: 82 08 7d fe and %g1, -514, %g1 400308e4: 90 12 00 01 or %o0, %g1, %o0 400308e8: d0 27 60 10 st %o0, [ %i5 + 0x10 ] { rtems_libio_t *iop; int fd2; int flags; int mask; int ret = 0; 400308ec: 10 80 00 0e b 40030924 400308f0: b0 10 20 00 clr %i0 errno = ENOTSUP; ret = -1; break; case F_GETOWN: /* for sockets. */ errno = ENOTSUP; 400308f4: 7f ff be 14 call 40020144 <__errno> 400308f8: 01 00 00 00 nop 400308fc: 10 80 00 05 b 40030910 40030900: 82 10 20 86 mov 0x86, %g1 ! 86 ret = -1; break; default: errno = EINVAL; 40030904: 7f ff be 10 call 40020144 <__errno> 40030908: 01 00 00 00 nop 4003090c: 82 10 20 16 mov 0x16, %g1 ! 16 40030910: 10 80 00 10 b 40030950 40030914: 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) { 40030918: 80 a6 20 00 cmp %i0, 0 4003091c: 06 80 00 0e bl 40030954 <== NEVER TAKEN 40030920: 01 00 00 00 nop int err = (*iop->pathinfo.handlers->fcntl_h)( iop, cmd ); 40030924: c2 07 60 24 ld [ %i5 + 0x24 ], %g1 40030928: 90 10 00 1d mov %i5, %o0 4003092c: c2 00 60 28 ld [ %g1 + 0x28 ], %g1 40030930: 9f c0 40 00 call %g1 40030934: 92 10 00 19 mov %i1, %o1 if (err) { 40030938: ba 92 20 00 orcc %o0, 0, %i5 4003093c: 02 80 00 06 be 40030954 <== ALWAYS TAKEN 40030940: 01 00 00 00 nop errno = err; 40030944: 7f ff be 00 call 40020144 <__errno> <== NOT EXECUTED 40030948: 01 00 00 00 nop <== NOT EXECUTED 4003094c: 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); 40030950: b0 10 3f ff mov -1, %i0 va_list ap; va_start( ap, cmd ); ret = vfcntl(fd,cmd,ap); va_end(ap); return ret; } 40030954: 81 c7 e0 08 ret 40030958: 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 58 sethi %hi(0x40016000), %g1 4000393c: c2 00 61 e4 ld [ %g1 + 0x1e4 ], %g1 ! 400161e4 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 5a sethi %hi(0x40016800), %g1 40003958: d0 00 63 3c ld [ %g1 + 0x33c ], %o0 ! 40016b3c 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 2f 37 call 4000f654 <__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 =============================================================================== 4000d030 : int fifo_open( pipe_control_t **pipep, rtems_libio_t *iop ) { 4000d030: 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) { 4000d034: 3b 10 00 8a sethi %hi(0x40022800), %i5 4000d038: c2 07 61 c8 ld [ %i5 + 0x1c8 ], %g1 ! 400229c8 int fifo_open( pipe_control_t **pipep, rtems_libio_t *iop ) { 4000d03c: b6 10 00 18 mov %i0, %i3 static int pipe_lock(void) { rtems_status_code sc = RTEMS_SUCCESSFUL; if (pipe_semaphore == RTEMS_ID_NONE) { 4000d040: 80 a0 60 00 cmp %g1, 0 4000d044: 02 80 00 0c be 4000d074 4000d048: b8 17 61 c8 or %i5, 0x1c8, %i4 rtems_libio_unlock(); } if (sc == RTEMS_SUCCESSFUL) { sc = rtems_semaphore_obtain(pipe_semaphore, RTEMS_WAIT, RTEMS_NO_TIMEOUT); 4000d04c: 03 10 00 8a sethi %hi(0x40022800), %g1 4000d050: d0 00 61 c8 ld [ %g1 + 0x1c8 ], %o0 ! 400229c8 4000d054: 92 10 20 00 clr %o1 4000d058: 7f ff ed 2a call 40008500 4000d05c: 94 10 20 00 clr %o2 } if (sc == RTEMS_SUCCESSFUL) { 4000d060: 80 a2 20 00 cmp %o0, 0 4000d064: 22 80 01 00 be,a 4000d464 <== ALWAYS TAKEN 4000d068: fa 06 c0 00 ld [ %i3 ], %i5 return 0; } else { return -ENOMEM; 4000d06c: 81 c7 e0 08 ret <== NOT EXECUTED 4000d070: 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 ); 4000d074: 03 10 00 8a sethi %hi(0x40022800), %g1 4000d078: d0 00 63 48 ld [ %g1 + 0x348 ], %o0 ! 40022b48 4000d07c: 92 10 20 00 clr %o1 4000d080: 7f ff ed 20 call 40008500 4000d084: 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) { 4000d088: c2 07 61 c8 ld [ %i5 + 0x1c8 ], %g1 4000d08c: 80 a0 60 00 cmp %g1, 0 4000d090: 12 80 00 0a bne 4000d0b8 <== NEVER TAKEN 4000d094: ba 10 20 00 clr %i5 sc = rtems_semaphore_create( 4000d098: 11 14 12 54 sethi %hi(0x50495000), %o0 4000d09c: 92 10 20 01 mov 1, %o1 4000d0a0: 90 12 20 45 or %o0, 0x45, %o0 4000d0a4: 94 10 20 54 mov 0x54, %o2 4000d0a8: 96 10 20 00 clr %o3 4000d0ac: 7f ff ec 78 call 4000828c 4000d0b0: 98 10 00 1c mov %i4, %o4 4000d0b4: ba 10 00 08 mov %o0, %i5 } static inline void rtems_libio_unlock( void ) { rtems_semaphore_release( rtems_libio_semaphore ); 4000d0b8: 03 10 00 8a sethi %hi(0x40022800), %g1 4000d0bc: 7f ff ed 5a call 40008624 4000d0c0: d0 00 63 48 ld [ %g1 + 0x348 ], %o0 ! 40022b48 } rtems_libio_unlock(); } if (sc == RTEMS_SUCCESSFUL) { 4000d0c4: 80 a7 60 00 cmp %i5, 0 4000d0c8: 02 bf ff e1 be 4000d04c 4000d0cc: b0 10 3f f4 mov -12, %i0 4000d0d0: 81 c7 e0 08 ret 4000d0d4: 81 e8 00 00 restore { static char c = 'a'; pipe_control_t *pipe; int err = -ENOMEM; pipe = malloc(sizeof(pipe_control_t)); 4000d0d8: 7f ff dc d7 call 40004434 4000d0dc: 90 10 20 34 mov 0x34, %o0 if (pipe == NULL) 4000d0e0: ba 92 20 00 orcc %o0, 0, %i5 4000d0e4: 02 80 00 e4 be 4000d474 <== NEVER TAKEN 4000d0e8: 92 10 20 00 clr %o1 return err; memset(pipe, 0, sizeof(pipe_control_t)); 4000d0ec: 40 00 12 05 call 40011900 4000d0f0: 94 10 20 34 mov 0x34, %o2 pipe->Size = PIPE_BUF; 4000d0f4: 82 10 22 00 mov 0x200, %g1 pipe->Buffer = malloc(pipe->Size); 4000d0f8: 90 10 22 00 mov 0x200, %o0 4000d0fc: 7f ff dc ce call 40004434 4000d100: c2 27 60 04 st %g1, [ %i5 + 4 ] if (! pipe->Buffer) 4000d104: 80 a2 20 00 cmp %o0, 0 4000d108: 02 80 00 40 be 4000d208 <== NEVER TAKEN 4000d10c: d0 27 40 00 st %o0, [ %i5 ] goto err_buf; err = -ENOMEM; if (rtems_barrier_create( rtems_build_name ('P', 'I', 'r', c), 4000d110: 39 10 00 88 sethi %hi(0x40022000), %i4 4000d114: d0 4f 22 bc ldsb [ %i4 + 0x2bc ], %o0 ! 400222bc if (! pipe->Buffer) goto err_buf; err = -ENOMEM; if (rtems_barrier_create( 4000d118: 35 14 12 5c sethi %hi(0x50497000), %i2 4000d11c: 82 16 a2 00 or %i2, 0x200, %g1 ! 50497200 4000d120: 92 10 20 00 clr %o1 4000d124: 90 12 00 01 or %o0, %g1, %o0 4000d128: 94 10 20 00 clr %o2 4000d12c: 40 00 05 c6 call 4000e844 4000d130: 96 07 60 2c add %i5, 0x2c, %o3 4000d134: 80 a2 20 00 cmp %o0, 0 4000d138: 12 80 00 32 bne 4000d200 4000d13c: d0 4f 22 bc ldsb [ %i4 + 0x2bc ], %o0 rtems_build_name ('P', 'I', 'r', c), RTEMS_BARRIER_MANUAL_RELEASE, 0, &pipe->readBarrier) != RTEMS_SUCCESSFUL) goto err_rbar; if (rtems_barrier_create( 4000d140: 03 14 12 5d sethi %hi(0x50497400), %g1 4000d144: 82 10 63 00 or %g1, 0x300, %g1 ! 50497700 4000d148: 92 10 20 00 clr %o1 4000d14c: 90 12 00 01 or %o0, %g1, %o0 4000d150: 94 10 20 00 clr %o2 4000d154: 40 00 05 bc call 4000e844 4000d158: 96 07 60 30 add %i5, 0x30, %o3 4000d15c: 80 a2 20 00 cmp %o0, 0 4000d160: 12 80 00 26 bne 4000d1f8 4000d164: d0 4f 22 bc ldsb [ %i4 + 0x2bc ], %o0 rtems_build_name ('P', 'I', 'w', c), RTEMS_BARRIER_MANUAL_RELEASE, 0, &pipe->writeBarrier) != RTEMS_SUCCESSFUL) goto err_wbar; if (rtems_semaphore_create( 4000d168: b4 16 a3 00 or %i2, 0x300, %i2 4000d16c: 92 10 20 01 mov 1, %o1 4000d170: 90 12 00 1a or %o0, %i2, %o0 4000d174: 94 10 20 10 mov 0x10, %o2 4000d178: 96 10 20 00 clr %o3 4000d17c: 7f ff ec 44 call 4000828c 4000d180: 98 07 60 28 add %i5, 0x28, %o4 4000d184: 80 a2 20 00 cmp %o0, 0 4000d188: 12 80 00 1a bne 4000d1f0 4000d18c: 94 07 bf fc add %fp, -4, %o2 RTEMS_INLINE_ROUTINE Barrier_Control *_Barrier_Get ( Objects_Id id, Objects_Locations *location ) { return (Barrier_Control *) 4000d190: d2 07 60 2c ld [ %i5 + 0x2c ], %o1 4000d194: 31 10 00 8d sethi %hi(0x40023400), %i0 4000d198: 7f ff f3 6d call 40009f4c <_Objects_Get> 4000d19c: 90 16 21 e0 or %i0, 0x1e0, %o0 ! 400235e0 <_Barrier_Information> static void pipe_interruptible(pipe_control_t *pipe) { Objects_Locations location; _Barrier_Get(pipe->readBarrier, &location)->Barrier.Wait_queue.state |= STATES_INTERRUPTIBLE_BY_SIGNAL; 4000d1a0: c2 02 20 4c ld [ %o0 + 0x4c ], %g1 4000d1a4: 35 04 00 00 sethi %hi(0x10000000), %i2 4000d1a8: 82 10 40 1a or %g1, %i2, %g1 _Thread_Enable_dispatch(); 4000d1ac: 7f ff f6 e9 call 4000ad50 <_Thread_Enable_dispatch> 4000d1b0: c2 22 20 4c st %g1, [ %o0 + 0x4c ] 4000d1b4: d2 07 60 30 ld [ %i5 + 0x30 ], %o1 4000d1b8: 94 07 bf fc add %fp, -4, %o2 4000d1bc: 7f ff f3 64 call 40009f4c <_Objects_Get> 4000d1c0: 90 16 21 e0 or %i0, 0x1e0, %o0 _Barrier_Get(pipe->writeBarrier, &location)->Barrier.Wait_queue.state |= STATES_INTERRUPTIBLE_BY_SIGNAL; 4000d1c4: c2 02 20 4c ld [ %o0 + 0x4c ], %g1 4000d1c8: b4 10 40 1a or %g1, %i2, %i2 _Thread_Enable_dispatch(); 4000d1cc: 7f ff f6 e1 call 4000ad50 <_Thread_Enable_dispatch> 4000d1d0: f4 22 20 4c st %i2, [ %o0 + 0x4c ] #ifdef RTEMS_POSIX_API pipe_interruptible(pipe); #endif *pipep = pipe; if (c ++ == 'z') 4000d1d4: c2 0f 22 bc ldub [ %i4 + 0x2bc ], %g1 4000d1d8: c4 4f 22 bc ldsb [ %i4 + 0x2bc ], %g2 4000d1dc: 80 a0 a0 7a cmp %g2, 0x7a 4000d1e0: 12 80 00 a7 bne 4000d47c 4000d1e4: 82 00 60 01 inc %g1 c = 'a'; 4000d1e8: 10 80 00 a5 b 4000d47c 4000d1ec: 82 10 20 61 mov 0x61, %g1 return 0; err_sem: rtems_barrier_delete(pipe->writeBarrier); 4000d1f0: 40 00 05 c4 call 4000e900 4000d1f4: d0 07 60 30 ld [ %i5 + 0x30 ], %o0 err_wbar: rtems_barrier_delete(pipe->readBarrier); 4000d1f8: 40 00 05 c2 call 4000e900 4000d1fc: d0 07 60 2c ld [ %i5 + 0x2c ], %o0 err_rbar: free(pipe->Buffer); 4000d200: 7f ff db 79 call 40003fe4 4000d204: d0 07 40 00 ld [ %i5 ], %o0 err_buf: free(pipe); 4000d208: 7f ff db 77 call 40003fe4 4000d20c: 90 10 00 1d mov %i5, %o0 if (err) goto out; } if (! PIPE_LOCK(pipe)) err = -EINTR; 4000d210: 10 80 00 13 b 4000d25c 4000d214: b0 10 3f f4 mov -12, %i0 err = pipe_alloc(&pipe); if (err) goto out; } if (! PIPE_LOCK(pipe)) 4000d218: d0 07 60 28 ld [ %i5 + 0x28 ], %o0 4000d21c: 92 10 20 00 clr %o1 4000d220: 7f ff ec b8 call 40008500 4000d224: 94 10 20 00 clr %o2 err = -EINTR; if (*pipep == NULL) { 4000d228: c2 06 c0 00 ld [ %i3 ], %g1 err = pipe_alloc(&pipe); if (err) goto out; } if (! PIPE_LOCK(pipe)) 4000d22c: 80 a0 00 08 cmp %g0, %o0 4000d230: b0 60 20 00 subx %g0, 0, %i0 err = -EINTR; if (*pipep == NULL) { 4000d234: 80 a0 60 00 cmp %g1, 0 4000d238: 12 80 00 09 bne 4000d25c 4000d23c: b0 0e 3f fc and %i0, -4, %i0 if (err) 4000d240: 80 a6 20 00 cmp %i0, 0 4000d244: 22 80 00 06 be,a 4000d25c <== ALWAYS TAKEN 4000d248: fa 26 c0 00 st %i5, [ %i3 ] pipe_free(pipe); 4000d24c: 7f ff ff 41 call 4000cf50 <== NOT EXECUTED 4000d250: 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); 4000d254: 10 80 00 03 b 4000d260 <== NOT EXECUTED 4000d258: 03 10 00 8a sethi %hi(0x40022800), %g1 <== NOT EXECUTED 4000d25c: 03 10 00 8a sethi %hi(0x40022800), %g1 4000d260: 7f ff ec f1 call 40008624 4000d264: d0 00 61 c8 ld [ %g1 + 0x1c8 ], %o0 ! 400229c8 pipe_control_t *pipe; unsigned int prevCounter; int err; err = pipe_new(pipep); if (err) 4000d268: 80 a6 20 00 cmp %i0, 0 4000d26c: 12 80 00 86 bne 4000d484 4000d270: 01 00 00 00 nop return err; pipe = *pipep; switch (LIBIO_ACCMODE(iop)) { 4000d274: c2 06 60 10 ld [ %i1 + 0x10 ], %g1 4000d278: 82 08 60 06 and %g1, 6, %g1 4000d27c: 80 a0 60 04 cmp %g1, 4 4000d280: 02 80 00 2e be 4000d338 4000d284: fa 06 c0 00 ld [ %i3 ], %i5 4000d288: 80 a0 60 06 cmp %g1, 6 4000d28c: 02 80 00 56 be 4000d3e4 4000d290: 80 a0 60 02 cmp %g1, 2 4000d294: 12 80 00 6a bne 4000d43c <== NEVER TAKEN 4000d298: 01 00 00 00 nop case LIBIO_FLAGS_READ: pipe->readerCounter ++; 4000d29c: c2 07 60 20 ld [ %i5 + 0x20 ], %g1 4000d2a0: 82 00 60 01 inc %g1 4000d2a4: c2 27 60 20 st %g1, [ %i5 + 0x20 ] if (pipe->Readers ++ == 0) 4000d2a8: c2 07 60 10 ld [ %i5 + 0x10 ], %g1 4000d2ac: 84 00 60 01 add %g1, 1, %g2 4000d2b0: 80 a0 60 00 cmp %g1, 0 4000d2b4: 12 80 00 05 bne 4000d2c8 <== NEVER TAKEN 4000d2b8: c4 27 60 10 st %g2, [ %i5 + 0x10 ] PIPE_WAKEUPWRITERS(pipe); 4000d2bc: d0 07 60 30 ld [ %i5 + 0x30 ], %o0 4000d2c0: 40 00 05 b9 call 4000e9a4 4000d2c4: 92 07 bf f8 add %fp, -8, %o1 if (pipe->Writers == 0) { 4000d2c8: c2 07 60 14 ld [ %i5 + 0x14 ], %g1 4000d2cc: 80 a0 60 00 cmp %g1, 0 4000d2d0: 12 80 00 5b bne 4000d43c 4000d2d4: 01 00 00 00 nop /* Not an error */ if (LIBIO_NODELAY(iop)) 4000d2d8: c2 06 60 10 ld [ %i1 + 0x10 ], %g1 4000d2dc: 80 88 60 01 btst 1, %g1 4000d2e0: 12 80 00 57 bne 4000d43c 4000d2e4: 01 00 00 00 nop break; prevCounter = pipe->writerCounter; 4000d2e8: f8 07 60 24 ld [ %i5 + 0x24 ], %i4 err = -EINTR; /* Wait until a writer opens the pipe */ do { PIPE_UNLOCK(pipe); 4000d2ec: 7f ff ec ce call 40008624 4000d2f0: d0 07 60 28 ld [ %i5 + 0x28 ], %o0 if (! PIPE_READWAIT(pipe)) 4000d2f4: d0 07 60 2c ld [ %i5 + 0x2c ], %o0 4000d2f8: 40 00 05 c1 call 4000e9fc 4000d2fc: 92 10 20 00 clr %o1 4000d300: 80 a2 20 00 cmp %o0, 0 4000d304: 12 80 00 52 bne 4000d44c <== NEVER TAKEN 4000d308: 92 10 20 00 clr %o1 goto out_error; if (! PIPE_LOCK(pipe)) 4000d30c: d0 07 60 28 ld [ %i5 + 0x28 ], %o0 4000d310: 7f ff ec 7c call 40008500 4000d314: 94 10 20 00 clr %o2 4000d318: 80 a2 20 00 cmp %o0, 0 4000d31c: 32 80 00 4d bne,a 4000d450 <== NEVER TAKEN 4000d320: b0 10 3f fc mov -4, %i0 <== NOT EXECUTED goto out_error; } while (prevCounter == pipe->writerCounter); 4000d324: c2 07 60 24 ld [ %i5 + 0x24 ], %g1 4000d328: 80 a7 00 01 cmp %i4, %g1 4000d32c: 02 bf ff f0 be 4000d2ec <== NEVER TAKEN 4000d330: 01 00 00 00 nop 4000d334: 30 80 00 42 b,a 4000d43c } break; case LIBIO_FLAGS_WRITE: pipe->writerCounter ++; 4000d338: c2 07 60 24 ld [ %i5 + 0x24 ], %g1 4000d33c: 82 00 60 01 inc %g1 4000d340: c2 27 60 24 st %g1, [ %i5 + 0x24 ] if (pipe->Writers ++ == 0) 4000d344: c2 07 60 14 ld [ %i5 + 0x14 ], %g1 4000d348: 84 00 60 01 add %g1, 1, %g2 4000d34c: 80 a0 60 00 cmp %g1, 0 4000d350: 12 80 00 05 bne 4000d364 <== NEVER TAKEN 4000d354: c4 27 60 14 st %g2, [ %i5 + 0x14 ] PIPE_WAKEUPREADERS(pipe); 4000d358: d0 07 60 2c ld [ %i5 + 0x2c ], %o0 4000d35c: 40 00 05 92 call 4000e9a4 4000d360: 92 07 bf f8 add %fp, -8, %o1 if (pipe->Readers == 0 && LIBIO_NODELAY(iop)) { 4000d364: c2 07 60 10 ld [ %i5 + 0x10 ], %g1 4000d368: 80 a0 60 00 cmp %g1, 0 4000d36c: 12 80 00 34 bne 4000d43c 4000d370: 01 00 00 00 nop 4000d374: c2 06 60 10 ld [ %i1 + 0x10 ], %g1 4000d378: 80 88 60 01 btst 1, %g1 4000d37c: 22 80 00 07 be,a 4000d398 4000d380: f8 07 60 20 ld [ %i5 + 0x20 ], %i4 PIPE_UNLOCK(pipe); 4000d384: d0 07 60 28 ld [ %i5 + 0x28 ], %o0 4000d388: 7f ff ec a7 call 40008624 4000d38c: b0 10 3f fa mov -6, %i0 err = -ENXIO; goto out_error; 4000d390: 10 80 00 31 b 4000d454 4000d394: 90 10 00 1b mov %i3, %o0 if (pipe->Readers == 0) { prevCounter = pipe->readerCounter; err = -EINTR; do { PIPE_UNLOCK(pipe); 4000d398: 7f ff ec a3 call 40008624 4000d39c: d0 07 60 28 ld [ %i5 + 0x28 ], %o0 if (! PIPE_WRITEWAIT(pipe)) 4000d3a0: d0 07 60 30 ld [ %i5 + 0x30 ], %o0 4000d3a4: 40 00 05 96 call 4000e9fc 4000d3a8: 92 10 20 00 clr %o1 4000d3ac: 80 a2 20 00 cmp %o0, 0 4000d3b0: 12 80 00 27 bne 4000d44c <== NEVER TAKEN 4000d3b4: 92 10 20 00 clr %o1 goto out_error; if (! PIPE_LOCK(pipe)) 4000d3b8: d0 07 60 28 ld [ %i5 + 0x28 ], %o0 4000d3bc: 7f ff ec 51 call 40008500 4000d3c0: 94 10 20 00 clr %o2 4000d3c4: 80 a2 20 00 cmp %o0, 0 4000d3c8: 32 80 00 22 bne,a 4000d450 <== NEVER TAKEN 4000d3cc: b0 10 3f fc mov -4, %i0 <== NOT EXECUTED goto out_error; } while (prevCounter == pipe->readerCounter); 4000d3d0: c2 07 60 20 ld [ %i5 + 0x20 ], %g1 4000d3d4: 80 a7 00 01 cmp %i4, %g1 4000d3d8: 02 bf ff f0 be 4000d398 <== NEVER TAKEN 4000d3dc: 01 00 00 00 nop 4000d3e0: 30 80 00 17 b,a 4000d43c } break; case LIBIO_FLAGS_READ_WRITE: pipe->readerCounter ++; 4000d3e4: c2 07 60 20 ld [ %i5 + 0x20 ], %g1 4000d3e8: 82 00 60 01 inc %g1 4000d3ec: c2 27 60 20 st %g1, [ %i5 + 0x20 ] if (pipe->Readers ++ == 0) 4000d3f0: c2 07 60 10 ld [ %i5 + 0x10 ], %g1 4000d3f4: 84 00 60 01 add %g1, 1, %g2 4000d3f8: 80 a0 60 00 cmp %g1, 0 4000d3fc: 12 80 00 05 bne 4000d410 <== NEVER TAKEN 4000d400: c4 27 60 10 st %g2, [ %i5 + 0x10 ] PIPE_WAKEUPWRITERS(pipe); 4000d404: d0 07 60 30 ld [ %i5 + 0x30 ], %o0 4000d408: 40 00 05 67 call 4000e9a4 4000d40c: 92 07 bf f8 add %fp, -8, %o1 pipe->writerCounter ++; 4000d410: c2 07 60 24 ld [ %i5 + 0x24 ], %g1 4000d414: 82 00 60 01 inc %g1 4000d418: c2 27 60 24 st %g1, [ %i5 + 0x24 ] if (pipe->Writers ++ == 0) 4000d41c: c2 07 60 14 ld [ %i5 + 0x14 ], %g1 4000d420: 84 00 60 01 add %g1, 1, %g2 4000d424: 80 a0 60 00 cmp %g1, 0 4000d428: 12 80 00 05 bne 4000d43c <== NEVER TAKEN 4000d42c: c4 27 60 14 st %g2, [ %i5 + 0x14 ] PIPE_WAKEUPREADERS(pipe); 4000d430: d0 07 60 2c ld [ %i5 + 0x2c ], %o0 4000d434: 40 00 05 5c call 4000e9a4 4000d438: 92 07 bf f8 add %fp, -8, %o1 break; } PIPE_UNLOCK(pipe); 4000d43c: 7f ff ec 7a call 40008624 4000d440: d0 07 60 28 ld [ %i5 + 0x28 ], %o0 return 0; 4000d444: 81 c7 e0 08 ret 4000d448: 81 e8 00 00 restore /* Not an error */ if (LIBIO_NODELAY(iop)) break; prevCounter = pipe->writerCounter; err = -EINTR; 4000d44c: b0 10 3f fc mov -4, %i0 <== NOT EXECUTED PIPE_UNLOCK(pipe); return 0; out_error: pipe_release(pipep, iop); 4000d450: 90 10 00 1b mov %i3, %o0 <== NOT EXECUTED 4000d454: 7f ff fe ca call 4000cf7c 4000d458: 92 10 00 19 mov %i1, %o1 return err; 4000d45c: 81 c7 e0 08 ret 4000d460: 81 e8 00 00 restore err = pipe_lock(); if (err) return err; pipe = *pipep; if (pipe == NULL) { 4000d464: 80 a7 60 00 cmp %i5, 0 4000d468: 32 bf ff 6d bne,a 4000d21c 4000d46c: d0 07 60 28 ld [ %i5 + 0x28 ], %o0 4000d470: 30 bf ff 1a b,a 4000d0d8 if (err) goto out; } if (! PIPE_LOCK(pipe)) err = -EINTR; 4000d474: 10 bf ff 7a b 4000d25c <== NOT EXECUTED 4000d478: b0 10 3f f4 mov -12, %i0 <== NOT EXECUTED #ifdef RTEMS_POSIX_API pipe_interruptible(pipe); #endif *pipep = pipe; if (c ++ == 'z') 4000d47c: 10 bf ff 67 b 4000d218 4000d480: c2 2f 22 bc stb %g1, [ %i4 + 0x2bc ] return 0; out_error: pipe_release(pipep, iop); return err; } 4000d484: 81 c7 e0 08 ret 4000d488: 81 e8 00 00 restore =============================================================================== 40009394 : */ long fpathconf( int fd, int name ) { 40009394: 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); 40009398: 03 10 00 51 sethi %hi(0x40014400), %g1 4000939c: c2 00 63 88 ld [ %g1 + 0x388 ], %g1 ! 40014788 400093a0: 80 a6 00 01 cmp %i0, %g1 400093a4: 2a 80 00 03 bcs,a 400093b0 400093a8: 83 2e 20 03 sll %i0, 3, %g1 400093ac: 30 80 00 0a b,a 400093d4 iop = rtems_libio_iop(fd); 400093b0: b1 2e 20 06 sll %i0, 6, %i0 400093b4: b0 26 00 01 sub %i0, %g1, %i0 400093b8: 03 10 00 54 sethi %hi(0x40015000), %g1 400093bc: c2 00 60 c0 ld [ %g1 + 0xc0 ], %g1 ! 400150c0 400093c0: b0 00 40 18 add %g1, %i0, %i0 rtems_libio_check_is_open(iop); 400093c4: c2 06 20 10 ld [ %i0 + 0x10 ], %g1 400093c8: 80 88 61 00 btst 0x100, %g1 400093cc: 32 80 00 06 bne,a 400093e4 <== ALWAYS TAKEN 400093d0: c2 06 20 28 ld [ %i0 + 0x28 ], %g1 400093d4: 40 00 08 d4 call 4000b724 <__errno> 400093d8: 01 00 00 00 nop 400093dc: 10 80 00 32 b 400094a4 400093e0: 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 ) { 400093e4: 80 a6 60 0b cmp %i1, 0xb 400093e8: 18 80 00 2c bgu 40009498 400093ec: c2 00 60 2c ld [ %g1 + 0x2c ], %g1 400093f0: b3 2e 60 02 sll %i1, 2, %i1 400093f4: 05 10 00 24 sethi %hi(0x40009000), %g2 400093f8: 84 10 a3 64 or %g2, 0x364, %g2 ! 40009364 <_close_r+0x10> 400093fc: c4 00 80 19 ld [ %g2 + %i1 ], %g2 40009400: 81 c0 80 00 jmp %g2 40009404: 01 00 00 00 nop case _PC_LINK_MAX: return_value = the_limits->link_max; 40009408: f0 00 40 00 ld [ %g1 ], %i0 break; 4000940c: 81 c7 e0 08 ret 40009410: 81 e8 00 00 restore case _PC_MAX_CANON: return_value = the_limits->max_canon; 40009414: f0 00 60 04 ld [ %g1 + 4 ], %i0 break; 40009418: 81 c7 e0 08 ret 4000941c: 81 e8 00 00 restore case _PC_MAX_INPUT: return_value = the_limits->max_input; 40009420: f0 00 60 08 ld [ %g1 + 8 ], %i0 break; 40009424: 81 c7 e0 08 ret 40009428: 81 e8 00 00 restore case _PC_NAME_MAX: return_value = the_limits->name_max; 4000942c: f0 00 60 0c ld [ %g1 + 0xc ], %i0 break; 40009430: 81 c7 e0 08 ret 40009434: 81 e8 00 00 restore case _PC_PATH_MAX: return_value = the_limits->path_max; 40009438: f0 00 60 10 ld [ %g1 + 0x10 ], %i0 break; 4000943c: 81 c7 e0 08 ret 40009440: 81 e8 00 00 restore case _PC_PIPE_BUF: return_value = the_limits->pipe_buf; 40009444: f0 00 60 14 ld [ %g1 + 0x14 ], %i0 break; 40009448: 81 c7 e0 08 ret 4000944c: 81 e8 00 00 restore case _PC_CHOWN_RESTRICTED: return_value = the_limits->posix_chown_restrictions; 40009450: f0 00 60 1c ld [ %g1 + 0x1c ], %i0 break; 40009454: 81 c7 e0 08 ret 40009458: 81 e8 00 00 restore case _PC_NO_TRUNC: return_value = the_limits->posix_no_trunc; 4000945c: f0 00 60 20 ld [ %g1 + 0x20 ], %i0 break; 40009460: 81 c7 e0 08 ret 40009464: 81 e8 00 00 restore case _PC_VDISABLE: return_value = the_limits->posix_vdisable; 40009468: f0 00 60 2c ld [ %g1 + 0x2c ], %i0 break; 4000946c: 81 c7 e0 08 ret 40009470: 81 e8 00 00 restore case _PC_ASYNC_IO: return_value = the_limits->posix_async_io; 40009474: f0 00 60 18 ld [ %g1 + 0x18 ], %i0 break; 40009478: 81 c7 e0 08 ret 4000947c: 81 e8 00 00 restore case _PC_PRIO_IO: return_value = the_limits->posix_prio_io; 40009480: f0 00 60 24 ld [ %g1 + 0x24 ], %i0 break; 40009484: 81 c7 e0 08 ret 40009488: 81 e8 00 00 restore case _PC_SYNC_IO: return_value = the_limits->posix_sync_io; 4000948c: f0 00 60 28 ld [ %g1 + 0x28 ], %i0 break; 40009490: 81 c7 e0 08 ret 40009494: 81 e8 00 00 restore default: rtems_set_errno_and_return_minus_one( EINVAL ); 40009498: 40 00 08 a3 call 4000b724 <__errno> 4000949c: 01 00 00 00 nop 400094a0: 82 10 20 16 mov 0x16, %g1 ! 16 400094a4: c2 22 00 00 st %g1, [ %o0 ] break; } return return_value; } 400094a8: 81 c7 e0 08 ret 400094ac: 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 78 sethi %hi(0x4001e000), %g1 40002fd4: 82 10 60 80 or %g1, 0x80, %g1 ! 4001e080 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 79 sethi %hi(0x4001e400), %g1 40002ff4: c2 00 63 08 ld [ %g1 + 0x308 ], %g1 ! 4001e708 <_System_state_Current> 40002ff8: 80 a0 60 03 cmp %g1, 3 40002ffc: 12 80 00 09 bne 40003020 <== NEVER TAKEN 40003000: 03 10 00 77 sethi %hi(0x4001dc00), %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 77 sethi %hi(0x4001dc00), %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 61 d0 ld [ %g1 + 0x1d0 ], %g1 40003024: 80 a0 60 00 cmp %g1, 0 40003028: 02 80 00 06 be 40003040 4000302c: 3b 10 00 75 sethi %hi(0x4001d400), %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 75 sethi %hi(0x4001d400), %i5 40003040: d0 07 62 a0 ld [ %i5 + 0x2a0 ], %o0 ! 4001d6a0 40003044: 40 00 17 16 call 40008c9c <_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 62 a0 ld [ %i5 + 0x2a0 ], %g1 printk( "Program heap: free of bad pointer %p -- range %p - %p \n", 40003058: 31 10 00 70 sethi %hi(0x4001c000), %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 22 00 restore %i0, 0x200, %o0 4000306c: 81 c7 e0 08 ret 40003070: 81 e8 00 00 restore =============================================================================== 4001a8fc : int fstat( int fd, struct stat *sbuf ) { 4001a8fc: 9d e3 bf a0 save %sp, -96, %sp rtems_libio_t *iop; /* * Check to see if we were passed a valid pointer. */ if ( !sbuf ) 4001a900: 80 a6 60 00 cmp %i1, 0 4001a904: 32 80 00 06 bne,a 4001a91c <== ALWAYS TAKEN 4001a908: 03 10 00 75 sethi %hi(0x4001d400), %g1 rtems_set_errno_and_return_minus_one( EFAULT ); 4001a90c: 7f ff d0 58 call 4000ea6c <__errno> <== NOT EXECUTED 4001a910: 01 00 00 00 nop <== NOT EXECUTED 4001a914: 10 80 00 12 b 4001a95c <== NOT EXECUTED 4001a918: 82 10 20 0e mov 0xe, %g1 ! e <== NOT EXECUTED /* * Now process the stat() request. */ iop = rtems_libio_iop( fd ); 4001a91c: c2 00 62 e4 ld [ %g1 + 0x2e4 ], %g1 4001a920: 80 a6 00 01 cmp %i0, %g1 4001a924: 1a 80 00 0b bcc 4001a950 4001a928: 83 2e 20 03 sll %i0, 3, %g1 4001a92c: b1 2e 20 06 sll %i0, 6, %i0 4001a930: b0 26 00 01 sub %i0, %g1, %i0 4001a934: 03 10 00 78 sethi %hi(0x4001e000), %g1 4001a938: c2 00 60 70 ld [ %g1 + 0x70 ], %g1 ! 4001e070 4001a93c: b0 00 40 18 add %g1, %i0, %i0 rtems_libio_check_fd( fd ); rtems_libio_check_is_open(iop); 4001a940: c2 06 20 10 ld [ %i0 + 0x10 ], %g1 4001a944: 80 88 61 00 btst 0x100, %g1 4001a948: 12 80 00 08 bne 4001a968 4001a94c: 94 10 20 48 mov 0x48, %o2 /* * Now process the stat() request. */ iop = rtems_libio_iop( fd ); rtems_libio_check_fd( fd ); 4001a950: 7f ff d0 47 call 4000ea6c <__errno> 4001a954: 01 00 00 00 nop 4001a958: 82 10 20 09 mov 9, %g1 ! 9 4001a95c: c2 22 00 00 st %g1, [ %o0 ] 4001a960: 81 c7 e0 08 ret 4001a964: 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) ); 4001a968: 90 10 00 19 mov %i1, %o0 4001a96c: 7f ff d2 ce call 4000f4a4 4001a970: 92 10 20 00 clr %o1 return (*iop->pathinfo.handlers->fstat_h)( &iop->pathinfo, sbuf ); 4001a974: c2 06 20 24 ld [ %i0 + 0x24 ], %g1 4001a978: 90 06 20 14 add %i0, 0x14, %o0 4001a97c: c2 00 60 18 ld [ %g1 + 0x18 ], %g1 4001a980: 9f c0 40 00 call %g1 4001a984: 92 10 00 19 mov %i1, %o1 } 4001a988: 81 c7 e0 08 ret 4001a98c: 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 67 sethi %hi(0x40019c00), %g1 40002f1c: c2 00 62 58 ld [ %g1 + 0x258 ], %g1 ! 40019e58 40002f20: 80 a2 00 01 cmp %o0, %g1 40002f24: 1a 80 00 1e bcc 40002f9c <== NEVER TAKEN 40002f28: 03 10 00 67 sethi %hi(0x40019c00), %g1 40002f2c: c2 00 62 5c ld [ %g1 + 0x25c ], %g1 ! 40019e5c 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 =============================================================================== 40030984 : int getdents( int dd_fd, char *dd_buf, int dd_len ) { 40030984: 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 ); 40030988: 03 10 00 da sethi %hi(0x40036800), %g1 4003098c: c2 00 61 6c ld [ %g1 + 0x16c ], %g1 ! 4003696c 40030990: 80 a6 00 01 cmp %i0, %g1 40030994: 1a 80 00 08 bcc 400309b4 <== NEVER TAKEN 40030998: ba 10 20 00 clr %i5 4003099c: 83 2e 20 03 sll %i0, 3, %g1 400309a0: b1 2e 20 06 sll %i0, 6, %i0 400309a4: b0 26 00 01 sub %i0, %g1, %i0 400309a8: 03 10 01 1d sethi %hi(0x40047400), %g1 400309ac: fa 00 60 50 ld [ %g1 + 0x50 ], %i5 ! 40047450 400309b0: ba 07 40 18 add %i5, %i0, %i5 /* * Make sure we are working on a directory */ type = rtems_filesystem_node_type( &iop->pathinfo ); 400309b4: 7f ff 63 10 call 400095f4 400309b8: 90 07 60 14 add %i5, 0x14, %o0 if ( type != RTEMS_FILESYSTEM_DIRECTORY ) 400309bc: 80 a2 20 00 cmp %o0, 0 400309c0: 22 80 00 08 be,a 400309e0 400309c4: c2 07 60 24 ld [ %i5 + 0x24 ], %g1 rtems_set_errno_and_return_minus_one( ENOTDIR ); 400309c8: 7f ff bd df call 40020144 <__errno> 400309cc: b0 10 3f ff mov -1, %i0 400309d0: 82 10 20 14 mov 0x14, %g1 400309d4: c2 22 00 00 st %g1, [ %o0 ] 400309d8: 81 c7 e0 08 ret 400309dc: 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 ); 400309e0: 90 10 00 1d mov %i5, %o0 400309e4: c2 00 60 08 ld [ %g1 + 8 ], %g1 400309e8: 92 10 00 19 mov %i1, %o1 400309ec: 9f c0 40 00 call %g1 400309f0: 94 10 00 1a mov %i2, %o2 } 400309f4: 81 c7 e0 08 ret 400309f8: 91 e8 00 08 restore %g0, %o0, %o0 =============================================================================== 4002382c : /** * Initialize useable but dummy databases */ void init_etc_passwd_group(void) { 4002382c: 9d e3 bf a0 save %sp, -96, %sp FILE *fp; static char etc_passwd_initted = 0; if (etc_passwd_initted) 40023830: 03 10 01 8a sethi %hi(0x40062800), %g1 40023834: c4 48 62 38 ldsb [ %g1 + 0x238 ], %g2 ! 40062a38 40023838: 80 a0 a0 00 cmp %g2, 0 4002383c: 12 80 00 2f bne 400238f8 40023840: 84 10 20 01 mov 1, %g2 return; etc_passwd_initted = 1; mkdir("/etc", 0777); 40023844: 92 10 21 ff mov 0x1ff, %o1 FILE *fp; static char etc_passwd_initted = 0; if (etc_passwd_initted) return; etc_passwd_initted = 1; 40023848: c4 28 62 38 stb %g2, [ %g1 + 0x238 ] mkdir("/etc", 0777); 4002384c: 11 10 01 68 sethi %hi(0x4005a000), %o0 40023850: 7f ff 7d b9 call 40002f34 40023854: 90 12 20 b0 or %o0, 0xb0, %o0 ! 4005a0b0 /* * Initialize /etc/passwd */ if ((fp = fopen("/etc/passwd", "r")) != NULL) { 40023858: 3b 10 01 68 sethi %hi(0x4005a000), %i5 4002385c: 13 10 01 79 sethi %hi(0x4005e400), %o1 40023860: 90 17 60 b8 or %i5, 0xb8, %o0 40023864: 40 00 4d 1f call 40036ce0 40023868: 92 12 63 c0 or %o1, 0x3c0, %o1 4002386c: 80 a2 20 00 cmp %o0, 0 40023870: 22 80 00 03 be,a 4002387c 40023874: 90 17 60 b8 or %i5, 0xb8, %o0 40023878: 30 80 00 0b b,a 400238a4 fclose(fp); } else if ((fp = fopen("/etc/passwd", "w")) != NULL) { 4002387c: 13 10 01 5e sethi %hi(0x40057800), %o1 40023880: 40 00 4d 18 call 40036ce0 40023884: 92 12 63 80 or %o1, 0x380, %o1 ! 40057b80 40023888: ba 92 20 00 orcc %o0, 0, %i5 4002388c: 02 80 00 08 be 400238ac <== NEVER TAKEN 40023890: 11 10 01 68 sethi %hi(0x4005a000), %o0 fprintf(fp, "root:*:0:0:root::/:/bin/sh\n" 40023894: 92 10 00 1d mov %i5, %o1 40023898: 40 00 4d 75 call 40036e6c 4002389c: 90 12 20 c8 or %o0, 0xc8, %o0 "rtems:*:1:1:RTEMS Application::/:/bin/sh\n" "tty:!:2:2:tty owner::/:/bin/false\n" ); fclose(fp); 400238a0: 90 10 00 1d mov %i5, %o0 400238a4: 40 00 4a b1 call 40036368 400238a8: 01 00 00 00 nop } /* * Initialize /etc/group */ if ((fp = fopen("/etc/group", "r")) != NULL) { 400238ac: 3b 10 01 68 sethi %hi(0x4005a000), %i5 400238b0: 13 10 01 79 sethi %hi(0x4005e400), %o1 400238b4: 90 17 61 30 or %i5, 0x130, %o0 400238b8: 40 00 4d 0a call 40036ce0 400238bc: 92 12 63 c0 or %o1, 0x3c0, %o1 400238c0: b0 92 20 00 orcc %o0, 0, %i0 400238c4: 12 80 00 0b bne 400238f0 400238c8: 90 17 61 30 or %i5, 0x130, %o0 fclose(fp); } else if ((fp = fopen("/etc/group", "w")) != NULL) { 400238cc: 13 10 01 5e sethi %hi(0x40057800), %o1 400238d0: 40 00 4d 04 call 40036ce0 400238d4: 92 12 63 80 or %o1, 0x380, %o1 ! 40057b80 400238d8: b0 92 20 00 orcc %o0, 0, %i0 400238dc: 02 80 00 07 be 400238f8 <== NEVER TAKEN 400238e0: 11 10 01 68 sethi %hi(0x4005a000), %o0 fprintf( fp, "root:x:0:root\n" 400238e4: 92 10 00 18 mov %i0, %o1 400238e8: 40 00 4d 61 call 40036e6c 400238ec: 90 12 21 40 or %o0, 0x140, %o0 "rtems:x:1:rtems\n" "tty:x:2:tty\n" ); fclose(fp); 400238f0: 40 00 4a 9e call 40036368 400238f4: 81 e8 00 00 restore 400238f8: 81 c7 e0 08 ret 400238fc: 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 76 sethi %hi(0x4001d800), %g2 40005a58: c4 00 a0 a0 ld [ %g2 + 0xa0 ], %g2 ! 4001d8a0 <__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 75 sethi %hi(0x4001d400), %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 75 sethi %hi(0x4001d400), %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 75 sethi %hi(0x4001d400), %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 63 24 ld [ %g1 + 0x324 ], %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 =============================================================================== 4001ad34 : int killinfo( pid_t pid, int sig, const union sigval *value ) { 4001ad34: 9d e3 bf 90 save %sp, -112, %sp POSIX_signals_Siginfo_node *psiginfo; /* * Only supported for the "calling process" (i.e. this node). */ if ( pid != getpid() ) 4001ad38: 7f ff ff 1b call 4001a9a4 4001ad3c: 01 00 00 00 nop 4001ad40: 80 a6 00 08 cmp %i0, %o0 4001ad44: 02 80 00 06 be 4001ad5c 4001ad48: 80 a6 60 00 cmp %i1, 0 rtems_set_errno_and_return_minus_one( ESRCH ); 4001ad4c: 7f ff cf 48 call 4000ea6c <__errno> 4001ad50: 01 00 00 00 nop 4001ad54: 10 80 00 a6 b 4001afec 4001ad58: 82 10 20 03 mov 3, %g1 ! 3 /* * Validate the signal passed. */ if ( !sig ) 4001ad5c: 32 80 00 03 bne,a 4001ad68 4001ad60: ba 06 7f ff add %i1, -1, %i5 4001ad64: 30 80 00 04 b,a 4001ad74 rtems_set_errno_and_return_minus_one( EINVAL ); if ( !is_valid_signo(sig) ) 4001ad68: 80 a7 60 1f cmp %i5, 0x1f 4001ad6c: 28 80 00 06 bleu,a 4001ad84 4001ad70: 83 2e 60 02 sll %i1, 2, %g1 rtems_set_errno_and_return_minus_one( EINVAL ); 4001ad74: 7f ff cf 3e call 4000ea6c <__errno> 4001ad78: 01 00 00 00 nop 4001ad7c: 10 80 00 9c b 4001afec 4001ad80: 82 10 20 16 mov 0x16, %g1 ! 16 /* * If the signal is being ignored, then we are out of here. */ if ( _POSIX_signals_Vectors[ sig ].sa_handler == SIG_IGN ) 4001ad84: 85 2e 60 04 sll %i1, 4, %g2 4001ad88: 84 20 80 01 sub %g2, %g1, %g2 4001ad8c: 03 10 00 79 sethi %hi(0x4001e400), %g1 4001ad90: 82 10 63 70 or %g1, 0x370, %g1 ! 4001e770 <_POSIX_signals_Vectors> 4001ad94: 82 00 40 02 add %g1, %g2, %g1 4001ad98: c2 00 60 08 ld [ %g1 + 8 ], %g1 4001ad9c: 80 a0 60 01 cmp %g1, 1 4001ada0: 02 80 00 9f be 4001b01c 4001ada4: 80 a6 60 04 cmp %i1, 4 /* * P1003.1c/Draft 10, p. 33 says that certain signals should always * be directed to the executing thread such as those caused by hardware * faults. */ if ( (sig == SIGFPE) || (sig == SIGILL) || (sig == SIGSEGV ) ) 4001ada8: 02 80 00 06 be 4001adc0 4001adac: 80 a6 60 08 cmp %i1, 8 4001adb0: 02 80 00 04 be 4001adc0 4001adb4: 80 a6 60 0b cmp %i1, 0xb 4001adb8: 12 80 00 08 bne 4001add8 4001adbc: 82 10 20 01 mov 1, %g1 return pthread_kill( pthread_self(), sig ); 4001adc0: 40 00 01 33 call 4001b28c 4001adc4: 01 00 00 00 nop 4001adc8: 40 00 00 f4 call 4001b198 4001adcc: 92 10 00 19 mov %i1, %o1 4001add0: 81 c7 e0 08 ret 4001add4: 91 e8 00 08 restore %g0, %o0, %o0 /* * Build up a siginfo structure */ siginfo = &siginfo_struct; siginfo->si_signo = sig; 4001add8: f2 27 bf f4 st %i1, [ %fp + -12 ] siginfo->si_code = SI_USER; 4001addc: c2 27 bf f8 st %g1, [ %fp + -8 ] if ( !value ) { 4001ade0: 80 a6 a0 00 cmp %i2, 0 4001ade4: 12 80 00 04 bne 4001adf4 4001ade8: bb 28 40 1d sll %g1, %i5, %i5 siginfo->si_value.sival_int = 0; 4001adec: 10 80 00 04 b 4001adfc 4001adf0: c0 27 bf fc clr [ %fp + -4 ] } else { siginfo->si_value = *value; 4001adf4: c2 06 80 00 ld [ %i2 ], %g1 4001adf8: c2 27 bf fc st %g1, [ %fp + -4 ] * * 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; 4001adfc: 03 10 00 78 sethi %hi(0x4001e000), %g1 4001ae00: c4 00 62 00 ld [ %g1 + 0x200 ], %g2 ! 4001e200 <_Thread_Dispatch_disable_level> ++level; 4001ae04: 84 00 a0 01 inc %g2 _Thread_Dispatch_disable_level = level; 4001ae08: c4 20 62 00 st %g2, [ %g1 + 0x200 ] */ void _POSIX_signals_Manager_Initialization(void); static inline void _POSIX_signals_Add_post_switch_extension(void) { _API_extensions_Add_post_switch( &_POSIX_signals_Post_switch ); 4001ae0c: 11 10 00 75 sethi %hi(0x4001d400), %o0 4001ae10: 7f ff b2 bb call 400078fc <_API_extensions_Add_post_switch> 4001ae14: 90 12 23 e8 or %o0, 0x3e8, %o0 ! 4001d7e8 <_POSIX_signals_Post_switch> /* * Is the currently executing thread interested? If so then it will * get it an execute it as soon as the dispatcher executes. */ the_thread = _Thread_Executing; 4001ae18: 03 10 00 79 sethi %hi(0x4001e400), %g1 4001ae1c: d0 00 63 20 ld [ %g1 + 0x320 ], %o0 ! 4001e720 <_Per_CPU_Information+0x10> api = the_thread->API_Extensions[ THREAD_API_POSIX ]; if ( _POSIX_signals_Is_interested( api, mask ) ) { 4001ae20: c4 02 21 50 ld [ %o0 + 0x150 ], %g2 4001ae24: c4 00 a0 d0 ld [ %g2 + 0xd0 ], %g2 4001ae28: 80 af 40 02 andncc %i5, %g2, %g0 4001ae2c: 12 80 00 52 bne 4001af74 4001ae30: 03 10 00 7a sethi %hi(0x4001e800), %g1 /* XXX violation of visibility -- need to define thread queue support */ the_chain = &_POSIX_signals_Wait_queue.Queues.Fifo; for ( the_node = _Chain_First( the_chain ); 4001ae34: 05 10 00 7a sethi %hi(0x4001e800), %g2 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_First( Chain_Control *the_chain ) { return _Chain_Head( the_chain )->next; 4001ae38: c2 00 60 fc ld [ %g1 + 0xfc ], %g1 4001ae3c: 10 80 00 0a b 4001ae64 4001ae40: 84 10 a1 00 or %g2, 0x100, %g2 #endif /* * Is this thread is actually blocked waiting for the signal? */ if (the_thread->Wait.option & mask) 4001ae44: 80 8f 40 04 btst %i5, %g4 4001ae48: 12 80 00 4a bne 4001af70 4001ae4c: c6 00 61 50 ld [ %g1 + 0x150 ], %g3 /* * Is this thread is blocked waiting for another signal but has * not blocked this one? */ if (~api->signals_blocked & mask) 4001ae50: c6 00 e0 d0 ld [ %g3 + 0xd0 ], %g3 4001ae54: 80 af 40 03 andncc %i5, %g3, %g0 4001ae58: 12 80 00 47 bne 4001af74 4001ae5c: 90 10 00 01 mov %g1, %o0 the_chain = &_POSIX_signals_Wait_queue.Queues.Fifo; for ( the_node = _Chain_First( the_chain ); !_Chain_Is_tail( the_chain, the_node ) ; the_node = the_node->next ) { 4001ae60: c2 00 40 00 ld [ %g1 ], %g1 /* XXX violation of visibility -- need to define thread queue support */ the_chain = &_POSIX_signals_Wait_queue.Queues.Fifo; for ( the_node = _Chain_First( the_chain ); 4001ae64: 80 a0 40 02 cmp %g1, %g2 4001ae68: 32 bf ff f7 bne,a 4001ae44 4001ae6c: c8 00 60 30 ld [ %g1 + 0x30 ], %g4 * NOTES: * * + rtems internal threads do not receive signals. */ interested = NULL; interested_priority = PRIORITY_MAXIMUM + 1; 4001ae70: 03 10 00 75 sethi %hi(0x4001d400), %g1 4001ae74: c6 08 62 1c ldub [ %g1 + 0x21c ], %g3 ! 4001d61c for (the_api = OBJECTS_CLASSIC_API; the_api <= OBJECTS_APIS_LAST; the_api++) { 4001ae78: b8 10 20 02 mov 2, %i4 * NOTES: * * + rtems internal threads do not receive signals. */ interested = NULL; interested_priority = PRIORITY_MAXIMUM + 1; 4001ae7c: 86 00 e0 01 inc %g3 * * NOTES: * * + rtems internal threads do not receive signals. */ interested = NULL; 4001ae80: 82 10 20 00 clr %g1 for (the_api = OBJECTS_CLASSIC_API; the_api <= OBJECTS_APIS_LAST; the_api++) { /* * This can occur when no one is interested and an API is not configured. */ if ( !_Objects_Information_table[ the_api ] ) 4001ae84: 1b 10 00 78 sethi %hi(0x4001e000), %o5 */ RTEMS_INLINE_ROUTINE bool _States_Is_interruptible_by_signal ( States_Control the_states ) { return (the_states & STATES_INTERRUPTIBLE_BY_SIGNAL); 4001ae88: 35 04 00 00 sethi %hi(0x10000000), %i2 */ #define _POSIX_signals_Is_interested( _api, _mask ) \ ( ~(_api)->signals_blocked & (_mask) ) int killinfo( 4001ae8c: 85 2f 20 02 sll %i4, 2, %g2 for (the_api = OBJECTS_CLASSIC_API; the_api <= OBJECTS_APIS_LAST; the_api++) { /* * This can occur when no one is interested and an API is not configured. */ if ( !_Objects_Information_table[ the_api ] ) 4001ae90: 88 13 61 64 or %o5, 0x164, %g4 4001ae94: c4 01 00 02 ld [ %g4 + %g2 ], %g2 4001ae98: 80 a0 a0 00 cmp %g2, 0 4001ae9c: 22 80 00 2f be,a 4001af58 <== NEVER TAKEN 4001aea0: b8 07 20 01 inc %i4 <== NOT EXECUTED continue; the_info = _Objects_Information_table[ the_api ][ 1 ]; 4001aea4: c4 00 a0 04 ld [ %g2 + 4 ], %g2 #endif maximum = the_info->maximum; object_table = the_info->local_table; for ( index = 1 ; index <= maximum ; index++ ) { 4001aea8: b6 10 20 01 mov 1, %i3 */ if ( !the_info ) continue; #endif maximum = the_info->maximum; 4001aeac: d8 10 a0 10 lduh [ %g2 + 0x10 ], %o4 object_table = the_info->local_table; for ( index = 1 ; index <= maximum ; index++ ) { 4001aeb0: 10 80 00 26 b 4001af48 4001aeb4: d6 00 a0 1c ld [ %g2 + 0x1c ], %o3 the_thread = (Thread_Control *) object_table[ index ]; 4001aeb8: c4 02 c0 02 ld [ %o3 + %g2 ], %g2 if ( !the_thread ) 4001aebc: 80 a0 a0 00 cmp %g2, 0 4001aec0: 22 80 00 22 be,a 4001af48 4001aec4: b6 06 e0 01 inc %i3 /* * If this thread is of lower priority than the interested thread, * go on to the next thread. */ if ( the_thread->current_priority > interested_priority ) 4001aec8: c8 00 a0 14 ld [ %g2 + 0x14 ], %g4 4001aecc: 80 a1 00 03 cmp %g4, %g3 4001aed0: 38 80 00 1e bgu,a 4001af48 4001aed4: b6 06 e0 01 inc %i3 #if defined(RTEMS_DEBUG) if ( !api ) continue; #endif if ( !_POSIX_signals_Is_interested( api, mask ) ) 4001aed8: f0 00 a1 50 ld [ %g2 + 0x150 ], %i0 4001aedc: f0 06 20 d0 ld [ %i0 + 0xd0 ], %i0 4001aee0: 80 af 40 18 andncc %i5, %i0, %g0 4001aee4: 22 80 00 19 be,a 4001af48 4001aee8: b6 06 e0 01 inc %i3 * * NOTE: We initialized interested_priority to PRIORITY_MAXIMUM + 1 * so we never have to worry about deferencing a NULL * interested thread. */ if ( the_thread->current_priority < interested_priority ) { 4001aeec: 80 a1 00 03 cmp %g4, %g3 4001aef0: 2a 80 00 14 bcs,a 4001af40 4001aef4: 86 10 00 04 mov %g4, %g3 * and blocking interruptibutable by signal. * * If the interested thread is ready, don't think about changing. */ if ( interested && !_States_Is_ready( interested->current_state ) ) { 4001aef8: 80 a0 60 00 cmp %g1, 0 4001aefc: 22 80 00 13 be,a 4001af48 <== NEVER TAKEN 4001af00: b6 06 e0 01 inc %i3 <== NOT EXECUTED 4001af04: de 00 60 10 ld [ %g1 + 0x10 ], %o7 4001af08: 80 a3 e0 00 cmp %o7, 0 4001af0c: 22 80 00 0f be,a 4001af48 <== NEVER TAKEN 4001af10: b6 06 e0 01 inc %i3 <== NOT EXECUTED /* preferred ready over blocked */ DEBUG_STEP("5"); if ( _States_Is_ready( the_thread->current_state ) ) { 4001af14: f0 00 a0 10 ld [ %g2 + 0x10 ], %i0 4001af18: 80 a6 20 00 cmp %i0, 0 4001af1c: 22 80 00 09 be,a 4001af40 4001af20: 86 10 00 04 mov %g4, %g3 continue; } DEBUG_STEP("6"); /* prefer blocked/interruptible over blocked/not interruptible */ if ( !_States_Is_interruptible_by_signal(interested->current_state) ) { 4001af24: 80 8b c0 1a btst %o7, %i2 4001af28: 32 80 00 08 bne,a 4001af48 4001af2c: b6 06 e0 01 inc %i3 DEBUG_STEP("7"); if ( _States_Is_interruptible_by_signal(the_thread->current_state) ) { 4001af30: 80 8e 00 1a btst %i0, %i2 4001af34: 22 80 00 05 be,a 4001af48 4001af38: b6 06 e0 01 inc %i3 */ if ( interested && !_States_Is_ready( interested->current_state ) ) { /* preferred ready over blocked */ DEBUG_STEP("5"); if ( _States_Is_ready( the_thread->current_state ) ) { 4001af3c: 86 10 00 04 mov %g4, %g3 4001af40: 82 10 00 02 mov %g2, %g1 #endif maximum = the_info->maximum; object_table = the_info->local_table; for ( index = 1 ; index <= maximum ; index++ ) { 4001af44: b6 06 e0 01 inc %i3 4001af48: 80 a6 c0 0c cmp %i3, %o4 4001af4c: 08 bf ff db bleu 4001aeb8 4001af50: 85 2e e0 02 sll %i3, 2, %g2 * + rtems internal threads do not receive signals. */ interested = NULL; interested_priority = PRIORITY_MAXIMUM + 1; for (the_api = OBJECTS_CLASSIC_API; the_api <= OBJECTS_APIS_LAST; the_api++) { 4001af54: b8 07 20 01 inc %i4 4001af58: 80 a7 20 04 cmp %i4, 4 4001af5c: 12 bf ff cd bne 4001ae90 4001af60: 85 2f 20 02 sll %i4, 2, %g2 } } } } if ( interested ) { 4001af64: 80 a0 60 00 cmp %g1, 0 4001af68: 02 80 00 0c be 4001af98 4001af6c: 01 00 00 00 nop /* * Is this thread is blocked waiting for another signal but has * not blocked this one? */ if (~api->signals_blocked & mask) 4001af70: 90 10 00 01 mov %g1, %o0 /* * Returns true if the signal was synchronously given to a thread * blocked waiting for the signal. */ if ( _POSIX_signals_Unblock_thread( the_thread, sig, siginfo ) ) { 4001af74: 92 10 00 19 mov %i1, %o1 4001af78: 40 00 00 36 call 4001b050 <_POSIX_signals_Unblock_thread> 4001af7c: 94 07 bf f4 add %fp, -12, %o2 4001af80: 80 8a 20 ff btst 0xff, %o0 4001af84: 02 80 00 05 be 4001af98 4001af88: 01 00 00 00 nop _Thread_Enable_dispatch(); 4001af8c: 7f ff ba 25 call 40009820 <_Thread_Enable_dispatch> 4001af90: b0 10 20 00 clr %i0 ! 0 4001af94: 30 80 00 23 b,a 4001b020 /* * We may have woken up a thread but we definitely need to post the * signal to the process wide information set. */ _POSIX_signals_Set_process_signals( mask ); 4001af98: 40 00 00 24 call 4001b028 <_POSIX_signals_Set_process_signals> 4001af9c: 90 10 00 1d mov %i5, %o0 if ( _POSIX_signals_Vectors[ sig ].sa_flags == SA_SIGINFO ) { 4001afa0: 83 2e 60 02 sll %i1, 2, %g1 4001afa4: b3 2e 60 04 sll %i1, 4, %i1 4001afa8: b2 26 40 01 sub %i1, %g1, %i1 4001afac: 03 10 00 79 sethi %hi(0x4001e400), %g1 4001afb0: 82 10 63 70 or %g1, 0x370, %g1 ! 4001e770 <_POSIX_signals_Vectors> 4001afb4: c2 00 40 19 ld [ %g1 + %i1 ], %g1 4001afb8: 80 a0 60 02 cmp %g1, 2 4001afbc: 12 bf ff f4 bne 4001af8c 4001afc0: 11 10 00 7a sethi %hi(0x4001e800), %o0 psiginfo = (POSIX_signals_Siginfo_node *) 4001afc4: 7f ff b2 b3 call 40007a90 <_Chain_Get> 4001afc8: 90 12 20 f0 or %o0, 0xf0, %o0 ! 4001e8f0 <_POSIX_signals_Inactive_siginfo> _Chain_Get( &_POSIX_signals_Inactive_siginfo ); if ( !psiginfo ) { 4001afcc: ba 92 20 00 orcc %o0, 0, %i5 4001afd0: 12 80 00 0a bne 4001aff8 4001afd4: 92 07 bf f4 add %fp, -12, %o1 _Thread_Enable_dispatch(); 4001afd8: 7f ff ba 12 call 40009820 <_Thread_Enable_dispatch> 4001afdc: 01 00 00 00 nop rtems_set_errno_and_return_minus_one( EAGAIN ); 4001afe0: 7f ff ce a3 call 4000ea6c <__errno> 4001afe4: 01 00 00 00 nop 4001afe8: 82 10 20 0b mov 0xb, %g1 ! b 4001afec: c2 22 00 00 st %g1, [ %o0 ] 4001aff0: 81 c7 e0 08 ret 4001aff4: 91 e8 3f ff restore %g0, -1, %o0 } psiginfo->Info = *siginfo; 4001aff8: 90 07 60 08 add %i5, 8, %o0 4001affc: 7f ff d0 ed call 4000f3b0 4001b000: 94 10 20 0c mov 0xc, %o2 _Chain_Append( &_POSIX_signals_Siginfo[ sig ], &psiginfo->Node ); 4001b004: 11 10 00 7a sethi %hi(0x4001e800), %o0 4001b008: 92 10 00 1d mov %i5, %o1 4001b00c: 90 12 21 68 or %o0, 0x168, %o0 4001b010: 7f ff b2 94 call 40007a60 <_Chain_Append> 4001b014: 90 02 00 19 add %o0, %i1, %o0 4001b018: 30 bf ff dd b,a 4001af8c /* * If the signal is being ignored, then we are out of here. */ if ( _POSIX_signals_Vectors[ sig ].sa_handler == SIG_IGN ) return 0; 4001b01c: b0 10 20 00 clr %i0 } DEBUG_STEP("\n"); _Thread_Enable_dispatch(); return 0; } 4001b020: 81 c7 e0 08 ret 4001b024: 81 e8 00 00 restore =============================================================================== 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 79 sethi %hi(0x4001e400), %g1 40003854: c2 00 63 08 ld [ %g1 + 0x308 ], %g1 ! 4001e708 <_System_state_Current> 40003858: 80 a0 60 03 cmp %g1, 3 4000385c: 12 80 00 16 bne 400038b4 <== NEVER TAKEN 40003860: 03 10 00 72 sethi %hi(0x4001c800), %g1 /* * This was already done if the user called exit() directly . _wrapup_reent(0); */ if (_REENT != _global_impure_ptr) { 40003864: 39 10 00 76 sethi %hi(0x4001d800), %i4 40003868: fa 00 63 f0 ld [ %g1 + 0x3f0 ], %i5 4000386c: c2 07 20 a8 ld [ %i4 + 0xa8 ], %g1 40003870: 80 a0 40 1d cmp %g1, %i5 40003874: 22 80 00 06 be,a 4000388c 40003878: 3b 10 00 76 sethi %hi(0x4001d800), %i5 _wrapup_reent(_global_impure_ptr); 4000387c: 40 00 2f ab call 4000f728 <_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 20 a8 st %i5, [ %i4 + 0xa8 ] * * Should this be changed to do *all* file streams? * _fwalk (_REENT, fclose); */ fclose (stdin); 40003888: 3b 10 00 76 sethi %hi(0x4001d800), %i5 4000388c: c2 07 60 a8 ld [ %i5 + 0xa8 ], %g1 ! 4001d8a8 <_impure_ptr> 40003890: 40 00 2c c9 call 4000ebb4 40003894: d0 00 60 04 ld [ %g1 + 4 ], %o0 fclose (stdout); 40003898: c2 07 60 a8 ld [ %i5 + 0xa8 ], %g1 4000389c: 40 00 2c c6 call 4000ebb4 400038a0: d0 00 60 08 ld [ %g1 + 8 ], %o0 fclose (stderr); 400038a4: c2 07 60 a8 ld [ %i5 + 0xa8 ], %g1 400038a8: f0 00 60 0c ld [ %g1 + 0xc ], %i0 400038ac: 40 00 2c c2 call 4000ebb4 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 78 sethi %hi(0x4001e000), %g1 40003324: 82 10 60 80 or %g1, 0x80, %g1 ! 4001e080 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 79 sethi %hi(0x4001e400), %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 63 08 ld [ %g1 + 0x308 ], %g1 40003350: 80 a0 60 03 cmp %g1, 3 40003354: 02 80 00 0c be 40003384 40003358: 39 10 00 75 sethi %hi(0x4001d400), %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 22 a0 ld [ %i4 + 0x2a0 ], %o0 ! 4001d6a0 40003360: 92 10 00 18 mov %i0, %o1 40003364: 94 10 20 00 clr %o2 40003368: 40 00 16 3f call 40008c64 <_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 77 sethi %hi(0x4001dc00), %g1 return_this = (*rtems_malloc_extend_handler)( RTEMS_Malloc_Heap, size ); 4000337c: 10 80 00 09 b 400033a0 40003380: d0 07 22 a0 ld [ %i4 + 0x2a0 ], %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 6d sethi %hi(0x4001b400), %g1 400033a4: c2 00 63 a0 ld [ %g1 + 0x3a0 ], %g1 ! 4001b7a0 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 77 sethi %hi(0x4001dc00), %g1 errno = ENOMEM; 400033bc: 40 00 2d ac call 4000ea6c <__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 61 cc ld [ %g1 + 0x1cc ], %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 77 sethi %hi(0x4001dc00), %g1 400033f0: c2 00 61 d0 ld [ %g1 + 0x1d0 ], %g1 ! 4001ddd0 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 =============================================================================== 4000d130 : * Allocate a block for an in-memory file. */ int memfile_blocks_allocated = 0; void *memfile_alloc_block(void) { 4000d130: 9d e3 bf a0 save %sp, -96, %sp void *memory; memory = (void *)calloc(1, IMFS_MEMFILE_BYTES_PER_BLOCK); 4000d134: 03 10 00 77 sethi %hi(0x4001dc00), %g1 4000d138: d2 00 61 e0 ld [ %g1 + 0x1e0 ], %o1 ! 4001dde0 4000d13c: 7f ff d6 f1 call 40002d00 4000d140: 90 10 20 01 mov 1, %o0 if ( memory ) 4000d144: b0 92 20 00 orcc %o0, 0, %i0 4000d148: 02 80 00 05 be 4000d15c <== NEVER TAKEN 4000d14c: 03 10 00 77 sethi %hi(0x4001dc00), %g1 memfile_blocks_allocated++; 4000d150: c4 00 62 f4 ld [ %g1 + 0x2f4 ], %g2 ! 4001def4 4000d154: 84 00 a0 01 inc %g2 4000d158: c4 20 62 f4 st %g2, [ %g1 + 0x2f4 ] return memory; } 4000d15c: 81 c7 e0 08 ret 4000d160: 81 e8 00 00 restore =============================================================================== 4000dc58 : int memfile_ftruncate( rtems_libio_t *iop, off_t length ) { 4000dc58: 9d e3 bf 98 save %sp, -104, %sp <== NOT EXECUTED IMFS_jnode_t *the_jnode; the_jnode = iop->pathinfo.node_access; 4000dc5c: 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 ) 4000dc60: c2 07 60 50 ld [ %i5 + 0x50 ], %g1 <== NOT EXECUTED 4000dc64: 80 a0 40 19 cmp %g1, %i1 <== NOT EXECUTED 4000dc68: 06 80 00 09 bl 4000dc8c <== NOT EXECUTED 4000dc6c: 90 10 00 1d mov %i5, %o0 <== NOT EXECUTED 4000dc70: 32 80 00 0d bne,a 4000dca4 <== NOT EXECUTED 4000dc74: f2 27 60 50 st %i1, [ %i5 + 0x50 ] <== NOT EXECUTED 4000dc78: c2 07 60 54 ld [ %i5 + 0x54 ], %g1 <== NOT EXECUTED 4000dc7c: 80 a0 40 1a cmp %g1, %i2 <== NOT EXECUTED 4000dc80: 3a 80 00 09 bcc,a 4000dca4 <== NOT EXECUTED 4000dc84: f2 27 60 50 st %i1, [ %i5 + 0x50 ] <== NOT EXECUTED return IMFS_memfile_extend( the_jnode, true, length ); 4000dc88: 90 10 00 1d mov %i5, %o0 <== NOT EXECUTED 4000dc8c: 92 10 20 01 mov 1, %o1 <== NOT EXECUTED 4000dc90: 94 10 00 19 mov %i1, %o2 <== NOT EXECUTED 4000dc94: 7f ff fe df call 4000d810 <== NOT EXECUTED 4000dc98: 96 10 00 1a mov %i2, %o3 <== NOT EXECUTED 4000dc9c: 81 c7 e0 08 ret <== NOT EXECUTED 4000dca0: 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; 4000dca4: f4 27 60 54 st %i2, [ %i5 + 0x54 ] <== NOT EXECUTED IMFS_update_atime( the_jnode ); 4000dca8: 90 07 bf f8 add %fp, -8, %o0 <== NOT EXECUTED 4000dcac: 7f ff d4 f2 call 40003074 <== NOT EXECUTED 4000dcb0: 92 10 20 00 clr %o1 <== NOT EXECUTED 4000dcb4: c2 07 bf f8 ld [ %fp + -8 ], %g1 <== NOT EXECUTED 4000dcb8: c2 27 60 40 st %g1, [ %i5 + 0x40 ] <== NOT EXECUTED return 0; } 4000dcbc: 81 c7 e0 08 ret <== NOT EXECUTED 4000dcc0: 91 e8 20 00 restore %g0, 0, %o0 <== NOT EXECUTED =============================================================================== 4000dbdc : rtems_libio_t *iop, const char *pathname, int oflag, mode_t mode ) { 4000dbdc: 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) 4000dbe0: c2 06 20 10 ld [ %i0 + 0x10 ], %g1 4000dbe4: 80 88 60 04 btst 4, %g1 4000dbe8: 12 80 00 04 bne 4000dbf8 4000dbec: d0 06 20 1c ld [ %i0 + 0x1c ], %o0 if ((count != 0) && (IMFS_memfile_write(the_jnode, 0, buffer, count) == -1)) return -1; } return 0; 4000dbf0: 81 c7 e0 08 ret 4000dbf4: 91 e8 20 00 restore %g0, 0, %o0 4000dbf8: 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)) { 4000dbfc: c2 00 40 00 ld [ %g1 ], %g1 4000dc00: 80 a0 60 05 cmp %g1, 5 4000dc04: 12 bf ff fb bne 4000dbf0 <== ALWAYS TAKEN 4000dc08: 03 10 00 71 sethi %hi(0x4001c400), %g1 uint32_t count = the_jnode->info.linearfile.size; 4000dc0c: d8 02 20 54 ld [ %o0 + 0x54 ], %o4 <== NOT EXECUTED const unsigned char *buffer = the_jnode->info.linearfile.direct; 4000dc10: d6 02 20 58 ld [ %o0 + 0x58 ], %o3 <== NOT EXECUTED the_jnode->control = &IMFS_node_control_memfile; the_jnode->info.file.size = 0; 4000dc14: 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; 4000dc18: 82 10 62 1c or %g1, 0x21c, %g1 <== NOT EXECUTED the_jnode->info.file.size = 0; 4000dc1c: 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; 4000dc20: c2 22 20 4c st %g1, [ %o0 + 0x4c ] <== NOT EXECUTED the_jnode->info.file.size = 0; the_jnode->info.file.indirect = 0; 4000dc24: c0 22 20 58 clr [ %o0 + 0x58 ] <== NOT EXECUTED the_jnode->info.file.doubly_indirect = 0; 4000dc28: c0 22 20 5c clr [ %o0 + 0x5c ] <== NOT EXECUTED the_jnode->info.file.triply_indirect = 0; if ((count != 0) 4000dc2c: 80 a3 20 00 cmp %o4, 0 <== NOT EXECUTED 4000dc30: 02 bf ff f0 be 4000dbf0 <== NOT EXECUTED 4000dc34: c0 22 20 60 clr [ %o0 + 0x60 ] <== NOT EXECUTED && (IMFS_memfile_write(the_jnode, 0, buffer, count) == -1)) 4000dc38: 92 10 20 00 clr %o1 <== NOT EXECUTED 4000dc3c: 7f ff ff 5d call 4000d9b0 <== NOT EXECUTED 4000dc40: 94 10 20 00 clr %o2 <== NOT EXECUTED return -1; 4000dc44: 90 38 00 08 xnor %g0, %o0, %o0 <== NOT EXECUTED 4000dc48: 80 a0 00 08 cmp %g0, %o0 <== NOT EXECUTED 4000dc4c: b0 40 3f ff addx %g0, -1, %i0 <== NOT EXECUTED } return 0; } 4000dc50: 81 c7 e0 08 ret <== NOT EXECUTED 4000dc54: 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 a4 call 4000b7d8 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 70 sethi %hi(0x4001c000), %l1 40003568: a2 14 62 38 or %l1, 0x238, %l1 ! 4001c238 size_t filesystemtype_size = strlen( filesystemtype ) + 1; 4000356c: 40 00 32 c7 call 40010088 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 32 c1 call 40010088 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 32 bb call 40010088 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 2f 79 call 4000f3b0 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 2f 70 call 4000f3b0 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 2f 6a call 4000f3b0 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 70 sethi %hi(0x4001c000), %g1 4000361c: 82 10 62 3c or %g1, 0x23c, %g1 ! 4001c23c 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 22 call 40007acc <_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 78 sethi %hi(0x4001e000), %i4 400036dc: d0 07 20 78 ld [ %i4 + 0x78 ], %o0 ! 4001e078 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 75 sethi %hi(0x4001d400), %g1 } static inline void rtems_libio_unlock( void ) { rtems_semaphore_release( rtems_libio_semaphore ); 400036ec: d0 07 20 78 ld [ %i4 + 0x78 ], %o0 400036f0: 82 10 63 0c or %g1, 0x30c, %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 78 sethi %hi(0x4001e000), %g1 40003750: d0 00 60 78 ld [ %g1 + 0x78 ], %o0 ! 4001e078 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 75 sethi %hi(0x4001d400), %g2 ) { int rv = 0; rtems_filesystem_mt_lock(); if ( rtems_chain_is_empty( &rtems_filesystem_mount_table ) ) { 40003764: c6 00 a3 0c ld [ %g2 + 0x30c ], %g3 ! 4001d70c 40003768: 82 10 a3 0c or %g2, 0x30c, %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 2c b6 call 4000ea6c <__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 78 sethi %hi(0x4001e000), %g1 400037a8: 40 00 0e 3b call 40007094 400037ac: d0 00 60 78 ld [ %g1 + 0x78 ], %o0 ! 4001e078 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 75 sethi %hi(0x4001d400), %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 63 2c ld [ %i5 + 0x32c ], %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 63 2c ld [ %i5 + 0x32c ], %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 2c 97 call 4000ea6c <__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 2c 8f call 4000ea6c <__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 60 5d call 40020144 <__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 =============================================================================== 40016a9c : msdos_node_type_t type, const char *name, int name_len, mode_t mode, const fat_file_fd_t *link_fd) { 40016a9c: 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; 40016aa0: 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); 40016aa4: 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; 40016aa8: 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; 40016aac: 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); 40016ab0: 94 10 20 20 mov 0x20, %o2 40016ab4: c2 27 bf 78 st %g1, [ %fp + -136 ] dir_pos->lname.ofs = FAT_FILE_SHORT_NAME; 40016ab8: 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; 40016abc: e0 06 20 08 ld [ %i0 + 8 ], %l0 fat_file_fd_t *fat_fd = NULL; 40016ac0: c0 27 bf 6c clr [ %fp + -148 ] time_t time_ret = 0; uint16_t time_val = 0; 40016ac4: c0 37 bf 68 clrh [ %fp + -152 ] uint16_t date = 0; 40016ac8: 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; 40016acc: c0 27 bf 70 clr [ %fp + -144 ] dir_pos->sname.ofs = 0; 40016ad0: 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); 40016ad4: 40 00 12 60 call 4001b454 40016ad8: 90 07 bf 80 add %fp, -128, %o0 memset(dot_dotdot, 0, MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE * 2); 40016adc: 90 07 bf c0 add %fp, -64, %o0 40016ae0: 92 10 20 00 clr %o1 40016ae4: 40 00 12 5c call 4001b454 40016ae8: 94 10 20 40 mov 0x40, %o2 if (name_len > MSDOS_NAME_MAX_LFN_WITH_DOT) { 40016aec: 80 a6 e1 04 cmp %i3, 0x104 40016af0: 24 80 00 06 ble,a 40016b08 <== ALWAYS TAKEN 40016af4: 90 10 00 1a mov %i2, %o0 rtems_set_errno_and_return_minus_one(ENAMETOOLONG); 40016af8: 40 00 0f 75 call 4001a8cc <__errno> <== NOT EXECUTED 40016afc: 01 00 00 00 nop <== NOT EXECUTED 40016b00: 10 80 00 0c b 40016b30 <== NOT EXECUTED 40016b04: 82 10 20 5b mov 0x5b, %g1 ! 5b <== NOT EXECUTED } name_type = msdos_long_to_short (name, name_len, 40016b08: 92 10 00 1b mov %i3, %o1 40016b0c: 94 07 bf 80 add %fp, -128, %o2 40016b10: 40 00 01 45 call 40017024 40016b14: 96 10 20 0b mov 0xb, %o3 MSDOS_DIR_NAME(short_node), MSDOS_NAME_MAX); if (name_type == MSDOS_NAME_INVALID) { 40016b18: a4 92 20 00 orcc %o0, 0, %l2 40016b1c: 32 80 00 08 bne,a 40016b3c <== ALWAYS TAKEN 40016b20: c0 2f bf 8c clrb [ %fp + -116 ] rtems_set_errno_and_return_minus_one(EINVAL); 40016b24: 40 00 0f 6a call 4001a8cc <__errno> <== NOT EXECUTED 40016b28: 01 00 00 00 nop <== NOT EXECUTED 40016b2c: 82 10 20 16 mov 0x16, %g1 ! 16 <== NOT EXECUTED 40016b30: c2 22 00 00 st %g1, [ %o0 ] <== NOT EXECUTED 40016b34: 10 80 00 ce b 40016e6c <== NOT EXECUTED 40016b38: 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); 40016b3c: 40 00 21 09 call 4001ef60