=============================================================================== 4000b81c : int IMFS_chown( const rtems_filesystem_location_info_t *loc, uid_t owner, gid_t group ) { 4000b81c: 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(); 4000b820: 40 00 02 5c call 4000c190 4000b824: fa 06 20 08 ld [ %i0 + 8 ], %i5 if ( ( st_uid != jnode->st_uid ) && ( st_uid != 0 ) ) 4000b828: c2 17 60 3c lduh [ %i5 + 0x3c ], %g1 4000b82c: 91 2a 20 10 sll %o0, 0x10, %o0 4000b830: 91 32 20 10 srl %o0, 0x10, %o0 4000b834: 80 a2 00 01 cmp %o0, %g1 4000b838: 02 80 00 0a be 4000b860 <== ALWAYS TAKEN 4000b83c: 80 a2 20 00 cmp %o0, 0 4000b840: 22 80 00 09 be,a 4000b864 <== NOT EXECUTED 4000b844: f2 37 60 3c sth %i1, [ %i5 + 0x3c ] <== NOT EXECUTED rtems_set_errno_and_return_minus_one( EPERM ); 4000b848: 40 00 10 76 call 4000fa20 <__errno> <== NOT EXECUTED 4000b84c: b0 10 3f ff mov -1, %i0 <== NOT EXECUTED 4000b850: 82 10 20 01 mov 1, %g1 <== NOT EXECUTED 4000b854: c2 22 00 00 st %g1, [ %o0 ] <== NOT EXECUTED 4000b858: 81 c7 e0 08 ret <== NOT EXECUTED 4000b85c: 81 e8 00 00 restore <== NOT EXECUTED #endif jnode->st_uid = owner; 4000b860: f2 37 60 3c sth %i1, [ %i5 + 0x3c ] jnode->st_gid = group; 4000b864: f4 37 60 3e sth %i2, [ %i5 + 0x3e ] static inline void IMFS_update_ctime( IMFS_jnode_t *jnode ) { struct timeval now; gettimeofday( &now, 0 ); 4000b868: 90 07 bf f8 add %fp, -8, %o0 4000b86c: 7f ff e0 12 call 400038b4 4000b870: 92 10 20 00 clr %o1 jnode->stat_ctime = now.tv_sec; 4000b874: c2 07 bf f8 ld [ %fp + -8 ], %g1 4000b878: c2 27 60 48 st %g1, [ %i5 + 0x48 ] IMFS_update_ctime( jnode ); return 0; } 4000b87c: 81 c7 e0 08 ret 4000b880: 91 e8 20 00 restore %g0, 0, %o0 =============================================================================== 40006108 : */ static void IMFS_dump_directory( IMFS_jnode_t *the_directory, int level ) { 40006108: 9d e3 bf a0 save %sp, -96, %sp */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_First( Chain_Control *the_chain ) { return _Chain_Head( the_chain )->next; 4000610c: 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, "...." ); 40006110: 37 10 00 90 sethi %hi(0x40024000), %i3 case IMFS_FIFO: fprintf(stdout, " FIFO not printed\n" ); return; default: fprintf(stdout, " bad type %d\n", IMFS_type( the_jnode ) ); 40006114: 35 10 00 90 sethi %hi(0x40024000), %i2 ) { IMFS_assert( the_jnode ); fprintf(stdout, "%s", the_jnode->name ); switch( IMFS_type( the_jnode ) ) { 40006118: 21 10 00 18 sethi %hi(0x40006000), %l0 default: fprintf(stdout, " bad type %d\n", IMFS_type( the_jnode ) ); return; } puts(""); 4000611c: 23 10 00 91 sethi %hi(0x40024400), %l1 case IMFS_SYM_LINK: fprintf(stdout, " links not printed\n" ); return; case IMFS_FIFO: fprintf(stdout, " FIFO not printed\n" ); 40006120: 25 10 00 90 sethi %hi(0x40024000), %l2 the_node = the_node->next ) { the_jnode = (IMFS_jnode_t *) the_node; for ( i=0 ; i<=level ; i++ ) fprintf(stdout, "...." ); 40006124: b6 16 e0 18 or %i3, 0x18, %i3 case IMFS_FIFO: fprintf(stdout, " FIFO not printed\n" ); return; default: fprintf(stdout, " bad type %d\n", IMFS_type( the_jnode ) ); 40006128: b4 16 a0 88 or %i2, 0x88, %i2 ) { IMFS_assert( the_jnode ); fprintf(stdout, "%s", the_jnode->name ); switch( IMFS_type( the_jnode ) ) { 4000612c: a0 14 20 ec or %l0, 0xec, %l0 default: fprintf(stdout, " bad type %d\n", IMFS_type( the_jnode ) ); return; } puts(""); 40006130: a2 14 60 a0 or %l1, 0xa0, %l1 case IMFS_SYM_LINK: fprintf(stdout, " links not printed\n" ); return; case IMFS_FIFO: fprintf(stdout, " FIFO not printed\n" ); 40006134: a4 14 a0 70 or %l2, 0x70, %l2 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 )); 40006138: 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 ); 4000613c: 80 a7 40 01 cmp %i5, %g1 40006140: 02 80 00 5c be 400062b0 40006144: b8 10 20 00 clr %i4 !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++ ) 40006148: 80 a7 00 19 cmp %i4, %i1 4000614c: 14 80 00 09 bg 40006170 40006150: 01 00 00 00 nop fprintf(stdout, "...." ); 40006154: 7f ff ec 56 call 400012ac <__getreent> 40006158: b8 07 20 01 inc %i4 4000615c: d2 02 20 08 ld [ %o0 + 8 ], %o1 40006160: 40 00 39 5a call 400146c8 40006164: 90 10 00 1b mov %i3, %o0 !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++ ) 40006168: 10 bf ff f9 b 4000614c 4000616c: 80 a7 00 19 cmp %i4, %i1 IMFS_jnode_t *the_jnode ) { IMFS_assert( the_jnode ); fprintf(stdout, "%s", the_jnode->name ); 40006170: 7f ff ec 4f call 400012ac <__getreent> 40006174: 01 00 00 00 nop 40006178: d2 02 20 08 ld [ %o0 + 8 ], %o1 4000617c: 40 00 39 53 call 400146c8 40006180: 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; 40006184: c2 07 60 4c ld [ %i5 + 0x4c ], %g1 switch( IMFS_type( the_jnode ) ) { 40006188: c2 00 40 00 ld [ %g1 ], %g1 4000618c: 80 a0 60 06 cmp %g1, 6 40006190: 18 80 00 33 bgu 4000625c <== NEVER TAKEN 40006194: 01 00 00 00 nop 40006198: 83 28 60 02 sll %g1, 2, %g1 4000619c: c2 04 00 01 ld [ %l0 + %g1 ], %g1 400061a0: 81 c0 40 00 jmp %g1 400061a4: 01 00 00 00 nop case IMFS_DIRECTORY: fprintf(stdout, "/" ); 400061a8: 7f ff ec 41 call 400012ac <__getreent> 400061ac: 01 00 00 00 nop 400061b0: d2 02 20 08 ld [ %o0 + 8 ], %o1 400061b4: 40 00 39 11 call 400145f8 400061b8: 90 10 20 2f mov 0x2f, %o0 400061bc: 30 80 00 31 b,a 40006280 break; case IMFS_DEVICE: fprintf(stdout, " (device %" PRId32 ", %" PRId32 ")", 400061c0: 7f ff ec 3b call 400012ac <__getreent> 400061c4: 01 00 00 00 nop 400061c8: 13 10 00 90 sethi %hi(0x40024000), %o1 400061cc: d0 02 20 08 ld [ %o0 + 8 ], %o0 400061d0: 92 12 60 20 or %o1, 0x20, %o1 400061d4: 10 80 00 09 b 400061f8 400061d8: 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)", 400061dc: 7f ff ec 34 call 400012ac <__getreent> 400061e0: 01 00 00 00 nop 400061e4: d4 07 60 54 ld [ %i5 + 0x54 ], %o2 400061e8: d0 02 20 08 ld [ %o0 + 8 ], %o0 400061ec: d6 07 60 58 ld [ %i5 + 0x58 ], %o3 400061f0: 13 10 00 90 sethi %hi(0x40024000), %o1 400061f4: 92 12 60 38 or %o1, 0x38, %o1 ! 40024038 <__FUNCTION__.6501+0x148> 400061f8: 40 00 38 e4 call 40014588 400061fc: 01 00 00 00 nop 40006200: 30 80 00 20 b,a 40006280 the_jnode->info.file.indirect, the_jnode->info.file.doubly_indirect, the_jnode->info.file.triply_indirect ); #else fprintf(stdout, " (file %" PRId32 ")", 40006204: 7f ff ec 2a call 400012ac <__getreent> 40006208: 01 00 00 00 nop 4000620c: d4 07 60 54 ld [ %i5 + 0x54 ], %o2 40006210: d0 02 20 08 ld [ %o0 + 8 ], %o0 40006214: 13 10 00 90 sethi %hi(0x40024000), %o1 40006218: 40 00 38 dc call 40014588 4000621c: 92 12 60 48 or %o1, 0x48, %o1 ! 40024048 <__FUNCTION__.6501+0x158> 40006220: 30 80 00 18 b,a 40006280 case IMFS_HARD_LINK: fprintf(stdout, " links not printed\n" ); return; case IMFS_SYM_LINK: fprintf(stdout, " links not printed\n" ); 40006224: 7f ff ec 22 call 400012ac <__getreent> 40006228: 01 00 00 00 nop 4000622c: d2 02 20 08 ld [ %o0 + 8 ], %o1 40006230: 11 10 00 90 sethi %hi(0x40024000), %o0 40006234: 10 80 00 06 b 4000624c 40006238: 90 12 20 58 or %o0, 0x58, %o0 ! 40024058 <__FUNCTION__.6501+0x168> return; case IMFS_FIFO: fprintf(stdout, " FIFO not printed\n" ); 4000623c: 7f ff ec 1c call 400012ac <__getreent> 40006240: 01 00 00 00 nop 40006244: d2 02 20 08 ld [ %o0 + 8 ], %o1 40006248: 90 10 00 12 mov %l2, %o0 4000624c: 40 00 39 1f call 400146c8 40006250: 01 00 00 00 nop } static inline bool IMFS_is_directory( const IMFS_jnode_t *node ) { return node->control->imfs_type == IMFS_DIRECTORY; 40006254: 10 80 00 0e b 4000628c 40006258: c2 07 60 4c ld [ %i5 + 0x4c ], %g1 return; default: fprintf(stdout, " bad type %d\n", IMFS_type( the_jnode ) ); 4000625c: 7f ff ec 14 call 400012ac <__getreent> <== NOT EXECUTED 40006260: 01 00 00 00 nop <== NOT EXECUTED rtems_chain_extract_unprotected( &node->Node ); } static inline IMFS_jnode_types_t IMFS_type( const IMFS_jnode_t *node ) { return node->control->imfs_type; 40006264: c2 07 60 4c ld [ %i5 + 0x4c ], %g1 <== NOT EXECUTED 40006268: d0 02 20 08 ld [ %o0 + 8 ], %o0 <== NOT EXECUTED 4000626c: d4 00 40 00 ld [ %g1 ], %o2 <== NOT EXECUTED 40006270: 40 00 38 c6 call 40014588 <== NOT EXECUTED 40006274: 92 10 00 1a mov %i2, %o1 <== NOT EXECUTED } static inline bool IMFS_is_directory( const IMFS_jnode_t *node ) { return node->control->imfs_type == IMFS_DIRECTORY; 40006278: 10 80 00 05 b 4000628c <== NOT EXECUTED 4000627c: c2 07 60 4c ld [ %i5 + 0x4c ], %g1 <== NOT EXECUTED return; } puts(""); 40006280: 40 00 3f ff call 4001627c 40006284: 90 10 00 11 mov %l1, %o0 40006288: 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 ) ) 4000628c: c2 00 40 00 ld [ %g1 ], %g1 40006290: 80 a0 60 00 cmp %g1, 0 40006294: 32 bf ff a9 bne,a 40006138 40006298: fa 07 40 00 ld [ %i5 ], %i5 IMFS_dump_directory( the_jnode, level + 1 ); 4000629c: 90 10 00 1d mov %i5, %o0 400062a0: 7f ff ff 9a call 40006108 400062a4: 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 ) { 400062a8: 10 bf ff a4 b 40006138 400062ac: fa 07 40 00 ld [ %i5 ], %i5 400062b0: 81 c7 e0 08 ret 400062b4: 81 e8 00 00 restore =============================================================================== 4000b9d4 : rtems_filesystem_eval_path_context_t *ctx, void *arg, const char *token, size_t tokenlen ) { 4000b9d4: 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; 4000b9d8: f8 06 20 20 ld [ %i0 + 0x20 ], %i4 bool access_ok = rtems_filesystem_eval_path_check_access( 4000b9dc: 90 10 00 18 mov %i0, %o0 4000b9e0: d4 07 20 30 ld [ %i4 + 0x30 ], %o2 4000b9e4: d6 17 20 3c lduh [ %i4 + 0x3c ], %o3 4000b9e8: d8 17 20 3e lduh [ %i4 + 0x3e ], %o4 4000b9ec: 40 00 02 92 call 4000c434 4000b9f0: 92 10 20 01 mov 1, %o1 dir->st_mode, dir->st_uid, dir->st_gid ); if ( access_ok ) { 4000b9f4: 80 a2 20 00 cmp %o0, 0 4000b9f8: 02 80 00 66 be 4000bb90 4000b9fc: 80 a6 e0 01 cmp %i3, 1 static inline bool rtems_filesystem_is_current_directory( const char *token, size_t tokenlen ) { return tokenlen == 1 && token [0] == '.'; 4000ba00: 12 80 00 06 bne 4000ba18 4000ba04: 82 10 20 00 clr %g1 4000ba08: c2 4e 80 00 ldsb [ %i2 ], %g1 4000ba0c: 82 18 60 2e xor %g1, 0x2e, %g1 4000ba10: 80 a0 00 01 cmp %g0, %g1 4000ba14: 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 ) ) { 4000ba18: 80 a0 60 00 cmp %g1, 0 4000ba1c: 12 80 00 29 bne 4000bac0 4000ba20: 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] == '.'; 4000ba24: 12 80 00 0b bne 4000ba50 4000ba28: 80 a0 60 00 cmp %g1, 0 4000ba2c: c4 4e 80 00 ldsb [ %i2 ], %g2 4000ba30: 80 a0 a0 2e cmp %g2, 0x2e 4000ba34: 12 80 00 07 bne 4000ba50 4000ba38: 80 a0 60 00 cmp %g1, 0 4000ba3c: c2 4e a0 01 ldsb [ %i2 + 1 ], %g1 4000ba40: 82 18 60 2e xor %g1, 0x2e, %g1 4000ba44: 80 a0 00 01 cmp %g0, %g1 4000ba48: 82 60 3f ff subx %g0, -1, %g1 return dir; } else { if ( rtems_filesystem_is_parent_directory( token, tokenlen ) ) { 4000ba4c: 80 a0 60 00 cmp %g1, 0 4000ba50: 22 80 00 04 be,a 4000ba60 4000ba54: fa 07 20 50 ld [ %i4 + 0x50 ], %i5 return dir->Parent; 4000ba58: 10 80 00 15 b 4000baac 4000ba5c: 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 ); 4000ba60: b2 07 20 54 add %i4, 0x54, %i1 while ( current != tail ) { 4000ba64: 80 a7 40 19 cmp %i5, %i1 4000ba68: 02 80 00 4c be 4000bb98 4000ba6c: 90 07 60 0c add %i5, 0xc, %o0 IMFS_jnode_t *entry = (IMFS_jnode_t *) current; bool match = strncmp( entry->name, token, tokenlen ) == 0 4000ba70: 92 10 00 1a mov %i2, %o1 4000ba74: 40 00 13 7b call 40010860 4000ba78: 94 10 00 1b mov %i3, %o2 && entry->name [tokenlen] == '\0'; 4000ba7c: 80 a2 20 00 cmp %o0, 0 4000ba80: 12 80 00 06 bne 4000ba98 4000ba84: 82 10 20 00 clr %g1 4000ba88: 82 07 40 1b add %i5, %i3, %g1 4000ba8c: c2 48 60 0c ldsb [ %g1 + 0xc ], %g1 4000ba90: 80 a0 00 01 cmp %g0, %g1 4000ba94: 82 60 3f ff subx %g0, -1, %g1 if ( match ) { 4000ba98: 80 a0 60 00 cmp %g1, 0 4000ba9c: 12 80 00 05 bne 4000bab0 4000baa0: 80 a7 60 00 cmp %i5, 0 * @param[in] the_node is the node to be operated upon. * * @return This method returns the next node on the chain. */ RTEMS_INLINE_ROUTINE rtems_chain_node *rtems_chain_next( rtems_chain_node *the_node 4000baa4: 10 bf ff f0 b 4000ba64 4000baa8: fa 07 40 00 ld [ %i5 ], %i5 ); if ( access_ok ) { IMFS_jnode_t *entry = IMFS_search_in_directory( dir, token, tokenlen ); if ( entry != NULL ) { 4000baac: 80 a7 60 00 cmp %i5, 0 4000bab0: 32 80 00 06 bne,a 4000bac8 4000bab4: c4 07 60 4c ld [ %i5 + 0x4c ], %g2 rtems_filesystem_eval_path_restart( ctx, fs_root_ptr ); } } } } else { status = RTEMS_FILESYSTEM_EVAL_PATH_GENERIC_NO_ENTRY; 4000bab8: 81 c7 e0 08 ret 4000babc: 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 ) ) { 4000bac0: ba 10 00 1c mov %i4, %i5 rtems_chain_extract_unprotected( &node->Node ); } static inline IMFS_jnode_types_t IMFS_type( const IMFS_jnode_t *node ) { return node->control->imfs_type; 4000bac4: c4 07 60 4c ld [ %i5 + 0x4c ], %g2 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 ); 4000bac8: c2 06 20 04 ld [ %i0 + 4 ], %g1 4000bacc: c4 00 80 00 ld [ %g2 ], %g2 4000bad0: 80 a0 00 01 cmp %g0, %g1 static inline void rtems_filesystem_eval_path_clear_token( rtems_filesystem_eval_path_context_t *ctx ) { ctx->tokenlen = 0; 4000bad4: c0 26 20 0c clr [ %i0 + 0xc ] 4000bad8: 82 60 3f ff subx %g0, -1, %g1 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)) { 4000badc: 80 a0 a0 02 cmp %g2, 2 4000bae0: 12 80 00 0a bne 4000bb08 4000bae4: c6 06 20 10 ld [ %i0 + 0x10 ], %g3 4000bae8: 80 a0 60 00 cmp %g1, 0 4000baec: 22 80 00 2d be,a 4000bba0 4000baf0: fa 07 60 50 ld [ %i5 + 0x50 ], %i5 4000baf4: 80 88 e0 08 btst 8, %g3 4000baf8: 22 80 00 2b be,a 4000bba4 4000bafc: c4 17 20 34 lduh [ %i4 + 0x34 ], %g2 entry = entry->info.hard_link.link_node; 4000bb00: 10 80 00 28 b 4000bba0 4000bb04: fa 07 60 50 ld [ %i5 + 0x50 ], %i5 } if ( type == IMFS_SYM_LINK && (follow_sym_link || !terminal)) { 4000bb08: 80 a0 a0 03 cmp %g2, 3 4000bb0c: 12 80 00 10 bne 4000bb4c 4000bb10: 80 a0 a0 00 cmp %g2, 0 4000bb14: 80 a0 60 00 cmp %g1, 0 4000bb18: 02 80 00 04 be 4000bb28 4000bb1c: 80 88 e0 10 btst 0x10, %g3 4000bb20: 22 80 00 21 be,a 4000bba4 4000bb24: c4 17 20 34 lduh [ %i4 + 0x34 ], %g2 const char *target = entry->info.sym_link.name; 4000bb28: fa 07 60 50 ld [ %i5 + 0x50 ], %i5 rtems_filesystem_eval_path_recursive( ctx, target, strlen( target ) ); 4000bb2c: 40 00 13 1d call 400107a0 4000bb30: 90 10 00 1d mov %i5, %o0 4000bb34: 92 10 00 1d mov %i5, %o1 4000bb38: 94 10 00 08 mov %o0, %o2 4000bb3c: 7f ff e3 28 call 400047dc 4000bb40: 90 10 00 18 mov %i0, %o0 void *arg, const char *token, size_t tokenlen ) { rtems_filesystem_eval_path_generic_status status = 4000bb44: 81 c7 e0 08 ret 4000bb48: 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 ) { 4000bb4c: 32 80 00 16 bne,a 4000bba4 4000bb50: c4 17 20 34 lduh [ %i4 + 0x34 ], %g2 if ( node->info.directory.mt_fs != NULL ) { 4000bb54: d2 07 60 5c ld [ %i5 + 0x5c ], %o1 4000bb58: 80 a2 60 00 cmp %o1, 0 4000bb5c: 02 80 00 11 be 4000bba0 4000bb60: 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( 4000bb64: d4 07 60 30 ld [ %i5 + 0x30 ], %o2 4000bb68: d6 17 60 3c lduh [ %i5 + 0x3c ], %o3 4000bb6c: 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; 4000bb70: 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( 4000bb74: 40 00 02 30 call 4000c434 4000bb78: 92 10 20 01 mov 1, %o1 RTEMS_FS_PERMS_EXEC, entry->st_mode, entry->st_uid, entry->st_gid ); if ( access_ok ) { 4000bb7c: 80 a2 20 00 cmp %o0, 0 4000bb80: 02 80 00 04 be 4000bb90 <== NEVER TAKEN 4000bb84: 90 10 00 18 mov %i0, %o0 rtems_filesystem_eval_path_restart( ctx, fs_root_ptr ); 4000bb88: 7f ff e2 fc call 40004778 4000bb8c: 92 10 00 1c mov %i4, %o1 void *arg, const char *token, size_t tokenlen ) { rtems_filesystem_eval_path_generic_status status = 4000bb90: 81 c7 e0 08 ret 4000bb94: 91 e8 20 01 restore %g0, 1, %o0 rtems_filesystem_eval_path_restart( ctx, fs_root_ptr ); } } } } else { status = RTEMS_FILESYSTEM_EVAL_PATH_GENERIC_NO_ENTRY; 4000bb98: 81 c7 e0 08 ret 4000bb9c: 91 e8 20 02 restore %g0, 2, %o0 } else { rtems_filesystem_global_location_t **fs_root_ptr = IMFS_is_mount_point( entry, type ); if ( fs_root_ptr == NULL ) { --dir->reference_count; 4000bba0: c4 17 20 34 lduh [ %i4 + 0x34 ], %g2 4000bba4: 84 00 bf ff add %g2, -1, %g2 4000bba8: c4 37 20 34 sth %g2, [ %i4 + 0x34 ] ++entry->reference_count; 4000bbac: c4 17 60 34 lduh [ %i5 + 0x34 ], %g2 4000bbb0: 84 00 a0 01 inc %g2 4000bbb4: c4 37 60 34 sth %g2, [ %i5 + 0x34 ] currentloc->node_access = entry; 4000bbb8: fa 26 20 20 st %i5, [ %i0 + 0x20 ] dir->st_uid, dir->st_gid ); if ( access_ok ) { IMFS_jnode_t *entry = IMFS_search_in_directory( dir, token, tokenlen ); 4000bbbc: c4 07 60 50 ld [ %i5 + 0x50 ], %g2 if ( fs_root_ptr == NULL ) { --dir->reference_count; ++entry->reference_count; currentloc->node_access = entry; currentloc->node_access_2 = 4000bbc0: c4 26 20 24 st %g2, [ %i0 + 0x24 ] 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; 4000bbc4: c4 07 60 4c ld [ %i5 + 0x4c ], %g2 4000bbc8: c4 00 a0 04 ld [ %g2 + 4 ], %g2 4000bbcc: c4 26 20 28 st %g2, [ %i0 + 0x28 ] void *arg, const char *token, size_t tokenlen ) { rtems_filesystem_eval_path_generic_status status = 4000bbd0: b0 08 60 ff and %g1, 0xff, %i0 status = RTEMS_FILESYSTEM_EVAL_PATH_GENERIC_NO_ENTRY; } } return status; } 4000bbd4: 81 c7 e0 08 ret 4000bbd8: 81 e8 00 00 restore =============================================================================== 40003e9c : static ssize_t IMFS_fifo_write( rtems_libio_t *iop, const void *buffer, size_t count ) { 40003e9c: 9d e3 bf 98 save %sp, -104, %sp IMFS_jnode_t *jnode = iop->pathinfo.node_access; 40003ea0: f8 06 20 1c ld [ %i0 + 0x1c ], %i4 int err = pipe_write(JNODE2PIPE(jnode), buffer, count, iop); 40003ea4: 92 10 00 19 mov %i1, %o1 40003ea8: d0 07 20 50 ld [ %i4 + 0x50 ], %o0 40003eac: 94 10 00 1a mov %i2, %o2 40003eb0: 40 00 2a 2a call 4000e758 40003eb4: 96 10 00 18 mov %i0, %o3 if (err > 0) { 40003eb8: ba 92 20 00 orcc %o0, 0, %i5 40003ebc: 04 80 00 09 ble 40003ee0 40003ec0: 90 07 bf f8 add %fp, -8, %o0 static inline void IMFS_mtime_ctime_update( IMFS_jnode_t *jnode ) { struct timeval now; gettimeofday( &now, 0 ); 40003ec4: 40 00 03 cc call 40004df4 40003ec8: 92 10 20 00 clr %o1 jnode->stat_mtime = now.tv_sec; 40003ecc: c2 07 bf f8 ld [ %fp + -8 ], %g1 40003ed0: c2 27 20 44 st %g1, [ %i4 + 0x44 ] jnode->stat_ctime = now.tv_sec; 40003ed4: c2 27 20 48 st %g1, [ %i4 + 0x48 ] 40003ed8: 81 c7 e0 08 ret 40003edc: 91 e8 00 1d restore %g0, %i5, %o0 IMFS_mtime_ctime_update(jnode); } IMFS_FIFO_RETURN(err); 40003ee0: 80 a7 60 00 cmp %i5, 0 40003ee4: 02 80 00 06 be 40003efc <== NEVER TAKEN 40003ee8: b0 10 20 00 clr %i0 40003eec: 40 00 37 5a call 40011c54 <__errno> 40003ef0: ba 20 00 1d neg %i5 40003ef4: b0 10 3f ff mov -1, %i0 40003ef8: fa 22 00 00 st %i5, [ %o0 ] } 40003efc: 81 c7 e0 08 ret 40003f00: 81 e8 00 00 restore =============================================================================== 4000bc1c : ((IMFS_jnode_t *)( rtems_chain_head( jnode_get_control( jnode ) )->next)) void IMFS_fsunmount( rtems_filesystem_mount_table_entry_t *temp_mt_entry ) { 4000bc1c: 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; 4000bc20: f8 06 20 24 ld [ %i0 + 0x24 ], %i4 4000bc24: 90 07 bf e8 add %fp, -24, %o0 4000bc28: 92 10 00 1c mov %i4, %o1 4000bc2c: 40 00 11 63 call 400101b8 4000bc30: 94 10 20 18 mov 0x18, %o2 jnode = (IMFS_jnode_t *)loc.node_access; 4000bc34: 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; 4000bc38: c0 27 20 08 clr [ %i4 + 8 ] 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; 4000bc3c: c2 07 60 4c ld [ %i5 + 0x4c ], %g1 do { next = jnode->Parent; 4000bc40: f8 07 60 08 ld [ %i5 + 8 ], %i4 4000bc44: 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 ) ) { 4000bc48: 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; 4000bc4c: fa 27 bf f0 st %i5, [ %fp + -16 ] IMFS_Set_handlers( &loc ); if ( !IMFS_is_directory( jnode ) || jnode_has_no_children( jnode ) ) { 4000bc50: 80 a0 60 00 cmp %g1, 0 4000bc54: 12 80 00 07 bne 4000bc70 4000bc58: c4 27 bf f8 st %g2, [ %fp + -8 ] 4000bc5c: 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 ); 4000bc60: 82 07 60 54 add %i5, 0x54, %g1 4000bc64: 80 a0 80 01 cmp %g2, %g1 4000bc68: 32 80 00 10 bne,a 4000bca8 4000bc6c: c2 07 60 4c ld [ %i5 + 0x4c ], %g1 result = IMFS_rmnod( NULL, &loc ); 4000bc70: 90 10 20 00 clr %o0 4000bc74: 7f ff de 3c call 40003564 4000bc78: 92 07 bf e8 add %fp, -24, %o1 if ( result != 0 ) 4000bc7c: 80 a2 20 00 cmp %o0, 0 4000bc80: 02 80 00 04 be 4000bc90 <== ALWAYS TAKEN 4000bc84: 11 37 ab 6f sethi %hi(0xdeadbc00), %o0 rtems_fatal_error_occurred( 0xdeadbeef ); 4000bc88: 7f ff f0 3f call 40007d84 <== NOT EXECUTED 4000bc8c: 90 12 22 ef or %o0, 0x2ef, %o0 ! deadbeef <== NOT EXECUTED IMFS_node_destroy( jnode ); 4000bc90: 7f ff dd 66 call 40003228 4000bc94: 90 10 00 1d mov %i5, %o0 jnode = next; } if ( jnode != NULL ) { 4000bc98: 80 a7 20 00 cmp %i4, 0 4000bc9c: 02 80 00 0e be 4000bcd4 4000bca0: 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; 4000bca4: c2 07 60 4c ld [ %i5 + 0x4c ], %g1 if ( IMFS_is_directory( jnode ) ) { 4000bca8: c2 00 40 00 ld [ %g1 ], %g1 4000bcac: 80 a0 60 00 cmp %g1, 0 4000bcb0: 32 bf ff e4 bne,a 4000bc40 <== NEVER TAKEN 4000bcb4: 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; 4000bcb8: 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 ); 4000bcbc: 84 07 60 54 add %i5, 0x54, %g2 if ( jnode_has_children( jnode ) ) 4000bcc0: 80 a0 40 02 cmp %g1, %g2 4000bcc4: 02 bf ff de be 4000bc3c 4000bcc8: 80 a0 60 00 cmp %g1, 0 jnode = jnode_get_first_child( jnode ); } } } while (jnode != NULL); 4000bccc: 12 bf ff dc bne 4000bc3c <== ALWAYS TAKEN 4000bcd0: ba 10 00 01 mov %g1, %i5 4000bcd4: 81 c7 e0 08 ret 4000bcd8: 81 e8 00 00 restore =============================================================================== 40003114 : 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] ) { 40003114: 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 ) ); 40003118: 90 10 20 01 mov 1, %o0 4000311c: 40 00 01 a7 call 400037b8 40003120: 92 10 20 24 mov 0x24, %o1 if ( fs_info != NULL ) { 40003124: ba 92 20 00 orcc %o0, 0, %i5 40003128: 02 80 00 26 be 400031c0 4000312c: 05 10 00 5f sethi %hi(0x40017c00), %g2 IMFS_jnode_t *root_node; fs_info->instance = imfs_instance++; 40003130: c2 00 a1 70 ld [ %g2 + 0x170 ], %g1 ! 40017d70 memcpy( 40003134: 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++; 40003138: 86 00 60 01 add %g1, 1, %g3 4000313c: c2 27 40 00 st %g1, [ %i5 ] 40003140: c6 20 a1 70 st %g3, [ %g2 + 0x170 ] memcpy( 40003144: 94 10 20 1c mov 0x1c, %o2 40003148: 40 00 34 1c call 400101b8 4000314c: 90 07 60 08 add %i5, 8, %o0 fs_info->node_controls, node_controls, sizeof( fs_info->node_controls ) ); root_node = IMFS_allocate_node( 40003150: d2 07 60 08 ld [ %i5 + 8 ], %o1 40003154: 90 10 00 1d mov %i5, %o0 40003158: 15 10 00 57 sethi %hi(0x40015c00), %o2 4000315c: 96 10 20 00 clr %o3 40003160: 94 12 a0 48 or %o2, 0x48, %o2 40003164: 19 00 00 10 sethi %hi(0x4000), %o4 40003168: 9a 10 20 00 clr %o5 4000316c: 40 00 21 c6 call 4000b884 40003170: 98 13 21 ed or %o4, 0x1ed, %o4 "", 0, (S_IFDIR | 0755), NULL ); if ( root_node != NULL ) { 40003174: 80 a2 20 00 cmp %o0, 0 40003178: 02 80 00 10 be 400031b8 <== NEVER TAKEN 4000317c: 03 10 00 58 sethi %hi(0x40016000), %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; 40003180: 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; 40003184: 82 10 60 dc or %g1, 0xdc, %g1 40003188: c4 00 a0 04 ld [ %g2 + 4 ], %g2 4000318c: c2 26 20 2c st %g1, [ %i0 + 0x2c ] mt_entry->mt_fs_root->location.node_access = root_node; 40003190: c2 06 20 24 ld [ %i0 + 0x24 ], %g1 0, (S_IFDIR | 0755), NULL ); if ( root_node != NULL ) { mt_entry->fs_info = fs_info; 40003194: fa 26 20 08 st %i5, [ %i0 + 8 ] mt_entry->ops = op_table; 40003198: f2 26 20 0c st %i1, [ %i0 + 0xc ] 4000319c: 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; 400031a0: d0 20 60 08 st %o0, [ %g1 + 8 ] errno = ENOMEM; rv = -1; } if ( rv == 0 ) { IMFS_determine_bytes_per_block( 400031a4: 03 10 00 5a sethi %hi(0x40016800), %g1 400031a8: 84 10 20 06 mov 6, %g2 400031ac: c6 00 63 2c ld [ %g1 + 0x32c ], %g3 int bit_mask; /* * check, whether requested bytes per block is valid */ for (bit_mask = 16; !is_valid && (bit_mask <= 512); bit_mask <<= 1) { 400031b0: 10 80 00 0e b 400031e8 400031b4: 82 10 20 10 mov 0x10, %g1 mt_entry->ops = op_table; mt_entry->pathconf_limits_and_options = &IMFS_LIMITS_AND_OPTIONS; mt_entry->mt_fs_root->location.node_access = root_node; IMFS_Set_handlers( &mt_entry->mt_fs_root->location ); } else { free(fs_info); 400031b8: 40 00 01 95 call 4000380c <== NOT EXECUTED 400031bc: 90 10 00 1d mov %i5, %o0 <== NOT EXECUTED errno = ENOMEM; rv = -1; } } else { errno = ENOMEM; 400031c0: 40 00 32 18 call 4000fa20 <__errno> 400031c4: b0 10 3f ff mov -1, %i0 400031c8: 82 10 20 0c mov 0xc, %g1 400031cc: c2 22 00 00 st %g1, [ %o0 ] IMFS_MEMFILE_DEFAULT_BYTES_PER_BLOCK ); } return rv; } 400031d0: 81 c7 e0 08 ret 400031d4: 81 e8 00 00 restore for (bit_mask = 16; !is_valid && (bit_mask <= 512); bit_mask <<= 1) { if (bit_mask == requested_bytes_per_block) { is_valid = true; break; } if(bit_mask > requested_bytes_per_block) 400031d8: 14 80 00 09 bg 400031fc 400031dc: 84 80 bf ff addcc %g2, -1, %g2 int bit_mask; /* * check, whether requested bytes per block is valid */ for (bit_mask = 16; !is_valid && (bit_mask <= 512); bit_mask <<= 1) { 400031e0: 02 80 00 07 be 400031fc <== NEVER TAKEN 400031e4: 83 28 60 01 sll %g1, 1, %g1 if (bit_mask == requested_bytes_per_block) { 400031e8: 80 a0 40 03 cmp %g1, %g3 400031ec: 12 bf ff fb bne 400031d8 400031f0: 01 00 00 00 nop break; } if(bit_mask > requested_bytes_per_block) break; } *dest_bytes_per_block = ((is_valid) 400031f4: 10 80 00 04 b 40003204 400031f8: 05 10 00 5f sethi %hi(0x40017c00), %g2 ? requested_bytes_per_block : default_bytes_per_block); 400031fc: 82 10 20 80 mov 0x80, %g1 break; } if(bit_mask > requested_bytes_per_block) break; } *dest_bytes_per_block = ((is_valid) 40003200: 05 10 00 5f sethi %hi(0x40017c00), %g2 40003204: c2 20 a1 74 st %g1, [ %g2 + 0x174 ] ! 40017d74 const IMFS_node_control *const node_controls [IMFS_TYPE_COUNT] ) { static int imfs_instance; int rv = 0; 40003208: 81 c7 e0 08 ret 4000320c: 91 e8 20 00 restore %g0, 0, %o0 =============================================================================== 40004920 : const char *path, mode_t mode, const IMFS_node_control *node_control, void *context ) { 40004920: 9d e3 bf 48 save %sp, -184, %sp int rv = 0; mode &= ~rtems_filesystem_umask; 40004924: 40 00 05 74 call 40005ef4 40004928: 01 00 00 00 nop 4000492c: c2 02 20 08 ld [ %o0 + 8 ], %g1 switch (mode & S_IFMT) { 40004930: 05 00 00 18 sethi %hi(0x6000), %g2 void *context ) { int rv = 0; mode &= ~rtems_filesystem_umask; 40004934: b2 2e 40 01 andn %i1, %g1, %i1 switch (mode & S_IFMT) { 40004938: 03 00 00 3c sethi %hi(0xf000), %g1 4000493c: 82 0e 40 01 and %i1, %g1, %g1 40004940: 80 a0 40 02 cmp %g1, %g2 40004944: 22 80 00 11 be,a 40004988 40004948: c2 06 80 00 ld [ %i2 ], %g1 4000494c: 18 80 00 08 bgu 4000496c <== NEVER TAKEN 40004950: 05 00 00 20 sethi %hi(0x8000), %g2 40004954: 05 00 00 04 sethi %hi(0x1000), %g2 40004958: 80 a0 40 02 cmp %g1, %g2 4000495c: 02 80 00 0a be 40004984 <== NEVER TAKEN 40004960: 05 00 00 08 sethi %hi(0x2000), %g2 40004964: 10 80 00 06 b 4000497c 40004968: 80 a0 40 02 cmp %g1, %g2 4000496c: 80 a0 40 02 cmp %g1, %g2 <== NOT EXECUTED 40004970: 02 80 00 05 be 40004984 <== NOT EXECUTED 40004974: 05 00 00 30 sethi %hi(0xc000), %g2 <== NOT EXECUTED 40004978: 80 a0 40 02 cmp %g1, %g2 <== NOT EXECUTED 4000497c: 12 80 00 06 bne 40004994 40004980: 01 00 00 00 nop rv = -1; break; } if ( rv == 0 ) { if ( node_control->imfs_type == IMFS_GENERIC ) { 40004984: c2 06 80 00 ld [ %i2 ], %g1 40004988: 80 a0 60 07 cmp %g1, 7 4000498c: 02 80 00 08 be 400049ac 40004990: 92 10 00 18 mov %i0, %o1 rv = -1; } rtems_filesystem_eval_path_cleanup( &ctx ); } else { errno = EINVAL; 40004994: 40 00 3f f9 call 40014978 <__errno> 40004998: b0 10 3f ff mov -1, %i0 4000499c: 82 10 20 16 mov 0x16, %g1 400049a0: c2 22 00 00 st %g1, [ %o0 ] 400049a4: 81 c7 e0 08 ret 400049a8: 81 e8 00 00 restore 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 = 400049ac: 94 10 20 78 mov 0x78, %o2 400049b0: 40 00 06 e5 call 40006544 400049b4: 90 07 bf c8 add %fp, -56, %o0 rtems_filesystem_eval_path_start( &ctx, path, eval_flags ); if ( IMFS_is_imfs_instance( currentloc ) ) { 400049b8: 7f ff ff c8 call 400048d8 400049bc: ba 10 00 08 mov %o0, %i5 400049c0: 80 a2 20 00 cmp %o0, 0 400049c4: 02 80 00 15 be 40004a18 400049c8: 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( 400049cc: 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; 400049d0: f6 27 bf b0 st %i3, [ %fp + -80 ] new_node = IMFS_create_node_with_control( 400049d4: 90 10 00 1d mov %i5, %o0 400049d8: 92 10 00 1a mov %i2, %o1 400049dc: 98 10 00 19 mov %i1, %o4 400049e0: 9a 07 bf b0 add %fp, -80, %o5 400049e4: 40 00 2d 7f call 4000ffe0 400049e8: b0 10 3f ff mov -1, %i0 rtems_filesystem_eval_path_get_tokenlen( &ctx ), mode, &info ); if ( new_node != NULL ) { 400049ec: 80 a2 20 00 cmp %o0, 0 400049f0: 02 80 00 0d be 40004a24 400049f4: 90 07 bf a8 add %fp, -88, %o0 IMFS_jnode_t *parent = currentloc->node_access; 400049f8: fa 07 60 08 ld [ %i5 + 8 ], %i5 static inline void IMFS_mtime_ctime_update( IMFS_jnode_t *jnode ) { struct timeval now; gettimeofday( &now, 0 ); 400049fc: 40 00 01 d9 call 40005160 40004a00: 92 10 20 00 clr %o1 jnode->stat_mtime = now.tv_sec; 40004a04: c2 07 bf a8 ld [ %fp + -88 ], %g1 40004a08: b0 10 20 00 clr %i0 40004a0c: c2 27 60 44 st %g1, [ %i5 + 0x44 ] jnode->stat_ctime = now.tv_sec; 40004a10: 10 80 00 05 b 40004a24 40004a14: c2 27 60 48 st %g1, [ %i5 + 0x48 ] IMFS_mtime_ctime_update( parent ); } else { rv = -1; } } else { rtems_filesystem_eval_path_error( &ctx, ENOTSUP ); 40004a18: 92 10 20 86 mov 0x86, %o1 40004a1c: 40 00 06 17 call 40006278 40004a20: b0 10 3f ff mov -1, %i0 rv = -1; } rtems_filesystem_eval_path_cleanup( &ctx ); 40004a24: 40 00 06 d0 call 40006564 40004a28: 90 07 bf c8 add %fp, -56, %o0 40004a2c: 81 c7 e0 08 ret 40004a30: 81 e8 00 00 restore =============================================================================== 4000dfec : */ MEMFILE_STATIC int IMFS_memfile_addblock( IMFS_jnode_t *the_jnode, unsigned int block ) { 4000dfec: 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 ); 4000dff0: 94 10 20 01 mov 1, %o2 4000dff4: 90 10 00 18 mov %i0, %o0 4000dff8: 7f ff fe d6 call 4000db50 4000dffc: 92 10 00 19 mov %i1, %o1 if ( !block_entry_ptr ) 4000e000: ba 92 20 00 orcc %o0, 0, %i5 4000e004: 32 80 00 04 bne,a 4000e014 <== ALWAYS TAKEN 4000e008: c2 07 40 00 ld [ %i5 ], %g1 return 1; 4000e00c: 81 c7 e0 08 ret 4000e010: 91 e8 20 01 restore %g0, 1, %o0 if ( *block_entry_ptr ) 4000e014: 80 a0 60 00 cmp %g1, 0 4000e018: 12 80 00 08 bne 4000e038 4000e01c: b0 10 20 00 clr %i0 return 0; /* * There is no memory for this block number so allocate it. */ memory = memfile_alloc_block(); 4000e020: 7f ff fe bf call 4000db1c 4000e024: 01 00 00 00 nop if ( !memory ) 4000e028: 80 a2 20 00 cmp %o0, 0 4000e02c: 02 bf ff f8 be 4000e00c 4000e030: 01 00 00 00 nop return 1; *block_entry_ptr = memory; 4000e034: d0 27 40 00 st %o0, [ %i5 ] return 0; } 4000e038: 81 c7 e0 08 ret 4000e03c: 81 e8 00 00 restore =============================================================================== 4000e09c : MEMFILE_STATIC int IMFS_memfile_extend( IMFS_jnode_t *the_jnode, bool zero_fill, off_t new_length ) { 4000e09c: 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 ) 4000e0a0: 21 10 00 5f sethi %hi(0x40017c00), %l0 4000e0a4: fa 04 21 74 ld [ %l0 + 0x174 ], %i5 ! 40017d74 4000e0a8: a4 10 00 10 mov %l0, %l2 4000e0ac: b9 37 60 02 srl %i5, 2, %i4 4000e0b0: 92 10 00 1c mov %i4, %o1 4000e0b4: 40 00 14 cf call 400133f0 <.umul> 4000e0b8: 90 07 20 01 add %i4, 1, %o0 4000e0bc: 92 10 00 1c mov %i4, %o1 4000e0c0: 40 00 14 cc call 400133f0 <.umul> 4000e0c4: 90 02 20 01 inc %o0 4000e0c8: 92 10 00 1d mov %i5, %o1 4000e0cc: 40 00 14 c9 call 400133f0 <.umul> 4000e0d0: 90 02 3f ff add %o0, -1, %o0 4000e0d4: 82 10 20 00 clr %g1 4000e0d8: 80 a0 40 1a cmp %g1, %i2 4000e0dc: 34 80 00 0b bg,a 4000e108 <== NEVER TAKEN 4000e0e0: f8 06 20 50 ld [ %i0 + 0x50 ], %i4 <== NOT EXECUTED 4000e0e4: 80 a0 40 1a cmp %g1, %i2 4000e0e8: 12 80 00 04 bne 4000e0f8 <== NEVER TAKEN 4000e0ec: 80 a2 00 1b cmp %o0, %i3 4000e0f0: 38 80 00 06 bgu,a 4000e108 4000e0f4: f8 06 20 50 ld [ %i0 + 0x50 ], %i4 rtems_set_errno_and_return_minus_one( EFBIG ); 4000e0f8: 40 00 06 4a call 4000fa20 <__errno> 4000e0fc: 01 00 00 00 nop 4000e100: 10 80 00 20 b 4000e180 4000e104: 82 10 20 1b mov 0x1b, %g1 ! 1b <_TLS_Alignment+0x1a> /* * Verify new file size is actually larger than current size */ if ( new_length <= the_jnode->info.file.size ) 4000e108: 80 a6 80 1c cmp %i2, %i4 4000e10c: 14 80 00 07 bg 4000e128 <== NEVER TAKEN 4000e110: e0 06 20 54 ld [ %i0 + 0x54 ], %l0 4000e114: 80 a6 80 1c cmp %i2, %i4 4000e118: 12 80 00 45 bne 4000e22c <== NEVER TAKEN 4000e11c: 80 a6 c0 10 cmp %i3, %l0 4000e120: 08 80 00 43 bleu 4000e22c <== NEVER TAKEN 4000e124: 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; 4000e128: a3 3f 60 1f sra %i5, 0x1f, %l1 4000e12c: 96 10 00 1d mov %i5, %o3 4000e130: 94 10 00 11 mov %l1, %o2 4000e134: 90 10 00 1a mov %i2, %o0 4000e138: 40 00 16 40 call 40013a38 <__divdi3> 4000e13c: 92 10 00 1b mov %i3, %o1 old_blocks = the_jnode->info.file.size / IMFS_MEMFILE_BYTES_PER_BLOCK; 4000e140: 94 10 00 11 mov %l1, %o2 4000e144: 90 10 00 1c mov %i4, %o0 4000e148: 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; 4000e14c: a6 10 00 09 mov %o1, %l3 old_blocks = the_jnode->info.file.size / IMFS_MEMFILE_BYTES_PER_BLOCK; 4000e150: 40 00 16 3a call 40013a38 <__divdi3> 4000e154: 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++ ) { 4000e158: 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; 4000e15c: 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; 4000e160: b8 10 00 09 mov %o1, %i4 offset = the_jnode->info.file.size - old_blocks * IMFS_MEMFILE_BYTES_PER_BLOCK; 4000e164: 40 00 14 a3 call 400133f0 <.umul> 4000e168: 92 10 00 1d mov %i5, %o1 /* * Now allocate each of those blocks. */ for ( block=old_blocks ; block<=new_blocks ; block++ ) { 4000e16c: 10 80 00 1c b 4000e1dc 4000e170: a0 24 00 08 sub %l0, %o0, %l0 } } else { for ( ; block>=old_blocks ; block-- ) { IMFS_memfile_remove_block( the_jnode, block ); } rtems_set_errno_and_return_minus_one( ENOSPC ); 4000e174: 40 00 06 2b call 4000fa20 <__errno> 4000e178: 01 00 00 00 nop 4000e17c: 82 10 20 1c mov 0x1c, %g1 ! 1c <_TLS_Alignment+0x1b> 4000e180: c2 22 00 00 st %g1, [ %o0 ] 4000e184: 81 c7 e0 08 ret 4000e188: 91 e8 3f ff restore %g0, -1, %o0 /* * Now allocate each of those blocks. */ for ( block=old_blocks ; block<=new_blocks ; block++ ) { if ( !IMFS_memfile_addblock( the_jnode, block ) ) { 4000e18c: 7f ff ff 98 call 4000dfec 4000e190: 92 10 00 1d mov %i5, %o1 4000e194: 80 a2 20 00 cmp %o0, 0 4000e198: 12 80 00 17 bne 4000e1f4 4000e19c: 80 a6 60 00 cmp %i1, 0 if ( zero_fill ) { 4000e1a0: 22 80 00 0f be,a 4000e1dc 4000e1a4: a2 04 60 01 inc %l1 size_t count = IMFS_MEMFILE_BYTES_PER_BLOCK - offset; 4000e1a8: e8 04 a1 74 ld [ %l2 + 0x174 ], %l4 block_p *block_ptr = 4000e1ac: 92 10 00 1d mov %i5, %o1 4000e1b0: 94 10 20 00 clr %o2 4000e1b4: 7f ff fe 67 call 4000db50 4000e1b8: 90 10 00 18 mov %i0, %o0 IMFS_memfile_get_block_pointer( the_jnode, block, 0 ); memset( &(*block_ptr) [offset], 0, count); 4000e1bc: 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; 4000e1c0: 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); 4000e1c4: 90 02 00 10 add %o0, %l0, %o0 4000e1c8: 92 10 20 00 clr %o1 4000e1cc: 94 10 00 14 mov %l4, %o2 4000e1d0: 40 00 08 39 call 400102b4 4000e1d4: a0 10 20 00 clr %l0 4000e1d8: a2 04 60 01 inc %l1 4000e1dc: 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++ ) { 4000e1e0: 80 a7 40 13 cmp %i5, %l3 4000e1e4: 08 bf ff ea bleu 4000e18c 4000e1e8: 90 10 00 18 mov %i0, %o0 4000e1ec: 10 80 00 0a b 4000e214 4000e1f0: f4 3e 20 50 std %i2, [ %i0 + 0x50 ] memset( &(*block_ptr) [offset], 0, count); offset = 0; } } else { for ( ; block>=old_blocks ; block-- ) { 4000e1f4: 80 a7 40 1c cmp %i5, %i4 4000e1f8: 0a bf ff df bcs 4000e174 4000e1fc: 92 10 00 1d mov %i5, %o1 IMFS_memfile_remove_block( the_jnode, block ); 4000e200: 90 10 00 18 mov %i0, %o0 4000e204: 7f ff ff 98 call 4000e064 4000e208: ba 07 7f ff add %i5, -1, %i5 memset( &(*block_ptr) [offset], 0, count); offset = 0; } } else { for ( ; block>=old_blocks ; block-- ) { 4000e20c: 10 bf ff fb b 4000e1f8 4000e210: 80 a7 40 1c cmp %i5, %i4 static inline void IMFS_mtime_ctime_update( IMFS_jnode_t *jnode ) { struct timeval now; gettimeofday( &now, 0 ); 4000e214: 90 07 bf f8 add %fp, -8, %o0 4000e218: 7f ff d5 a7 call 400038b4 4000e21c: 92 10 20 00 clr %o1 jnode->stat_mtime = now.tv_sec; 4000e220: c2 07 bf f8 ld [ %fp + -8 ], %g1 4000e224: c2 26 20 44 st %g1, [ %i0 + 0x44 ] jnode->stat_ctime = now.tv_sec; 4000e228: c2 26 20 48 st %g1, [ %i0 + 0x48 ] */ the_jnode->info.file.size = new_length; IMFS_mtime_ctime_update(the_jnode); return 0; } 4000e22c: 81 c7 e0 08 ret 4000e230: 91 e8 20 00 restore %g0, 0, %o0 =============================================================================== 4000db50 : #endif IMFS_jnode_t *the_jnode, unsigned int block, int malloc_it ) { 4000db50: 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 ) { 4000db54: 03 10 00 5f sethi %hi(0x40017c00), %g1 4000db58: fa 00 61 74 ld [ %g1 + 0x174 ], %i5 ! 40017d74 4000db5c: bb 37 60 02 srl %i5, 2, %i5 4000db60: 82 07 7f ff add %i5, -1, %g1 4000db64: 80 a6 40 01 cmp %i1, %g1 4000db68: 18 80 00 18 bgu 4000dbc8 4000db6c: 90 07 60 01 add %i5, 1, %o0 p = info->indirect; if ( malloc_it ) { 4000db70: 80 a6 a0 00 cmp %i2, 0 4000db74: 02 80 00 10 be 4000dbb4 4000db78: c2 06 20 58 ld [ %i0 + 0x58 ], %g1 if ( !p ) { 4000db7c: 80 a0 60 00 cmp %g1, 0 4000db80: 32 80 00 0a bne,a 4000dba8 4000db84: f0 06 20 58 ld [ %i0 + 0x58 ], %i0 p = memfile_alloc_block(); 4000db88: 7f ff ff e5 call 4000db1c 4000db8c: 01 00 00 00 nop if ( !p ) 4000db90: 80 a2 20 00 cmp %o0, 0 4000db94: 32 80 00 04 bne,a 4000dba4 <== ALWAYS TAKEN 4000db98: d0 26 20 58 st %o0, [ %i0 + 0x58 ] return 0; 4000db9c: 81 c7 e0 08 ret <== NOT EXECUTED 4000dba0: 91 e8 20 00 restore %g0, 0, %o0 <== NOT EXECUTED info->indirect = p; } return &info->indirect[ my_block ]; 4000dba4: f0 06 20 58 ld [ %i0 + 0x58 ], %i0 4000dba8: b3 2e 60 02 sll %i1, 2, %i1 4000dbac: 81 c7 e0 08 ret 4000dbb0: 91 ee 00 19 restore %i0, %i1, %o0 } if ( !p ) 4000dbb4: 80 a0 60 00 cmp %g1, 0 4000dbb8: 02 bf ff f9 be 4000db9c <== NEVER TAKEN 4000dbbc: b3 2e 60 02 sll %i1, 2, %i1 return 0; return &info->indirect[ my_block ]; 4000dbc0: 81 c7 e0 08 ret 4000dbc4: 91 e8 40 19 restore %g1, %i1, %o0 /* * Is the block number in the doubly indirect portion? */ if ( my_block <= LAST_DOUBLY_INDIRECT ) { 4000dbc8: 40 00 16 0a call 400133f0 <.umul> 4000dbcc: 92 10 00 1d mov %i5, %o1 4000dbd0: 82 02 3f ff add %o0, -1, %g1 4000dbd4: 80 a6 40 01 cmp %i1, %g1 4000dbd8: 18 80 00 2c bgu 4000dc88 4000dbdc: b8 10 00 08 mov %o0, %i4 my_block -= FIRST_DOUBLY_INDIRECT; 4000dbe0: b2 26 40 1d sub %i1, %i5, %i1 singly = my_block % IMFS_MEMFILE_BLOCK_SLOTS; 4000dbe4: 92 10 00 1d mov %i5, %o1 4000dbe8: 40 00 16 e8 call 40013788 <.urem> 4000dbec: 90 10 00 19 mov %i1, %o0 doubly = my_block / IMFS_MEMFILE_BLOCK_SLOTS; 4000dbf0: 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; 4000dbf4: b8 10 00 08 mov %o0, %i4 doubly = my_block / IMFS_MEMFILE_BLOCK_SLOTS; 4000dbf8: 40 00 16 38 call 400134d8 <.udiv> 4000dbfc: 90 10 00 19 mov %i1, %o0 p = info->doubly_indirect; if ( malloc_it ) { 4000dc00: 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; 4000dc04: ba 10 00 08 mov %o0, %i5 p = info->doubly_indirect; if ( malloc_it ) { 4000dc08: 02 80 00 17 be 4000dc64 4000dc0c: d0 06 20 5c ld [ %i0 + 0x5c ], %o0 if ( !p ) { 4000dc10: 80 a2 20 00 cmp %o0, 0 4000dc14: 12 80 00 08 bne 4000dc34 4000dc18: bb 2f 60 02 sll %i5, 2, %i5 p = memfile_alloc_block(); 4000dc1c: 7f ff ff c0 call 4000db1c 4000dc20: 01 00 00 00 nop if ( !p ) 4000dc24: 80 a2 20 00 cmp %o0, 0 4000dc28: 02 bf ff dd be 4000db9c <== NEVER TAKEN 4000dc2c: 01 00 00 00 nop return 0; info->doubly_indirect = p; 4000dc30: d0 26 20 5c st %o0, [ %i0 + 0x5c ] } p1 = (block_p *)p[ doubly ]; 4000dc34: b6 02 00 1d add %o0, %i5, %i3 4000dc38: d0 02 00 1d ld [ %o0 + %i5 ], %o0 if ( !p1 ) { 4000dc3c: 80 a2 20 00 cmp %o0, 0 4000dc40: 12 80 00 4a bne 4000dd68 4000dc44: b1 2f 20 02 sll %i4, 2, %i0 p1 = memfile_alloc_block(); 4000dc48: 7f ff ff b5 call 4000db1c 4000dc4c: 01 00 00 00 nop if ( !p1 ) 4000dc50: 80 a2 20 00 cmp %o0, 0 4000dc54: 02 bf ff d2 be 4000db9c <== NEVER TAKEN 4000dc58: 01 00 00 00 nop return 0; p[ doubly ] = (block_p) p1; 4000dc5c: 10 80 00 43 b 4000dd68 4000dc60: d0 26 c0 00 st %o0, [ %i3 ] } return (block_p *)&p1[ singly ]; } if ( !p ) 4000dc64: 80 a2 20 00 cmp %o0, 0 4000dc68: 02 bf ff cd be 4000db9c <== NEVER TAKEN 4000dc6c: bb 2f 60 02 sll %i5, 2, %i5 return 0; p = (block_p *)p[ doubly ]; 4000dc70: c2 02 00 1d ld [ %o0 + %i5 ], %g1 if ( !p ) 4000dc74: 80 a0 60 00 cmp %g1, 0 4000dc78: 02 bf ff c9 be 4000db9c <== NEVER TAKEN 4000dc7c: 01 00 00 00 nop return 0; return (block_p *)&p[ singly ]; 4000dc80: 10 80 00 48 b 4000dda0 4000dc84: b1 2f 20 02 sll %i4, 2, %i0 } /* * Is the block number in the triply indirect portion? */ if ( my_block <= LAST_TRIPLY_INDIRECT ) { 4000dc88: 90 02 20 01 inc %o0 4000dc8c: 40 00 15 d9 call 400133f0 <.umul> 4000dc90: 92 10 00 1d mov %i5, %o1 4000dc94: 90 02 3f ff add %o0, -1, %o0 4000dc98: 80 a6 40 08 cmp %i1, %o0 4000dc9c: 18 bf ff c0 bgu 4000db9c <== NEVER TAKEN 4000dca0: b2 26 40 1c sub %i1, %i4, %i1 my_block -= FIRST_TRIPLY_INDIRECT; singly = my_block % IMFS_MEMFILE_BLOCK_SLOTS; 4000dca4: 92 10 00 1d mov %i5, %o1 4000dca8: 40 00 16 b8 call 40013788 <.urem> 4000dcac: 90 10 00 19 mov %i1, %o0 doubly = my_block / IMFS_MEMFILE_BLOCK_SLOTS; 4000dcb0: 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; 4000dcb4: b6 10 00 08 mov %o0, %i3 doubly = my_block / IMFS_MEMFILE_BLOCK_SLOTS; 4000dcb8: 40 00 16 08 call 400134d8 <.udiv> 4000dcbc: 90 10 00 19 mov %i1, %o0 triply = doubly / IMFS_MEMFILE_BLOCK_SLOTS; 4000dcc0: 92 10 00 1d mov %i5, %o1 4000dcc4: 40 00 16 05 call 400134d8 <.udiv> 4000dcc8: b2 10 00 08 mov %o0, %i1 doubly %= IMFS_MEMFILE_BLOCK_SLOTS; 4000dccc: 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; 4000dcd0: b8 10 00 08 mov %o0, %i4 doubly %= IMFS_MEMFILE_BLOCK_SLOTS; 4000dcd4: 40 00 16 ad call 40013788 <.urem> 4000dcd8: 90 10 00 19 mov %i1, %o0 p = info->triply_indirect; if ( malloc_it ) { 4000dcdc: 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; 4000dce0: ba 10 00 08 mov %o0, %i5 p = info->triply_indirect; if ( malloc_it ) { 4000dce4: 02 80 00 23 be 4000dd70 4000dce8: d0 06 20 60 ld [ %i0 + 0x60 ], %o0 if ( !p ) { 4000dcec: 80 a2 20 00 cmp %o0, 0 4000dcf0: 12 80 00 08 bne 4000dd10 4000dcf4: b9 2f 20 02 sll %i4, 2, %i4 p = memfile_alloc_block(); 4000dcf8: 7f ff ff 89 call 4000db1c 4000dcfc: 01 00 00 00 nop if ( !p ) 4000dd00: 80 a2 20 00 cmp %o0, 0 4000dd04: 02 bf ff a6 be 4000db9c <== NEVER TAKEN 4000dd08: 01 00 00 00 nop return 0; info->triply_indirect = p; 4000dd0c: d0 26 20 60 st %o0, [ %i0 + 0x60 ] } p1 = (block_p *) p[ triply ]; 4000dd10: b4 02 00 1c add %o0, %i4, %i2 4000dd14: d0 02 00 1c ld [ %o0 + %i4 ], %o0 if ( !p1 ) { 4000dd18: 80 a2 20 00 cmp %o0, 0 4000dd1c: 12 80 00 08 bne 4000dd3c 4000dd20: bb 2f 60 02 sll %i5, 2, %i5 p1 = memfile_alloc_block(); 4000dd24: 7f ff ff 7e call 4000db1c 4000dd28: 01 00 00 00 nop if ( !p1 ) 4000dd2c: 80 a2 20 00 cmp %o0, 0 4000dd30: 02 bf ff 9b be 4000db9c <== NEVER TAKEN 4000dd34: 01 00 00 00 nop return 0; p[ triply ] = (block_p) p1; 4000dd38: d0 26 80 00 st %o0, [ %i2 ] } p2 = (block_p *)p1[ doubly ]; 4000dd3c: b8 02 00 1d add %o0, %i5, %i4 4000dd40: d0 02 00 1d ld [ %o0 + %i5 ], %o0 if ( !p2 ) { 4000dd44: 80 a2 20 00 cmp %o0, 0 4000dd48: 12 80 00 08 bne 4000dd68 4000dd4c: b1 2e e0 02 sll %i3, 2, %i0 p2 = memfile_alloc_block(); 4000dd50: 7f ff ff 73 call 4000db1c 4000dd54: 01 00 00 00 nop if ( !p2 ) 4000dd58: 80 a2 20 00 cmp %o0, 0 4000dd5c: 02 bf ff 90 be 4000db9c <== NEVER TAKEN 4000dd60: 01 00 00 00 nop return 0; p1[ doubly ] = (block_p) p2; 4000dd64: d0 27 00 00 st %o0, [ %i4 ] } return (block_p *)&p2[ singly ]; 4000dd68: 81 c7 e0 08 ret 4000dd6c: 91 ea 00 18 restore %o0, %i0, %o0 } if ( !p ) 4000dd70: 80 a2 20 00 cmp %o0, 0 4000dd74: 02 bf ff 8a be 4000db9c <== NEVER TAKEN 4000dd78: b9 2f 20 02 sll %i4, 2, %i4 return 0; p1 = (block_p *) p[ triply ]; 4000dd7c: c2 02 00 1c ld [ %o0 + %i4 ], %g1 if ( !p1 ) 4000dd80: 80 a0 60 00 cmp %g1, 0 4000dd84: 02 bf ff 86 be 4000db9c <== NEVER TAKEN 4000dd88: bb 2f 60 02 sll %i5, 2, %i5 return 0; p2 = (block_p *)p1[ doubly ]; 4000dd8c: c2 00 40 1d ld [ %g1 + %i5 ], %g1 if ( !p2 ) 4000dd90: 80 a0 60 00 cmp %g1, 0 4000dd94: 02 bf ff 82 be 4000db9c <== NEVER TAKEN 4000dd98: 01 00 00 00 nop return 0; return (block_p *)&p2[ singly ]; 4000dd9c: b1 2e e0 02 sll %i3, 2, %i0 /* * This means the requested block number is out of range. */ return 0; } 4000dda0: 81 c7 e0 08 ret 4000dda4: 91 e8 40 18 restore %g1, %i0, %o0 =============================================================================== 4000dda8 : IMFS_jnode_t *the_jnode, off_t start, unsigned char *destination, unsigned int length ) { 4000dda8: 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; 4000ddac: c2 06 20 4c ld [ %i0 + 0x4c ], %g1 4000ddb0: 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 ) { 4000ddb4: c2 00 40 00 ld [ %g1 ], %g1 IMFS_jnode_t *the_jnode, off_t start, unsigned char *destination, unsigned int length ) { 4000ddb8: a0 10 00 19 mov %i1, %l0 4000ddbc: 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 ) { 4000ddc0: 80 a0 60 05 cmp %g1, 5 4000ddc4: 12 80 00 1a bne 4000de2c 4000ddc8: 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)) 4000ddcc: f4 1e 20 50 ldd [ %i0 + 0x50 ], %i2 4000ddd0: 82 10 20 00 clr %g1 4000ddd4: 86 a6 c0 11 subcc %i3, %l1, %g3 4000ddd8: 84 66 80 19 subx %i2, %i1, %g2 4000dddc: 80 a0 40 02 cmp %g1, %g2 4000dde0: 14 80 00 07 bg 4000ddfc <== NEVER TAKEN 4000dde4: d2 06 20 58 ld [ %i0 + 0x58 ], %o1 4000dde8: 80 a0 40 02 cmp %g1, %g2 4000ddec: 12 80 00 05 bne 4000de00 <== NEVER TAKEN 4000ddf0: 80 a7 00 03 cmp %i4, %g3 4000ddf4: 28 80 00 04 bleu,a 4000de04 <== NEVER TAKEN 4000ddf8: 92 02 40 11 add %o1, %l1, %o1 <== NOT EXECUTED my_length = the_jnode->info.linearfile.size - start; 4000ddfc: b8 26 c0 11 sub %i3, %l1, %i4 memcpy(dest, &file_ptr[start], my_length); 4000de00: 92 02 40 11 add %o1, %l1, %o1 4000de04: 94 10 00 1c mov %i4, %o2 4000de08: 40 00 08 ec call 400101b8 4000de0c: 90 10 00 12 mov %l2, %o0 static inline void IMFS_update_atime( IMFS_jnode_t *jnode ) { struct timeval now; gettimeofday( &now, 0 ); 4000de10: 90 07 bf f8 add %fp, -8, %o0 4000de14: 7f ff d6 a8 call 400038b4 4000de18: 92 10 20 00 clr %o1 jnode->stat_atime = now.tv_sec; 4000de1c: c2 07 bf f8 ld [ %fp + -8 ], %g1 4000de20: c2 27 60 40 st %g1, [ %i5 + 0x40 ] IMFS_update_atime( the_jnode ); return my_length; 4000de24: 81 c7 e0 08 ret 4000de28: 91 e8 00 1c restore %g0, %i4, %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 ) 4000de2c: c4 06 20 50 ld [ %i0 + 0x50 ], %g2 4000de30: 86 10 20 00 clr %g3 4000de34: c2 06 20 54 ld [ %i0 + 0x54 ], %g1 4000de38: 80 a0 c0 02 cmp %g3, %g2 4000de3c: 14 80 00 08 bg 4000de5c <== NEVER TAKEN 4000de40: 88 07 00 1a add %i4, %i2, %g4 4000de44: 80 a0 c0 02 cmp %g3, %g2 4000de48: 12 80 00 07 bne 4000de64 <== NEVER TAKEN 4000de4c: 33 10 00 5f sethi %hi(0x40017c00), %i1 4000de50: 80 a1 00 01 cmp %g4, %g1 4000de54: 08 80 00 05 bleu 4000de68 4000de58: f6 06 61 74 ld [ %i1 + 0x174 ], %i3 my_length = the_jnode->info.file.size - start; 4000de5c: b8 20 40 11 sub %g1, %l1, %i4 */ /* * Phase 1: possibly the last part of one block */ start_offset = start % IMFS_MEMFILE_BYTES_PER_BLOCK; 4000de60: 33 10 00 5f sethi %hi(0x40017c00), %i1 4000de64: f6 06 61 74 ld [ %i1 + 0x174 ], %i3 ! 40017d74 4000de68: 90 10 00 10 mov %l0, %o0 4000de6c: b5 3e e0 1f sra %i3, 0x1f, %i2 4000de70: 96 10 00 1b mov %i3, %o3 4000de74: 94 10 00 1a mov %i2, %o2 4000de78: 40 00 17 e2 call 40013e00 <__moddi3> 4000de7c: 92 10 00 11 mov %l1, %o1 block = start / IMFS_MEMFILE_BYTES_PER_BLOCK; 4000de80: 90 10 00 10 mov %l0, %o0 */ /* * Phase 1: possibly the last part of one block */ start_offset = start % IMFS_MEMFILE_BYTES_PER_BLOCK; 4000de84: a6 10 00 09 mov %o1, %l3 block = start / IMFS_MEMFILE_BYTES_PER_BLOCK; 4000de88: 94 10 00 1a mov %i2, %o2 4000de8c: 92 10 00 11 mov %l1, %o1 4000de90: 40 00 16 ea call 40013a38 <__divdi3> 4000de94: 96 10 00 1b mov %i3, %o3 if ( start_offset ) { 4000de98: 80 a4 e0 00 cmp %l3, 0 /* * Phase 1: possibly the last part of one block */ start_offset = start % IMFS_MEMFILE_BYTES_PER_BLOCK; block = start / IMFS_MEMFILE_BYTES_PER_BLOCK; 4000de9c: b4 10 00 09 mov %o1, %i2 if ( start_offset ) { 4000dea0: 02 80 00 17 be 4000defc 4000dea4: a0 10 00 19 mov %i1, %l0 to_copy = IMFS_MEMFILE_BYTES_PER_BLOCK - start_offset; 4000dea8: b6 26 c0 13 sub %i3, %l3, %i3 4000deac: 80 a7 00 1b cmp %i4, %i3 4000deb0: 08 80 00 03 bleu 4000debc 4000deb4: b2 10 00 1c mov %i4, %i1 4000deb8: 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 ); 4000debc: 90 10 00 1d mov %i5, %o0 4000dec0: 92 10 00 1a mov %i2, %o1 4000dec4: 94 10 20 00 clr %o2 4000dec8: 7f ff ff 22 call 4000db50 4000decc: b0 10 20 00 clr %i0 if ( !block_ptr ) 4000ded0: 80 a2 20 00 cmp %o0, 0 4000ded4: 02 80 00 33 be 4000dfa0 <== NEVER TAKEN 4000ded8: 94 10 00 19 mov %i1, %o2 return copied; memcpy( dest, &(*block_ptr)[ start_offset ], to_copy ); 4000dedc: d2 02 00 00 ld [ %o0 ], %o1 4000dee0: 90 10 00 12 mov %l2, %o0 4000dee4: 92 02 40 13 add %o1, %l3, %o1 4000dee8: 40 00 08 b4 call 400101b8 4000deec: a4 04 80 19 add %l2, %i1, %l2 dest += to_copy; block++; 4000def0: b4 06 a0 01 inc %i2 my_length -= to_copy; 4000def4: 10 80 00 03 b 4000df00 4000def8: b8 27 00 19 sub %i4, %i1, %i4 */ last_byte = start + length; if ( last_byte > the_jnode->info.file.size ) my_length = the_jnode->info.file.size - start; copied = 0; 4000defc: b2 10 20 00 clr %i1 } /* * Phase 2: all of zero of more blocks */ to_copy = IMFS_MEMFILE_BYTES_PER_BLOCK; 4000df00: f6 04 21 74 ld [ %l0 + 0x174 ], %i3 while ( my_length >= IMFS_MEMFILE_BYTES_PER_BLOCK ) { 4000df04: b0 10 00 19 mov %i1, %i0 4000df08: a4 24 80 19 sub %l2, %i1, %l2 4000df0c: c2 04 21 74 ld [ %l0 + 0x174 ], %g1 4000df10: 80 a7 00 01 cmp %i4, %g1 4000df14: 0a 80 00 10 bcs 4000df54 4000df18: b2 04 80 18 add %l2, %i0, %i1 block_ptr = IMFS_memfile_get_block_pointer( the_jnode, block, 0 ); 4000df1c: 90 10 00 1d mov %i5, %o0 4000df20: 92 10 00 1a mov %i2, %o1 4000df24: 7f ff ff 0b call 4000db50 4000df28: 94 10 20 00 clr %o2 if ( !block_ptr ) 4000df2c: 82 92 20 00 orcc %o0, 0, %g1 4000df30: 02 80 00 1c be 4000dfa0 <== NEVER TAKEN 4000df34: 90 10 00 19 mov %i1, %o0 return copied; memcpy( dest, &(*block_ptr)[ 0 ], to_copy ); 4000df38: d2 00 40 00 ld [ %g1 ], %o1 4000df3c: 94 10 00 1b mov %i3, %o2 4000df40: 40 00 08 9e call 400101b8 4000df44: b4 06 a0 01 inc %i2 dest += to_copy; block++; my_length -= to_copy; 4000df48: b8 27 00 1b sub %i4, %i3, %i4 copied += to_copy; 4000df4c: 10 bf ff f0 b 4000df0c 4000df50: b0 06 00 1b add %i0, %i3, %i0 /* * Phase 3: possibly the first part of one block */ IMFS_assert( my_length < IMFS_MEMFILE_BYTES_PER_BLOCK ); if ( my_length ) { 4000df54: 80 a7 20 00 cmp %i4, 0 4000df58: 02 80 00 0e be 4000df90 4000df5c: 90 07 bf f8 add %fp, -8, %o0 block_ptr = IMFS_memfile_get_block_pointer( the_jnode, block, 0 ); 4000df60: 90 10 00 1d mov %i5, %o0 4000df64: 92 10 00 1a mov %i2, %o1 4000df68: 7f ff fe fa call 4000db50 4000df6c: 94 10 20 00 clr %o2 if ( !block_ptr ) 4000df70: 82 92 20 00 orcc %o0, 0, %g1 4000df74: 02 80 00 0b be 4000dfa0 <== NEVER TAKEN 4000df78: 90 10 00 19 mov %i1, %o0 return copied; memcpy( dest, &(*block_ptr)[ 0 ], my_length ); 4000df7c: d2 00 40 00 ld [ %g1 ], %o1 4000df80: 94 10 00 1c mov %i4, %o2 4000df84: 40 00 08 8d call 400101b8 4000df88: b0 07 00 18 add %i4, %i0, %i0 static inline void IMFS_update_atime( IMFS_jnode_t *jnode ) { struct timeval now; gettimeofday( &now, 0 ); 4000df8c: 90 07 bf f8 add %fp, -8, %o0 4000df90: 7f ff d6 49 call 400038b4 4000df94: 92 10 20 00 clr %o1 jnode->stat_atime = now.tv_sec; 4000df98: c2 07 bf f8 ld [ %fp + -8 ], %g1 4000df9c: c2 27 60 40 st %g1, [ %i5 + 0x40 ] } IMFS_update_atime( the_jnode ); return copied; } 4000dfa0: 81 c7 e0 08 ret 4000dfa4: 81 e8 00 00 restore =============================================================================== 4000e590 : * is better to stick to simple, easy to understand algorithms. */ IMFS_jnode_t *IMFS_memfile_remove( IMFS_jnode_t *the_jnode ) { 4000e590: 9d e3 bf a0 save %sp, -96, %sp <== NOT EXECUTED /* * 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; 4000e594: 37 10 00 5f sethi %hi(0x40017c00), %i3 <== NOT EXECUTED * + doubly indirect * + triply indirect */ info = &the_jnode->info.file; if ( info->indirect ) { 4000e598: c2 06 20 58 ld [ %i0 + 0x58 ], %g1 <== NOT EXECUTED /* * 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; 4000e59c: fa 06 e1 74 ld [ %i3 + 0x174 ], %i5 <== NOT EXECUTED * + doubly indirect * + triply indirect */ info = &the_jnode->info.file; if ( info->indirect ) { 4000e5a0: 80 a0 60 00 cmp %g1, 0 <== NOT EXECUTED 4000e5a4: 02 80 00 05 be 4000e5b8 <== NOT EXECUTED 4000e5a8: bb 37 60 02 srl %i5, 2, %i5 <== NOT EXECUTED memfile_free_blocks_in_table( &info->indirect, to_free ); 4000e5ac: 90 06 20 58 add %i0, 0x58, %o0 <== NOT EXECUTED 4000e5b0: 7f ff ff e5 call 4000e544 <== NOT EXECUTED 4000e5b4: 92 10 00 1d mov %i5, %o1 <== NOT EXECUTED } if ( info->doubly_indirect ) { 4000e5b8: c2 06 20 5c ld [ %i0 + 0x5c ], %g1 <== NOT EXECUTED 4000e5bc: 80 a0 60 00 cmp %g1, 0 <== NOT EXECUTED 4000e5c0: 02 80 00 14 be 4000e610 <== NOT EXECUTED 4000e5c4: b8 10 20 00 clr %i4 <== NOT EXECUTED for ( i=0 ; i <== NOT EXECUTED 4000e5d8: 83 2f 20 02 sll %i4, 2, %g1 <== NOT EXECUTED if ( info->doubly_indirect[i] ) { 4000e5dc: c4 06 20 5c ld [ %i0 + 0x5c ], %g2 <== NOT EXECUTED 4000e5e0: 90 00 80 01 add %g2, %g1, %o0 <== NOT EXECUTED 4000e5e4: c2 00 80 01 ld [ %g2 + %g1 ], %g1 <== NOT EXECUTED 4000e5e8: 80 a0 60 00 cmp %g1, 0 <== NOT EXECUTED 4000e5ec: 22 bf ff f7 be,a 4000e5c8 <== NOT EXECUTED 4000e5f0: b8 07 20 01 inc %i4 <== NOT EXECUTED memfile_free_blocks_in_table( 4000e5f4: 7f ff ff d4 call 4000e544 <== NOT EXECUTED 4000e5f8: 92 10 00 1d mov %i5, %o1 <== NOT EXECUTED if ( info->indirect ) { memfile_free_blocks_in_table( &info->indirect, to_free ); } if ( info->doubly_indirect ) { for ( i=0 ; i <== NOT EXECUTED 4000e600: b8 07 20 01 inc %i4 <== NOT EXECUTED 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 ); 4000e604: 90 06 20 5c add %i0, 0x5c, %o0 <== NOT EXECUTED 4000e608: 7f ff ff cf call 4000e544 <== NOT EXECUTED 4000e60c: 92 10 00 1d mov %i5, %o1 <== NOT EXECUTED } if ( info->triply_indirect ) { 4000e610: c2 06 20 60 ld [ %i0 + 0x60 ], %g1 <== NOT EXECUTED 4000e614: 80 a0 60 00 cmp %g1, 0 <== NOT EXECUTED 4000e618: 02 80 00 25 be 4000e6ac <== NOT EXECUTED 4000e61c: b8 10 20 00 clr %i4 <== NOT EXECUTED for ( i=0 ; i <== NOT EXECUTED 4000e634: a2 10 00 19 mov %i1, %l1 <== NOT EXECUTED p = (block_p *) info->triply_indirect[i]; 4000e638: c2 06 20 60 ld [ %i0 + 0x60 ], %g1 <== NOT EXECUTED 4000e63c: a1 2f 20 02 sll %i4, 2, %l0 <== NOT EXECUTED 4000e640: f6 00 40 10 ld [ %g1 + %l0 ], %i3 <== NOT EXECUTED if ( !p ) /* ensure we have a valid pointer */ 4000e644: 80 a6 e0 00 cmp %i3, 0 <== NOT EXECUTED 4000e648: 02 80 00 16 be 4000e6a0 <== NOT EXECUTED 4000e64c: b4 10 20 00 clr %i2 <== NOT EXECUTED break; for ( j=0 ; j <== NOT EXECUTED 4000e660: d0 06 20 60 ld [ %i0 + 0x60 ], %o0 <== NOT EXECUTED if ( p[j] ) { 4000e664: c2 06 c0 00 ld [ %i3 ], %g1 <== NOT EXECUTED 4000e668: 80 a0 60 00 cmp %g1, 0 <== NOT EXECUTED 4000e66c: 02 80 00 04 be 4000e67c <== NOT EXECUTED 4000e670: 90 10 00 1b mov %i3, %o0 <== NOT EXECUTED memfile_free_blocks_in_table( (block_p **)&p[j], to_free); 4000e674: 7f ff ff b4 call 4000e544 <== NOT EXECUTED 4000e678: 92 10 00 1d mov %i5, %o1 <== NOT EXECUTED if ( info->triply_indirect ) { for ( i=0 ; itriply_indirect[i]; if ( !p ) /* ensure we have a valid pointer */ break; for ( j=0 ; j <== NOT EXECUTED 4000e684: b6 06 e0 04 add %i3, 4, %i3 <== NOT EXECUTED if ( p[j] ) { memfile_free_blocks_in_table( (block_p **)&p[j], to_free); } } memfile_free_blocks_in_table( 4000e688: 92 10 00 1d mov %i5, %o1 <== NOT EXECUTED 4000e68c: 90 02 00 10 add %o0, %l0, %o0 <== NOT EXECUTED 4000e690: 7f ff ff ad call 4000e544 <== NOT EXECUTED 4000e694: b8 07 20 01 inc %i4 <== NOT EXECUTED memfile_free_blocks_in_table( &info->doubly_indirect, to_free ); } if ( info->triply_indirect ) { for ( i=0 ; i <== NOT EXECUTED 4000e69c: c2 06 40 00 ld [ %i1 ], %g1 <== NOT EXECUTED } } memfile_free_blocks_in_table( (block_p **)&info->triply_indirect[i], to_free ); } memfile_free_blocks_in_table( 4000e6a0: 90 06 20 60 add %i0, 0x60, %o0 <== NOT EXECUTED 4000e6a4: 7f ff ff a8 call 4000e544 <== NOT EXECUTED 4000e6a8: 92 10 00 1d mov %i5, %o1 <== NOT EXECUTED (block_p **)&info->triply_indirect, to_free ); } return the_jnode; } 4000e6ac: 81 c7 e0 08 ret <== NOT EXECUTED 4000e6b0: 81 e8 00 00 restore <== NOT EXECUTED =============================================================================== 4000e064 : */ MEMFILE_STATIC void IMFS_memfile_remove_block( IMFS_jnode_t *the_jnode, unsigned int block ) { 4000e064: 9d e3 bf a0 save %sp, -96, %sp block_p *block_ptr; block_p ptr; block_ptr = IMFS_memfile_get_block_pointer( the_jnode, block, 0 ); 4000e068: 94 10 20 00 clr %o2 4000e06c: 90 10 00 18 mov %i0, %o0 4000e070: 7f ff fe b8 call 4000db50 4000e074: 92 10 00 19 mov %i1, %o1 if ( block_ptr ) { 4000e078: 80 a2 20 00 cmp %o0, 0 4000e07c: 02 80 00 06 be 4000e094 <== NEVER TAKEN 4000e080: 01 00 00 00 nop ptr = *block_ptr; 4000e084: f0 02 00 00 ld [ %o0 ], %i0 *block_ptr = 0; 4000e088: c0 22 00 00 clr [ %o0 ] memfile_free_block( ptr ); 4000e08c: 7f ff ff ed call 4000e040 4000e090: 81 e8 00 00 restore 4000e094: 81 c7 e0 08 ret <== NOT EXECUTED 4000e098: 81 e8 00 00 restore <== NOT EXECUTED =============================================================================== 4000e2a4 : IMFS_jnode_t *the_jnode, off_t start, const unsigned char *source, unsigned int length ) { 4000e2a4: 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 ) { 4000e2a8: c2 06 20 50 ld [ %i0 + 0x50 ], %g1 4000e2ac: 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; 4000e2b0: 96 07 00 1a add %i4, %i2, %o3 if ( last_byte > the_jnode->info.file.size ) { 4000e2b4: 80 a0 c0 01 cmp %g3, %g1 4000e2b8: 14 80 00 1b bg 4000e324 <== NEVER TAKEN 4000e2bc: c4 06 20 54 ld [ %i0 + 0x54 ], %g2 4000e2c0: 80 a0 c0 01 cmp %g3, %g1 4000e2c4: 12 80 00 06 bne 4000e2dc <== NEVER TAKEN 4000e2c8: 23 10 00 5f sethi %hi(0x40017c00), %l1 4000e2cc: 80 a2 c0 02 cmp %o3, %g2 4000e2d0: 18 80 00 16 bgu 4000e328 4000e2d4: 80 a6 40 01 cmp %i1, %g1 */ /* * Phase 1: possibly the last part of one block */ start_offset = start % IMFS_MEMFILE_BYTES_PER_BLOCK; 4000e2d8: 23 10 00 5f sethi %hi(0x40017c00), %l1 4000e2dc: fa 04 61 74 ld [ %l1 + 0x174 ], %i5 ! 40017d74 4000e2e0: 92 10 00 1a mov %i2, %o1 4000e2e4: a5 3f 60 1f sra %i5, 0x1f, %l2 4000e2e8: 96 10 00 1d mov %i5, %o3 4000e2ec: 94 10 00 12 mov %l2, %o2 4000e2f0: 40 00 16 c4 call 40013e00 <__moddi3> 4000e2f4: 90 10 00 19 mov %i1, %o0 block = start / IMFS_MEMFILE_BYTES_PER_BLOCK; 4000e2f8: 90 10 00 19 mov %i1, %o0 */ /* * Phase 1: possibly the last part of one block */ start_offset = start % IMFS_MEMFILE_BYTES_PER_BLOCK; 4000e2fc: a0 10 00 09 mov %o1, %l0 block = start / IMFS_MEMFILE_BYTES_PER_BLOCK; 4000e300: 94 10 00 12 mov %l2, %o2 4000e304: 92 10 00 1a mov %i2, %o1 4000e308: 40 00 15 cc call 40013a38 <__divdi3> 4000e30c: 96 10 00 1d mov %i5, %o3 if ( start_offset ) { 4000e310: 80 a4 20 00 cmp %l0, 0 4000e314: 12 80 00 17 bne 4000e370 4000e318: b4 10 00 09 mov %o1, %i2 status = IMFS_memfile_extend( the_jnode, zero_fill, last_byte ); if ( status ) return status; } copied = 0; 4000e31c: 10 80 00 28 b 4000e3bc 4000e320: 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; 4000e324: 80 a6 40 01 cmp %i1, %g1 <== NOT EXECUTED 4000e328: 14 80 00 09 bg 4000e34c <== NEVER TAKEN 4000e32c: 92 10 20 01 mov 1, %o1 4000e330: 80 a6 40 01 cmp %i1, %g1 4000e334: 32 80 00 06 bne,a 4000e34c <== NEVER TAKEN 4000e338: 92 10 20 00 clr %o1 <== NOT EXECUTED 4000e33c: 80 a6 80 02 cmp %i2, %g2 4000e340: 18 80 00 04 bgu 4000e350 4000e344: 90 10 00 18 mov %i0, %o0 4000e348: 92 10 20 00 clr %o1 status = IMFS_memfile_extend( the_jnode, zero_fill, last_byte ); 4000e34c: 90 10 00 18 mov %i0, %o0 4000e350: 92 0a 60 01 and %o1, 1, %o1 4000e354: 7f ff ff 52 call 4000e09c 4000e358: 94 10 20 00 clr %o2 if ( status ) 4000e35c: 82 92 20 00 orcc %o0, 0, %g1 4000e360: 02 bf ff df be 4000e2dc 4000e364: 23 10 00 5f sethi %hi(0x40017c00), %l1 } IMFS_mtime_ctime_update( the_jnode ); return copied; } 4000e368: 81 c7 e0 08 ret 4000e36c: 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; 4000e370: ba 27 40 10 sub %i5, %l0, %i5 4000e374: 80 a7 40 1c cmp %i5, %i4 4000e378: 38 80 00 02 bgu,a 4000e380 4000e37c: 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 ); 4000e380: 90 10 00 18 mov %i0, %o0 4000e384: 92 10 00 1a mov %i2, %o1 4000e388: 7f ff fd f2 call 4000db50 4000e38c: 94 10 20 00 clr %o2 if ( !block_ptr ) 4000e390: 80 a2 20 00 cmp %o0, 0 4000e394: 02 80 00 34 be 4000e464 <== NEVER TAKEN 4000e398: 82 10 20 00 clr %g1 block, to_copy, src ); #endif memcpy( &(*block_ptr)[ start_offset ], src, to_copy ); 4000e39c: d0 02 00 00 ld [ %o0 ], %o0 4000e3a0: 92 10 00 1b mov %i3, %o1 4000e3a4: 90 02 00 10 add %o0, %l0, %o0 4000e3a8: 94 10 00 1d mov %i5, %o2 4000e3ac: 40 00 07 83 call 400101b8 4000e3b0: b6 06 c0 1d add %i3, %i5, %i3 src += to_copy; block++; 4000e3b4: b4 06 a0 01 inc %i2 my_length -= to_copy; 4000e3b8: b8 27 00 1d sub %i4, %i5, %i4 /* * Phase 2: all of zero of more blocks */ to_copy = IMFS_MEMFILE_BYTES_PER_BLOCK; 4000e3bc: f2 04 61 74 ld [ %l1 + 0x174 ], %i1 4000e3c0: b6 26 c0 1d sub %i3, %i5, %i3 while ( my_length >= IMFS_MEMFILE_BYTES_PER_BLOCK ) { 4000e3c4: c2 04 61 74 ld [ %l1 + 0x174 ], %g1 4000e3c8: 80 a7 00 01 cmp %i4, %g1 4000e3cc: 0a 80 00 10 bcs 4000e40c 4000e3d0: a0 06 c0 1d add %i3, %i5, %l0 block_ptr = IMFS_memfile_get_block_pointer( the_jnode, block, 0 ); 4000e3d4: 90 10 00 18 mov %i0, %o0 4000e3d8: 92 10 00 1a mov %i2, %o1 4000e3dc: 7f ff fd dd call 4000db50 4000e3e0: 94 10 20 00 clr %o2 if ( !block_ptr ) 4000e3e4: 80 a2 20 00 cmp %o0, 0 4000e3e8: 02 80 00 1e be 4000e460 <== NEVER TAKEN 4000e3ec: 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 ); 4000e3f0: d0 02 00 00 ld [ %o0 ], %o0 4000e3f4: 92 10 00 10 mov %l0, %o1 4000e3f8: 40 00 07 70 call 400101b8 4000e3fc: b4 06 a0 01 inc %i2 src += to_copy; block++; my_length -= to_copy; 4000e400: b8 27 00 19 sub %i4, %i1, %i4 4000e404: 10 bf ff f0 b 4000e3c4 4000e408: ba 07 40 19 add %i5, %i1, %i5 * 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 ) { 4000e40c: 80 a7 20 00 cmp %i4, 0 4000e410: 02 80 00 0f be 4000e44c 4000e414: 90 07 bf f8 add %fp, -8, %o0 block_ptr = IMFS_memfile_get_block_pointer( the_jnode, block, 0 ); 4000e418: 90 10 00 18 mov %i0, %o0 4000e41c: 92 10 00 1a mov %i2, %o1 4000e420: 7f ff fd cc call 4000db50 4000e424: 94 10 20 00 clr %o2 if ( !block_ptr ) 4000e428: 80 a2 20 00 cmp %o0, 0 4000e42c: 02 80 00 0e be 4000e464 <== NEVER TAKEN 4000e430: 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 ); 4000e434: d0 02 00 00 ld [ %o0 ], %o0 4000e438: 92 10 00 10 mov %l0, %o1 4000e43c: 94 10 00 1c mov %i4, %o2 4000e440: 40 00 07 5e call 400101b8 4000e444: ba 07 40 1c add %i5, %i4, %i5 static inline void IMFS_mtime_ctime_update( IMFS_jnode_t *jnode ) { struct timeval now; gettimeofday( &now, 0 ); 4000e448: 90 07 bf f8 add %fp, -8, %o0 4000e44c: 7f ff d5 1a call 400038b4 4000e450: 92 10 20 00 clr %o1 jnode->stat_mtime = now.tv_sec; 4000e454: c2 07 bf f8 ld [ %fp + -8 ], %g1 4000e458: c2 26 20 44 st %g1, [ %i0 + 0x44 ] jnode->stat_ctime = now.tv_sec; 4000e45c: c2 26 20 48 st %g1, [ %i0 + 0x48 ] 4000e460: 82 10 00 1d mov %i5, %g1 } IMFS_mtime_ctime_update( the_jnode ); return copied; } 4000e464: b0 10 00 01 mov %g1, %i0 4000e468: 81 c7 e0 08 ret 4000e46c: 81 e8 00 00 restore =============================================================================== 400033dc : #endif #include "imfs.h" int IMFS_mount( rtems_filesystem_mount_table_entry_t *mt_entry ) { 400033dc: 9d e3 bf a0 save %sp, -96, %sp int rv = 0; IMFS_jnode_t *node = mt_entry->mt_point_node->location.node_access; 400033e0: c2 06 20 20 ld [ %i0 + 0x20 ], %g1 400033e4: 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; 400033e8: c4 00 60 4c ld [ %g1 + 0x4c ], %g2 if ( IMFS_is_directory( node ) ) { 400033ec: c4 00 80 00 ld [ %g2 ], %g2 400033f0: 80 a0 a0 00 cmp %g2, 0 400033f4: 12 80 00 0d bne 40003428 400033f8: 01 00 00 00 nop if ( node->info.directory.mt_fs == NULL ) { 400033fc: c4 00 60 5c ld [ %g1 + 0x5c ], %g2 40003400: 80 a0 a0 00 cmp %g2, 0 40003404: 12 80 00 05 bne 40003418 <== NEVER TAKEN 40003408: 01 00 00 00 nop node->info.directory.mt_fs = mt_entry; 4000340c: f0 20 60 5c st %i0, [ %g1 + 0x5c ] 40003410: 81 c7 e0 08 ret 40003414: 91 e8 20 00 restore %g0, 0, %o0 } else { errno = EBUSY; 40003418: 40 00 31 82 call 4000fa20 <__errno> <== NOT EXECUTED 4000341c: 01 00 00 00 nop <== NOT EXECUTED 40003420: 10 80 00 05 b 40003434 <== NOT EXECUTED 40003424: 82 10 20 10 mov 0x10, %g1 ! 10 <_TLS_Alignment+0xf> <== NOT EXECUTED rv = -1; } } else { errno = ENOTDIR; 40003428: 40 00 31 7e call 4000fa20 <__errno> 4000342c: 01 00 00 00 nop 40003430: 82 10 20 14 mov 0x14, %g1 ! 14 <_TLS_Alignment+0x13> 40003434: c2 22 00 00 st %g1, [ %o0 ] rv = -1; } return rv; } 40003438: 81 c7 e0 08 ret 4000343c: 91 e8 3f ff restore %g0, -1, %o0 =============================================================================== 4000bd5c : } static IMFS_jnode_t *IMFS_node_remove_directory( IMFS_jnode_t *node ) { 4000bd5c: 9d e3 bf a0 save %sp, -96, %sp if ( !rtems_chain_is_empty( &node->info.directory.Entries ) ) { 4000bd60: 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 ); 4000bd64: 82 06 20 54 add %i0, 0x54, %g1 4000bd68: 80 a0 80 01 cmp %g2, %g1 4000bd6c: 22 80 00 06 be,a 4000bd84 4000bd70: c2 06 20 5c ld [ %i0 + 0x5c ], %g1 errno = ENOTEMPTY; 4000bd74: 40 00 0f 2b call 4000fa20 <__errno> 4000bd78: 01 00 00 00 nop 4000bd7c: 10 80 00 08 b 4000bd9c 4000bd80: 82 10 20 5a mov 0x5a, %g1 ! 5a <_TLS_Alignment+0x59> node = NULL; } else if ( IMFS_is_mount_point( node ) ) { 4000bd84: 80 a0 60 00 cmp %g1, 0 4000bd88: 02 80 00 07 be 4000bda4 <== ALWAYS TAKEN 4000bd8c: 01 00 00 00 nop errno = EBUSY; 4000bd90: 40 00 0f 24 call 4000fa20 <__errno> <== NOT EXECUTED 4000bd94: 01 00 00 00 nop <== NOT EXECUTED 4000bd98: 82 10 20 10 mov 0x10, %g1 ! 10 <_TLS_Alignment+0xf> <== NOT EXECUTED 4000bd9c: c2 22 00 00 st %g1, [ %o0 ] 4000bda0: b0 10 20 00 clr %i0 node = NULL; } return node; } 4000bda4: 81 c7 e0 08 ret 4000bda8: 81 e8 00 00 restore =============================================================================== 40003440 : rtems_filesystem_node_types_t IMFS_node_type( const rtems_filesystem_location_info_t *loc ) { const IMFS_jnode_t *node = loc->node_access; 40003440: 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; 40003444: c2 00 a0 4c ld [ %g2 + 0x4c ], %g1 40003448: 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 ) { 4000344c: 80 a0 60 02 cmp %g1, 2 40003450: 02 80 00 06 be 40003468 40003454: 80 a0 60 05 cmp %g1, 5 40003458: 02 80 00 07 be 40003474 <== NEVER TAKEN 4000345c: 90 10 20 04 mov 4, %o0 40003460: 81 c3 e0 08 retl 40003464: 90 10 00 01 mov %g1, %o0 case IMFS_HARD_LINK: type = IMFS_type( node->info.hard_link.link_node ); 40003468: c2 00 a0 50 ld [ %g2 + 0x50 ], %g1 4000346c: c2 00 60 4c ld [ %g1 + 0x4c ], %g1 40003470: d0 00 40 00 ld [ %g1 ], %o0 type = imfs_type; break; } return type; } 40003474: 81 c3 e0 08 retl =============================================================================== 400034bc : const rtems_filesystem_location_info_t *oldloc, const rtems_filesystem_location_info_t *newparentloc, const char *name, size_t namelen ) { 400034bc: 9d e3 bf 98 save %sp, -104, %sp int rv = 0; IMFS_jnode_t *node = oldloc->node_access; 400034c0: 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 ) { 400034c4: c2 07 60 08 ld [ %i5 + 8 ], %g1 400034c8: 80 a0 60 00 cmp %g1, 0 400034cc: 02 80 00 20 be 4000354c <== NEVER TAKEN 400034d0: f4 06 a0 08 ld [ %i2 + 8 ], %i2 if ( namelen < IMFS_NAME_MAX ) { 400034d4: 80 a7 20 1f cmp %i4, 0x1f 400034d8: 18 80 00 19 bgu 4000353c 400034dc: 94 10 00 1c mov %i4, %o2 memcpy( node->name, name, namelen ); 400034e0: 92 10 00 1b mov %i3, %o1 400034e4: 40 00 33 35 call 400101b8 400034e8: 90 07 60 0c add %i5, 0xc, %o0 node->name [namelen] = '\0'; 400034ec: b8 07 40 1c add %i5, %i4, %i4 400034f0: c0 2f 20 0c clrb [ %i4 + 0xc ] ) { Chain_Node *next; Chain_Node *previous; next = the_node->next; 400034f4: c4 07 40 00 ld [ %i5 ], %g2 previous = the_node->previous; 400034f8: c2 07 60 04 ld [ %i5 + 4 ], %g1 static inline void IMFS_update_ctime( IMFS_jnode_t *jnode ) { struct timeval now; gettimeofday( &now, 0 ); 400034fc: 90 07 bf f8 add %fp, -8, %o0 next->previous = previous; 40003500: c2 20 a0 04 st %g1, [ %g2 + 4 ] previous->next = next; 40003504: 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; 40003508: 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; 4000350c: 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 ); 40003510: 84 06 a0 54 add %i2, 0x54, %g2 Chain_Node *old_last = tail->previous; the_node->next = tail; 40003514: c4 27 40 00 st %g2, [ %i5 ] tail->previous = the_node; 40003518: fa 26 a0 58 st %i5, [ %i2 + 0x58 ] old_last->next = the_node; 4000351c: fa 20 40 00 st %i5, [ %g1 ] the_node->previous = old_last; 40003520: c2 27 60 04 st %g1, [ %i5 + 4 ] static inline void IMFS_update_ctime( IMFS_jnode_t *jnode ) { struct timeval now; gettimeofday( &now, 0 ); 40003524: 40 00 00 e4 call 400038b4 40003528: 92 10 20 00 clr %o1 jnode->stat_ctime = now.tv_sec; 4000352c: c2 07 bf f8 ld [ %fp + -8 ], %g1 40003530: c2 27 60 48 st %g1, [ %i5 + 0x48 ] const rtems_filesystem_location_info_t *newparentloc, const char *name, size_t namelen ) { int rv = 0; 40003534: 81 c7 e0 08 ret 40003538: 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; 4000353c: 40 00 31 39 call 4000fa20 <__errno> 40003540: 01 00 00 00 nop 40003544: 10 80 00 05 b 40003558 40003548: 82 10 20 5b mov 0x5b, %g1 ! 5b <_TLS_Alignment+0x5a> rv = -1; } } else { errno = EINVAL; 4000354c: 40 00 31 35 call 4000fa20 <__errno> <== NOT EXECUTED 40003550: 01 00 00 00 nop <== NOT EXECUTED 40003554: 82 10 20 16 mov 0x16, %g1 ! 16 <_TLS_Alignment+0x15> <== NOT EXECUTED 40003558: c2 22 00 00 st %g1, [ %o0 ] rv = -1; } return rv; } 4000355c: 81 c7 e0 08 ret 40003560: 91 e8 3f ff restore %g0, -1, %o0 =============================================================================== 4000363c : #endif #include "imfs.h" int IMFS_unmount( rtems_filesystem_mount_table_entry_t *mt_entry ) { 4000363c: 9d e3 bf a0 save %sp, -96, %sp int rv = 0; IMFS_jnode_t *node = mt_entry->mt_point_node->location.node_access; 40003640: c2 06 20 20 ld [ %i0 + 0x20 ], %g1 40003644: 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; 40003648: c4 00 60 4c ld [ %g1 + 0x4c ], %g2 if ( IMFS_is_directory( node ) ) { 4000364c: c4 00 80 00 ld [ %g2 ], %g2 40003650: 80 a0 a0 00 cmp %g2, 0 40003654: 12 80 00 0d bne 40003688 <== NEVER TAKEN 40003658: 01 00 00 00 nop if ( node->info.directory.mt_fs == mt_entry ) { 4000365c: c4 00 60 5c ld [ %g1 + 0x5c ], %g2 40003660: 80 a0 80 18 cmp %g2, %i0 40003664: 12 80 00 05 bne 40003678 <== NEVER TAKEN 40003668: 01 00 00 00 nop node->info.directory.mt_fs = NULL; 4000366c: c0 20 60 5c clr [ %g1 + 0x5c ] 40003670: 81 c7 e0 08 ret 40003674: 91 e8 20 00 restore %g0, 0, %o0 } else { errno = EINVAL; 40003678: 40 00 30 ea call 4000fa20 <__errno> <== NOT EXECUTED 4000367c: 01 00 00 00 nop <== NOT EXECUTED 40003680: 10 80 00 05 b 40003694 <== NOT EXECUTED 40003684: 82 10 20 16 mov 0x16, %g1 ! 16 <_TLS_Alignment+0x15> <== NOT EXECUTED rv = -1; } } else { errno = ENOTDIR; 40003688: 40 00 30 e6 call 4000fa20 <__errno> <== NOT EXECUTED 4000368c: 01 00 00 00 nop <== NOT EXECUTED 40003690: 82 10 20 14 mov 0x14, %g1 ! 14 <_TLS_Alignment+0x13> <== NOT EXECUTED 40003694: c2 22 00 00 st %g1, [ %o0 ] <== NOT EXECUTED rv = -1; } return rv; } 40003698: 81 c7 e0 08 ret <== NOT EXECUTED 4000369c: 91 e8 3f ff restore %g0, -1, %o0 <== NOT EXECUTED =============================================================================== 40003aa8 : void RTEMS_Malloc_Initialize( const Heap_Area *areas, size_t area_count, Heap_Initialization_or_extend_handler extend ) { 40003aa8: 9d e3 bf a0 save %sp, -96, %sp Heap_Control *heap = RTEMS_Malloc_Heap; 40003aac: 03 10 00 5a sethi %hi(0x40016800), %g1 40003ab0: f6 00 63 28 ld [ %g1 + 0x328 ], %i3 ! 40016b28 if ( !rtems_configuration_get_unified_work_area() ) { 40003ab4: 03 10 00 55 sethi %hi(0x40015400), %g1 40003ab8: c2 08 61 c1 ldub [ %g1 + 0x1c1 ], %g1 ! 400155c1 40003abc: 80 a0 60 00 cmp %g1, 0 40003ac0: 12 80 00 1a bne 40003b28 40003ac4: 03 10 00 5c sethi %hi(0x40017000), %g1 40003ac8: 3b 10 00 21 sethi %hi(0x40008400), %i5 40003acc: b8 10 20 00 clr %i4 40003ad0: ba 17 63 ac or %i5, 0x3ac, %i5 40003ad4: a0 10 00 1d mov %i5, %l0 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) { 40003ad8: 80 a7 00 19 cmp %i4, %i1 40003adc: 02 80 00 0c be 40003b0c 40003ae0: 90 10 00 1b mov %i3, %o0 const Heap_Area *area = &areas [i]; uintptr_t space_available = (*init_or_extend)( 40003ae4: d2 06 00 00 ld [ %i0 ], %o1 40003ae8: d4 06 20 04 ld [ %i0 + 4 ], %o2 40003aec: 9f c7 40 00 call %i5 40003af0: 96 10 20 08 mov 8, %o3 area->begin, area->size, page_size ); if ( space_available > 0 ) { 40003af4: 80 a2 20 00 cmp %o0, 0 40003af8: 32 80 00 02 bne,a 40003b00 <== ALWAYS TAKEN 40003afc: 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) { 40003b00: b8 07 20 01 inc %i4 40003b04: 10 bf ff f5 b 40003ad8 40003b08: b0 06 20 08 add %i0, 8, %i0 if ( space_available > 0 ) { init_or_extend = extend; } } if ( init_or_extend == _Heap_Initialize ) { 40003b0c: 80 a7 40 10 cmp %i5, %l0 40003b10: 12 80 00 06 bne 40003b28 40003b14: 03 10 00 5c sethi %hi(0x40017000), %g1 _Terminate( 40003b18: 90 10 20 00 clr %o0 40003b1c: 92 10 20 01 mov 1, %o1 40003b20: 40 00 13 ba call 40008a08 <_Terminate> 40003b24: 94 10 20 17 mov 0x17, %o2 } /* * If configured, initialize the statistics support */ if ( rtems_malloc_statistics_helpers != NULL ) { 40003b28: c2 00 60 bc ld [ %g1 + 0xbc ], %g1 40003b2c: 80 a0 60 00 cmp %g1, 0 40003b30: 02 80 00 05 be 40003b44 40003b34: 3b 10 00 60 sethi %hi(0x40018000), %i5 (*rtems_malloc_statistics_helpers->initialize)(); 40003b38: c2 00 40 00 ld [ %g1 ], %g1 40003b3c: 9f c0 40 00 call %g1 40003b40: 01 00 00 00 nop } MSBUMP( space_available, _Protected_heap_Get_size( heap ) ); 40003b44: f8 07 63 40 ld [ %i5 + 0x340 ], %i4 40003b48: 40 00 16 0b call 40009374 <_Protected_heap_Get_size> 40003b4c: 90 10 00 1b mov %i3, %o0 40003b50: 90 02 00 1c add %o0, %i4, %o0 40003b54: d0 27 63 40 st %o0, [ %i5 + 0x340 ] 40003b58: 81 c7 e0 08 ret 40003b5c: 81 e8 00 00 restore =============================================================================== 400038ec : static rtems_printk_plugin_t print_handler; static void Stack_check_Dump_threads_usage( Thread_Control *the_thread ) { 400038ec: 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) { 400038f0: 80 a6 3f ff cmp %i0, -1 <== NOT EXECUTED 400038f4: 32 80 00 0a bne,a 4000391c <== NOT EXECUTED 400038f8: e0 06 21 18 ld [ %i0 + 0x118 ], %l0 <== NOT EXECUTED if (!Stack_check_Interrupt_stack.area) 400038fc: 3b 10 00 66 sethi %hi(0x40019800), %i5 <== NOT EXECUTED 40003900: ba 17 63 4c or %i5, 0x34c, %i5 ! 40019b4c <== NOT EXECUTED 40003904: c2 07 60 04 ld [ %i5 + 4 ], %g1 <== NOT EXECUTED 40003908: 80 a0 60 00 cmp %g1, 0 <== NOT EXECUTED 4000390c: 02 80 00 4a be 40003a34 <== NOT EXECUTED 40003910: a0 10 20 00 clr %l0 <== NOT EXECUTED return; stack = &Stack_check_Interrupt_stack; the_thread = 0; 40003914: 10 80 00 04 b 40003924 <== NOT EXECUTED 40003918: b0 10 20 00 clr %i0 <== NOT EXECUTED current = 0; } else #endif { stack = &the_thread->Start.Initial_stack; 4000391c: 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); 40003920: c2 07 60 04 ld [ %i5 + 4 ], %g1 <== NOT EXECUTED size = Stack_check_usable_stack_size(stack); 40003924: f6 07 40 00 ld [ %i5 ], %i3 <== NOT EXECUTED { stack = &the_thread->Start.Initial_stack; current = (void *)_CPU_Context_Get_SP( &the_thread->Registers ); } low = Stack_check_usable_stack_start(stack); 40003928: 84 00 60 10 add %g1, 0x10, %g2 <== NOT EXECUTED size = Stack_check_usable_stack_size(stack); 4000392c: b6 06 ff f0 add %i3, -16, %i3 <== NOT EXECUTED /* * start at lower memory and find first word that does not * match pattern */ base += PATTERN_SIZE_WORDS; 40003930: 82 00 60 20 add %g1, 0x20, %g1 <== NOT EXECUTED for (ebase = base + length; base < ebase; base++) 40003934: 86 0e ff fc and %i3, -4, %g3 <== NOT EXECUTED if (*base != U32_PATTERN) 40003938: 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++) 4000393c: 86 00 40 03 add %g1, %g3, %g3 <== NOT EXECUTED if (*base != U32_PATTERN) 40003940: 88 11 21 a5 or %g4, 0x1a5, %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++) 40003944: 80 a0 40 03 cmp %g1, %g3 <== NOT EXECUTED 40003948: 1a 80 00 0c bcc 40003978 <== NOT EXECUTED 4000394c: b8 10 20 00 clr %i4 <== NOT EXECUTED if (*base != U32_PATTERN) 40003950: f8 00 40 00 ld [ %g1 ], %i4 <== NOT EXECUTED 40003954: 80 a7 00 04 cmp %i4, %g4 <== NOT EXECUTED 40003958: 12 80 00 04 bne 40003968 <== NOT EXECUTED 4000395c: 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++) 40003960: 10 bf ff f9 b 40003944 <== NOT EXECUTED 40003964: 82 00 60 04 add %g1, 4, %g1 <== 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 ) 40003968: 02 80 00 04 be 40003978 <== NOT EXECUTED 4000396c: b8 10 20 00 clr %i4 <== NOT EXECUTED used = Stack_check_Calculate_used( low, size, high_water_mark ); 40003970: b8 00 80 1b add %g2, %i3, %i4 <== NOT EXECUTED 40003974: b8 27 00 01 sub %i4, %g1, %i4 <== NOT EXECUTED else used = 0; #if (CPU_ALLOCATE_INTERRUPT_STACK == TRUE) if ( the_thread ) 40003978: 80 a6 20 00 cmp %i0, 0 <== NOT EXECUTED 4000397c: 33 10 00 65 sethi %hi(0x40019400), %i1 <== NOT EXECUTED 40003980: 02 80 00 11 be 400039c4 <== NOT EXECUTED 40003984: 35 10 00 65 sethi %hi(0x40019400), %i2 <== NOT EXECUTED #endif { (*print_handler)( 40003988: f0 06 20 08 ld [ %i0 + 8 ], %i0 <== NOT EXECUTED 4000398c: e4 06 a1 54 ld [ %i2 + 0x154 ], %l2 <== NOT EXECUTED 40003990: e2 06 61 50 ld [ %i1 + 0x150 ], %l1 <== NOT EXECUTED 40003994: 94 07 bf f8 add %fp, -8, %o2 <== NOT EXECUTED 40003998: 90 10 00 18 mov %i0, %o0 <== NOT EXECUTED 4000399c: 40 00 12 cf call 400084d8 <== NOT EXECUTED 400039a0: 92 10 20 05 mov 5, %o1 <== NOT EXECUTED 400039a4: 13 10 00 5b sethi %hi(0x40016c00), %o1 <== NOT EXECUTED 400039a8: 96 10 00 08 mov %o0, %o3 <== NOT EXECUTED 400039ac: 92 12 62 f0 or %o1, 0x2f0, %o1 <== NOT EXECUTED 400039b0: 90 10 00 12 mov %l2, %o0 <== NOT EXECUTED 400039b4: 9f c4 40 00 call %l1 <== NOT EXECUTED 400039b8: 94 10 00 18 mov %i0, %o2 <== NOT EXECUTED 400039bc: 10 80 00 09 b 400039e0 <== NOT EXECUTED 400039c0: 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 ); 400039c4: c2 06 61 50 ld [ %i1 + 0x150 ], %g1 <== NOT EXECUTED 400039c8: d0 06 a1 54 ld [ %i2 + 0x154 ], %o0 <== NOT EXECUTED 400039cc: 13 10 00 5b sethi %hi(0x40016c00), %o1 <== NOT EXECUTED 400039d0: 94 10 3f ff mov -1, %o2 <== NOT EXECUTED 400039d4: 9f c0 40 00 call %g1 <== NOT EXECUTED 400039d8: 92 12 63 00 or %o1, 0x300, %o1 <== NOT EXECUTED (*print_handler)( print_context, " %010p - %010p %010p %8" PRId32 " ", stack->area, stack->area + stack->size - 1, 400039dc: d4 07 60 04 ld [ %i5 + 4 ], %o2 <== NOT EXECUTED 400039e0: d6 07 40 00 ld [ %i5 ], %o3 <== NOT EXECUTED else { (*print_handler)( print_context, "0x%08" PRIx32 " INTR", ~0 ); } #endif (*print_handler)( 400039e4: c2 06 61 50 ld [ %i1 + 0x150 ], %g1 <== NOT EXECUTED 400039e8: d0 06 a1 54 ld [ %i2 + 0x154 ], %o0 <== NOT EXECUTED print_context, " %010p - %010p %010p %8" PRId32 " ", stack->area, stack->area + stack->size - 1, 400039ec: 96 02 ff ff add %o3, -1, %o3 <== NOT EXECUTED else { (*print_handler)( print_context, "0x%08" PRIx32 " INTR", ~0 ); } #endif (*print_handler)( 400039f0: 13 10 00 5b sethi %hi(0x40016c00), %o1 <== NOT EXECUTED 400039f4: 96 02 80 0b add %o2, %o3, %o3 <== NOT EXECUTED 400039f8: 92 12 63 10 or %o1, 0x310, %o1 <== NOT EXECUTED 400039fc: 98 10 00 10 mov %l0, %o4 <== NOT EXECUTED 40003a00: 9f c0 40 00 call %g1 <== NOT EXECUTED 40003a04: 9a 10 00 1b mov %i3, %o5 <== NOT EXECUTED stack->area + stack->size - 1, current, size ); if (Stack_check_Initialized == 0) { 40003a08: 03 10 00 65 sethi %hi(0x40019400), %g1 <== NOT EXECUTED 40003a0c: c2 00 61 58 ld [ %g1 + 0x158 ], %g1 ! 40019558 <== NOT EXECUTED else { (*print_handler)( print_context, "0x%08" PRIx32 " INTR", ~0 ); } #endif (*print_handler)( 40003a10: 23 10 00 65 sethi %hi(0x40019400), %l1 <== NOT EXECUTED 40003a14: 31 10 00 65 sethi %hi(0x40019400), %i0 <== NOT EXECUTED stack->area + stack->size - 1, current, size ); if (Stack_check_Initialized == 0) { 40003a18: 80 a0 60 00 cmp %g1, 0 <== NOT EXECUTED (*print_handler)( print_context, "Unavailable\n" ); 40003a1c: d0 06 21 54 ld [ %i0 + 0x154 ], %o0 <== NOT EXECUTED stack->area + stack->size - 1, current, size ); if (Stack_check_Initialized == 0) { 40003a20: 12 80 00 07 bne 40003a3c <== NOT EXECUTED 40003a24: c2 04 61 50 ld [ %l1 + 0x150 ], %g1 <== NOT EXECUTED (*print_handler)( print_context, "Unavailable\n" ); 40003a28: 13 10 00 5b sethi %hi(0x40016c00), %o1 <== NOT EXECUTED 40003a2c: 9f c0 40 00 call %g1 <== NOT EXECUTED 40003a30: 92 12 63 30 or %o1, 0x330, %o1 ! 40016f30 <__FUNCTION__.6501+0x168><== NOT EXECUTED 40003a34: 81 c7 e0 08 ret <== NOT EXECUTED 40003a38: 81 e8 00 00 restore <== NOT EXECUTED } else { (*print_handler)( print_context, "%8" PRId32 "\n", used ); 40003a3c: 13 10 00 5b sethi %hi(0x40016c00), %o1 <== NOT EXECUTED 40003a40: 94 10 00 1c mov %i4, %o2 <== NOT EXECUTED 40003a44: 9f c0 40 00 call %g1 <== NOT EXECUTED 40003a48: 92 12 63 40 or %o1, 0x340, %o1 <== NOT EXECUTED 40003a4c: 81 c7 e0 08 ret <== NOT EXECUTED 40003a50: 81 e8 00 00 restore <== NOT EXECUTED =============================================================================== 40002d2c : Thread_Control *running, bool pattern_ok ) RTEMS_COMPILER_NO_RETURN_ATTRIBUTE; void Stack_check_report_blown_task(Thread_Control *running, bool pattern_ok) { 40002d2c: 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"); 40002d30: 11 10 00 55 sethi %hi(0x40015400), %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); 40002d34: fa 06 20 b8 ld [ %i0 + 0xb8 ], %i5 <== NOT EXECUTED char name[32]; printk("BLOWN STACK!!!\n"); 40002d38: 40 00 05 28 call 400041d8 <== NOT EXECUTED 40002d3c: 90 12 20 70 or %o0, 0x70, %o0 <== NOT EXECUTED printk("task control block: 0x%08" PRIxPTR "\n", running); 40002d40: 92 10 00 18 mov %i0, %o1 <== NOT EXECUTED 40002d44: 11 10 00 55 sethi %hi(0x40015400), %o0 <== NOT EXECUTED 40002d48: 40 00 05 24 call 400041d8 <== NOT EXECUTED 40002d4c: 90 12 20 80 or %o0, 0x80, %o0 ! 40015480 <__FUNCTION__.6501+0x190><== NOT EXECUTED printk("task ID: 0x%08lx\n", (unsigned long) running->Object.id); 40002d50: d2 06 20 08 ld [ %i0 + 8 ], %o1 <== NOT EXECUTED 40002d54: 11 10 00 55 sethi %hi(0x40015400), %o0 <== NOT EXECUTED 40002d58: 40 00 05 20 call 400041d8 <== NOT EXECUTED 40002d5c: 90 12 20 a0 or %o0, 0xa0, %o0 ! 400154a0 <__FUNCTION__.6501+0x1b0><== NOT EXECUTED printk( 40002d60: d2 06 20 0c ld [ %i0 + 0xc ], %o1 <== NOT EXECUTED 40002d64: 11 10 00 55 sethi %hi(0x40015400), %o0 <== NOT EXECUTED 40002d68: 40 00 05 1c call 400041d8 <== NOT EXECUTED 40002d6c: 90 12 20 b8 or %o0, 0xb8, %o0 ! 400154b8 <__FUNCTION__.6501+0x1c8><== NOT EXECUTED "task name: 0x%08" PRIx32 "\n", running->Object.name.name_u32 ); printk( 40002d70: d0 06 20 08 ld [ %i0 + 8 ], %o0 <== NOT EXECUTED 40002d74: 94 07 bf e0 add %fp, -32, %o2 <== NOT EXECUTED 40002d78: 40 00 10 e1 call 400070fc <== NOT EXECUTED 40002d7c: 92 10 20 20 mov 0x20, %o1 <== NOT EXECUTED 40002d80: 92 10 00 08 mov %o0, %o1 <== NOT EXECUTED 40002d84: 11 10 00 55 sethi %hi(0x40015400), %o0 <== NOT EXECUTED 40002d88: 40 00 05 14 call 400041d8 <== NOT EXECUTED 40002d8c: 90 12 20 d0 or %o0, 0xd0, %o0 ! 400154d0 <__FUNCTION__.6501+0x1e0><== 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) 40002d90: d4 06 20 b8 ld [ %i0 + 0xb8 ], %o2 <== NOT EXECUTED 40002d94: 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( 40002d98: 11 10 00 55 sethi %hi(0x40015400), %o0 <== NOT EXECUTED 40002d9c: 96 02 80 09 add %o2, %o1, %o3 <== NOT EXECUTED 40002da0: 40 00 05 0e call 400041d8 <== NOT EXECUTED 40002da4: 90 12 20 e8 or %o0, 0xe8, %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) { 40002da8: 80 a6 60 00 cmp %i1, 0 <== NOT EXECUTED 40002dac: 32 80 00 09 bne,a 40002dd0 <== NOT EXECUTED 40002db0: d2 06 20 0c ld [ %i0 + 0xc ], %o1 <== NOT EXECUTED printk( 40002db4: 11 10 00 55 sethi %hi(0x40015400), %o0 <== NOT EXECUTED 40002db8: 92 10 20 10 mov 0x10, %o1 <== NOT EXECUTED 40002dbc: 90 12 21 18 or %o0, 0x118, %o0 <== NOT EXECUTED 40002dc0: 94 07 60 08 add %i5, 8, %o2 <== NOT EXECUTED 40002dc4: 40 00 05 05 call 400041d8 <== NOT EXECUTED 40002dc8: 96 07 60 18 add %i5, 0x18, %o3 <== NOT EXECUTED rtems_configuration_get_user_multiprocessing_table()->node ); } #endif rtems_fatal( 40002dcc: d2 06 20 0c ld [ %i0 + 0xc ], %o1 <== NOT EXECUTED 40002dd0: 40 00 13 23 call 40007a5c <== NOT EXECUTED 40002dd4: 90 10 20 08 mov 8, %o0 <== NOT EXECUTED =============================================================================== 4000aa38 <_CORE_RWLock_Release>: CORE_RWLock_Status _CORE_RWLock_Release( CORE_RWLock_Control *the_rwlock, Thread_Control *executing ) { 4000aa38: 9d e3 bf a0 save %sp, -96, %sp * 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 ); 4000aa3c: 7f ff e4 ce call 40003d74 4000aa40: 01 00 00 00 nop if ( the_rwlock->current_state == CORE_RWLOCK_UNLOCKED){ 4000aa44: c2 06 20 44 ld [ %i0 + 0x44 ], %g1 4000aa48: 80 a0 60 00 cmp %g1, 0 4000aa4c: 12 80 00 08 bne 4000aa6c <_CORE_RWLock_Release+0x34> 4000aa50: 80 a0 60 01 cmp %g1, 1 _ISR_Enable( level ); 4000aa54: 7f ff e4 cb call 40003d80 4000aa58: b0 10 20 00 clr %i0 executing->Wait.return_code = CORE_RWLOCK_UNAVAILABLE; 4000aa5c: 82 10 20 02 mov 2, %g1 4000aa60: c2 26 60 34 st %g1, [ %i1 + 0x34 ] 4000aa64: 81 c7 e0 08 ret 4000aa68: 81 e8 00 00 restore return CORE_RWLOCK_SUCCESSFUL; } if ( the_rwlock->current_state == CORE_RWLOCK_LOCKED_FOR_READING ) { 4000aa6c: 32 80 00 0b bne,a 4000aa98 <_CORE_RWLock_Release+0x60> 4000aa70: c0 26 60 34 clr [ %i1 + 0x34 ] the_rwlock->number_of_readers -= 1; 4000aa74: c2 06 20 48 ld [ %i0 + 0x48 ], %g1 4000aa78: 82 00 7f ff add %g1, -1, %g1 if ( the_rwlock->number_of_readers != 0 ) { 4000aa7c: 80 a0 60 00 cmp %g1, 0 4000aa80: 02 80 00 05 be 4000aa94 <_CORE_RWLock_Release+0x5c> 4000aa84: c2 26 20 48 st %g1, [ %i0 + 0x48 ] /* must be unlocked again */ _ISR_Enable( level ); 4000aa88: 7f ff e4 be call 40003d80 4000aa8c: b0 10 20 00 clr %i0 return CORE_RWLOCK_SUCCESSFUL; 4000aa90: 30 80 00 24 b,a 4000ab20 <_CORE_RWLock_Release+0xe8> } } /* CORE_RWLOCK_LOCKED_FOR_WRITING or READING with readers */ executing->Wait.return_code = CORE_RWLOCK_SUCCESSFUL; 4000aa94: c0 26 60 34 clr [ %i1 + 0x34 ] /* * Implicitly transition to "unlocked" and find another thread interested * in obtaining this rwlock. */ the_rwlock->current_state = CORE_RWLOCK_UNLOCKED; 4000aa98: c0 26 20 44 clr [ %i0 + 0x44 ] _ISR_Enable( level ); 4000aa9c: 7f ff e4 b9 call 40003d80 4000aaa0: 01 00 00 00 nop next = _Thread_queue_Dequeue( &the_rwlock->Wait_queue ); 4000aaa4: 40 00 07 7e call 4000c89c <_Thread_queue_Dequeue> 4000aaa8: 90 10 00 18 mov %i0, %o0 if ( next ) { 4000aaac: 80 a2 20 00 cmp %o0, 0 4000aab0: 22 80 00 1c be,a 4000ab20 <_CORE_RWLock_Release+0xe8> 4000aab4: b0 10 20 00 clr %i0 if ( next->Wait.option == CORE_RWLOCK_THREAD_WAITING_FOR_WRITE ) { 4000aab8: c2 02 20 30 ld [ %o0 + 0x30 ], %g1 4000aabc: 80 a0 60 01 cmp %g1, 1 4000aac0: 32 80 00 05 bne,a 4000aad4 <_CORE_RWLock_Release+0x9c> 4000aac4: c2 06 20 48 ld [ %i0 + 0x48 ], %g1 the_rwlock->current_state = CORE_RWLOCK_LOCKED_FOR_WRITING; 4000aac8: 82 10 20 02 mov 2, %g1 return CORE_RWLOCK_SUCCESSFUL; 4000aacc: 10 80 00 14 b 4000ab1c <_CORE_RWLock_Release+0xe4> 4000aad0: c2 26 20 44 st %g1, [ %i0 + 0x44 ] } /* * Must be CORE_RWLOCK_THREAD_WAITING_FOR_READING */ the_rwlock->number_of_readers += 1; 4000aad4: 82 00 60 01 inc %g1 4000aad8: c2 26 20 48 st %g1, [ %i0 + 0x48 ] the_rwlock->current_state = CORE_RWLOCK_LOCKED_FOR_READING; 4000aadc: 82 10 20 01 mov 1, %g1 4000aae0: 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 ); 4000aae4: 40 00 08 96 call 4000cd3c <_Thread_queue_First> 4000aae8: 90 10 00 18 mov %i0, %o0 if ( !next || 4000aaec: 92 92 20 00 orcc %o0, 0, %o1 4000aaf0: 22 80 00 0c be,a 4000ab20 <_CORE_RWLock_Release+0xe8> 4000aaf4: b0 10 20 00 clr %i0 4000aaf8: c2 02 60 30 ld [ %o1 + 0x30 ], %g1 4000aafc: 80 a0 60 01 cmp %g1, 1 4000ab00: 02 80 00 07 be 4000ab1c <_CORE_RWLock_Release+0xe4> <== NEVER TAKEN 4000ab04: 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; 4000ab08: c2 06 20 48 ld [ %i0 + 0x48 ], %g1 4000ab0c: 82 00 60 01 inc %g1 _Thread_queue_Extract( &the_rwlock->Wait_queue, next ); 4000ab10: 40 00 08 50 call 4000cc50 <_Thread_queue_Extract> 4000ab14: c2 26 20 48 st %g1, [ %i0 + 0x48 ] } 4000ab18: 30 bf ff f3 b,a 4000aae4 <_CORE_RWLock_Release+0xac> } /* indentation is to match _ISR_Disable at top */ return CORE_RWLOCK_SUCCESSFUL; } 4000ab1c: b0 10 20 00 clr %i0 4000ab20: 81 c7 e0 08 ret 4000ab24: 81 e8 00 00 restore =============================================================================== 4000ab28 <_CORE_RWLock_Timeout>: void _CORE_RWLock_Timeout( Objects_Id id, void *ignored ) { 4000ab28: 9d e3 bf 98 save %sp, -104, %sp Thread_Control *the_thread; Objects_Locations location; the_thread = _Thread_Get( id, &location ); 4000ab2c: 90 10 00 18 mov %i0, %o0 4000ab30: 40 00 06 85 call 4000c544 <_Thread_Get> 4000ab34: 92 07 bf fc add %fp, -4, %o1 switch ( location ) { 4000ab38: c2 07 bf fc ld [ %fp + -4 ], %g1 4000ab3c: 80 a0 60 00 cmp %g1, 0 4000ab40: 12 80 00 07 bne 4000ab5c <_CORE_RWLock_Timeout+0x34> <== NEVER TAKEN 4000ab44: 01 00 00 00 nop #if defined(RTEMS_MULTIPROCESSING) case OBJECTS_REMOTE: /* impossible */ #endif break; case OBJECTS_LOCAL: _Thread_queue_Process_timeout( the_thread ); 4000ab48: 40 00 08 be call 4000ce40 <_Thread_queue_Process_timeout> 4000ab4c: 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 disable_level = _Thread_Dispatch_disable_level; 4000ab50: c4 01 a0 10 ld [ %g6 + 0x10 ], %g2 ISR_Level level; _ISR_Disable( level ); #endif --disable_level; 4000ab54: 84 00 bf ff add %g2, -1, %g2 _Thread_Dispatch_disable_level = disable_level; 4000ab58: c4 21 a0 10 st %g2, [ %g6 + 0x10 ] 4000ab5c: 81 c7 e0 08 ret 4000ab60: 81 e8 00 00 restore =============================================================================== 4000846c <_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 ) { 4000846c: 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)) ) { 40008470: 90 10 00 18 mov %i0, %o0 40008474: 40 00 07 4a call 4000a19c <_Thread_queue_Dequeue> 40008478: ba 10 00 18 mov %i0, %i5 4000847c: 80 a2 20 00 cmp %o0, 0 40008480: 12 80 00 0e bne 400084b8 <_CORE_semaphore_Surrender+0x4c> 40008484: 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 ); 40008488: 7f ff e7 eb call 40002434 4000848c: 01 00 00 00 nop if ( the_semaphore->count < the_semaphore->Attributes.maximum_count ) 40008490: c2 07 60 48 ld [ %i5 + 0x48 ], %g1 40008494: c4 07 60 40 ld [ %i5 + 0x40 ], %g2 40008498: 80 a0 40 02 cmp %g1, %g2 4000849c: 1a 80 00 05 bcc 400084b0 <_CORE_semaphore_Surrender+0x44> <== NEVER TAKEN 400084a0: b0 10 20 04 mov 4, %i0 the_semaphore->count += 1; 400084a4: 82 00 60 01 inc %g1 { Thread_Control *the_thread; ISR_Level level; CORE_semaphore_Status status; status = CORE_SEMAPHORE_STATUS_SUCCESSFUL; 400084a8: b0 10 20 00 clr %i0 #endif } else { _ISR_Disable( level ); if ( the_semaphore->count < the_semaphore->Attributes.maximum_count ) the_semaphore->count += 1; 400084ac: c2 27 60 48 st %g1, [ %i5 + 0x48 ] else status = CORE_SEMAPHORE_MAXIMUM_COUNT_EXCEEDED; _ISR_Enable( level ); 400084b0: 7f ff e7 e4 call 40002440 400084b4: 01 00 00 00 nop } return status; } 400084b8: 81 c7 e0 08 ret 400084bc: 81 e8 00 00 restore =============================================================================== 400071cc <_Event_Surrender>: rtems_event_set event_in, Event_Control *event, Thread_blocking_operation_States *sync_state, States_Control wait_state ) { 400071cc: 9d e3 bf a0 save %sp, -96, %sp rtems_event_set seized_events; rtems_option option_set; option_set = the_thread->Wait.option; _ISR_Disable( level ); 400071d0: 7f ff ec 99 call 40002434 400071d4: fa 06 20 30 ld [ %i0 + 0x30 ], %i5 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; 400071d8: c2 06 80 00 ld [ %i2 ], %g1 400071dc: b2 16 40 01 or %i1, %g1, %i1 400071e0: f2 26 80 00 st %i1, [ %i2 ] /* * At this point the event condition is a speculative quantity. Later state * checks will show if the thread actually waits for an event. */ event_condition = the_thread->Wait.count; 400071e4: c4 06 20 24 ld [ %i0 + 0x24 ], %g2 seized_events = _Event_sets_Get( pending_events, event_condition ); if ( 400071e8: 82 8e 40 02 andcc %i1, %g2, %g1 400071ec: 02 80 00 31 be 400072b0 <_Event_Surrender+0xe4> 400071f0: 80 a0 40 02 cmp %g1, %g2 !_Event_sets_Is_empty( seized_events ) && ( seized_events == event_condition || _Options_Is_any( option_set ) ) 400071f4: 02 80 00 04 be 40007204 <_Event_Surrender+0x38> 400071f8: 80 8f 60 02 btst 2, %i5 400071fc: 02 80 00 2d be 400072b0 <_Event_Surrender+0xe4> 40007200: 01 00 00 00 nop * section issue to deal with. The entity sending to the executing thread * can be either the executing thread or an ISR. In case it is the * executing thread, then the blocking operation state is not equal to * THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED. */ if ( _Thread_Is_executing( the_thread ) && 40007204: c4 01 a0 18 ld [ %g6 + 0x18 ], %g2 40007208: 80 a6 00 02 cmp %i0, %g2 4000720c: 32 80 00 0e bne,a 40007244 <_Event_Surrender+0x78> 40007210: c4 06 20 10 ld [ %i0 + 0x10 ], %g2 40007214: c4 06 c0 00 ld [ %i3 ], %g2 40007218: 80 a0 a0 01 cmp %g2, 1 4000721c: 32 80 00 0a bne,a 40007244 <_Event_Surrender+0x78> 40007220: c4 06 20 10 ld [ %i0 + 0x10 ], %g2 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) ); 40007224: 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; 40007228: c4 06 20 28 ld [ %i0 + 0x28 ], %g2 * executing thread, then the blocking operation state is not equal to * THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED. */ if ( _Thread_Is_executing( the_thread ) && *sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED ) { event->pending_events = _Event_sets_Clear( 4000722c: f2 26 80 00 st %i1, [ %i2 ] pending_events, seized_events ); the_thread->Wait.count = 0; 40007230: c0 26 20 24 clr [ %i0 + 0x24 ] *(rtems_event_set *)the_thread->Wait.return_argument = seized_events; 40007234: c2 20 80 00 st %g1, [ %g2 ] *sync_state = THREAD_BLOCKING_OPERATION_SATISFIED; 40007238: 82 10 20 03 mov 3, %g1 4000723c: 10 80 00 1d b 400072b0 <_Event_Surrender+0xe4> 40007240: c2 26 c0 00 st %g1, [ %i3 ] } else if ( _States_Are_set( the_thread->current_state, wait_state ) ) { 40007244: 80 8f 00 02 btst %i4, %g2 40007248: 02 80 00 1a be 400072b0 <_Event_Surrender+0xe4> <== NEVER TAKEN 4000724c: 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; 40007250: c4 06 20 28 ld [ %i0 + 0x28 ], %g2 ); the_thread->Wait.count = 0; *(rtems_event_set *)the_thread->Wait.return_argument = seized_events; *sync_state = THREAD_BLOCKING_OPERATION_SATISFIED; } else if ( _States_Are_set( the_thread->current_state, wait_state ) ) { event->pending_events = _Event_sets_Clear( 40007254: f2 26 80 00 st %i1, [ %i2 ] pending_events, seized_events ); the_thread->Wait.count = 0; 40007258: c0 26 20 24 clr [ %i0 + 0x24 ] *(rtems_event_set *)the_thread->Wait.return_argument = seized_events; 4000725c: c2 20 80 00 st %g1, [ %g2 ] _ISR_Flash( level ); 40007260: 7f ff ec 78 call 40002440 40007264: 01 00 00 00 nop 40007268: 7f ff ec 73 call 40002434 4000726c: 01 00 00 00 nop if ( !_Watchdog_Is_active( &the_thread->Timer ) ) { 40007270: c2 06 20 50 ld [ %i0 + 0x50 ], %g1 40007274: 80 a0 60 02 cmp %g1, 2 40007278: 02 80 00 06 be 40007290 <_Event_Surrender+0xc4> 4000727c: 82 10 20 03 mov 3, %g1 _ISR_Enable( level ); 40007280: 7f ff ec 70 call 40002440 40007284: 33 04 03 ff sethi %hi(0x100ffc00), %i1 RTEMS_INLINE_ROUTINE void _Thread_Unblock ( Thread_Control *the_thread ) { _Thread_Clear_state( the_thread, STATES_BLOCKED ); 40007288: 10 80 00 08 b 400072a8 <_Event_Surrender+0xdc> 4000728c: b2 16 63 f8 or %i1, 0x3f8, %i1 ! 100ffff8 RTEMS_INLINE_ROUTINE void _Watchdog_Deactivate( Watchdog_Control *the_watchdog ) { the_watchdog->state = WATCHDOG_REMOVE_IT; 40007290: c2 26 20 50 st %g1, [ %i0 + 0x50 ] _Thread_Unblock( the_thread ); } else { _Watchdog_Deactivate( &the_thread->Timer ); _ISR_Enable( level ); 40007294: 7f ff ec 6b call 40002440 40007298: 33 04 03 ff sethi %hi(0x100ffc00), %i1 (void) _Watchdog_Remove( &the_thread->Timer ); 4000729c: 40 00 0f 7f call 4000b098 <_Watchdog_Remove> 400072a0: 90 06 20 48 add %i0, 0x48, %o0 400072a4: b2 16 63 f8 or %i1, 0x3f8, %i1 400072a8: 40 00 0a 31 call 40009b6c <_Thread_Clear_state> 400072ac: 81 e8 00 00 restore _Thread_Unblock( the_thread ); } return; } } _ISR_Enable( level ); 400072b0: 7f ff ec 64 call 40002440 400072b4: 91 e8 00 08 restore %g0, %o0, %o0 =============================================================================== 400072b8 <_Event_Timeout>: void _Event_Timeout( Objects_Id id, void *arg ) { 400072b8: 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 ); 400072bc: 90 10 00 18 mov %i0, %o0 400072c0: 40 00 0a e1 call 40009e44 <_Thread_Get> 400072c4: 92 07 bf fc add %fp, -4, %o1 switch ( location ) { 400072c8: c2 07 bf fc ld [ %fp + -4 ], %g1 400072cc: 80 a0 60 00 cmp %g1, 0 400072d0: 12 80 00 1f bne 4000734c <_Event_Timeout+0x94> <== NEVER TAKEN 400072d4: 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 ); 400072d8: 7f ff ec 57 call 40002434 400072dc: 01 00 00 00 nop * This test is necessary to avoid state corruption if the timeout * happens after the event condition is satisfied in * _Event_Surrender(). A satisfied event condition is indicated with * count set to zero. */ if ( !the_thread->Wait.count ) { 400072e0: c2 07 60 24 ld [ %i5 + 0x24 ], %g1 400072e4: 80 a0 60 00 cmp %g1, 0 400072e8: 32 80 00 05 bne,a 400072fc <_Event_Timeout+0x44> 400072ec: c2 01 a0 18 ld [ %g6 + 0x18 ], %g1 _ISR_Enable( level ); 400072f0: 7f ff ec 54 call 40002440 400072f4: 01 00 00 00 nop 400072f8: 30 80 00 12 b,a 40007340 <_Event_Timeout+0x88> _Objects_Put_without_thread_dispatch( &the_thread->Object ); return; } the_thread->Wait.count = 0; if ( _Thread_Is_executing( the_thread ) ) { 400072fc: 80 a7 40 01 cmp %i5, %g1 40007300: 12 80 00 08 bne 40007320 <_Event_Timeout+0x68> 40007304: c0 27 60 24 clr [ %i5 + 0x24 ] if ( *sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED ) 40007308: c2 06 40 00 ld [ %i1 ], %g1 4000730c: 80 a0 60 01 cmp %g1, 1 40007310: 12 80 00 05 bne 40007324 <_Event_Timeout+0x6c> <== NEVER TAKEN 40007314: 82 10 20 06 mov 6, %g1 *sync_state = THREAD_BLOCKING_OPERATION_TIMEOUT; 40007318: 82 10 20 02 mov 2, %g1 4000731c: c2 26 40 00 st %g1, [ %i1 ] } the_thread->Wait.return_code = RTEMS_TIMEOUT; 40007320: 82 10 20 06 mov 6, %g1 40007324: c2 27 60 34 st %g1, [ %i5 + 0x34 ] _ISR_Enable( level ); 40007328: 7f ff ec 46 call 40002440 4000732c: 01 00 00 00 nop 40007330: 13 04 03 ff sethi %hi(0x100ffc00), %o1 40007334: 90 10 00 1d mov %i5, %o0 40007338: 40 00 0a 0d call 40009b6c <_Thread_Clear_state> 4000733c: 92 12 63 f8 or %o1, 0x3f8, %o1 * * This routine decrements the thread dispatch level. */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_decrement_disable_level(void) { uint32_t disable_level = _Thread_Dispatch_disable_level; 40007340: c4 01 a0 10 ld [ %g6 + 0x10 ], %g2 ISR_Level level; _ISR_Disable( level ); #endif --disable_level; 40007344: 84 00 bf ff add %g2, -1, %g2 _Thread_Dispatch_disable_level = disable_level; 40007348: c4 21 a0 10 st %g2, [ %g6 + 0x10 ] 4000734c: 81 c7 e0 08 ret 40007350: 81 e8 00 00 restore =============================================================================== 4000712c <_Freechain_Get>: } void *_Freechain_Get(Freechain_Control *freechain) { 4000712c: 9d e3 bf a0 save %sp, -96, %sp if ( _Chain_Is_empty( &freechain->Freechain ) ) { 40007130: c4 06 00 00 ld [ %i0 ], %g2 RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( const Chain_Control *the_chain ) { return _Chain_Immutable_first( the_chain ) == _Chain_Immutable_tail( the_chain ); 40007134: 82 06 20 04 add %i0, 4, %g1 40007138: 80 a0 80 01 cmp %g2, %g1 4000713c: 22 80 00 08 be,a 4000715c <_Freechain_Get+0x30> 40007140: c2 06 20 0c ld [ %i0 + 0xc ], %g1 RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Get_first_unprotected( Chain_Control *the_chain ) { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *old_first = head->next; 40007144: c2 06 00 00 ld [ %i0 ], %g1 Chain_Node *new_first = old_first->next; 40007148: c4 00 40 00 ld [ %g1 ], %g2 head->next = new_first; 4000714c: c4 26 00 00 st %g2, [ %i0 ] new_first->previous = head; 40007150: f0 20 a0 04 st %i0, [ %g2 + 4 ] if ( !( *freechain->extend )( freechain ) ) { return NULL; } } return _Chain_Get_first_unprotected( &freechain->Freechain ); 40007154: 81 c7 e0 08 ret 40007158: 91 e8 00 01 restore %g0, %g1, %o0 } void *_Freechain_Get(Freechain_Control *freechain) { if ( _Chain_Is_empty( &freechain->Freechain ) ) { if ( !( *freechain->extend )( freechain ) ) { 4000715c: 9f c0 40 00 call %g1 40007160: 90 10 00 18 mov %i0, %o0 40007164: 80 a2 20 00 cmp %o0, 0 40007168: 32 bf ff f8 bne,a 40007148 <_Freechain_Get+0x1c> <== ALWAYS TAKEN 4000716c: c2 06 00 00 ld [ %i0 ], %g1 return NULL; } } return _Chain_Get_first_unprotected( &freechain->Freechain ); } 40007170: 81 c7 e0 08 ret <== NOT EXECUTED 40007174: 91 e8 20 00 restore %g0, 0, %o0 <== NOT EXECUTED =============================================================================== 4000d8c8 <_Heap_Extend>: Heap_Control *heap, void *extend_area_begin_ptr, uintptr_t extend_area_size, uintptr_t unused __attribute__((unused)) ) { 4000d8c8: 9d e3 bf 98 save %sp, -104, %sp Heap_Block *start_block = first_block; Heap_Block *merge_below_block = NULL; Heap_Block *merge_above_block = NULL; Heap_Block *link_below_block = NULL; Heap_Block *link_above_block = NULL; Heap_Block *extend_first_block = NULL; 4000d8cc: c0 27 bf f8 clr [ %fp + -8 ] Heap_Block *extend_last_block = NULL; 4000d8d0: c0 27 bf fc clr [ %fp + -4 ] uintptr_t const page_size = heap->page_size; uintptr_t const min_block_size = heap->min_block_size; uintptr_t const extend_area_begin = (uintptr_t) extend_area_begin_ptr; uintptr_t const extend_area_end = extend_area_begin + extend_area_size; 4000d8d4: ba 06 40 1a add %i1, %i2, %i5 uintptr_t extend_area_size, uintptr_t unused __attribute__((unused)) ) { Heap_Statistics *const stats = &heap->stats; Heap_Block *const first_block = heap->first_block; 4000d8d8: e4 06 20 20 ld [ %i0 + 0x20 ], %l2 Heap_Block *merge_above_block = NULL; Heap_Block *link_below_block = NULL; Heap_Block *link_above_block = NULL; Heap_Block *extend_first_block = NULL; Heap_Block *extend_last_block = NULL; uintptr_t const page_size = heap->page_size; 4000d8dc: ec 06 20 10 ld [ %i0 + 0x10 ], %l6 uintptr_t const min_block_size = heap->min_block_size; 4000d8e0: d6 06 20 14 ld [ %i0 + 0x14 ], %o3 uintptr_t const free_size = stats->free_size; uintptr_t extend_first_block_size = 0; uintptr_t extended_size = 0; bool extend_area_ok = false; if ( extend_area_end < extend_area_begin ) { 4000d8e4: 80 a7 40 19 cmp %i5, %i1 4000d8e8: 1a 80 00 04 bcc 4000d8f8 <_Heap_Extend+0x30> 4000d8ec: e6 06 20 30 ld [ %i0 + 0x30 ], %l3 return 0; 4000d8f0: 81 c7 e0 08 ret 4000d8f4: 91 e8 20 00 restore %g0, 0, %o0 } extend_area_ok = _Heap_Get_first_and_last_block( 4000d8f8: 90 10 00 19 mov %i1, %o0 4000d8fc: 92 10 00 1a mov %i2, %o1 4000d900: 94 10 00 16 mov %l6, %o2 4000d904: 98 07 bf f8 add %fp, -8, %o4 4000d908: 7f ff ec 3f call 40008a04 <_Heap_Get_first_and_last_block> 4000d90c: 9a 07 bf fc add %fp, -4, %o5 page_size, min_block_size, &extend_first_block, &extend_last_block ); if (!extend_area_ok ) { 4000d910: 80 a2 20 00 cmp %o0, 0 4000d914: 02 bf ff f7 be 4000d8f0 <_Heap_Extend+0x28> 4000d918: b6 10 00 12 mov %l2, %i3 4000d91c: a2 10 20 00 clr %l1 4000d920: a8 10 20 00 clr %l4 4000d924: b8 10 20 00 clr %i4 4000d928: a0 10 20 00 clr %l0 return 0; } do { uintptr_t const sub_area_begin = (start_block != first_block) ? (uintptr_t) start_block : heap->area_begin; 4000d92c: 80 a6 c0 12 cmp %i3, %l2 4000d930: 12 80 00 03 bne 4000d93c <_Heap_Extend+0x74> <== NEVER TAKEN 4000d934: aa 10 00 1b mov %i3, %l5 4000d938: ea 06 20 18 ld [ %i0 + 0x18 ], %l5 uintptr_t const sub_area_end = start_block->prev_size; 4000d93c: f4 06 c0 00 ld [ %i3 ], %i2 RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down( uintptr_t value, uintptr_t alignment ) { return value - (value % alignment); 4000d940: 92 10 00 16 mov %l6, %o1 4000d944: 40 00 18 f8 call 40013d24 <.urem> 4000d948: 90 10 00 1a mov %i2, %o0 4000d94c: ae 06 bf f8 add %i2, -8, %l7 Heap_Block *const end_block = _Heap_Block_of_alloc_area( sub_area_end, page_size ); if ( 4000d950: 80 a5 40 1d cmp %l5, %i5 4000d954: 1a 80 00 05 bcc 4000d968 <_Heap_Extend+0xa0> 4000d958: 90 25 c0 08 sub %l7, %o0, %o0 4000d95c: 80 a6 40 1a cmp %i1, %i2 4000d960: 0a bf ff e4 bcs 4000d8f0 <_Heap_Extend+0x28> 4000d964: 01 00 00 00 nop sub_area_end > extend_area_begin && extend_area_end > sub_area_begin ) { return 0; } if ( extend_area_end == sub_area_begin ) { 4000d968: 80 a7 40 15 cmp %i5, %l5 4000d96c: 02 80 00 06 be 4000d984 <_Heap_Extend+0xbc> 4000d970: 80 a7 40 1a cmp %i5, %i2 merge_below_block = start_block; } else if ( extend_area_end < sub_area_end ) { 4000d974: 2a 80 00 05 bcs,a 4000d988 <_Heap_Extend+0xc0> 4000d978: a8 10 00 1b mov %i3, %l4 link_below_block = start_block; } if ( sub_area_end == extend_area_begin ) { 4000d97c: 10 80 00 04 b 4000d98c <_Heap_Extend+0xc4> 4000d980: 80 a6 80 19 cmp %i2, %i1 4000d984: a0 10 00 1b mov %i3, %l0 4000d988: 80 a6 80 19 cmp %i2, %i1 4000d98c: 12 80 00 05 bne 4000d9a0 <_Heap_Extend+0xd8> 4000d990: 80 a6 80 19 cmp %i2, %i1 start_block->prev_size = extend_area_end; 4000d994: fa 26 c0 00 st %i5, [ %i3 ] 4000d998: 10 80 00 04 b 4000d9a8 <_Heap_Extend+0xe0> 4000d99c: b8 10 00 08 mov %o0, %i4 merge_above_block = end_block; } else if ( sub_area_end < extend_area_begin ) { 4000d9a0: 2a 80 00 02 bcs,a 4000d9a8 <_Heap_Extend+0xe0> 4000d9a4: a2 10 00 08 mov %o0, %l1 - 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; 4000d9a8: f6 02 20 04 ld [ %o0 + 4 ], %i3 4000d9ac: b6 0e ff fe and %i3, -2, %i3 RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); 4000d9b0: b6 06 c0 08 add %i3, %o0, %i3 link_above_block = end_block; } start_block = _Heap_Block_at( end_block, _Heap_Block_size( end_block ) ); } while ( start_block != first_block ); 4000d9b4: 80 a6 c0 12 cmp %i3, %l2 4000d9b8: 12 bf ff e1 bne 4000d93c <_Heap_Extend+0x74> 4000d9bc: aa 10 00 1b mov %i3, %l5 if ( extend_area_begin < heap->area_begin ) { 4000d9c0: c2 06 20 18 ld [ %i0 + 0x18 ], %g1 4000d9c4: 80 a6 40 01 cmp %i1, %g1 4000d9c8: 3a 80 00 04 bcc,a 4000d9d8 <_Heap_Extend+0x110> 4000d9cc: c2 06 20 1c ld [ %i0 + 0x1c ], %g1 4000d9d0: 10 80 00 05 b 4000d9e4 <_Heap_Extend+0x11c> 4000d9d4: f2 26 20 18 st %i1, [ %i0 + 0x18 ] heap->area_begin = extend_area_begin; } else if ( heap->area_end < extend_area_end ) { 4000d9d8: 80 a0 40 1d cmp %g1, %i5 4000d9dc: 2a 80 00 02 bcs,a 4000d9e4 <_Heap_Extend+0x11c> 4000d9e0: fa 26 20 1c st %i5, [ %i0 + 0x1c ] heap->area_end = extend_area_end; } extend_first_block_size = (uintptr_t) extend_last_block - (uintptr_t) extend_first_block; 4000d9e4: c4 07 bf f8 ld [ %fp + -8 ], %g2 4000d9e8: c2 07 bf fc ld [ %fp + -4 ], %g1 extend_first_block->prev_size = extend_area_end; 4000d9ec: fa 20 80 00 st %i5, [ %g2 ] heap->area_begin = extend_area_begin; } else if ( heap->area_end < extend_area_end ) { heap->area_end = extend_area_end; } extend_first_block_size = 4000d9f0: 86 20 40 02 sub %g1, %g2, %g3 (uintptr_t) extend_last_block - (uintptr_t) extend_first_block; extend_first_block->prev_size = extend_area_end; extend_first_block->size_and_flag = extend_first_block_size | HEAP_PREV_BLOCK_USED; 4000d9f4: 88 10 e0 01 or %g3, 1, %g4 extend_first_block_size = (uintptr_t) extend_last_block - (uintptr_t) extend_first_block; extend_first_block->prev_size = extend_area_end; extend_first_block->size_and_flag = 4000d9f8: c8 20 a0 04 st %g4, [ %g2 + 4 ] extend_first_block_size | HEAP_PREV_BLOCK_USED; _Heap_Protection_block_initialize( heap, extend_first_block ); extend_last_block->prev_size = extend_first_block_size; 4000d9fc: c6 20 40 00 st %g3, [ %g1 ] extend_last_block->size_and_flag = 0; _Heap_Protection_block_initialize( heap, extend_last_block ); if ( (uintptr_t) extend_first_block < (uintptr_t) heap->first_block ) { 4000da00: c6 06 20 20 ld [ %i0 + 0x20 ], %g3 4000da04: 80 a0 c0 02 cmp %g3, %g2 4000da08: 08 80 00 04 bleu 4000da18 <_Heap_Extend+0x150> 4000da0c: c0 20 60 04 clr [ %g1 + 4 ] 4000da10: 10 80 00 06 b 4000da28 <_Heap_Extend+0x160> 4000da14: c4 26 20 20 st %g2, [ %i0 + 0x20 ] heap->first_block = extend_first_block; } else if ( (uintptr_t) extend_last_block > (uintptr_t) heap->last_block ) { 4000da18: c4 06 20 24 ld [ %i0 + 0x24 ], %g2 4000da1c: 80 a0 80 01 cmp %g2, %g1 4000da20: 2a 80 00 02 bcs,a 4000da28 <_Heap_Extend+0x160> 4000da24: c2 26 20 24 st %g1, [ %i0 + 0x24 ] heap->last_block = extend_last_block; } if ( merge_below_block != NULL ) { 4000da28: 80 a4 20 00 cmp %l0, 0 4000da2c: 02 80 00 14 be 4000da7c <_Heap_Extend+0x1b4> 4000da30: b2 06 60 08 add %i1, 8, %i1 Heap_Control *heap, uintptr_t extend_area_begin, Heap_Block *first_block ) { uintptr_t const page_size = heap->page_size; 4000da34: f6 06 20 10 ld [ %i0 + 0x10 ], %i3 RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_up( uintptr_t value, uintptr_t alignment ) { uintptr_t remainder = value % alignment; 4000da38: 92 10 00 1b mov %i3, %o1 4000da3c: 40 00 18 ba call 40013d24 <.urem> 4000da40: 90 10 00 19 mov %i1, %o0 if ( remainder != 0 ) { 4000da44: 80 a2 20 00 cmp %o0, 0 4000da48: 02 80 00 04 be 4000da58 <_Heap_Extend+0x190> 4000da4c: c2 04 00 00 ld [ %l0 ], %g1 return value - remainder + alignment; 4000da50: b2 06 40 1b add %i1, %i3, %i1 4000da54: b2 26 40 08 sub %i1, %o0, %i1 uintptr_t const new_first_block_alloc_begin = _Heap_Align_up( extend_area_begin + HEAP_BLOCK_HEADER_SIZE, page_size ); uintptr_t const new_first_block_begin = 4000da58: 92 06 7f f8 add %i1, -8, %o1 uintptr_t const first_block_begin = (uintptr_t) first_block; uintptr_t const new_first_block_size = first_block_begin - new_first_block_begin; Heap_Block *const new_first_block = (Heap_Block *) new_first_block_begin; new_first_block->prev_size = first_block->prev_size; 4000da5c: c2 26 7f f8 st %g1, [ %i1 + -8 ] uintptr_t const new_first_block_alloc_begin = _Heap_Align_up( extend_area_begin + HEAP_BLOCK_HEADER_SIZE, page_size ); uintptr_t const new_first_block_begin = new_first_block_alloc_begin - HEAP_BLOCK_HEADER_SIZE; uintptr_t const first_block_begin = (uintptr_t) first_block; uintptr_t const new_first_block_size = 4000da60: 82 24 00 09 sub %l0, %o1, %g1 first_block_begin - new_first_block_begin; Heap_Block *const new_first_block = (Heap_Block *) new_first_block_begin; new_first_block->prev_size = first_block->prev_size; new_first_block->size_and_flag = new_first_block_size | HEAP_PREV_BLOCK_USED; 4000da64: 82 10 60 01 or %g1, 1, %g1 _Heap_Free_block( heap, new_first_block ); 4000da68: 90 10 00 18 mov %i0, %o0 4000da6c: 7f ff ff 81 call 4000d870 <_Heap_Free_block> 4000da70: c2 22 60 04 st %g1, [ %o1 + 4 ] link_below_block, extend_last_block ); } if ( merge_above_block != NULL ) { 4000da74: 10 80 00 08 b 4000da94 <_Heap_Extend+0x1cc> 4000da78: 80 a7 20 00 cmp %i4, 0 heap->last_block = extend_last_block; } if ( merge_below_block != NULL ) { _Heap_Merge_below( heap, extend_area_begin, merge_below_block ); } else if ( link_below_block != NULL ) { 4000da7c: 80 a5 20 00 cmp %l4, 0 4000da80: 02 80 00 04 be 4000da90 <_Heap_Extend+0x1c8> 4000da84: a8 25 00 01 sub %l4, %g1, %l4 { uintptr_t const last_block_begin = (uintptr_t) last_block; uintptr_t const link_begin = (uintptr_t) link; last_block->size_and_flag = (link_begin - last_block_begin) | HEAP_PREV_BLOCK_USED; 4000da88: a8 15 20 01 or %l4, 1, %l4 ) { uintptr_t const last_block_begin = (uintptr_t) last_block; uintptr_t const link_begin = (uintptr_t) link; last_block->size_and_flag = 4000da8c: e8 20 60 04 st %l4, [ %g1 + 4 ] link_below_block, extend_last_block ); } if ( merge_above_block != NULL ) { 4000da90: 80 a7 20 00 cmp %i4, 0 4000da94: 02 80 00 15 be 4000dae8 <_Heap_Extend+0x220> 4000da98: ba 07 7f f8 add %i5, -8, %i5 RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down( uintptr_t value, uintptr_t alignment ) { return value - (value % alignment); 4000da9c: d2 06 20 10 ld [ %i0 + 0x10 ], %o1 uintptr_t extend_area_end ) { uintptr_t const page_size = heap->page_size; uintptr_t const last_block_begin = (uintptr_t) last_block; uintptr_t const last_block_new_size = _Heap_Align_down( 4000daa0: ba 27 40 1c sub %i5, %i4, %i5 4000daa4: 40 00 18 a0 call 40013d24 <.urem> 4000daa8: 90 10 00 1d mov %i5, %o0 ); Heap_Block *const new_last_block = _Heap_Block_at( last_block, last_block_new_size ); new_last_block->size_and_flag = (last_block->size_and_flag - last_block_new_size) 4000daac: c4 07 20 04 ld [ %i4 + 4 ], %g2 4000dab0: 90 27 40 08 sub %i5, %o0, %o0 page_size ); Heap_Block *const new_last_block = _Heap_Block_at( last_block, last_block_new_size ); new_last_block->size_and_flag = 4000dab4: 82 02 00 1c add %o0, %i4, %g1 (last_block->size_and_flag - last_block_new_size) 4000dab8: 84 20 80 08 sub %g2, %o0, %g2 | HEAP_PREV_BLOCK_USED; 4000dabc: 84 10 a0 01 or %g2, 1, %g2 page_size ); Heap_Block *const new_last_block = _Heap_Block_at( last_block, last_block_new_size ); new_last_block->size_and_flag = 4000dac0: c4 20 60 04 st %g2, [ %g1 + 4 ] RTEMS_INLINE_ROUTINE void _Heap_Block_set_size( Heap_Block *block, uintptr_t size ) { uintptr_t flag = block->size_and_flag & HEAP_PREV_BLOCK_USED; 4000dac4: c2 07 20 04 ld [ %i4 + 4 ], %g1 (last_block->size_and_flag - last_block_new_size) | HEAP_PREV_BLOCK_USED; _Heap_Block_set_size( last_block, last_block_new_size ); _Heap_Free_block( heap, last_block ); 4000dac8: 92 10 00 1c mov %i4, %o1 4000dacc: 82 08 60 01 and %g1, 1, %g1 block->size_and_flag = size | flag; 4000dad0: 90 12 00 01 or %o0, %g1, %o0 4000dad4: d0 27 20 04 st %o0, [ %i4 + 4 ] 4000dad8: 7f ff ff 66 call 4000d870 <_Heap_Free_block> 4000dadc: 90 10 00 18 mov %i0, %o0 extend_first_block, extend_last_block ); } if ( merge_below_block == NULL && merge_above_block == NULL ) { 4000dae0: 10 80 00 0f b 4000db1c <_Heap_Extend+0x254> 4000dae4: 80 a7 20 00 cmp %i4, 0 ); } if ( merge_above_block != NULL ) { _Heap_Merge_above( heap, merge_above_block, extend_area_end ); } else if ( link_above_block != NULL ) { 4000dae8: 80 a4 60 00 cmp %l1, 0 4000daec: 02 80 00 0b be 4000db18 <_Heap_Extend+0x250> 4000daf0: c4 07 bf f8 ld [ %fp + -8 ], %g2 RTEMS_INLINE_ROUTINE void _Heap_Block_set_size( Heap_Block *block, uintptr_t size ) { uintptr_t flag = block->size_and_flag & HEAP_PREV_BLOCK_USED; 4000daf4: c6 04 60 04 ld [ %l1 + 4 ], %g3 _Heap_Link_above( 4000daf8: c2 07 bf fc ld [ %fp + -4 ], %g1 4000dafc: 86 08 e0 01 and %g3, 1, %g3 ) { uintptr_t const link_begin = (uintptr_t) link; uintptr_t const first_block_begin = (uintptr_t) first_block; _Heap_Block_set_size( link, first_block_begin - link_begin ); 4000db00: 84 20 80 11 sub %g2, %l1, %g2 block->size_and_flag = size | flag; 4000db04: 84 10 c0 02 or %g3, %g2, %g2 4000db08: c4 24 60 04 st %g2, [ %l1 + 4 ] last_block->size_and_flag |= HEAP_PREV_BLOCK_USED; 4000db0c: c4 00 60 04 ld [ %g1 + 4 ], %g2 4000db10: 84 10 a0 01 or %g2, 1, %g2 4000db14: c4 20 60 04 st %g2, [ %g1 + 4 ] extend_first_block, extend_last_block ); } if ( merge_below_block == NULL && merge_above_block == NULL ) { 4000db18: 80 a7 20 00 cmp %i4, 0 4000db1c: 32 80 00 09 bne,a 4000db40 <_Heap_Extend+0x278> 4000db20: c2 06 20 24 ld [ %i0 + 0x24 ], %g1 4000db24: 80 a4 20 00 cmp %l0, 0 4000db28: 32 80 00 06 bne,a 4000db40 <_Heap_Extend+0x278> 4000db2c: c2 06 20 24 ld [ %i0 + 0x24 ], %g1 _Heap_Free_block( heap, extend_first_block ); 4000db30: d2 07 bf f8 ld [ %fp + -8 ], %o1 4000db34: 7f ff ff 4f call 4000d870 <_Heap_Free_block> 4000db38: 90 10 00 18 mov %i0, %o0 */ RTEMS_INLINE_ROUTINE void _Heap_Set_last_block_size( Heap_Control *heap ) { _Heap_Block_set_size( heap->last_block, (uintptr_t) heap->first_block - (uintptr_t) heap->last_block 4000db3c: c2 06 20 24 ld [ %i0 + 0x24 ], %g1 * This feature will be used to terminate the scattered heap area list. See * also _Heap_Extend(). */ RTEMS_INLINE_ROUTINE void _Heap_Set_last_block_size( Heap_Control *heap ) { _Heap_Block_set_size( 4000db40: c4 06 20 20 ld [ %i0 + 0x20 ], %g2 RTEMS_INLINE_ROUTINE void _Heap_Block_set_size( Heap_Block *block, uintptr_t size ) { uintptr_t flag = block->size_and_flag & HEAP_PREV_BLOCK_USED; 4000db44: c6 00 60 04 ld [ %g1 + 4 ], %g3 * This feature will be used to terminate the scattered heap area list. See * also _Heap_Extend(). */ RTEMS_INLINE_ROUTINE void _Heap_Set_last_block_size( Heap_Control *heap ) { _Heap_Block_set_size( 4000db48: 84 20 80 01 sub %g2, %g1, %g2 RTEMS_INLINE_ROUTINE void _Heap_Block_set_size( Heap_Block *block, uintptr_t size ) { uintptr_t flag = block->size_and_flag & HEAP_PREV_BLOCK_USED; 4000db4c: 86 08 e0 01 and %g3, 1, %g3 block->size_and_flag = size | flag; 4000db50: 84 10 c0 02 or %g3, %g2, %g2 4000db54: c4 20 60 04 st %g2, [ %g1 + 4 ] } _Heap_Set_last_block_size( heap ); extended_size = stats->free_size - free_size; 4000db58: c2 06 20 30 ld [ %i0 + 0x30 ], %g1 4000db5c: a6 20 40 13 sub %g1, %l3, %l3 /* Statistics */ stats->size += extended_size; 4000db60: c2 06 20 2c ld [ %i0 + 0x2c ], %g1 4000db64: 82 00 40 13 add %g1, %l3, %g1 4000db68: c2 26 20 2c st %g1, [ %i0 + 0x2c ] return extended_size; } 4000db6c: 81 c7 e0 08 ret 4000db70: 91 e8 00 13 restore %g0, %l3, %o0 =============================================================================== 4000d61c <_Heap_Free>: return do_free; } #endif bool _Heap_Free( Heap_Control *heap, void *alloc_begin_ptr ) { 4000d61c: 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 ) { 4000d620: 80 a6 60 00 cmp %i1, 0 4000d624: 02 80 00 7d be 4000d818 <_Heap_Free+0x1fc> 4000d628: 86 10 20 01 mov 1, %g3 4000d62c: d2 06 20 10 ld [ %i0 + 0x10 ], %o1 4000d630: 40 00 18 56 call 40013788 <.urem> 4000d634: 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 4000d638: f4 06 20 20 ld [ %i0 + 0x20 ], %i2 RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down( uintptr_t value, uintptr_t alignment ) { return value - (value % alignment); 4000d63c: 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); 4000d640: 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; 4000d644: 80 a2 00 1a cmp %o0, %i2 4000d648: 0a 80 00 05 bcs 4000d65c <_Heap_Free+0x40> 4000d64c: 82 10 20 00 clr %g1 4000d650: c2 06 20 24 ld [ %i0 + 0x24 ], %g1 4000d654: 80 a0 40 08 cmp %g1, %o0 4000d658: 82 60 3f ff subx %g0, -1, %g1 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 4000d65c: 82 08 60 01 and %g1, 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 ) ) { 4000d660: 80 a0 60 00 cmp %g1, 0 4000d664: 02 80 00 6d be 4000d818 <_Heap_Free+0x1fc> 4000d668: 86 10 00 01 mov %g1, %g3 bool _Heap_Free( Heap_Control *heap, void *alloc_begin_ptr ) { Heap_Statistics *const stats = &heap->stats; uintptr_t alloc_begin; Heap_Block *block; 4000d66c: f8 02 20 04 ld [ %o0 + 4 ], %i4 - 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; 4000d670: 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); 4000d674: 82 00 80 08 add %g2, %o0, %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; 4000d678: 80 a0 40 1a cmp %g1, %i2 4000d67c: 0a 80 00 05 bcs 4000d690 <_Heap_Free+0x74> <== NEVER TAKEN 4000d680: 88 10 20 00 clr %g4 4000d684: c6 06 20 24 ld [ %i0 + 0x24 ], %g3 4000d688: 80 a0 c0 01 cmp %g3, %g1 4000d68c: 88 60 3f ff subx %g0, -1, %g4 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 4000d690: 88 09 20 01 and %g4, 1, %g4 _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 ) ) { 4000d694: 80 a1 20 00 cmp %g4, 0 4000d698: 02 80 00 60 be 4000d818 <_Heap_Free+0x1fc> 4000d69c: 86 10 00 04 mov %g4, %g3 bool _Heap_Free( Heap_Control *heap, void *alloc_begin_ptr ) { Heap_Statistics *const stats = &heap->stats; uintptr_t alloc_begin; Heap_Block *block; Heap_Block *next_block = NULL; 4000d6a0: fa 00 60 04 ld [ %g1 + 4 ], %i5 return false; } _Heap_Protection_block_check( heap, next_block ); if ( !_Heap_Is_prev_used( next_block ) ) { 4000d6a4: 80 8f 60 01 btst 1, %i5 4000d6a8: 22 80 00 5c be,a 4000d818 <_Heap_Free+0x1fc> <== NEVER TAKEN 4000d6ac: 86 10 20 00 clr %g3 <== 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 4000d6b0: de 06 20 24 ld [ %i0 + 0x24 ], %o7 && !_Heap_Is_prev_used( _Heap_Block_at( next_block, next_block_size )); 4000d6b4: 80 a0 40 0f cmp %g1, %o7 4000d6b8: 02 80 00 07 be 4000d6d4 <_Heap_Free+0xb8> 4000d6bc: ba 0f 7f fe and %i5, -2, %i5 4000d6c0: 88 00 40 1d add %g1, %i5, %g4 4000d6c4: f2 01 20 04 ld [ %g4 + 4 ], %i1 4000d6c8: b2 1e 60 01 xor %i1, 1, %i1 4000d6cc: 10 80 00 03 b 4000d6d8 <_Heap_Free+0xbc> 4000d6d0: b2 0e 60 01 and %i1, 1, %i1 4000d6d4: b2 10 20 00 clr %i1 if ( !_Heap_Is_prev_used( block ) ) { 4000d6d8: 80 8f 20 01 btst 1, %i4 4000d6dc: 12 80 00 25 bne 4000d770 <_Heap_Free+0x154> 4000d6e0: b2 0e 60 01 and %i1, 1, %i1 uintptr_t const prev_size = block->prev_size; 4000d6e4: 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); 4000d6e8: 88 22 00 1c sub %o0, %i4, %g4 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; 4000d6ec: 80 a1 00 1a cmp %g4, %i2 4000d6f0: 0a 80 00 04 bcs 4000d700 <_Heap_Free+0xe4> <== NEVER TAKEN 4000d6f4: b6 10 20 00 clr %i3 4000d6f8: 80 a3 c0 04 cmp %o7, %g4 4000d6fc: b6 60 3f ff subx %g0, -1, %i3 Heap_Block * const prev_block = _Heap_Block_at( block, -prev_size ); if ( !_Heap_Is_block_in_heap( heap, prev_block ) ) { 4000d700: b6 8e e0 01 andcc %i3, 1, %i3 4000d704: 22 80 00 45 be,a 4000d818 <_Heap_Free+0x1fc> <== NEVER TAKEN 4000d708: 86 10 00 1b mov %i3, %g3 <== 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; 4000d70c: f6 01 20 04 ld [ %g4 + 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) ) { 4000d710: 80 8e e0 01 btst 1, %i3 4000d714: 02 80 00 40 be 4000d814 <_Heap_Free+0x1f8> <== NEVER TAKEN 4000d718: 80 a6 60 00 cmp %i1, 0 _HAssert( false ); return( false ); } if ( next_is_free ) { /* coalesce both */ 4000d71c: 02 80 00 0e be 4000d754 <_Heap_Free+0x138> 4000d720: b8 00 80 1c add %g2, %i4, %i4 uintptr_t const size = block_size + prev_size + next_block_size; 4000d724: ba 07 00 1d add %i4, %i5, %i5 return _Heap_Free_list_tail(heap)->prev; } RTEMS_INLINE_ROUTINE void _Heap_Free_list_remove( Heap_Block *block ) { Heap_Block *next = block->next; 4000d728: f8 00 60 08 ld [ %g1 + 8 ], %i4 Heap_Block *prev = block->prev; 4000d72c: c2 00 60 0c ld [ %g1 + 0xc ], %g1 prev->next = next; 4000d730: f8 20 60 08 st %i4, [ %g1 + 8 ] next->prev = prev; 4000d734: c2 27 20 0c st %g1, [ %i4 + 0xc ] _Heap_Free_list_remove( next_block ); stats->free_blocks -= 1; 4000d738: c2 06 20 38 ld [ %i0 + 0x38 ], %g1 4000d73c: 82 00 7f ff add %g1, -1, %g1 4000d740: c2 26 20 38 st %g1, [ %i0 + 0x38 ] prev_block->size_and_flag = size | HEAP_PREV_BLOCK_USED; 4000d744: 82 17 60 01 or %i5, 1, %g1 4000d748: c2 21 20 04 st %g1, [ %g4 + 4 ] 4000d74c: 10 80 00 28 b 4000d7ec <_Heap_Free+0x1d0> 4000d750: fa 27 40 04 st %i5, [ %i5 + %g4 ] 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; 4000d754: ba 17 20 01 or %i4, 1, %i5 4000d758: fa 21 20 04 st %i5, [ %g4 + 4 ] next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED; 4000d75c: c8 00 60 04 ld [ %g1 + 4 ], %g4 4000d760: 88 09 3f fe and %g4, -2, %g4 4000d764: c8 20 60 04 st %g4, [ %g1 + 4 ] next_block->prev_size = size; 4000d768: 10 80 00 21 b 4000d7ec <_Heap_Free+0x1d0> 4000d76c: f8 20 80 08 st %i4, [ %g2 + %o0 ] } } else if ( next_is_free ) { /* coalesce next */ 4000d770: 80 a6 60 00 cmp %i1, 0 4000d774: 22 80 00 0d be,a 4000d7a8 <_Heap_Free+0x18c> 4000d778: c8 06 20 08 ld [ %i0 + 8 ], %g4 uintptr_t const size = block_size + next_block_size; 4000d77c: 88 07 40 02 add %i5, %g2, %g4 RTEMS_INLINE_ROUTINE void _Heap_Free_list_replace( Heap_Block *old_block, Heap_Block *new_block ) { Heap_Block *next = old_block->next; 4000d780: fa 00 60 08 ld [ %g1 + 8 ], %i5 Heap_Block *prev = old_block->prev; 4000d784: c2 00 60 0c ld [ %g1 + 0xc ], %g1 new_block->next = next; 4000d788: fa 22 20 08 st %i5, [ %o0 + 8 ] new_block->prev = prev; 4000d78c: c2 22 20 0c st %g1, [ %o0 + 0xc ] next->prev = new_block; 4000d790: d0 27 60 0c st %o0, [ %i5 + 0xc ] prev->next = new_block; 4000d794: d0 20 60 08 st %o0, [ %g1 + 8 ] _Heap_Free_list_replace( next_block, block ); block->size_and_flag = size | HEAP_PREV_BLOCK_USED; 4000d798: 82 11 20 01 or %g4, 1, %g1 4000d79c: c2 22 20 04 st %g1, [ %o0 + 4 ] 4000d7a0: 10 80 00 13 b 4000d7ec <_Heap_Free+0x1d0> 4000d7a4: c8 21 00 08 st %g4, [ %g4 + %o0 ] ) { Heap_Block *next = block_before->next; new_block->next = next; new_block->prev = block_before; 4000d7a8: f0 22 20 0c st %i0, [ %o0 + 0xc ] Heap_Block *new_block ) { Heap_Block *next = block_before->next; new_block->next = next; 4000d7ac: c8 22 20 08 st %g4, [ %o0 + 8 ] new_block->prev = block_before; block_before->next = new_block; 4000d7b0: d0 26 20 08 st %o0, [ %i0 + 8 ] next->prev = new_block; 4000d7b4: d0 21 20 0c st %o0, [ %g4 + 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; 4000d7b8: 88 10 a0 01 or %g2, 1, %g4 4000d7bc: c8 22 20 04 st %g4, [ %o0 + 4 ] next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED; 4000d7c0: c8 00 60 04 ld [ %g1 + 4 ], %g4 4000d7c4: 88 09 3f fe and %g4, -2, %g4 4000d7c8: c8 20 60 04 st %g4, [ %g1 + 4 ] next_block->prev_size = block_size; /* Statistics */ ++stats->free_blocks; 4000d7cc: c2 06 20 38 ld [ %i0 + 0x38 ], %g1 /* Add 'block' to the head of the free blocks list as it tends to produce less fragmentation than adding to the tail. */ _Heap_Free_list_insert_after( _Heap_Free_list_head( heap), block ); block->size_and_flag = block_size | HEAP_PREV_BLOCK_USED; next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED; next_block->prev_size = block_size; 4000d7d0: c4 20 80 08 st %g2, [ %g2 + %o0 ] /* Statistics */ ++stats->free_blocks; if ( stats->max_free_blocks < stats->free_blocks ) { 4000d7d4: c8 06 20 3c ld [ %i0 + 0x3c ], %g4 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; 4000d7d8: 82 00 60 01 inc %g1 if ( stats->max_free_blocks < stats->free_blocks ) { 4000d7dc: 80 a1 00 01 cmp %g4, %g1 4000d7e0: 1a 80 00 03 bcc 4000d7ec <_Heap_Free+0x1d0> 4000d7e4: c2 26 20 38 st %g1, [ %i0 + 0x38 ] stats->max_free_blocks = stats->free_blocks; 4000d7e8: c2 26 20 3c st %g1, [ %i0 + 0x3c ] } } /* Statistics */ --stats->used_blocks; 4000d7ec: c2 06 20 40 ld [ %i0 + 0x40 ], %g1 4000d7f0: 82 00 7f ff add %g1, -1, %g1 4000d7f4: c2 26 20 40 st %g1, [ %i0 + 0x40 ] ++stats->frees; 4000d7f8: c2 06 20 50 ld [ %i0 + 0x50 ], %g1 4000d7fc: 82 00 60 01 inc %g1 4000d800: c2 26 20 50 st %g1, [ %i0 + 0x50 ] stats->free_size += block_size; 4000d804: c2 06 20 30 ld [ %i0 + 0x30 ], %g1 4000d808: 84 00 40 02 add %g1, %g2, %g2 return( true ); 4000d80c: 10 80 00 03 b 4000d818 <_Heap_Free+0x1fc> 4000d810: c4 26 20 30 st %g2, [ %i0 + 0x30 ] alloc_begin = (uintptr_t) alloc_begin_ptr; block = _Heap_Block_of_alloc_area( alloc_begin, heap->page_size ); if ( !_Heap_Is_block_in_heap( heap, block ) ) { return false; 4000d814: 86 10 20 00 clr %g3 <== NOT EXECUTED --stats->used_blocks; ++stats->frees; stats->free_size += block_size; return( true ); } 4000d818: b0 08 e0 01 and %g3, 1, %i0 4000d81c: 81 c7 e0 08 ret 4000d820: 81 e8 00 00 restore =============================================================================== 400084d4 <_Heap_Greedy_allocate_all_except_largest>: Heap_Block *_Heap_Greedy_allocate_all_except_largest( Heap_Control *heap, uintptr_t *allocatable_size ) { 400084d4: 9d e3 bf 90 save %sp, -112, %sp Heap_Information info; _Heap_Get_free_information( heap, &info ); 400084d8: 90 10 00 18 mov %i0, %o0 400084dc: 40 00 14 6a call 4000d684 <_Heap_Get_free_information> 400084e0: 92 07 bf f4 add %fp, -12, %o1 if ( info.largest > 0 ) { 400084e4: c2 07 bf f8 ld [ %fp + -8 ], %g1 400084e8: 80 a0 60 00 cmp %g1, 0 400084ec: 22 80 00 04 be,a 400084fc <_Heap_Greedy_allocate_all_except_largest+0x28><== NEVER TAKEN 400084f0: c0 26 40 00 clr [ %i1 ] <== NOT EXECUTED *allocatable_size = info.largest - HEAP_BLOCK_HEADER_SIZE + HEAP_ALLOC_BONUS; 400084f4: 82 00 7f fc add %g1, -4, %g1 400084f8: c2 26 40 00 st %g1, [ %i1 ] } else { *allocatable_size = 0; } return _Heap_Greedy_allocate( heap, allocatable_size, 1 ); 400084fc: 90 10 00 18 mov %i0, %o0 40008500: 92 10 00 19 mov %i1, %o1 40008504: 7f ff ff c4 call 40008414 <_Heap_Greedy_allocate> 40008508: 94 10 20 01 mov 1, %o2 } 4000850c: 81 c7 e0 08 ret 40008510: 91 e8 00 08 restore %g0, %o0, %o0 =============================================================================== 4000b840 <_Heap_Iterate>: void _Heap_Iterate( Heap_Control *heap, Heap_Block_visitor visitor, void *visitor_arg ) { 4000b840: 9d e3 bf a0 save %sp, -96, %sp Heap_Block *current = heap->first_block; 4000b844: c2 06 20 20 ld [ %i0 + 0x20 ], %g1 Heap_Block *end = heap->last_block; 4000b848: f8 06 20 24 ld [ %i0 + 0x24 ], %i4 bool stop = false; 4000b84c: 90 10 20 00 clr %o0 while ( !stop && current != end ) { 4000b850: 80 a0 40 1c cmp %g1, %i4 4000b854: 02 80 00 0e be 4000b88c <_Heap_Iterate+0x4c> 4000b858: 90 1a 20 01 xor %o0, 1, %o0 4000b85c: 80 8a 20 ff btst 0xff, %o0 4000b860: 02 80 00 0b be 4000b88c <_Heap_Iterate+0x4c> <== NEVER TAKEN 4000b864: 90 10 00 01 mov %g1, %o0 - 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; 4000b868: d2 00 60 04 ld [ %g1 + 4 ], %o1 4000b86c: 92 0a 7f fe and %o1, -2, %o1 RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); 4000b870: ba 00 40 09 add %g1, %o1, %i5 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; 4000b874: d4 07 60 04 ld [ %i5 + 4 ], %o2 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 ); 4000b878: 96 10 00 1a mov %i2, %o3 4000b87c: 9f c6 40 00 call %i1 4000b880: 94 0a a0 01 and %o2, 1, %o2 current = next; 4000b884: 10 bf ff f3 b 4000b850 <_Heap_Iterate+0x10> 4000b888: 82 10 00 1d mov %i5, %g1 4000b88c: 81 c7 e0 08 ret 4000b890: 81 e8 00 00 restore =============================================================================== 40015260 <_Heap_Size_of_alloc_area>: bool _Heap_Size_of_alloc_area( Heap_Control *heap, void *alloc_begin_ptr, uintptr_t *alloc_size ) { 40015260: 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); 40015264: d2 06 20 10 ld [ %i0 + 0x10 ], %o1 40015268: 7f ff f9 48 call 40013788 <.urem> 4001526c: 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 40015270: 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); 40015274: 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); 40015278: 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; 4001527c: 80 a2 00 04 cmp %o0, %g4 40015280: 0a 80 00 05 bcs 40015294 <_Heap_Size_of_alloc_area+0x34> 40015284: 82 10 20 00 clr %g1 40015288: c2 06 20 24 ld [ %i0 + 0x24 ], %g1 4001528c: 80 a0 40 08 cmp %g1, %o0 40015290: 82 60 3f ff subx %g0, -1, %g1 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 40015294: 82 08 60 01 and %g1, 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 ) ) { 40015298: 80 a0 60 00 cmp %g1, 0 4001529c: 02 80 00 17 be 400152f8 <_Heap_Size_of_alloc_area+0x98> 400152a0: 86 10 00 01 mov %g1, %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; 400152a4: c2 02 20 04 ld [ %o0 + 4 ], %g1 400152a8: 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); 400152ac: 82 00 40 08 add %g1, %o0, %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; 400152b0: 80 a0 40 04 cmp %g1, %g4 400152b4: 0a 80 00 05 bcs 400152c8 <_Heap_Size_of_alloc_area+0x68> <== NEVER TAKEN 400152b8: 84 10 20 00 clr %g2 400152bc: c4 06 20 24 ld [ %i0 + 0x24 ], %g2 400152c0: 80 a0 80 01 cmp %g2, %g1 400152c4: 84 60 3f ff subx %g0, -1, %g2 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 400152c8: 84 08 a0 01 and %g2, 1, %g2 } block_size = _Heap_Block_size( block ); next_block = _Heap_Block_at( block, block_size ); if ( 400152cc: 80 a0 a0 00 cmp %g2, 0 400152d0: 02 80 00 0a be 400152f8 <_Heap_Size_of_alloc_area+0x98> <== NEVER TAKEN 400152d4: 86 10 00 02 mov %g2, %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; 400152d8: c4 00 60 04 ld [ %g1 + 4 ], %g2 !_Heap_Is_block_in_heap( heap, next_block ) || !_Heap_Is_prev_used( next_block ) 400152dc: 80 88 a0 01 btst 1, %g2 400152e0: 02 80 00 05 be 400152f4 <_Heap_Size_of_alloc_area+0x94> <== NEVER TAKEN 400152e4: 82 20 40 19 sub %g1, %i1, %g1 ) { return false; } *alloc_size = (uintptr_t) next_block + HEAP_ALLOC_BONUS - alloc_begin; 400152e8: 82 00 60 04 add %g1, 4, %g1 return true; 400152ec: 10 80 00 03 b 400152f8 <_Heap_Size_of_alloc_area+0x98> 400152f0: c2 26 80 00 st %g1, [ %i2 ] Heap_Block *block = _Heap_Block_of_alloc_area( alloc_begin, page_size ); Heap_Block *next_block = NULL; uintptr_t block_size = 0; if ( !_Heap_Is_block_in_heap( heap, block ) ) { return false; 400152f4: 86 10 20 00 clr %g3 <== NOT EXECUTED } *alloc_size = (uintptr_t) next_block + HEAP_ALLOC_BONUS - alloc_begin; return true; } 400152f8: b0 08 e0 01 and %g3, 1, %i0 400152fc: 81 c7 e0 08 ret 40015300: 81 e8 00 00 restore =============================================================================== 4000962c <_Heap_Walk>: bool _Heap_Walk( Heap_Control *heap, int source, bool dump ) { 4000962c: 9d e3 bf 80 save %sp, -128, %sp 40009630: ac 10 00 19 mov %i1, %l6 uintptr_t const page_size = heap->page_size; 40009634: f8 06 20 10 ld [ %i0 + 0x10 ], %i4 uintptr_t const min_block_size = heap->min_block_size; 40009638: f6 06 20 14 ld [ %i0 + 0x14 ], %i3 Heap_Block *const first_block = heap->first_block; 4000963c: 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; 40009640: 80 a6 a0 00 cmp %i2, 0 40009644: 02 80 00 05 be 40009658 <_Heap_Walk+0x2c> 40009648: e0 06 20 24 ld [ %i0 + 0x24 ], %l0 4000964c: 3b 10 00 25 sethi %hi(0x40009400), %i5 40009650: 10 80 00 04 b 40009660 <_Heap_Walk+0x34> 40009654: ba 17 61 dc or %i5, 0x1dc, %i5 ! 400095dc <_Heap_Walk_print> 40009658: 3b 10 00 25 sethi %hi(0x40009400), %i5 4000965c: ba 17 61 d4 or %i5, 0x1d4, %i5 ! 400095d4 <_Heap_Walk_print_nothing> 40009660: 05 10 00 6a sethi %hi(0x4001a800), %g2 if ( !_System_state_Is_up( _System_state_Get() ) ) { 40009664: c4 00 a1 d4 ld [ %g2 + 0x1d4 ], %g2 ! 4001a9d4 <_System_state_Current> 40009668: 80 a0 a0 02 cmp %g2, 2 4000966c: 22 80 00 04 be,a 4000967c <_Heap_Walk+0x50> 40009670: c4 06 20 1c ld [ %i0 + 0x1c ], %g2 return true; 40009674: 10 80 01 30 b 40009b34 <_Heap_Walk+0x508> 40009678: a6 10 20 01 mov 1, %l3 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)( 4000967c: da 06 20 18 ld [ %i0 + 0x18 ], %o5 40009680: c4 23 a0 5c st %g2, [ %sp + 0x5c ] 40009684: f2 23 a0 60 st %i1, [ %sp + 0x60 ] 40009688: e0 23 a0 64 st %l0, [ %sp + 0x64 ] 4000968c: c4 06 20 08 ld [ %i0 + 8 ], %g2 40009690: 90 10 00 16 mov %l6, %o0 40009694: c4 23 a0 68 st %g2, [ %sp + 0x68 ] 40009698: c4 06 20 0c ld [ %i0 + 0xc ], %g2 4000969c: 92 10 20 00 clr %o1 400096a0: c4 23 a0 6c st %g2, [ %sp + 0x6c ] 400096a4: 15 10 00 5b sethi %hi(0x40016c00), %o2 400096a8: 96 10 00 1c mov %i4, %o3 400096ac: 94 12 a0 f0 or %o2, 0xf0, %o2 400096b0: 9f c7 40 00 call %i5 400096b4: 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 ) { 400096b8: 80 a7 20 00 cmp %i4, 0 400096bc: 12 80 00 07 bne 400096d8 <_Heap_Walk+0xac> 400096c0: 80 8f 20 07 btst 7, %i4 (*printer)( source, true, "page size is zero\n" ); 400096c4: 15 10 00 5b sethi %hi(0x40016c00), %o2 400096c8: 90 10 00 16 mov %l6, %o0 400096cc: 92 10 20 01 mov 1, %o1 400096d0: 10 80 00 37 b 400097ac <_Heap_Walk+0x180> 400096d4: 94 12 a1 88 or %o2, 0x188, %o2 return false; } if ( !_Addresses_Is_aligned( (void *) page_size ) ) { 400096d8: 22 80 00 08 be,a 400096f8 <_Heap_Walk+0xcc> 400096dc: 90 10 00 1b mov %i3, %o0 (*printer)( 400096e0: 15 10 00 5b sethi %hi(0x40016c00), %o2 400096e4: 90 10 00 16 mov %l6, %o0 400096e8: 92 10 20 01 mov 1, %o1 400096ec: 94 12 a1 a0 or %o2, 0x1a0, %o2 400096f0: 10 80 00 4a b 40009818 <_Heap_Walk+0x1ec> 400096f4: 96 10 00 1c mov %i4, %o3 RTEMS_INLINE_ROUTINE bool _Heap_Is_aligned( uintptr_t value, uintptr_t alignment ) { return (value % alignment) == 0; 400096f8: 7f ff e1 3d call 40001bec <.urem> 400096fc: 92 10 00 1c mov %i4, %o1 ); return false; } if ( !_Heap_Is_aligned( min_block_size, page_size ) ) { 40009700: 80 a2 20 00 cmp %o0, 0 40009704: 22 80 00 08 be,a 40009724 <_Heap_Walk+0xf8> 40009708: 90 06 60 08 add %i1, 8, %o0 (*printer)( 4000970c: 15 10 00 5b sethi %hi(0x40016c00), %o2 40009710: 90 10 00 16 mov %l6, %o0 40009714: 92 10 20 01 mov 1, %o1 40009718: 94 12 a1 c0 or %o2, 0x1c0, %o2 4000971c: 10 80 00 3f b 40009818 <_Heap_Walk+0x1ec> 40009720: 96 10 00 1b mov %i3, %o3 40009724: 7f ff e1 32 call 40001bec <.urem> 40009728: 92 10 00 1c mov %i4, %o1 ); return false; } if ( 4000972c: 80 a2 20 00 cmp %o0, 0 40009730: 22 80 00 07 be,a 4000974c <_Heap_Walk+0x120> 40009734: c4 06 60 04 ld [ %i1 + 4 ], %g2 !_Heap_Is_aligned( _Heap_Alloc_area_of_block( first_block ), page_size ) ) { (*printer)( 40009738: 15 10 00 5b sethi %hi(0x40016c00), %o2 4000973c: 90 10 00 16 mov %l6, %o0 40009740: 92 10 20 01 mov 1, %o1 40009744: 10 80 01 03 b 40009b50 <_Heap_Walk+0x524> 40009748: 94 12 a1 e8 or %o2, 0x1e8, %o2 ); return false; } if ( !_Heap_Is_prev_used( first_block ) ) { 4000974c: 80 88 a0 01 btst 1, %g2 40009750: 32 80 00 07 bne,a 4000976c <_Heap_Walk+0x140> 40009754: f4 04 20 04 ld [ %l0 + 4 ], %i2 (*printer)( 40009758: 15 10 00 5b sethi %hi(0x40016c00), %o2 4000975c: 90 10 00 16 mov %l6, %o0 40009760: 92 10 20 01 mov 1, %o1 40009764: 10 80 00 12 b 400097ac <_Heap_Walk+0x180> 40009768: 94 12 a2 20 or %o2, 0x220, %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; 4000976c: 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); 40009770: 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; 40009774: c4 06 a0 04 ld [ %i2 + 4 ], %g2 ); return false; } if ( _Heap_Is_free( last_block ) ) { 40009778: 80 88 a0 01 btst 1, %g2 4000977c: 12 80 00 07 bne 40009798 <_Heap_Walk+0x16c> 40009780: 80 a6 80 19 cmp %i2, %i1 (*printer)( 40009784: 15 10 00 5b sethi %hi(0x40016c00), %o2 40009788: 90 10 00 16 mov %l6, %o0 4000978c: 92 10 20 01 mov 1, %o1 40009790: 10 80 00 07 b 400097ac <_Heap_Walk+0x180> 40009794: 94 12 a2 50 or %o2, 0x250, %o2 ); return false; } if ( 40009798: 02 80 00 0a be 400097c0 <_Heap_Walk+0x194> 4000979c: 15 10 00 5b sethi %hi(0x40016c00), %o2 _Heap_Block_at( last_block, _Heap_Block_size( last_block ) ) != first_block ) { (*printer)( 400097a0: 90 10 00 16 mov %l6, %o0 400097a4: 92 10 20 01 mov 1, %o1 400097a8: 94 12 a2 68 or %o2, 0x268, %o2 400097ac: 9f c7 40 00 call %i5 400097b0: a6 10 20 00 clr %l3 400097b4: b0 0c e0 ff and %l3, 0xff, %i0 400097b8: 81 c7 e0 08 ret 400097bc: 81 e8 00 00 restore int source, Heap_Walk_printer printer, Heap_Control *heap ) { uintptr_t const page_size = heap->page_size; 400097c0: 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; 400097c4: d6 06 20 08 ld [ %i0 + 8 ], %o3 const Heap_Block *const free_list_tail = _Heap_Free_list_tail( heap ); 400097c8: 10 80 00 03 b 400097d4 <_Heap_Walk+0x1a8> 400097cc: b2 10 00 18 mov %i0, %i1 return false; } prev_block = free_block; free_block = free_block->next; 400097d0: 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 ) { 400097d4: 80 a2 c0 18 cmp %o3, %i0 400097d8: 22 80 00 34 be,a 400098a8 <_Heap_Walk+0x27c> 400097dc: b2 10 00 1a mov %i2, %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; 400097e0: c6 06 20 20 ld [ %i0 + 0x20 ], %g3 400097e4: 80 a0 c0 0b cmp %g3, %o3 400097e8: 18 80 00 05 bgu 400097fc <_Heap_Walk+0x1d0> 400097ec: 84 10 20 00 clr %g2 400097f0: c4 06 20 24 ld [ %i0 + 0x24 ], %g2 400097f4: 80 a0 80 0b cmp %g2, %o3 400097f8: 84 60 3f ff subx %g0, -1, %g2 if ( !_Heap_Is_block_in_heap( heap, free_block ) ) { 400097fc: 80 a0 a0 00 cmp %g2, 0 40009800: 12 80 00 0b bne 4000982c <_Heap_Walk+0x200> 40009804: 90 02 e0 08 add %o3, 8, %o0 (*printer)( 40009808: 15 10 00 5b sethi %hi(0x40016c00), %o2 4000980c: 90 10 00 16 mov %l6, %o0 40009810: 92 10 20 01 mov 1, %o1 40009814: 94 12 a2 98 or %o2, 0x298, %o2 return false; } if ( _Heap_Is_used( free_block ) ) { (*printer)( 40009818: 9f c7 40 00 call %i5 4000981c: a6 10 20 00 clr %l3 40009820: b0 0c e0 ff and %l3, 0xff, %i0 40009824: 81 c7 e0 08 ret 40009828: 81 e8 00 00 restore RTEMS_INLINE_ROUTINE bool _Heap_Is_aligned( uintptr_t value, uintptr_t alignment ) { return (value % alignment) == 0; 4000982c: d6 27 bf fc st %o3, [ %fp + -4 ] 40009830: 7f ff e0 ef call 40001bec <.urem> 40009834: 92 10 00 11 mov %l1, %o1 ); return false; } if ( 40009838: 80 a2 20 00 cmp %o0, 0 4000983c: 02 80 00 07 be 40009858 <_Heap_Walk+0x22c> 40009840: d6 07 bf fc ld [ %fp + -4 ], %o3 !_Heap_Is_aligned( _Heap_Alloc_area_of_block( free_block ), page_size ) ) { (*printer)( 40009844: 15 10 00 5b sethi %hi(0x40016c00), %o2 40009848: 90 10 00 16 mov %l6, %o0 4000984c: 92 10 20 01 mov 1, %o1 40009850: 10 bf ff f2 b 40009818 <_Heap_Walk+0x1ec> 40009854: 94 12 a2 b8 or %o2, 0x2b8, %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; 40009858: c4 02 e0 04 ld [ %o3 + 4 ], %g2 4000985c: 84 08 bf fe and %g2, -2, %g2 RTEMS_INLINE_ROUTINE bool _Heap_Is_used( const Heap_Block *block ) { const Heap_Block *const next_block = 40009860: 84 02 c0 02 add %o3, %g2, %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; 40009864: c4 00 a0 04 ld [ %g2 + 4 ], %g2 ); return false; } if ( _Heap_Is_used( free_block ) ) { 40009868: 80 88 a0 01 btst 1, %g2 4000986c: 22 80 00 07 be,a 40009888 <_Heap_Walk+0x25c> 40009870: d8 02 e0 0c ld [ %o3 + 0xc ], %o4 (*printer)( 40009874: 15 10 00 5b sethi %hi(0x40016c00), %o2 40009878: 90 10 00 16 mov %l6, %o0 4000987c: 92 10 20 01 mov 1, %o1 40009880: 10 bf ff e6 b 40009818 <_Heap_Walk+0x1ec> 40009884: 94 12 a2 e8 or %o2, 0x2e8, %o2 ); return false; } if ( free_block->prev != prev_block ) { 40009888: 80 a3 00 19 cmp %o4, %i1 4000988c: 02 bf ff d1 be 400097d0 <_Heap_Walk+0x1a4> 40009890: b2 10 00 0b mov %o3, %i1 (*printer)( 40009894: 15 10 00 5b sethi %hi(0x40016c00), %o2 40009898: 90 10 00 16 mov %l6, %o0 4000989c: 92 10 20 01 mov 1, %o1 400098a0: 10 80 00 2b b 4000994c <_Heap_Walk+0x320> 400098a4: 94 12 a3 08 or %o2, 0x308, %o2 " (= first free)" : (block->prev == free_list_head ? " (= head)" : ""), block->next, block->next == last_free_block ? " (= last free)" : (block->next == free_list_tail ? " (= tail)" : "") 400098a8: 23 10 00 5c sethi %hi(0x40017000), %l1 400098ac: 2f 10 00 5b sethi %hi(0x40016c00), %l7 { uintptr_t const page_size = heap->page_size; uintptr_t const min_block_size = heap->min_block_size; Heap_Block *const first_block = heap->first_block; Heap_Block *const last_block = heap->last_block; Heap_Block *block = first_block; 400098b0: 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; 400098b4: da 06 20 20 ld [ %i0 + 0x20 ], %o5 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; 400098b8: 9e 1e 40 10 xor %i1, %l0, %o7 400098bc: 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; 400098c0: aa 0c bf fe and %l2, -2, %l5 400098c4: 98 40 20 00 addx %g0, 0, %o4 RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); 400098c8: a8 05 40 19 add %l5, %i1, %l4 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; 400098cc: 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; 400098d0: 80 a3 40 14 cmp %o5, %l4 400098d4: 18 80 00 05 bgu 400098e8 <_Heap_Walk+0x2bc> <== NEVER TAKEN 400098d8: 9e 10 20 00 clr %o7 400098dc: de 06 20 24 ld [ %i0 + 0x24 ], %o7 400098e0: 80 a3 c0 14 cmp %o7, %l4 400098e4: 9e 60 3f ff subx %g0, -1, %o7 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 400098e8: 9e 0b e0 01 and %o7, 1, %o7 if ( !_Heap_Is_block_in_heap( heap, next_block ) ) { 400098ec: 80 a3 e0 00 cmp %o7, 0 400098f0: 12 80 00 07 bne 4000990c <_Heap_Walk+0x2e0> 400098f4: a6 10 00 0f mov %o7, %l3 (*printer)( 400098f8: 15 10 00 5b sethi %hi(0x40016c00), %o2 400098fc: 90 10 00 16 mov %l6, %o0 40009900: 92 10 20 01 mov 1, %o1 40009904: 10 80 00 31 b 400099c8 <_Heap_Walk+0x39c> 40009908: 94 12 a3 40 or %o2, 0x340, %o2 RTEMS_INLINE_ROUTINE bool _Heap_Is_aligned( uintptr_t value, uintptr_t alignment ) { return (value % alignment) == 0; 4000990c: d8 27 bf f8 st %o4, [ %fp + -8 ] 40009910: 90 10 00 15 mov %l5, %o0 40009914: 7f ff e0 b6 call 40001bec <.urem> 40009918: 92 10 00 1c mov %i4, %o1 ); return false; } if ( !_Heap_Is_aligned( block_size, page_size ) && is_not_last_block ) { 4000991c: 80 a2 20 00 cmp %o0, 0 40009920: 02 80 00 10 be 40009960 <_Heap_Walk+0x334> 40009924: d8 07 bf f8 ld [ %fp + -8 ], %o4 40009928: 80 a3 20 00 cmp %o4, 0 4000992c: 02 80 00 0e be 40009964 <_Heap_Walk+0x338> 40009930: 80 a5 40 1b cmp %l5, %i3 (*printer)( 40009934: 15 10 00 5b sethi %hi(0x40016c00), %o2 40009938: 90 10 00 16 mov %l6, %o0 4000993c: 92 10 20 01 mov 1, %o1 40009940: 94 12 a3 70 or %o2, 0x370, %o2 40009944: 96 10 00 19 mov %i1, %o3 40009948: 98 10 00 15 mov %l5, %o4 4000994c: 9f c7 40 00 call %i5 40009950: a6 10 20 00 clr %l3 40009954: b0 0c e0 ff and %l3, 0xff, %i0 40009958: 81 c7 e0 08 ret 4000995c: 81 e8 00 00 restore ); return false; } if ( block_size < min_block_size && is_not_last_block ) { 40009960: 80 a5 40 1b cmp %l5, %i3 40009964: 9e 40 20 00 addx %g0, 0, %o7 40009968: 9e 0b 00 0f and %o4, %o7, %o7 4000996c: 80 a3 e0 00 cmp %o7, 0 40009970: 02 80 00 0c be 400099a0 <_Heap_Walk+0x374> 40009974: a6 10 00 0f mov %o7, %l3 (*printer)( 40009978: 90 10 00 16 mov %l6, %o0 4000997c: 92 10 20 01 mov 1, %o1 40009980: 15 10 00 5b sethi %hi(0x40016c00), %o2 40009984: 96 10 00 19 mov %i1, %o3 40009988: 94 12 a3 a0 or %o2, 0x3a0, %o2 4000998c: 98 10 00 15 mov %l5, %o4 40009990: 9f c7 40 00 call %i5 40009994: 9a 10 00 1b mov %i3, %o5 if ( !_System_state_Is_up( _System_state_Get() ) ) { return true; } if ( !_Heap_Walk_check_control( source, printer, heap ) ) { return false; 40009998: 10 80 00 67 b 40009b34 <_Heap_Walk+0x508> 4000999c: a6 10 20 00 clr %l3 ); return false; } if ( next_block_begin <= block_begin && is_not_last_block ) { 400099a0: 80 a6 40 14 cmp %i1, %l4 400099a4: 2a 80 00 0f bcs,a 400099e0 <_Heap_Walk+0x3b4> 400099a8: de 05 20 04 ld [ %l4 + 4 ], %o7 400099ac: 80 a3 20 00 cmp %o4, 0 400099b0: 22 80 00 0c be,a 400099e0 <_Heap_Walk+0x3b4> 400099b4: de 05 20 04 ld [ %l4 + 4 ], %o7 (*printer)( 400099b8: 15 10 00 5b sethi %hi(0x40016c00), %o2 400099bc: 90 10 00 16 mov %l6, %o0 400099c0: 92 10 20 01 mov 1, %o1 400099c4: 94 12 a3 d0 or %o2, 0x3d0, %o2 400099c8: 96 10 00 19 mov %i1, %o3 400099cc: 9f c7 40 00 call %i5 400099d0: 98 10 00 14 mov %l4, %o4 400099d4: b0 0c e0 ff and %l3, 0xff, %i0 400099d8: 81 c7 e0 08 ret 400099dc: 81 e8 00 00 restore ); return false; } if ( !_Heap_Is_prev_used( next_block ) ) { 400099e0: 80 8b e0 01 btst 1, %o7 400099e4: 12 80 00 3f bne 40009ae0 <_Heap_Walk+0x4b4> 400099e8: 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 ? 400099ec: 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)( 400099f0: d8 06 20 08 ld [ %i0 + 8 ], %o4 400099f4: 80 a3 40 0c cmp %o5, %o4 400099f8: 02 80 00 08 be 40009a18 <_Heap_Walk+0x3ec> 400099fc: 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)" : ""), 40009a00: 80 a3 40 18 cmp %o5, %i0 40009a04: 12 80 00 07 bne 40009a20 <_Heap_Walk+0x3f4> 40009a08: 96 14 60 78 or %l1, 0x78, %o3 40009a0c: 17 10 00 5b sethi %hi(0x40016c00), %o3 40009a10: 10 80 00 04 b 40009a20 <_Heap_Walk+0x3f4> 40009a14: 96 12 e0 c0 or %o3, 0xc0, %o3 ! 40016cc0 <_Semaphore_Translate_core_mutex_return_code_+0x88> 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)( 40009a18: 03 10 00 5b sethi %hi(0x40016c00), %g1 40009a1c: 96 10 60 b0 or %g1, 0xb0, %o3 ! 40016cb0 <_Semaphore_Translate_core_mutex_return_code_+0x78> block->prev, block->prev == first_free_block ? " (= first free)" : (block->prev == free_list_head ? " (= head)" : ""), block->next, block->next == last_free_block ? 40009a20: 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)( 40009a24: 80 a3 00 0f cmp %o4, %o7 40009a28: 02 80 00 06 be 40009a40 <_Heap_Walk+0x414> 40009a2c: 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)" : "") 40009a30: 12 80 00 06 bne 40009a48 <_Heap_Walk+0x41c> 40009a34: 9e 14 60 78 or %l1, 0x78, %o7 40009a38: 10 80 00 04 b 40009a48 <_Heap_Walk+0x41c> 40009a3c: 9e 15 e0 e0 or %l7, 0xe0, %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)( 40009a40: 03 10 00 5b sethi %hi(0x40016c00), %g1 40009a44: 9e 10 60 d0 or %g1, 0xd0, %o7 ! 40016cd0 <_Semaphore_Translate_core_mutex_return_code_+0x98> 40009a48: d6 23 a0 5c st %o3, [ %sp + 0x5c ] 40009a4c: d8 23 a0 60 st %o4, [ %sp + 0x60 ] 40009a50: de 23 a0 64 st %o7, [ %sp + 0x64 ] 40009a54: 90 10 00 16 mov %l6, %o0 40009a58: 92 10 20 00 clr %o1 40009a5c: 15 10 00 5c sethi %hi(0x40017000), %o2 40009a60: 96 10 00 19 mov %i1, %o3 40009a64: 94 12 a0 08 or %o2, 8, %o2 40009a68: 9f c7 40 00 call %i5 40009a6c: 98 10 00 15 mov %l5, %o4 block->next == last_free_block ? " (= last free)" : (block->next == free_list_tail ? " (= tail)" : "") ); if ( block_size != next_block->prev_size ) { 40009a70: da 05 00 00 ld [ %l4 ], %o5 40009a74: 80 a5 40 0d cmp %l5, %o5 40009a78: 02 80 00 0c be 40009aa8 <_Heap_Walk+0x47c> 40009a7c: 80 a4 a0 00 cmp %l2, 0 (*printer)( 40009a80: e8 23 a0 5c st %l4, [ %sp + 0x5c ] 40009a84: 90 10 00 16 mov %l6, %o0 40009a88: 92 10 20 01 mov 1, %o1 40009a8c: 15 10 00 5c sethi %hi(0x40017000), %o2 40009a90: 96 10 00 19 mov %i1, %o3 40009a94: 94 12 a0 40 or %o2, 0x40, %o2 40009a98: 9f c7 40 00 call %i5 40009a9c: 98 10 00 15 mov %l5, %o4 if ( !_System_state_Is_up( _System_state_Get() ) ) { return true; } if ( !_Heap_Walk_check_control( source, printer, heap ) ) { return false; 40009aa0: 10 80 00 25 b 40009b34 <_Heap_Walk+0x508> 40009aa4: a6 10 20 00 clr %l3 ); return false; } if ( !prev_used ) { 40009aa8: 32 80 00 07 bne,a 40009ac4 <_Heap_Walk+0x498> 40009aac: c8 06 20 08 ld [ %i0 + 8 ], %g4 (*printer)( 40009ab0: 15 10 00 5c sethi %hi(0x40017000), %o2 40009ab4: 90 10 00 16 mov %l6, %o0 40009ab8: 92 10 20 01 mov 1, %o1 40009abc: 10 80 00 25 b 40009b50 <_Heap_Walk+0x524> 40009ac0: 94 12 a0 80 or %o2, 0x80, %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 ) { 40009ac4: 80 a1 00 18 cmp %g4, %i0 40009ac8: 02 80 00 1e be 40009b40 <_Heap_Walk+0x514> 40009acc: 80 a1 00 19 cmp %g4, %i1 if ( free_block == block ) { 40009ad0: 02 80 00 15 be 40009b24 <_Heap_Walk+0x4f8> 40009ad4: 80 a5 00 1a cmp %l4, %i2 return true; } free_block = free_block->next; 40009ad8: 10 bf ff fb b 40009ac4 <_Heap_Walk+0x498> 40009adc: c8 01 20 08 ld [ %g4 + 8 ], %g4 if ( !_Heap_Is_prev_used( next_block ) ) { if ( !_Heap_Walk_check_free_block( source, printer, heap, block ) ) { return false; } } else if (prev_used) { 40009ae0: 80 a4 a0 00 cmp %l2, 0 40009ae4: 02 80 00 09 be 40009b08 <_Heap_Walk+0x4dc> 40009ae8: 92 10 20 00 clr %o1 (*printer)( 40009aec: 15 10 00 5c sethi %hi(0x40017000), %o2 40009af0: 96 10 00 19 mov %i1, %o3 40009af4: 94 12 a0 b0 or %o2, 0xb0, %o2 40009af8: 9f c7 40 00 call %i5 40009afc: 98 10 00 15 mov %l5, %o4 40009b00: 10 80 00 09 b 40009b24 <_Heap_Walk+0x4f8> 40009b04: 80 a5 00 1a cmp %l4, %i2 "block 0x%08x: size %u\n", block, block_size ); } else { (*printer)( 40009b08: da 06 40 00 ld [ %i1 ], %o5 40009b0c: 15 10 00 5c sethi %hi(0x40017000), %o2 40009b10: 96 10 00 19 mov %i1, %o3 40009b14: 94 12 a0 c8 or %o2, 0xc8, %o2 40009b18: 9f c7 40 00 call %i5 40009b1c: 98 10 00 15 mov %l5, %o4 block->prev_size ); } block = next_block; } while ( block != first_block ); 40009b20: 80 a5 00 1a cmp %l4, %i2 40009b24: 02 80 00 04 be 40009b34 <_Heap_Walk+0x508> 40009b28: a6 10 20 01 mov 1, %l3 40009b2c: 10 bf ff 61 b 400098b0 <_Heap_Walk+0x284> 40009b30: b2 10 00 14 mov %l4, %i1 40009b34: b0 0c e0 ff and %l3, 0xff, %i0 40009b38: 81 c7 e0 08 ret 40009b3c: 81 e8 00 00 restore return false; } if ( !_Heap_Walk_is_in_free_list( heap, block ) ) { (*printer)( 40009b40: 15 10 00 5c sethi %hi(0x40017000), %o2 40009b44: 90 10 00 16 mov %l6, %o0 40009b48: 92 10 20 01 mov 1, %o1 40009b4c: 94 12 a0 f0 or %o2, 0xf0, %o2 40009b50: 10 bf ff 32 b 40009818 <_Heap_Walk+0x1ec> 40009b54: 96 10 00 19 mov %i1, %o3 =============================================================================== 40008ab4 <_Objects_Allocate_unprotected>: } Objects_Control *_Objects_Allocate_unprotected( Objects_Information *information ) { 40008ab4: 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 ) 40008ab8: c2 06 20 18 ld [ %i0 + 0x18 ], %g1 40008abc: 80 a0 60 00 cmp %g1, 0 40008ac0: 12 80 00 04 bne 40008ad0 <_Objects_Allocate_unprotected+0x1c><== ALWAYS TAKEN 40008ac4: ba 10 00 18 mov %i0, %i5 return NULL; 40008ac8: 81 c7 e0 08 ret 40008acc: 91 e8 20 00 restore %g0, 0, %o0 */ RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_first( const Chain_Control *the_chain ) { return _Chain_Immutable_head( the_chain )->next; 40008ad0: f8 06 20 20 ld [ %i0 + 0x20 ], %i4 RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( const Chain_Control *the_chain ) { return _Chain_Immutable_first( the_chain ) == _Chain_Immutable_tail( the_chain ); 40008ad4: b4 06 20 24 add %i0, 0x24, %i2 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Get_unprotected( Chain_Control *the_chain ) { if ( !_Chain_Is_empty(the_chain)) 40008ad8: 80 a7 00 1a cmp %i4, %i2 40008adc: 02 80 00 06 be 40008af4 <_Objects_Allocate_unprotected+0x40> 40008ae0: b6 06 20 20 add %i0, 0x20, %i3 Chain_Control *the_chain ) { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *old_first = head->next; Chain_Node *new_first = old_first->next; 40008ae4: c2 07 00 00 ld [ %i4 ], %g1 head->next = new_first; 40008ae8: c2 26 20 20 st %g1, [ %i0 + 0x20 ] new_first->previous = head; 40008aec: 10 80 00 03 b 40008af8 <_Objects_Allocate_unprotected+0x44> 40008af0: f6 20 60 04 st %i3, [ %g1 + 4 ] ) { if ( !_Chain_Is_empty(the_chain)) return _Chain_Get_first_unprotected(the_chain); else return NULL; 40008af4: b8 10 20 00 clr %i4 * 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_Get_inactive( information ); if ( information->auto_extend ) { 40008af8: c2 0f 60 12 ldub [ %i5 + 0x12 ], %g1 40008afc: 80 a0 60 00 cmp %g1, 0 40008b00: 02 80 00 20 be 40008b80 <_Objects_Allocate_unprotected+0xcc> 40008b04: b0 10 00 1c mov %i4, %i0 /* * If the list is empty then we are out of objects and need to * extend information base. */ if ( !the_object ) { 40008b08: 80 a7 20 00 cmp %i4, 0 40008b0c: 32 80 00 0c bne,a 40008b3c <_Objects_Allocate_unprotected+0x88> 40008b10: c4 07 60 08 ld [ %i5 + 8 ], %g2 _Objects_Extend_information( information ); 40008b14: 40 00 00 2a call 40008bbc <_Objects_Extend_information> 40008b18: 90 10 00 1d mov %i5, %o0 */ RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_first( const Chain_Control *the_chain ) { return _Chain_Immutable_head( the_chain )->next; 40008b1c: f8 07 60 20 ld [ %i5 + 0x20 ], %i4 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Get_unprotected( Chain_Control *the_chain ) { if ( !_Chain_Is_empty(the_chain)) 40008b20: 80 a7 00 1a cmp %i4, %i2 40008b24: 02 bf ff e9 be 40008ac8 <_Objects_Allocate_unprotected+0x14> 40008b28: 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; 40008b2c: c2 07 00 00 ld [ %i4 ], %g1 head->next = new_first; 40008b30: c2 27 60 20 st %g1, [ %i5 + 0x20 ] new_first->previous = head; 40008b34: f6 20 60 04 st %i3, [ %g1 + 4 ] } if ( the_object ) { uint32_t block; block = (uint32_t) _Objects_Get_index( the_object->id ) - 40008b38: c4 07 60 08 ld [ %i5 + 8 ], %g2 40008b3c: d0 07 20 08 ld [ %i4 + 8 ], %o0 _Objects_Get_index( information->minimum_id ); block /= information->allocation_size; 40008b40: d2 17 60 14 lduh [ %i5 + 0x14 ], %o1 } if ( the_object ) { uint32_t block; block = (uint32_t) _Objects_Get_index( the_object->id ) - 40008b44: 03 00 00 3f sethi %hi(0xfc00), %g1 40008b48: 82 10 63 ff or %g1, 0x3ff, %g1 ! ffff <_TLS_Alignment+0xfffe> 40008b4c: 90 0a 00 01 and %o0, %g1, %o0 40008b50: 82 08 80 01 and %g2, %g1, %g1 _Objects_Get_index( information->minimum_id ); block /= information->allocation_size; 40008b54: 40 00 2a 61 call 400134d8 <.udiv> 40008b58: 90 22 00 01 sub %o0, %g1, %o0 information->inactive_per_block[ block ]--; 40008b5c: c2 07 60 30 ld [ %i5 + 0x30 ], %g1 40008b60: 91 2a 20 02 sll %o0, 2, %o0 40008b64: c4 00 40 08 ld [ %g1 + %o0 ], %g2 information->inactive--; 40008b68: b0 10 00 1c mov %i4, %i0 block = (uint32_t) _Objects_Get_index( the_object->id ) - _Objects_Get_index( information->minimum_id ); block /= information->allocation_size; information->inactive_per_block[ block ]--; 40008b6c: 84 00 bf ff add %g2, -1, %g2 40008b70: c4 20 40 08 st %g2, [ %g1 + %o0 ] information->inactive--; 40008b74: c2 17 60 2c lduh [ %i5 + 0x2c ], %g1 40008b78: 82 00 7f ff add %g1, -1, %g1 40008b7c: c2 37 60 2c sth %g1, [ %i5 + 0x2c ] ); } #endif return the_object; } 40008b80: 81 c7 e0 08 ret 40008b84: 81 e8 00 00 restore =============================================================================== 40008bbc <_Objects_Extend_information>: */ void _Objects_Extend_information( Objects_Information *information ) { 40008bbc: 9d e3 bf a0 save %sp, -96, %sp minimum_index = _Objects_Get_index( information->minimum_id ); index_base = minimum_index; block = 0; /* if ( information->maximum < minimum_index ) */ if ( information->object_blocks == NULL ) 40008bc0: f2 06 20 34 ld [ %i0 + 0x34 ], %i1 */ void _Objects_Extend_information( Objects_Information *information ) { 40008bc4: ba 10 00 18 mov %i0, %i5 /* * Search for a free block of indexes. If we do NOT need to allocate or * extend the block table, then we will change do_extend. */ do_extend = true; minimum_index = _Objects_Get_index( information->minimum_id ); 40008bc8: f4 16 20 0a lduh [ %i0 + 0xa ], %i2 index_base = minimum_index; block = 0; /* if ( information->maximum < minimum_index ) */ if ( information->object_blocks == NULL ) 40008bcc: 80 a6 60 00 cmp %i1, 0 40008bd0: e8 16 20 14 lduh [ %i0 + 0x14 ], %l4 40008bd4: 02 80 00 18 be 40008c34 <_Objects_Extend_information+0x78> 40008bd8: e0 16 20 10 lduh [ %i0 + 0x10 ], %l0 block_count = 0; else { block_count = information->maximum / information->allocation_size; 40008bdc: 91 2c 20 10 sll %l0, 0x10, %o0 40008be0: b1 2d 20 10 sll %l4, 0x10, %i0 40008be4: 91 32 20 10 srl %o0, 0x10, %o0 40008be8: b1 36 20 10 srl %i0, 0x10, %i0 /* * Search for a free block of indexes. If we do NOT need to allocate or * extend the block table, then we will change do_extend. */ do_extend = true; minimum_index = _Objects_Get_index( information->minimum_id ); 40008bec: b8 10 00 1a mov %i2, %i4 /* if ( information->maximum < minimum_index ) */ if ( information->object_blocks == NULL ) block_count = 0; else { block_count = information->maximum / information->allocation_size; 40008bf0: 92 10 00 18 mov %i0, %o1 40008bf4: 40 00 2a 39 call 400134d8 <.udiv> 40008bf8: b6 10 20 00 clr %i3 40008bfc: 91 2a 20 10 sll %o0, 0x10, %o0 40008c00: a7 32 20 10 srl %o0, 0x10, %l3 for ( ; block < block_count; block++ ) { 40008c04: 80 a6 c0 13 cmp %i3, %l3 40008c08: 1a 80 00 09 bcc 40008c2c <_Objects_Extend_information+0x70> 40008c0c: 83 2e e0 02 sll %i3, 2, %g1 if ( information->object_blocks[ block ] == NULL ) { 40008c10: c2 06 40 01 ld [ %i1 + %g1 ], %g1 40008c14: 80 a0 60 00 cmp %g1, 0 40008c18: 22 80 00 0b be,a 40008c44 <_Objects_Extend_information+0x88> 40008c1c: b2 10 20 00 clr %i1 do_extend = false; break; } else index_base += information->allocation_size; 40008c20: b8 07 00 18 add %i4, %i0, %i4 if ( information->object_blocks == NULL ) block_count = 0; else { block_count = information->maximum / information->allocation_size; for ( ; block < block_count; block++ ) { 40008c24: 10 bf ff f8 b 40008c04 <_Objects_Extend_information+0x48> 40008c28: b6 06 e0 01 inc %i3 40008c2c: 10 80 00 06 b 40008c44 <_Objects_Extend_information+0x88> 40008c30: b2 10 20 01 mov 1, %i1 /* * Search for a free block of indexes. If we do NOT need to allocate or * extend the block table, then we will change do_extend. */ do_extend = true; minimum_index = _Objects_Get_index( information->minimum_id ); 40008c34: b8 10 00 1a mov %i2, %i4 /* * Search for a free block of indexes. If we do NOT need to allocate or * extend the block table, then we will change do_extend. */ do_extend = true; 40008c38: b2 10 20 01 mov 1, %i1 minimum_index = _Objects_Get_index( information->minimum_id ); index_base = minimum_index; block = 0; 40008c3c: b6 10 20 00 clr %i3 40008c40: a6 10 20 00 clr %l3 break; } else index_base += information->allocation_size; } } index_end = index_base + information->allocation_size; 40008c44: a9 2d 20 10 sll %l4, 0x10, %l4 maximum = (uint32_t) information->maximum + information->allocation_size; 40008c48: a1 2c 20 10 sll %l0, 0x10, %l0 break; } else index_base += information->allocation_size; } } index_end = index_base + information->allocation_size; 40008c4c: a9 35 20 10 srl %l4, 0x10, %l4 maximum = (uint32_t) information->maximum + information->allocation_size; 40008c50: a1 34 20 10 srl %l0, 0x10, %l0 /* * We need to limit the number of objects to the maximum number * representable in the index portion of the object Id. In the * case of 16-bit Ids, this is only 256 object instances. */ if ( maximum > OBJECTS_ID_FINAL_INDEX ) { 40008c54: 03 00 00 3f sethi %hi(0xfc00), %g1 index_base += information->allocation_size; } } index_end = index_base + information->allocation_size; maximum = (uint32_t) information->maximum + information->allocation_size; 40008c58: a0 04 00 14 add %l0, %l4, %l0 /* * We need to limit the number of objects to the maximum number * representable in the index portion of the object Id. In the * case of 16-bit Ids, this is only 256 object instances. */ if ( maximum > OBJECTS_ID_FINAL_INDEX ) { 40008c5c: 82 10 63 ff or %g1, 0x3ff, %g1 40008c60: 80 a4 00 01 cmp %l0, %g1 40008c64: 18 80 00 8d bgu 40008e98 <_Objects_Extend_information+0x2dc> 40008c68: 01 00 00 00 nop /* * Allocate the name table, and the objects and if it fails either return or * generate a fatal error depending on auto-extending being active. */ block_size = information->allocation_size * information->size; 40008c6c: d2 07 60 18 ld [ %i5 + 0x18 ], %o1 40008c70: 40 00 29 e0 call 400133f0 <.umul> 40008c74: 90 10 00 14 mov %l4, %o0 if ( information->auto_extend ) { 40008c78: c2 0f 60 12 ldub [ %i5 + 0x12 ], %g1 40008c7c: 80 a0 60 00 cmp %g1, 0 40008c80: 02 80 00 09 be 40008ca4 <_Objects_Extend_information+0xe8> 40008c84: 01 00 00 00 nop new_object_block = _Workspace_Allocate( block_size ); 40008c88: 40 00 09 bc call 4000b378 <_Workspace_Allocate> 40008c8c: 01 00 00 00 nop if ( !new_object_block ) 40008c90: b0 92 20 00 orcc %o0, 0, %i0 40008c94: 12 80 00 08 bne 40008cb4 <_Objects_Extend_information+0xf8><== ALWAYS TAKEN 40008c98: 80 8e 60 ff btst 0xff, %i1 40008c9c: 81 c7 e0 08 ret <== NOT EXECUTED 40008ca0: 81 e8 00 00 restore <== NOT EXECUTED return; } else { new_object_block = _Workspace_Allocate_or_fatal_error( block_size ); 40008ca4: 40 00 09 cc call 4000b3d4 <_Workspace_Allocate_or_fatal_error> 40008ca8: 01 00 00 00 nop 40008cac: b0 10 00 08 mov %o0, %i0 } /* * Do we need to grow the tables? */ if ( do_extend ) { 40008cb0: 80 8e 60 ff btst 0xff, %i1 40008cb4: 02 80 00 59 be 40008e18 <_Objects_Extend_information+0x25c> 40008cb8: a8 07 00 14 add %i4, %l4, %l4 */ /* * Up the block count and maximum */ block_count++; 40008cbc: a6 04 e0 01 inc %l3 * 1. object_blocks : void* * 2. inactive_per_blocks : uint32_t * 3. local_table : Objects_Name* */ object_blocks_size = (uintptr_t)_Addresses_Align_up( (void*)(block_count * sizeof(void*)), 40008cc0: a7 2c e0 02 sll %l3, 2, %l3 void *address, size_t alignment ) { uintptr_t mask = alignment - (uintptr_t)1; return (void*)(((uintptr_t)address + mask) & ~mask); 40008cc4: a2 04 e0 07 add %l3, 7, %l1 40008cc8: a2 0c 7f f8 and %l1, -8, %l1 inactive_per_block_size = (uintptr_t)_Addresses_Align_up( (void*)(block_count * sizeof(uint32_t)), CPU_ALIGNMENT ); block_size = object_blocks_size + inactive_per_block_size + 40008ccc: 83 2c 60 01 sll %l1, 1, %g1 ((maximum + minimum_index) * sizeof(Objects_Control *)); 40008cd0: 90 04 00 1a add %l0, %i2, %o0 40008cd4: 91 2a 20 02 sll %o0, 2, %o0 inactive_per_block_size = (uintptr_t)_Addresses_Align_up( (void*)(block_count * sizeof(uint32_t)), CPU_ALIGNMENT ); block_size = object_blocks_size + inactive_per_block_size + 40008cd8: 90 00 40 08 add %g1, %o0, %o0 ((maximum + minimum_index) * sizeof(Objects_Control *)); if ( information->auto_extend ) { 40008cdc: c2 0f 60 12 ldub [ %i5 + 0x12 ], %g1 40008ce0: 80 a0 60 00 cmp %g1, 0 40008ce4: 02 80 00 09 be 40008d08 <_Objects_Extend_information+0x14c> 40008ce8: 01 00 00 00 nop object_blocks = _Workspace_Allocate( block_size ); 40008cec: 40 00 09 a3 call 4000b378 <_Workspace_Allocate> 40008cf0: 01 00 00 00 nop if ( !object_blocks ) { 40008cf4: b2 92 20 00 orcc %o0, 0, %i1 40008cf8: 32 80 00 08 bne,a 40008d18 <_Objects_Extend_information+0x15c><== ALWAYS TAKEN 40008cfc: c2 17 60 10 lduh [ %i5 + 0x10 ], %g1 _Workspace_Free( new_object_block ); 40008d00: 40 00 09 af call 4000b3bc <_Workspace_Free> <== NOT EXECUTED 40008d04: 81 e8 00 00 restore <== NOT EXECUTED return; } } else { object_blocks = _Workspace_Allocate_or_fatal_error( block_size ); 40008d08: 40 00 09 b3 call 4000b3d4 <_Workspace_Allocate_or_fatal_error> 40008d0c: 01 00 00 00 nop 40008d10: b2 10 00 08 mov %o0, %i1 * Take the block count down. Saves all the (block_count - 1) * in the copies. */ block_count--; if ( information->maximum > minimum_index ) { 40008d14: c2 17 60 10 lduh [ %i5 + 0x10 ], %g1 RTEMS_INLINE_ROUTINE void *_Addresses_Add_offset ( const void *base, uintptr_t offset ) { return (void *)((uintptr_t)base + offset); 40008d18: a4 06 40 11 add %i1, %l1, %l2 40008d1c: 80 a0 40 1a cmp %g1, %i2 40008d20: 18 80 00 04 bgu 40008d30 <_Objects_Extend_information+0x174> 40008d24: a2 04 80 11 add %l2, %l1, %l1 40008d28: 10 80 00 13 b 40008d74 <_Objects_Extend_information+0x1b8> 40008d2c: 82 10 20 00 clr %g1 /* * Copy each section of the table over. This has to be performed as * separate parts as size of each block has changed. */ memcpy( object_blocks, 40008d30: d2 07 60 34 ld [ %i5 + 0x34 ], %o1 information->object_blocks, block_count * sizeof(void*) ); 40008d34: aa 04 ff fc add %l3, -4, %l5 /* * Copy each section of the table over. This has to be performed as * separate parts as size of each block has changed. */ memcpy( object_blocks, 40008d38: 90 10 00 19 mov %i1, %o0 40008d3c: 40 00 1d 1f call 400101b8 40008d40: 94 10 00 15 mov %l5, %o2 information->object_blocks, block_count * sizeof(void*) ); memcpy( inactive_per_block, 40008d44: d2 07 60 30 ld [ %i5 + 0x30 ], %o1 40008d48: 94 10 00 15 mov %l5, %o2 40008d4c: 40 00 1d 1b call 400101b8 40008d50: 90 10 00 12 mov %l2, %o0 information->inactive_per_block, block_count * sizeof(uint32_t) ); memcpy( local_table, information->local_table, (information->maximum + minimum_index) * sizeof(Objects_Control *) ); 40008d54: c2 17 60 10 lduh [ %i5 + 0x10 ], %g1 information->object_blocks, block_count * sizeof(void*) ); memcpy( inactive_per_block, information->inactive_per_block, block_count * sizeof(uint32_t) ); memcpy( local_table, 40008d58: d2 07 60 1c ld [ %i5 + 0x1c ], %o1 information->local_table, (information->maximum + minimum_index) * sizeof(Objects_Control *) ); 40008d5c: 94 00 40 1a add %g1, %i2, %o2 information->object_blocks, block_count * sizeof(void*) ); memcpy( inactive_per_block, information->inactive_per_block, block_count * sizeof(uint32_t) ); memcpy( local_table, 40008d60: 90 10 00 11 mov %l1, %o0 40008d64: 40 00 1d 15 call 400101b8 40008d68: 95 2a a0 02 sll %o2, 2, %o2 40008d6c: 10 80 00 09 b 40008d90 <_Objects_Extend_information+0x1d4> 40008d70: a6 04 ff fc add %l3, -4, %l3 } else { /* * Deal with the special case of the 0 to minimum_index */ for ( index = 0; index < minimum_index; index++ ) { 40008d74: 80 a0 40 1a cmp %g1, %i2 40008d78: 02 80 00 05 be 40008d8c <_Objects_Extend_information+0x1d0> 40008d7c: 85 28 60 02 sll %g1, 2, %g2 40008d80: 82 00 60 01 inc %g1 local_table[ index ] = NULL; 40008d84: 10 bf ff fc b 40008d74 <_Objects_Extend_information+0x1b8> 40008d88: c0 20 80 11 clr [ %g2 + %l1 ] } /* * Initialise the new entries in the table. */ object_blocks[block_count] = NULL; 40008d8c: a6 04 ff fc add %l3, -4, %l3 40008d90: c0 26 40 13 clr [ %i1 + %l3 ] inactive_per_block[block_count] = 0; 40008d94: c0 24 80 13 clr [ %l2 + %l3 ] for ( index = index_base ; index < index_end ; ++index ) { 40008d98: 82 10 00 1c mov %i4, %g1 40008d9c: 80 a0 40 14 cmp %g1, %l4 40008da0: 1a 80 00 05 bcc 40008db4 <_Objects_Extend_information+0x1f8> 40008da4: 85 28 60 02 sll %g1, 2, %g2 40008da8: 82 00 60 01 inc %g1 local_table[ index ] = NULL; 40008dac: 10 bf ff fc b 40008d9c <_Objects_Extend_information+0x1e0> 40008db0: c0 20 80 11 clr [ %g2 + %l1 ] * * This rountine increments the thread dispatch level */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_increment_disable_level(void) { uint32_t disable_level = _Thread_Dispatch_disable_level; 40008db4: c4 01 a0 10 ld [ %g6 + 0x10 ], %g2 _ISR_Disable( level ); _Profiling_Thread_dispatch_disable( _Per_CPU_Get(), disable_level ); #endif ++disable_level; 40008db8: 84 00 a0 01 inc %g2 _Thread_Dispatch_disable_level = disable_level; 40008dbc: c4 21 a0 10 st %g2, [ %g6 + 0x10 ] } _Thread_Disable_dispatch(); _ISR_Disable( level ); 40008dc0: 7f ff e5 9d call 40002434 40008dc4: 01 00 00 00 nop uint32_t the_class, uint32_t node, uint32_t index ) { return (( (Objects_Id) the_api ) << OBJECTS_API_START_BIT) | 40008dc8: c2 07 40 00 ld [ %i5 ], %g1 40008dcc: 05 00 00 40 sethi %hi(0x10000), %g2 40008dd0: 83 28 60 18 sll %g1, 0x18, %g1 40008dd4: 82 10 40 02 or %g1, %g2, %g1 old_tables = information->object_blocks; information->object_blocks = object_blocks; information->inactive_per_block = inactive_per_block; information->local_table = local_table; information->maximum = (Objects_Maximum) maximum; 40008dd8: e0 37 60 10 sth %l0, [ %i5 + 0x10 ] (( (Objects_Id) the_class ) << OBJECTS_CLASS_START_BIT) | 40008ddc: a0 10 40 10 or %g1, %l0, %l0 information->maximum_id = _Objects_Build_id( 40008de0: c2 17 60 04 lduh [ %i5 + 4 ], %g1 } _Thread_Disable_dispatch(); _ISR_Disable( level ); old_tables = information->object_blocks; 40008de4: f4 07 60 34 ld [ %i5 + 0x34 ], %i2 40008de8: 83 28 60 1b sll %g1, 0x1b, %g1 information->object_blocks = object_blocks; 40008dec: f2 27 60 34 st %i1, [ %i5 + 0x34 ] uint32_t the_class, uint32_t node, uint32_t index ) { return (( (Objects_Id) the_api ) << OBJECTS_API_START_BIT) | 40008df0: a0 14 00 01 or %l0, %g1, %l0 information->inactive_per_block = inactive_per_block; 40008df4: e4 27 60 30 st %l2, [ %i5 + 0x30 ] information->local_table = local_table; 40008df8: e2 27 60 1c st %l1, [ %i5 + 0x1c ] information->maximum = (Objects_Maximum) maximum; information->maximum_id = _Objects_Build_id( 40008dfc: e0 27 60 0c st %l0, [ %i5 + 0xc ] information->the_class, _Objects_Local_node, information->maximum ); _ISR_Enable( level ); 40008e00: 7f ff e5 90 call 40002440 40008e04: 01 00 00 00 nop _Thread_Enable_dispatch(); 40008e08: 40 00 04 04 call 40009e18 <_Thread_Enable_dispatch> 40008e0c: 01 00 00 00 nop _Workspace_Free( old_tables ); 40008e10: 40 00 09 6b call 4000b3bc <_Workspace_Free> 40008e14: 90 10 00 1a mov %i2, %o0 } /* * Assign the new object block to the object block table. */ information->object_blocks[ block ] = new_object_block; 40008e18: c2 07 60 34 ld [ %i5 + 0x34 ], %g1 40008e1c: b7 2e e0 02 sll %i3, 2, %i3 40008e20: f0 20 40 1b st %i0, [ %g1 + %i3 ] /* * Append to inactive chain. */ the_object = information->object_blocks[ block ]; 40008e24: c2 07 60 34 ld [ %i5 + 0x34 ], %g1 40008e28: 07 00 00 40 sethi %hi(0x10000), %g3 40008e2c: c2 00 40 1b ld [ %g1 + %i3 ], %g1 RTEMS_INLINE_ROUTINE void _Chain_Append_unprotected( Chain_Control *the_chain, Chain_Node *the_node ) { Chain_Node *tail = _Chain_Tail( the_chain ); 40008e30: 88 07 60 24 add %i5, 0x24, %g4 for ( index = index_base ; index < index_end ; ++index ) { 40008e34: 80 a7 00 14 cmp %i4, %l4 40008e38: 3a 80 00 13 bcc,a 40008e84 <_Objects_Extend_information+0x2c8> 40008e3c: c4 07 60 30 ld [ %i5 + 0x30 ], %g2 40008e40: f4 07 40 00 ld [ %i5 ], %i2 the_object->id = _Objects_Build_id( 40008e44: c4 17 60 04 lduh [ %i5 + 4 ], %g2 40008e48: b5 2e a0 18 sll %i2, 0x18, %i2 (( (Objects_Id) the_class ) << OBJECTS_CLASS_START_BIT) | 40008e4c: 85 28 a0 1b sll %g2, 0x1b, %g2 uint32_t the_class, uint32_t node, uint32_t index ) { return (( (Objects_Id) the_api ) << OBJECTS_API_START_BIT) | 40008e50: b4 16 80 03 or %i2, %g3, %i2 (( (Objects_Id) the_class ) << OBJECTS_CLASS_START_BIT) | 40008e54: 84 16 80 02 or %i2, %g2, %g2 uint32_t the_class, uint32_t node, uint32_t index ) { return (( (Objects_Id) the_api ) << OBJECTS_API_START_BIT) | 40008e58: 84 10 80 1c or %g2, %i4, %g2 40008e5c: c4 20 60 08 st %g2, [ %g1 + 8 ] Chain_Node *old_last = tail->previous; 40008e60: c4 07 60 28 ld [ %i5 + 0x28 ], %g2 the_node->next = tail; 40008e64: c8 20 40 00 st %g4, [ %g1 ] tail->previous = the_node; 40008e68: c2 27 60 28 st %g1, [ %i5 + 0x28 ] old_last->next = the_node; 40008e6c: c2 20 80 00 st %g1, [ %g2 ] the_node->previous = old_last; 40008e70: c4 20 60 04 st %g2, [ %g1 + 4 ] index ); _Chain_Append_unprotected( &information->Inactive, &the_object->Node ); the_object = (Objects_Control *) 40008e74: c4 07 60 18 ld [ %i5 + 0x18 ], %g2 /* * Append to inactive chain. */ the_object = information->object_blocks[ block ]; for ( index = index_base ; index < index_end ; ++index ) { 40008e78: b8 07 20 01 inc %i4 index ); _Chain_Append_unprotected( &information->Inactive, &the_object->Node ); the_object = (Objects_Control *) 40008e7c: 10 bf ff ee b 40008e34 <_Objects_Extend_information+0x278> 40008e80: 82 00 40 02 add %g1, %g2, %g1 ( (char *) the_object + information->size ); } information->inactive_per_block[ block ] = information->allocation_size; 40008e84: c2 17 60 14 lduh [ %i5 + 0x14 ], %g1 40008e88: c2 20 80 1b st %g1, [ %g2 + %i3 ] information->inactive = (Objects_Maximum)(information->inactive + information->allocation_size); 40008e8c: c4 17 60 2c lduh [ %i5 + 0x2c ], %g2 40008e90: 82 00 80 01 add %g2, %g1, %g1 the_object = (Objects_Control *) ( (char *) the_object + information->size ); } information->inactive_per_block[ block ] = information->allocation_size; information->inactive = 40008e94: c2 37 60 2c sth %g1, [ %i5 + 0x2c ] 40008e98: 81 c7 e0 08 ret 40008e9c: 81 e8 00 00 restore =============================================================================== 40008f60 <_Objects_Get_information>: Objects_Information *_Objects_Get_information( Objects_APIs the_api, uint16_t the_class ) { 40008f60: 9d e3 bf a0 save %sp, -96, %sp Objects_Information *info; int the_class_api_maximum; if ( !the_class ) 40008f64: 80 a6 60 00 cmp %i1, 0 40008f68: 12 80 00 04 bne 40008f78 <_Objects_Get_information+0x18> 40008f6c: 01 00 00 00 nop return NULL; 40008f70: 81 c7 e0 08 ret 40008f74: 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 ); 40008f78: 40 00 12 2b call 4000d824 <_Objects_API_maximum_class> 40008f7c: 90 10 00 18 mov %i0, %o0 if ( the_class_api_maximum == 0 ) 40008f80: 80 a2 20 00 cmp %o0, 0 40008f84: 02 bf ff fb be 40008f70 <_Objects_Get_information+0x10> 40008f88: 80 a6 40 08 cmp %i1, %o0 return NULL; if ( the_class > (uint32_t) the_class_api_maximum ) 40008f8c: 18 bf ff f9 bgu 40008f70 <_Objects_Get_information+0x10> 40008f90: 03 10 00 61 sethi %hi(0x40018400), %g1 return NULL; if ( !_Objects_Information_table[ the_api ] ) 40008f94: b1 2e 20 02 sll %i0, 2, %i0 40008f98: 82 10 60 20 or %g1, 0x20, %g1 40008f9c: c2 00 40 18 ld [ %g1 + %i0 ], %g1 40008fa0: 80 a0 60 00 cmp %g1, 0 40008fa4: 02 bf ff f3 be 40008f70 <_Objects_Get_information+0x10> <== NEVER TAKEN 40008fa8: b3 2e 60 02 sll %i1, 2, %i1 return NULL; info = _Objects_Information_table[ the_api ][ the_class ]; 40008fac: f0 00 40 19 ld [ %g1 + %i1 ], %i0 if ( !info ) 40008fb0: 80 a6 20 00 cmp %i0, 0 40008fb4: 02 bf ff ef be 40008f70 <_Objects_Get_information+0x10> <== NEVER TAKEN 40008fb8: 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 ) 40008fbc: c2 16 20 10 lduh [ %i0 + 0x10 ], %g1 40008fc0: 80 a0 60 00 cmp %g1, 0 40008fc4: 02 bf ff eb be 40008f70 <_Objects_Get_information+0x10> 40008fc8: 01 00 00 00 nop return NULL; #endif return info; } 40008fcc: 81 c7 e0 08 ret 40008fd0: 81 e8 00 00 restore =============================================================================== 4000cc1c <_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; 4000cc1c: c2 02 20 08 ld [ %o0 + 8 ], %g1 4000cc20: 92 22 40 01 sub %o1, %g1, %o1 if ( information->maximum >= index ) { 4000cc24: 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; 4000cc28: 92 02 60 01 inc %o1 if ( information->maximum >= index ) { 4000cc2c: 80 a0 40 09 cmp %g1, %o1 4000cc30: 0a 80 00 09 bcs 4000cc54 <_Objects_Get_no_protection+0x38> 4000cc34: 93 2a 60 02 sll %o1, 2, %o1 if ( (the_object = information->local_table[ index ]) != NULL ) { 4000cc38: c2 02 20 1c ld [ %o0 + 0x1c ], %g1 4000cc3c: d0 00 40 09 ld [ %g1 + %o1 ], %o0 4000cc40: 80 a2 20 00 cmp %o0, 0 4000cc44: 02 80 00 05 be 4000cc58 <_Objects_Get_no_protection+0x3c> <== NEVER TAKEN 4000cc48: 82 10 20 01 mov 1, %g1 *location = OBJECTS_LOCAL; return the_object; 4000cc4c: 81 c3 e0 08 retl 4000cc50: 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; 4000cc54: 82 10 20 01 mov 1, %g1 return NULL; 4000cc58: 90 10 20 00 clr %o0 } 4000cc5c: 81 c3 e0 08 retl 4000cc60: c2 22 80 00 st %g1, [ %o2 ] =============================================================================== 4000d3b0 <_Objects_Id_to_name>: Objects_Name_or_id_lookup_errors _Objects_Id_to_name ( Objects_Id id, Objects_Name *name ) { 4000d3b0: 9d e3 bf 98 save %sp, -104, %sp /* * Caller is trusted for name != NULL. */ tmpId = (id == OBJECTS_ID_OF_SELF) ? _Thread_Get_executing()->Object.id : id; 4000d3b4: 80 a6 20 00 cmp %i0, 0 4000d3b8: 12 80 00 05 bne 4000d3cc <_Objects_Id_to_name+0x1c> 4000d3bc: 83 36 20 18 srl %i0, 0x18, %g1 4000d3c0: c2 01 a0 18 ld [ %g6 + 0x18 ], %g1 4000d3c4: f0 00 60 08 ld [ %g1 + 8 ], %i0 4000d3c8: 83 36 20 18 srl %i0, 0x18, %g1 4000d3cc: 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 ) 4000d3d0: 84 00 7f ff add %g1, -1, %g2 4000d3d4: 80 a0 a0 02 cmp %g2, 2 4000d3d8: 08 80 00 04 bleu 4000d3e8 <_Objects_Id_to_name+0x38> 4000d3dc: 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; 4000d3e0: 81 c7 e0 08 ret 4000d3e4: 91 e8 20 03 restore %g0, 3, %o0 if ( !_Objects_Information_table[ the_api ] ) 4000d3e8: 05 10 00 c0 sethi %hi(0x40030000), %g2 4000d3ec: 84 10 a3 60 or %g2, 0x360, %g2 ! 40030360 <_Objects_Information_table> 4000d3f0: c2 00 80 01 ld [ %g2 + %g1 ], %g1 4000d3f4: 80 a0 60 00 cmp %g1, 0 4000d3f8: 02 bf ff fa be 4000d3e0 <_Objects_Id_to_name+0x30> 4000d3fc: 85 36 20 1b srl %i0, 0x1b, %g2 return OBJECTS_INVALID_ID; the_class = _Objects_Get_class( tmpId ); information = _Objects_Information_table[ the_api ][ the_class ]; 4000d400: 85 28 a0 02 sll %g2, 2, %g2 4000d404: d0 00 40 02 ld [ %g1 + %g2 ], %o0 if ( !information ) 4000d408: 80 a2 20 00 cmp %o0, 0 4000d40c: 02 bf ff f5 be 4000d3e0 <_Objects_Id_to_name+0x30> <== NEVER TAKEN 4000d410: 01 00 00 00 nop return OBJECTS_INVALID_ID; #if defined(RTEMS_SCORE_OBJECT_ENABLE_STRING_NAMES) if ( information->is_string ) 4000d414: c2 0a 20 38 ldub [ %o0 + 0x38 ], %g1 4000d418: 80 a0 60 00 cmp %g1, 0 4000d41c: 12 bf ff f1 bne 4000d3e0 <_Objects_Id_to_name+0x30> <== NEVER TAKEN 4000d420: 92 10 00 18 mov %i0, %o1 return OBJECTS_INVALID_ID; #endif the_object = _Objects_Get( information, tmpId, &ignored_location ); 4000d424: 7f ff ff c8 call 4000d344 <_Objects_Get> 4000d428: 94 07 bf fc add %fp, -4, %o2 if ( !the_object ) 4000d42c: 80 a2 20 00 cmp %o0, 0 4000d430: 02 bf ff ec be 4000d3e0 <_Objects_Id_to_name+0x30> 4000d434: 01 00 00 00 nop return OBJECTS_INVALID_ID; *name = the_object->name; 4000d438: c2 02 20 0c ld [ %o0 + 0xc ], %g1 _Objects_Put( the_object ); return OBJECTS_NAME_OR_ID_LOOKUP_SUCCESSFUL; 4000d43c: b0 10 20 00 clr %i0 RTEMS_INLINE_ROUTINE void _Objects_Put( Objects_Control *the_object ) { (void) the_object; _Thread_Enable_dispatch(); 4000d440: 40 00 03 5f call 4000e1bc <_Thread_Enable_dispatch> 4000d444: c2 26 40 00 st %g1, [ %i1 ] 4000d448: 81 c7 e0 08 ret 4000d44c: 81 e8 00 00 restore =============================================================================== 4000792c <_POSIX_Keys_Free_memory>: #include void _POSIX_Keys_Free_memory( POSIX_Keys_Control *the_key ) { 4000792c: 9d e3 bf 78 save %sp, -136, %sp POSIX_Keys_Key_value_pair search_node; POSIX_Keys_Key_value_pair *p; RBTree_Node *iter, *next; Objects_Id key_id; key_id = the_key->Object.id; 40007930: f6 06 20 08 ld [ %i0 + 8 ], %i3 search_node.key = key_id; search_node.thread_id = 0; iter = _RBTree_Find( &_POSIX_Keys_Key_value_lookup_tree, &search_node.Key_value_lookup_node ); 40007934: 39 10 00 65 sethi %hi(0x40019400), %i4 POSIX_Keys_Key_value_pair *p; RBTree_Node *iter, *next; Objects_Id key_id; key_id = the_key->Object.id; search_node.key = key_id; 40007938: f6 27 bf f4 st %i3, [ %fp + -12 ] search_node.thread_id = 0; 4000793c: c0 27 bf f8 clr [ %fp + -8 ] iter = _RBTree_Find( &_POSIX_Keys_Key_value_lookup_tree, &search_node.Key_value_lookup_node ); 40007940: 90 17 22 a8 or %i4, 0x2a8, %o0 40007944: 92 07 bf e4 add %fp, -28, %o1 40007948: 40 00 0a 7e call 4000a340 <_RBTree_Find> 4000794c: b2 10 00 1c mov %i4, %i1 if ( !iter ) 40007950: ba 92 20 00 orcc %o0, 0, %i5 40007954: 02 80 00 2d be 40007a08 <_POSIX_Keys_Free_memory+0xdc> 40007958: 01 00 00 00 nop return; /** * find the smallest thread_id node in the rbtree. */ next = _RBTree_Next( iter, RBT_LEFT ); 4000795c: 40 00 0b 38 call 4000a63c <_RBTree_Next> 40007960: 92 10 20 00 clr %o1 ! 0 <_TLS_BSS_size> 40007964: b8 10 00 08 mov %o0, %i4 p = _RBTree_Container_of( next, POSIX_Keys_Key_value_pair, Key_value_lookup_node ); 40007968: 82 02 3f f8 add %o0, -8, %g1 while ( next != NULL && p->key == key_id) { 4000796c: 80 a7 20 00 cmp %i4, 0 40007970: 32 80 00 07 bne,a 4000798c <_POSIX_Keys_Free_memory+0x60> 40007974: c2 00 60 18 ld [ %g1 + 0x18 ], %g1 RTEMS_INLINE_ROUTINE void _POSIX_Keys_Key_value_pair_free( POSIX_Keys_Key_value_pair *key_value_pair ) { _Freechain_Put( &_POSIX_Keys_Keypool, key_value_pair ); 40007978: 31 10 00 65 sethi %hi(0x40019400), %i0 } /** * delete all nodes belongs to the_key from the rbtree and chain. */ p = _RBTree_Container_of( iter, POSIX_Keys_Key_value_pair, Key_value_lookup_node ); 4000797c: b8 07 7f f8 add %i5, -8, %i4 while ( iter != NULL && p->key == key_id ) { next = _RBTree_Next( iter, RBT_RIGHT ); _RBTree_Extract( &_POSIX_Keys_Key_value_lookup_tree, iter ); 40007980: b2 16 62 a8 or %i1, 0x2a8, %i1 40007984: 10 80 00 1d b 400079f8 <_POSIX_Keys_Free_memory+0xcc> 40007988: b0 16 22 64 or %i0, 0x264, %i0 /** * find the smallest thread_id node in the rbtree. */ next = _RBTree_Next( iter, RBT_LEFT ); p = _RBTree_Container_of( next, POSIX_Keys_Key_value_pair, Key_value_lookup_node ); while ( next != NULL && p->key == key_id) { 4000798c: 80 a0 40 1b cmp %g1, %i3 40007990: 12 bf ff fb bne 4000797c <_POSIX_Keys_Free_memory+0x50> <== NEVER TAKEN 40007994: 31 10 00 65 sethi %hi(0x40019400), %i0 iter = next; next = _RBTree_Next( iter, RBT_LEFT ); 40007998: 90 10 00 1c mov %i4, %o0 4000799c: 92 10 20 00 clr %o1 400079a0: 40 00 0b 27 call 4000a63c <_RBTree_Next> 400079a4: ba 10 00 1c mov %i4, %i5 p = _RBTree_Container_of( next, POSIX_Keys_Key_value_pair, Key_value_lookup_node ); 400079a8: 82 02 3f f8 add %o0, -8, %g1 */ next = _RBTree_Next( iter, RBT_LEFT ); p = _RBTree_Container_of( next, POSIX_Keys_Key_value_pair, Key_value_lookup_node ); while ( next != NULL && p->key == key_id) { iter = next; next = _RBTree_Next( iter, RBT_LEFT ); 400079ac: 10 bf ff f0 b 4000796c <_POSIX_Keys_Free_memory+0x40> 400079b0: b8 10 00 08 mov %o0, %i4 /** * delete all nodes belongs to the_key from the rbtree and chain. */ p = _RBTree_Container_of( iter, POSIX_Keys_Key_value_pair, Key_value_lookup_node ); while ( iter != NULL && p->key == key_id ) { next = _RBTree_Next( iter, RBT_RIGHT ); 400079b4: 40 00 0b 22 call 4000a63c <_RBTree_Next> 400079b8: 90 10 00 1d mov %i5, %o0 _RBTree_Extract( &_POSIX_Keys_Key_value_lookup_tree, iter ); 400079bc: 92 10 00 1d mov %i5, %o1 /** * delete all nodes belongs to the_key from the rbtree and chain. */ p = _RBTree_Container_of( iter, POSIX_Keys_Key_value_pair, Key_value_lookup_node ); while ( iter != NULL && p->key == key_id ) { next = _RBTree_Next( iter, RBT_RIGHT ); 400079c0: b4 10 00 08 mov %o0, %i2 _RBTree_Extract( &_POSIX_Keys_Key_value_lookup_tree, iter ); 400079c4: 40 00 09 f3 call 4000a190 <_RBTree_Extract> 400079c8: 90 10 00 19 mov %i1, %o0 ) { Chain_Node *next; Chain_Node *previous; next = the_node->next; 400079cc: c4 07 00 00 ld [ %i4 ], %g2 previous = the_node->previous; 400079d0: c2 07 20 04 ld [ %i4 + 4 ], %g1 400079d4: 92 10 00 1c mov %i4, %o1 next->previous = previous; 400079d8: c2 20 a0 04 st %g1, [ %g2 + 4 ] previous->next = next; 400079dc: c4 20 40 00 st %g2, [ %g1 ] 400079e0: 40 00 05 fa call 400091c8 <_Freechain_Put> 400079e4: 90 10 00 18 mov %i0, %o0 /** * delete all nodes belongs to the_key from the rbtree and chain. */ p = _RBTree_Container_of( iter, POSIX_Keys_Key_value_pair, Key_value_lookup_node ); while ( iter != NULL && p->key == key_id ) { 400079e8: 80 a6 a0 00 cmp %i2, 0 400079ec: 02 80 00 07 be 40007a08 <_POSIX_Keys_Free_memory+0xdc> 400079f0: b8 06 bf f8 add %i2, -8, %i4 next = _RBTree_Next( iter, RBT_RIGHT ); _RBTree_Extract( &_POSIX_Keys_Key_value_lookup_tree, iter ); _Chain_Extract_unprotected( &p->Key_values_per_thread_node ); _POSIX_Keys_Key_value_pair_free( p ); iter = next; 400079f4: ba 10 00 1a mov %i2, %i5 /** * delete all nodes belongs to the_key from the rbtree and chain. */ p = _RBTree_Container_of( iter, POSIX_Keys_Key_value_pair, Key_value_lookup_node ); while ( iter != NULL && p->key == key_id ) { 400079f8: c2 07 20 18 ld [ %i4 + 0x18 ], %g1 400079fc: 80 a0 40 1b cmp %g1, %i3 40007a00: 02 bf ff ed be 400079b4 <_POSIX_Keys_Free_memory+0x88> 40007a04: 92 10 20 01 mov 1, %o1 40007a08: 81 c7 e0 08 ret 40007a0c: 81 e8 00 00 restore =============================================================================== 4000c774 <_POSIX_Keys_Key_value_lookup_tree_compare_function>: int diff; n1 = _RBTree_Container_of( node1, POSIX_Keys_Key_value_pair, Key_value_lookup_node ); n2 = _RBTree_Container_of( node2, POSIX_Keys_Key_value_pair, Key_value_lookup_node ); diff = n1->key - n2->key; 4000c774: c4 02 60 10 ld [ %o1 + 0x10 ], %g2 POSIX_Keys_Key_value_pair *n1; POSIX_Keys_Key_value_pair *n2; Objects_Id thread_id1, thread_id2; int diff; n1 = _RBTree_Container_of( node1, POSIX_Keys_Key_value_pair, Key_value_lookup_node ); 4000c778: 82 02 3f f8 add %o0, -8, %g1 n2 = _RBTree_Container_of( node2, POSIX_Keys_Key_value_pair, Key_value_lookup_node ); diff = n1->key - n2->key; 4000c77c: d0 02 20 10 ld [ %o0 + 0x10 ], %o0 if ( diff ) 4000c780: 90 a2 00 02 subcc %o0, %g2, %o0 4000c784: 12 80 00 0c bne 4000c7b4 <_POSIX_Keys_Key_value_lookup_tree_compare_function+0x40> 4000c788: 92 02 7f f8 add %o1, -8, %o1 return diff; thread_id1 = n1->thread_id; 4000c78c: d0 00 60 1c ld [ %g1 + 0x1c ], %o0 thread_id2 = n2->thread_id; 4000c790: c2 02 60 1c ld [ %o1 + 0x1c ], %g1 /** * if thread_id1 or thread_id2 equals to 0, only key1 and key2 is valued. * it enables us search node only by pthread_key_t type key. */ if ( thread_id1 && thread_id2 ) 4000c794: 80 a0 60 00 cmp %g1, 0 4000c798: 02 80 00 06 be 4000c7b0 <_POSIX_Keys_Key_value_lookup_tree_compare_function+0x3c><== NEVER TAKEN 4000c79c: 80 a2 20 00 cmp %o0, 0 4000c7a0: 22 80 00 05 be,a 4000c7b4 <_POSIX_Keys_Key_value_lookup_tree_compare_function+0x40> 4000c7a4: 90 10 20 00 clr %o0 return thread_id1 - thread_id2; 4000c7a8: 81 c3 e0 08 retl 4000c7ac: 90 22 00 01 sub %o0, %g1, %o0 return 0; 4000c7b0: 90 10 20 00 clr %o0 <== NOT EXECUTED } 4000c7b4: 81 c3 e0 08 retl =============================================================================== 4000c7bc <_POSIX_Keys_Keypool_extend>: return _Objects_Maximum_per_allocation( max ); } static bool _POSIX_Keys_Keypool_extend( Freechain_Control *keypool ) { 4000c7bc: 9d e3 bf a0 save %sp, -96, %sp return 0; } static uint32_t _POSIX_Keys_Get_keypool_bump_count( void ) { uint32_t max = Configuration.maximum_key_value_pairs; 4000c7c0: 03 10 00 55 sethi %hi(0x40015400), %g1 4000c7c4: c2 00 61 98 ld [ %g1 + 0x198 ], %g1 ! 40015598 return _Objects_Is_unlimited( max ) ? 4000c7c8: 80 a0 60 00 cmp %g1, 0 4000c7cc: 36 80 00 14 bge,a 4000c81c <_POSIX_Keys_Keypool_extend+0x60><== NEVER TAKEN 4000c7d0: b0 10 20 00 clr %i0 <== NOT EXECUTED 4000c7d4: 3b 00 00 3f sethi %hi(0xfc00), %i5 4000c7d8: ba 17 63 ff or %i5, 0x3ff, %i5 ! ffff <_TLS_Alignment+0xfffe> static bool _POSIX_Keys_Keypool_extend( Freechain_Control *keypool ) { size_t bump_count = _POSIX_Keys_Get_keypool_bump_count(); bool ok = bump_count > 0; if ( ok ) { 4000c7dc: ba 88 40 1d andcc %g1, %i5, %i5 4000c7e0: 12 80 00 04 bne 4000c7f0 <_POSIX_Keys_Keypool_extend+0x34><== ALWAYS TAKEN 4000c7e4: 83 2f 60 05 sll %i5, 5, %g1 return _Objects_Maximum_per_allocation( max ); } static bool _POSIX_Keys_Keypool_extend( Freechain_Control *keypool ) { 4000c7e8: 10 80 00 0d b 4000c81c <_POSIX_Keys_Keypool_extend+0x60> <== NOT EXECUTED 4000c7ec: b0 10 20 00 clr %i0 <== NOT EXECUTED size_t bump_count = _POSIX_Keys_Get_keypool_bump_count(); bool ok = bump_count > 0; if ( ok ) { size_t size = bump_count * sizeof( POSIX_Keys_Key_value_pair ); 4000c7f0: 91 2f 60 02 sll %i5, 2, %o0 POSIX_Keys_Key_value_pair *nodes = _Workspace_Allocate( size ); 4000c7f4: 7f ff fa e1 call 4000b378 <_Workspace_Allocate> 4000c7f8: 90 02 00 01 add %o0, %g1, %o0 ok = nodes != NULL; if ( ok ) { 4000c7fc: 92 92 20 00 orcc %o0, 0, %o1 4000c800: 22 80 00 07 be,a 4000c81c <_POSIX_Keys_Keypool_extend+0x60><== NEVER TAKEN 4000c804: b0 10 20 00 clr %i0 <== NOT EXECUTED _Chain_Initialize( 4000c808: 90 10 00 18 mov %i0, %o0 4000c80c: 94 10 00 1d mov %i5, %o2 4000c810: 96 10 20 24 mov 0x24, %o3 4000c814: 7f ff ee 3d call 40008108 <_Chain_Initialize> 4000c818: b0 10 20 01 mov 1, %i0 ); } } return ok; } 4000c81c: b0 0e 20 01 and %i0, 1, %i0 4000c820: 81 c7 e0 08 ret 4000c824: 81 e8 00 00 restore =============================================================================== 4000c9c8 <_POSIX_Message_queue_Receive_support>: size_t msg_len, unsigned int *msg_prio, bool wait, Watchdog_Interval timeout ) { 4000c9c8: 9d e3 bf 90 save %sp, -112, %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( 4000c9cc: 11 10 00 a8 sethi %hi(0x4002a000), %o0 4000c9d0: 92 10 00 18 mov %i0, %o1 4000c9d4: 90 12 23 40 or %o0, 0x340, %o0 4000c9d8: 40 00 0c c8 call 4000fcf8 <_Objects_Get> 4000c9dc: 94 07 bf f8 add %fp, -8, %o2 size_t length_out; bool do_wait; Thread_Control *executing; the_mq_fd = _POSIX_Message_queue_Get_fd( mqdes, &location ); switch ( location ) { 4000c9e0: c2 07 bf f8 ld [ %fp + -8 ], %g1 4000c9e4: 80 a0 60 00 cmp %g1, 0 4000c9e8: 12 80 00 3c bne 4000cad8 <_POSIX_Message_queue_Receive_support+0x110> 4000c9ec: 01 00 00 00 nop case OBJECTS_LOCAL: if ( (the_mq_fd->oflag & O_ACCMODE) == O_WRONLY ) { 4000c9f0: c2 02 20 14 ld [ %o0 + 0x14 ], %g1 4000c9f4: 84 08 60 03 and %g1, 3, %g2 4000c9f8: 80 a0 a0 01 cmp %g2, 1 4000c9fc: 32 80 00 05 bne,a 4000ca10 <_POSIX_Message_queue_Receive_support+0x48> 4000ca00: d0 02 20 10 ld [ %o0 + 0x10 ], %o0 RTEMS_INLINE_ROUTINE void _Objects_Put( Objects_Control *the_object ) { (void) the_object; _Thread_Enable_dispatch(); 4000ca04: 40 00 10 33 call 40010ad0 <_Thread_Enable_dispatch> 4000ca08: 01 00 00 00 nop 4000ca0c: 30 80 00 33 b,a 4000cad8 <_POSIX_Message_queue_Receive_support+0x110> rtems_set_errno_and_return_minus_one( EBADF ); } the_mq = the_mq_fd->Queue; if ( msg_len < the_mq->Message_queue.maximum_message_size ) { 4000ca10: c4 02 20 68 ld [ %o0 + 0x68 ], %g2 4000ca14: 80 a6 80 02 cmp %i2, %g2 4000ca18: 1a 80 00 08 bcc 4000ca38 <_POSIX_Message_queue_Receive_support+0x70> 4000ca1c: 84 10 3f ff mov -1, %g2 4000ca20: 40 00 10 2c call 40010ad0 <_Thread_Enable_dispatch> 4000ca24: 01 00 00 00 nop _Objects_Put( &the_mq_fd->Object ); rtems_set_errno_and_return_minus_one( EMSGSIZE ); 4000ca28: 40 00 29 30 call 40016ee8 <__errno> 4000ca2c: 01 00 00 00 nop 4000ca30: 10 80 00 2d b 4000cae4 <_POSIX_Message_queue_Receive_support+0x11c> 4000ca34: 82 10 20 7a mov 0x7a, %g1 ! 7a <_TLS_Alignment+0x79> length_out = -1; /* * A timed receive with a bad time will do a poll regardless. */ if ( wait ) 4000ca38: 80 a7 20 00 cmp %i4, 0 4000ca3c: 02 80 00 05 be 4000ca50 <_POSIX_Message_queue_Receive_support+0x88> 4000ca40: c4 27 bf fc st %g2, [ %fp + -4 ] do_wait = (the_mq_fd->oflag & O_NONBLOCK) ? false : true; 4000ca44: b9 30 60 0e srl %g1, 0xe, %i4 4000ca48: b8 1f 20 01 xor %i4, 1, %i4 4000ca4c: b8 0f 20 01 and %i4, 1, %i4 do_wait = wait; /* * Now perform the actual message receive */ executing = _Thread_Executing; 4000ca50: f4 01 a0 18 ld [ %g6 + 0x18 ], %i2 _CORE_message_queue_Seize( 4000ca54: 90 02 20 1c add %o0, 0x1c, %o0 4000ca58: 92 10 00 1a mov %i2, %o1 4000ca5c: 94 10 00 18 mov %i0, %o2 4000ca60: 96 10 00 19 mov %i1, %o3 4000ca64: 98 07 bf fc add %fp, -4, %o4 4000ca68: 9a 10 00 1c mov %i4, %o5 4000ca6c: 40 00 08 4e call 4000eba4 <_CORE_message_queue_Seize> 4000ca70: fa 23 a0 5c st %i5, [ %sp + 0x5c ] 4000ca74: 40 00 10 17 call 40010ad0 <_Thread_Enable_dispatch> 4000ca78: 01 00 00 00 nop do_wait, timeout ); _Objects_Put( &the_mq_fd->Object ); if (msg_prio) { 4000ca7c: 80 a6 e0 00 cmp %i3, 0 4000ca80: 22 80 00 08 be,a 4000caa0 <_POSIX_Message_queue_Receive_support+0xd8><== NEVER TAKEN 4000ca84: c2 06 a0 34 ld [ %i2 + 0x34 ], %g1 <== NOT EXECUTED 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); 4000ca88: c4 06 a0 24 ld [ %i2 + 0x24 ], %g2 4000ca8c: 83 38 a0 1f sra %g2, 0x1f, %g1 4000ca90: 84 18 40 02 xor %g1, %g2, %g2 4000ca94: 82 20 80 01 sub %g2, %g1, %g1 *msg_prio = _POSIX_Message_queue_Priority_from_core( 4000ca98: c2 26 c0 00 st %g1, [ %i3 ] executing->Wait.count ); } if ( !executing->Wait.return_code ) 4000ca9c: c2 06 a0 34 ld [ %i2 + 0x34 ], %g1 4000caa0: 80 a0 60 00 cmp %g1, 0 4000caa4: 12 80 00 05 bne 4000cab8 <_POSIX_Message_queue_Receive_support+0xf0> 4000caa8: 01 00 00 00 nop return length_out; 4000caac: f0 07 bf fc ld [ %fp + -4 ], %i0 4000cab0: 81 c7 e0 08 ret 4000cab4: 81 e8 00 00 restore rtems_set_errno_and_return_minus_one( 4000cab8: 40 00 29 0c call 40016ee8 <__errno> 4000cabc: b0 10 3f ff mov -1, %i0 4000cac0: ba 10 00 08 mov %o0, %i5 4000cac4: 40 00 00 94 call 4000cd14 <_POSIX_Message_queue_Translate_core_message_queue_return_code> 4000cac8: d0 06 a0 34 ld [ %i2 + 0x34 ], %o0 4000cacc: d0 27 40 00 st %o0, [ %i5 ] 4000cad0: 81 c7 e0 08 ret 4000cad4: 81 e8 00 00 restore #endif case OBJECTS_ERROR: break; } rtems_set_errno_and_return_minus_one( EBADF ); 4000cad8: 40 00 29 04 call 40016ee8 <__errno> 4000cadc: 01 00 00 00 nop 4000cae0: 82 10 20 09 mov 9, %g1 ! 9 <_TLS_Alignment+0x8> 4000cae4: c2 22 00 00 st %g1, [ %o0 ] 4000cae8: b0 10 3f ff mov -1, %i0 } 4000caec: 81 c7 e0 08 ret 4000caf0: 81 e8 00 00 restore =============================================================================== 4000f6fc <_POSIX_Semaphore_Create_support>: size_t name_len, int pshared, unsigned int value, POSIX_Semaphore_Control **the_sem ) { 4000f6fc: 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) 4000f700: 80 a6 a0 00 cmp %i2, 0 4000f704: 22 80 00 06 be,a 4000f71c <_POSIX_Semaphore_Create_support+0x20> 4000f708: 21 10 00 78 sethi %hi(0x4001e000), %l0 rtems_set_errno_and_return_minus_one( ENOSYS ); 4000f70c: 40 00 0a c3 call 40012218 <__errno> 4000f710: 01 00 00 00 nop 4000f714: 10 80 00 0b b 4000f740 <_POSIX_Semaphore_Create_support+0x44> 4000f718: 82 10 20 58 mov 0x58, %g1 ! 58 <_TLS_Alignment+0x57> void _POSIX_Semaphore_Manager_initialization(void); RTEMS_INLINE_ROUTINE POSIX_Semaphore_Control * _POSIX_Semaphore_Allocate_unprotected( void ) { return (POSIX_Semaphore_Control *) 4000f71c: 90 14 22 e4 or %l0, 0x2e4, %o0 4000f720: 7f ff ee 77 call 4000b0fc <_Objects_Allocate_unprotected> 4000f724: a2 10 00 10 mov %l0, %l1 the_semaphore = _POSIX_Semaphore_Allocate_unprotected(); if ( !the_semaphore ) { 4000f728: ba 92 20 00 orcc %o0, 0, %i5 4000f72c: 12 80 00 08 bne 4000f74c <_POSIX_Semaphore_Create_support+0x50> 4000f730: 80 a6 20 00 cmp %i0, 0 rtems_set_errno_and_return_minus_one( ENOSPC ); 4000f734: 40 00 0a b9 call 40012218 <__errno> 4000f738: 01 00 00 00 nop 4000f73c: 82 10 20 1c mov 0x1c, %g1 ! 1c <_TLS_Alignment+0x1b> 4000f740: c2 22 00 00 st %g1, [ %o0 ] 4000f744: 81 c7 e0 08 ret 4000f748: 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 ) { 4000f74c: 02 80 00 0e be 4000f784 <_POSIX_Semaphore_Create_support+0x88> 4000f750: 90 10 00 18 mov %i0, %o0 name = _Workspace_String_duplicate( name_arg, name_len ); 4000f754: 40 00 03 1f call 400103d0 <_Workspace_String_duplicate> 4000f758: 92 10 00 19 mov %i1, %o1 if ( !name ) { 4000f75c: b4 92 20 00 orcc %o0, 0, %i2 4000f760: 12 80 00 0b bne 4000f78c <_POSIX_Semaphore_Create_support+0x90><== ALWAYS TAKEN 4000f764: 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 ); 4000f768: 90 14 22 e4 or %l0, 0x2e4, %o0 <== NOT EXECUTED 4000f76c: 7f ff ef 5f call 4000b4e8 <_Objects_Free> <== NOT EXECUTED 4000f770: 92 10 00 1d mov %i5, %o1 <== NOT EXECUTED _POSIX_Semaphore_Free( the_semaphore ); rtems_set_errno_and_return_minus_one( ENOMEM ); 4000f774: 40 00 0a a9 call 40012218 <__errno> <== NOT EXECUTED 4000f778: 01 00 00 00 nop <== NOT EXECUTED 4000f77c: 10 bf ff f1 b 4000f740 <_POSIX_Semaphore_Create_support+0x44><== NOT EXECUTED 4000f780: 82 10 20 0c mov 0xc, %g1 ! c <_TLS_Alignment+0xb> <== NOT EXECUTED } } else { name = NULL; 4000f784: b4 10 20 00 clr %i2 } the_semaphore->process_shared = pshared; if ( name ) { 4000f788: 80 a6 a0 00 cmp %i2, 0 4000f78c: 02 80 00 08 be 4000f7ac <_POSIX_Semaphore_Create_support+0xb0> 4000f790: c0 27 60 10 clr [ %i5 + 0x10 ] the_semaphore->named = true; 4000f794: 82 10 20 01 mov 1, %g1 4000f798: c2 2f 60 14 stb %g1, [ %i5 + 0x14 ] the_semaphore->open_count = 1; 4000f79c: 82 10 20 01 mov 1, %g1 4000f7a0: c2 27 60 18 st %g1, [ %i5 + 0x18 ] 4000f7a4: 10 80 00 05 b 4000f7b8 <_POSIX_Semaphore_Create_support+0xbc> 4000f7a8: c2 2f 60 15 stb %g1, [ %i5 + 0x15 ] the_semaphore->linked = true; } else { the_semaphore->named = false; 4000f7ac: c0 2f 60 14 clrb [ %i5 + 0x14 ] the_semaphore->open_count = 0; 4000f7b0: c0 27 60 18 clr [ %i5 + 0x18 ] the_semaphore->linked = false; 4000f7b4: 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; 4000f7b8: 82 10 3f ff mov -1, %g1 * blocking tasks on this semaphore should be. It could somehow * be derived from the current scheduling policy. One * thing is certain, no matter what we decide, it won't be * the same as all other POSIX implementations. :) */ the_sem_attr->discipline = CORE_SEMAPHORE_DISCIPLINES_FIFO; 4000f7bc: c0 27 60 60 clr [ %i5 + 0x60 ] /* * This effectively disables limit checking. */ the_sem_attr->maximum_count = 0xFFFFFFFF; 4000f7c0: c2 27 60 5c st %g1, [ %i5 + 0x5c ] _CORE_semaphore_Initialize( &the_semaphore->Semaphore, the_sem_attr, value ); 4000f7c4: 90 07 60 1c add %i5, 0x1c, %o0 4000f7c8: 92 07 60 5c add %i5, 0x5c, %o1 4000f7cc: 7f ff ec 6f call 4000a988 <_CORE_semaphore_Initialize> 4000f7d0: 94 10 00 1b mov %i3, %o2 #if defined(RTEMS_SCORE_OBJECT_ENABLE_STRING_NAMES) /* ASSERT: information->is_string */ the_object->name.name_p = name; #endif _Objects_Set_local_object( 4000f7d4: c2 17 60 0a lduh [ %i5 + 0xa ], %g1 const char *name ) { #if defined(RTEMS_SCORE_OBJECT_ENABLE_STRING_NAMES) /* ASSERT: information->is_string */ the_object->name.name_p = name; 4000f7d8: f4 27 60 0c st %i2, [ %i5 + 0xc ] * @param[in] information points to an Object Information Table * @param[in] the_object is a pointer to an object * @param[in] name is the name of the object to make accessible */ RTEMS_INLINE_ROUTINE void _Objects_Open_string( Objects_Information *information, 4000f7dc: a2 14 62 e4 or %l1, 0x2e4, %l1 #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 4000f7e0: c4 04 60 1c ld [ %l1 + 0x1c ], %g2 4000f7e4: 83 28 60 02 sll %g1, 2, %g1 4000f7e8: fa 20 80 01 st %i5, [ %g2 + %g1 ] &_POSIX_Semaphore_Information, &the_semaphore->Object, name ); *the_sem = the_semaphore; 4000f7ec: fa 27 00 00 st %i5, [ %i4 ] return 0; } 4000f7f0: 81 c7 e0 08 ret 4000f7f4: 91 e8 20 00 restore %g0, 0, %o0 =============================================================================== 4000c7b8 <_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 ]; 4000c7b8: c2 02 21 30 ld [ %o0 + 0x130 ], %g1 if ( thread_support->cancelability_state == PTHREAD_CANCEL_ENABLE && 4000c7bc: c4 00 60 f0 ld [ %g1 + 0xf0 ], %g2 4000c7c0: 80 a0 a0 00 cmp %g2, 0 4000c7c4: 12 80 00 11 bne 4000c808 <_POSIX_Thread_Evaluate_cancellation_and_enable_dispatch+0x50><== NEVER TAKEN 4000c7c8: 01 00 00 00 nop 4000c7cc: c4 00 60 f4 ld [ %g1 + 0xf4 ], %g2 4000c7d0: 80 a0 a0 01 cmp %g2, 1 4000c7d4: 12 80 00 0d bne 4000c808 <_POSIX_Thread_Evaluate_cancellation_and_enable_dispatch+0x50> 4000c7d8: 01 00 00 00 nop thread_support->cancelability_type == PTHREAD_CANCEL_ASYNCHRONOUS && 4000c7dc: c2 00 60 f8 ld [ %g1 + 0xf8 ], %g1 4000c7e0: 80 a0 60 00 cmp %g1, 0 4000c7e4: 02 80 00 09 be 4000c808 <_POSIX_Thread_Evaluate_cancellation_and_enable_dispatch+0x50> 4000c7e8: 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 disable_level = _Thread_Dispatch_disable_level; 4000c7ec: c4 01 a0 10 ld [ %g6 + 0x10 ], %g2 thread_support->cancelation_requested ) { /* FIXME: This path is broken on SMP */ _Thread_Unnest_dispatch(); /* FIXME: Cancelability state may change here */ _POSIX_Thread_Exit( the_thread, PTHREAD_CANCELED ); 4000c7f0: 92 10 3f ff mov -1, %o1 ISR_Level level; _ISR_Disable( level ); #endif --disable_level; 4000c7f4: 84 00 bf ff add %g2, -1, %g2 _Thread_Dispatch_disable_level = disable_level; 4000c7f8: c4 21 a0 10 st %g2, [ %g6 + 0x10 ] 4000c7fc: 82 13 c0 00 mov %o7, %g1 4000c800: 40 00 01 f5 call 4000cfd4 <_POSIX_Thread_Exit> 4000c804: 9e 10 40 00 mov %g1, %o7 4000c808: 82 13 c0 00 mov %o7, %g1 4000c80c: 7f ff f5 a2 call 40009e94 <_Thread_Enable_dispatch> 4000c810: 9e 10 40 00 mov %g1, %o7 =============================================================================== 4000d958 <_POSIX_Thread_Translate_sched_param>: int policy, struct sched_param *param, Thread_CPU_budget_algorithms *budget_algorithm, Thread_CPU_budget_algorithm_callout *budget_callout ) { 4000d958: 9d e3 bf a0 save %sp, -96, %sp if ( !_POSIX_Priority_Is_valid( param->sched_priority ) ) 4000d95c: 7f ff ff f4 call 4000d92c <_POSIX_Priority_Is_valid> 4000d960: d0 06 40 00 ld [ %i1 ], %o0 4000d964: 80 a2 20 00 cmp %o0, 0 4000d968: 32 80 00 04 bne,a 4000d978 <_POSIX_Thread_Translate_sched_param+0x20><== ALWAYS TAKEN 4000d96c: c0 26 80 00 clr [ %i2 ] return EINVAL; 4000d970: 81 c7 e0 08 ret 4000d974: 91 e8 20 16 restore %g0, 0x16, %o0 *budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_NONE; *budget_callout = NULL; if ( policy == SCHED_OTHER ) { 4000d978: 80 a6 20 00 cmp %i0, 0 4000d97c: 12 80 00 06 bne 4000d994 <_POSIX_Thread_Translate_sched_param+0x3c> 4000d980: c0 26 c0 00 clr [ %i3 ] *budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE; 4000d984: 82 10 20 01 mov 1, %g1 4000d988: c2 26 80 00 st %g1, [ %i2 ] return 0; 4000d98c: 81 c7 e0 08 ret 4000d990: 81 e8 00 00 restore } if ( policy == SCHED_FIFO ) { 4000d994: 80 a6 20 01 cmp %i0, 1 4000d998: 02 80 00 29 be 4000da3c <_POSIX_Thread_Translate_sched_param+0xe4> 4000d99c: 80 a6 20 02 cmp %i0, 2 *budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_NONE; return 0; } if ( policy == SCHED_RR ) { 4000d9a0: 12 80 00 04 bne 4000d9b0 <_POSIX_Thread_Translate_sched_param+0x58> 4000d9a4: 80 a6 20 04 cmp %i0, 4 *budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_EXHAUST_TIMESLICE; 4000d9a8: 10 80 00 25 b 4000da3c <_POSIX_Thread_Translate_sched_param+0xe4> 4000d9ac: f0 26 80 00 st %i0, [ %i2 ] return 0; } if ( policy == SCHED_SPORADIC ) { 4000d9b0: 12 bf ff f0 bne 4000d970 <_POSIX_Thread_Translate_sched_param+0x18> 4000d9b4: 01 00 00 00 nop if ( (param->sched_ss_repl_period.tv_sec == 0) && 4000d9b8: c2 06 60 08 ld [ %i1 + 8 ], %g1 4000d9bc: 80 a0 60 00 cmp %g1, 0 4000d9c0: 32 80 00 07 bne,a 4000d9dc <_POSIX_Thread_Translate_sched_param+0x84> 4000d9c4: c2 06 60 10 ld [ %i1 + 0x10 ], %g1 4000d9c8: c2 06 60 0c ld [ %i1 + 0xc ], %g1 4000d9cc: 80 a0 60 00 cmp %g1, 0 4000d9d0: 02 bf ff e8 be 4000d970 <_POSIX_Thread_Translate_sched_param+0x18> 4000d9d4: 01 00 00 00 nop (param->sched_ss_repl_period.tv_nsec == 0) ) return EINVAL; if ( (param->sched_ss_init_budget.tv_sec == 0) && 4000d9d8: c2 06 60 10 ld [ %i1 + 0x10 ], %g1 4000d9dc: 80 a0 60 00 cmp %g1, 0 4000d9e0: 12 80 00 06 bne 4000d9f8 <_POSIX_Thread_Translate_sched_param+0xa0> 4000d9e4: 01 00 00 00 nop 4000d9e8: c2 06 60 14 ld [ %i1 + 0x14 ], %g1 4000d9ec: 80 a0 60 00 cmp %g1, 0 4000d9f0: 02 bf ff e0 be 4000d970 <_POSIX_Thread_Translate_sched_param+0x18> 4000d9f4: 01 00 00 00 nop (param->sched_ss_init_budget.tv_nsec == 0) ) return EINVAL; if ( _Timespec_To_ticks( ¶m->sched_ss_repl_period ) < 4000d9f8: 7f ff f7 c8 call 4000b918 <_Timespec_To_ticks> 4000d9fc: 90 06 60 08 add %i1, 8, %o0 4000da00: ba 10 00 08 mov %o0, %i5 _Timespec_To_ticks( ¶m->sched_ss_init_budget ) ) 4000da04: 7f ff f7 c5 call 4000b918 <_Timespec_To_ticks> 4000da08: 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 ) < 4000da0c: 80 a7 40 08 cmp %i5, %o0 4000da10: 0a bf ff d8 bcs 4000d970 <_POSIX_Thread_Translate_sched_param+0x18> 4000da14: 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 ) ) 4000da18: 7f ff ff c5 call 4000d92c <_POSIX_Priority_Is_valid> 4000da1c: d0 06 60 04 ld [ %i1 + 4 ], %o0 4000da20: 80 a2 20 00 cmp %o0, 0 4000da24: 02 bf ff d3 be 4000d970 <_POSIX_Thread_Translate_sched_param+0x18> 4000da28: 82 10 20 03 mov 3, %g1 return EINVAL; *budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_CALLOUT; 4000da2c: c2 26 80 00 st %g1, [ %i2 ] *budget_callout = _POSIX_Threads_Sporadic_budget_callout; 4000da30: 03 10 00 1e sethi %hi(0x40007800), %g1 4000da34: 82 10 62 d0 or %g1, 0x2d0, %g1 ! 40007ad0 <_POSIX_Threads_Sporadic_budget_callout> 4000da38: c2 26 c0 00 st %g1, [ %i3 ] return 0; } return EINVAL; } 4000da3c: 81 c7 e0 08 ret 4000da40: 91 e8 20 00 restore %g0, 0, %o0 =============================================================================== 40007840 <_POSIX_Threads_Initialize_user_threads_body>: #include #include #include void _POSIX_Threads_Initialize_user_threads_body(void) { 40007840: 9d e3 bf 50 save %sp, -176, %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; 40007844: 03 10 00 7c sethi %hi(0x4001f000), %g1 40007848: 82 10 61 1c or %g1, 0x11c, %g1 ! 4001f11c maximum = Configuration_POSIX_API.number_of_initialization_threads; 4000784c: f6 00 60 2c ld [ %g1 + 0x2c ], %i3 if ( !user_threads || maximum == 0 ) 40007850: 80 a6 e0 00 cmp %i3, 0 40007854: 02 80 00 1b be 400078c0 <_POSIX_Threads_Initialize_user_threads_body+0x80><== NEVER TAKEN 40007858: fa 00 60 30 ld [ %g1 + 0x30 ], %i5 4000785c: 80 a7 60 00 cmp %i5, 0 40007860: 02 80 00 18 be 400078c0 <_POSIX_Threads_Initialize_user_threads_body+0x80><== NEVER TAKEN 40007864: b8 10 20 00 clr %i4 for ( index=0 ; index < maximum ; index++ ) { /* * There is no way for these calls to fail in this situation. */ eno = pthread_attr_init( &attr ); 40007868: 40 00 18 77 call 4000da44 4000786c: 90 07 bf b4 add %fp, -76, %o0 _Assert( eno == 0 ); eno = pthread_attr_setinheritsched( &attr, PTHREAD_EXPLICIT_SCHED ); 40007870: 92 10 20 02 mov 2, %o1 40007874: 40 00 18 80 call 4000da74 40007878: 90 07 bf b4 add %fp, -76, %o0 _Assert( eno == 0 ); eno = pthread_attr_setstacksize(&attr, user_threads[ index ].stack_size); 4000787c: d2 07 60 04 ld [ %i5 + 4 ], %o1 40007880: 40 00 18 8c call 4000dab0 40007884: 90 07 bf b4 add %fp, -76, %o0 _Assert( eno == 0 ); eno = pthread_create( 40007888: d4 07 40 00 ld [ %i5 ], %o2 4000788c: 92 07 bf b4 add %fp, -76, %o1 40007890: 90 07 bf b0 add %fp, -80, %o0 40007894: 7f ff ff 1f call 40007510 40007898: 96 10 20 00 clr %o3 &thread_id, &attr, user_threads[ index ].thread_entry, NULL ); if ( eno ) 4000789c: 92 92 20 00 orcc %o0, 0, %o1 400078a0: 22 80 00 05 be,a 400078b4 <_POSIX_Threads_Initialize_user_threads_body+0x74> 400078a4: b8 07 20 01 inc %i4 _POSIX_Fatal_error( POSIX_FD_PTHREAD, eno ); 400078a8: 40 00 04 5f call 40008a24 <_POSIX_Fatal_error> 400078ac: 90 10 20 00 clr %o0 * * Setting the attributes explicitly is critical, since we don't want * to inherit the idle tasks attributes. */ for ( index=0 ; index < maximum ; index++ ) { 400078b0: b8 07 20 01 inc %i4 <== NOT EXECUTED 400078b4: 80 a7 00 1b cmp %i4, %i3 400078b8: 12 bf ff ec bne 40007868 <_POSIX_Threads_Initialize_user_threads_body+0x28><== NEVER TAKEN 400078bc: ba 07 60 08 add %i5, 8, %i5 400078c0: 81 c7 e0 08 ret 400078c4: 81 e8 00 00 restore =============================================================================== 4000cc10 <_POSIX_Threads_Sporadic_budget_TSR>: */ void _POSIX_Threads_Sporadic_budget_TSR( Objects_Id id __attribute__((unused)), void *argument ) { 4000cc10: 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 ]; 4000cc14: fa 06 61 30 ld [ %i1 + 0x130 ], %i5 /* ticks is guaranteed to be at least one */ ticks = _Timespec_To_ticks( &api->schedparam.sched_ss_init_budget ); 4000cc18: 40 00 03 8c call 4000da48 <_Timespec_To_ticks> 4000cc1c: 90 07 60 a4 add %i5, 0xa4, %o0 */ RTEMS_INLINE_ROUTINE Priority_Control _POSIX_Priority_To_core( int priority ) { return (Priority_Control) (POSIX_SCHEDULER_MAXIMUM_PRIORITY - priority + 1); 4000cc20: 03 10 00 5a sethi %hi(0x40016800), %g1 4000cc24: d2 08 62 a4 ldub [ %g1 + 0x2a4 ], %o1 ! 40016aa4 4000cc28: c2 07 60 94 ld [ %i5 + 0x94 ], %g1 the_thread->cpu_time_budget = ticks; 4000cc2c: d0 26 60 74 st %o0, [ %i1 + 0x74 ] 4000cc30: 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 ( !_Thread_Owns_resources( the_thread ) ) { 4000cc34: c2 06 60 1c ld [ %i1 + 0x1c ], %g1 4000cc38: 80 a0 60 00 cmp %g1, 0 4000cc3c: 12 80 00 09 bne 4000cc60 <_POSIX_Threads_Sporadic_budget_TSR+0x50><== NEVER TAKEN 4000cc40: 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 ) { 4000cc44: c2 06 60 14 ld [ %i1 + 0x14 ], %g1 4000cc48: 80 a0 40 09 cmp %g1, %o1 4000cc4c: 08 80 00 06 bleu 4000cc64 <_POSIX_Threads_Sporadic_budget_TSR+0x54> 4000cc50: 90 07 60 9c add %i5, 0x9c, %o0 _Thread_Change_priority( the_thread, new_priority, true ); 4000cc54: 90 10 00 19 mov %i1, %o0 4000cc58: 7f ff f3 83 call 40009a64 <_Thread_Change_priority> 4000cc5c: 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 ); 4000cc60: 90 07 60 9c add %i5, 0x9c, %o0 4000cc64: 40 00 03 79 call 4000da48 <_Timespec_To_ticks> 4000cc68: 31 10 00 61 sethi %hi(0x40018400), %i0 ) { the_watchdog->initial = units; _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 4000cc6c: b0 16 20 b0 or %i0, 0xb0, %i0 ! 400184b0 <_Watchdog_Ticks_chain> Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 4000cc70: d0 27 60 c0 st %o0, [ %i5 + 0xc0 ] _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 4000cc74: 7f ff f8 b4 call 4000af44 <_Watchdog_Insert> 4000cc78: 93 ef 60 b4 restore %i5, 0xb4, %o1 =============================================================================== 40007ad0 <_POSIX_Threads_Sporadic_budget_callout>: ) { POSIX_API_Control *api; uint32_t new_priority; api = the_thread->API_Extensions[ THREAD_API_POSIX ]; 40007ad0: c4 02 21 30 ld [ %o0 + 0x130 ], %g2 /* * This will prevent the thread from consuming its entire "budget" * while at low priority. */ the_thread->cpu_time_budget = UINT32_MAX; 40007ad4: 86 10 3f ff mov -1, %g3 */ RTEMS_INLINE_ROUTINE Priority_Control _POSIX_Priority_To_core( int priority ) { return (Priority_Control) (POSIX_SCHEDULER_MAXIMUM_PRIORITY - priority + 1); 40007ad8: c4 00 a0 98 ld [ %g2 + 0x98 ], %g2 40007adc: c6 22 20 74 st %g3, [ %o0 + 0x74 ] 40007ae0: 07 10 00 7c sethi %hi(0x4001f000), %g3 40007ae4: d2 08 e1 14 ldub [ %g3 + 0x114 ], %o1 ! 4001f114 40007ae8: 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 ( !_Thread_Owns_resources( the_thread ) ) { 40007aec: c4 02 20 1c ld [ %o0 + 0x1c ], %g2 40007af0: 80 a0 a0 00 cmp %g2, 0 40007af4: 12 80 00 09 bne 40007b18 <_POSIX_Threads_Sporadic_budget_callout+0x48><== NEVER TAKEN 40007af8: 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 ) { 40007afc: c2 02 20 14 ld [ %o0 + 0x14 ], %g1 40007b00: 80 a0 40 09 cmp %g1, %o1 40007b04: 1a 80 00 05 bcc 40007b18 <_POSIX_Threads_Sporadic_budget_callout+0x48><== NEVER TAKEN 40007b08: 94 10 20 01 mov 1, %o2 _Thread_Change_priority( the_thread, new_priority, true ); 40007b0c: 82 13 c0 00 mov %o7, %g1 40007b10: 40 00 0a c8 call 4000a630 <_Thread_Change_priority> 40007b14: 9e 10 40 00 mov %g1, %o7 40007b18: 81 c3 e0 08 retl <== NOT EXECUTED =============================================================================== 4000cc8c <_POSIX_Threads_Terminate_extension>: } static void _POSIX_Threads_Terminate_extension( Thread_Control *executing ) { 4000cc8c: 9d e3 bf a0 save %sp, -96, %sp Thread_Control *the_thread; POSIX_API_Control *api; void **value_ptr; api = executing->API_Extensions[ THREAD_API_POSIX ]; 4000cc90: fa 06 21 30 ld [ %i0 + 0x130 ], %i5 /* * Run the POSIX cancellation handlers */ _POSIX_Threads_cancel_run( executing ); 4000cc94: 40 00 07 c0 call 4000eb94 <_POSIX_Threads_cancel_run> 4000cc98: 90 10 00 18 mov %i0, %o0 * * This rountine increments the thread dispatch level */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_increment_disable_level(void) { uint32_t disable_level = _Thread_Dispatch_disable_level; 4000cc9c: c4 01 a0 10 ld [ %g6 + 0x10 ], %g2 _ISR_Disable( level ); _Profiling_Thread_dispatch_disable( _Per_CPU_Get(), disable_level ); #endif ++disable_level; 4000cca0: 84 00 a0 01 inc %g2 _Thread_Dispatch_disable_level = disable_level; 4000cca4: c4 21 a0 10 st %g2, [ %g6 + 0x10 ] _Thread_Disable_dispatch(); /* * Wakeup all the tasks which joined with this one */ value_ptr = (void **) executing->Wait.return_argument; 4000cca8: f6 06 20 28 ld [ %i0 + 0x28 ], %i3 while ( (the_thread = _Thread_queue_Dequeue( &api->Join_List )) ) 4000ccac: b8 07 60 50 add %i5, 0x50, %i4 4000ccb0: 7f ff f5 3b call 4000a19c <_Thread_queue_Dequeue> 4000ccb4: 90 10 00 1c mov %i4, %o0 4000ccb8: 80 a2 20 00 cmp %o0, 0 4000ccbc: 22 80 00 05 be,a 4000ccd0 <_POSIX_Threads_Terminate_extension+0x44><== ALWAYS TAKEN 4000ccc0: c2 07 60 90 ld [ %i5 + 0x90 ], %g1 *(void **)the_thread->Wait.return_argument = value_ptr; 4000ccc4: c2 02 20 28 ld [ %o0 + 0x28 ], %g1 <== NOT EXECUTED 4000ccc8: 10 bf ff fa b 4000ccb0 <_POSIX_Threads_Terminate_extension+0x24><== NOT EXECUTED 4000cccc: f6 20 40 00 st %i3, [ %g1 ] <== NOT EXECUTED if ( api->schedpolicy == SCHED_SPORADIC ) 4000ccd0: 80 a0 60 04 cmp %g1, 4 4000ccd4: 12 80 00 04 bne 4000cce4 <_POSIX_Threads_Terminate_extension+0x58> 4000ccd8: 01 00 00 00 nop (void) _Watchdog_Remove( &api->Sporadic_timer ); 4000ccdc: 7f ff f8 ef call 4000b098 <_Watchdog_Remove> 4000cce0: 90 07 60 b4 add %i5, 0xb4, %o0 _Thread_Enable_dispatch(); 4000cce4: 7f ff f4 4d call 40009e18 <_Thread_Enable_dispatch> 4000cce8: 81 e8 00 00 restore =============================================================================== 40007348 <_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) { 40007348: 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; 4000734c: c2 06 60 68 ld [ %i1 + 0x68 ], %g1 40007350: 82 00 60 01 inc %g1 40007354: c2 26 60 68 st %g1, [ %i1 + 0x68 ] /* The timer must be reprogrammed */ if ( ( ptimer->timer_data.it_interval.tv_sec != 0 ) || 40007358: c2 06 60 54 ld [ %i1 + 0x54 ], %g1 4000735c: 80 a0 60 00 cmp %g1, 0 40007360: 32 80 00 07 bne,a 4000737c <_POSIX_Timer_TSR+0x34> 40007364: d2 06 60 64 ld [ %i1 + 0x64 ], %o1 40007368: c2 06 60 58 ld [ %i1 + 0x58 ], %g1 4000736c: 80 a0 60 00 cmp %g1, 0 40007370: 02 80 00 1f be 400073ec <_POSIX_Timer_TSR+0xa4> <== NEVER TAKEN 40007374: 82 10 20 04 mov 4, %g1 ( ptimer->timer_data.it_interval.tv_nsec != 0 ) ) { activated = _POSIX_Timer_Insert_helper( 40007378: d2 06 60 64 ld [ %i1 + 0x64 ], %o1 4000737c: d4 06 60 08 ld [ %i1 + 8 ], %o2 40007380: 90 06 60 10 add %i1, 0x10, %o0 40007384: 17 10 00 1c sethi %hi(0x40007000), %o3 40007388: 98 10 00 19 mov %i1, %o4 4000738c: 40 00 18 9c call 4000d5fc <_POSIX_Timer_Insert_helper> 40007390: 96 12 e3 48 or %o3, 0x348, %o3 ptimer->ticks, ptimer->Object.id, _POSIX_Timer_TSR, ptimer ); if ( !activated ) 40007394: 80 a2 20 00 cmp %o0, 0 40007398: 02 80 00 1a be 40007400 <_POSIX_Timer_TSR+0xb8> <== NEVER TAKEN 4000739c: 90 07 bf f8 add %fp, -8, %o0 tod_as_timestamp_ptr = 400073a0: 13 10 00 67 sethi %hi(0x40019c00), %o1 400073a4: 40 00 05 b7 call 40008a80 <_TOD_Get_with_nanoseconds> 400073a8: 92 12 61 40 or %o1, 0x140, %o1 ! 40019d40 <_TOD> static inline void _TOD_Get( struct timespec *tod_as_timespec ) { Timestamp_Control tod_as_timestamp; Timestamp_Control *tod_as_timestamp_ptr; 400073ac: 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); 400073b0: 94 10 20 00 clr %o2 400073b4: 90 10 00 1c mov %i4, %o0 400073b8: 92 10 00 1d mov %i5, %o1 400073bc: 17 0e e6 b2 sethi %hi(0x3b9ac800), %o3 400073c0: 40 00 36 0e call 40014bf8 <__divdi3> 400073c4: 96 12 e2 00 or %o3, 0x200, %o3 ! 3b9aca00 _timespec->tv_nsec = (long) (*_timestamp % 1000000000L); 400073c8: 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); 400073cc: d2 26 60 6c st %o1, [ %i1 + 0x6c ] _timespec->tv_nsec = (long) (*_timestamp % 1000000000L); 400073d0: 94 10 20 00 clr %o2 400073d4: 92 10 00 1d mov %i5, %o1 400073d8: 17 0e e6 b2 sethi %hi(0x3b9ac800), %o3 400073dc: 40 00 36 f9 call 40014fc0 <__moddi3> 400073e0: 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; 400073e4: 82 10 20 03 mov 3, %g1 400073e8: 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 ) ) { 400073ec: d0 06 60 38 ld [ %i1 + 0x38 ], %o0 400073f0: d2 06 60 44 ld [ %i1 + 0x44 ], %o1 400073f4: 40 00 17 97 call 4000d250 400073f8: 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; 400073fc: c0 26 60 68 clr [ %i1 + 0x68 ] 40007400: 81 c7 e0 08 ret 40007404: 81 e8 00 00 restore =============================================================================== 4000ca1c <_POSIX_signals_Action_handler>: Thread_Control *executing, Thread_Action *action, Per_CPU_Control *cpu, ISR_Level level ) { 4000ca1c: 9d e3 bf a0 save %sp, -96, %sp RTEMS_INLINE_ROUTINE void _Thread_Action_release_and_ISR_enable( Per_CPU_Control *cpu, ISR_Level level ) { _Per_CPU_Release_and_ISR_enable( cpu, level ); 4000ca20: 7f ff d6 88 call 40002440 4000ca24: 90 10 00 1b mov %i3, %o0 int hold_errno; (void) action; _Thread_Action_release_and_ISR_enable( cpu, level ); api = executing->API_Extensions[ THREAD_API_POSIX ]; 4000ca28: fa 06 21 30 ld [ %i0 + 0x130 ], %i5 hold_errno = executing->Wait.return_code; /* * api may be NULL in case of a thread close in progress */ if ( !api ) 4000ca2c: 80 a7 60 00 cmp %i5, 0 4000ca30: 02 80 00 0f be 4000ca6c <_POSIX_signals_Action_handler+0x50><== NEVER TAKEN 4000ca34: f6 06 20 34 ld [ %i0 + 0x34 ], %i3 * processed at all. No point in doing this loop otherwise. */ while (1) { _POSIX_signals_Acquire( &lock_context ); if ( !(~api->signals_blocked & (api->signals_pending | _POSIX_signals_Pending)) ) { 4000ca38: 35 10 00 63 sethi %hi(0x40018c00), %i2 { #if defined( RTEMS_SMP ) _SMP_lock_ISR_disable_and_acquire( &lock->lock, &context->lock_context ); #else (void) lock; _ISR_Disable( context->isr_level ); 4000ca3c: 7f ff d6 7e call 40002434 4000ca40: 01 00 00 00 nop 4000ca44: c4 06 a2 f4 ld [ %i2 + 0x2f4 ], %g2 4000ca48: c2 07 60 e0 ld [ %i5 + 0xe0 ], %g1 4000ca4c: 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) { _POSIX_signals_Acquire( &lock_context ); if ( !(~api->signals_blocked & 4000ca50: c4 07 60 dc ld [ %i5 + 0xdc ], %g2 4000ca54: 80 a8 40 02 andncc %g1, %g2, %g0 4000ca58: 12 80 00 07 bne 4000ca74 <_POSIX_signals_Action_handler+0x58> 4000ca5c: 01 00 00 00 nop { #if defined( RTEMS_SMP ) _SMP_lock_Release_and_ISR_enable( &lock->lock, &context->lock_context ); #else (void) lock; _ISR_Enable( context->isr_level ); 4000ca60: 7f ff d6 78 call 40002440 4000ca64: 01 00 00 00 nop _POSIX_signals_Check_signal( api, signo, false ); _POSIX_signals_Check_signal( api, signo, true ); } } executing->Wait.return_code = hold_errno; 4000ca68: f6 26 20 34 st %i3, [ %i0 + 0x34 ] 4000ca6c: 81 c7 e0 08 ret 4000ca70: 81 e8 00 00 restore 4000ca74: 7f ff d6 73 call 40002440 4000ca78: b8 10 20 1b mov 0x1b, %i4 break; } _POSIX_signals_Release( &lock_context ); for ( signo = SIGRTMIN ; signo <= SIGRTMAX ; signo++ ) { _POSIX_signals_Check_signal( api, signo, false ); 4000ca7c: 92 10 00 1c mov %i4, %o1 4000ca80: 94 10 20 00 clr %o2 4000ca84: 40 00 08 83 call 4000ec90 <_POSIX_signals_Check_signal> 4000ca88: 90 10 00 1d mov %i5, %o0 _POSIX_signals_Check_signal( api, signo, true ); 4000ca8c: 92 10 00 1c mov %i4, %o1 4000ca90: 90 10 00 1d mov %i5, %o0 4000ca94: 40 00 08 7f call 4000ec90 <_POSIX_signals_Check_signal> 4000ca98: 94 10 20 01 mov 1, %o2 _POSIX_signals_Release( &lock_context ); break; } _POSIX_signals_Release( &lock_context ); for ( signo = SIGRTMIN ; signo <= SIGRTMAX ; signo++ ) { 4000ca9c: b8 07 20 01 inc %i4 4000caa0: 80 a7 20 20 cmp %i4, 0x20 4000caa4: 12 bf ff f7 bne 4000ca80 <_POSIX_signals_Action_handler+0x64> 4000caa8: 92 10 00 1c mov %i4, %o1 4000caac: 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 ); 4000cab0: 92 10 00 1c mov %i4, %o1 4000cab4: 94 10 20 00 clr %o2 4000cab8: 40 00 08 76 call 4000ec90 <_POSIX_signals_Check_signal> 4000cabc: 90 10 00 1d mov %i5, %o0 _POSIX_signals_Check_signal( api, signo, true ); 4000cac0: 92 10 00 1c mov %i4, %o1 4000cac4: 90 10 00 1d mov %i5, %o0 4000cac8: 40 00 08 72 call 4000ec90 <_POSIX_signals_Check_signal> 4000cacc: 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++ ) { 4000cad0: b8 07 20 01 inc %i4 4000cad4: 80 a7 20 1b cmp %i4, 0x1b 4000cad8: 12 bf ff f7 bne 4000cab4 <_POSIX_signals_Action_handler+0x98> 4000cadc: 92 10 00 1c mov %i4, %o1 4000cae0: 30 bf ff d7 b,a 4000ca3c <_POSIX_signals_Action_handler+0x20> =============================================================================== 4000ec90 <_POSIX_signals_Check_signal>: bool _POSIX_signals_Check_signal( POSIX_API_Control *api, int signo, bool is_global ) { 4000ec90: 9d e3 bf 68 save %sp, -152, %sp siginfo_t siginfo_struct; sigset_t saved_signals_blocked; Thread_Wait_information stored_thread_wait_information; Thread_Control *executing; if ( ! _POSIX_signals_Clear_signals( api, signo, &siginfo_struct, 4000ec94: 98 10 20 01 mov 1, %o4 4000ec98: 90 10 00 18 mov %i0, %o0 4000ec9c: 92 10 00 19 mov %i1, %o1 4000eca0: 94 07 bf cc add %fp, -52, %o2 4000eca4: 96 10 00 1a mov %i2, %o3 4000eca8: 40 00 00 2d call 4000ed5c <_POSIX_signals_Clear_signals> 4000ecac: 9a 10 20 01 mov 1, %o5 4000ecb0: 80 a2 20 00 cmp %o0, 0 4000ecb4: 02 80 00 27 be 4000ed50 <_POSIX_signals_Check_signal+0xc0> 4000ecb8: b8 10 00 08 mov %o0, %i4 #endif /* * Just to prevent sending a signal which is currently being ignored. */ if ( _POSIX_signals_Vectors[ signo ].sa_handler == SIG_IGN ) 4000ecbc: 83 2e 60 04 sll %i1, 4, %g1 4000ecc0: 23 10 00 63 sethi %hi(0x40018c00), %l1 4000ecc4: a1 2e 60 02 sll %i1, 2, %l0 4000ecc8: a2 14 61 28 or %l1, 0x128, %l1 4000eccc: a0 20 40 10 sub %g1, %l0, %l0 4000ecd0: 82 04 40 10 add %l1, %l0, %g1 4000ecd4: fa 00 60 08 ld [ %g1 + 8 ], %i5 4000ecd8: 80 a7 60 01 cmp %i5, 1 4000ecdc: 02 80 00 1c be 4000ed4c <_POSIX_signals_Check_signal+0xbc><== NEVER TAKEN 4000ece0: 90 07 bf d8 add %fp, -40, %o0 return false; /* * Block the signals requested in sa_mask */ saved_signals_blocked = api->signals_blocked; 4000ece4: f6 06 20 dc ld [ %i0 + 0xdc ], %i3 api->signals_blocked |= _POSIX_signals_Vectors[ signo ].sa_mask; 4000ece8: c2 00 60 04 ld [ %g1 + 4 ], %g1 /* * 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, &executing->Wait, 4000ecec: f4 01 a0 18 ld [ %g6 + 0x18 ], %i2 /* * Block the signals requested in sa_mask */ saved_signals_blocked = api->signals_blocked; api->signals_blocked |= _POSIX_signals_Vectors[ signo ].sa_mask; 4000ecf0: 82 10 40 1b or %g1, %i3, %g1 /* * 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, &executing->Wait, 4000ecf4: b4 06 a0 20 add %i2, 0x20, %i2 /* * Block the signals requested in sa_mask */ saved_signals_blocked = api->signals_blocked; api->signals_blocked |= _POSIX_signals_Vectors[ signo ].sa_mask; 4000ecf8: c2 26 20 dc st %g1, [ %i0 + 0xdc ] /* * 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, &executing->Wait, 4000ecfc: 92 10 00 1a mov %i2, %o1 4000ed00: 40 00 05 2e call 400101b8 4000ed04: 94 10 20 28 mov 0x28, %o2 sizeof( stored_thread_wait_information )); /* * Here, the signal handler function executes */ switch ( _POSIX_signals_Vectors[ signo ].sa_flags ) { 4000ed08: c2 04 40 10 ld [ %l1 + %l0 ], %g1 4000ed0c: 80 a0 60 02 cmp %g1, 2 4000ed10: 12 80 00 07 bne 4000ed2c <_POSIX_signals_Check_signal+0x9c> 4000ed14: 90 10 00 19 mov %i1, %o0 case SA_SIGINFO: (*_POSIX_signals_Vectors[ signo ].sa_sigaction)( 4000ed18: 92 07 bf cc add %fp, -52, %o1 4000ed1c: 9f c7 40 00 call %i5 4000ed20: 94 10 20 00 clr %o2 signo, &siginfo_struct, NULL /* context is undefined per 1003.1b-1993, p. 66 */ ); break; 4000ed24: 10 80 00 05 b 4000ed38 <_POSIX_signals_Check_signal+0xa8> 4000ed28: 90 10 00 1a mov %i2, %o0 default: (*_POSIX_signals_Vectors[ signo ].sa_handler)( signo ); 4000ed2c: 9f c7 40 00 call %i5 4000ed30: 01 00 00 00 nop } /* * Restore the blocking information */ memcpy( &executing->Wait, &stored_thread_wait_information, 4000ed34: 90 10 00 1a mov %i2, %o0 4000ed38: 92 07 bf d8 add %fp, -40, %o1 4000ed3c: 40 00 05 1f call 400101b8 4000ed40: 94 10 20 28 mov 0x28, %o2 /* * Restore the previous set of blocked signals */ api->signals_blocked = saved_signals_blocked; return true; 4000ed44: 10 80 00 03 b 4000ed50 <_POSIX_signals_Check_signal+0xc0> 4000ed48: f6 26 20 dc st %i3, [ %i0 + 0xdc ] Thread_Wait_information stored_thread_wait_information; Thread_Control *executing; if ( ! _POSIX_signals_Clear_signals( api, signo, &siginfo_struct, is_global, true, true ) ) return false; 4000ed4c: b8 10 20 00 clr %i4 <== NOT EXECUTED * Restore the previous set of blocked signals */ api->signals_blocked = saved_signals_blocked; return true; } 4000ed50: b0 0f 20 ff and %i4, 0xff, %i0 4000ed54: 81 c7 e0 08 ret 4000ed58: 81 e8 00 00 restore =============================================================================== 4000f920 <_POSIX_signals_Clear_process_signals>: 4000f920: 82 02 3f ff add %o0, -1, %g1 4000f924: 84 10 20 01 mov 1, %g2 4000f928: 85 28 80 01 sll %g2, %g1, %g2 _Assert( _ISR_Get_level() != 0 ); clear_signal = true; mask = signo_to_mask( signo ); if ( _POSIX_signals_Vectors[ signo ].sa_flags == SA_SIGINFO ) { 4000f92c: 83 2a 20 02 sll %o0, 2, %g1 4000f930: 91 2a 20 04 sll %o0, 4, %o0 4000f934: 90 22 00 01 sub %o0, %g1, %o0 4000f938: 03 10 00 63 sethi %hi(0x40018c00), %g1 4000f93c: 82 10 61 28 or %g1, 0x128, %g1 ! 40018d28 <_POSIX_signals_Vectors> 4000f940: c2 00 40 08 ld [ %g1 + %o0 ], %g1 4000f944: 80 a0 60 02 cmp %g1, 2 4000f948: 12 80 00 0a bne 4000f970 <_POSIX_signals_Clear_process_signals+0x50> 4000f94c: 03 10 00 63 sethi %hi(0x40018c00), %g1 if ( !_Chain_Is_empty( &_POSIX_signals_Siginfo[ signo ] ) ) 4000f950: 03 10 00 63 sethi %hi(0x40018c00), %g1 4000f954: 82 10 62 f8 or %g1, 0x2f8, %g1 ! 40018ef8 <_POSIX_signals_Siginfo> 4000f958: 86 02 00 01 add %o0, %g1, %g3 4000f95c: c2 02 00 01 ld [ %o0 + %g1 ], %g1 RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( const Chain_Control *the_chain ) { return _Chain_Immutable_first( the_chain ) == _Chain_Immutable_tail( the_chain ); 4000f960: 86 00 e0 04 add %g3, 4, %g3 4000f964: 80 a0 40 03 cmp %g1, %g3 4000f968: 12 80 00 05 bne 4000f97c <_POSIX_signals_Clear_process_signals+0x5c><== NEVER TAKEN 4000f96c: 03 10 00 63 sethi %hi(0x40018c00), %g1 clear_signal = false; } if ( clear_signal ) { _POSIX_signals_Pending &= ~mask; 4000f970: c6 00 62 f4 ld [ %g1 + 0x2f4 ], %g3 ! 40018ef4 <_POSIX_signals_Pending> 4000f974: 84 28 c0 02 andn %g3, %g2, %g2 4000f978: c4 20 62 f4 st %g2, [ %g1 + 0x2f4 ] 4000f97c: 81 c3 e0 08 retl =============================================================================== 4000818c <_POSIX_signals_Get_lowest>: sigset_t set ) { int signo; for ( signo = SIGRTMIN ; signo <= SIGRTMAX ; signo++ ) { 4000818c: 82 10 20 1b mov 0x1b, %g1 40008190: 84 10 20 01 mov 1, %g2 40008194: 86 00 7f ff add %g1, -1, %g3 40008198: 87 28 80 03 sll %g2, %g3, %g3 if ( set & signo_to_mask( signo ) ) { 4000819c: 80 88 c0 08 btst %g3, %o0 400081a0: 12 80 00 11 bne 400081e4 <_POSIX_signals_Get_lowest+0x58> <== NEVER TAKEN 400081a4: 01 00 00 00 nop sigset_t set ) { int signo; for ( signo = SIGRTMIN ; signo <= SIGRTMAX ; signo++ ) { 400081a8: 82 00 60 01 inc %g1 400081ac: 80 a0 60 20 cmp %g1, 0x20 400081b0: 12 bf ff fa bne 40008198 <_POSIX_signals_Get_lowest+0xc> 400081b4: 86 00 7f ff add %g1, -1, %g3 400081b8: 82 10 20 01 mov 1, %g1 400081bc: 84 10 20 01 mov 1, %g2 400081c0: 86 00 7f ff add %g1, -1, %g3 400081c4: 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 ) ) { 400081c8: 80 88 c0 08 btst %g3, %o0 400081cc: 12 80 00 06 bne 400081e4 <_POSIX_signals_Get_lowest+0x58> 400081d0: 01 00 00 00 nop */ #if (SIGHUP != 1) #error "Assumption that SIGHUP==1 violated!!" #endif for ( signo = SIGHUP ; signo <= __SIGLASTNOTRT ; signo++ ) { 400081d4: 82 00 60 01 inc %g1 400081d8: 80 a0 60 1b cmp %g1, 0x1b 400081dc: 12 bf ff fa bne 400081c4 <_POSIX_signals_Get_lowest+0x38> <== ALWAYS TAKEN 400081e0: 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; } 400081e4: 81 c3 e0 08 retl 400081e8: 90 10 00 01 mov %g1, %o0 =============================================================================== 4002985c <_POSIX_signals_Unblock_thread>: bool _POSIX_signals_Unblock_thread( Thread_Control *the_thread, int signo, siginfo_t *info ) { 4002985c: 9d e3 bf a0 save %sp, -96, %sp ISR_Level *level ) { Per_CPU_Control *cpu; _ISR_Disable_without_giant( *level ); 40029860: 7f ff 64 3d call 40002954 40029864: fa 06 21 30 ld [ %i0 + 0x130 ], %i5 RTEMS_INLINE_ROUTINE void _Chain_Append_if_is_off_chain_unprotected( Chain_Control *the_chain, Chain_Node *the_node ) { if ( _Chain_Is_node_off_chain( the_node ) ) { 40029868: c2 07 60 e4 ld [ %i5 + 0xe4 ], %g1 4002986c: 80 a0 60 00 cmp %g1, 0 40029870: 12 80 00 08 bne 40029890 <_POSIX_signals_Unblock_thread+0x34> 40029874: 86 06 20 c8 add %i0, 0xc8, %g3 Chain_Control *the_chain, Chain_Node *the_node ) { Chain_Node *tail = _Chain_Tail( the_chain ); Chain_Node *old_last = tail->previous; 40029878: c2 06 20 cc ld [ %i0 + 0xcc ], %g1 the_node->next = tail; 4002987c: c6 27 60 e4 st %g3, [ %i5 + 0xe4 ] { Per_CPU_Control *cpu; ISR_Level level; cpu = _Thread_Action_ISR_disable_and_acquire( thread, &level ); _Chain_Append_if_is_off_chain_unprotected( 40029880: 84 07 60 e4 add %i5, 0xe4, %g2 tail->previous = the_node; 40029884: c4 26 20 cc st %g2, [ %i0 + 0xcc ] old_last->next = the_node; 40029888: c4 20 40 00 st %g2, [ %g1 ] the_node->previous = old_last; 4002988c: c2 27 60 e8 st %g1, [ %i5 + 0xe8 ] RTEMS_INLINE_ROUTINE void _Thread_Action_release_and_ISR_enable( Per_CPU_Control *cpu, ISR_Level level ) { _Per_CPU_Release_and_ISR_enable( cpu, level ); 40029890: 7f ff 64 34 call 40002960 40029894: 01 00 00 00 nop /* * Is the thread is specifically waiting for a signal? */ if ( _States_Is_interruptible_signal( the_thread->current_state ) ) { 40029898: c2 06 20 10 ld [ %i0 + 0x10 ], %g1 4002989c: 09 04 00 20 sethi %hi(0x10008000), %g4 400298a0: 84 06 7f ff add %i1, -1, %g2 400298a4: 86 10 20 01 mov 1, %g3 400298a8: b8 08 40 04 and %g1, %g4, %i4 400298ac: 80 a7 00 04 cmp %i4, %g4 400298b0: 12 80 00 1c bne 40029920 <_POSIX_signals_Unblock_thread+0xc4> 400298b4: 85 28 c0 02 sll %g3, %g2, %g2 if ( (the_thread->Wait.option & mask) || (~api->signals_blocked & mask) ) { 400298b8: c2 06 20 30 ld [ %i0 + 0x30 ], %g1 400298bc: 80 88 80 01 btst %g2, %g1 400298c0: 12 80 00 06 bne 400298d8 <_POSIX_signals_Unblock_thread+0x7c> 400298c4: 82 10 20 04 mov 4, %g1 400298c8: c2 07 60 dc ld [ %i5 + 0xdc ], %g1 400298cc: 80 a8 80 01 andncc %g2, %g1, %g0 400298d0: 02 80 00 3a be 400299b8 <_POSIX_signals_Unblock_thread+0x15c> 400298d4: 82 10 20 04 mov 4, %g1 the_thread->Wait.return_code = EINTR; 400298d8: c2 26 20 34 st %g1, [ %i0 + 0x34 ] the_info = (siginfo_t *) the_thread->Wait.return_argument; if ( !info ) { 400298dc: 80 a6 a0 00 cmp %i2, 0 400298e0: 12 80 00 07 bne 400298fc <_POSIX_signals_Unblock_thread+0xa0> 400298e4: d0 06 20 28 ld [ %i0 + 0x28 ], %o0 the_info->si_signo = signo; the_info->si_code = SI_USER; 400298e8: 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; 400298ec: f2 22 00 00 st %i1, [ %o0 ] the_info->si_code = SI_USER; 400298f0: c2 22 20 04 st %g1, [ %o0 + 4 ] 400298f4: 10 80 00 05 b 40029908 <_POSIX_signals_Unblock_thread+0xac> 400298f8: c0 22 20 08 clr [ %o0 + 8 ] the_info->si_value.sival_int = 0; } else { *the_info = *info; 400298fc: 92 10 00 1a mov %i2, %o1 40029900: 7f ff bf 39 call 400195e4 40029904: 94 10 20 0c mov 0xc, %o2 } _Thread_queue_Extract_with_proxy( the_thread ); 40029908: 90 10 00 18 mov %i0, %o0 4002990c: 7f ff ac bf call 40014c08 <_Thread_queue_Extract_with_proxy> 40029910: b0 10 20 01 mov 1, %i0 40029914: b0 0e 20 01 and %i0, 1, %i0 40029918: 81 c7 e0 08 ret 4002991c: 81 e8 00 00 restore } /* * Thread is not waiting due to a sigwait. */ if ( ~api->signals_blocked & mask ) { 40029920: c8 07 60 dc ld [ %i5 + 0xdc ], %g4 40029924: 80 a8 80 04 andncc %g2, %g4, %g0 40029928: 02 80 00 24 be 400299b8 <_POSIX_signals_Unblock_thread+0x15c> 4002992c: 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 ) ) { 40029930: 80 88 40 02 btst %g1, %g2 40029934: 02 80 00 17 be 40029990 <_POSIX_signals_Unblock_thread+0x134> 40029938: 80 a0 60 00 cmp %g1, 0 the_thread->Wait.return_code = EINTR; 4002993c: 84 10 20 04 mov 4, %g2 40029940: 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) ) 40029944: 05 00 02 ef sethi %hi(0xbbc00), %g2 40029948: 84 10 a2 e0 or %g2, 0x2e0, %g2 ! bbee0 <_TLS_Alignment+0xbbedf> 4002994c: 80 88 40 02 btst %g1, %g2 40029950: 02 80 00 06 be 40029968 <_POSIX_signals_Unblock_thread+0x10c> 40029954: 80 88 60 08 btst 8, %g1 _Thread_queue_Extract_with_proxy( the_thread ); 40029958: 7f ff ac ac call 40014c08 <_Thread_queue_Extract_with_proxy> 4002995c: 90 10 00 18 mov %i0, %o0 } else if ( the_thread->current_state == STATES_READY ) { _Thread_Signal_notification( the_thread ); } } return false; 40029960: 10 80 00 17 b 400299bc <_POSIX_signals_Unblock_thread+0x160> 40029964: 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) ) { 40029968: 22 80 00 15 be,a 400299bc <_POSIX_signals_Unblock_thread+0x160><== NEVER TAKEN 4002996c: b0 10 20 00 clr %i0 <== NOT EXECUTED (void) _Watchdog_Remove( &the_thread->Timer ); 40029970: 7f ff 96 de call 4000f4e8 <_Watchdog_Remove> 40029974: 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 ); 40029978: 90 10 00 18 mov %i0, %o0 4002997c: 13 04 03 ff sethi %hi(0x100ffc00), %o1 40029980: 7f ff 91 64 call 4000df10 <_Thread_Clear_state> 40029984: 92 12 63 f8 or %o1, 0x3f8, %o1 ! 100ffff8 } else if ( the_thread->current_state == STATES_READY ) { _Thread_Signal_notification( the_thread ); } } return false; 40029988: 10 80 00 0d b 400299bc <_POSIX_signals_Unblock_thread+0x160> 4002998c: 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 ) { 40029990: 32 80 00 0b bne,a 400299bc <_POSIX_signals_Unblock_thread+0x160><== NEVER TAKEN 40029994: b0 10 20 00 clr %i0 <== NOT EXECUTED #endif } RTEMS_INLINE_ROUTINE void _Thread_Signal_notification( Thread_Control *thread ) { if ( _ISR_Is_in_progress() && _Thread_Is_executing( thread ) ) { 40029998: c4 01 a0 0c ld [ %g6 + 0xc ], %g2 4002999c: 80 a0 a0 00 cmp %g2, 0 400299a0: 22 80 00 07 be,a 400299bc <_POSIX_signals_Unblock_thread+0x160> 400299a4: b0 10 20 00 clr %i0 400299a8: c4 01 a0 18 ld [ %g6 + 0x18 ], %g2 400299ac: 80 a6 00 02 cmp %i0, %g2 400299b0: 22 80 00 02 be,a 400299b8 <_POSIX_signals_Unblock_thread+0x15c><== ALWAYS TAKEN 400299b4: c6 29 a0 14 stb %g3, [ %g6 + 0x14 ] _Thread_Signal_notification( the_thread ); } } return false; 400299b8: b0 10 20 00 clr %i0 } 400299bc: b0 0e 20 01 and %i0, 1, %i0 400299c0: 81 c7 e0 08 ret 400299c4: 81 e8 00 00 restore =============================================================================== 4000b010 <_RBTree_Initialize>: void *starting_address, size_t number_nodes, size_t node_size, bool is_unique ) { 4000b010: 9d e3 bf a0 save %sp, -96, %sp size_t count; RBTree_Node *next; /* TODO: Error message? */ if (!the_rbtree) return; 4000b014: 80 a6 20 00 cmp %i0, 0 4000b018: 02 80 00 10 be 4000b058 <_RBTree_Initialize+0x48> <== NEVER TAKEN 4000b01c: 01 00 00 00 nop RBTree_Control *the_rbtree, RBTree_Compare_function compare_function, bool is_unique ) { the_rbtree->permanent_null = NULL; 4000b020: c0 26 00 00 clr [ %i0 ] the_rbtree->root = NULL; 4000b024: c0 26 20 04 clr [ %i0 + 4 ] the_rbtree->first[0] = NULL; 4000b028: c0 26 20 08 clr [ %i0 + 8 ] the_rbtree->first[1] = NULL; 4000b02c: c0 26 20 0c clr [ %i0 + 0xc ] the_rbtree->compare_function = compare_function; 4000b030: f2 26 20 10 st %i1, [ %i0 + 0x10 ] the_rbtree->is_unique = is_unique; 4000b034: fa 2e 20 14 stb %i5, [ %i0 + 0x14 ] /* could do sanity checks here */ _RBTree_Initialize_empty(the_rbtree, compare_function, is_unique); count = number_nodes; next = starting_address; while ( count-- ) { 4000b038: 80 a6 e0 00 cmp %i3, 0 4000b03c: 02 80 00 07 be 4000b058 <_RBTree_Initialize+0x48> 4000b040: 92 10 00 1a mov %i2, %o1 _RBTree_Insert(the_rbtree, next); 4000b044: 90 10 00 18 mov %i0, %o0 4000b048: 7f ff ff 44 call 4000ad58 <_RBTree_Insert> 4000b04c: b4 06 80 1c add %i2, %i4, %i2 4000b050: 10 bf ff fa b 4000b038 <_RBTree_Initialize+0x28> 4000b054: b6 06 ff ff add %i3, -1, %i3 4000b058: 81 c7 e0 08 ret 4000b05c: 81 e8 00 00 restore =============================================================================== 40007e74 <_RBTree_Insert>: */ RBTree_Node *_RBTree_Insert( RBTree_Control *the_rbtree, RBTree_Node *the_node ) { 40007e74: 9d e3 bf a0 save %sp, -96, %sp if(!the_node) return (RBTree_Node*)-1; 40007e78: 80 a6 60 00 cmp %i1, 0 40007e7c: 02 80 00 80 be 4000807c <_RBTree_Insert+0x208> 40007e80: 01 00 00 00 nop RBTree_Node *iter_node = the_rbtree->root; 40007e84: fa 06 20 04 ld [ %i0 + 4 ], %i5 int compare_result; if (!iter_node) { /* special case: first node inserted */ 40007e88: 80 a7 60 00 cmp %i5, 0 40007e8c: 32 80 00 16 bne,a 40007ee4 <_RBTree_Insert+0x70> 40007e90: c2 06 20 10 ld [ %i0 + 0x10 ], %g1 the_node->color = RBT_BLACK; 40007e94: c0 26 60 0c clr [ %i1 + 0xc ] the_rbtree->root = the_node; 40007e98: f2 26 20 04 st %i1, [ %i0 + 4 ] the_rbtree->first[0] = the_rbtree->first[1] = the_node; 40007e9c: f2 26 20 0c st %i1, [ %i0 + 0xc ] 40007ea0: f2 26 20 08 st %i1, [ %i0 + 8 ] the_node->parent = (RBTree_Node *) the_rbtree; 40007ea4: f0 26 40 00 st %i0, [ %i1 ] the_node->child[RBT_LEFT] = the_node->child[RBT_RIGHT] = NULL; 40007ea8: c0 26 60 08 clr [ %i1 + 8 ] 40007eac: c0 26 60 04 clr [ %i1 + 4 ] 40007eb0: 81 c7 e0 08 ret 40007eb4: 91 e8 20 00 restore %g0, 0, %o0 } else { /* typical binary search tree insert, descend tree to leaf and insert */ while (iter_node) { compare_result = the_rbtree->compare_function(the_node, iter_node); if ( the_rbtree->is_unique && _RBTree_Is_equal( compare_result ) ) 40007eb8: 02 80 00 73 be 40008084 <_RBTree_Insert+0x210> 40007ebc: b8 38 00 08 xnor %g0, %o0, %i4 return iter_node; RBTree_Direction dir = !_RBTree_Is_lesser( compare_result ); 40007ec0: b9 37 20 1f srl %i4, 0x1f, %i4 if (!iter_node->child[dir]) { 40007ec4: 83 2f 20 02 sll %i4, 2, %g1 40007ec8: 84 07 40 01 add %i5, %g1, %g2 40007ecc: c6 00 a0 04 ld [ %g2 + 4 ], %g3 40007ed0: 80 a0 e0 00 cmp %g3, 0 40007ed4: 22 80 00 0d be,a 40007f08 <_RBTree_Insert+0x94> 40007ed8: c0 26 60 08 clr [ %i1 + 8 ] (dir && _RBTree_Is_greater(compare_result)) ) { the_rbtree->first[dir] = the_node; } break; } else { iter_node = iter_node->child[dir]; 40007edc: ba 10 00 03 mov %g3, %i5 the_node->parent = (RBTree_Node *) the_rbtree; the_node->child[RBT_LEFT] = the_node->child[RBT_RIGHT] = NULL; } else { /* typical binary search tree insert, descend tree to leaf and insert */ while (iter_node) { compare_result = the_rbtree->compare_function(the_node, iter_node); 40007ee0: c2 06 20 10 ld [ %i0 + 0x10 ], %g1 40007ee4: 90 10 00 19 mov %i1, %o0 40007ee8: 9f c0 40 00 call %g1 40007eec: 92 10 00 1d mov %i5, %o1 if ( the_rbtree->is_unique && _RBTree_Is_equal( compare_result ) ) 40007ef0: c2 0e 20 14 ldub [ %i0 + 0x14 ], %g1 40007ef4: 80 a0 60 00 cmp %g1, 0 40007ef8: 22 bf ff f2 be,a 40007ec0 <_RBTree_Insert+0x4c> 40007efc: b8 38 00 08 xnor %g0, %o0, %i4 40007f00: 10 bf ff ee b 40007eb8 <_RBTree_Insert+0x44> 40007f04: 80 a2 20 00 cmp %o0, 0 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; 40007f08: c0 26 60 04 clr [ %i1 + 4 ] the_node->color = RBT_RED; 40007f0c: 86 10 20 01 mov 1, %g3 40007f10: c6 26 60 0c st %g3, [ %i1 + 0xc ] iter_node->child[dir] = the_node; 40007f14: f2 20 a0 04 st %i1, [ %g2 + 4 ] the_node->parent = iter_node; 40007f18: fa 26 40 00 st %i5, [ %i1 ] 40007f1c: ba 06 00 01 add %i0, %g1, %i5 /* update min/max */ compare_result = the_rbtree->compare_function( 40007f20: c2 06 20 10 ld [ %i0 + 0x10 ], %g1 40007f24: d2 07 60 08 ld [ %i5 + 8 ], %o1 40007f28: 9f c0 40 00 call %g1 40007f2c: 90 10 00 19 mov %i1, %o0 the_node, _RBTree_First(the_rbtree, dir) ); if ( (!dir && _RBTree_Is_lesser(compare_result)) || 40007f30: 80 a7 20 00 cmp %i4, 0 40007f34: 12 80 00 06 bne 40007f4c <_RBTree_Insert+0xd8> 40007f38: 80 a2 20 00 cmp %o0, 0 40007f3c: 36 80 00 1e bge,a 40007fb4 <_RBTree_Insert+0x140> 40007f40: d0 06 40 00 ld [ %i1 ], %o0 (dir && _RBTree_Is_greater(compare_result)) ) { the_rbtree->first[dir] = the_node; 40007f44: 10 80 00 1b b 40007fb0 <_RBTree_Insert+0x13c> 40007f48: f2 27 60 08 st %i1, [ %i5 + 8 ] 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)) ) { 40007f4c: 34 80 00 19 bg,a 40007fb0 <_RBTree_Insert+0x13c> 40007f50: f2 27 60 08 st %i1, [ %i5 + 8 ] * * @note It does NOT disable interrupts to ensure the atomicity of the * append operation. */ static void _RBTree_Validate_insert( RBTree_Node *the_node 40007f54: 10 80 00 18 b 40007fb4 <_RBTree_Insert+0x140> 40007f58: d0 06 40 00 ld [ %i1 ], %o0 */ RTEMS_INLINE_ROUTINE bool _RBTree_Is_red( const RBTree_Node *the_node ) { return (the_node && the_node->color == RBT_RED); 40007f5c: 82 18 60 01 xor %g1, 1, %g1 40007f60: 80 a0 00 01 cmp %g0, %g1 40007f64: 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))) { 40007f68: 80 a0 60 00 cmp %g1, 0 40007f6c: 02 80 00 3f be 40008068 <_RBTree_Insert+0x1f4> 40007f70: 80 a7 60 00 cmp %i5, 0 const RBTree_Node *the_node ) { if(!the_node) return NULL; if(!(the_node->parent)) return NULL; if(!(the_node->parent->parent)) return NULL; 40007f74: 02 80 00 06 be 40007f8c <_RBTree_Insert+0x118> <== NEVER TAKEN 40007f78: 82 10 20 00 clr %g1 if(!(the_node->parent->parent->parent)) return NULL; 40007f7c: c2 07 40 00 ld [ %i5 ], %g1 40007f80: 80 a0 60 00 cmp %g1, 0 40007f84: 32 80 00 12 bne,a 40007fcc <_RBTree_Insert+0x158> <== ALWAYS TAKEN 40007f88: c2 07 60 04 ld [ %i5 + 4 ], %g1 */ RTEMS_INLINE_ROUTINE bool _RBTree_Is_red( const RBTree_Node *the_node ) { return (the_node && the_node->color == RBT_RED); 40007f8c: 84 10 20 00 clr %g2 <== NOT EXECUTED 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)) { 40007f90: 80 a0 a0 00 cmp %g2, 0 40007f94: 22 80 00 1c be,a 40008004 <_RBTree_Insert+0x190> 40007f98: c2 07 60 04 ld [ %i5 + 4 ], %g1 the_node->parent->color = RBT_BLACK; 40007f9c: c0 22 20 0c clr [ %o0 + 0xc ] u->color = RBT_BLACK; 40007fa0: c0 20 60 0c clr [ %g1 + 0xc ] g->color = RBT_RED; 40007fa4: 82 10 20 01 mov 1, %g1 40007fa8: c2 27 60 0c st %g1, [ %i5 + 0xc ] } the_node->parent->color = RBT_BLACK; g->color = RBT_RED; /* now rotate grandparent in the other branch direction (toward uncle) */ _RBTree_Rotate(g, (1-pdir)); 40007fac: b2 10 00 1d mov %i5, %i1 * * @note It does NOT disable interrupts to ensure the atomicity of the * append operation. */ static void _RBTree_Validate_insert( RBTree_Node *the_node 40007fb0: d0 06 40 00 ld [ %i1 ], %o0 */ RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_Parent( const RBTree_Node *the_node ) { if (!the_node->parent->parent) return NULL; 40007fb4: fa 02 00 00 ld [ %o0 ], %i5 40007fb8: 80 a7 60 00 cmp %i5, 0 40007fbc: 32 bf ff e8 bne,a 40007f5c <_RBTree_Insert+0xe8> 40007fc0: c2 02 20 0c ld [ %o0 + 0xc ], %g1 40007fc4: 10 bf ff e9 b 40007f68 <_RBTree_Insert+0xf4> 40007fc8: 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]) 40007fcc: 80 a2 00 01 cmp %o0, %g1 40007fd0: 22 80 00 02 be,a 40007fd8 <_RBTree_Insert+0x164> 40007fd4: 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); 40007fd8: 80 a0 60 00 cmp %g1, 0 40007fdc: 02 bf ff ed be 40007f90 <_RBTree_Insert+0x11c> 40007fe0: 84 10 20 00 clr %g2 40007fe4: c4 00 60 0c ld [ %g1 + 0xc ], %g2 40007fe8: 80 a0 a0 01 cmp %g2, 1 40007fec: 32 bf ff e9 bne,a 40007f90 <_RBTree_Insert+0x11c> 40007ff0: 84 10 20 00 clr %g2 40007ff4: 10 80 00 02 b 40007ffc <_RBTree_Insert+0x188> 40007ff8: 84 10 20 01 mov 1, %g2 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)) { 40007ffc: 10 bf ff e6 b 40007f94 <_RBTree_Insert+0x120> 40008000: 80 a0 a0 00 cmp %g2, 0 u->color = RBT_BLACK; g->color = RBT_RED; the_node = g; } else { /* if uncle is black */ RBTree_Direction dir = the_node != the_node->parent->child[0]; RBTree_Direction pdir = the_node->parent != g->child[0]; 40008004: 82 1a 00 01 xor %o0, %g1, %g1 40008008: 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]; 4000800c: c2 02 20 04 ld [ %o0 + 4 ], %g1 RBTree_Direction pdir = the_node->parent != g->child[0]; 40008010: 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]; 40008014: 82 1e 40 01 xor %i1, %g1, %g1 40008018: 80 a0 00 01 cmp %g0, %g1 4000801c: 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) { 40008020: 80 a0 40 1c cmp %g1, %i4 40008024: 22 80 00 08 be,a 40008044 <_RBTree_Insert+0x1d0> 40008028: c2 06 40 00 ld [ %i1 ], %g1 _RBTree_Rotate(the_node->parent, pdir); 4000802c: 7f ff ff 74 call 40007dfc <_RBTree_Rotate> 40008030: 92 10 00 1c mov %i4, %o1 the_node = the_node->child[pdir]; 40008034: 83 2f 20 02 sll %i4, 2, %g1 40008038: b2 06 40 01 add %i1, %g1, %i1 4000803c: f2 06 60 04 ld [ %i1 + 4 ], %i1 } the_node->parent->color = RBT_BLACK; 40008040: c2 06 40 00 ld [ %i1 ], %g1 g->color = RBT_RED; 40008044: 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; 40008048: c0 20 60 0c clr [ %g1 + 0xc ] g->color = RBT_RED; 4000804c: d2 27 60 0c st %o1, [ %i5 + 0xc ] /* now rotate grandparent in the other branch direction (toward uncle) */ _RBTree_Rotate(g, (1-pdir)); 40008050: 90 10 00 1d mov %i5, %o0 40008054: 92 22 40 1c sub %o1, %i4, %o1 40008058: 7f ff ff 69 call 40007dfc <_RBTree_Rotate> 4000805c: ba 10 00 19 mov %i1, %i5 40008060: 10 bf ff d4 b 40007fb0 <_RBTree_Insert+0x13c> 40008064: b2 10 00 1d mov %i5, %i1 } } if(!the_node->parent->parent) the_node->color = RBT_BLACK; 40008068: 12 80 00 03 bne 40008074 <_RBTree_Insert+0x200> 4000806c: b0 10 20 00 clr %i0 40008070: c0 26 60 0c clr [ %i1 + 0xc ] 40008074: 81 c7 e0 08 ret 40008078: 81 e8 00 00 restore RBTree_Node *_RBTree_Insert( RBTree_Control *the_rbtree, RBTree_Node *the_node ) { if(!the_node) return (RBTree_Node*)-1; 4000807c: 81 c7 e0 08 ret 40008080: 91 e8 3f ff restore %g0, -1, %o0 40008084: b0 10 00 1d mov %i5, %i0 /* verify red-black properties */ _RBTree_Validate_insert(the_node); } return (RBTree_Node*)0; } 40008088: 81 c7 e0 08 ret 4000808c: 81 e8 00 00 restore =============================================================================== 4000a70c <_RBTree_Iterate>: const RBTree_Control *rbtree, RBTree_Direction dir, RBTree_Visitor visitor, void *visitor_arg ) { 4000a70c: 9d e3 bf a0 save %sp, -96, %sp */ RTEMS_INLINE_ROUTINE RBTree_Direction _RBTree_Opposite_direction( RBTree_Direction the_dir ) { return (RBTree_Direction) !((int) the_dir); 4000a710: 80 a0 00 19 cmp %g0, %i1 4000a714: 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]; 4000a718: 82 00 60 02 add %g1, 2, %g1 4000a71c: 83 28 60 02 sll %g1, 2, %g1 4000a720: fa 06 00 01 ld [ %i0 + %g1 ], %i5 RBTree_Direction opp_dir = _RBTree_Opposite_direction( dir ); const RBTree_Node *current = _RBTree_First( rbtree, opp_dir ); bool stop = false; 4000a724: b8 10 20 00 clr %i4 while ( !stop && current != NULL ) { 4000a728: 80 a7 60 00 cmp %i5, 0 4000a72c: 02 80 00 0e be 4000a764 <_RBTree_Iterate+0x58> 4000a730: b8 1f 20 01 xor %i4, 1, %i4 4000a734: 80 8f 20 ff btst 0xff, %i4 4000a738: 02 80 00 0b be 4000a764 <_RBTree_Iterate+0x58> <== NEVER TAKEN 4000a73c: 90 10 00 1d mov %i5, %o0 stop = (*visitor)( current, dir, visitor_arg ); 4000a740: 92 10 00 19 mov %i1, %o1 4000a744: 9f c6 80 00 call %i2 4000a748: 94 10 00 1b mov %i3, %o2 current = _RBTree_Next( current, dir ); 4000a74c: 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 ); 4000a750: b8 10 00 08 mov %o0, %i4 current = _RBTree_Next( current, dir ); 4000a754: 40 00 00 06 call 4000a76c <_RBTree_Next> 4000a758: 90 10 00 1d mov %i5, %o0 4000a75c: 10 bf ff f3 b 4000a728 <_RBTree_Iterate+0x1c> 4000a760: ba 10 00 08 mov %o0, %i5 4000a764: 81 c7 e0 08 ret 4000a768: 81 e8 00 00 restore =============================================================================== 4000f3dc <_RBTree_Rotate>: RBTree_Node *the_node, RBTree_Direction dir ) { RBTree_Node *c; if (the_node == NULL) return; 4000f3dc: 80 a2 20 00 cmp %o0, 0 4000f3e0: 02 80 00 1b be 4000f44c <_RBTree_Rotate+0x70> <== NEVER TAKEN 4000f3e4: 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); 4000f3e8: 84 60 3f ff subx %g0, -1, %g2 4000f3ec: 85 28 a0 02 sll %g2, 2, %g2 4000f3f0: 84 02 00 02 add %o0, %g2, %g2 RBTree_Direction dir ) { RBTree_Node *c; if (the_node == NULL) return; if (the_node->child[_RBTree_Opposite_direction(dir)] == NULL) return; 4000f3f4: c2 00 a0 04 ld [ %g2 + 4 ], %g1 4000f3f8: 80 a0 60 00 cmp %g1, 0 4000f3fc: 02 80 00 14 be 4000f44c <_RBTree_Rotate+0x70> <== NEVER TAKEN 4000f400: 93 2a 60 02 sll %o1, 2, %o1 4000f404: 92 00 40 09 add %g1, %o1, %o1 c = the_node->child[_RBTree_Opposite_direction(dir)]; the_node->child[_RBTree_Opposite_direction(dir)] = c->child[dir]; 4000f408: c6 02 60 04 ld [ %o1 + 4 ], %g3 4000f40c: c6 20 a0 04 st %g3, [ %g2 + 4 ] if (c->child[dir]) 4000f410: c4 02 60 04 ld [ %o1 + 4 ], %g2 4000f414: 80 a0 a0 00 cmp %g2, 0 4000f418: 32 80 00 02 bne,a 4000f420 <_RBTree_Rotate+0x44> 4000f41c: d0 20 80 00 st %o0, [ %g2 ] c->child[dir]->parent = the_node; c->child[dir] = the_node; 4000f420: d0 22 60 04 st %o0, [ %o1 + 4 ] the_node->parent->child[the_node != the_node->parent->child[0]] = c; 4000f424: c4 02 00 00 ld [ %o0 ], %g2 4000f428: c6 00 a0 04 ld [ %g2 + 4 ], %g3 4000f42c: 86 1a 00 03 xor %o0, %g3, %g3 4000f430: 80 a0 00 03 cmp %g0, %g3 4000f434: 86 40 20 00 addx %g0, 0, %g3 4000f438: 87 28 e0 02 sll %g3, 2, %g3 4000f43c: 86 00 80 03 add %g2, %g3, %g3 4000f440: c2 20 e0 04 st %g1, [ %g3 + 4 ] c->parent = the_node->parent; 4000f444: c4 20 40 00 st %g2, [ %g1 ] the_node->parent = c; 4000f448: c2 22 00 00 st %g1, [ %o0 ] 4000f44c: 81 c3 e0 08 retl =============================================================================== 4000f394 <_RBTree_Sibling>: */ RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_Sibling( const RBTree_Node *the_node ) { if(!the_node) return NULL; 4000f394: 80 a2 20 00 cmp %o0, 0 4000f398: 02 80 00 0f be 4000f3d4 <_RBTree_Sibling+0x40> <== NEVER TAKEN 4000f39c: 82 10 20 00 clr %g1 if(!(the_node->parent)) return NULL; 4000f3a0: c2 02 00 00 ld [ %o0 ], %g1 4000f3a4: 80 a0 60 00 cmp %g1, 0 4000f3a8: 02 80 00 0b be 4000f3d4 <_RBTree_Sibling+0x40> <== NEVER TAKEN 4000f3ac: 01 00 00 00 nop if(!(the_node->parent->parent)) return NULL; 4000f3b0: c4 00 40 00 ld [ %g1 ], %g2 4000f3b4: 80 a0 a0 00 cmp %g2, 0 4000f3b8: 22 80 00 07 be,a 4000f3d4 <_RBTree_Sibling+0x40> 4000f3bc: 82 10 20 00 clr %g1 if(the_node == the_node->parent->child[RBT_LEFT]) 4000f3c0: c4 00 60 04 ld [ %g1 + 4 ], %g2 4000f3c4: 80 a2 00 02 cmp %o0, %g2 4000f3c8: 32 80 00 03 bne,a 4000f3d4 <_RBTree_Sibling+0x40> 4000f3cc: 82 10 00 02 mov %g2, %g1 4000f3d0: c2 00 60 08 ld [ %g1 + 8 ], %g1 return the_node->parent->child[RBT_RIGHT]; else return the_node->parent->child[RBT_LEFT]; } 4000f3d4: 81 c3 e0 08 retl 4000f3d8: 90 10 00 01 mov %g1, %o0 =============================================================================== 4000d290 <_RTEMS_Tasks_Invoke_task_variable_dtor>: void _RTEMS_Tasks_Invoke_task_variable_dtor( Thread_Control *the_thread, rtems_task_variable_t *tvp ) { 4000d290: 9d e3 bf a0 save %sp, -96, %sp <== NOT EXECUTED void (*dtor)(void *); void *value; dtor = tvp->dtor; if (_Thread_Get_executing() == the_thread) { 4000d294: c4 01 a0 18 ld [ %g6 + 0x18 ], %g2 <== NOT EXECUTED 4000d298: 80 a0 80 18 cmp %g2, %i0 <== NOT EXECUTED 4000d29c: 12 80 00 07 bne 4000d2b8 <_RTEMS_Tasks_Invoke_task_variable_dtor+0x28><== NOT EXECUTED 4000d2a0: c2 06 60 10 ld [ %i1 + 0x10 ], %g1 <== NOT EXECUTED value = *tvp->ptr; 4000d2a4: c4 06 60 04 ld [ %i1 + 4 ], %g2 <== NOT EXECUTED *tvp->ptr = tvp->gval; 4000d2a8: c6 06 60 08 ld [ %i1 + 8 ], %g3 <== NOT EXECUTED void (*dtor)(void *); void *value; dtor = tvp->dtor; if (_Thread_Get_executing() == the_thread) { value = *tvp->ptr; 4000d2ac: d0 00 80 00 ld [ %g2 ], %o0 <== NOT EXECUTED 4000d2b0: 10 80 00 03 b 4000d2bc <_RTEMS_Tasks_Invoke_task_variable_dtor+0x2c><== NOT EXECUTED 4000d2b4: c6 20 80 00 st %g3, [ %g2 ] <== NOT EXECUTED *tvp->ptr = tvp->gval; } else { value = tvp->tval; 4000d2b8: d0 06 60 0c ld [ %i1 + 0xc ], %o0 <== NOT EXECUTED } if ( dtor ) 4000d2bc: 80 a0 60 00 cmp %g1, 0 <== NOT EXECUTED 4000d2c0: 02 80 00 04 be 4000d2d0 <_RTEMS_Tasks_Invoke_task_variable_dtor+0x40><== NOT EXECUTED 4000d2c4: 01 00 00 00 nop <== NOT EXECUTED (*dtor)(value); 4000d2c8: 9f c0 40 00 call %g1 <== NOT EXECUTED 4000d2cc: 01 00 00 00 nop <== NOT EXECUTED _Workspace_Free(tvp); 4000d2d0: 7f ff f8 3b call 4000b3bc <_Workspace_Free> <== NOT EXECUTED 4000d2d4: 91 e8 00 19 restore %g0, %i1, %o0 <== NOT EXECUTED =============================================================================== 4000d188 <_RTEMS_tasks_Switch_extension>: /* * Per Task Variables are only enabled in uniprocessor configurations */ tvp = executing->task_variables; 4000d188: c2 02 21 34 ld [ %o0 + 0x134 ], %g1 while (tvp) { 4000d18c: 80 a0 60 00 cmp %g1, 0 4000d190: 22 80 00 09 be,a 4000d1b4 <_RTEMS_tasks_Switch_extension+0x2c><== ALWAYS TAKEN 4000d194: c2 02 61 34 ld [ %o1 + 0x134 ], %g1 tvp->tval = *tvp->ptr; 4000d198: c4 00 60 04 ld [ %g1 + 4 ], %g2 <== NOT EXECUTED 4000d19c: c6 00 80 00 ld [ %g2 ], %g3 <== NOT EXECUTED 4000d1a0: c6 20 60 0c st %g3, [ %g1 + 0xc ] <== NOT EXECUTED *tvp->ptr = tvp->gval; 4000d1a4: c6 00 60 08 ld [ %g1 + 8 ], %g3 <== NOT EXECUTED 4000d1a8: c6 20 80 00 st %g3, [ %g2 ] <== NOT EXECUTED tvp = (rtems_task_variable_t *)tvp->next; 4000d1ac: 10 bf ff f8 b 4000d18c <_RTEMS_tasks_Switch_extension+0x4><== NOT EXECUTED 4000d1b0: c2 00 40 00 ld [ %g1 ], %g1 <== NOT EXECUTED } tvp = heir->task_variables; while (tvp) { 4000d1b4: 80 a0 60 00 cmp %g1, 0 4000d1b8: 02 80 00 09 be 4000d1dc <_RTEMS_tasks_Switch_extension+0x54><== ALWAYS TAKEN 4000d1bc: 01 00 00 00 nop tvp->gval = *tvp->ptr; 4000d1c0: c4 00 60 04 ld [ %g1 + 4 ], %g2 <== NOT EXECUTED 4000d1c4: c6 00 80 00 ld [ %g2 ], %g3 <== NOT EXECUTED 4000d1c8: c6 20 60 08 st %g3, [ %g1 + 8 ] <== NOT EXECUTED *tvp->ptr = tvp->tval; 4000d1cc: c6 00 60 0c ld [ %g1 + 0xc ], %g3 <== NOT EXECUTED 4000d1d0: c6 20 80 00 st %g3, [ %g2 ] <== NOT EXECUTED tvp = (rtems_task_variable_t *)tvp->next; 4000d1d4: 10 bf ff f8 b 4000d1b4 <_RTEMS_tasks_Switch_extension+0x2c><== NOT EXECUTED 4000d1d8: c2 00 40 00 ld [ %g1 ], %g1 <== NOT EXECUTED } } 4000d1dc: 81 c3 e0 08 retl =============================================================================== 4000d20c <_RTEMS_tasks_Terminate_extension>: } static void _RTEMS_tasks_Terminate_extension( Thread_Control *executing ) { 4000d20c: 9d e3 bf a0 save %sp, -96, %sp */ #if !defined(RTEMS_SMP) do { rtems_task_variable_t *tvp, *next; tvp = executing->task_variables; 4000d210: d2 06 21 34 ld [ %i0 + 0x134 ], %o1 executing->task_variables = NULL; 4000d214: c0 26 21 34 clr [ %i0 + 0x134 ] while (tvp) { 4000d218: 80 a2 60 00 cmp %o1, 0 4000d21c: 02 80 00 07 be 4000d238 <_RTEMS_tasks_Terminate_extension+0x2c><== ALWAYS TAKEN 4000d220: 01 00 00 00 nop next = (rtems_task_variable_t *)tvp->next; 4000d224: fa 02 40 00 ld [ %o1 ], %i5 <== NOT EXECUTED _RTEMS_Tasks_Invoke_task_variable_dtor( executing, tvp ); 4000d228: 40 00 00 1a call 4000d290 <_RTEMS_Tasks_Invoke_task_variable_dtor><== NOT EXECUTED 4000d22c: 90 10 00 18 mov %i0, %o0 <== NOT EXECUTED tvp = next; 4000d230: 10 bf ff fa b 4000d218 <_RTEMS_tasks_Terminate_extension+0xc><== NOT EXECUTED 4000d234: 92 10 00 1d mov %i5, %o1 <== NOT EXECUTED #endif /* * Run all the key destructors */ _POSIX_Keys_Run_destructors( executing ); 4000d238: 40 00 06 6b call 4000ebe4 <_POSIX_Keys_Run_destructors> 4000d23c: 81 e8 00 00 restore =============================================================================== 40008148 <_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 ) { 40008148: 9d e3 bf 98 save %sp, -104, %sp */ static inline void _TOD_Get_uptime( Timestamp_Control *time ) { _TOD_Get_with_nanoseconds( time, &_TOD.uptime ); 4000814c: 13 10 00 68 sethi %hi(0x4001a000), %o1 #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ Timestamp_Control uptime; #endif Thread_Control *owning_thread = the_period->owner; 40008150: f6 06 20 40 ld [ %i0 + 0x40 ], %i3 40008154: 90 07 bf f8 add %fp, -8, %o0 40008158: 40 00 06 9f call 40009bd4 <_TOD_Get_with_nanoseconds> 4000815c: 92 12 63 68 or %o1, 0x368, %o1 /* * Determine elapsed wall time since period initiated. */ #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ _TOD_Get_uptime( &uptime ); _Timestamp_Subtract( 40008160: c4 1f bf f8 ldd [ %fp + -8 ], %g2 const Timestamp64_Control *_start, const Timestamp64_Control *_end, Timestamp64_Control *_result ) { *_result = *_end - *_start; 40008164: f8 1e 20 50 ldd [ %i0 + 0x50 ], %i4 if (used < the_period->cpu_usage_period_initiated) return false; *cpu_since_last_period = used - the_period->cpu_usage_period_initiated; #endif return true; 40008168: 82 10 20 01 mov 1, %g1 4000816c: ba a0 c0 1d subcc %g3, %i5, %i5 40008170: b8 60 80 1c subx %g2, %i4, %i4 40008174: f8 3e 40 00 std %i4, [ %i1 ] * Determine cpu usage since period initiated. */ used = owning_thread->cpu_time_used; #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ if (owning_thread == _Thread_Executing) { 40008178: fa 01 a0 18 ld [ %g6 + 0x18 ], %i5 4000817c: 80 a6 c0 1d cmp %i3, %i5 40008180: 12 80 00 15 bne 400081d4 <_Rate_monotonic_Get_status+0x8c> 40008184: d8 1e e0 80 ldd [ %i3 + 0x80 ], %o4 40008188: f8 19 a0 20 ldd [ %g6 + 0x20 ], %i4 4000818c: 86 a0 c0 1d subcc %g3, %i5, %g3 40008190: 84 60 80 1c subx %g2, %i4, %g2 static inline void _Timestamp64_implementation_Add_to( Timestamp64_Control *_time, const Timestamp64_Control *_add ) { *_time += *_add; 40008194: ba 83 40 03 addcc %o5, %g3, %i5 40008198: b8 43 00 02 addx %o4, %g2, %i4 /* * The cpu usage info was reset while executing. Can't * determine a status. */ if (_Timestamp_Less_than(&used, &the_period->cpu_usage_period_initiated)) 4000819c: c4 1e 20 48 ldd [ %i0 + 0x48 ], %g2 400081a0: 80 a0 80 1c cmp %g2, %i4 400081a4: 34 80 00 0c bg,a 400081d4 <_Rate_monotonic_Get_status+0x8c><== NEVER TAKEN 400081a8: 82 10 20 00 clr %g1 <== NOT EXECUTED 400081ac: 32 80 00 06 bne,a 400081c4 <_Rate_monotonic_Get_status+0x7c> 400081b0: 86 a7 40 03 subcc %i5, %g3, %g3 400081b4: 80 a0 c0 1d cmp %g3, %i5 400081b8: 18 80 00 06 bgu 400081d0 <_Rate_monotonic_Get_status+0x88> 400081bc: 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; 400081c0: 82 10 20 01 mov 1, %g1 const Timestamp64_Control *_start, const Timestamp64_Control *_end, Timestamp64_Control *_result ) { *_result = *_end - *_start; 400081c4: 84 67 00 02 subx %i4, %g2, %g2 400081c8: 10 80 00 03 b 400081d4 <_Rate_monotonic_Get_status+0x8c> 400081cc: 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; 400081d0: 82 10 20 00 clr %g1 return false; *cpu_since_last_period = used - the_period->cpu_usage_period_initiated; #endif return true; } 400081d4: b0 08 60 01 and %g1, 1, %i0 400081d8: 81 c7 e0 08 ret 400081dc: 81 e8 00 00 restore =============================================================================== 400087fc <_Rate_monotonic_Timeout>: void _Rate_monotonic_Timeout( Objects_Id id, void *ignored ) { 400087fc: 9d e3 bf 98 save %sp, -104, %sp 40008800: 11 10 00 68 sethi %hi(0x4001a000), %o0 40008804: 92 10 00 18 mov %i0, %o1 40008808: 90 12 22 a0 or %o0, 0x2a0, %o0 4000880c: 40 00 08 15 call 4000a860 <_Objects_Get> 40008810: 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 ) { 40008814: c2 07 bf fc ld [ %fp + -4 ], %g1 40008818: 80 a0 60 00 cmp %g1, 0 4000881c: 12 80 00 23 bne 400088a8 <_Rate_monotonic_Timeout+0xac> <== NEVER TAKEN 40008820: ba 10 00 08 mov %o0, %i5 case OBJECTS_LOCAL: the_thread = the_period->owner; 40008824: d0 02 20 40 ld [ %o0 + 0x40 ], %o0 if ( _States_Is_waiting_for_period( the_thread->current_state ) && 40008828: 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); 4000882c: c4 02 20 10 ld [ %o0 + 0x10 ], %g2 40008830: 80 88 80 01 btst %g2, %g1 40008834: 22 80 00 0b be,a 40008860 <_Rate_monotonic_Timeout+0x64> 40008838: c2 07 60 38 ld [ %i5 + 0x38 ], %g1 4000883c: c4 02 20 20 ld [ %o0 + 0x20 ], %g2 40008840: c2 07 60 08 ld [ %i5 + 8 ], %g1 40008844: 80 a0 80 01 cmp %g2, %g1 40008848: 32 80 00 06 bne,a 40008860 <_Rate_monotonic_Timeout+0x64> 4000884c: c2 07 60 38 ld [ %i5 + 0x38 ], %g1 40008850: 13 04 03 ff sethi %hi(0x100ffc00), %o1 40008854: 40 00 0a ce call 4000b38c <_Thread_Clear_state> 40008858: 92 12 63 f8 or %o1, 0x3f8, %o1 ! 100ffff8 4000885c: 30 80 00 06 b,a 40008874 <_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 ) { 40008860: 80 a0 60 01 cmp %g1, 1 40008864: 12 80 00 0d bne 40008898 <_Rate_monotonic_Timeout+0x9c> 40008868: 82 10 20 04 mov 4, %g1 the_period->state = RATE_MONOTONIC_EXPIRED_WHILE_BLOCKING; 4000886c: 82 10 20 03 mov 3, %g1 40008870: c2 27 60 38 st %g1, [ %i5 + 0x38 ] _Rate_monotonic_Initiate_statistics( the_period ); 40008874: 7f ff fe a4 call 40008304 <_Rate_monotonic_Initiate_statistics> 40008878: 90 10 00 1d mov %i5, %o0 Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 4000887c: c2 07 60 3c ld [ %i5 + 0x3c ], %g1 _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 40008880: 11 10 00 69 sethi %hi(0x4001a400), %o0 Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 40008884: c2 27 60 1c st %g1, [ %i5 + 0x1c ] _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 40008888: 90 12 20 10 or %o0, 0x10, %o0 4000888c: 40 00 0f fc call 4000c87c <_Watchdog_Insert> 40008890: 92 07 60 10 add %i5, 0x10, %o1 40008894: 30 80 00 02 b,a 4000889c <_Rate_monotonic_Timeout+0xa0> _Watchdog_Insert_ticks( &the_period->Timer, the_period->next_length ); } else the_period->state = RATE_MONOTONIC_EXPIRED; 40008898: 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 disable_level = _Thread_Dispatch_disable_level; 4000889c: c4 01 a0 10 ld [ %g6 + 0x10 ], %g2 ISR_Level level; _ISR_Disable( level ); #endif --disable_level; 400088a0: 84 00 bf ff add %g2, -1, %g2 _Thread_Dispatch_disable_level = disable_level; 400088a4: c4 21 a0 10 st %g2, [ %g6 + 0x10 ] 400088a8: 81 c7 e0 08 ret 400088ac: 81 e8 00 00 restore =============================================================================== 400081e0 <_Rate_monotonic_Update_statistics>: } static void _Rate_monotonic_Update_statistics( Rate_monotonic_Control *the_period ) { 400081e0: 9d e3 bf 90 save %sp, -112, %sp /* * Update the counts. */ stats = &the_period->Statistics; stats->count++; 400081e4: c2 06 20 58 ld [ %i0 + 0x58 ], %g1 400081e8: 82 00 60 01 inc %g1 400081ec: c2 26 20 58 st %g1, [ %i0 + 0x58 ] if ( the_period->state == RATE_MONOTONIC_EXPIRED ) 400081f0: c2 06 20 38 ld [ %i0 + 0x38 ], %g1 400081f4: 80 a0 60 04 cmp %g1, 4 400081f8: 12 80 00 05 bne 4000820c <_Rate_monotonic_Update_statistics+0x2c> 400081fc: 90 10 00 18 mov %i0, %o0 stats->missed_count++; 40008200: c2 06 20 5c ld [ %i0 + 0x5c ], %g1 40008204: 82 00 60 01 inc %g1 40008208: c2 26 20 5c st %g1, [ %i0 + 0x5c ] /* * Grab status for time statistics. */ valid_status = 4000820c: 92 07 bf f8 add %fp, -8, %o1 40008210: 7f ff ff ce call 40008148 <_Rate_monotonic_Get_status> 40008214: 94 07 bf f0 add %fp, -16, %o2 _Rate_monotonic_Get_status( the_period, &since_last_period, &executed ); if (!valid_status) 40008218: 80 a2 20 00 cmp %o0, 0 4000821c: 02 80 00 38 be 400082fc <_Rate_monotonic_Update_statistics+0x11c> 40008220: c4 1f bf f0 ldd [ %fp + -16 ], %g2 static inline void _Timestamp64_implementation_Add_to( Timestamp64_Control *_time, const Timestamp64_Control *_add ) { *_time += *_add; 40008224: 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 ) ) 40008228: c2 06 20 60 ld [ %i0 + 0x60 ], %g1 4000822c: b6 87 40 03 addcc %i5, %g3, %i3 40008230: b4 47 00 02 addx %i4, %g2, %i2 40008234: 80 a0 40 02 cmp %g1, %g2 40008238: 14 80 00 09 bg 4000825c <_Rate_monotonic_Update_statistics+0x7c> 4000823c: f4 3e 20 70 std %i2, [ %i0 + 0x70 ] 40008240: 80 a0 40 02 cmp %g1, %g2 40008244: 32 80 00 08 bne,a 40008264 <_Rate_monotonic_Update_statistics+0x84><== NEVER TAKEN 40008248: c2 06 20 68 ld [ %i0 + 0x68 ], %g1 <== NOT EXECUTED 4000824c: c2 06 20 64 ld [ %i0 + 0x64 ], %g1 40008250: 80 a0 40 03 cmp %g1, %g3 40008254: 28 80 00 04 bleu,a 40008264 <_Rate_monotonic_Update_statistics+0x84> 40008258: c2 06 20 68 ld [ %i0 + 0x68 ], %g1 stats->min_cpu_time = executed; 4000825c: c4 3e 20 60 std %g2, [ %i0 + 0x60 ] if ( _Timestamp_Greater_than( &executed, &stats->max_cpu_time ) ) 40008260: c2 06 20 68 ld [ %i0 + 0x68 ], %g1 40008264: 80 a0 40 02 cmp %g1, %g2 40008268: 26 80 00 0a bl,a 40008290 <_Rate_monotonic_Update_statistics+0xb0><== NEVER TAKEN 4000826c: c4 3e 20 68 std %g2, [ %i0 + 0x68 ] <== NOT EXECUTED 40008270: 80 a0 40 02 cmp %g1, %g2 40008274: 32 80 00 08 bne,a 40008294 <_Rate_monotonic_Update_statistics+0xb4><== NEVER TAKEN 40008278: c4 1f bf f8 ldd [ %fp + -8 ], %g2 <== NOT EXECUTED 4000827c: c2 06 20 6c ld [ %i0 + 0x6c ], %g1 40008280: 80 a0 40 03 cmp %g1, %g3 40008284: 3a 80 00 04 bcc,a 40008294 <_Rate_monotonic_Update_statistics+0xb4> 40008288: c4 1f bf f8 ldd [ %fp + -8 ], %g2 stats->max_cpu_time = executed; 4000828c: 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 ); 40008290: c4 1f bf f8 ldd [ %fp + -8 ], %g2 40008294: f8 1e 20 88 ldd [ %i0 + 0x88 ], %i4 if ( _Timestamp_Less_than( &since_last_period, &stats->min_wall_time ) ) 40008298: c2 06 20 78 ld [ %i0 + 0x78 ], %g1 4000829c: b6 87 40 03 addcc %i5, %g3, %i3 400082a0: b4 47 00 02 addx %i4, %g2, %i2 400082a4: 80 a0 40 02 cmp %g1, %g2 400082a8: 14 80 00 09 bg 400082cc <_Rate_monotonic_Update_statistics+0xec> 400082ac: f4 3e 20 88 std %i2, [ %i0 + 0x88 ] 400082b0: 80 a0 40 02 cmp %g1, %g2 400082b4: 32 80 00 08 bne,a 400082d4 <_Rate_monotonic_Update_statistics+0xf4><== NEVER TAKEN 400082b8: c2 06 20 80 ld [ %i0 + 0x80 ], %g1 <== NOT EXECUTED 400082bc: c2 06 20 7c ld [ %i0 + 0x7c ], %g1 400082c0: 80 a0 40 03 cmp %g1, %g3 400082c4: 28 80 00 04 bleu,a 400082d4 <_Rate_monotonic_Update_statistics+0xf4> 400082c8: c2 06 20 80 ld [ %i0 + 0x80 ], %g1 stats->min_wall_time = since_last_period; 400082cc: c4 3e 20 78 std %g2, [ %i0 + 0x78 ] if ( _Timestamp_Greater_than( &since_last_period, &stats->max_wall_time ) ) 400082d0: c2 06 20 80 ld [ %i0 + 0x80 ], %g1 400082d4: 80 a0 40 02 cmp %g1, %g2 400082d8: 26 80 00 09 bl,a 400082fc <_Rate_monotonic_Update_statistics+0x11c><== NEVER TAKEN 400082dc: c4 3e 20 80 std %g2, [ %i0 + 0x80 ] <== NOT EXECUTED 400082e0: 80 a0 40 02 cmp %g1, %g2 400082e4: 12 80 00 06 bne 400082fc <_Rate_monotonic_Update_statistics+0x11c><== NEVER TAKEN 400082e8: 01 00 00 00 nop 400082ec: c2 06 20 84 ld [ %i0 + 0x84 ], %g1 400082f0: 80 a0 40 03 cmp %g1, %g3 400082f4: 2a 80 00 02 bcs,a 400082fc <_Rate_monotonic_Update_statistics+0x11c> 400082f8: c4 3e 20 80 std %g2, [ %i0 + 0x80 ] 400082fc: 81 c7 e0 08 ret 40008300: 81 e8 00 00 restore =============================================================================== 4000b24c <_Scheduler_CBS_Attach_thread>: int _Scheduler_CBS_Attach_thread ( Scheduler_CBS_Server_id server_id, rtems_id task_id ) { 4000b24c: 9d e3 bf 98 save %sp, -104, %sp Objects_Locations location; Thread_Control *the_thread; if ( server_id >= _Scheduler_CBS_Maximum_servers ) 4000b250: 03 10 00 5f sethi %hi(0x40017c00), %g1 4000b254: c2 00 62 a0 ld [ %g1 + 0x2a0 ], %g1 ! 40017ea0 <_Scheduler_CBS_Maximum_servers> 4000b258: 80 a6 00 01 cmp %i0, %g1 4000b25c: 0a 80 00 04 bcs 4000b26c <_Scheduler_CBS_Attach_thread+0x20> 4000b260: 83 2e 20 02 sll %i0, 2, %g1 return SCHEDULER_CBS_ERROR_INVALID_PARAMETER; 4000b264: 81 c7 e0 08 ret 4000b268: 91 e8 3f ee restore %g0, -18, %o0 /* Server is not valid. */ if ( !_Scheduler_CBS_Server_list[server_id].initialized ) 4000b26c: 3b 10 00 67 sethi %hi(0x40019c00), %i5 4000b270: b1 2e 20 04 sll %i0, 4, %i0 4000b274: ba 17 63 20 or %i5, 0x320, %i5 4000b278: b0 00 40 18 add %g1, %i0, %i0 4000b27c: b8 07 40 18 add %i5, %i0, %i4 4000b280: c2 0f 20 10 ldub [ %i4 + 0x10 ], %g1 4000b284: 80 a0 60 00 cmp %g1, 0 4000b288: 02 80 00 1f be 4000b304 <_Scheduler_CBS_Attach_thread+0xb8> 4000b28c: 01 00 00 00 nop return SCHEDULER_CBS_ERROR_NOSERVER; /* Server is already attached to a thread. */ if ( _Scheduler_CBS_Server_list[server_id].task_id != -1 ) 4000b290: c2 07 40 18 ld [ %i5 + %i0 ], %g1 4000b294: 80 a0 7f ff cmp %g1, -1 4000b298: 12 80 00 1d bne 4000b30c <_Scheduler_CBS_Attach_thread+0xc0> 4000b29c: 90 10 00 19 mov %i1, %o0 return SCHEDULER_CBS_ERROR_FULL; the_thread = _Thread_Get(task_id, &location); 4000b2a0: 40 00 03 95 call 4000c0f4 <_Thread_Get> 4000b2a4: 92 07 bf fc add %fp, -4, %o1 /* The routine _Thread_Get may disable dispatch and not enable again. */ if ( the_thread ) { 4000b2a8: 80 a2 20 00 cmp %o0, 0 4000b2ac: 02 bf ff ee be 4000b264 <_Scheduler_CBS_Attach_thread+0x18> 4000b2b0: 01 00 00 00 nop * * @{ */ RTEMS_INLINE_ROUTINE Scheduler_CBS_Node *_Scheduler_CBS_Node_get( Thread_Control *the_thread 4000b2b4: c2 02 20 88 ld [ %o0 + 0x88 ], %g1 Scheduler_CBS_Node *node = _Scheduler_CBS_Node_get( the_thread ); /* Thread is already attached to a server. */ if ( node->cbs_server ) { 4000b2b8: c4 00 60 18 ld [ %g1 + 0x18 ], %g2 4000b2bc: 80 a0 a0 00 cmp %g2, 0 4000b2c0: 22 80 00 05 be,a 4000b2d4 <_Scheduler_CBS_Attach_thread+0x88><== ALWAYS TAKEN 4000b2c4: f2 27 40 18 st %i1, [ %i5 + %i0 ] RTEMS_INLINE_ROUTINE void _Objects_Put( Objects_Control *the_object ) { (void) the_object; _Thread_Enable_dispatch(); 4000b2c8: 40 00 03 80 call 4000c0c8 <_Thread_Enable_dispatch> <== NOT EXECUTED 4000b2cc: b0 10 3f e6 mov -26, %i0 <== NOT EXECUTED 4000b2d0: 30 80 00 10 b,a 4000b310 <_Scheduler_CBS_Attach_thread+0xc4><== NOT EXECUTED _Objects_Put( &the_thread->Object ); return SCHEDULER_CBS_ERROR_FULL; } _Scheduler_CBS_Server_list[server_id].task_id = task_id; node->cbs_server = &_Scheduler_CBS_Server_list[server_id]; 4000b2d4: f8 20 60 18 st %i4, [ %g1 + 0x18 ] the_thread->budget_callout = _Scheduler_CBS_Budget_callout; 4000b2d8: 03 10 00 2d sethi %hi(0x4000b400), %g1 4000b2dc: 82 10 63 84 or %g1, 0x384, %g1 ! 4000b784 <_Scheduler_CBS_Budget_callout> 4000b2e0: c2 22 20 7c st %g1, [ %o0 + 0x7c ] the_thread->budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_CALLOUT; 4000b2e4: 82 10 20 03 mov 3, %g1 4000b2e8: c2 22 20 78 st %g1, [ %o0 + 0x78 ] the_thread->is_preemptible = true; 4000b2ec: 82 10 20 01 mov 1, %g1 _Objects_Put( &the_thread->Object ); } else { return SCHEDULER_CBS_ERROR_INVALID_PARAMETER; } return SCHEDULER_CBS_OK; 4000b2f0: b0 10 20 00 clr %i0 4000b2f4: 40 00 03 75 call 4000c0c8 <_Thread_Enable_dispatch> 4000b2f8: c2 2a 20 70 stb %g1, [ %o0 + 0x70 ] 4000b2fc: 81 c7 e0 08 ret 4000b300: 81 e8 00 00 restore if ( server_id >= _Scheduler_CBS_Maximum_servers ) return SCHEDULER_CBS_ERROR_INVALID_PARAMETER; /* Server is not valid. */ if ( !_Scheduler_CBS_Server_list[server_id].initialized ) return SCHEDULER_CBS_ERROR_NOSERVER; 4000b304: 81 c7 e0 08 ret 4000b308: 91 e8 3f e7 restore %g0, -25, %o0 /* Server is already attached to a thread. */ if ( _Scheduler_CBS_Server_list[server_id].task_id != -1 ) return SCHEDULER_CBS_ERROR_FULL; 4000b30c: b0 10 3f e6 mov -26, %i0 } else { return SCHEDULER_CBS_ERROR_INVALID_PARAMETER; } return SCHEDULER_CBS_OK; } 4000b310: 81 c7 e0 08 ret 4000b314: 81 e8 00 00 restore =============================================================================== 4000b784 <_Scheduler_CBS_Budget_callout>: #include void _Scheduler_CBS_Budget_callout( Thread_Control *the_thread ) { 4000b784: 9d e3 bf 98 save %sp, -104, %sp Priority_Control new_priority; Scheduler_CBS_Node *node; Scheduler_CBS_Server_id server_id; /* Put violating task to background until the end of period. */ new_priority = the_thread->Start.initial_priority; 4000b788: d2 06 20 ac ld [ %i0 + 0xac ], %o1 if ( the_thread->real_priority != new_priority ) 4000b78c: c2 06 20 18 ld [ %i0 + 0x18 ], %g1 4000b790: 80 a0 40 09 cmp %g1, %o1 4000b794: 32 80 00 02 bne,a 4000b79c <_Scheduler_CBS_Budget_callout+0x18><== ALWAYS TAKEN 4000b798: d2 26 20 18 st %o1, [ %i0 + 0x18 ] the_thread->real_priority = new_priority; if ( the_thread->current_priority != new_priority ) 4000b79c: c2 06 20 14 ld [ %i0 + 0x14 ], %g1 4000b7a0: 80 a0 40 09 cmp %g1, %o1 4000b7a4: 02 80 00 04 be 4000b7b4 <_Scheduler_CBS_Budget_callout+0x30><== NEVER TAKEN 4000b7a8: 90 10 00 18 mov %i0, %o0 _Thread_Change_priority(the_thread, new_priority, true); 4000b7ac: 40 00 01 5a call 4000bd14 <_Thread_Change_priority> 4000b7b0: 94 10 20 01 mov 1, %o2 4000b7b4: fa 06 20 88 ld [ %i0 + 0x88 ], %i5 /* Invoke callback function if any. */ node = _Scheduler_CBS_Node_get( the_thread ); if ( node->cbs_server->cbs_budget_overrun ) { 4000b7b8: c2 07 60 18 ld [ %i5 + 0x18 ], %g1 4000b7bc: c4 00 60 0c ld [ %g1 + 0xc ], %g2 4000b7c0: 80 a0 a0 00 cmp %g2, 0 4000b7c4: 02 80 00 09 be 4000b7e8 <_Scheduler_CBS_Budget_callout+0x64><== NEVER TAKEN 4000b7c8: 01 00 00 00 nop _Scheduler_CBS_Get_server_id( 4000b7cc: d0 00 40 00 ld [ %g1 ], %o0 4000b7d0: 7f ff ff d0 call 4000b710 <_Scheduler_CBS_Get_server_id> 4000b7d4: 92 07 bf fc add %fp, -4, %o1 node->cbs_server->task_id, &server_id ); node->cbs_server->cbs_budget_overrun( server_id ); 4000b7d8: c2 07 60 18 ld [ %i5 + 0x18 ], %g1 4000b7dc: c2 00 60 0c ld [ %g1 + 0xc ], %g1 4000b7e0: 9f c0 40 00 call %g1 4000b7e4: d0 07 bf fc ld [ %fp + -4 ], %o0 4000b7e8: 81 c7 e0 08 ret 4000b7ec: 81 e8 00 00 restore =============================================================================== 4000a58c <_Scheduler_CBS_Release_job>: Thread_Control *the_thread, uint32_t deadline ) { Scheduler_CBS_Node *node = _Scheduler_CBS_Node_get( the_thread ); Scheduler_CBS_Server *serv_info = node->cbs_server; 4000a58c: c2 02 60 88 ld [ %o1 + 0x88 ], %g1 void _Scheduler_CBS_Release_job( const Scheduler_Control *scheduler, Thread_Control *the_thread, uint32_t deadline ) { 4000a590: 90 10 00 09 mov %o1, %o0 Scheduler_CBS_Node *node = _Scheduler_CBS_Node_get( the_thread ); Scheduler_CBS_Server *serv_info = node->cbs_server; Priority_Control new_priority; if (deadline) { 4000a594: 80 a2 a0 00 cmp %o2, 0 4000a598: 02 80 00 0f be 4000a5d4 <_Scheduler_CBS_Release_job+0x48> 4000a59c: c2 00 60 18 ld [ %g1 + 0x18 ], %g1 4000a5a0: 05 10 00 61 sethi %hi(0x40018400), %g2 /* Initializing or shifting deadline. */ if (serv_info) new_priority = (_Watchdog_Ticks_since_boot + serv_info->parameters.deadline) 4000a5a4: d2 00 a3 80 ld [ %g2 + 0x380 ], %o1 ! 40018780 <_Watchdog_Ticks_since_boot> Scheduler_CBS_Server *serv_info = node->cbs_server; Priority_Control new_priority; if (deadline) { /* Initializing or shifting deadline. */ if (serv_info) 4000a5a8: 80 a0 60 00 cmp %g1, 0 4000a5ac: 02 80 00 07 be 4000a5c8 <_Scheduler_CBS_Release_job+0x3c> 4000a5b0: 94 02 80 09 add %o2, %o1, %o2 new_priority = (_Watchdog_Ticks_since_boot + serv_info->parameters.deadline) 4000a5b4: c4 00 60 04 ld [ %g1 + 4 ], %g2 4000a5b8: 92 02 40 02 add %o1, %g2, %o1 4000a5bc: 05 20 00 00 sethi %hi(0x80000000), %g2 4000a5c0: 10 80 00 08 b 4000a5e0 <_Scheduler_CBS_Release_job+0x54> 4000a5c4: 92 2a 40 02 andn %o1, %g2, %o1 & ~SCHEDULER_EDF_PRIO_MSB; else new_priority = (_Watchdog_Ticks_since_boot + deadline) 4000a5c8: 13 20 00 00 sethi %hi(0x80000000), %o1 4000a5cc: 10 80 00 07 b 4000a5e8 <_Scheduler_CBS_Release_job+0x5c> 4000a5d0: 92 2a 80 09 andn %o2, %o1, %o1 /* Switch back to background priority. */ new_priority = the_thread->Start.initial_priority; } /* Budget replenishment for the next job. */ if (serv_info) 4000a5d4: 80 a0 60 00 cmp %g1, 0 4000a5d8: 02 80 00 04 be 4000a5e8 <_Scheduler_CBS_Release_job+0x5c> <== NEVER TAKEN 4000a5dc: d2 02 60 ac ld [ %o1 + 0xac ], %o1 the_thread->cpu_time_budget = serv_info->parameters.budget; 4000a5e0: c2 00 60 08 ld [ %g1 + 8 ], %g1 4000a5e4: c2 22 20 74 st %g1, [ %o0 + 0x74 ] the_thread->real_priority = new_priority; 4000a5e8: d2 22 20 18 st %o1, [ %o0 + 0x18 ] _Thread_Change_priority(the_thread, new_priority, true); 4000a5ec: 94 10 20 01 mov 1, %o2 4000a5f0: 82 13 c0 00 mov %o7, %g1 4000a5f4: 40 00 01 0e call 4000aa2c <_Thread_Change_priority> 4000a5f8: 9e 10 40 00 mov %g1, %o7 =============================================================================== 4000a5fc <_Scheduler_CBS_Unblock>: void _Scheduler_CBS_Unblock( const Scheduler_Control *scheduler, Thread_Control *the_thread ) { 4000a5fc: 9d e3 bf a0 save %sp, -96, %sp 4000a600: f8 06 60 88 ld [ %i1 + 0x88 ], %i4 { Scheduler_EDF_Context *context = _Scheduler_EDF_Get_context( scheduler ); Scheduler_EDF_Node *node = _Scheduler_EDF_Node_get( the_thread ); _RBTree_Insert( &context->Ready, &node->Node ); 4000a604: d0 06 00 00 ld [ %i0 ], %o0 Scheduler_CBS_Node *node = _Scheduler_CBS_Node_get( the_thread ); Scheduler_CBS_Server *serv_info = node->cbs_server; 4000a608: fa 07 20 18 ld [ %i4 + 0x18 ], %i5 4000a60c: 7f ff ff 53 call 4000a358 <_RBTree_Insert> 4000a610: 92 07 20 04 add %i4, 4, %o1 node->queue_state = SCHEDULER_EDF_QUEUE_STATE_YES; 4000a614: 82 10 20 01 mov 1, %g1 * 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) { 4000a618: 80 a7 60 00 cmp %i5, 0 4000a61c: 02 80 00 19 be 4000a680 <_Scheduler_CBS_Unblock+0x84> 4000a620: c2 27 20 14 st %g1, [ %i4 + 0x14 ] 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 - 4000a624: 03 10 00 61 sethi %hi(0x40018400), %g1 _Watchdog_Ticks_since_boot; if ( deadline*budget_left > budget*deadline_left ) { 4000a628: 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 - 4000a62c: d0 00 63 80 ld [ %g1 + 0x380 ], %o0 4000a630: f8 06 60 18 ld [ %i1 + 0x18 ], %i4 _Watchdog_Ticks_since_boot; if ( deadline*budget_left > budget*deadline_left ) { 4000a634: 40 00 27 98 call 40014494 <.umul> 4000a638: 90 27 00 08 sub %i4, %o0, %o0 4000a63c: d2 06 60 74 ld [ %i1 + 0x74 ], %o1 4000a640: b6 10 00 08 mov %o0, %i3 4000a644: 40 00 27 94 call 40014494 <.umul> 4000a648: d0 07 60 08 ld [ %i5 + 8 ], %o0 4000a64c: 80 a6 c0 08 cmp %i3, %o0 4000a650: 24 80 00 0d ble,a 4000a684 <_Scheduler_CBS_Unblock+0x88> 4000a654: c4 01 a0 1c ld [ %g6 + 0x1c ], %g2 /* Put late unblocked task to background until the end of period. */ new_priority = the_thread->Start.initial_priority; 4000a658: d2 06 60 ac ld [ %i1 + 0xac ], %o1 if ( the_thread->real_priority != new_priority ) 4000a65c: 80 a7 00 09 cmp %i4, %o1 4000a660: 32 80 00 02 bne,a 4000a668 <_Scheduler_CBS_Unblock+0x6c> 4000a664: d2 26 60 18 st %o1, [ %i1 + 0x18 ] the_thread->real_priority = new_priority; if ( the_thread->current_priority != new_priority ) 4000a668: c2 06 60 14 ld [ %i1 + 0x14 ], %g1 4000a66c: 80 a0 40 09 cmp %g1, %o1 4000a670: 02 80 00 04 be 4000a680 <_Scheduler_CBS_Unblock+0x84> 4000a674: 90 10 00 19 mov %i1, %o0 _Thread_Change_priority(the_thread, new_priority, true); 4000a678: 40 00 00 ed call 4000aa2c <_Thread_Change_priority> 4000a67c: 94 10 20 01 mov 1, %o2 * 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( 4000a680: c4 01 a0 1c ld [ %g6 + 0x1c ], %g2 const Scheduler_Control *scheduler, Priority_Control p1, Priority_Control p2 ) { return ( *scheduler->Operations.priority_compare )( p1, p2 ); 4000a684: c2 06 20 28 ld [ %i0 + 0x28 ], %g1 4000a688: d0 06 60 14 ld [ %i1 + 0x14 ], %o0 4000a68c: 9f c0 40 00 call %g1 4000a690: d2 00 a0 14 ld [ %g2 + 0x14 ], %o1 * 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 ( 4000a694: 80 a2 20 00 cmp %o0, 0 4000a698: 04 80 00 0e ble 4000a6d0 <_Scheduler_CBS_Unblock+0xd4> 4000a69c: 01 00 00 00 nop the_thread->current_priority, _Thread_Heir->current_priority ) ) { _Thread_Heir = the_thread; if ( _Thread_Executing->is_preemptible || 4000a6a0: c4 01 a0 18 ld [ %g6 + 0x18 ], %g2 scheduler, the_thread->current_priority, _Thread_Heir->current_priority ) ) { _Thread_Heir = the_thread; 4000a6a4: f2 21 a0 1c st %i1, [ %g6 + 0x1c ] if ( _Thread_Executing->is_preemptible || 4000a6a8: c4 08 a0 70 ldub [ %g2 + 0x70 ], %g2 4000a6ac: 80 a0 a0 00 cmp %g2, 0 4000a6b0: 12 80 00 06 bne 4000a6c8 <_Scheduler_CBS_Unblock+0xcc> 4000a6b4: 82 10 00 06 mov %g6, %g1 4000a6b8: c4 06 60 14 ld [ %i1 + 0x14 ], %g2 4000a6bc: 80 a0 a0 00 cmp %g2, 0 4000a6c0: 12 80 00 04 bne 4000a6d0 <_Scheduler_CBS_Unblock+0xd4> <== ALWAYS TAKEN 4000a6c4: 01 00 00 00 nop the_thread->current_priority == 0 ) _Thread_Dispatch_necessary = true; 4000a6c8: 84 10 20 01 mov 1, %g2 ! 1 <_TLS_Alignment> 4000a6cc: c4 28 60 14 stb %g2, [ %g1 + 0x14 ] 4000a6d0: 81 c7 e0 08 ret 4000a6d4: 81 e8 00 00 restore =============================================================================== 4000a7f8 <_Scheduler_EDF_Block>: void _Scheduler_EDF_Block( const Scheduler_Control *scheduler, Thread_Control *the_thread ) { 4000a7f8: 9d e3 bf a0 save %sp, -96, %sp const Scheduler_Control *, Thread_Control *, bool ) ) { ( *extract )( scheduler, the_thread ); 4000a7fc: 90 10 00 18 mov %i0, %o0 4000a800: 7f ff ff f8 call 4000a7e0 <_Scheduler_EDF_Extract> 4000a804: 92 10 00 19 mov %i1, %o1 /* TODO: flash critical section? */ if ( _Thread_Is_executing( the_thread ) || _Thread_Is_heir( the_thread ) ) { 4000a808: c4 01 a0 18 ld [ %g6 + 0x18 ], %g2 4000a80c: 80 a6 40 02 cmp %i1, %g2 4000a810: 02 80 00 06 be 4000a828 <_Scheduler_EDF_Block+0x30> 4000a814: 01 00 00 00 nop 4000a818: c2 01 a0 1c ld [ %g6 + 0x1c ], %g1 4000a81c: 80 a6 40 01 cmp %i1, %g1 4000a820: 12 80 00 04 bne 4000a830 <_Scheduler_EDF_Block+0x38> <== ALWAYS TAKEN 4000a824: 01 00 00 00 nop ( *schedule )( scheduler, the_thread, true ); 4000a828: 7f ff ff dd call 4000a79c <_Scheduler_EDF_Schedule_body> 4000a82c: 95 e8 20 01 restore %g0, 1, %o2 4000a830: 81 c7 e0 08 ret 4000a834: 81 e8 00 00 restore =============================================================================== 4000a8f0 <_Scheduler_EDF_Schedule>: RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_First( const RBTree_Control *the_rbtree, RBTree_Direction dir ) { return the_rbtree->first[dir]; 4000a8f0: c2 02 00 00 ld [ %o0 ], %g1 Scheduler_EDF_Context *context = _Scheduler_EDF_Get_context( scheduler ); RBTree_Node *first = _RBTree_First( &context->Ready, RBT_LEFT ); Scheduler_EDF_Node *node = _RBTree_Container_of(first, Scheduler_EDF_Node, Node); Thread_Control *heir = node->thread; 4000a8f4: c2 00 60 08 ld [ %g1 + 8 ], %g1 4000a8f8: c4 00 7f fc ld [ %g1 + -4 ], %g2 RTEMS_INLINE_ROUTINE void _Scheduler_Update_heir( Thread_Control *heir, bool force_dispatch ) { Thread_Control *executing = _Thread_Executing; 4000a8fc: c2 01 a0 18 ld [ %g6 + 0x18 ], %g1 _Thread_Heir = heir; if ( executing != heir && ( force_dispatch || executing->is_preemptible ) ) 4000a900: 80 a0 40 02 cmp %g1, %g2 4000a904: 02 80 00 07 be 4000a920 <_Scheduler_EDF_Schedule+0x30> 4000a908: c4 21 a0 1c st %g2, [ %g6 + 0x1c ] 4000a90c: c2 08 60 70 ldub [ %g1 + 0x70 ], %g1 4000a910: 80 a0 60 00 cmp %g1, 0 4000a914: 02 80 00 03 be 4000a920 <_Scheduler_EDF_Schedule+0x30> <== NEVER TAKEN 4000a918: 84 10 20 01 mov 1, %g2 _Thread_Dispatch_necessary = true; 4000a91c: c4 29 a0 14 stb %g2, [ %g6 + 0x14 ] 4000a920: 81 c3 e0 08 retl =============================================================================== 4000a79c <_Scheduler_EDF_Schedule_body>: RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_First( const RBTree_Control *the_rbtree, RBTree_Direction dir ) { return the_rbtree->first[dir]; 4000a79c: c2 02 00 00 ld [ %o0 ], %g1 Scheduler_EDF_Context *context = _Scheduler_EDF_Get_context( scheduler ); RBTree_Node *first = _RBTree_First( &context->Ready, RBT_LEFT ); Scheduler_EDF_Node *node = _RBTree_Container_of(first, Scheduler_EDF_Node, Node); Thread_Control *heir = node->thread; 4000a7a0: c2 00 60 08 ld [ %g1 + 8 ], %g1 4000a7a4: c4 00 7f fc ld [ %g1 + -4 ], %g2 RTEMS_INLINE_ROUTINE void _Scheduler_Update_heir( Thread_Control *heir, bool force_dispatch ) { Thread_Control *executing = _Thread_Executing; 4000a7a8: c2 01 a0 18 ld [ %g6 + 0x18 ], %g1 _Thread_Heir = heir; if ( executing != heir && ( force_dispatch || executing->is_preemptible ) ) 4000a7ac: 80 a0 40 02 cmp %g1, %g2 4000a7b0: 02 80 00 0a be 4000a7d8 <_Scheduler_EDF_Schedule_body+0x3c><== NEVER TAKEN 4000a7b4: c4 21 a0 1c st %g2, [ %g6 + 0x1c ] 4000a7b8: 80 a2 a0 00 cmp %o2, 0 4000a7bc: 12 80 00 06 bne 4000a7d4 <_Scheduler_EDF_Schedule_body+0x38><== ALWAYS TAKEN 4000a7c0: 84 10 20 01 mov 1, %g2 4000a7c4: c2 08 60 70 ldub [ %g1 + 0x70 ], %g1 <== NOT EXECUTED 4000a7c8: 80 a0 60 00 cmp %g1, 0 <== NOT EXECUTED 4000a7cc: 02 80 00 03 be 4000a7d8 <_Scheduler_EDF_Schedule_body+0x3c><== NOT EXECUTED 4000a7d0: 01 00 00 00 nop <== NOT EXECUTED _Thread_Dispatch_necessary = true; 4000a7d4: c4 29 a0 14 stb %g2, [ %g6 + 0x14 ] 4000a7d8: 81 c3 e0 08 retl =============================================================================== 4000a814 <_Scheduler_EDF_Unblock>: void _Scheduler_EDF_Unblock( const Scheduler_Control *scheduler, Thread_Control *the_thread ) { 4000a814: 9d e3 bf a0 save %sp, -96, %sp { return (Scheduler_EDF_Context *) _Scheduler_Get_context( scheduler ); } RTEMS_INLINE_ROUTINE Scheduler_EDF_Node *_Scheduler_EDF_Node_get( Thread_Control *the_thread 4000a818: fa 06 60 88 ld [ %i1 + 0x88 ], %i5 { Scheduler_EDF_Context *context = _Scheduler_EDF_Get_context( scheduler ); Scheduler_EDF_Node *node = _Scheduler_EDF_Node_get( the_thread ); _RBTree_Insert( &context->Ready, &node->Node ); 4000a81c: d0 06 00 00 ld [ %i0 ], %o0 4000a820: 7f ff fe ce call 4000a358 <_RBTree_Insert> 4000a824: 92 07 60 04 add %i5, 4, %o1 * 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( 4000a828: c4 01 a0 1c ld [ %g6 + 0x1c ], %g2 node->queue_state = SCHEDULER_EDF_QUEUE_STATE_YES; 4000a82c: 82 10 20 01 mov 1, %g1 const Scheduler_Control *scheduler, Priority_Control p1, Priority_Control p2 ) { return ( *scheduler->Operations.priority_compare )( p1, p2 ); 4000a830: d0 00 a0 14 ld [ %g2 + 0x14 ], %o0 4000a834: c2 27 60 14 st %g1, [ %i5 + 0x14 ] 4000a838: c2 06 20 28 ld [ %i0 + 0x28 ], %g1 4000a83c: 9f c0 40 00 call %g1 4000a840: d2 06 60 14 ld [ %i1 + 0x14 ], %o1 4000a844: 80 a2 20 00 cmp %o0, 0 4000a848: 16 80 00 0e bge 4000a880 <_Scheduler_EDF_Unblock+0x6c> 4000a84c: 01 00 00 00 nop scheduler, _Thread_Heir->current_priority, the_thread->current_priority )) { _Thread_Heir = the_thread; if ( _Thread_Executing->is_preemptible || 4000a850: c4 01 a0 18 ld [ %g6 + 0x18 ], %g2 */ if ( _Scheduler_Is_priority_lower_than( scheduler, _Thread_Heir->current_priority, the_thread->current_priority )) { _Thread_Heir = the_thread; 4000a854: f2 21 a0 1c st %i1, [ %g6 + 0x1c ] if ( _Thread_Executing->is_preemptible || 4000a858: c4 08 a0 70 ldub [ %g2 + 0x70 ], %g2 4000a85c: 80 a0 a0 00 cmp %g2, 0 4000a860: 12 80 00 06 bne 4000a878 <_Scheduler_EDF_Unblock+0x64> 4000a864: 82 10 00 06 mov %g6, %g1 4000a868: c4 06 60 14 ld [ %i1 + 0x14 ], %g2 4000a86c: 80 a0 a0 00 cmp %g2, 0 4000a870: 12 80 00 04 bne 4000a880 <_Scheduler_EDF_Unblock+0x6c> <== ALWAYS TAKEN 4000a874: 01 00 00 00 nop the_thread->current_priority == 0 ) _Thread_Dispatch_necessary = true; 4000a878: 84 10 20 01 mov 1, %g2 ! 1 <_TLS_Alignment> 4000a87c: c4 28 60 14 stb %g2, [ %g1 + 0x14 ] 4000a880: 81 c7 e0 08 ret 4000a884: 81 e8 00 00 restore =============================================================================== 4000a928 <_Scheduler_EDF_Update_priority>: { return (Scheduler_EDF_Context *) _Scheduler_Get_context( scheduler ); } RTEMS_INLINE_ROUTINE Scheduler_EDF_Node *_Scheduler_EDF_Node_get( Thread_Control *the_thread 4000a928: c4 02 60 88 ld [ %o1 + 0x88 ], %g2 Scheduler_EDF_Node *node = _Scheduler_EDF_Node_get( the_thread ); (void) scheduler; (void) new_priority; if (node->queue_state == SCHEDULER_EDF_QUEUE_STATE_NEVER_HAS_BEEN) { 4000a92c: c2 00 a0 14 ld [ %g2 + 0x14 ], %g1 4000a930: 80 a0 60 02 cmp %g1, 2 4000a934: 12 80 00 08 bne 4000a954 <_Scheduler_EDF_Update_priority+0x2c><== NEVER TAKEN 4000a938: 03 20 00 00 sethi %hi(0x80000000), %g1 /* Shifts the priority to the region of background tasks. */ the_thread->Start.initial_priority |= (SCHEDULER_EDF_PRIO_MSB); 4000a93c: c6 02 60 ac ld [ %o1 + 0xac ], %g3 4000a940: 82 10 c0 01 or %g3, %g1, %g1 4000a944: c2 22 60 ac st %g1, [ %o1 + 0xac ] the_thread->real_priority = the_thread->Start.initial_priority; 4000a948: c2 22 60 18 st %g1, [ %o1 + 0x18 ] the_thread->current_priority = the_thread->Start.initial_priority; 4000a94c: c2 22 60 14 st %g1, [ %o1 + 0x14 ] node->queue_state = SCHEDULER_EDF_QUEUE_STATE_NOT_PRESENTLY; 4000a950: c0 20 a0 14 clr [ %g2 + 0x14 ] 4000a954: 81 c3 e0 08 retl =============================================================================== 4000a95c <_Scheduler_EDF_Yield>: void _Scheduler_EDF_Yield( const Scheduler_Control *scheduler, Thread_Control *the_thread ) { 4000a95c: 9d e3 bf a0 save %sp, -96, %sp /* * The RBTree has more than one node, enqueue behind the tasks * with the same priority in case there are such ones. */ _RBTree_Extract( &context->Ready, &node->Node ); 4000a960: fa 06 00 00 ld [ %i0 ], %i5 4000a964: f8 06 60 88 ld [ %i1 + 0x88 ], %i4 4000a968: 90 10 00 1d mov %i5, %o0 4000a96c: b8 07 20 04 add %i4, 4, %i4 4000a970: 40 00 10 7b call 4000eb5c <_RBTree_Extract> 4000a974: 92 10 00 1c mov %i4, %o1 _RBTree_Insert( &context->Ready, &node->Node ); 4000a978: 90 10 00 1d mov %i5, %o0 4000a97c: 7f ff fe 77 call 4000a358 <_RBTree_Insert> 4000a980: 92 10 00 1c mov %i4, %o1 4000a984: c2 06 00 00 ld [ %i0 ], %g1 Scheduler_EDF_Context *context = _Scheduler_EDF_Get_context( scheduler ); RBTree_Node *first = _RBTree_First( &context->Ready, RBT_LEFT ); Scheduler_EDF_Node *node = _RBTree_Container_of(first, Scheduler_EDF_Node, Node); Thread_Control *heir = node->thread; 4000a988: c2 00 60 08 ld [ %g1 + 8 ], %g1 4000a98c: c4 00 7f fc ld [ %g1 + -4 ], %g2 RTEMS_INLINE_ROUTINE void _Scheduler_Update_heir( Thread_Control *heir, bool force_dispatch ) { Thread_Control *executing = _Thread_Executing; 4000a990: c2 01 a0 18 ld [ %g6 + 0x18 ], %g1 _Thread_Heir = heir; if ( executing != heir && ( force_dispatch || executing->is_preemptible ) ) 4000a994: 80 a0 40 02 cmp %g1, %g2 4000a998: 02 80 00 07 be 4000a9b4 <_Scheduler_EDF_Yield+0x58> <== NEVER TAKEN 4000a99c: c4 21 a0 1c st %g2, [ %g6 + 0x1c ] 4000a9a0: c2 08 60 70 ldub [ %g1 + 0x70 ], %g1 4000a9a4: 80 a0 60 00 cmp %g1, 0 4000a9a8: 02 80 00 03 be 4000a9b4 <_Scheduler_EDF_Yield+0x58> <== ALWAYS TAKEN 4000a9ac: 84 10 20 01 mov 1, %g2 _Thread_Dispatch_necessary = true; 4000a9b0: c4 29 a0 14 stb %g2, [ %g6 + 0x14 ] <== NOT EXECUTED 4000a9b4: 81 c7 e0 08 ret 4000a9b8: 81 e8 00 00 restore =============================================================================== 40009418 <_Scheduler_default_Tick>: void _Scheduler_default_Tick( const Scheduler_Control *scheduler, Thread_Control *executing ) { 40009418: 9d e3 bf a0 save %sp, -96, %sp /* * If the thread is not preemptible or is not ready, then * just return. */ if ( !executing->is_preemptible ) 4000941c: c2 0e 60 70 ldub [ %i1 + 0x70 ], %g1 40009420: 80 a0 60 00 cmp %g1, 0 40009424: 02 80 00 23 be 400094b0 <_Scheduler_default_Tick+0x98> 40009428: 01 00 00 00 nop return; if ( !_States_Is_ready( executing->current_state ) ) 4000942c: c2 06 60 10 ld [ %i1 + 0x10 ], %g1 40009430: 80 a0 60 00 cmp %g1, 0 40009434: 12 80 00 1f bne 400094b0 <_Scheduler_default_Tick+0x98> 40009438: 01 00 00 00 nop /* * The cpu budget algorithm determines what happens next. */ switch ( executing->budget_algorithm ) { 4000943c: c2 06 60 78 ld [ %i1 + 0x78 ], %g1 40009440: 80 a0 60 01 cmp %g1, 1 40009444: 0a 80 00 06 bcs 4000945c <_Scheduler_default_Tick+0x44> 40009448: 80 a0 60 02 cmp %g1, 2 4000944c: 08 80 00 06 bleu 40009464 <_Scheduler_default_Tick+0x4c> 40009450: 80 a0 60 03 cmp %g1, 3 40009454: 22 80 00 10 be,a 40009494 <_Scheduler_default_Tick+0x7c> <== ALWAYS TAKEN 40009458: c2 06 60 74 ld [ %i1 + 0x74 ], %g1 4000945c: 81 c7 e0 08 ret 40009460: 81 e8 00 00 restore 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 ) { 40009464: c2 06 60 74 ld [ %i1 + 0x74 ], %g1 40009468: 82 00 7f ff add %g1, -1, %g1 4000946c: 80 a0 60 00 cmp %g1, 0 40009470: 14 bf ff fb bg 4000945c <_Scheduler_default_Tick+0x44> 40009474: c2 26 60 74 st %g1, [ %i1 + 0x74 ] * at the priority of the currently executing thread, then the * 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. */ _Thread_Yield( executing ); 40009478: 40 00 06 12 call 4000acc0 <_Thread_Yield> 4000947c: 90 10 00 19 mov %i1, %o0 executing->cpu_time_budget = rtems_configuration_get_ticks_per_timeslice(); 40009480: 03 10 00 55 sethi %hi(0x40015400), %g1 * 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. */ _Thread_Yield( executing ); executing->cpu_time_budget = 40009484: c2 00 61 a4 ld [ %g1 + 0x1a4 ], %g1 ! 400155a4 40009488: c2 26 60 74 st %g1, [ %i1 + 0x74 ] 4000948c: 81 c7 e0 08 ret 40009490: 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 ) 40009494: 82 00 7f ff add %g1, -1, %g1 40009498: 80 a0 60 00 cmp %g1, 0 4000949c: 12 bf ff f0 bne 4000945c <_Scheduler_default_Tick+0x44> 400094a0: c2 26 60 74 st %g1, [ %i1 + 0x74 ] (*executing->budget_callout)( executing ); 400094a4: c2 06 60 7c ld [ %i1 + 0x7c ], %g1 400094a8: 9f c0 40 00 call %g1 400094ac: 90 10 00 19 mov %i1, %o0 400094b0: 81 c7 e0 08 ret 400094b4: 81 e8 00 00 restore =============================================================================== 400094d8 <_Scheduler_priority_Schedule_body>: * @addtogroup ScoreSchedulerDPS */ /**@{**/ RTEMS_INLINE_ROUTINE Scheduler_priority_Context * _Scheduler_priority_Get_context( const Scheduler_Control *scheduler ) 400094d8: c4 02 00 00 ld [ %o0 ], %g2 400094dc: 03 10 00 59 sethi %hi(0x40016400), %g1 /* Avoid problems with some inline ASM statements */ Priority_bit_map_Word tmp; tmp = bit_map->major_bit_map; _Bitfield_Find_first_bit( tmp, major ); 400094e0: c6 10 80 00 lduh [ %g2 ], %g3 bool force_dispatch ) { Scheduler_priority_Context *context = _Scheduler_priority_Get_context( scheduler ); Thread_Control *heir = _Scheduler_priority_Ready_queue_first( 400094e4: 9a 00 a0 24 add %g2, 0x24, %o5 400094e8: 87 28 e0 10 sll %g3, 0x10, %g3 400094ec: 89 30 e0 10 srl %g3, 0x10, %g4 400094f0: 80 a1 20 ff cmp %g4, 0xff 400094f4: 18 80 00 05 bgu 40009508 <_Scheduler_priority_Schedule_body+0x30> 400094f8: 82 10 61 48 or %g1, 0x148, %g1 400094fc: c6 08 40 04 ldub [ %g1 + %g4 ], %g3 40009500: 10 80 00 04 b 40009510 <_Scheduler_priority_Schedule_body+0x38> 40009504: 86 00 e0 08 add %g3, 8, %g3 40009508: 87 30 e0 18 srl %g3, 0x18, %g3 4000950c: c6 08 40 03 ldub [ %g1 + %g3 ], %g3 tmp = bit_map->bit_map[ major ]; 40009510: 87 28 e0 10 sll %g3, 0x10, %g3 40009514: 89 30 e0 0f srl %g3, 0xf, %g4 40009518: 84 00 80 04 add %g2, %g4, %g2 _Bitfield_Find_first_bit( tmp, minor ); 4000951c: c4 10 a0 02 lduh [ %g2 + 2 ], %g2 40009520: 85 28 a0 10 sll %g2, 0x10, %g2 40009524: 89 30 a0 10 srl %g2, 0x10, %g4 40009528: 80 a1 20 ff cmp %g4, 0xff 4000952c: 18 80 00 05 bgu 40009540 <_Scheduler_priority_Schedule_body+0x68> 40009530: 85 30 a0 18 srl %g2, 0x18, %g2 40009534: c2 08 40 04 ldub [ %g1 + %g4 ], %g1 40009538: 10 80 00 03 b 40009544 <_Scheduler_priority_Schedule_body+0x6c> 4000953c: 82 00 60 08 add %g1, 8, %g1 40009540: c2 08 40 02 ldub [ %g1 + %g2 ], %g1 return (_Priority_Bits_index( major ) << 4) + _Priority_Bits_index( minor ); 40009544: 83 28 60 10 sll %g1, 0x10, %g1 _Bitfield_Find_first_bit( tmp, major ); tmp = bit_map->bit_map[ major ]; _Bitfield_Find_first_bit( tmp, minor ); return (_Priority_Bits_index( major ) << 4) + 40009548: 87 30 e0 0c srl %g3, 0xc, %g3 _Priority_Bits_index( minor ); 4000954c: 83 30 60 10 srl %g1, 0x10, %g1 Chain_Control *ready_queues ) { Priority_Control index = _Priority_bit_map_Get_highest( bit_map ); return (Thread_Control *) _Chain_First( &ready_queues[ index ] ); 40009550: 82 00 40 03 add %g1, %g3, %g1 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_First( Chain_Control *the_chain ) { return _Chain_Head( the_chain )->next; 40009554: 85 28 60 02 sll %g1, 2, %g2 40009558: 83 28 60 04 sll %g1, 4, %g1 4000955c: 82 20 40 02 sub %g1, %g2, %g1 40009560: c4 03 40 01 ld [ %o5 + %g1 ], %g2 RTEMS_INLINE_ROUTINE void _Scheduler_Update_heir( Thread_Control *heir, bool force_dispatch ) { Thread_Control *executing = _Thread_Executing; 40009564: c2 01 a0 18 ld [ %g6 + 0x18 ], %g1 _Thread_Heir = heir; if ( executing != heir && ( force_dispatch || executing->is_preemptible ) ) 40009568: 80 a0 40 02 cmp %g1, %g2 4000956c: 02 80 00 0a be 40009594 <_Scheduler_priority_Schedule_body+0xbc> 40009570: c4 21 a0 1c st %g2, [ %g6 + 0x1c ] 40009574: 80 a2 a0 00 cmp %o2, 0 40009578: 12 80 00 06 bne 40009590 <_Scheduler_priority_Schedule_body+0xb8><== ALWAYS TAKEN 4000957c: 84 10 20 01 mov 1, %g2 40009580: c2 08 60 70 ldub [ %g1 + 0x70 ], %g1 <== NOT EXECUTED 40009584: 80 a0 60 00 cmp %g1, 0 <== NOT EXECUTED 40009588: 02 80 00 03 be 40009594 <_Scheduler_priority_Schedule_body+0xbc><== NOT EXECUTED 4000958c: 01 00 00 00 nop <== NOT EXECUTED _Thread_Dispatch_necessary = true; 40009590: c4 29 a0 14 stb %g2, [ %g6 + 0x14 ] 40009594: 81 c3 e0 08 retl =============================================================================== 4000a1b0 <_Scheduler_simple_Block>: ) { Chain_Node *next; Chain_Node *previous; next = the_node->next; 4000a1b0: c4 02 40 00 ld [ %o1 ], %g2 previous = the_node->previous; 4000a1b4: c2 02 60 04 ld [ %o1 + 4 ], %g1 next->previous = previous; 4000a1b8: c2 20 a0 04 st %g1, [ %g2 + 4 ] previous->next = next; 4000a1bc: c4 20 40 00 st %g2, [ %g1 ] { ( *extract )( scheduler, the_thread ); /* TODO: flash critical section? */ if ( _Thread_Is_executing( the_thread ) || _Thread_Is_heir( the_thread ) ) { 4000a1c0: c4 01 a0 18 ld [ %g6 + 0x18 ], %g2 4000a1c4: 80 a2 40 02 cmp %o1, %g2 4000a1c8: 02 80 00 06 be 4000a1e0 <_Scheduler_simple_Block+0x30> 4000a1cc: 94 10 20 01 mov 1, %o2 4000a1d0: c2 01 a0 1c ld [ %g6 + 0x1c ], %g1 4000a1d4: 80 a2 40 01 cmp %o1, %g1 4000a1d8: 12 80 00 05 bne 4000a1ec <_Scheduler_simple_Block+0x3c> <== ALWAYS TAKEN 4000a1dc: 01 00 00 00 nop ( *schedule )( scheduler, the_thread, true ); 4000a1e0: 82 13 c0 00 mov %o7, %g1 4000a1e4: 7f ff ff e3 call 4000a170 <_Scheduler_simple_Schedule_body> 4000a1e8: 9e 10 40 00 mov %g1, %o7 4000a1ec: 81 c3 e0 08 retl =============================================================================== 4000a2c4 <_Scheduler_simple_Schedule>: */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_First( Chain_Control *the_chain ) { return _Chain_Head( the_chain )->next; 4000a2c4: c2 02 00 00 ld [ %o0 ], %g1 4000a2c8: c4 00 40 00 ld [ %g1 ], %g2 RTEMS_INLINE_ROUTINE void _Scheduler_Update_heir( Thread_Control *heir, bool force_dispatch ) { Thread_Control *executing = _Thread_Executing; 4000a2cc: c2 01 a0 18 ld [ %g6 + 0x18 ], %g1 _Thread_Heir = heir; if ( executing != heir && ( force_dispatch || executing->is_preemptible ) ) 4000a2d0: 80 a0 40 02 cmp %g1, %g2 4000a2d4: 02 80 00 07 be 4000a2f0 <_Scheduler_simple_Schedule+0x2c> 4000a2d8: c4 21 a0 1c st %g2, [ %g6 + 0x1c ] 4000a2dc: c2 08 60 70 ldub [ %g1 + 0x70 ], %g1 4000a2e0: 80 a0 60 00 cmp %g1, 0 4000a2e4: 02 80 00 03 be 4000a2f0 <_Scheduler_simple_Schedule+0x2c> <== ALWAYS TAKEN 4000a2e8: 84 10 20 01 mov 1, %g2 _Thread_Dispatch_necessary = true; 4000a2ec: c4 29 a0 14 stb %g2, [ %g6 + 0x14 ] <== NOT EXECUTED 4000a2f0: 81 c3 e0 08 retl =============================================================================== 4000a170 <_Scheduler_simple_Schedule_body>: */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_First( Chain_Control *the_chain ) { return _Chain_Head( the_chain )->next; 4000a170: c2 02 00 00 ld [ %o0 ], %g1 4000a174: c4 00 40 00 ld [ %g1 ], %g2 RTEMS_INLINE_ROUTINE void _Scheduler_Update_heir( Thread_Control *heir, bool force_dispatch ) { Thread_Control *executing = _Thread_Executing; 4000a178: c2 01 a0 18 ld [ %g6 + 0x18 ], %g1 _Thread_Heir = heir; if ( executing != heir && ( force_dispatch || executing->is_preemptible ) ) 4000a17c: 80 a0 40 02 cmp %g1, %g2 4000a180: 02 80 00 0a be 4000a1a8 <_Scheduler_simple_Schedule_body+0x38><== NEVER TAKEN 4000a184: c4 21 a0 1c st %g2, [ %g6 + 0x1c ] 4000a188: 80 a2 a0 00 cmp %o2, 0 4000a18c: 12 80 00 06 bne 4000a1a4 <_Scheduler_simple_Schedule_body+0x34><== ALWAYS TAKEN 4000a190: 84 10 20 01 mov 1, %g2 4000a194: c2 08 60 70 ldub [ %g1 + 0x70 ], %g1 <== NOT EXECUTED 4000a198: 80 a0 60 00 cmp %g1, 0 <== NOT EXECUTED 4000a19c: 02 80 00 03 be 4000a1a8 <_Scheduler_simple_Schedule_body+0x38><== NOT EXECUTED 4000a1a0: 01 00 00 00 nop <== NOT EXECUTED _Thread_Dispatch_necessary = true; 4000a1a4: c4 29 a0 14 stb %g2, [ %g6 + 0x14 ] 4000a1a8: 81 c3 e0 08 retl =============================================================================== 4000a390 <_Scheduler_simple_Yield>: { Chain_Node *next; Chain_Node *previous; next = the_node->next; previous = the_node->previous; 4000a390: c2 02 60 04 ld [ %o1 + 4 ], %g1 ) { Chain_Node *next; Chain_Node *previous; next = the_node->next; 4000a394: c6 02 40 00 ld [ %o1 ], %g3 4000a398: c4 02 00 00 ld [ %o0 ], %g2 previous = the_node->previous; next->previous = previous; 4000a39c: c2 20 e0 04 st %g1, [ %g3 + 4 ] previous->next = next; 4000a3a0: c6 20 40 00 st %g3, [ %g1 ] */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_First( Chain_Control *the_chain ) { return _Chain_Head( the_chain )->next; 4000a3a4: c2 00 80 00 ld [ %g2 ], %g1 Chain_Control *chain, Chain_Node *to_insert, Chain_Node_order order ) { const Chain_Node *tail = _Chain_Immutable_tail( chain ); 4000a3a8: 9a 00 a0 04 add %g2, 4, %o5 Chain_Node *next = _Chain_First( chain ); while ( next != tail && !( *order )( to_insert, next ) ) { 4000a3ac: 80 a0 40 0d cmp %g1, %o5 4000a3b0: 32 80 00 0f bne,a 4000a3ec <_Scheduler_simple_Yield+0x5c><== ALWAYS TAKEN 4000a3b4: c8 02 60 14 ld [ %o1 + 0x14 ], %g4 Chain_Node *to_insert, Chain_Node_order order ) { const Chain_Node *tail = _Chain_Immutable_tail( chain ); Chain_Node *next = _Chain_First( chain ); 4000a3b8: c2 00 60 04 ld [ %g1 + 4 ], %g1 <== NOT EXECUTED ) { Chain_Node *before_node; the_node->previous = after_node; before_node = after_node->next; 4000a3bc: c6 00 40 00 ld [ %g1 ], %g3 Chain_Node *the_node ) { Chain_Node *before_node; the_node->previous = after_node; 4000a3c0: c2 22 60 04 st %g1, [ %o1 + 4 ] before_node = after_node->next; after_node->next = the_node; 4000a3c4: d2 20 40 00 st %o1, [ %g1 ] the_node->next = before_node; 4000a3c8: c6 22 40 00 st %g3, [ %o1 ] */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_First( Chain_Control *the_chain ) { return _Chain_Head( the_chain )->next; 4000a3cc: c4 00 80 00 ld [ %g2 ], %g2 the_node->previous = after_node; before_node = after_node->next; after_node->next = the_node; the_node->next = before_node; before_node->previous = the_node; 4000a3d0: d2 20 e0 04 st %o1, [ %g3 + 4 ] RTEMS_INLINE_ROUTINE void _Scheduler_Update_heir( Thread_Control *heir, bool force_dispatch ) { Thread_Control *executing = _Thread_Executing; 4000a3d4: c2 01 a0 18 ld [ %g6 + 0x18 ], %g1 _Thread_Heir = heir; if ( executing != heir && ( force_dispatch || executing->is_preemptible ) ) 4000a3d8: 80 a0 40 02 cmp %g1, %g2 4000a3dc: 12 80 00 0a bne 4000a404 <_Scheduler_simple_Yield+0x74> 4000a3e0: c4 21 a0 1c st %g2, [ %g6 + 0x1c ] 4000a3e4: 81 c3 e0 08 retl 4000a3e8: 01 00 00 00 nop ) { const Chain_Node *tail = _Chain_Immutable_tail( chain ); Chain_Node *next = _Chain_First( chain ); while ( next != tail && !( *order )( to_insert, next ) ) { 4000a3ec: c6 00 60 14 ld [ %g1 + 0x14 ], %g3 4000a3f0: 80 a1 00 03 cmp %g4, %g3 4000a3f4: 2a bf ff f2 bcs,a 4000a3bc <_Scheduler_simple_Yield+0x2c> 4000a3f8: c2 00 60 04 ld [ %g1 + 4 ], %g1 Chain_Node *to_insert, Chain_Node_order order ) { const Chain_Node *tail = _Chain_Immutable_tail( chain ); Chain_Node *next = _Chain_First( chain ); 4000a3fc: 10 bf ff ec b 4000a3ac <_Scheduler_simple_Yield+0x1c> 4000a400: c2 00 40 00 ld [ %g1 ], %g1 4000a404: c2 08 60 70 ldub [ %g1 + 0x70 ], %g1 4000a408: 80 a0 60 00 cmp %g1, 0 4000a40c: 02 bf ff f6 be 4000a3e4 <_Scheduler_simple_Yield+0x54> <== ALWAYS TAKEN 4000a410: 84 10 20 01 mov 1, %g2 _Thread_Dispatch_necessary = true; 4000a414: c4 29 a0 14 stb %g2, [ %g6 + 0x14 ] <== NOT EXECUTED 4000a418: 81 c3 e0 08 retl <== NOT EXECUTED =============================================================================== 4000ef50 <_Signal_Action_handler>: Thread_Control *executing, Thread_Action *action, Per_CPU_Control *cpu, ISR_Level level ) { 4000ef50: 9d e3 bf 98 save %sp, -104, %sp RTEMS_INLINE_ROUTINE void _Thread_Action_release_and_ISR_enable( Per_CPU_Control *cpu, ISR_Level level ) { _Per_CPU_Release_and_ISR_enable( cpu, level ); 4000ef54: 7f ff cd 3b call 40002440 4000ef58: 90 10 00 1b mov %i3, %o0 Modes_Control prev_mode; (void) action; _Thread_Action_release_and_ISR_enable( cpu, level ); api = executing->API_Extensions[ THREAD_API_RTEMS ]; 4000ef5c: fa 06 21 2c ld [ %i0 + 0x12c ], %i5 if ( !api ) 4000ef60: 80 a7 60 00 cmp %i5, 0 4000ef64: 02 80 00 1c be 4000efd4 <_Signal_Action_handler+0x84> <== NEVER TAKEN 4000ef68: 01 00 00 00 nop { #if defined( RTEMS_SMP ) _SMP_lock_ISR_disable_and_acquire( &lock->lock, &context->lock_context ); #else (void) lock; _ISR_Disable( context->isr_level ); 4000ef6c: 7f ff cd 32 call 40002434 4000ef70: 01 00 00 00 nop { rtems_signal_set signal_set; ISR_lock_Context lock_context; _ISR_lock_ISR_disable_and_acquire( &asr->Lock, &lock_context ); signal_set = asr->signals_posted; 4000ef74: f8 07 60 14 ld [ %i5 + 0x14 ], %i4 asr->signals_posted = 0; 4000ef78: c0 27 60 14 clr [ %i5 + 0x14 ] { #if defined( RTEMS_SMP ) _SMP_lock_Release_and_ISR_enable( &lock->lock, &context->lock_context ); #else (void) lock; _ISR_Enable( context->isr_level ); 4000ef7c: 7f ff cd 31 call 40002440 4000ef80: 01 00 00 00 nop */ asr = &api->Signal; signal_set = _ASR_Get_posted_signals( asr ); if ( !signal_set ) /* similar to _ASR_Are_signals_pending( asr ) */ 4000ef84: 80 a7 20 00 cmp %i4, 0 4000ef88: 02 80 00 13 be 4000efd4 <_Signal_Action_handler+0x84> <== NEVER TAKEN 4000ef8c: 94 07 bf fc add %fp, -4, %o2 return; asr->nest_level += 1; 4000ef90: c2 07 60 1c ld [ %i5 + 0x1c ], %g1 rtems_task_mode( asr->mode_set, RTEMS_ALL_MODE_MASKS, &prev_mode ); 4000ef94: d0 07 60 10 ld [ %i5 + 0x10 ], %o0 signal_set = _ASR_Get_posted_signals( asr ); if ( !signal_set ) /* similar to _ASR_Are_signals_pending( asr ) */ return; asr->nest_level += 1; 4000ef98: 82 00 60 01 inc %g1 4000ef9c: c2 27 60 1c st %g1, [ %i5 + 0x1c ] rtems_task_mode( asr->mode_set, RTEMS_ALL_MODE_MASKS, &prev_mode ); 4000efa0: 37 00 00 3f sethi %hi(0xfc00), %i3 4000efa4: 40 00 00 0e call 4000efdc 4000efa8: 92 16 e3 ff or %i3, 0x3ff, %o1 ! ffff <_TLS_Alignment+0xfffe> (*asr->handler)( signal_set ); 4000efac: c2 07 60 0c ld [ %i5 + 0xc ], %g1 4000efb0: 9f c0 40 00 call %g1 4000efb4: 90 10 00 1c mov %i4, %o0 asr->nest_level -= 1; 4000efb8: c2 07 60 1c ld [ %i5 + 0x1c ], %g1 rtems_task_mode( prev_mode, RTEMS_ALL_MODE_MASKS, &prev_mode ); 4000efbc: 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; 4000efc0: 82 00 7f ff add %g1, -1, %g1 rtems_task_mode( prev_mode, RTEMS_ALL_MODE_MASKS, &prev_mode ); 4000efc4: 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; 4000efc8: c2 27 60 1c st %g1, [ %i5 + 0x1c ] rtems_task_mode( prev_mode, RTEMS_ALL_MODE_MASKS, &prev_mode ); 4000efcc: 40 00 00 04 call 4000efdc 4000efd0: 94 07 bf fc add %fp, -4, %o2 4000efd4: 81 c7 e0 08 ret 4000efd8: 81 e8 00 00 restore =============================================================================== 40008598 <_TOD_Validate>: }; bool _TOD_Validate( const rtems_time_of_day *the_tod ) { 40008598: 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 / 4000859c: 03 10 00 5c sethi %hi(0x40017000), %g1 400085a0: d2 00 61 34 ld [ %g1 + 0x134 ], %o1 ! 40017134 400085a4: 11 00 03 d0 sethi %hi(0xf4000), %o0 400085a8: 40 00 32 8f call 40014fe4 <.udiv> 400085ac: 90 12 22 40 or %o0, 0x240, %o0 ! f4240 <_TLS_Alignment+0xf423f> rtems_configuration_get_microseconds_per_tick(); if ((!the_tod) || 400085b0: 80 a6 20 00 cmp %i0, 0 400085b4: 02 80 00 33 be 40008680 <_TOD_Validate+0xe8> <== NEVER TAKEN 400085b8: 82 10 20 00 clr %g1 400085bc: c4 06 20 18 ld [ %i0 + 0x18 ], %g2 400085c0: 80 a0 80 08 cmp %g2, %o0 400085c4: 3a 80 00 30 bcc,a 40008684 <_TOD_Validate+0xec> 400085c8: b0 08 60 01 and %g1, 1, %i0 (the_tod->ticks >= ticks_per_second) || 400085cc: c4 06 20 14 ld [ %i0 + 0x14 ], %g2 400085d0: 80 a0 a0 3b cmp %g2, 0x3b 400085d4: 38 80 00 2c bgu,a 40008684 <_TOD_Validate+0xec> 400085d8: b0 08 60 01 and %g1, 1, %i0 (the_tod->second >= TOD_SECONDS_PER_MINUTE) || 400085dc: c4 06 20 10 ld [ %i0 + 0x10 ], %g2 400085e0: 80 a0 a0 3b cmp %g2, 0x3b 400085e4: 38 80 00 28 bgu,a 40008684 <_TOD_Validate+0xec> 400085e8: b0 08 60 01 and %g1, 1, %i0 (the_tod->minute >= TOD_MINUTES_PER_HOUR) || 400085ec: c4 06 20 0c ld [ %i0 + 0xc ], %g2 400085f0: 80 a0 a0 17 cmp %g2, 0x17 400085f4: 38 80 00 24 bgu,a 40008684 <_TOD_Validate+0xec> 400085f8: b0 08 60 01 and %g1, 1, %i0 (the_tod->hour >= TOD_HOURS_PER_DAY) || (the_tod->month == 0) || 400085fc: f8 06 20 04 ld [ %i0 + 4 ], %i4 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) || 40008600: 84 07 3f ff add %i4, -1, %g2 40008604: 80 a0 a0 0b cmp %g2, 0xb 40008608: 38 80 00 1f bgu,a 40008684 <_TOD_Validate+0xec> 4000860c: b0 08 60 01 and %g1, 1, %i0 (the_tod->month == 0) || (the_tod->month > TOD_MONTHS_PER_YEAR) || (the_tod->year < TOD_BASE_YEAR) || 40008610: fa 06 00 00 ld [ %i0 ], %i5 (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) || 40008614: 80 a7 67 c3 cmp %i5, 0x7c3 40008618: 28 80 00 1b bleu,a 40008684 <_TOD_Validate+0xec> 4000861c: b0 08 60 01 and %g1, 1, %i0 (the_tod->year < TOD_BASE_YEAR) || (the_tod->day == 0) ) 40008620: f6 06 20 08 ld [ %i0 + 8 ], %i3 (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) || 40008624: 80 a6 e0 00 cmp %i3, 0 40008628: 02 80 00 16 be 40008680 <_TOD_Validate+0xe8> <== NEVER TAKEN 4000862c: 35 10 00 5f sethi %hi(0x40017c00), %i2 (the_tod->day == 0) ) return false; if (((the_tod->year % 4) == 0 && (the_tod->year % 100 != 0)) || 40008630: 80 8f 60 03 btst 3, %i5 40008634: 12 80 00 08 bne 40008654 <_TOD_Validate+0xbc> 40008638: b4 16 a1 d8 or %i2, 0x1d8, %i2 4000863c: 90 10 00 1d mov %i5, %o0 40008640: 40 00 33 15 call 40015294 <.urem> 40008644: 92 10 20 64 mov 0x64, %o1 40008648: 80 a2 20 00 cmp %o0, 0 4000864c: 32 80 00 09 bne,a 40008670 <_TOD_Validate+0xd8> 40008650: b8 07 20 0d add %i4, 0xd, %i4 (the_tod->year % 400 == 0)) 40008654: 90 10 00 1d mov %i5, %o0 40008658: 40 00 33 0f call 40015294 <.urem> 4000865c: 92 10 21 90 mov 0x190, %o1 (the_tod->month > TOD_MONTHS_PER_YEAR) || (the_tod->year < TOD_BASE_YEAR) || (the_tod->day == 0) ) return false; if (((the_tod->year % 4) == 0 && (the_tod->year % 100 != 0)) || 40008660: 80 a2 20 00 cmp %o0, 0 40008664: 32 80 00 04 bne,a 40008674 <_TOD_Validate+0xdc> 40008668: b9 2f 20 02 sll %i4, 2, %i4 (the_tod->year % 400 == 0)) days_in_month = _TOD_Days_per_month[ 1 ][ the_tod->month ]; 4000866c: b8 07 20 0d add %i4, 0xd, %i4 else days_in_month = _TOD_Days_per_month[ 0 ][ the_tod->month ]; 40008670: b9 2f 20 02 sll %i4, 2, %i4 40008674: c2 06 80 1c ld [ %i2 + %i4 ], %g1 if ( the_tod->day > days_in_month ) 40008678: 80 a0 40 1b cmp %g1, %i3 4000867c: 82 60 3f ff subx %g0, -1, %g1 return false; return true; } 40008680: b0 08 60 01 and %g1, 1, %i0 40008684: 81 c7 e0 08 ret 40008688: 81 e8 00 00 restore =============================================================================== 40008a08 <_Terminate>: void _Terminate( Internal_errors_Source the_source, bool is_internal, Internal_errors_t the_error ) { 40008a08: 9d e3 bf 90 save %sp, -112, %sp ISR_Level level; _ISR_Disable_without_giant( level ); 40008a0c: 7f ff e6 8a call 40002434 40008a10: 01 00 00 00 nop Internal_errors_t error ) { User_extensions_Fatal_context ctx = { source, is_internal, error }; _User_extensions_Iterate( &ctx, _User_extensions_Fatal_visitor ); 40008a14: 13 10 00 2b sethi %hi(0x4000ac00), %o1 40008a18: 90 07 bf f4 add %fp, -12, %o0 40008a1c: 92 12 61 ec or %o1, 0x1ec, %o1 Internal_errors_Source source, bool is_internal, Internal_errors_t error ) { User_extensions_Fatal_context ctx = { source, is_internal, error }; 40008a20: f0 27 bf f4 st %i0, [ %fp + -12 ] 40008a24: f2 2f bf f8 stb %i1, [ %fp + -8 ] _User_extensions_Iterate( &ctx, _User_extensions_Fatal_visitor ); 40008a28: 40 00 09 05 call 4000ae3c <_User_extensions_Iterate> 40008a2c: f4 27 bf fc st %i2, [ %fp + -4 ] _SMP_Request_shutdown(); _User_extensions_Fatal( the_source, is_internal, the_error ); _Internal_errors_What_happened.the_source = the_source; 40008a30: 05 10 00 62 sethi %hi(0x40018800), %g2 <== NOT EXECUTED 40008a34: 82 10 a0 e8 or %g2, 0xe8, %g1 ! 400188e8 <_Internal_errors_What_happened><== NOT EXECUTED 40008a38: f0 20 a0 e8 st %i0, [ %g2 + 0xe8 ] <== NOT EXECUTED _Internal_errors_What_happened.is_internal = is_internal; 40008a3c: f2 28 60 04 stb %i1, [ %g1 + 4 ] <== NOT EXECUTED _Internal_errors_What_happened.the_error = the_error; 40008a40: 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; 40008a44: 84 10 20 03 mov 3, %g2 <== NOT EXECUTED 40008a48: 03 10 00 62 sethi %hi(0x40018800), %g1 <== NOT EXECUTED _System_state_Set( SYSTEM_STATE_TERMINATED ); _CPU_Fatal_halt( the_error ); 40008a4c: 7f ff e6 7a call 40002434 <== NOT EXECUTED 40008a50: c4 20 60 f4 st %g2, [ %g1 + 0xf4 ] ! 400188f4 <_System_state_Current><== NOT EXECUTED 40008a54: 82 10 00 08 mov %o0, %g1 <== NOT EXECUTED 40008a58: 30 80 00 00 b,a 40008a58 <_Terminate+0x50> <== NOT EXECUTED =============================================================================== 40009a64 <_Thread_Change_priority>: void _Thread_Change_priority( Thread_Control *the_thread, Priority_Control new_priority, bool prepend_it ) { 40009a64: 9d e3 bf 98 save %sp, -104, %sp /* * Do not bother recomputing all the priority related information if * we are not REALLY changing priority. */ if ( the_thread->current_priority != new_priority ) { 40009a68: c2 06 20 14 ld [ %i0 + 0x14 ], %g1 40009a6c: 80 a0 40 19 cmp %g1, %i1 40009a70: 02 80 00 3d be 40009b64 <_Thread_Change_priority+0x100> 40009a74: 01 00 00 00 nop ISR_Level level; const Scheduler_Control *scheduler; _ISR_Disable( level ); 40009a78: 7f ff e2 6f call 40002434 40009a7c: 01 00 00 00 nop 40009a80: ba 10 00 08 mov %o0, %i5 scheduler = _Scheduler_Get( the_thread ); the_thread->current_priority = new_priority; if ( _States_Is_ready( the_thread->current_state ) ) { 40009a84: c2 06 20 10 ld [ %i0 + 0x10 ], %g1 const Scheduler_Control *scheduler; _ISR_Disable( level ); scheduler = _Scheduler_Get( the_thread ); the_thread->current_priority = new_priority; 40009a88: f2 26 20 14 st %i1, [ %i0 + 0x14 ] if ( _States_Is_ready( the_thread->current_state ) ) { 40009a8c: 80 a0 60 00 cmp %g1, 0 40009a90: 03 10 00 55 sethi %hi(0x40015400), %g1 40009a94: 12 80 00 12 bne 40009adc <_Thread_Change_priority+0x78> 40009a98: 90 10 62 6c or %g1, 0x26c, %o0 ! 4001566c <_Scheduler_Table> Thread_Control *the_thread, Priority_Control new_priority, bool prepend_it ) { ( *scheduler->Operations.change_priority )( 40009a9c: c4 02 20 18 ld [ %o0 + 0x18 ], %g2 40009aa0: 92 10 00 18 mov %i0, %o1 40009aa4: 94 10 00 19 mov %i1, %o2 40009aa8: 9f c0 80 00 call %g2 40009aac: 96 10 00 1a mov %i2, %o3 the_thread, new_priority, prepend_it ); _ISR_Flash( level ); 40009ab0: 7f ff e2 64 call 40002440 40009ab4: 90 10 00 1d mov %i5, %o0 40009ab8: 7f ff e2 5f call 40002434 40009abc: 01 00 00 00 nop 40009ac0: ba 10 00 08 mov %o0, %i5 RTEMS_INLINE_ROUTINE void _Scheduler_Schedule( const Scheduler_Control *scheduler, Thread_Control *the_thread ) { ( *scheduler->Operations.schedule )( scheduler, the_thread ); 40009ac4: 11 10 00 55 sethi %hi(0x40015400), %o0 40009ac8: 90 12 22 6c or %o0, 0x26c, %o0 ! 4001566c <_Scheduler_Table> 40009acc: c2 02 20 08 ld [ %o0 + 8 ], %g1 40009ad0: 9f c0 40 00 call %g1 40009ad4: 92 10 00 18 mov %i0, %o1 40009ad8: 30 80 00 05 b,a 40009aec <_Thread_Change_priority+0x88> const Scheduler_Control *scheduler, Thread_Control *the_thread, Priority_Control new_priority ) { ( *scheduler->Operations.update_priority )( 40009adc: c4 02 20 24 ld [ %o0 + 0x24 ], %g2 40009ae0: 92 10 00 18 mov %i0, %o1 40009ae4: 9f c0 80 00 call %g2 40009ae8: 94 10 00 19 mov %i1, %o2 scheduler = _Scheduler_Get( the_thread ); _Scheduler_Schedule( scheduler, the_thread ); } else { _Scheduler_Update_priority( scheduler, the_thread, new_priority ); } _ISR_Enable( level ); 40009aec: 7f ff e2 55 call 40002440 40009af0: 90 10 00 1d mov %i5, %o0 _Thread_queue_Requeue( the_thread->Wait.queue, the_thread ); 40009af4: fa 06 20 44 ld [ %i0 + 0x44 ], %i5 { /* * Just in case the thread really wasn't blocked on a thread queue * when we get here. */ if ( !the_thread_queue ) 40009af8: 80 a7 60 00 cmp %i5, 0 40009afc: 02 80 00 1a be 40009b64 <_Thread_Change_priority+0x100> 40009b00: 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 ) { 40009b04: c2 07 60 34 ld [ %i5 + 0x34 ], %g1 40009b08: 80 a0 60 01 cmp %g1, 1 40009b0c: 12 80 00 16 bne 40009b64 <_Thread_Change_priority+0x100> 40009b10: 01 00 00 00 nop Thread_queue_Control *tq = the_thread_queue; ISR_Level level; ISR_Level level_ignored; _ISR_Disable( level ); 40009b14: 7f ff e2 48 call 40002434 40009b18: 01 00 00 00 nop 40009b1c: b8 10 00 08 mov %o0, %i4 */ RTEMS_INLINE_ROUTINE bool _States_Is_waiting_on_thread_queue ( States_Control the_states ) { return (the_states & STATES_WAITING_ON_THREAD_QUEUE); 40009b20: c4 06 20 10 ld [ %i0 + 0x10 ], %g2 if ( _States_Is_waiting_on_thread_queue( the_thread->current_state ) ) { 40009b24: 03 00 02 ef sethi %hi(0xbbc00), %g1 40009b28: 82 10 62 e0 or %g1, 0x2e0, %g1 ! bbee0 <_TLS_Alignment+0xbbedf> 40009b2c: 80 88 80 01 btst %g2, %g1 40009b30: 02 80 00 0b be 40009b5c <_Thread_Change_priority+0xf8> <== NEVER TAKEN 40009b34: 82 10 20 01 mov 1, %g1 _Thread_queue_Enter_critical_section( tq ); _Thread_queue_Extract_priority_helper( 40009b38: d2 06 20 34 ld [ %i0 + 0x34 ], %o1 40009b3c: 90 10 00 18 mov %i0, %o0 40009b40: 94 10 20 01 mov 1, %o2 40009b44: 40 00 02 76 call 4000a51c <_Thread_queue_Extract_priority_helper> 40009b48: c2 27 60 30 st %g1, [ %i5 + 0x30 ] the_thread, the_thread->Wait.return_code, true ); (void) _Thread_queue_Enqueue_priority( tq, the_thread, &level_ignored ); 40009b4c: 90 10 00 1d mov %i5, %o0 40009b50: 92 10 00 18 mov %i0, %o1 40009b54: 40 00 02 0f call 4000a390 <_Thread_queue_Enqueue_priority> 40009b58: 94 07 bf fc add %fp, -4, %o2 } _ISR_Enable( level ); 40009b5c: 7f ff e2 39 call 40002440 40009b60: 90 10 00 1c mov %i4, %o0 40009b64: 81 c7 e0 08 ret 40009b68: 81 e8 00 00 restore =============================================================================== 4000aa78 <_Thread_Close>: } } } void _Thread_Close( Thread_Control *the_thread, Thread_Control *executing ) { 4000aa78: 9d e3 bf a0 save %sp, -96, %sp _Assert( _Thread_Is_life_protected( executing->Life.state ) ); _Objects_Close( 4000aa7c: d0 06 20 08 ld [ %i0 + 8 ], %o0 4000aa80: 7f ff f9 31 call 40008f44 <_Objects_Get_information_id> 4000aa84: ba 10 00 18 mov %i0, %i5 4000aa88: 7f ff f8 46 call 40008ba0 <_Objects_Close> 4000aa8c: 92 10 00 18 mov %i0, %o1 */ RTEMS_INLINE_ROUTINE bool _States_Is_dormant ( States_Control the_states ) { return (the_states & STATES_DORMANT); 4000aa90: c2 06 20 10 ld [ %i0 + 0x10 ], %g1 _Objects_Get_information_id( the_thread->Object.id ), &the_thread->Object ); if ( _States_Is_dormant( the_thread->current_state ) ) { 4000aa94: 80 88 60 01 btst 1, %g1 4000aa98: 02 80 00 04 be 4000aaa8 <_Thread_Close+0x30> 4000aa9c: 80 a6 00 19 cmp %i0, %i1 _Thread_Make_zombie( the_thread ); 4000aaa0: 7f ff ff 0c call 4000a6d0 <_Thread_Make_zombie> 4000aaa4: 81 e8 00 00 restore } else { if ( 4000aaa8: 22 80 00 0b be,a 4000aad4 <_Thread_Close+0x5c> 4000aaac: f4 06 60 14 ld [ %i1 + 0x14 ], %i2 RTEMS_INLINE_ROUTINE bool _Thread_Is_life_terminating( Thread_Life_state life_state ) { return ( life_state & THREAD_LIFE_TERMINATING ) != 0; 4000aab0: c2 06 61 50 ld [ %i1 + 0x150 ], %g1 the_thread != executing && !_Thread_Is_life_terminating( executing->Life.state ) 4000aab4: 80 88 60 04 btst 4, %g1 4000aab8: 32 80 00 07 bne,a 4000aad4 <_Thread_Close+0x5c> <== NEVER TAKEN 4000aabc: f4 06 60 14 ld [ %i1 + 0x14 ], %i2 <== NOT EXECUTED /* * Wait for termination of victim thread. If the executing thread is * also terminated, then do not wait. This avoids potential cyclic * dependencies and thus dead lock. */ the_thread->Life.terminator = executing; 4000aac0: f2 26 21 54 st %i1, [ %i0 + 0x154 ] _Thread_Set_state( executing, STATES_WAITING_FOR_TERMINATION ); 4000aac4: 90 10 00 19 mov %i1, %o0 4000aac8: 40 00 00 2b call 4000ab74 <_Thread_Set_state> 4000aacc: 13 00 04 00 sethi %hi(0x100000), %o1 } _Thread_Request_life_change( 4000aad0: f4 06 60 14 ld [ %i1 + 0x14 ], %i2 4000aad4: b0 10 00 1d mov %i5, %i0 4000aad8: 7f ff ff 36 call 4000a7b0 <_Thread_Request_life_change> 4000aadc: 97 e8 20 04 restore %g0, 4, %o3 =============================================================================== 40009c68 <_Thread_Delay_ended>: void _Thread_Delay_ended( Objects_Id id, void *ignored __attribute__((unused)) ) { 40009c68: 9d e3 bf 98 save %sp, -104, %sp Thread_Control *the_thread; Objects_Locations location; the_thread = _Thread_Get( id, &location ); 40009c6c: 90 10 00 18 mov %i0, %o0 40009c70: 40 00 00 75 call 40009e44 <_Thread_Get> 40009c74: 92 07 bf fc add %fp, -4, %o1 switch ( location ) { 40009c78: c2 07 bf fc ld [ %fp + -4 ], %g1 40009c7c: 80 a0 60 00 cmp %g1, 0 40009c80: 12 80 00 07 bne 40009c9c <_Thread_Delay_ended+0x34> <== NEVER TAKEN 40009c84: 13 04 00 00 sethi %hi(0x10000000), %o1 #if defined(RTEMS_MULTIPROCESSING) case OBJECTS_REMOTE: /* impossible */ #endif break; case OBJECTS_LOCAL: _Thread_Clear_state( 40009c88: 7f ff ff b9 call 40009b6c <_Thread_Clear_state> 40009c8c: 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 disable_level = _Thread_Dispatch_disable_level; 40009c90: c4 01 a0 10 ld [ %g6 + 0x10 ], %g2 ISR_Level level; _ISR_Disable( level ); #endif --disable_level; 40009c94: 84 00 bf ff add %g2, -1, %g2 _Thread_Dispatch_disable_level = disable_level; 40009c98: c4 21 a0 10 st %g2, [ %g6 + 0x10 ] 40009c9c: 81 c7 e0 08 ret 40009ca0: 81 e8 00 00 restore =============================================================================== 40009ca4 <_Thread_Dispatch>: _Thread_Action_release_and_ISR_enable( cpu_self, level ); } void _Thread_Dispatch( void ) { 40009ca4: 9d e3 bf 98 save %sp, -104, %sp #endif cpu_self = _Per_CPU_Get(); _Assert( cpu_self->thread_dispatch_disable_level == 0 ); _Profiling_Thread_dispatch_disable( cpu_self, 0 ); cpu_self->thread_dispatch_disable_level = 1; 40009ca8: 82 10 20 01 mov 1, %g1 * to this function. */ _ISR_Disable_without_giant( level ); #endif cpu_self = _Per_CPU_Get(); 40009cac: b6 10 00 06 mov %g6, %i3 _Assert( cpu_self->thread_dispatch_disable_level == 0 ); _Profiling_Thread_dispatch_disable( cpu_self, 0 ); cpu_self->thread_dispatch_disable_level = 1; 40009cb0: c2 21 a0 10 st %g1, [ %g6 + 0x10 ] * Now determine if we need to perform a dispatch on the current CPU. */ executing = cpu_self->executing; #if !defined( RTEMS_SMP ) _ISR_Disable( level ); 40009cb4: 7f ff e1 e0 call 40002434 40009cb8: e6 01 a0 18 ld [ %g6 + 0x18 ], %l3 */ static inline void _TOD_Get_uptime( Timestamp_Control *time ) { _TOD_Get_with_nanoseconds( time, &_TOD.uptime ); 40009cbc: 23 10 00 61 sethi %hi(0x40018400), %l1 */ RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_first( const Chain_Control *the_chain ) { return _Chain_Immutable_head( the_chain )->next; 40009cc0: 33 10 00 5b sethi %hi(0x40016c00), %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 = rtems_configuration_get_ticks_per_timeslice(); 40009cc4: 21 10 00 55 sethi %hi(0x40015400), %l0 40009cc8: b2 16 60 18 or %i1, 0x18, %i1 40009ccc: a2 14 60 08 or %l1, 8, %l1 { const Chain_Control *chain = &_User_extensions_Switches_list; const Chain_Node *tail = _Chain_Immutable_tail( chain ); const Chain_Node *node = _Chain_Immutable_first( chain ); if ( node != tail ) { 40009cd0: b0 06 60 04 add %i1, 4, %i0 if ( executing->fp_context != NULL ) _Context_Save_fp( &executing->fp_context ); #endif #endif _Context_Switch( &executing->Registers, &heir->Registers ); 40009cd4: a4 04 e0 d0 add %l3, 0xd0, %l2 #endif #if defined( RTEMS_SMP ) if ( cpu_self->dispatch_necessary ) { #else while ( cpu_self->dispatch_necessary ) { 40009cd8: c2 0e e0 14 ldub [ %i3 + 0x14 ], %g1 40009cdc: 80 a0 60 00 cmp %g1, 0 40009ce0: 02 80 00 07 be 40009cfc <_Thread_Dispatch+0x58> 40009ce4: 01 00 00 00 nop * _Scheduler_SMP_Update_heir(). */ _Atomic_Fence( ATOMIC_ORDER_SEQ_CST ); #endif heir = cpu_self->heir; 40009ce8: e8 06 e0 1c ld [ %i3 + 0x1c ], %l4 Per_CPU_Control *cpu_self ) { Thread_Control *heir; cpu_self->dispatch_necessary = false; 40009cec: c0 2e e0 14 clrb [ %i3 + 0x14 ] /* * 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 ) 40009cf0: 80 a5 00 13 cmp %l4, %l3 40009cf4: 12 80 00 10 bne 40009d34 <_Thread_Dispatch+0x90> 40009cf8: e8 26 e0 18 st %l4, [ %i3 + 0x18 ] #endif } post_switch: _Assert( cpu_self->thread_dispatch_disable_level == 1 ); cpu_self->thread_dispatch_disable_level = 0; 40009cfc: c0 26 e0 10 clr [ %i3 + 0x10 ] _Profiling_Thread_dispatch_enable( cpu_self, 0 ); _ISR_Enable_without_giant( level ); 40009d00: 7f ff e1 d0 call 40002440 40009d04: 01 00 00 00 nop ISR_Level *level ) { Per_CPU_Control *cpu; _ISR_Disable_without_giant( *level ); 40009d08: 7f ff e1 cb call 40002434 40009d0c: 01 00 00 00 nop 40009d10: 96 10 00 08 mov %o0, %o3 40009d14: d2 04 e0 c4 ld [ %l3 + 0xc4 ], %o1 RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( const Chain_Control *the_chain ) { return _Chain_Immutable_first( the_chain ) == _Chain_Immutable_tail( the_chain ); 40009d18: ba 04 e0 c8 add %l3, 0xc8, %i5 #if defined(RTEMS_SMP) return thread->cpu; #else (void) thread; return _Per_CPU_Get(); 40009d1c: 94 10 00 06 mov %g6, %o2 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Get_unprotected( Chain_Control *the_chain ) { if ( !_Chain_Is_empty(the_chain)) 40009d20: 80 a2 40 1d cmp %o1, %i5 40009d24: 12 80 00 35 bne 40009df8 <_Thread_Dispatch+0x154> 40009d28: b8 04 e0 c4 add %l3, 0xc4, %i4 return _Chain_Get_first_unprotected(the_chain); else return NULL; 40009d2c: 10 80 00 25 b 40009dc0 <_Thread_Dispatch+0x11c> 40009d30: 92 10 20 00 clr %o1 */ #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 ) 40009d34: c2 05 20 78 ld [ %l4 + 0x78 ], %g1 40009d38: 80 a0 60 01 cmp %g1, 1 40009d3c: 12 80 00 04 bne 40009d4c <_Thread_Dispatch+0xa8> 40009d40: 82 14 21 88 or %l0, 0x188, %g1 heir->cpu_time_budget = rtems_configuration_get_ticks_per_timeslice(); 40009d44: c2 00 60 1c ld [ %g1 + 0x1c ], %g1 40009d48: c2 25 20 74 st %g1, [ %l4 + 0x74 ] #if !defined( RTEMS_SMP ) _ISR_Enable( level ); 40009d4c: 7f ff e1 bd call 40002440 40009d50: 01 00 00 00 nop 40009d54: 90 07 bf f8 add %fp, -8, %o0 40009d58: 7f ff f9 da call 400084c0 <_TOD_Get_with_nanoseconds> 40009d5c: 92 10 00 11 mov %l1, %o1 { Timestamp_Control uptime; Timestamp_Control ran; _TOD_Get_uptime( &uptime ); _Timestamp_Subtract( 40009d60: c4 1f bf f8 ldd [ %fp + -8 ], %g2 const Timestamp64_Control *_start, const Timestamp64_Control *_end, Timestamp64_Control *_result ) { *_result = *_end - *_start; 40009d64: f8 1e e0 20 ldd [ %i3 + 0x20 ], %i4 time_of_last_context_switch, &uptime, &ran ); *time_of_last_context_switch = uptime; 40009d68: c4 3e e0 20 std %g2, [ %i3 + 0x20 ] 40009d6c: ba a0 c0 1d subcc %g3, %i5, %i5 40009d70: b8 60 80 1c subx %g2, %i4, %i4 static inline void _Timestamp64_implementation_Add_to( Timestamp64_Control *_time, const Timestamp64_Control *_add ) { *_time += *_add; 40009d74: c4 1c e0 80 ldd [ %l3 + 0x80 ], %g2 40009d78: b6 80 c0 1d addcc %g3, %i5, %i3 */ RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_first( const Chain_Control *the_chain ) { return _Chain_Immutable_head( the_chain )->next; 40009d7c: fa 06 40 00 ld [ %i1 ], %i5 40009d80: b4 40 80 1c addx %g2, %i4, %i2 40009d84: f4 3c e0 80 std %i2, [ %l3 + 0x80 ] 40009d88: 80 a7 40 18 cmp %i5, %i0 40009d8c: 02 80 00 08 be 40009dac <_Thread_Dispatch+0x108> 40009d90: 90 10 00 12 mov %l2, %o0 while ( node != tail ) { const User_extensions_Switch_control *extension = (const User_extensions_Switch_control *) node; (*extension->thread_switch)( executing, heir ); 40009d94: c2 07 60 08 ld [ %i5 + 8 ], %g1 40009d98: 90 10 00 13 mov %l3, %o0 40009d9c: 9f c0 40 00 call %g1 40009da0: 92 10 00 14 mov %l4, %o1 Thread_Control *heir ) { const Chain_Control *chain = &_User_extensions_Switches_list; const Chain_Node *tail = _Chain_Immutable_tail( chain ); const Chain_Node *node = _Chain_Immutable_first( chain ); 40009da4: 10 bf ff f9 b 40009d88 <_Thread_Dispatch+0xe4> 40009da8: fa 07 40 00 ld [ %i5 ], %i5 if ( executing->fp_context != NULL ) _Context_Save_fp( &executing->fp_context ); #endif #endif _Context_Switch( &executing->Registers, &heir->Registers ); 40009dac: 40 00 2a c7 call 400148c8 <_CPU_Context_switch> 40009db0: 92 05 20 d0 add %l4, 0xd0, %o1 cpu_self = _Per_CPU_Get(); _Thread_Debug_set_real_processor( executing, cpu_self ); #if !defined( RTEMS_SMP ) _ISR_Disable( level ); 40009db4: 7f ff e1 a0 call 40002434 40009db8: b6 10 00 06 mov %g6, %i3 40009dbc: 30 bf ff c7 b,a 40009cd8 <_Thread_Dispatch+0x34> Thread_Action *action; cpu_self = _Thread_Action_ISR_disable_and_acquire( executing, &level ); action = _Thread_Get_post_switch_action( executing ); while ( action != NULL ) { 40009dc0: 80 a2 60 00 cmp %o1, 0 40009dc4: 02 80 00 11 be 40009e08 <_Thread_Dispatch+0x164> 40009dc8: 01 00 00 00 nop _Chain_Set_off_chain( &action->Node ); ( *action->handler )( executing, action, cpu_self, level ); 40009dcc: c2 02 60 08 ld [ %o1 + 8 ], %g1 */ RTEMS_INLINE_ROUTINE void _Chain_Set_off_chain( Chain_Node *node ) { node->next = NULL; 40009dd0: c0 22 40 00 clr [ %o1 ] 40009dd4: 9f c0 40 00 call %g1 40009dd8: 90 10 00 13 mov %l3, %o0 ISR_Level *level ) { Per_CPU_Control *cpu; _ISR_Disable_without_giant( *level ); 40009ddc: 7f ff e1 96 call 40002434 40009de0: 01 00 00 00 nop 40009de4: 96 10 00 08 mov %o0, %o3 */ RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_first( const Chain_Control *the_chain ) { return _Chain_Immutable_head( the_chain )->next; 40009de8: d2 04 e0 c4 ld [ %l3 + 0xc4 ], %o1 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Get_unprotected( Chain_Control *the_chain ) { if ( !_Chain_Is_empty(the_chain)) 40009dec: 80 a2 40 1d cmp %o1, %i5 40009df0: 02 80 00 06 be 40009e08 <_Thread_Dispatch+0x164> <== ALWAYS TAKEN 40009df4: 94 10 00 06 mov %g6, %o2 Chain_Control *the_chain ) { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *old_first = head->next; Chain_Node *new_first = old_first->next; 40009df8: c2 02 40 00 ld [ %o1 ], %g1 head->next = new_first; 40009dfc: c2 24 e0 c4 st %g1, [ %l3 + 0xc4 ] new_first->previous = head; 40009e00: 10 bf ff f0 b 40009dc0 <_Thread_Dispatch+0x11c> 40009e04: f8 20 60 04 st %i4, [ %g1 + 4 ] RTEMS_INLINE_ROUTINE void _Thread_Action_release_and_ISR_enable( Per_CPU_Control *cpu, ISR_Level level ) { _Per_CPU_Release_and_ISR_enable( cpu, level ); 40009e08: 7f ff e1 8e call 40002440 40009e0c: 90 10 00 0b mov %o3, %o0 40009e10: 81 c7 e0 08 ret 40009e14: 81 e8 00 00 restore =============================================================================== 4000f828 <_Thread_Handler>: return doCons; } #endif void _Thread_Handler( void ) { 4000f828: 9d e3 bf a0 save %sp, -96, %sp Thread_Control *executing; #if defined(EXECUTE_GLOBAL_CONSTRUCTORS) bool doCons; #endif executing = _Thread_Executing; 4000f82c: fa 01 a0 18 ld [ %g6 + 0x18 ], %i5 /* * 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(); 4000f830: 3f 10 00 3e sethi %hi(0x4000f800), %i7 4000f834: be 17 e0 28 or %i7, 0x28, %i7 ! 4000f828 <_Thread_Handler> #if !defined(RTEMS_SMP) /* * have to put level into a register for those cpu's that use * inline asm here */ level = executing->Start.isr_level; 4000f838: d0 07 60 a8 ld [ %i5 + 0xa8 ], %o0 _ISR_Set_level( level ); 4000f83c: 7f ff cb 01 call 40002440 4000f840: 91 2a 20 08 sll %o0, 8, %o0 && _Objects_Get_API( executing->Object.id ) != OBJECTS_INTERNAL_API; if (doCons) doneConstructors = true; #else (void) executing; doCons = !doneConstructors; 4000f844: 03 10 00 5f sethi %hi(0x40017c00), %g1 doneConstructors = true; 4000f848: 84 10 20 01 mov 1, %g2 && _Objects_Get_API( executing->Object.id ) != OBJECTS_INTERNAL_API; if (doCons) doneConstructors = true; #else (void) executing; doCons = !doneConstructors; 4000f84c: f8 08 62 c8 ldub [ %g1 + 0x2c8 ], %i4 ); } static inline void _User_extensions_Thread_begin( Thread_Control *executing ) { _User_extensions_Iterate( 4000f850: 90 10 00 1d mov %i5, %o0 4000f854: 13 10 00 2b sethi %hi(0x4000ac00), %o1 4000f858: 92 12 61 a4 or %o1, 0x1a4, %o1 ! 4000ada4 <_User_extensions_Thread_begin_visitor> 4000f85c: 7f ff ed 78 call 4000ae3c <_User_extensions_Iterate> 4000f860: c4 28 62 c8 stb %g2, [ %g1 + 0x2c8 ] * no thread dispatch necessary update. */ _Thread_Dispatch(); } #else _Thread_Enable_dispatch(); 4000f864: 7f ff e9 6d call 40009e18 <_Thread_Enable_dispatch> 4000f868: 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) */ { 4000f86c: 80 8f 20 ff btst 0xff, %i4 4000f870: 32 80 00 05 bne,a 4000f884 <_Thread_Handler+0x5c> 4000f874: c2 07 60 90 ld [ %i5 + 0x90 ], %g1 INIT_NAME (); 4000f878: 40 00 1c 7c call 40016a68 <_init> 4000f87c: 01 00 00 00 nop /* * RTEMS supports multiple APIs and each API can define a different * thread/task prototype. The following code supports invoking the * user thread entry point using the prototype expected. */ if ( executing->Start.prototype == THREAD_START_NUMERIC ) { 4000f880: c2 07 60 90 ld [ %i5 + 0x90 ], %g1 4000f884: 80 a0 60 00 cmp %g1, 0 4000f888: 12 80 00 05 bne 4000f89c <_Thread_Handler+0x74> 4000f88c: 80 a0 60 01 cmp %g1, 1 executing->Wait.return_argument = (*(Thread_Entry_numeric) executing->Start.entry_point)( 4000f890: c2 07 60 8c ld [ %i5 + 0x8c ], %g1 4000f894: 10 80 00 06 b 4000f8ac <_Thread_Handler+0x84> 4000f898: 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 ) { 4000f89c: 12 80 00 08 bne 4000f8bc <_Thread_Handler+0x94> <== NEVER TAKEN 4000f8a0: 90 10 00 1d mov %i5, %o0 executing->Wait.return_argument = (*(Thread_Entry_pointer) executing->Start.entry_point)( 4000f8a4: c2 07 60 8c ld [ %i5 + 0x8c ], %g1 4000f8a8: d0 07 60 94 ld [ %i5 + 0x94 ], %o0 4000f8ac: 9f c0 40 00 call %g1 4000f8b0: 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 = 4000f8b4: d0 27 60 28 st %o0, [ %i5 + 0x28 ] } } static inline void _User_extensions_Thread_exitted( Thread_Control *executing ) { _User_extensions_Iterate( 4000f8b8: 90 10 00 1d mov %i5, %o0 4000f8bc: 13 10 00 2b sethi %hi(0x4000ac00), %o1 4000f8c0: 7f ff ed 5f call 4000ae3c <_User_extensions_Iterate> 4000f8c4: 92 12 61 c8 or %o1, 0x1c8, %o1 ! 4000adc8 <_User_extensions_Thread_exitted_visitor> * able to fit in a (void *). */ _User_extensions_Thread_exitted( executing ); _Terminate( 4000f8c8: 90 10 20 00 clr %o0 4000f8cc: 92 10 20 01 mov 1, %o1 4000f8d0: 7f ff e4 4e call 40008a08 <_Terminate> 4000f8d4: 94 10 20 05 mov 5, %o2 =============================================================================== 4000a11c <_Thread_Handler_initialization>: #include #include void _Thread_Handler_initialization(void) { 4000a11c: 9d e3 bf 98 save %sp, -104, %sp rtems_stack_allocate_init_hook stack_allocate_init_hook = 4000a120: 03 10 00 55 sethi %hi(0x40015400), %g1 4000a124: 82 10 61 88 or %g1, 0x188, %g1 ! 40015588 #if defined(RTEMS_MULTIPROCESSING) uint32_t maximum_proxies = _Configuration_MP_table->maximum_proxies; #endif if ( rtems_configuration_get_stack_allocate_hook() == NULL || 4000a128: c6 00 60 30 ld [ %g1 + 0x30 ], %g3 4000a12c: 80 a0 e0 00 cmp %g3, 0 4000a130: 02 80 00 06 be 4000a148 <_Thread_Handler_initialization+0x2c><== NEVER TAKEN 4000a134: c4 00 60 2c ld [ %g1 + 0x2c ], %g2 4000a138: c6 00 60 34 ld [ %g1 + 0x34 ], %g3 4000a13c: 80 a0 e0 00 cmp %g3, 0 4000a140: 12 80 00 06 bne 4000a158 <_Thread_Handler_initialization+0x3c> 4000a144: 80 a0 a0 00 cmp %g2, 0 rtems_configuration_get_stack_free_hook() == NULL) _Terminate( 4000a148: 90 10 20 00 clr %o0 4000a14c: 92 10 20 01 mov 1, %o1 4000a150: 7f ff fa 2e call 40008a08 <_Terminate> 4000a154: 94 10 20 0e mov 0xe, %o2 INTERNAL_ERROR_CORE, true, INTERNAL_ERROR_BAD_STACK_HOOK ); if ( stack_allocate_init_hook != NULL ) 4000a158: 22 80 00 05 be,a 4000a16c <_Thread_Handler_initialization+0x50> 4000a15c: 03 10 00 55 sethi %hi(0x40015400), %g1 (*stack_allocate_init_hook)( rtems_configuration_get_stack_space_size() ); 4000a160: 9f c0 80 00 call %g2 4000a164: d0 00 60 04 ld [ %g1 + 4 ], %o0 ! 40015404 <__EH_FRAME_BEGIN__+0x44> /* * Initialize the internal class of threads. We need an IDLE thread * per CPU in an SMP system. In addition, if this is a loosely * coupled multiprocessing system, account for the MPCI Server Thread. */ _Objects_Initialize_information( 4000a168: 03 10 00 55 sethi %hi(0x40015400), %g1 4000a16c: d8 10 61 f2 lduh [ %g1 + 0x1f2 ], %o4 ! 400155f2 <_Thread_Control_size+0x2> 4000a170: 82 10 20 08 mov 8, %g1 4000a174: 11 10 00 61 sethi %hi(0x40018400), %o0 4000a178: c2 23 a0 5c st %g1, [ %sp + 0x5c ] 4000a17c: 90 12 20 c8 or %o0, 0xc8, %o0 4000a180: 92 10 20 01 mov 1, %o1 4000a184: 94 10 20 01 mov 1, %o2 4000a188: 96 10 20 01 mov 1, %o3 4000a18c: 7f ff fb c8 call 400090ac <_Objects_Initialize_information> 4000a190: 9a 10 20 00 clr %o5 4000a194: 81 c7 e0 08 ret 4000a198: 81 e8 00 00 restore =============================================================================== 40009ed4 <_Thread_Initialize>: Thread_CPU_budget_algorithms budget_algorithm, Thread_CPU_budget_algorithm_callout budget_callout, uint32_t isr_level, Objects_Name name ) { 40009ed4: 9d e3 bf 98 save %sp, -104, %sp 40009ed8: c2 07 a0 70 ld [ %fp + 0x70 ], %g1 40009edc: fa 07 a0 5c ld [ %fp + 0x5c ], %i5 40009ee0: e2 00 40 00 ld [ %g1 ], %l1 40009ee4: e0 07 a0 64 ld [ %fp + 0x64 ], %l0 { /* * Do not use _TLS_Size here since this will lead GCC to assume that this * symbol is not 0 and the tests for 0 will be optimized away. */ return (uintptr_t) _TLS_BSS_end - (uintptr_t) _TLS_Data_begin; 40009ee8: 03 10 00 5a sethi %hi(0x40016800), %g1 40009eec: e4 0f a0 63 ldub [ %fp + 0x63 ], %l2 40009ef0: 82 10 62 a0 or %g1, 0x2a0, %g1 40009ef4: 27 10 00 5a sethi %hi(0x40016800), %l3 40009ef8: a6 14 e2 a0 or %l3, 0x2a0, %l3 ! 40016aa0 <_RTEMS_tasks_Initialize_user_tasks_p> 40009efc: a6 24 c0 01 sub %l3, %g1, %l3 if ( rtems_configuration_is_smp_enabled() && !is_preemptible ) { return false; } #endif for ( i = 0 ; i < _Thread_Control_add_on_count ; ++i ) { 40009f00: 03 10 00 55 sethi %hi(0x40015400), %g1 40009f04: 84 10 20 00 clr %g2 40009f08: c6 00 61 cc ld [ %g1 + 0x1cc ], %g3 40009f0c: 03 10 00 55 sethi %hi(0x40015400), %g1 40009f10: 82 10 61 d0 or %g1, 0x1d0, %g1 ! 400155d0 <_Thread_Control_add_ons> 40009f14: 80 a0 80 03 cmp %g2, %g3 40009f18: 02 80 00 08 be 40009f38 <_Thread_Initialize+0x64> 40009f1c: 84 00 a0 01 inc %g2 const Thread_Control_add_on *add_on = &_Thread_Control_add_ons[ i ]; *(void **) ( (char *) the_thread + add_on->destination_offset ) = (char *) the_thread + add_on->source_offset; 40009f20: de 00 60 04 ld [ %g1 + 4 ], %o7 #endif for ( i = 0 ; i < _Thread_Control_add_on_count ; ++i ) { const Thread_Control_add_on *add_on = &_Thread_Control_add_ons[ i ]; *(void **) ( (char *) the_thread + add_on->destination_offset ) = 40009f24: c8 00 40 00 ld [ %g1 ], %g4 (char *) the_thread + add_on->source_offset; 40009f28: 9e 06 40 0f add %i1, %o7, %o7 #endif for ( i = 0 ; i < _Thread_Control_add_on_count ; ++i ) { const Thread_Control_add_on *add_on = &_Thread_Control_add_ons[ i ]; *(void **) ( (char *) the_thread + add_on->destination_offset ) = 40009f2c: de 26 40 04 st %o7, [ %i1 + %g4 ] 40009f30: 10 bf ff f9 b 40009f14 <_Thread_Initialize+0x40> 40009f34: 82 00 60 08 add %g1, 8, %g1 if ( !actual_stack_size || actual_stack_size < stack_size ) return false; /* stack allocation failed */ stack = the_thread->Start.stack; #else if ( !stack_area ) { 40009f38: 80 a6 e0 00 cmp %i3, 0 40009f3c: 12 80 00 0e bne 40009f74 <_Thread_Initialize+0xa0> 40009f40: c0 26 60 c0 clr [ %i1 + 0xc0 ] actual_stack_size = _Thread_Stack_Allocate( the_thread, stack_size ); 40009f44: 90 10 00 19 mov %i1, %o0 40009f48: 40 00 03 1d call 4000abbc <_Thread_Stack_Allocate> 40009f4c: 92 10 00 1c mov %i4, %o1 if ( !actual_stack_size || actual_stack_size < stack_size ) 40009f50: 80 a2 00 1c cmp %o0, %i4 40009f54: 0a 80 00 6e bcs 4000a10c <_Thread_Initialize+0x238> 40009f58: 80 a2 20 00 cmp %o0, 0 40009f5c: 02 80 00 6c be 4000a10c <_Thread_Initialize+0x238> <== NEVER TAKEN 40009f60: 82 10 20 01 mov 1, %g1 return false; /* stack allocation failed */ stack = the_thread->Start.stack; 40009f64: f6 06 60 bc ld [ %i1 + 0xbc ], %i3 the_thread->Start.core_allocated_stack = true; 40009f68: c2 2e 60 b0 stb %g1, [ %i1 + 0xb0 ] 40009f6c: 10 80 00 03 b 40009f78 <_Thread_Initialize+0xa4> 40009f70: b8 10 00 08 mov %o0, %i4 } else { stack = stack_area; actual_stack_size = stack_size; the_thread->Start.core_allocated_stack = false; 40009f74: c0 2e 60 b0 clrb [ %i1 + 0xb0 ] Stack_Control *the_stack, void *starting_address, size_t size ) { the_stack->area = starting_address; 40009f78: f6 26 60 b8 st %i3, [ %i1 + 0xb8 ] stack, actual_stack_size ); /* Thread-local storage (TLS) area allocation */ if ( tls_size > 0 ) { 40009f7c: 80 a4 e0 00 cmp %l3, 0 40009f80: 12 80 00 0b bne 40009fac <_Thread_Initialize+0xd8> 40009f84: f8 26 60 b4 st %i4, [ %i1 + 0xb4 ] * create the extension long after tasks have been created * so they cannot rely on the thread create user extension * call. The object index starts with one, so the first extension context is * unused. */ for ( i = 1 ; i <= rtems_configuration_get_maximum_extensions() ; ++i ) 40009f88: 05 10 00 55 sethi %hi(0x40015400), %g2 Watchdog_Service_routine_entry routine, Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; 40009f8c: c0 26 60 50 clr [ %i1 + 0x50 ] 40009f90: 84 10 a1 88 or %g2, 0x188, %g2 the_watchdog->routine = routine; 40009f94: c0 26 60 64 clr [ %i1 + 0x64 ] the_watchdog->id = id; 40009f98: c0 26 60 68 clr [ %i1 + 0x68 ] the_watchdog->user_data = user_data; 40009f9c: c0 26 60 6c clr [ %i1 + 0x6c ] 40009fa0: c6 00 a0 08 ld [ %g2 + 8 ], %g3 40009fa4: 10 80 00 13 b 40009ff0 <_Thread_Initialize+0x11c> 40009fa8: 82 10 20 01 mov 1, %g1 static inline uintptr_t _TLS_Heap_align_up( uintptr_t val ) { uintptr_t msk = CPU_HEAP_ALIGNMENT - 1; return (val + msk) & ~msk; 40009fac: 13 00 00 00 sethi %hi(0), %o1 40009fb0: a6 04 e0 07 add %l3, 7, %l3 40009fb4: 92 12 60 01 or %o1, 1, %o1 40009fb8: a6 0c ff f8 and %l3, -8, %l3 40009fbc: 92 02 60 07 add %o1, 7, %o1 40009fc0: 92 0a 7f f8 and %o1, -8, %o1 static inline uintptr_t _TLS_Get_thread_control_block_area_size( uintptr_t alignment ) { return alignment <= sizeof(TLS_Thread_control_block) ? 40009fc4: 80 a2 60 08 cmp %o1, 8 40009fc8: 1a 80 00 03 bcc 40009fd4 <_Thread_Initialize+0x100> <== ALWAYS TAKEN 40009fcc: 82 10 00 09 mov %o1, %g1 40009fd0: 82 10 20 08 mov 8, %g1 <== NOT EXECUTED ) { uintptr_t aligned_size = _TLS_Heap_align_up( size ); return _TLS_Get_thread_control_block_area_size( alignment ) + aligned_size + sizeof(TLS_Dynamic_thread_vector); 40009fd4: 90 04 c0 01 add %l3, %g1, %o0 if ( tls_size > 0 ) { uintptr_t tls_align = _TLS_Heap_align_up( (uintptr_t) _TLS_Alignment ); uintptr_t tls_alloc = _TLS_Get_allocation_size( tls_size, tls_align ); the_thread->Start.tls_area = _Workspace_Allocate_aligned( tls_alloc, tls_align ); 40009fd8: 40 00 04 f0 call 4000b398 <_Workspace_Allocate_aligned> 40009fdc: 90 02 20 08 add %o0, 8, %o0 if ( the_thread->Start.tls_area == NULL ) { 40009fe0: 80 a2 20 00 cmp %o0, 0 40009fe4: 12 bf ff e9 bne 40009f88 <_Thread_Initialize+0xb4> <== ALWAYS TAKEN 40009fe8: d0 26 60 c0 st %o0, [ %i1 + 0xc0 ] 40009fec: 30 80 00 44 b,a 4000a0fc <_Thread_Initialize+0x228> <== NOT EXECUTED * create the extension long after tasks have been created * so they cannot rely on the thread create user extension * call. The object index starts with one, so the first extension context is * unused. */ for ( i = 1 ; i <= rtems_configuration_get_maximum_extensions() ; ++i ) 40009ff0: 80 a0 40 03 cmp %g1, %g3 40009ff4: 18 80 00 06 bgu 4000a00c <_Thread_Initialize+0x138> 40009ff8: 89 28 60 02 sll %g1, 2, %g4 40009ffc: 82 00 60 01 inc %g1 4000a000: 88 06 40 04 add %i1, %g4, %g4 the_thread->extensions[ i ] = NULL; 4000a004: 10 bf ff fb b 40009ff0 <_Thread_Initialize+0x11c> 4000a008: c0 21 21 58 clr [ %g4 + 0x158 ] * General initialization */ the_thread->Start.is_preemptible = is_preemptible; the_thread->Start.budget_algorithm = budget_algorithm; the_thread->Start.budget_callout = budget_callout; 4000a00c: c2 07 a0 68 ld [ %fp + 0x68 ], %g1 /* * General initialization */ the_thread->Start.is_preemptible = is_preemptible; 4000a010: e4 2e 60 9c stb %l2, [ %i1 + 0x9c ] the_thread->Start.budget_algorithm = budget_algorithm; 4000a014: e0 26 60 a0 st %l0, [ %i1 + 0xa0 ] the_thread->Start.budget_callout = budget_callout; switch ( budget_algorithm ) { 4000a018: 80 a4 20 02 cmp %l0, 2 4000a01c: 12 80 00 04 bne 4000a02c <_Thread_Initialize+0x158> 4000a020: 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 = 4000a024: c2 00 a0 1c ld [ %g2 + 0x1c ], %g1 4000a028: c2 26 60 74 st %g1, [ %i1 + 0x74 ] case THREAD_CPU_BUDGET_ALGORITHM_CALLOUT: break; #endif } the_thread->Start.isr_level = isr_level; 4000a02c: c2 07 a0 6c ld [ %fp + 0x6c ], %g1 _Thread_Debug_set_real_processor( the_thread, cpu ); /* Initialize the CPU for the non-SMP schedulers */ _Thread_Set_CPU( the_thread, cpu ); the_thread->current_state = STATES_DORMANT; 4000a030: b8 10 20 01 mov 1, %i4 case THREAD_CPU_BUDGET_ALGORITHM_CALLOUT: break; #endif } the_thread->Start.isr_level = isr_level; 4000a034: c2 26 60 a8 st %g1, [ %i1 + 0xa8 ] RTEMS_INLINE_ROUTINE void _Scheduler_Node_initialize( const Scheduler_Control *scheduler, Thread_Control *the_thread ) { return ( *scheduler->Operations.node_initialize )( scheduler, the_thread ); 4000a038: c2 06 a0 1c ld [ %i2 + 0x1c ], %g1 4000a03c: 90 10 00 1a mov %i2, %o0 4000a040: 92 10 00 19 mov %i1, %o1 _Thread_Debug_set_real_processor( the_thread, cpu ); /* Initialize the CPU for the non-SMP schedulers */ _Thread_Set_CPU( the_thread, cpu ); the_thread->current_state = STATES_DORMANT; 4000a044: f8 26 60 10 st %i4, [ %i1 + 0x10 ] the_thread->Wait.queue = NULL; 4000a048: c0 26 60 44 clr [ %i1 + 0x44 ] the_thread->resource_count = 0; 4000a04c: c0 26 60 1c clr [ %i1 + 0x1c ] the_thread->real_priority = priority; 4000a050: fa 26 60 18 st %i5, [ %i1 + 0x18 ] 4000a054: 9f c0 40 00 call %g1 4000a058: fa 26 60 ac st %i5, [ %i1 + 0xac ] the_thread->Start.initial_priority = priority; _Scheduler_Node_initialize( scheduler, the_thread ); scheduler_node_initialized = true; _Thread_Set_priority( the_thread, priority ); 4000a05c: 90 10 00 19 mov %i1, %o0 4000a060: 40 00 02 bb call 4000ab4c <_Thread_Set_priority> 4000a064: 92 10 00 1d mov %i5, %o1 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 ); 4000a068: 82 06 61 38 add %i1, 0x138, %g1 4000a06c: 84 06 61 3c add %i1, 0x13c, %g2 head->next = tail; head->previous = NULL; tail->previous = head; 4000a070: c2 26 61 40 st %g1, [ %i1 + 0x140 ] 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 ); 4000a074: 82 06 60 c4 add %i1, 0xc4, %g1 head->next = tail; 4000a078: c4 26 61 38 st %g2, [ %i1 + 0x138 ] head->previous = NULL; tail->previous = head; 4000a07c: c2 26 60 cc st %g1, [ %i1 + 0xcc ] 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 ); 4000a080: 84 06 60 c8 add %i1, 0xc8, %g2 RTEMS_INLINE_ROUTINE void _Thread_Action_initialize( Thread_Action *action, Thread_Action_handler handler ) { action->handler = handler; 4000a084: 03 10 00 2a sethi %hi(0x4000a800), %g1 4000a088: 82 10 61 d0 or %g1, 0x1d0, %g1 ! 4000a9d0 <_Thread_Life_action_handler> head->next = tail; head->previous = NULL; 4000a08c: c0 26 61 3c clr [ %i1 + 0x13c ] ) { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); head->next = tail; 4000a090: c4 26 60 c4 st %g2, [ %i1 + 0xc4 ] head->previous = NULL; 4000a094: c0 26 60 c8 clr [ %i1 + 0xc8 ] 4000a098: c2 26 61 4c st %g1, [ %i1 + 0x14c ] */ RTEMS_INLINE_ROUTINE void _Chain_Set_off_chain( Chain_Node *node ) { node->next = NULL; 4000a09c: c0 26 61 44 clr [ %i1 + 0x144 ] Objects_Name name ) { the_object->name = name; _Objects_Set_local_object( 4000a0a0: c2 16 60 0a lduh [ %i1 + 0xa ], %g1 #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 4000a0a4: c4 06 20 1c ld [ %i0 + 0x1c ], %g2 static inline void _Timestamp64_implementation_Set_to_zero( Timestamp64_Control *_time ) { *_time = 0; 4000a0a8: c0 26 60 80 clr [ %i1 + 0x80 ] 4000a0ac: c0 26 60 84 clr [ %i1 + 0x84 ] _Thread_Action_initialize( &the_thread->Life.Action, _Thread_Life_action_handler ); the_thread->Life.state = THREAD_LIFE_NORMAL; 4000a0b0: c0 26 61 50 clr [ %i1 + 0x150 ] the_thread->Life.terminator = NULL; 4000a0b4: c0 26 61 54 clr [ %i1 + 0x154 ] Objects_Information *information, Objects_Control *the_object, Objects_Name name ) { the_object->name = name; 4000a0b8: e2 26 60 0c st %l1, [ %i1 + 0xc ] #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 4000a0bc: 83 28 60 02 sll %g1, 2, %g1 4000a0c0: f2 20 80 01 st %i1, [ %g2 + %g1 ] */ /**@{**/ static inline bool _User_extensions_Thread_create( Thread_Control *created ) { User_extensions_Thread_create_context ctx = { created, true }; 4000a0c4: f2 27 bf f8 st %i1, [ %fp + -8 ] 4000a0c8: f8 2f bf fc stb %i4, [ %fp + -4 ] _User_extensions_Iterate( &ctx, _User_extensions_Thread_create_visitor ); 4000a0cc: 90 07 bf f8 add %fp, -8, %o0 4000a0d0: 13 10 00 2b sethi %hi(0x4000ac00), %o1 4000a0d4: 40 00 03 5a call 4000ae3c <_User_extensions_Iterate> 4000a0d8: 92 12 60 f8 or %o1, 0xf8, %o1 ! 4000acf8 <_User_extensions_Thread_create_visitor> return ctx.ok; 4000a0dc: f0 0f bf fc ldub [ %fp + -4 ], %i0 * 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 ) 4000a0e0: 80 8e 20 ff btst 0xff, %i0 4000a0e4: 32 80 00 0c bne,a 4000a114 <_Thread_Initialize+0x240> 4000a0e8: b0 0e 20 ff and %i0, 0xff, %i0 RTEMS_INLINE_ROUTINE void _Scheduler_Node_destroy( const Scheduler_Control *scheduler, Thread_Control *the_thread ) { ( *scheduler->Operations.node_destroy )( scheduler, the_thread ); 4000a0ec: c2 06 a0 20 ld [ %i2 + 0x20 ], %g1 4000a0f0: 90 10 00 1a mov %i2, %o0 4000a0f4: 9f c0 40 00 call %g1 4000a0f8: 92 10 00 19 mov %i1, %o1 if ( scheduler_node_initialized ) { _Scheduler_Node_destroy( scheduler, the_thread ); } _Workspace_Free( the_thread->Start.tls_area ); 4000a0fc: 40 00 04 b0 call 4000b3bc <_Workspace_Free> 4000a100: d0 06 60 c0 ld [ %i1 + 0xc0 ], %o0 #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) _Workspace_Free( fp_area ); #endif _Thread_Stack_Free( the_thread ); 4000a104: 40 00 02 be call 4000abfc <_Thread_Stack_Free> 4000a108: 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 */ 4000a10c: b0 10 20 00 clr %i0 4000a110: b0 0e 20 ff and %i0, 0xff, %i0 4000a114: 81 c7 e0 08 ret 4000a118: 81 e8 00 00 restore =============================================================================== 4000a9d0 <_Thread_Life_action_handler>: Thread_Control *executing, Thread_Action *action, Per_CPU_Control *cpu, ISR_Level level ) { 4000a9d0: 9d e3 bf a0 save %sp, -96, %sp Thread_Life_state previous_life_state; (void) action; previous_life_state = executing->Life.state; executing->Life.state = THREAD_LIFE_PROTECTED; 4000a9d4: 82 10 20 01 mov 1, %g1 { Thread_Life_state previous_life_state; (void) action; previous_life_state = executing->Life.state; 4000a9d8: fa 06 21 50 ld [ %i0 + 0x150 ], %i5 executing->Life.state = THREAD_LIFE_PROTECTED; 4000a9dc: c2 26 21 50 st %g1, [ %i0 + 0x150 ] 4000a9e0: 7f ff de 98 call 40002440 4000a9e4: 90 10 00 1b mov %i3, %o0 _Thread_Action_release_and_ISR_enable( cpu, level ); if ( _Thread_Is_life_terminating( previous_life_state ) ) { 4000a9e8: ba 8f 60 04 andcc %i5, 4, %i5 4000a9ec: 02 80 00 05 be 4000aa00 <_Thread_Life_action_handler+0x30> 4000a9f0: 90 10 00 18 mov %i0, %o0 static inline void _User_extensions_Thread_terminate( Thread_Control *executing ) { _User_extensions_Iterate( 4000a9f4: 13 10 00 2b sethi %hi(0x4000ac00), %o1 4000a9f8: 10 80 00 04 b 4000aa08 <_Thread_Life_action_handler+0x38> 4000a9fc: 92 12 62 18 or %o1, 0x218, %o1 ! 4000ae18 <_User_extensions_Thread_terminate_visitor> ); } static inline void _User_extensions_Thread_restart( Thread_Control *restarted ) { _User_extensions_Iterate( 4000aa00: 13 10 00 2b sethi %hi(0x4000ac00), %o1 4000aa04: 92 12 61 80 or %o1, 0x180, %o1 ! 4000ad80 <_User_extensions_Thread_restart_visitor> 4000aa08: 40 00 01 0d call 4000ae3c <_User_extensions_Iterate> 4000aa0c: 01 00 00 00 nop * * This rountine increments the thread dispatch level */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_increment_disable_level(void) { uint32_t disable_level = _Thread_Dispatch_disable_level; 4000aa10: c4 01 a0 10 ld [ %g6 + 0x10 ], %g2 _ISR_Disable( level ); _Profiling_Thread_dispatch_disable( _Per_CPU_Get(), disable_level ); #endif ++disable_level; 4000aa14: 84 00 a0 01 inc %g2 _Thread_Dispatch_disable_level = disable_level; 4000aa18: c4 21 a0 10 st %g2, [ %g6 + 0x10 ] _User_extensions_Thread_restart( executing ); } _Thread_Disable_dispatch(); if ( _Thread_Is_life_terminating( previous_life_state ) ) { 4000aa1c: 80 a7 60 00 cmp %i5, 0 4000aa20: 22 80 00 0c be,a 4000aa50 <_Thread_Life_action_handler+0x80> 4000aa24: c2 06 21 50 ld [ %i0 + 0x150 ], %g1 _Thread_Make_zombie( executing ); 4000aa28: 7f ff ff 2a call 4000a6d0 <_Thread_Make_zombie> 4000aa2c: 90 10 00 18 mov %i0, %o0 if ( executing->Life.terminator != NULL ) { 4000aa30: d0 06 21 54 ld [ %i0 + 0x154 ], %o0 4000aa34: 80 a2 20 00 cmp %o0, 0 4000aa38: 02 80 00 04 be 4000aa48 <_Thread_Life_action_handler+0x78> 4000aa3c: 01 00 00 00 nop _Thread_Clear_state( 4000aa40: 7f ff fc 4b call 40009b6c <_Thread_Clear_state> 4000aa44: 13 00 04 00 sethi %hi(0x100000), %o1 executing->Life.terminator, STATES_WAITING_FOR_TERMINATION ); } _Thread_Enable_dispatch(); 4000aa48: 7f ff fc f4 call 40009e18 <_Thread_Enable_dispatch> 4000aa4c: 81 e8 00 00 restore _Assert_Not_reached(); } else { _Assert( _Thread_Is_life_restarting( previous_life_state ) ); if ( _Thread_Is_life_terminating( executing->Life.state ) ) { 4000aa50: 80 88 60 04 btst 4, %g1 4000aa54: 22 80 00 04 be,a 4000aa64 <_Thread_Life_action_handler+0x94><== ALWAYS TAKEN 4000aa58: 90 10 00 18 mov %i0, %o0 /* Someone deleted us in the mean-time */ _Thread_Start_life_change_for_executing( executing ); 4000aa5c: 7f ff ff 45 call 4000a770 <_Thread_Start_life_change_for_executing><== NOT EXECUTED 4000aa60: 81 e8 00 00 restore <== NOT EXECUTED || executing->current_state == STATES_SUSPENDED ); executing->Life.state = THREAD_LIFE_NORMAL; _Thread_Load_environment( executing ); 4000aa64: 40 00 0b 79 call 4000d848 <_Thread_Load_environment> 4000aa68: c0 26 21 50 clr [ %i0 + 0x150 ] #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) if ( executing->fp_context != NULL ) _Context_Restore_fp( &executing->fp_context ); #endif _CPU_Context_Restart_self( &executing->Registers ); 4000aa6c: 40 00 27 d8 call 400149cc <_CPU_Context_restore> 4000aa70: 90 06 20 d0 add %i0, 0xd0, %o0 =============================================================================== 4000a7b0 <_Thread_Request_life_change>: Thread_Control *the_thread, Thread_Control *executing, Priority_Control priority, Thread_Life_state additional_life_state ) { 4000a7b0: 9d e3 bf a0 save %sp, -96, %sp ISR_Level *level ) { Per_CPU_Control *cpu; _ISR_Disable_without_giant( *level ); 4000a7b4: 7f ff df 20 call 40002434 4000a7b8: 01 00 00 00 nop Per_CPU_Control *cpu; ISR_Level level; const Scheduler_Control *scheduler; cpu = _Thread_Action_ISR_disable_and_acquire( the_thread, &level ); previous_life_state = the_thread->Life.state; 4000a7bc: fa 06 21 50 ld [ %i0 + 0x150 ], %i5 the_thread->Life.state = previous_life_state | additional_life_state; 4000a7c0: 82 16 c0 1d or %i3, %i5, %g1 4000a7c4: c2 26 21 50 st %g1, [ %i0 + 0x150 ] RTEMS_INLINE_ROUTINE void _Thread_Action_release_and_ISR_enable( Per_CPU_Control *cpu, ISR_Level level ) { _Per_CPU_Release_and_ISR_enable( cpu, level ); 4000a7c8: 7f ff df 1e call 40002440 4000a7cc: 01 00 00 00 nop _Thread_Action_release_and_ISR_enable( cpu, level ); scheduler = _Scheduler_Get( the_thread ); if ( the_thread == executing ) { 4000a7d0: 80 a6 00 19 cmp %i0, %i1 4000a7d4: 12 80 00 0d bne 4000a808 <_Thread_Request_life_change+0x58> 4000a7d8: 80 a7 60 00 cmp %i5, 0 Priority_Control priority ) { Priority_Control current = the_thread->current_priority; if ( _Scheduler_Is_priority_higher_than( scheduler, priority, current ) ) { 4000a7dc: d2 06 20 14 ld [ %i0 + 0x14 ], %o1 executing->real_priority = priority; 4000a7e0: f4 26 20 18 st %i2, [ %i0 + 0x18 ] 4000a7e4: 7f ff ff d8 call 4000a744 <_Scheduler_Is_priority_higher_than.constprop.19> 4000a7e8: 90 10 00 1a mov %i2, %o0 4000a7ec: 80 a2 20 00 cmp %o0, 0 4000a7f0: 02 80 00 04 be 4000a800 <_Thread_Request_life_change+0x50><== ALWAYS TAKEN 4000a7f4: 90 10 00 18 mov %i0, %o0 _Thread_Set_priority( the_thread, priority ); 4000a7f8: 40 00 00 d5 call 4000ab4c <_Thread_Set_priority> <== NOT EXECUTED 4000a7fc: 92 10 00 1a mov %i2, %o1 <== NOT EXECUTED _Scheduler_Set_priority_if_higher( scheduler, the_thread, priority ); _Thread_Start_life_change_for_executing( executing ); 4000a800: 7f ff ff dc call 4000a770 <_Thread_Start_life_change_for_executing> 4000a804: 81 e8 00 00 restore } else if ( previous_life_state == THREAD_LIFE_NORMAL ) { 4000a808: 12 80 00 27 bne 4000a8a4 <_Thread_Request_life_change+0xf4> 4000a80c: 90 10 00 18 mov %i0, %o0 Thread_Control *the_thread, const Scheduler_Control *scheduler, Priority_Control priority ) { the_thread->is_preemptible = the_thread->Start.is_preemptible; 4000a810: c2 0e 20 9c ldub [ %i0 + 0x9c ], %g1 the_thread->budget_algorithm = the_thread->Start.budget_algorithm; the_thread->budget_callout = the_thread->Start.budget_callout; the_thread->real_priority = priority; _Thread_Set_state( the_thread, STATES_RESTARTING ); 4000a814: 13 00 20 00 sethi %hi(0x800000), %o1 Thread_Control *the_thread, const Scheduler_Control *scheduler, Priority_Control priority ) { the_thread->is_preemptible = the_thread->Start.is_preemptible; 4000a818: c2 2e 20 70 stb %g1, [ %i0 + 0x70 ] the_thread->budget_algorithm = the_thread->Start.budget_algorithm; 4000a81c: c2 06 20 a0 ld [ %i0 + 0xa0 ], %g1 4000a820: c2 26 20 78 st %g1, [ %i0 + 0x78 ] the_thread->budget_callout = the_thread->Start.budget_callout; 4000a824: c2 06 20 a4 ld [ %i0 + 0xa4 ], %g1 the_thread->real_priority = priority; 4000a828: f4 26 20 18 st %i2, [ %i0 + 0x18 ] _Thread_Set_state( the_thread, STATES_RESTARTING ); 4000a82c: 40 00 00 d2 call 4000ab74 <_Thread_Set_state> 4000a830: c2 26 20 7c st %g1, [ %i0 + 0x7c ] _Thread_queue_Extract_with_proxy( the_thread ); 4000a834: 40 00 0c 51 call 4000d978 <_Thread_queue_Extract_with_proxy> 4000a838: 90 10 00 18 mov %i0, %o0 _Watchdog_Remove( &the_thread->Timer ); 4000a83c: 40 00 02 17 call 4000b098 <_Watchdog_Remove> 4000a840: 90 06 20 48 add %i0, 0x48, %o0 Priority_Control priority ) { Priority_Control current = the_thread->current_priority; if ( _Scheduler_Is_priority_higher_than( scheduler, priority, current ) ) { 4000a844: d2 06 20 14 ld [ %i0 + 0x14 ], %o1 4000a848: 7f ff ff bf call 4000a744 <_Scheduler_Is_priority_higher_than.constprop.19> 4000a84c: 90 10 00 1a mov %i2, %o0 4000a850: 80 a2 20 00 cmp %o0, 0 4000a854: 02 80 00 04 be 4000a864 <_Thread_Request_life_change+0xb4> 4000a858: 90 10 00 18 mov %i0, %o0 _Thread_Set_priority( the_thread, priority ); 4000a85c: 40 00 00 bc call 4000ab4c <_Thread_Set_priority> 4000a860: 92 10 00 1a mov %i2, %o1 ISR_Level *level ) { Per_CPU_Control *cpu; _ISR_Disable_without_giant( *level ); 4000a864: 7f ff de f4 call 40002434 4000a868: 01 00 00 00 nop RTEMS_INLINE_ROUTINE void _Chain_Append_if_is_off_chain_unprotected( Chain_Control *the_chain, Chain_Node *the_node ) { if ( _Chain_Is_node_off_chain( the_node ) ) { 4000a86c: c2 06 21 44 ld [ %i0 + 0x144 ], %g1 4000a870: 80 a0 60 00 cmp %g1, 0 4000a874: 12 80 00 08 bne 4000a894 <_Thread_Request_life_change+0xe4><== NEVER TAKEN 4000a878: 84 06 21 44 add %i0, 0x144, %g2 Chain_Control *the_chain, Chain_Node *the_node ) { Chain_Node *tail = _Chain_Tail( the_chain ); Chain_Node *old_last = tail->previous; 4000a87c: c2 06 20 cc ld [ %i0 + 0xcc ], %g1 RTEMS_INLINE_ROUTINE void _Chain_Append_unprotected( Chain_Control *the_chain, Chain_Node *the_node ) { Chain_Node *tail = _Chain_Tail( the_chain ); 4000a880: 86 06 20 c8 add %i0, 0xc8, %g3 Chain_Node *old_last = tail->previous; the_node->next = tail; tail->previous = the_node; 4000a884: c4 26 20 cc st %g2, [ %i0 + 0xcc ] ) { Chain_Node *tail = _Chain_Tail( the_chain ); Chain_Node *old_last = tail->previous; the_node->next = tail; 4000a888: c6 26 21 44 st %g3, [ %i0 + 0x144 ] tail->previous = the_node; old_last->next = the_node; 4000a88c: c4 20 40 00 st %g2, [ %g1 ] the_node->previous = old_last; 4000a890: c2 26 21 48 st %g1, [ %i0 + 0x148 ] RTEMS_INLINE_ROUTINE void _Thread_Action_release_and_ISR_enable( Per_CPU_Control *cpu, ISR_Level level ) { _Per_CPU_Release_and_ISR_enable( cpu, level ); 4000a894: 7f ff de eb call 40002440 4000a898: 01 00 00 00 nop _Scheduler_Set_priority_if_higher( scheduler, the_thread, priority ); _Thread_Add_post_switch_action( the_thread, &the_thread->Life.Action ); _Thread_Ready( the_thread ); 4000a89c: 40 00 0c 5f call 4000da18 <_Thread_Ready> 4000a8a0: 81 e8 00 00 restore _Scheduler_Set_priority_if_higher( scheduler, the_thread, priority ); _Thread_Start_life_change_for_executing( executing ); } else if ( previous_life_state == THREAD_LIFE_NORMAL ) { _Thread_Start_life_change( the_thread, scheduler, priority ); } else { _Thread_Clear_state( the_thread, STATES_SUSPENDED ); 4000a8a4: 7f ff fc b2 call 40009b6c <_Thread_Clear_state> 4000a8a8: 92 10 20 02 mov 2, %o1 if ( _Thread_Is_life_terminating( additional_life_state ) ) { 4000a8ac: 80 8e e0 04 btst 4, %i3 4000a8b0: 02 80 00 12 be 4000a8f8 <_Thread_Request_life_change+0x148><== NEVER TAKEN 4000a8b4: 92 10 00 1a mov %i2, %o1 the_thread->real_priority = _Scheduler_Highest_priority_of_two( 4000a8b8: fa 06 20 18 ld [ %i0 + 0x18 ], %i5 const Scheduler_Control *scheduler, Priority_Control p1, Priority_Control p2 ) { return _Scheduler_Is_priority_higher_than( scheduler, p1, p2 ) ? p1 : p2; 4000a8bc: 7f ff ff a2 call 4000a744 <_Scheduler_Is_priority_higher_than.constprop.19> 4000a8c0: 90 10 00 1d mov %i5, %o0 4000a8c4: 80 a2 20 00 cmp %o0, 0 4000a8c8: 02 80 00 03 be 4000a8d4 <_Thread_Request_life_change+0x124><== ALWAYS TAKEN 4000a8cc: 82 10 00 1a mov %i2, %g1 4000a8d0: 82 10 00 1d mov %i5, %g1 <== NOT EXECUTED bool prepend_it ) { Priority_Control current = the_thread->current_priority; if ( _Scheduler_Is_priority_higher_than( scheduler, priority, current ) ) { 4000a8d4: d2 06 20 14 ld [ %i0 + 0x14 ], %o1 4000a8d8: c2 26 20 18 st %g1, [ %i0 + 0x18 ] 4000a8dc: 7f ff ff 9a call 4000a744 <_Scheduler_Is_priority_higher_than.constprop.19> 4000a8e0: 90 10 00 1a mov %i2, %o0 4000a8e4: 80 a2 20 00 cmp %o0, 0 4000a8e8: 02 80 00 04 be 4000a8f8 <_Thread_Request_life_change+0x148><== NEVER TAKEN 4000a8ec: b2 10 00 1a mov %i2, %i1 _Thread_Change_priority( the_thread, priority, prepend_it ); 4000a8f0: 7f ff fc 5d call 40009a64 <_Thread_Change_priority> 4000a8f4: 95 e8 20 00 restore %g0, 0, %o2 4000a8f8: 81 c7 e0 08 ret <== NOT EXECUTED 4000a8fc: 81 e8 00 00 restore <== NOT EXECUTED =============================================================================== 4000abfc <_Thread_Stack_Free>: #include void _Thread_Stack_Free( Thread_Control *the_thread ) { 4000abfc: 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 ) 4000ac00: c4 0e 20 b0 ldub [ %i0 + 0xb0 ], %g2 void _Thread_Stack_Free( Thread_Control *the_thread ) { rtems_stack_free_hook stack_free_hook = 4000ac04: 03 10 00 55 sethi %hi(0x40015400), %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 ) 4000ac08: 80 a0 a0 00 cmp %g2, 0 4000ac0c: 02 80 00 04 be 4000ac1c <_Thread_Stack_Free+0x20> <== NEVER TAKEN 4000ac10: c2 00 61 bc ld [ %g1 + 0x1bc ], %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 ); 4000ac14: 9f c0 40 00 call %g1 4000ac18: d0 06 20 b8 ld [ %i0 + 0xb8 ], %o0 4000ac1c: 81 c7 e0 08 ret 4000ac20: 81 e8 00 00 restore =============================================================================== 4000a770 <_Thread_Start_life_change_for_executing>: } static void _Thread_Start_life_change_for_executing( Thread_Control *executing ) { 4000a770: 9d e3 bf a0 save %sp, -96, %sp ISR_Level *level ) { Per_CPU_Control *cpu; _ISR_Disable_without_giant( *level ); 4000a774: 7f ff df 30 call 40002434 4000a778: ba 10 00 18 mov %i0, %i5 4000a77c: b0 10 00 08 mov %o0, %i0 RTEMS_INLINE_ROUTINE void _Chain_Append_if_is_off_chain_unprotected( Chain_Control *the_chain, Chain_Node *the_node ) { if ( _Chain_Is_node_off_chain( the_node ) ) { 4000a780: c2 07 61 44 ld [ %i5 + 0x144 ], %g1 4000a784: 80 a0 60 00 cmp %g1, 0 4000a788: 12 80 00 08 bne 4000a7a8 <_Thread_Start_life_change_for_executing+0x38><== NEVER TAKEN 4000a78c: 84 07 61 44 add %i5, 0x144, %g2 Chain_Control *the_chain, Chain_Node *the_node ) { Chain_Node *tail = _Chain_Tail( the_chain ); Chain_Node *old_last = tail->previous; 4000a790: c2 07 60 cc ld [ %i5 + 0xcc ], %g1 RTEMS_INLINE_ROUTINE void _Chain_Append_unprotected( Chain_Control *the_chain, Chain_Node *the_node ) { Chain_Node *tail = _Chain_Tail( the_chain ); 4000a794: 86 07 60 c8 add %i5, 0xc8, %g3 Chain_Node *old_last = tail->previous; the_node->next = tail; tail->previous = the_node; 4000a798: c4 27 60 cc st %g2, [ %i5 + 0xcc ] ) { Chain_Node *tail = _Chain_Tail( the_chain ); Chain_Node *old_last = tail->previous; the_node->next = tail; 4000a79c: c6 27 61 44 st %g3, [ %i5 + 0x144 ] tail->previous = the_node; old_last->next = the_node; 4000a7a0: c4 20 40 00 st %g2, [ %g1 ] the_node->previous = old_last; 4000a7a4: c2 27 61 48 st %g1, [ %i5 + 0x148 ] RTEMS_INLINE_ROUTINE void _Thread_Action_release_and_ISR_enable( Per_CPU_Control *cpu, ISR_Level level ) { _Per_CPU_Release_and_ISR_enable( cpu, level ); 4000a7a8: 7f ff df 26 call 40002440 4000a7ac: 81 e8 00 00 restore =============================================================================== 4000acc0 <_Thread_Yield>: #include #include void _Thread_Yield( Thread_Control *executing ) { 4000acc0: 9d e3 bf a0 save %sp, -96, %sp ISR_Level level; _ISR_Disable( level ); 4000acc4: 7f ff dd dc call 40002434 4000acc8: ba 10 00 18 mov %i0, %i5 4000accc: b0 10 00 08 mov %o0, %i0 if ( _States_Is_ready( executing->current_state ) ) { 4000acd0: c2 07 60 10 ld [ %i5 + 0x10 ], %g1 4000acd4: 80 a0 60 00 cmp %g1, 0 4000acd8: 12 80 00 06 bne 4000acf0 <_Thread_Yield+0x30> <== NEVER TAKEN 4000acdc: 11 10 00 55 sethi %hi(0x40015400), %o0 RTEMS_INLINE_ROUTINE void _Scheduler_Yield( const Scheduler_Control *scheduler, Thread_Control *the_thread ) { ( *scheduler->Operations.yield )( scheduler, the_thread ); 4000ace0: 90 12 22 6c or %o0, 0x26c, %o0 ! 4001566c <_Scheduler_Table> 4000ace4: c2 02 20 0c ld [ %o0 + 0xc ], %g1 4000ace8: 9f c0 40 00 call %g1 4000acec: 92 10 00 1d mov %i5, %o1 _Scheduler_Yield( _Scheduler_Get( executing ), executing ); } _ISR_Enable( level ); 4000acf0: 7f ff dd d4 call 40002440 4000acf4: 81 e8 00 00 restore =============================================================================== 400143f4 <_Thread_queue_First_fifo>: */ RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_first( const Chain_Control *the_chain ) { return _Chain_Immutable_head( the_chain )->next; 400143f4: c2 02 00 00 ld [ %o0 ], %g1 <== NOT EXECUTED RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( const Chain_Control *the_chain ) { return _Chain_Immutable_first( the_chain ) == _Chain_Immutable_tail( the_chain ); 400143f8: 90 02 20 04 add %o0, 4, %o0 <== NOT EXECUTED ) { if ( !_Chain_Is_empty( &the_thread_queue->Queues.Fifo ) ) return (Thread_Control *) _Chain_First( &the_thread_queue->Queues.Fifo ); return NULL; 400143fc: 90 18 40 08 xor %g1, %o0, %o0 <== NOT EXECUTED 40014400: 80 a0 00 08 cmp %g0, %o0 <== NOT EXECUTED 40014404: 90 60 20 00 subx %g0, 0, %o0 <== NOT EXECUTED } 40014408: 81 c3 e0 08 retl <== NOT EXECUTED 4001440c: 90 08 40 08 and %g1, %o0, %o0 <== NOT EXECUTED =============================================================================== 4000a694 <_Thread_queue_Timeout>: void _Thread_queue_Timeout( Objects_Id id, void *ignored __attribute__((unused)) ) { 4000a694: 9d e3 bf 98 save %sp, -104, %sp Thread_Control *the_thread; Objects_Locations location; the_thread = _Thread_Get( id, &location ); 4000a698: 90 10 00 18 mov %i0, %o0 4000a69c: 7f ff fd ea call 40009e44 <_Thread_Get> 4000a6a0: 92 07 bf fc add %fp, -4, %o1 switch ( location ) { 4000a6a4: c2 07 bf fc ld [ %fp + -4 ], %g1 4000a6a8: 80 a0 60 00 cmp %g1, 0 4000a6ac: 12 80 00 07 bne 4000a6c8 <_Thread_queue_Timeout+0x34> <== NEVER TAKEN 4000a6b0: 01 00 00 00 nop #if defined(RTEMS_MULTIPROCESSING) case OBJECTS_REMOTE: /* impossible */ #endif break; case OBJECTS_LOCAL: _Thread_queue_Process_timeout( the_thread ); 4000a6b4: 40 00 0c bb call 4000d9a0 <_Thread_queue_Process_timeout> 4000a6b8: 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 disable_level = _Thread_Dispatch_disable_level; 4000a6bc: c4 01 a0 10 ld [ %g6 + 0x10 ], %g2 ISR_Level level; _ISR_Disable( level ); #endif --disable_level; 4000a6c0: 84 00 bf ff add %g2, -1, %g2 _Thread_Dispatch_disable_level = disable_level; 4000a6c4: c4 21 a0 10 st %g2, [ %g6 + 0x10 ] 4000a6c8: 81 c7 e0 08 ret 4000a6cc: 81 e8 00 00 restore =============================================================================== 40008d4c <_Timer_server_Body>: * @a arg points to the corresponding timer server control block. */ static rtems_task _Timer_server_Body( rtems_task_argument arg ) { 40008d4c: 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; 40008d50: 2b 10 00 67 sethi %hi(0x40019c00), %l5 ) { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); head->next = tail; 40008d54: b2 07 bf e8 add %fp, -24, %i1 40008d58: a0 07 bf ec add %fp, -20, %l0 40008d5c: b8 07 bf f4 add %fp, -12, %i4 40008d60: b6 07 bf f8 add %fp, -8, %i3 40008d64: e0 27 bf e8 st %l0, [ %fp + -24 ] head->previous = NULL; 40008d68: c0 27 bf ec clr [ %fp + -20 ] tail->previous = head; 40008d6c: f2 27 bf f0 st %i1, [ %fp + -16 ] ) { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); head->next = tail; 40008d70: f6 27 bf f4 st %i3, [ %fp + -12 ] head->previous = NULL; 40008d74: c0 27 bf f8 clr [ %fp + -8 ] tail->previous = head; 40008d78: 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 ); 40008d7c: a2 06 20 30 add %i0, 0x30, %l1 /* * 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 ); 40008d80: b4 06 20 68 add %i0, 0x68, %i2 #endif _Timer_server_SMP_lock_release(); _Timer_server_SMP_lock_aquire(); ts->active = true; 40008d84: a8 10 20 01 mov 1, %l4 static void _Timer_server_Stop_interval_system_watchdog( Timer_server_Control *ts ) { _Watchdog_Remove( &ts->Interval_watchdogs.System_watchdog ); 40008d88: a6 06 20 08 add %i0, 8, %l3 static void _Timer_server_Stop_tod_system_watchdog( Timer_server_Control *ts ) { _Watchdog_Remove( &ts->TOD_watchdogs.System_watchdog ); 40008d8c: a4 06 20 40 add %i0, 0x40, %l2 { /* * 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; 40008d90: f2 26 20 78 st %i1, [ %i0 + 0x78 ] static void _Timer_server_Process_interval_watchdogs( Timer_server_Watchdogs *watchdogs, Chain_Control *fire_chain ) { Watchdog_Interval snapshot = _Watchdog_Ticks_since_boot; 40008d94: c2 05 63 60 ld [ %l5 + 0x360 ], %g1 /* * We assume adequate unsigned arithmetic here. */ Watchdog_Interval delta = snapshot - watchdogs->last_snapshot; 40008d98: d2 06 20 3c ld [ %i0 + 0x3c ], %o1 watchdogs->last_snapshot = snapshot; _Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain ); 40008d9c: 94 10 00 1c mov %i4, %o2 40008da0: 90 10 00 11 mov %l1, %o0 40008da4: 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; 40008da8: c2 26 20 3c st %g1, [ %i0 + 0x3c ] _Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain ); 40008dac: 40 00 0e 41 call 4000c6b0 <_Watchdog_Adjust_to_chain> 40008db0: 01 00 00 00 nop static void _Timer_server_Process_tod_watchdogs( Timer_server_Watchdogs *watchdogs, Chain_Control *fire_chain ) { Watchdog_Interval snapshot = (Watchdog_Interval) _TOD_Seconds_since_epoch(); 40008db4: 40 00 03 58 call 40009b14 <_TOD_Seconds_since_epoch> 40008db8: 01 00 00 00 nop Watchdog_Interval last_snapshot = watchdogs->last_snapshot; 40008dbc: 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 ) { 40008dc0: 80 a2 00 0a cmp %o0, %o2 40008dc4: 08 80 00 07 bleu 40008de0 <_Timer_server_Body+0x94> 40008dc8: ba 10 00 08 mov %o0, %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 ); 40008dcc: 92 27 40 0a sub %i5, %o2, %o1 40008dd0: 90 10 00 1a mov %i2, %o0 40008dd4: 40 00 0e 37 call 4000c6b0 <_Watchdog_Adjust_to_chain> 40008dd8: 94 10 00 1c mov %i4, %o2 40008ddc: 30 80 00 06 b,a 40008df4 <_Timer_server_Body+0xa8> } else if ( snapshot < last_snapshot ) { 40008de0: 1a 80 00 05 bcc 40008df4 <_Timer_server_Body+0xa8> 40008de4: 90 10 00 1a mov %i2, %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 ); 40008de8: 92 10 20 01 mov 1, %o1 40008dec: 40 00 0e 09 call 4000c610 <_Watchdog_Adjust> 40008df0: 94 22 80 1d sub %o2, %i5, %o2 } watchdogs->last_snapshot = snapshot; 40008df4: 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 ); 40008df8: d0 06 20 78 ld [ %i0 + 0x78 ], %o0 40008dfc: 40 00 02 29 call 400096a0 <_Chain_Get> 40008e00: 01 00 00 00 nop if ( timer == NULL ) { 40008e04: 92 92 20 00 orcc %o0, 0, %o1 40008e08: 02 80 00 0c be 40008e38 <_Timer_server_Body+0xec> 40008e0c: 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 ) { 40008e10: c2 02 60 38 ld [ %o1 + 0x38 ], %g1 40008e14: 80 a0 60 01 cmp %g1, 1 40008e18: 02 80 00 05 be 40008e2c <_Timer_server_Body+0xe0> 40008e1c: 90 10 00 11 mov %l1, %o0 _Watchdog_Insert( &ts->Interval_watchdogs.Chain, &timer->Ticker ); } else if ( timer->the_class == TIMER_TIME_OF_DAY_ON_TASK ) { 40008e20: 80 a0 60 03 cmp %g1, 3 40008e24: 12 bf ff f5 bne 40008df8 <_Timer_server_Body+0xac> <== NEVER TAKEN 40008e28: 90 10 00 1a mov %i2, %o0 _Watchdog_Insert( &ts->TOD_watchdogs.Chain, &timer->Ticker ); 40008e2c: 40 00 0e 4b call 4000c758 <_Watchdog_Insert> 40008e30: 92 02 60 10 add %o1, 0x10, %o1 40008e34: 30 bf ff f1 b,a 40008df8 <_Timer_server_Body+0xac> * of zero it will be processed in the next iteration of the timer server * body loop. */ _Timer_server_Process_insertions( ts ); _ISR_Disable( level ); 40008e38: 7f ff e7 df call 40002db4 40008e3c: 01 00 00 00 nop if ( _Chain_Is_empty( insert_chain ) ) { 40008e40: c2 07 bf e8 ld [ %fp + -24 ], %g1 40008e44: 80 a0 40 10 cmp %g1, %l0 40008e48: 12 80 00 0a bne 40008e70 <_Timer_server_Body+0x124> <== NEVER TAKEN 40008e4c: 01 00 00 00 nop ts->insert_chain = NULL; 40008e50: c0 26 20 78 clr [ %i0 + 0x78 ] _ISR_Enable( level ); 40008e54: 7f ff e7 db call 40002dc0 40008e58: 01 00 00 00 nop _Timer_server_SMP_lock_aquire(); while ( true ) { _Timer_server_Get_watchdogs_that_fire_now( ts, &insert_chain, &fire_chain ); if ( !_Chain_Is_empty( &fire_chain ) ) { 40008e5c: c2 07 bf f4 ld [ %fp + -12 ], %g1 40008e60: 80 a0 40 1b cmp %g1, %i3 40008e64: 12 80 00 06 bne 40008e7c <_Timer_server_Body+0x130> 40008e68: 01 00 00 00 nop 40008e6c: 30 80 00 18 b,a 40008ecc <_Timer_server_Body+0x180> ts->insert_chain = NULL; _ISR_Enable( level ); break; } else { _ISR_Enable( level ); 40008e70: 7f ff e7 d4 call 40002dc0 <== NOT EXECUTED 40008e74: 01 00 00 00 nop <== NOT EXECUTED 40008e78: 30 bf ff c7 b,a 40008d94 <_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 ); 40008e7c: 7f ff e7 ce call 40002db4 40008e80: 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; 40008e84: 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)) 40008e88: 80 a7 40 1b cmp %i5, %i3 40008e8c: 02 80 00 0d be 40008ec0 <_Timer_server_Body+0x174> 40008e90: 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; 40008e94: c2 07 40 00 ld [ %i5 ], %g1 head->next = new_first; new_first->previous = head; 40008e98: 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; 40008e9c: c2 27 bf f4 st %g1, [ %fp + -12 ] watchdog = (Watchdog_Control *) _Chain_Get_unprotected( &fire_chain ); if ( watchdog != NULL ) { watchdog->state = WATCHDOG_INACTIVE; 40008ea0: c0 27 60 08 clr [ %i5 + 8 ] _ISR_Enable( level ); 40008ea4: 7f ff e7 c7 call 40002dc0 40008ea8: 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 ); 40008eac: c2 07 60 1c ld [ %i5 + 0x1c ], %g1 40008eb0: d0 07 60 20 ld [ %i5 + 0x20 ], %o0 40008eb4: 9f c0 40 00 call %g1 40008eb8: d2 07 60 24 ld [ %i5 + 0x24 ], %o1 40008ebc: 30 bf ff f0 b,a 40008e7c <_Timer_server_Body+0x130> watchdog = (Watchdog_Control *) _Chain_Get_unprotected( &fire_chain ); if ( watchdog != NULL ) { watchdog->state = WATCHDOG_INACTIVE; _ISR_Enable( level ); } else { _ISR_Enable( level ); 40008ec0: 7f ff e7 c0 call 40002dc0 40008ec4: 01 00 00 00 nop 40008ec8: 30 bf ff b2 b,a 40008d90 <_Timer_server_Body+0x44> (*watchdog->routine)( watchdog->id, watchdog->user_data ); _Timer_server_SMP_lock_aquire(); } } else { ts->active = false; 40008ecc: c0 2e 20 7c clrb [ %i0 + 0x7c ] #if defined ( __THREAD_DO_NOT_INLINE_DISABLE_DISPATCH__ ) void _Thread_Disable_dispatch( void ); #else RTEMS_INLINE_ROUTINE void _Thread_Disable_dispatch( void ) { _Thread_Dispatch_increment_disable_level(); 40008ed0: 7f ff ff 72 call 40008c98 <_Thread_Dispatch_increment_disable_level> 40008ed4: 01 00 00 00 nop * Block until there is something to do. */ #if !defined( RTEMS_SMP ) _Thread_Disable_dispatch(); #endif _Thread_Set_state( ts->thread, STATES_DELAYING ); 40008ed8: d0 06 00 00 ld [ %i0 ], %o0 40008edc: 40 00 0c d9 call 4000c240 <_Thread_Set_state> 40008ee0: 92 10 20 08 mov 8, %o1 _Timer_server_Reset_interval_system_watchdog( ts ); 40008ee4: 7f ff ff 72 call 40008cac <_Timer_server_Reset_interval_system_watchdog> 40008ee8: 90 10 00 18 mov %i0, %o0 _Timer_server_Reset_tod_system_watchdog( ts ); 40008eec: 7f ff ff 84 call 40008cfc <_Timer_server_Reset_tod_system_watchdog> 40008ef0: 90 10 00 18 mov %i0, %o0 #if !defined( RTEMS_SMP ) _Thread_Enable_dispatch(); 40008ef4: 40 00 09 7c call 4000b4e4 <_Thread_Enable_dispatch> 40008ef8: 01 00 00 00 nop static void _Timer_server_Stop_interval_system_watchdog( Timer_server_Control *ts ) { _Watchdog_Remove( &ts->Interval_watchdogs.System_watchdog ); 40008efc: 90 10 00 13 mov %l3, %o0 #endif _Timer_server_SMP_lock_release(); _Timer_server_SMP_lock_aquire(); ts->active = true; 40008f00: e8 2e 20 7c stb %l4, [ %i0 + 0x7c ] static void _Timer_server_Stop_interval_system_watchdog( Timer_server_Control *ts ) { _Watchdog_Remove( &ts->Interval_watchdogs.System_watchdog ); 40008f04: 40 00 0e 6a call 4000c8ac <_Watchdog_Remove> 40008f08: 01 00 00 00 nop static void _Timer_server_Stop_tod_system_watchdog( Timer_server_Control *ts ) { _Watchdog_Remove( &ts->TOD_watchdogs.System_watchdog ); 40008f0c: 40 00 0e 68 call 4000c8ac <_Watchdog_Remove> 40008f10: 90 10 00 12 mov %l2, %o0 40008f14: 30 bf ff 9f b,a 40008d90 <_Timer_server_Body+0x44> =============================================================================== 40008f18 <_Timer_server_Schedule_operation_method>: static void _Timer_server_Schedule_operation_method( Timer_server_Control *ts, Timer_Control *timer ) { 40008f18: 9d e3 bf a0 save %sp, -96, %sp if ( ts->insert_chain == NULL ) { 40008f1c: c2 06 20 78 ld [ %i0 + 0x78 ], %g1 40008f20: 80 a0 60 00 cmp %g1, 0 40008f24: 12 80 00 4b bne 40009050 <_Timer_server_Schedule_operation_method+0x138> 40008f28: ba 10 00 19 mov %i1, %i5 40008f2c: 7f ff ff 5b call 40008c98 <_Thread_Dispatch_increment_disable_level> 40008f30: 01 00 00 00 nop * being inserted. This could result in an integer overflow. */ _Thread_Disable_dispatch(); if ( timer->the_class == TIMER_INTERVAL_ON_TASK ) { 40008f34: c2 06 60 38 ld [ %i1 + 0x38 ], %g1 40008f38: 80 a0 60 01 cmp %g1, 1 40008f3c: 12 80 00 1f bne 40008fb8 <_Timer_server_Schedule_operation_method+0xa0> 40008f40: 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 ); 40008f44: 7f ff e7 9c call 40002db4 40008f48: 01 00 00 00 nop snapshot = _Watchdog_Ticks_since_boot; 40008f4c: 03 10 00 67 sethi %hi(0x40019c00), %g1 40008f50: c4 00 63 60 ld [ %g1 + 0x360 ], %g2 ! 40019f60 <_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; 40008f54: c2 06 20 30 ld [ %i0 + 0x30 ], %g1 last_snapshot = ts->Interval_watchdogs.last_snapshot; 40008f58: 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 ); 40008f5c: 86 06 20 34 add %i0, 0x34, %g3 if ( !_Chain_Is_empty( &ts->Interval_watchdogs.Chain ) ) { 40008f60: 80 a0 40 03 cmp %g1, %g3 40008f64: 02 80 00 08 be 40008f84 <_Timer_server_Schedule_operation_method+0x6c> 40008f68: 88 20 80 04 sub %g2, %g4, %g4 /* * We assume adequate unsigned arithmetic here. */ delta = snapshot - last_snapshot; delta_interval = first_watchdog->delta_interval; 40008f6c: f8 00 60 10 ld [ %g1 + 0x10 ], %i4 if (delta_interval > delta) { 40008f70: 80 a7 00 04 cmp %i4, %g4 40008f74: 08 80 00 03 bleu 40008f80 <_Timer_server_Schedule_operation_method+0x68> 40008f78: 86 10 20 00 clr %g3 delta_interval -= delta; 40008f7c: 86 27 00 04 sub %i4, %g4, %g3 } else { delta_interval = 0; } first_watchdog->delta_interval = delta_interval; 40008f80: c6 20 60 10 st %g3, [ %g1 + 0x10 ] } ts->Interval_watchdogs.last_snapshot = snapshot; 40008f84: c4 26 20 3c st %g2, [ %i0 + 0x3c ] _ISR_Enable( level ); 40008f88: 7f ff e7 8e call 40002dc0 40008f8c: 01 00 00 00 nop _Watchdog_Insert( &ts->Interval_watchdogs.Chain, &timer->Ticker ); 40008f90: 90 06 20 30 add %i0, 0x30, %o0 40008f94: 40 00 0d f1 call 4000c758 <_Watchdog_Insert> 40008f98: 92 07 60 10 add %i5, 0x10, %o1 if ( !ts->active ) { 40008f9c: c2 0e 20 7c ldub [ %i0 + 0x7c ], %g1 40008fa0: 80 a0 60 00 cmp %g1, 0 40008fa4: 12 80 00 29 bne 40009048 <_Timer_server_Schedule_operation_method+0x130> 40008fa8: 01 00 00 00 nop _Timer_server_Reset_interval_system_watchdog( ts ); 40008fac: 7f ff ff 40 call 40008cac <_Timer_server_Reset_interval_system_watchdog> 40008fb0: 90 10 00 18 mov %i0, %o0 40008fb4: 30 80 00 25 b,a 40009048 <_Timer_server_Schedule_operation_method+0x130> } } else if ( timer->the_class == TIMER_TIME_OF_DAY_ON_TASK ) { 40008fb8: 12 80 00 24 bne 40009048 <_Timer_server_Schedule_operation_method+0x130> 40008fbc: 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 ); 40008fc0: 7f ff e7 7d call 40002db4 40008fc4: 01 00 00 00 nop 40008fc8: b6 10 00 08 mov %o0, %i3 snapshot = (Watchdog_Interval) _TOD_Seconds_since_epoch(); 40008fcc: 40 00 02 d2 call 40009b14 <_TOD_Seconds_since_epoch> 40008fd0: 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; 40008fd4: c4 06 20 68 ld [ %i0 + 0x68 ], %g2 last_snapshot = ts->TOD_watchdogs.last_snapshot; 40008fd8: c6 06 20 74 ld [ %i0 + 0x74 ], %g3 RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( const Chain_Control *the_chain ) { return _Chain_Immutable_first( the_chain ) == _Chain_Immutable_tail( the_chain ); 40008fdc: 88 06 20 6c add %i0, 0x6c, %g4 if ( !_Chain_Is_empty( &ts->TOD_watchdogs.Chain ) ) { 40008fe0: 80 a0 80 04 cmp %g2, %g4 40008fe4: 02 80 00 0d be 40009018 <_Timer_server_Schedule_operation_method+0x100> 40008fe8: 80 a2 00 03 cmp %o0, %g3 first_watchdog = _Watchdog_First( &ts->TOD_watchdogs.Chain ); delta_interval = first_watchdog->delta_interval; if ( snapshot > last_snapshot ) { 40008fec: 08 80 00 08 bleu 4000900c <_Timer_server_Schedule_operation_method+0xf4> 40008ff0: c8 00 a0 10 ld [ %g2 + 0x10 ], %g4 /* * We advanced in time. */ delta = snapshot - last_snapshot; 40008ff4: b8 22 00 03 sub %o0, %g3, %i4 if (delta_interval > delta) { 40008ff8: 80 a1 00 1c cmp %g4, %i4 40008ffc: 08 80 00 06 bleu 40009014 <_Timer_server_Schedule_operation_method+0xfc><== NEVER TAKEN 40009000: 86 10 20 00 clr %g3 delta_interval -= delta; 40009004: 10 80 00 04 b 40009014 <_Timer_server_Schedule_operation_method+0xfc> 40009008: 86 21 00 1c sub %g4, %i4, %g3 } } else { /* * Someone put us in the past. */ delta = last_snapshot - snapshot; 4000900c: 86 01 00 03 add %g4, %g3, %g3 delta_interval += delta; 40009010: 86 20 c0 08 sub %g3, %o0, %g3 } first_watchdog->delta_interval = delta_interval; 40009014: c6 20 a0 10 st %g3, [ %g2 + 0x10 ] } ts->TOD_watchdogs.last_snapshot = snapshot; 40009018: d0 26 20 74 st %o0, [ %i0 + 0x74 ] _ISR_Enable( level ); 4000901c: 7f ff e7 69 call 40002dc0 40009020: 90 10 00 1b mov %i3, %o0 _Watchdog_Insert( &ts->TOD_watchdogs.Chain, &timer->Ticker ); 40009024: 90 06 20 68 add %i0, 0x68, %o0 40009028: 40 00 0d cc call 4000c758 <_Watchdog_Insert> 4000902c: 92 07 60 10 add %i5, 0x10, %o1 if ( !ts->active ) { 40009030: c2 0e 20 7c ldub [ %i0 + 0x7c ], %g1 40009034: 80 a0 60 00 cmp %g1, 0 40009038: 12 80 00 04 bne 40009048 <_Timer_server_Schedule_operation_method+0x130> 4000903c: 01 00 00 00 nop _Timer_server_Reset_tod_system_watchdog( ts ); 40009040: 7f ff ff 2f call 40008cfc <_Timer_server_Reset_tod_system_watchdog> 40009044: 90 10 00 18 mov %i0, %o0 } } _Thread_Enable_dispatch(); 40009048: 40 00 09 27 call 4000b4e4 <_Thread_Enable_dispatch> 4000904c: 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 ); 40009050: f0 06 20 78 ld [ %i0 + 0x78 ], %i0 40009054: 40 00 01 87 call 40009670 <_Chain_Append> 40009058: 81 e8 00 00 restore =============================================================================== 4000c834 <_Timestamp64_Divide>: const Timestamp64_Control *_lhs, const Timestamp64_Control *_rhs, uint32_t *_ival_percentage, uint32_t *_fval_percentage ) { 4000c834: 9d e3 bf a0 save %sp, -96, %sp Timestamp64_Control answer; if ( *_rhs == 0 ) { 4000c838: d4 1e 40 00 ldd [ %i1 ], %o2 4000c83c: 80 92 80 0b orcc %o2, %o3, %g0 4000c840: 32 80 00 06 bne,a 4000c858 <_Timestamp64_Divide+0x24> <== ALWAYS TAKEN 4000c844: d8 1e 00 00 ldd [ %i0 ], %o4 *_ival_percentage = 0; 4000c848: c0 26 80 00 clr [ %i2 ] <== NOT EXECUTED *_fval_percentage = 0; 4000c84c: c0 26 c0 00 clr [ %i3 ] <== NOT EXECUTED return; 4000c850: 81 c7 e0 08 ret <== NOT EXECUTED 4000c854: 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; 4000c858: 83 2b 20 02 sll %o4, 2, %g1 4000c85c: 87 2b 60 02 sll %o5, 2, %g3 4000c860: 89 33 60 1e srl %o5, 0x1e, %g4 4000c864: bb 28 e0 05 sll %g3, 5, %i5 4000c868: 84 11 00 01 or %g4, %g1, %g2 4000c86c: 83 30 e0 1b srl %g3, 0x1b, %g1 4000c870: b9 28 a0 05 sll %g2, 5, %i4 4000c874: 86 a7 40 03 subcc %i5, %g3, %g3 4000c878: b8 10 40 1c or %g1, %i4, %i4 4000c87c: 84 67 00 02 subx %i4, %g2, %g2 4000c880: b2 80 c0 0d addcc %g3, %o5, %i1 4000c884: b0 40 80 0c addx %g2, %o4, %i0 4000c888: 83 36 60 1e srl %i1, 0x1e, %g1 4000c88c: 87 2e 60 02 sll %i1, 2, %g3 4000c890: 85 2e 20 02 sll %i0, 2, %g2 4000c894: 84 10 40 02 or %g1, %g2, %g2 4000c898: ba 86 40 03 addcc %i1, %g3, %i5 4000c89c: b8 46 00 02 addx %i0, %g2, %i4 4000c8a0: 83 37 60 1e srl %i5, 0x1e, %g1 4000c8a4: 87 2f 60 02 sll %i5, 2, %g3 4000c8a8: 85 2f 20 02 sll %i4, 2, %g2 4000c8ac: 84 10 40 02 or %g1, %g2, %g2 4000c8b0: 92 87 40 03 addcc %i5, %g3, %o1 4000c8b4: 90 47 00 02 addx %i4, %g2, %o0 4000c8b8: 87 32 60 1b srl %o1, 0x1b, %g3 4000c8bc: 85 2a 20 05 sll %o0, 5, %g2 4000c8c0: 83 2a 60 05 sll %o1, 5, %g1 4000c8c4: 90 10 c0 02 or %g3, %g2, %o0 4000c8c8: 40 00 23 1f call 40015544 <__divdi3> 4000c8cc: 92 10 00 01 mov %g1, %o1 *_ival_percentage = answer / 1000; 4000c8d0: 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; 4000c8d4: b8 10 00 08 mov %o0, %i4 4000c8d8: ba 10 00 09 mov %o1, %i5 *_ival_percentage = answer / 1000; 4000c8dc: 40 00 23 1a call 40015544 <__divdi3> 4000c8e0: 96 10 23 e8 mov 0x3e8, %o3 *_fval_percentage = answer % 1000; 4000c8e4: 90 10 00 1c mov %i4, %o0 * TODO: Rounding on the last digit of the fval. */ answer = (*_lhs * 100000) / *_rhs; *_ival_percentage = answer / 1000; 4000c8e8: d2 26 80 00 st %o1, [ %i2 ] *_fval_percentage = answer % 1000; 4000c8ec: 94 10 20 00 clr %o2 4000c8f0: 92 10 00 1d mov %i5, %o1 4000c8f4: 40 00 24 06 call 4001590c <__moddi3> 4000c8f8: 96 10 23 e8 mov 0x3e8, %o3 4000c8fc: d2 26 c0 00 st %o1, [ %i3 ] 4000c900: 81 c7 e0 08 ret 4000c904: 81 e8 00 00 restore =============================================================================== 4000af04 <_User_extensions_Handler_initialization>: } } void _User_extensions_Handler_initialization(void) { 4000af04: 9d e3 bf 98 save %sp, -104, %sp uint32_t number_of_initial_extensions = 4000af08: 03 10 00 55 sethi %hi(0x40015400), %g1 4000af0c: c2 00 61 c4 ld [ %g1 + 0x1c4 ], %g1 ! 400155c4 rtems_configuration_get_number_of_initial_extensions(); if ( number_of_initial_extensions > 0 ) { 4000af10: 80 a0 60 00 cmp %g1, 0 4000af14: 02 80 00 0a be 4000af3c <_User_extensions_Handler_initialization+0x38><== NEVER TAKEN 4000af18: 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 ) 4000af1c: 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 = 4000af20: 40 00 01 2d call 4000b3d4 <_Workspace_Allocate_or_fatal_error> 4000af24: 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 ); 4000af28: 13 10 00 2b sethi %hi(0x4000ac00), %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 }; 4000af2c: d0 27 bf fc st %o0, [ %fp + -4 ] _User_extensions_Iterate( &ctx, _User_extensions_Switch_visitor ); 4000af30: 92 12 62 c0 or %o1, 0x2c0, %o1 4000af34: 7f ff ff c2 call 4000ae3c <_User_extensions_Iterate> 4000af38: 90 07 bf fc add %fp, -4, %o0 4000af3c: 81 c7 e0 08 ret 4000af40: 81 e8 00 00 restore =============================================================================== 4000acf8 <_User_extensions_Thread_create_visitor>: void _User_extensions_Thread_create_visitor( Thread_Control *executing, void *arg, const User_extensions_Table *callouts ) { 4000acf8: 9d e3 bf a0 save %sp, -96, %sp User_extensions_thread_create_extension callout = callouts->thread_create; 4000acfc: c2 06 80 00 ld [ %i2 ], %g1 if ( callout != NULL ) { 4000ad00: 80 a0 60 00 cmp %g1, 0 4000ad04: 02 80 00 0b be 4000ad30 <_User_extensions_Thread_create_visitor+0x38> 4000ad08: 01 00 00 00 nop User_extensions_Thread_create_context *ctx = arg; ctx->ok = ctx->ok && (*callout)( executing, ctx->created ); 4000ad0c: c4 0e 60 04 ldub [ %i1 + 4 ], %g2 4000ad10: 80 a0 a0 00 cmp %g2, 0 4000ad14: 02 80 00 05 be 4000ad28 <_User_extensions_Thread_create_visitor+0x30><== NEVER TAKEN 4000ad18: 90 10 20 00 clr %o0 4000ad1c: d2 06 40 00 ld [ %i1 ], %o1 4000ad20: 9f c0 40 00 call %g1 4000ad24: 90 10 00 18 mov %i0, %o0 4000ad28: 90 0a 20 01 and %o0, 1, %o0 4000ad2c: d0 2e 60 04 stb %o0, [ %i1 + 4 ] 4000ad30: 81 c7 e0 08 ret 4000ad34: 81 e8 00 00 restore =============================================================================== 4000cbb8 <_Watchdog_Adjust>: void _Watchdog_Adjust( Chain_Control *header, Watchdog_Adjust_directions direction, Watchdog_Interval units ) { 4000cbb8: 9d e3 bf a0 save %sp, -96, %sp ISR_Level level; _ISR_Disable( level ); 4000cbbc: 7f ff d9 be call 400032b4 4000cbc0: 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; 4000cbc4: 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 ); 4000cbc8: 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 ) ) { 4000cbcc: 80 a0 40 1c cmp %g1, %i4 4000cbd0: 02 80 00 20 be 4000cc50 <_Watchdog_Adjust+0x98> 4000cbd4: 80 a6 60 00 cmp %i1, 0 switch ( direction ) { 4000cbd8: 02 80 00 07 be 4000cbf4 <_Watchdog_Adjust+0x3c> 4000cbdc: 80 a6 60 01 cmp %i1, 1 4000cbe0: 12 80 00 1c bne 4000cc50 <_Watchdog_Adjust+0x98> <== NEVER TAKEN 4000cbe4: 01 00 00 00 nop case WATCHDOG_BACKWARD: _Watchdog_First( header )->delta_interval += units; 4000cbe8: c4 00 60 10 ld [ %g1 + 0x10 ], %g2 4000cbec: 10 80 00 18 b 4000cc4c <_Watchdog_Adjust+0x94> 4000cbf0: b4 00 80 1a add %g2, %i2, %i2 if ( units < _Watchdog_First( header )->delta_interval ) { _Watchdog_First( header )->delta_interval -= units; break; } else { units -= _Watchdog_First( header )->delta_interval; _Watchdog_First( header )->delta_interval = 1; 4000cbf4: 10 80 00 0d b 4000cc28 <_Watchdog_Adjust+0x70> 4000cbf8: b6 10 20 01 mov 1, %i3 4000cbfc: f6 20 60 10 st %i3, [ %g1 + 0x10 ] _ISR_Enable( level ); 4000cc00: 7f ff d9 b0 call 400032c0 4000cc04: 01 00 00 00 nop _Watchdog_Tickle( header ); 4000cc08: 40 00 00 91 call 4000ce4c <_Watchdog_Tickle> 4000cc0c: 90 10 00 18 mov %i0, %o0 _ISR_Disable( level ); 4000cc10: 7f ff d9 a9 call 400032b4 4000cc14: 01 00 00 00 nop if ( _Chain_Is_empty( header ) ) 4000cc18: c2 06 00 00 ld [ %i0 ], %g1 4000cc1c: 80 a0 40 1c cmp %g1, %i4 4000cc20: 02 80 00 0c be 4000cc50 <_Watchdog_Adjust+0x98> 4000cc24: 01 00 00 00 nop switch ( direction ) { case WATCHDOG_BACKWARD: _Watchdog_First( header )->delta_interval += units; break; case WATCHDOG_FORWARD: while ( units ) { 4000cc28: 80 a6 a0 00 cmp %i2, 0 4000cc2c: 02 80 00 09 be 4000cc50 <_Watchdog_Adjust+0x98> <== NEVER TAKEN 4000cc30: 01 00 00 00 nop */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_First( Chain_Control *the_chain ) { return _Chain_Head( the_chain )->next; 4000cc34: c2 06 00 00 ld [ %i0 ], %g1 if ( units < _Watchdog_First( header )->delta_interval ) { 4000cc38: c4 00 60 10 ld [ %g1 + 0x10 ], %g2 4000cc3c: 80 a6 80 02 cmp %i2, %g2 4000cc40: 3a bf ff ef bcc,a 4000cbfc <_Watchdog_Adjust+0x44> 4000cc44: b4 26 80 02 sub %i2, %g2, %i2 _Watchdog_First( header )->delta_interval -= units; 4000cc48: b4 20 80 1a sub %g2, %i2, %i2 4000cc4c: f4 20 60 10 st %i2, [ %g1 + 0x10 ] } break; } } _ISR_Enable( level ); 4000cc50: 7f ff d9 9c call 400032c0 4000cc54: 91 e8 00 08 restore %g0, %o0, %o0 =============================================================================== 4000b098 <_Watchdog_Remove>: #include Watchdog_States _Watchdog_Remove( Watchdog_Control *the_watchdog ) { 4000b098: 9d e3 bf a0 save %sp, -96, %sp ISR_Level level; Watchdog_States previous_state; Watchdog_Control *next_watchdog; _ISR_Disable( level ); 4000b09c: 7f ff dc e6 call 40002434 4000b0a0: ba 10 00 18 mov %i0, %i5 previous_state = the_watchdog->state; 4000b0a4: f0 06 20 08 ld [ %i0 + 8 ], %i0 switch ( previous_state ) { 4000b0a8: 80 a6 20 01 cmp %i0, 1 4000b0ac: 22 80 00 1c be,a 4000b11c <_Watchdog_Remove+0x84> 4000b0b0: c0 27 60 08 clr [ %i5 + 8 ] 4000b0b4: 0a 80 00 1a bcs 4000b11c <_Watchdog_Remove+0x84> 4000b0b8: 80 a6 20 03 cmp %i0, 3 4000b0bc: 28 80 00 04 bleu,a 4000b0cc <_Watchdog_Remove+0x34> <== ALWAYS TAKEN 4000b0c0: c2 07 40 00 ld [ %i5 ], %g1 _Watchdog_Sync_level = _ISR_Nest_level; _Chain_Extract_unprotected( &the_watchdog->Node ); break; } the_watchdog->stop_time = _Watchdog_Ticks_since_boot; 4000b0c4: 10 80 00 17 b 4000b120 <_Watchdog_Remove+0x88> <== NOT EXECUTED 4000b0c8: 03 10 00 61 sethi %hi(0x40018400), %g1 <== NOT EXECUTED break; case WATCHDOG_ACTIVE: case WATCHDOG_REMOVE_IT: the_watchdog->state = WATCHDOG_INACTIVE; 4000b0cc: c0 27 60 08 clr [ %i5 + 8 ] next_watchdog = _Watchdog_Next( the_watchdog ); if ( _Watchdog_Next(next_watchdog) ) 4000b0d0: c4 00 40 00 ld [ %g1 ], %g2 4000b0d4: 80 a0 a0 00 cmp %g2, 0 4000b0d8: 02 80 00 07 be 4000b0f4 <_Watchdog_Remove+0x5c> 4000b0dc: 05 10 00 61 sethi %hi(0x40018400), %g2 next_watchdog->delta_interval += the_watchdog->delta_interval; 4000b0e0: c6 00 60 10 ld [ %g1 + 0x10 ], %g3 4000b0e4: c4 07 60 10 ld [ %i5 + 0x10 ], %g2 4000b0e8: 84 00 c0 02 add %g3, %g2, %g2 4000b0ec: c4 20 60 10 st %g2, [ %g1 + 0x10 ] if ( _Watchdog_Sync_count ) 4000b0f0: 05 10 00 61 sethi %hi(0x40018400), %g2 4000b0f4: c4 00 a0 bc ld [ %g2 + 0xbc ], %g2 ! 400184bc <_Watchdog_Sync_count> 4000b0f8: 80 a0 a0 00 cmp %g2, 0 4000b0fc: 22 80 00 06 be,a 4000b114 <_Watchdog_Remove+0x7c> 4000b100: c4 07 60 04 ld [ %i5 + 4 ], %g2 _Watchdog_Sync_level = _ISR_Nest_level; 4000b104: c6 01 a0 0c ld [ %g6 + 0xc ], %g3 4000b108: 05 10 00 61 sethi %hi(0x40018400), %g2 4000b10c: c6 20 a0 9c st %g3, [ %g2 + 0x9c ] ! 4001849c <_Watchdog_Sync_level> { Chain_Node *next; Chain_Node *previous; next = the_node->next; previous = the_node->previous; 4000b110: c4 07 60 04 ld [ %i5 + 4 ], %g2 next->previous = previous; 4000b114: c4 20 60 04 st %g2, [ %g1 + 4 ] previous->next = next; 4000b118: c2 20 80 00 st %g1, [ %g2 ] _Chain_Extract_unprotected( &the_watchdog->Node ); break; } the_watchdog->stop_time = _Watchdog_Ticks_since_boot; 4000b11c: 03 10 00 61 sethi %hi(0x40018400), %g1 4000b120: c2 00 60 c0 ld [ %g1 + 0xc0 ], %g1 ! 400184c0 <_Watchdog_Ticks_since_boot> 4000b124: c2 27 60 18 st %g1, [ %i5 + 0x18 ] _ISR_Enable( level ); 4000b128: 7f ff dc c6 call 40002440 4000b12c: 01 00 00 00 nop return( previous_state ); } 4000b130: 81 c7 e0 08 ret 4000b134: 81 e8 00 00 restore =============================================================================== 4000b138 <_Watchdog_Tickle>: #include void _Watchdog_Tickle( Chain_Control *header ) { 4000b138: 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 ); 4000b13c: 7f ff dc be call 40002434 4000b140: b8 10 00 18 mov %i0, %i4 4000b144: 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; 4000b148: 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 ); 4000b14c: b6 07 20 04 add %i4, 4, %i3 if ( _Chain_Is_empty( header ) ) 4000b150: 80 a7 40 1b cmp %i5, %i3 4000b154: 02 80 00 1f be 4000b1d0 <_Watchdog_Tickle+0x98> 4000b158: 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) { 4000b15c: c2 07 60 10 ld [ %i5 + 0x10 ], %g1 4000b160: 80 a0 60 00 cmp %g1, 0 4000b164: 02 80 00 06 be 4000b17c <_Watchdog_Tickle+0x44> <== NEVER TAKEN 4000b168: 82 00 7f ff add %g1, -1, %g1 the_watchdog->delta_interval--; 4000b16c: c2 27 60 10 st %g1, [ %i5 + 0x10 ] if ( the_watchdog->delta_interval != 0 ) 4000b170: 80 a0 60 00 cmp %g1, 0 4000b174: 12 80 00 17 bne 4000b1d0 <_Watchdog_Tickle+0x98> 4000b178: 01 00 00 00 nop goto leave; } do { watchdog_state = _Watchdog_Remove( the_watchdog ); 4000b17c: 7f ff ff c7 call 4000b098 <_Watchdog_Remove> 4000b180: 90 10 00 1d mov %i5, %o0 4000b184: b4 10 00 08 mov %o0, %i2 _ISR_Enable( level ); 4000b188: 7f ff dc ae call 40002440 4000b18c: 90 10 00 18 mov %i0, %o0 switch( watchdog_state ) { 4000b190: 80 a6 a0 02 cmp %i2, 2 4000b194: 12 80 00 06 bne 4000b1ac <_Watchdog_Tickle+0x74> 4000b198: 01 00 00 00 nop case WATCHDOG_ACTIVE: (*the_watchdog->routine)( 4000b19c: c2 07 60 1c ld [ %i5 + 0x1c ], %g1 4000b1a0: d0 07 60 20 ld [ %i5 + 0x20 ], %o0 4000b1a4: 9f c0 40 00 call %g1 4000b1a8: d2 07 60 24 ld [ %i5 + 0x24 ], %o1 case WATCHDOG_REMOVE_IT: break; } _ISR_Disable( level ); 4000b1ac: 7f ff dc a2 call 40002434 4000b1b0: 01 00 00 00 nop 4000b1b4: b0 10 00 08 mov %o0, %i0 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_First( Chain_Control *the_chain ) { return _Chain_Head( the_chain )->next; 4000b1b8: fa 07 00 00 ld [ %i4 ], %i5 the_watchdog = _Watchdog_First( header ); } while ( !_Chain_Is_empty( header ) && (the_watchdog->delta_interval == 0) ); 4000b1bc: 80 a7 40 1b cmp %i5, %i3 4000b1c0: 02 80 00 04 be 4000b1d0 <_Watchdog_Tickle+0x98> 4000b1c4: 01 00 00 00 nop } _ISR_Disable( level ); the_watchdog = _Watchdog_First( header ); } while ( !_Chain_Is_empty( header ) && 4000b1c8: 10 bf ff ea b 4000b170 <_Watchdog_Tickle+0x38> 4000b1cc: c2 07 60 10 ld [ %i5 + 0x10 ], %g1 (the_watchdog->delta_interval == 0) ); leave: _ISR_Enable(level); 4000b1d0: 7f ff dc 9c call 40002440 4000b1d4: 81 e8 00 00 restore =============================================================================== 4000b1d8 <_Workspace_Handler_initialization>: void _Workspace_Handler_initialization( Heap_Area *areas, size_t area_count, Heap_Initialization_or_extend_handler extend ) { 4000b1d8: 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(); 4000b1dc: 05 10 00 55 sethi %hi(0x40015400), %g2 4000b1e0: 82 10 a1 88 or %g2, 0x188, %g1 ! 40015588 4000b1e4: c6 08 60 3a ldub [ %g1 + 0x3a ], %g3 4000b1e8: fa 00 a1 88 ld [ %g2 + 0x188 ], %i5 4000b1ec: 80 a0 e0 00 cmp %g3, 0 4000b1f0: 12 80 00 03 bne 4000b1fc <_Workspace_Handler_initialization+0x24> 4000b1f4: 84 10 20 00 clr %g2 4000b1f8: c4 00 60 04 ld [ %g1 + 4 ], %g2 4000b1fc: ba 00 80 1d add %g2, %i5, %i5 bool do_zero = rtems_configuration_get_do_zero_of_workspace(); 4000b200: e2 08 60 38 ldub [ %g1 + 0x38 ], %l1 bool unified = rtems_configuration_get_unified_work_area(); 4000b204: e4 08 60 39 ldub [ %g1 + 0x39 ], %l2 { /* * Do not use _TLS_Size here since this will lead GCC to assume that this * symbol is not 0 and the tests for 0 will be optimized away. */ return (uintptr_t) _TLS_BSS_end - (uintptr_t) _TLS_Data_begin; 4000b208: 05 10 00 5a sethi %hi(0x40016800), %g2 4000b20c: 03 10 00 5a sethi %hi(0x40016800), %g1 4000b210: 84 10 a2 a0 or %g2, 0x2a0, %g2 4000b214: 82 10 62 a0 or %g1, 0x2a0, %g1 * workspace is large enough to fulfill all requests known at configuration * time (so excluding the unlimited option). It is not possible to estimate * the TLS size in the configuration at compile-time. The TLS size is * determined at application link-time. */ if ( tls_size > 0 ) { 4000b218: 90 a0 80 01 subcc %g2, %g1, %o0 4000b21c: 02 80 00 1a be 4000b284 <_Workspace_Handler_initialization+0xac> 4000b220: 03 00 00 00 sethi %hi(0), %g1 static inline uintptr_t _TLS_Heap_align_up( uintptr_t val ) { uintptr_t msk = CPU_HEAP_ALIGNMENT - 1; return (val + msk) & ~msk; 4000b224: 82 10 60 01 or %g1, 1, %g1 ! 1 <_TLS_Alignment> 4000b228: 82 00 60 07 add %g1, 7, %g1 4000b22c: 82 08 7f f8 and %g1, -8, %g1 static inline uintptr_t _TLS_Get_thread_control_block_area_size( uintptr_t alignment ) { return alignment <= sizeof(TLS_Thread_control_block) ? 4000b230: 80 a0 60 08 cmp %g1, 8 4000b234: 2a 80 00 02 bcs,a 4000b23c <_Workspace_Handler_initialization+0x64><== NEVER TAKEN 4000b238: 82 10 20 08 mov 8, %g1 <== NOT EXECUTED { uint32_t thread_count = 0; thread_count += _Thread_Get_maximum_internal_threads(); thread_count += rtems_resource_maximum_per_allocation( 4000b23c: 05 10 00 5a sethi %hi(0x40016800), %g2 Configuration_RTEMS_API.maximum_tasks ); #if defined(RTEMS_POSIX_API) thread_count += rtems_resource_maximum_per_allocation( 4000b240: 07 10 00 5c sethi %hi(0x40017000), %g3 { uint32_t thread_count = 0; thread_count += _Thread_Get_maximum_internal_threads(); thread_count += rtems_resource_maximum_per_allocation( 4000b244: d2 00 a2 ac ld [ %g2 + 0x2ac ], %o1 Configuration_RTEMS_API.maximum_tasks ); #if defined(RTEMS_POSIX_API) thread_count += rtems_resource_maximum_per_allocation( 4000b248: c6 00 e0 84 ld [ %g3 + 0x84 ], %g3 { uint32_t thread_count = 0; thread_count += _Thread_Get_maximum_internal_threads(); thread_count += rtems_resource_maximum_per_allocation( 4000b24c: 05 00 00 3f sethi %hi(0xfc00), %g2 4000b250: 84 10 a3 ff or %g2, 0x3ff, %g2 ! ffff <_TLS_Alignment+0xfffe> 4000b254: 92 0a 40 02 and %o1, %g2, %o1 Configuration_RTEMS_API.maximum_tasks ); #if defined(RTEMS_POSIX_API) thread_count += rtems_resource_maximum_per_allocation( 4000b258: 84 08 c0 02 and %g3, %g2, %g2 static inline uintptr_t _TLS_Heap_align_up( uintptr_t val ) { uintptr_t msk = CPU_HEAP_ALIGNMENT - 1; return (val + msk) & ~msk; 4000b25c: 90 02 20 07 add %o0, 7, %o0 { uint32_t thread_count = 0; thread_count += _Thread_Get_maximum_internal_threads(); thread_count += rtems_resource_maximum_per_allocation( 4000b260: 92 02 40 02 add %o1, %g2, %o1 4000b264: 90 0a 3f f8 and %o0, -8, %o0 * size. */ remaining += _Heap_Min_block_size( page_size ); remaining += _Get_maximum_thread_count() * _Heap_Size_with_overhead( page_size, tls_alloc, tls_align ); 4000b268: 92 02 60 01 inc %o1 uintptr_t alignment ) { uintptr_t aligned_size = _TLS_Heap_align_up( size ); return _TLS_Get_thread_control_block_area_size( alignment ) 4000b26c: 90 02 00 01 add %o0, %g1, %o0 if ( page_size < alignment ) { page_size = alignment; } return HEAP_BLOCK_HEADER_SIZE + page_size - 1 + size; 4000b270: 90 02 20 0f add %o0, 0xf, %o0 4000b274: 40 00 20 5f call 400133f0 <.umul> 4000b278: 90 02 00 01 add %o0, %g1, %o0 /* * Memory allocated with an alignment constraint is allocated from the end * of a free block. The last allocation may need one free block of minimum * size. */ remaining += _Heap_Min_block_size( page_size ); 4000b27c: 90 02 20 10 add %o0, 0x10, %o0 remaining += _Get_maximum_thread_count() 4000b280: ba 07 40 08 add %i5, %o0, %i5 remaining -= space_available; } else { remaining = 0; } init_or_extend = extend; 4000b284: 21 10 00 21 sethi %hi(0x40008400), %l0 } else { size = 0; } } space_available = (*init_or_extend)( 4000b288: 27 10 00 61 sethi %hi(0x40018400), %l3 remaining -= space_available; } else { remaining = 0; } init_or_extend = extend; 4000b28c: b6 10 20 00 clr %i3 4000b290: a0 14 23 ac or %l0, 0x3ac, %l0 } for (i = 0; i < area_count; ++i) { Heap_Area *area = &areas [i]; if ( do_zero ) { 4000b294: a2 0c 60 ff and %l1, 0xff, %l1 if ( area->size > overhead ) { uintptr_t space_available; uintptr_t size; if ( unified ) { 4000b298: a4 0c a0 ff and %l2, 0xff, %l2 } else { size = 0; } } space_available = (*init_or_extend)( 4000b29c: a6 14 e0 3c or %l3, 0x3c, %l3 remaining += _Get_maximum_thread_count() * _Heap_Size_with_overhead( page_size, tls_alloc, tls_align ); } for (i = 0; i < area_count; ++i) { 4000b2a0: 80 a6 c0 19 cmp %i3, %i1 4000b2a4: 02 80 00 2d be 4000b358 <_Workspace_Handler_initialization+0x180> 4000b2a8: 80 a4 60 00 cmp %l1, 0 Heap_Area *area = &areas [i]; if ( do_zero ) { 4000b2ac: 22 80 00 07 be,a 4000b2c8 <_Workspace_Handler_initialization+0xf0> 4000b2b0: f8 06 20 04 ld [ %i0 + 4 ], %i4 memset( area->begin, 0, area->size ); 4000b2b4: d0 06 00 00 ld [ %i0 ], %o0 4000b2b8: d4 06 20 04 ld [ %i0 + 4 ], %o2 4000b2bc: 40 00 13 fe call 400102b4 4000b2c0: 92 10 20 00 clr %o1 } if ( area->size > overhead ) { 4000b2c4: f8 06 20 04 ld [ %i0 + 4 ], %i4 4000b2c8: 80 a7 20 16 cmp %i4, 0x16 4000b2cc: 28 80 00 21 bleu,a 4000b350 <_Workspace_Handler_initialization+0x178> 4000b2d0: b6 06 e0 01 inc %i3 uintptr_t space_available; uintptr_t size; if ( unified ) { 4000b2d4: 80 a4 a0 00 cmp %l2, 0 4000b2d8: 32 80 00 0c bne,a 4000b308 <_Workspace_Handler_initialization+0x130> 4000b2dc: d2 06 00 00 ld [ %i0 ], %o1 size = area->size; } else { if ( remaining > 0 ) { 4000b2e0: 80 a7 60 00 cmp %i5, 0 4000b2e4: 22 80 00 08 be,a 4000b304 <_Workspace_Handler_initialization+0x12c><== NEVER TAKEN 4000b2e8: b8 10 20 00 clr %i4 <== NOT EXECUTED size = remaining < area->size - overhead ? 4000b2ec: 82 07 3f ea add %i4, -22, %g1 remaining + overhead : area->size; 4000b2f0: 80 a7 40 01 cmp %i5, %g1 4000b2f4: 2a 80 00 04 bcs,a 4000b304 <_Workspace_Handler_initialization+0x12c><== ALWAYS TAKEN 4000b2f8: b8 07 60 16 add %i5, 0x16, %i4 4000b2fc: 10 80 00 03 b 4000b308 <_Workspace_Handler_initialization+0x130><== NOT EXECUTED 4000b300: d2 06 00 00 ld [ %i0 ], %o1 <== NOT EXECUTED } else { size = 0; } } space_available = (*init_or_extend)( 4000b304: d2 06 00 00 ld [ %i0 ], %o1 4000b308: 94 10 00 1c mov %i4, %o2 4000b30c: 90 10 00 13 mov %l3, %o0 4000b310: 9f c4 00 00 call %l0 4000b314: 96 10 20 08 mov 8, %o3 area->begin, size, page_size ); area->begin = (char *) area->begin + size; 4000b318: c2 06 00 00 ld [ %i0 ], %g1 area->size -= size; if ( space_available < remaining ) { 4000b31c: 80 a2 00 1d cmp %o0, %i5 area->begin, size, page_size ); area->begin = (char *) area->begin + size; 4000b320: 82 00 40 1c add %g1, %i4, %g1 4000b324: c2 26 00 00 st %g1, [ %i0 ] area->size -= size; 4000b328: c2 06 20 04 ld [ %i0 + 4 ], %g1 4000b32c: b8 20 40 1c sub %g1, %i4, %i4 if ( space_available < remaining ) { 4000b330: 1a 80 00 05 bcc 4000b344 <_Workspace_Handler_initialization+0x16c><== ALWAYS TAKEN 4000b334: f8 26 20 04 st %i4, [ %i0 + 4 ] remaining -= space_available; 4000b338: ba 27 40 08 sub %i5, %o0, %i5 <== NOT EXECUTED 4000b33c: 10 80 00 04 b 4000b34c <_Workspace_Handler_initialization+0x174><== NOT EXECUTED 4000b340: a0 10 00 1a mov %i2, %l0 <== NOT EXECUTED } else { remaining = 0; } init_or_extend = extend; 4000b344: a0 10 00 1a mov %i2, %l0 area->size -= size; if ( space_available < remaining ) { remaining -= space_available; } else { remaining = 0; 4000b348: ba 10 20 00 clr %i5 remaining += _Get_maximum_thread_count() * _Heap_Size_with_overhead( page_size, tls_alloc, tls_align ); } for (i = 0; i < area_count; ++i) { 4000b34c: b6 06 e0 01 inc %i3 4000b350: 10 bf ff d4 b 4000b2a0 <_Workspace_Handler_initialization+0xc8> 4000b354: b0 06 20 08 add %i0, 8, %i0 init_or_extend = extend; } } if ( remaining > 0 ) { 4000b358: 80 a7 60 00 cmp %i5, 0 4000b35c: 02 80 00 05 be 4000b370 <_Workspace_Handler_initialization+0x198> 4000b360: 90 10 20 00 clr %o0 _Terminate( 4000b364: 92 10 20 01 mov 1, %o1 4000b368: 7f ff f5 a8 call 40008a08 <_Terminate> 4000b36c: 94 10 20 02 mov 2, %o2 4000b370: 81 c7 e0 08 ret 4000b374: 81 e8 00 00 restore =============================================================================== 400246f0 <_calloc_r>: struct _reent *ignored __attribute__((unused)), size_t elements, size_t size ) { return calloc( elements, size ); 400246f0: 90 10 00 09 mov %o1, %o0 400246f4: 92 10 00 0a mov %o2, %o1 400246f8: 82 13 c0 00 mov %o7, %g1 400246fc: 7f ff 8e 43 call 40008008 40024700: 9e 10 40 00 mov %g1, %o7 =============================================================================== 4000c094 <_close_r>: int _close_r( struct _reent *ptr __attribute__((unused)), int fd ) { return close( fd ); 4000c094: 90 10 00 09 mov %o1, %o0 4000c098: 82 13 c0 00 mov %o7, %g1 4000c09c: 7f ff ff df call 4000c018 4000c0a0: 9e 10 40 00 mov %g1, %o7 =============================================================================== 4001311c <_fat_block_read>: uint32_t start, uint32_t offset, uint32_t count, void *buff ) { 4001311c: 9d e3 bf 98 save %sp, -104, %sp int rc = RC_OK; ssize_t cmpltd = 0; 40013120: 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) 40013124: 80 a6 e0 00 cmp %i3, 0 40013128: 02 80 00 18 be 40013188 <_fat_block_read+0x6c> 4001312c: 90 10 00 18 mov %i0, %o0 { rc = fat_buf_access(fs_info, sec_num, FAT_OP_TYPE_READ, &sec_buf); 40013130: 92 10 00 19 mov %i1, %o1 40013134: 94 10 20 01 mov 1, %o2 40013138: 7f ff ff ca call 40013060 4001313c: 96 07 bf fc add %fp, -4, %o3 if (rc != RC_OK) 40013140: 80 a2 20 00 cmp %o0, 0 40013144: 12 80 00 13 bne 40013190 <_fat_block_read+0x74> <== NEVER TAKEN 40013148: 01 00 00 00 nop return -1; c = MIN(count, (fs_info->vol.bps - ofs)); 4001314c: fa 16 00 00 lduh [ %i0 ], %i5 40013150: ba 27 40 1a sub %i5, %i2, %i5 40013154: 80 a7 40 1b cmp %i5, %i3 40013158: 38 80 00 02 bgu,a 40013160 <_fat_block_read+0x44> 4001315c: ba 10 00 1b mov %i3, %i5 memcpy((buff + cmpltd), (sec_buf + ofs), c); 40013160: d2 07 bf fc ld [ %fp + -4 ], %o1 40013164: 90 07 00 10 add %i4, %l0, %o0 40013168: 92 02 40 1a add %o1, %i2, %o1 4001316c: 94 10 00 1d mov %i5, %o2 40013170: 40 00 27 1c call 4001cde0 40013174: b6 26 c0 1d sub %i3, %i5, %i3 count -= c; cmpltd += c; 40013178: a0 07 40 10 add %i5, %l0, %l0 sec_num++; 4001317c: b2 06 60 01 inc %i1 ofs = 0; 40013180: 10 bf ff e9 b 40013124 <_fat_block_read+0x8> 40013184: b4 10 20 00 clr %i2 40013188: 81 c7 e0 08 ret 4001318c: 91 e8 00 10 restore %g0, %l0, %o0 } return cmpltd; } 40013190: 81 c7 e0 08 ret <== NOT EXECUTED 40013194: 91 e8 3f ff restore %g0, -1, %o0 <== NOT EXECUTED =============================================================================== 400076dc : #include #include #include int aio_cancel(int fildes, struct aiocb *aiocbp) { 400076dc: 9d e3 bf a0 save %sp, -96, %sp rtems_chain_control *idle_req_chain = &aio_request_queue.idle_req; rtems_chain_control *work_req_chain = &aio_request_queue.work_req; rtems_aio_request_chain *r_chain; int result; pthread_mutex_lock (&aio_request_queue.mutex); 400076e0: 3b 10 00 6a sethi %hi(0x4001a800), %i5 400076e4: 40 00 04 a7 call 40008980 400076e8: 90 17 60 88 or %i5, 0x88, %o0 ! 4001a888 if (fcntl (fildes, F_GETFD) < 0) { 400076ec: 90 10 00 18 mov %i0, %o0 400076f0: 92 10 20 01 mov 1, %o1 400076f4: 40 00 1b b9 call 4000e5d8 400076f8: b4 10 00 1d mov %i5, %i2 400076fc: 80 a2 20 00 cmp %o0, 0 40007700: 16 80 00 08 bge 40007720 40007704: 80 a6 60 00 cmp %i1, 0 pthread_mutex_unlock(&aio_request_queue.mutex); 40007708: 40 00 04 bd call 400089fc 4000770c: 90 17 60 88 or %i5, 0x88, %o0 rtems_set_errno_and_return_minus_one (EBADF); 40007710: 40 00 2a 67 call 400120ac <__errno> 40007714: 01 00 00 00 nop 40007718: 10 80 00 53 b 40007864 4000771c: 82 10 20 09 mov 9, %g1 ! 9 <_TLS_Alignment+0x8> } /* if aiocbp is NULL remove all request for given file descriptor */ if (aiocbp == NULL) { 40007720: 32 80 00 34 bne,a 400077f0 40007724: f8 06 40 00 ld [ %i1 ], %i4 AIO_printf ("Cancel all requests\n"); r_chain = rtems_aio_search_fd (work_req_chain, fildes, 0); 40007728: 11 10 00 6a sethi %hi(0x4001a800), %o0 4000772c: 92 10 00 18 mov %i0, %o1 40007730: 90 12 20 dc or %o0, 0xdc, %o0 40007734: 40 00 01 6d call 40007ce8 40007738: 94 10 20 00 clr %o2 if (r_chain == NULL) { 4000773c: b8 92 20 00 orcc %o0, 0, %i4 40007740: 12 80 00 1f bne 400077bc 40007744: 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; 40007748: ba 17 60 88 or %i5, 0x88, %i5 AIO_printf ("Request chain not on [WQ]\n"); if (!rtems_chain_is_empty (idle_req_chain)) { 4000774c: c4 07 60 60 ld [ %i5 + 0x60 ], %g2 40007750: 82 07 60 64 add %i5, 0x64, %g1 40007754: 80 a0 80 01 cmp %g2, %g1 40007758: 02 80 00 08 be 40007778 <== NEVER TAKEN 4000775c: 90 07 60 60 add %i5, 0x60, %o0 r_chain = rtems_aio_search_fd (idle_req_chain, fildes, 0); 40007760: 92 10 00 18 mov %i0, %o1 40007764: 40 00 01 61 call 40007ce8 40007768: 94 10 20 00 clr %o2 if (r_chain == NULL) { 4000776c: b8 92 20 00 orcc %o0, 0, %i4 40007770: 12 80 00 07 bne 4000778c 40007774: 01 00 00 00 nop pthread_mutex_unlock(&aio_request_queue.mutex); 40007778: 90 16 a0 88 or %i2, 0x88, %o0 4000777c: 40 00 04 a0 call 400089fc 40007780: b0 10 20 02 mov 2, %i0 return AIO_ALLDONE; 40007784: 81 c7 e0 08 ret 40007788: 81 e8 00 00 restore #else RTEMS_INLINE_ROUTINE void rtems_chain_extract( rtems_chain_node *the_node ) { _Chain_Extract( the_node ); 4000778c: 40 00 0b 06 call 4000a3a4 <_Chain_Extract> 40007790: 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); 40007794: 40 00 01 7d call 40007d88 40007798: 90 10 00 1c mov %i4, %o0 pthread_mutex_destroy (&r_chain->mutex); 4000779c: 40 00 03 c6 call 400086b4 400077a0: 90 10 00 1b mov %i3, %o0 pthread_cond_destroy (&r_chain->mutex); 400077a4: 40 00 02 ae call 4000825c 400077a8: 90 10 00 1b mov %i3, %o0 free (r_chain); 400077ac: 7f ff f1 bb call 40003e98 400077b0: 90 10 00 1c mov %i4, %o0 pthread_mutex_unlock (&aio_request_queue.mutex); 400077b4: 10 80 00 0b b 400077e0 400077b8: 90 10 00 1d mov %i5, %o0 return AIO_ALLDONE; } AIO_printf ("Request chain on [WQ]\n"); pthread_mutex_lock (&r_chain->mutex); 400077bc: 40 00 04 71 call 40008980 400077c0: 90 10 00 1b mov %i3, %o0 400077c4: 40 00 0a f8 call 4000a3a4 <_Chain_Extract> 400077c8: 90 10 00 1c mov %i4, %o0 rtems_chain_extract (&r_chain->next_fd); rtems_aio_remove_fd (r_chain); 400077cc: 40 00 01 6f call 40007d88 400077d0: 90 10 00 1c mov %i4, %o0 pthread_mutex_unlock (&r_chain->mutex); 400077d4: 40 00 04 8a call 400089fc 400077d8: 90 10 00 1b mov %i3, %o0 pthread_mutex_unlock (&aio_request_queue.mutex); 400077dc: 90 17 60 88 or %i5, 0x88, %o0 400077e0: 40 00 04 87 call 400089fc 400077e4: b0 10 20 00 clr %i0 return AIO_CANCELED; 400077e8: 81 c7 e0 08 ret 400077ec: 81 e8 00 00 restore } else { AIO_printf ("Cancel request\n"); if (aiocbp->aio_fildes != fildes) { 400077f0: 80 a7 00 18 cmp %i4, %i0 400077f4: 12 80 00 17 bne 40007850 400077f8: 90 17 60 88 or %i5, 0x88, %o0 pthread_mutex_unlock (&aio_request_queue.mutex); rtems_set_errno_and_return_minus_one (EINVAL); } r_chain = rtems_aio_search_fd (work_req_chain, fildes, 0); 400077fc: 11 10 00 6a sethi %hi(0x4001a800), %o0 40007800: 92 10 00 1c mov %i4, %o1 40007804: 90 12 20 dc or %o0, 0xdc, %o0 40007808: 40 00 01 38 call 40007ce8 4000780c: 94 10 20 00 clr %o2 if (r_chain == NULL) { 40007810: b6 92 20 00 orcc %o0, 0, %i3 40007814: 32 80 00 1c bne,a 40007884 40007818: b8 06 e0 1c add %i3, 0x1c, %i4 4000781c: ba 17 60 88 or %i5, 0x88, %i5 if (!rtems_chain_is_empty (idle_req_chain)) { 40007820: c4 07 60 60 ld [ %i5 + 0x60 ], %g2 40007824: 82 07 60 64 add %i5, 0x64, %g1 40007828: 80 a0 80 01 cmp %g2, %g1 4000782c: 02 bf ff d3 be 40007778 <== NEVER TAKEN 40007830: 90 07 60 60 add %i5, 0x60, %o0 r_chain = rtems_aio_search_fd (idle_req_chain, fildes, 0); 40007834: 92 10 00 1c mov %i4, %o1 40007838: 40 00 01 2c call 40007ce8 4000783c: 94 10 20 00 clr %o2 if (r_chain == NULL) { 40007840: 80 a2 20 00 cmp %o0, 0 40007844: 12 80 00 0b bne 40007870 40007848: 90 02 20 08 add %o0, 8, %o0 pthread_mutex_unlock (&aio_request_queue.mutex); 4000784c: 90 10 00 1d mov %i5, %o0 40007850: 40 00 04 6b call 400089fc 40007854: 01 00 00 00 nop rtems_set_errno_and_return_minus_one (EINVAL); 40007858: 40 00 2a 15 call 400120ac <__errno> 4000785c: 01 00 00 00 nop 40007860: 82 10 20 16 mov 0x16, %g1 ! 16 <_TLS_Alignment+0x15> 40007864: c2 22 00 00 st %g1, [ %o0 ] 40007868: 81 c7 e0 08 ret 4000786c: 91 e8 3f ff restore %g0, -1, %o0 } AIO_printf ("Request on [IQ]\n"); result = rtems_aio_remove_req (&r_chain->perfd, aiocbp); 40007870: 40 00 01 5b call 40007ddc 40007874: 92 10 00 19 mov %i1, %o1 40007878: b0 10 00 08 mov %o0, %i0 pthread_mutex_unlock (&aio_request_queue.mutex); 4000787c: 10 80 00 0b b 400078a8 40007880: 90 10 00 1d mov %i5, %o0 return AIO_ALLDONE; } } AIO_printf ("Request on [WQ]\n"); pthread_mutex_lock (&r_chain->mutex); 40007884: 40 00 04 3f call 40008980 40007888: 90 10 00 1c mov %i4, %o0 result = rtems_aio_remove_req (&r_chain->perfd, aiocbp); 4000788c: 92 10 00 19 mov %i1, %o1 40007890: 40 00 01 53 call 40007ddc 40007894: 90 06 e0 08 add %i3, 8, %o0 40007898: b0 10 00 08 mov %o0, %i0 pthread_mutex_unlock (&r_chain->mutex); 4000789c: 40 00 04 58 call 400089fc 400078a0: 90 10 00 1c mov %i4, %o0 pthread_mutex_unlock (&aio_request_queue.mutex); 400078a4: 90 17 60 88 or %i5, 0x88, %o0 400078a8: 40 00 04 55 call 400089fc 400078ac: 01 00 00 00 nop return result; } return AIO_ALLDONE; } 400078b0: 81 c7 e0 08 ret 400078b4: 81 e8 00 00 restore =============================================================================== 400078c0 : int aio_fsync( int op, struct aiocb *aiocbp ) { 400078c0: 9d e3 bf a0 save %sp, -96, %sp rtems_aio_request *req; int mode; if (op != O_SYNC) 400078c4: 03 00 00 08 sethi %hi(0x2000), %g1 400078c8: 80 a6 00 01 cmp %i0, %g1 400078cc: 12 80 00 10 bne 4000790c 400078d0: ba 10 20 16 mov 0x16, %i5 rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp); mode = fcntl (aiocbp->aio_fildes, F_GETFL); 400078d4: d0 06 40 00 ld [ %i1 ], %o0 400078d8: 40 00 1b 40 call 4000e5d8 400078dc: 92 10 20 03 mov 3, %o1 if (!(((mode & O_ACCMODE) == O_WRONLY) || ((mode & O_ACCMODE) == O_RDWR))) 400078e0: 90 0a 20 03 and %o0, 3, %o0 400078e4: 90 02 3f ff add %o0, -1, %o0 400078e8: 80 a2 20 01 cmp %o0, 1 400078ec: 18 80 00 08 bgu 4000790c 400078f0: ba 10 20 09 mov 9, %i5 rtems_aio_set_errno_return_minus_one (EBADF, aiocbp); req = malloc (sizeof (rtems_aio_request)); 400078f4: 7f ff f2 87 call 40004310 400078f8: 90 10 20 18 mov 0x18, %o0 if (req == NULL) 400078fc: b0 92 20 00 orcc %o0, 0, %i0 40007900: 32 80 00 0b bne,a 4000792c <== ALWAYS TAKEN 40007904: f2 26 20 14 st %i1, [ %i0 + 0x14 ] rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp); 40007908: ba 10 20 0b mov 0xb, %i5 <== NOT EXECUTED 4000790c: 82 10 3f ff mov -1, %g1 40007910: fa 26 60 34 st %i5, [ %i1 + 0x34 ] 40007914: c2 26 60 38 st %g1, [ %i1 + 0x38 ] 40007918: 40 00 29 e5 call 400120ac <__errno> 4000791c: b0 10 3f ff mov -1, %i0 40007920: fa 22 00 00 st %i5, [ %o0 ] req->aiocbp = aiocbp; req->aiocbp->aio_lio_opcode = LIO_SYNC; return rtems_aio_enqueue (req); } 40007924: 81 c7 e0 08 ret 40007928: 81 e8 00 00 restore req = malloc (sizeof (rtems_aio_request)); if (req == NULL) rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp); req->aiocbp = aiocbp; req->aiocbp->aio_lio_opcode = LIO_SYNC; 4000792c: 82 10 20 03 mov 3, %g1 40007930: c2 26 60 30 st %g1, [ %i1 + 0x30 ] return rtems_aio_enqueue (req); 40007934: 40 00 01 48 call 40007e54 40007938: 81 e8 00 00 restore =============================================================================== 4000807c : * 0 - otherwise */ int aio_read (struct aiocb *aiocbp) { 4000807c: 9d e3 bf a0 save %sp, -96, %sp rtems_aio_request *req; int mode; mode = fcntl (aiocbp->aio_fildes, F_GETFL); 40008080: d0 06 00 00 ld [ %i0 ], %o0 40008084: 92 10 20 03 mov 3, %o1 40008088: 40 00 19 54 call 4000e5d8 4000808c: ba 10 00 18 mov %i0, %i5 if (!(((mode & O_ACCMODE) == O_RDONLY) || ((mode & O_ACCMODE) == O_RDWR))) 40008090: 80 8a 20 01 btst 1, %o0 40008094: 12 80 00 11 bne 400080d8 40008098: 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) 4000809c: c2 06 20 18 ld [ %i0 + 0x18 ], %g1 400080a0: 80 a0 60 00 cmp %g1, 0 400080a4: 22 80 00 04 be,a 400080b4 400080a8: c2 06 20 08 ld [ %i0 + 8 ], %g1 rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp); 400080ac: 10 80 00 0b b 400080d8 400080b0: b8 10 20 16 mov 0x16, %i4 if (aiocbp->aio_offset < 0) 400080b4: 80 a0 60 00 cmp %g1, 0 400080b8: 06 80 00 08 bl 400080d8 400080bc: b8 10 20 16 mov 0x16, %i4 rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp); req = malloc (sizeof (rtems_aio_request)); 400080c0: 7f ff f0 94 call 40004310 400080c4: 90 10 20 18 mov 0x18, %o0 if (req == NULL) 400080c8: b0 92 20 00 orcc %o0, 0, %i0 400080cc: 32 80 00 0b bne,a 400080f8 <== ALWAYS TAKEN 400080d0: fa 26 20 14 st %i5, [ %i0 + 0x14 ] rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp); 400080d4: b8 10 20 0b mov 0xb, %i4 <== NOT EXECUTED 400080d8: 82 10 3f ff mov -1, %g1 400080dc: f8 27 60 34 st %i4, [ %i5 + 0x34 ] 400080e0: c2 27 60 38 st %g1, [ %i5 + 0x38 ] 400080e4: 40 00 27 f2 call 400120ac <__errno> 400080e8: b0 10 3f ff mov -1, %i0 400080ec: f8 22 00 00 st %i4, [ %o0 ] req->aiocbp = aiocbp; req->aiocbp->aio_lio_opcode = LIO_READ; return rtems_aio_enqueue (req); } 400080f0: 81 c7 e0 08 ret 400080f4: 81 e8 00 00 restore req = malloc (sizeof (rtems_aio_request)); if (req == NULL) rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp); req->aiocbp = aiocbp; req->aiocbp->aio_lio_opcode = LIO_READ; 400080f8: 82 10 20 01 mov 1, %g1 400080fc: c2 27 60 30 st %g1, [ %i5 + 0x30 ] return rtems_aio_enqueue (req); 40008100: 7f ff ff 55 call 40007e54 40008104: 81 e8 00 00 restore =============================================================================== 40008110 : * 0 - otherwise */ int aio_write (struct aiocb *aiocbp) { 40008110: 9d e3 bf a0 save %sp, -96, %sp rtems_aio_request *req; int mode; mode = fcntl (aiocbp->aio_fildes, F_GETFL); 40008114: d0 06 00 00 ld [ %i0 ], %o0 40008118: 40 00 19 30 call 4000e5d8 4000811c: 92 10 20 03 mov 3, %o1 * 0 - otherwise */ int aio_write (struct aiocb *aiocbp) { 40008120: 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))) 40008124: 90 0a 20 03 and %o0, 3, %o0 40008128: 90 02 3f ff add %o0, -1, %o0 4000812c: 80 a2 20 01 cmp %o0, 1 40008130: 18 80 00 11 bgu 40008174 40008134: 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) 40008138: c2 06 20 18 ld [ %i0 + 0x18 ], %g1 4000813c: 80 a0 60 00 cmp %g1, 0 40008140: 22 80 00 04 be,a 40008150 40008144: c2 06 20 08 ld [ %i0 + 8 ], %g1 rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp); 40008148: 10 80 00 0b b 40008174 4000814c: b8 10 20 16 mov 0x16, %i4 if (aiocbp->aio_offset < 0) 40008150: 80 a0 60 00 cmp %g1, 0 40008154: 06 80 00 08 bl 40008174 40008158: b8 10 20 16 mov 0x16, %i4 rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp); req = malloc (sizeof (rtems_aio_request)); 4000815c: 7f ff f0 6d call 40004310 40008160: 90 10 20 18 mov 0x18, %o0 if (req == NULL) 40008164: b0 92 20 00 orcc %o0, 0, %i0 40008168: 32 80 00 0b bne,a 40008194 <== ALWAYS TAKEN 4000816c: fa 26 20 14 st %i5, [ %i0 + 0x14 ] rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp); 40008170: b8 10 20 0b mov 0xb, %i4 <== NOT EXECUTED 40008174: 82 10 3f ff mov -1, %g1 40008178: f8 27 60 34 st %i4, [ %i5 + 0x34 ] 4000817c: c2 27 60 38 st %g1, [ %i5 + 0x38 ] 40008180: 40 00 27 cb call 400120ac <__errno> 40008184: b0 10 3f ff mov -1, %i0 40008188: f8 22 00 00 st %i4, [ %o0 ] req->aiocbp = aiocbp; req->aiocbp->aio_lio_opcode = LIO_WRITE; return rtems_aio_enqueue (req); } 4000818c: 81 c7 e0 08 ret 40008190: 81 e8 00 00 restore req = malloc (sizeof (rtems_aio_request)); if (req == NULL) rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp); req->aiocbp = aiocbp; req->aiocbp->aio_lio_opcode = LIO_WRITE; 40008194: 82 10 20 02 mov 2, %g1 40008198: c2 27 60 30 st %g1, [ %i5 + 0x30 ] return rtems_aio_enqueue (req); 4000819c: 7f ff ff 2e call 40007e54 400081a0: 81 e8 00 00 restore =============================================================================== 400041a8 : #include #include int chroot( const char *path ) { 400041a8: 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( 400041ac: 94 10 20 19 mov 0x19, %o2 400041b0: 92 10 00 18 mov %i0, %o1 400041b4: 90 07 bf c8 add %fp, -56, %o0 400041b8: 17 10 00 4c sethi %hi(0x40013000), %o3 400041bc: 96 12 e3 84 or %o3, 0x384, %o3 ! 40013384 400041c0: 40 00 04 c1 call 400054c4 400041c4: 98 02 ff fc add %o3, -4, %o4 400041c8: 90 07 bf b0 add %fp, -80, %o0 400041cc: 40 00 05 de call 40005944 400041d0: 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 ); 400041d4: 40 00 05 e6 call 4000596c 400041d8: 90 07 bf b0 add %fp, -80, %o0 if ( !rtems_filesystem_global_location_is_null( new_current_loc ) ) { 400041dc: c2 02 20 10 ld [ %o0 + 0x10 ], %g1 400041e0: 39 10 00 4b sethi %hi(0x40012c00), %i4 400041e4: b8 17 21 28 or %i4, 0x128, %i4 ! 40012d28 400041e8: 80 a0 40 1c cmp %g1, %i4 400041ec: 02 80 00 2a be 40004294 400041f0: d0 27 bf ac st %o0, [ %fp + -84 ] rtems_filesystem_global_location_t *new_root_loc = 400041f4: 40 00 05 70 call 400057b4 400041f8: 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)( 400041fc: c2 02 20 14 ld [ %o0 + 0x14 ], %g1 40004200: 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 = 40004204: c2 00 60 14 ld [ %g1 + 0x14 ], %g1 40004208: 9f c0 40 00 call %g1 4000420c: 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 ) { 40004210: 80 a2 20 00 cmp %o0, 0 40004214: 32 80 00 17 bne,a 40004270 40004218: c2 07 60 10 ld [ %i5 + 0x10 ], %g1 sc = rtems_libio_set_private_env(); 4000421c: 40 00 03 1e call 40004e94 40004220: 01 00 00 00 nop if (sc == RTEMS_SUCCESSFUL) { 40004224: 80 a2 20 00 cmp %o0, 0 40004228: 12 80 00 0c bne 40004258 4000422c: 80 a2 20 0d cmp %o0, 0xd rtems_filesystem_global_location_assign( &rtems_filesystem_root, 40004230: 40 00 03 00 call 40004e30 40004234: b0 10 20 00 clr %i0 ); if ( type == RTEMS_FILESYSTEM_DIRECTORY ) { sc = rtems_libio_set_private_env(); if (sc == RTEMS_SUCCESSFUL) { rtems_filesystem_global_location_assign( 40004238: 92 10 00 1d mov %i5, %o1 4000423c: 40 00 05 a4 call 400058cc 40004240: 90 02 20 04 add %o0, 4, %o0 &rtems_filesystem_root, new_root_loc ); rtems_filesystem_global_location_assign( &rtems_filesystem_current, 40004244: 40 00 02 fb call 40004e30 40004248: 01 00 00 00 nop if (sc == RTEMS_SUCCESSFUL) { rtems_filesystem_global_location_assign( &rtems_filesystem_root, new_root_loc ); rtems_filesystem_global_location_assign( 4000424c: 40 00 05 a0 call 400058cc 40004250: d2 07 bf ac ld [ %fp + -84 ], %o1 40004254: 30 80 00 11 b,a 40004298 &rtems_filesystem_current, new_current_loc ); } else { if (sc != RTEMS_UNSATISFIED) { 40004258: 02 80 00 0d be 4000428c <== NEVER TAKEN 4000425c: 01 00 00 00 nop errno = ENOMEM; 40004260: 40 00 22 b1 call 4000cd24 <__errno> 40004264: 01 00 00 00 nop 40004268: 10 80 00 08 b 40004288 4000426c: 82 10 20 0c mov 0xc, %g1 ! c <_TLS_Alignment+0xb> static inline void rtems_filesystem_location_error( const rtems_filesystem_location_info_t *loc, int eno ) { if ( !rtems_filesystem_location_is_null( loc ) ) { 40004270: 80 a0 40 1c cmp %g1, %i4 40004274: 02 80 00 06 be 4000428c <== NEVER TAKEN 40004278: 01 00 00 00 nop errno = eno; 4000427c: 40 00 22 aa call 4000cd24 <__errno> 40004280: 01 00 00 00 nop 40004284: 82 10 20 14 mov 0x14, %g1 ! 14 <_TLS_Alignment+0x13> 40004288: c2 22 00 00 st %g1, [ %o0 ] rtems_filesystem_location_error( &new_root_loc->location, ENOTDIR ); rv = -1; } if ( rv != 0 ) { rtems_filesystem_global_location_release( new_root_loc ); 4000428c: 40 00 05 7c call 4000587c 40004290: 90 10 00 1d mov %i5, %o0 } } else { rv = -1; 40004294: b0 10 3f ff mov -1, %i0 } rtems_filesystem_eval_path_cleanup( &ctx ); 40004298: 40 00 04 b0 call 40005558 4000429c: 90 07 bf c8 add %fp, -56, %o0 if ( rv != 0 ) { 400042a0: 80 a6 20 00 cmp %i0, 0 400042a4: 02 80 00 06 be 400042bc 400042a8: 01 00 00 00 nop rtems_filesystem_global_location_release( new_current_loc ); 400042ac: 40 00 05 74 call 4000587c 400042b0: d0 07 bf ac ld [ %fp + -84 ], %o0 400042b4: 81 c7 e0 08 ret 400042b8: 81 e8 00 00 restore } return rv; } 400042bc: 81 c7 e0 08 ret 400042c0: 81 e8 00 00 restore =============================================================================== 40006e6c : int clock_gettime( clockid_t clock_id, struct timespec *tp ) { 40006e6c: 9d e3 bf 98 save %sp, -104, %sp if ( !tp ) 40006e70: 80 a6 60 00 cmp %i1, 0 40006e74: 12 80 00 06 bne 40006e8c 40006e78: 80 a6 20 01 cmp %i0, 1 rtems_set_errno_and_return_minus_one( EINVAL ); 40006e7c: 40 00 24 35 call 4000ff50 <__errno> 40006e80: 01 00 00 00 nop 40006e84: 10 80 00 25 b 40006f18 40006e88: 82 10 20 16 mov 0x16, %g1 ! 16 <_TLS_Alignment+0x15> if ( clock_id == CLOCK_REALTIME ) { 40006e8c: 12 80 00 16 bne 40006ee4 40006e90: 80 a6 20 04 cmp %i0, 4 ) { Timestamp_Control tod_as_timestamp; Timestamp_Control *tod_as_timestamp_ptr; tod_as_timestamp_ptr = 40006e94: 90 07 bf f8 add %fp, -8, %o0 40006e98: 13 10 00 6a sethi %hi(0x4001a800), %o1 40006e9c: 40 00 06 65 call 40008830 <_TOD_Get_with_nanoseconds> 40006ea0: 92 12 61 20 or %o1, 0x120, %o1 ! 4001a920 <_TOD> static inline void _TOD_Get( struct timespec *tod_as_timespec ) { Timestamp_Control tod_as_timestamp; Timestamp_Control *tod_as_timestamp_ptr; 40006ea4: 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); 40006ea8: 94 10 20 00 clr %o2 40006eac: 90 10 00 1c mov %i4, %o0 40006eb0: 92 10 00 1d mov %i5, %o1 40006eb4: 17 0e e6 b2 sethi %hi(0x3b9ac800), %o3 40006eb8: 40 00 3b 45 call 40015bcc <__divdi3> 40006ebc: 96 12 e2 00 or %o3, 0x200, %o3 ! 3b9aca00 _timespec->tv_nsec = (long) (*_timestamp % 1000000000L); 40006ec0: 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); 40006ec4: d2 26 40 00 st %o1, [ %i1 ] _timespec->tv_nsec = (long) (*_timestamp % 1000000000L); 40006ec8: 94 10 20 00 clr %o2 40006ecc: 92 10 00 1d mov %i5, %o1 40006ed0: 17 0e e6 b2 sethi %hi(0x3b9ac800), %o3 40006ed4: 40 00 3c 30 call 40015f94 <__moddi3> 40006ed8: 96 12 e2 00 or %o3, 0x200, %o3 ! 3b9aca00 40006edc: 10 80 00 06 b 40006ef4 40006ee0: d2 26 60 04 st %o1, [ %i1 + 4 ] _TOD_Get(tp); return 0; } #ifdef CLOCK_MONOTONIC if ( clock_id == CLOCK_MONOTONIC ) { 40006ee4: 12 80 00 06 bne 40006efc <== ALWAYS TAKEN 40006ee8: 80 a6 20 02 cmp %i0, 2 _TOD_Get_uptime_as_timespec( tp ); 40006eec: 40 00 06 62 call 40008874 <_TOD_Get_uptime_as_timespec> 40006ef0: 90 10 00 19 mov %i1, %o0 return 0; 40006ef4: 81 c7 e0 08 ret 40006ef8: 91 e8 20 00 restore %g0, 0, %o0 } #endif #ifdef _POSIX_CPUTIME if ( clock_id == CLOCK_PROCESS_CPUTIME_ID ) { 40006efc: 02 bf ff fc be 40006eec 40006f00: 80 a6 20 03 cmp %i0, 3 return 0; } #endif #ifdef _POSIX_THREAD_CPUTIME if ( clock_id == CLOCK_THREAD_CPUTIME_ID ) 40006f04: 12 bf ff de bne 40006e7c 40006f08: 01 00 00 00 nop rtems_set_errno_and_return_minus_one( ENOSYS ); 40006f0c: 40 00 24 11 call 4000ff50 <__errno> 40006f10: 01 00 00 00 nop 40006f14: 82 10 20 58 mov 0x58, %g1 ! 58 <_TLS_Alignment+0x57> 40006f18: c2 22 00 00 st %g1, [ %o0 ] #endif rtems_set_errno_and_return_minus_one( EINVAL ); return 0; } 40006f1c: 81 c7 e0 08 ret 40006f20: 91 e8 3f ff restore %g0, -1, %o0 =============================================================================== 400072e4 : int clock_settime( clockid_t clock_id, const struct timespec *tp ) { 400072e4: 9d e3 bf 98 save %sp, -104, %sp if ( !tp ) 400072e8: 82 96 60 00 orcc %i1, 0, %g1 400072ec: 12 80 00 06 bne 40007304 <== ALWAYS TAKEN 400072f0: 80 a6 20 01 cmp %i0, 1 rtems_set_errno_and_return_minus_one( EINVAL ); 400072f4: 40 00 26 31 call 40010bb8 <__errno> 400072f8: 01 00 00 00 nop 400072fc: 10 80 00 4a b 40007424 40007300: 82 10 20 16 mov 0x16, %g1 ! 16 <_TLS_Alignment+0x15> if ( clock_id == CLOCK_REALTIME ) { 40007304: 32 80 00 42 bne,a 4000740c 40007308: b0 06 3f fe add %i0, -2, %i0 if ( tp->tv_sec < TOD_SECONDS_1970_THROUGH_1988 ) 4000730c: c6 00 40 00 ld [ %g1 ], %g3 40007310: 05 08 76 b9 sethi %hi(0x21dae400), %g2 40007314: 84 10 a0 ff or %g2, 0xff, %g2 ! 21dae4ff 40007318: 80 a0 c0 02 cmp %g3, %g2 4000731c: 08 bf ff f6 bleu 400072f4 40007320: 01 00 00 00 nop * * This rountine increments the thread dispatch level */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_increment_disable_level(void) { uint32_t disable_level = _Thread_Dispatch_disable_level; 40007324: c6 01 a0 10 ld [ %g6 + 0x10 ], %g3 _ISR_Disable( level ); _Profiling_Thread_dispatch_disable( _Per_CPU_Get(), disable_level ); #endif ++disable_level; 40007328: 86 00 e0 01 inc %g3 _Thread_Dispatch_disable_level = disable_level; 4000732c: c6 21 a0 10 st %g3, [ %g6 + 0x10 ] const struct timespec *tod_as_timespec ) { Timestamp_Control tod_as_timestamp; _Timestamp_Set( 40007330: c8 00 40 00 ld [ %g1 ], %g4 40007334: c2 00 60 04 ld [ %g1 + 4 ], %g1 40007338: 86 10 00 04 mov %g4, %g3 4000733c: 85 39 20 1f sra %g4, 0x1f, %g2 Timestamp64_Control *_time, Timestamp64_Control _seconds, Timestamp64_Control _nanoseconds ) { *_time = _seconds * 1000000000L + _nanoseconds; 40007340: b7 31 20 1d srl %g4, 0x1d, %i3 40007344: 89 28 a0 03 sll %g2, 3, %g4 40007348: bb 28 e0 03 sll %g3, 3, %i5 4000734c: b8 16 c0 04 or %i3, %g4, %i4 40007350: 89 37 60 1b srl %i5, 0x1b, %g4 40007354: b5 2f 20 05 sll %i4, 5, %i2 40007358: b7 2f 60 05 sll %i5, 5, %i3 4000735c: b4 11 00 1a or %g4, %i2, %i2 40007360: ba a6 c0 1d subcc %i3, %i5, %i5 40007364: 89 37 60 1a srl %i5, 0x1a, %g4 40007368: b8 66 80 1c subx %i2, %i4, %i4 4000736c: b7 2f 60 06 sll %i5, 6, %i3 40007370: b5 2f 20 06 sll %i4, 6, %i2 40007374: b6 a6 c0 1d subcc %i3, %i5, %i3 40007378: b4 11 00 1a or %g4, %i2, %i2 4000737c: b4 66 80 1c subx %i2, %i4, %i2 40007380: b2 86 c0 03 addcc %i3, %g3, %i1 40007384: b0 46 80 02 addx %i2, %g2, %i0 40007388: 89 36 60 1e srl %i1, 0x1e, %g4 4000738c: 85 2e 20 02 sll %i0, 2, %g2 40007390: 84 11 00 02 or %g4, %g2, %g2 40007394: 87 2e 60 02 sll %i1, 2, %g3 40007398: ba 86 40 03 addcc %i1, %g3, %i5 4000739c: b8 46 00 02 addx %i0, %g2, %i4 400073a0: 89 37 60 1e srl %i5, 0x1e, %g4 400073a4: 85 2f 20 02 sll %i4, 2, %g2 400073a8: 84 11 00 02 or %g4, %g2, %g2 400073ac: 87 2f 60 02 sll %i5, 2, %g3 400073b0: b6 87 40 03 addcc %i5, %g3, %i3 400073b4: b4 47 00 02 addx %i4, %g2, %i2 400073b8: 85 36 e0 1e srl %i3, 0x1e, %g2 400073bc: bb 2e e0 02 sll %i3, 2, %i5 400073c0: b9 2e a0 02 sll %i2, 2, %i4 400073c4: 86 86 c0 1d addcc %i3, %i5, %g3 400073c8: b8 10 80 1c or %g2, %i4, %i4 400073cc: 84 46 80 1c addx %i2, %i4, %g2 400073d0: 89 28 e0 09 sll %g3, 9, %g4 400073d4: b9 30 e0 17 srl %g3, 0x17, %i4 400073d8: b6 81 00 01 addcc %g4, %g1, %i3 &tod_as_timestamp, tod_as_timespec->tv_sec, tod_as_timespec->tv_nsec ); _TOD_Set_with_timestamp( &tod_as_timestamp ); 400073dc: 90 07 bf f8 add %fp, -8, %o0 400073e0: bb 28 a0 09 sll %g2, 9, %i5 400073e4: 84 17 00 1d or %i4, %i5, %g2 rtems_set_errno_and_return_minus_one( ENOSYS ); #endif else rtems_set_errno_and_return_minus_one( EINVAL ); return 0; 400073e8: b0 10 20 00 clr %i0 const struct timespec *tod_as_timespec ) { Timestamp_Control tod_as_timestamp; _Timestamp_Set( 400073ec: b9 38 60 1f sra %g1, 0x1f, %i4 400073f0: 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 ); 400073f4: 40 00 07 e8 call 40009394 <_TOD_Set_with_timestamp> 400073f8: 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(); 400073fc: 40 00 0e 26 call 4000ac94 <_Thread_Enable_dispatch> 40007400: 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; 40007404: 81 c7 e0 08 ret 40007408: 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 ) 4000740c: 80 a6 20 01 cmp %i0, 1 40007410: 18 bf ff b9 bgu 400072f4 40007414: 01 00 00 00 nop rtems_set_errno_and_return_minus_one( ENOSYS ); 40007418: 40 00 25 e8 call 40010bb8 <__errno> 4000741c: 01 00 00 00 nop 40007420: 82 10 20 58 mov 0x58, %g1 ! 58 <_TLS_Alignment+0x57> 40007424: c2 22 00 00 st %g1, [ %o0 ] #endif else rtems_set_errno_and_return_minus_one( EINVAL ); return 0; } 40007428: 81 c7 e0 08 ret 4000742c: 91 e8 3f ff restore %g0, -1, %o0 =============================================================================== 40003a4c : dev_t dev, const char *name, rtems_disk_device **dd_ptr, char **alloc_name_ptr ) { 40003a4c: 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) { 40003a50: 03 10 00 70 sethi %hi(0x4001c000), %g1 40003a54: e0 00 62 80 ld [ %g1 + 0x280 ], %l0 ! 4001c280 40003a58: a6 10 00 01 mov %g1, %l3 40003a5c: 80 a6 00 10 cmp %i0, %l0 40003a60: 0a 80 00 13 bcs 40003aac 40003a64: 25 10 00 70 sethi %hi(0x4001c000), %l2 rtems_disk_device_table *table = disktab; rtems_device_major_number old_size = disktab_size; rtems_device_major_number new_size = 2 * old_size; 40003a68: bb 2c 20 01 sll %l0, 1, %i5 if (major >= new_size) { 40003a6c: 80 a6 00 1d cmp %i0, %i5 40003a70: 0a 80 00 03 bcs 40003a7c <== NEVER TAKEN 40003a74: d0 04 a2 84 ld [ %l2 + 0x284 ], %o0 new_size = major + 1; 40003a78: ba 06 20 01 add %i0, 1, %i5 } table = realloc(table, new_size * sizeof(*table)); 40003a7c: 40 00 07 3a call 40005764 40003a80: 93 2f 60 03 sll %i5, 3, %o1 if (table == NULL) { 40003a84: a2 92 20 00 orcc %o0, 0, %l1 40003a88: 02 80 00 53 be 40003bd4 <== ALWAYS TAKEN 40003a8c: 94 27 40 10 sub %i5, %l0, %o2 return NULL; } memset(table + old_size, 0, (new_size - old_size) * sizeof(*table)); 40003a90: 91 2c 20 03 sll %l0, 3, %o0 <== NOT EXECUTED 40003a94: 92 10 20 00 clr %o1 <== NOT EXECUTED 40003a98: 90 04 40 08 add %l1, %o0, %o0 <== NOT EXECUTED 40003a9c: 40 00 43 03 call 400146a8 <== NOT EXECUTED 40003aa0: 95 2a a0 03 sll %o2, 3, %o2 <== NOT EXECUTED disktab = table; 40003aa4: e2 24 a2 84 st %l1, [ %l2 + 0x284 ] <== NOT EXECUTED disktab_size = new_size; 40003aa8: fa 24 e2 80 st %i5, [ %l3 + 0x280 ] <== NOT EXECUTED } if (disktab [major].minor == NULL || minor >= disktab[major].size) { 40003aac: e4 04 a2 84 ld [ %l2 + 0x284 ], %l2 40003ab0: a3 2e 20 03 sll %i0, 3, %l1 40003ab4: d0 04 80 11 ld [ %l2 + %l1 ], %o0 40003ab8: a8 04 80 11 add %l2, %l1, %l4 40003abc: 80 a2 20 00 cmp %o0, 0 40003ac0: 02 80 00 05 be 40003ad4 40003ac4: e0 05 20 04 ld [ %l4 + 4 ], %l0 40003ac8: 80 a6 40 10 cmp %i1, %l0 40003acc: 2a 80 00 16 bcs,a 40003b24 40003ad0: 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) { 40003ad4: 80 a4 20 00 cmp %l0, 0 40003ad8: 02 80 00 03 be 40003ae4 40003adc: ba 10 20 08 mov 8, %i5 new_size = DISKTAB_INITIAL_SIZE; } else { new_size = 2 * old_size; 40003ae0: bb 2c 20 01 sll %l0, 1, %i5 } if (minor >= new_size) { 40003ae4: 80 a6 40 1d cmp %i1, %i5 40003ae8: 3a 80 00 02 bcc,a 40003af0 40003aec: ba 06 60 01 add %i1, 1, %i5 new_size = minor + 1; } table = realloc(table, new_size * sizeof(*table)); 40003af0: 40 00 07 1d call 40005764 40003af4: 93 2f 60 02 sll %i5, 2, %o1 if (table == NULL) { 40003af8: a6 92 20 00 orcc %o0, 0, %l3 40003afc: 02 80 00 36 be 40003bd4 40003b00: 94 27 40 10 sub %i5, %l0, %o2 return NULL; } memset(table + old_size, 0, (new_size - old_size) * sizeof(*table)); 40003b04: 91 2c 20 02 sll %l0, 2, %o0 40003b08: 92 10 20 00 clr %o1 40003b0c: 90 04 c0 08 add %l3, %o0, %o0 40003b10: 40 00 42 e6 call 400146a8 40003b14: 95 2a a0 02 sll %o2, 2, %o2 disktab [major].minor = table; 40003b18: e6 24 80 11 st %l3, [ %l2 + %l1 ] disktab [major].size = new_size; 40003b1c: fa 25 20 04 st %i5, [ %l4 + 4 ] } return disktab [major].minor + minor; 40003b20: e2 04 80 11 ld [ %l2 + %l1 ], %l1 40003b24: a1 2e 60 02 sll %i1, 2, %l0 40003b28: 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) { 40003b2c: 80 a0 60 00 cmp %g1, 0 40003b30: 02 80 00 2a be 40003bd8 <== NEVER TAKEN 40003b34: 82 10 20 1a mov 0x1a, %g1 return RTEMS_NO_MEMORY; } if (*dd_entry != NULL) { 40003b38: c4 04 40 10 ld [ %l1 + %l0 ], %g2 40003b3c: 80 a0 a0 00 cmp %g2, 0 40003b40: 12 80 00 26 bne 40003bd8 40003b44: 82 10 20 0c mov 0xc, %g1 return RTEMS_RESOURCE_IN_USE; } dd = malloc(sizeof(*dd)); 40003b48: 40 00 04 c1 call 40004e4c 40003b4c: 90 10 20 78 mov 0x78, %o0 if (dd == NULL) { 40003b50: ba 92 20 00 orcc %o0, 0, %i5 40003b54: 02 80 00 20 be 40003bd4 <== NEVER TAKEN 40003b58: 80 a6 a0 00 cmp %i2, 0 return RTEMS_NO_MEMORY; } if (name != NULL) { 40003b5c: 02 80 00 0b be 40003b88 40003b60: a4 10 20 00 clr %l2 alloc_name = strdup(name); 40003b64: 40 00 43 af call 40014a20 40003b68: 90 10 00 1a mov %i2, %o0 if (alloc_name == NULL) { 40003b6c: a4 92 20 00 orcc %o0, 0, %l2 40003b70: 12 80 00 0b bne 40003b9c <== ALWAYS TAKEN 40003b74: b4 10 00 08 mov %o0, %i2 free(dd); 40003b78: 40 00 03 8c call 400049a8 <== NOT EXECUTED 40003b7c: 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; 40003b80: 10 80 00 16 b 40003bd8 <== NOT EXECUTED 40003b84: 82 10 20 1a mov 0x1a, %g1 <== NOT EXECUTED free(dd); return RTEMS_UNSATISFIED; } } *dd_entry = dd; 40003b88: fa 24 40 10 st %i5, [ %l1 + %l0 ] *dd_ptr = dd; 40003b8c: fa 26 c0 00 st %i5, [ %i3 ] *alloc_name_ptr = alloc_name; 40003b90: e4 27 00 00 st %l2, [ %i4 ] return RTEMS_SUCCESSFUL; 40003b94: 10 80 00 11 b 40003bd8 40003b98: 82 10 20 00 clr %g1 return RTEMS_NO_MEMORY; } } if (name != NULL) { if (mknod(alloc_name, 0777 | S_IFBLK, dev) < 0) { 40003b9c: 13 00 00 18 sethi %hi(0x6000), %o1 40003ba0: 94 10 00 18 mov %i0, %o2 40003ba4: 92 12 61 ff or %o1, 0x1ff, %o1 40003ba8: 40 00 05 16 call 40005000 40003bac: 96 10 00 19 mov %i1, %o3 40003bb0: 80 a2 20 00 cmp %o0, 0 40003bb4: 36 bf ff f6 bge,a 40003b8c <== ALWAYS TAKEN 40003bb8: fa 24 40 10 st %i5, [ %l1 + %l0 ] free(alloc_name); 40003bbc: 40 00 03 7b call 400049a8 <== NOT EXECUTED 40003bc0: 90 10 00 1a mov %i2, %o0 <== NOT EXECUTED free(dd); 40003bc4: 40 00 03 79 call 400049a8 <== NOT EXECUTED 40003bc8: 90 10 00 1d mov %i5, %o0 <== NOT EXECUTED return RTEMS_UNSATISFIED; 40003bcc: 10 80 00 03 b 40003bd8 <== NOT EXECUTED 40003bd0: 82 10 20 0d mov 0xd, %g1 <== 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; 40003bd4: 82 10 20 1a mov 0x1a, %g1 *dd_entry = dd; *dd_ptr = dd; *alloc_name_ptr = alloc_name; return RTEMS_SUCCESSFUL; } 40003bd8: 81 c7 e0 08 ret 40003bdc: 91 e8 00 01 restore %g0, %g1, %o0 =============================================================================== 40003b4c : #include #include static char *create_logical_disk_name( const char *disk_name, char **marker) { 40003b4c: 9d e3 bf a0 save %sp, -96, %sp size_t disk_name_size = strlen( disk_name); 40003b50: 40 00 4b d8 call 40016ab0 40003b54: 90 10 00 18 mov %i0, %o0 40003b58: b8 10 00 08 mov %o0, %i4 char *logical_disk_name = malloc( disk_name_size + RTEMS_BDPART_NUMBER_SIZE); 40003b5c: 40 00 0b 76 call 40006934 40003b60: 90 02 20 04 add %o0, 4, %o0 if (logical_disk_name != NULL) { 40003b64: ba 92 20 00 orcc %o0, 0, %i5 40003b68: 02 80 00 06 be 40003b80 <== NEVER TAKEN 40003b6c: 94 10 00 1c mov %i4, %o2 strncpy( logical_disk_name, disk_name, disk_name_size); 40003b70: 92 10 00 18 mov %i0, %o1 40003b74: 40 00 4c 4d call 40016ca8 40003b78: b8 07 40 1c add %i5, %i4, %i4 *marker = logical_disk_name + disk_name_size; 40003b7c: f8 26 40 00 st %i4, [ %i1 ] } return logical_disk_name; } 40003b80: 81 c7 e0 08 ret 40003b84: 91 e8 00 1d restore %g0, %i5, %o0 =============================================================================== 40005488 : * 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) 40005488: 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) 4000548c: 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) 40005490: b8 10 00 18 mov %i0, %i4 if (new_part_desc == NULL) { return RTEMS_INTERNAL_ERROR; } *new_part_desc = NULL; 40005494: c0 26 40 00 clr [ %i1 ] if ((part_desc = calloc(1, sizeof(rtems_part_desc_t))) == NULL) 40005498: 92 10 20 28 mov 0x28, %o1 4000549c: 40 00 03 76 call 40006274 400054a0: b0 10 20 1a mov 0x1a, %i0 400054a4: 80 a2 20 00 cmp %o0, 0 400054a8: 02 80 00 27 be 40005544 <== NEVER TAKEN 400054ac: ba 10 00 08 mov %o0, %i5 { return RTEMS_NO_MEMORY; } part_desc->bootable = *(data + RTEMS_IDE_PARTITION_BOOTABLE_OFFSET); 400054b0: 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)); 400054b4: 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); 400054b8: c2 2a 00 00 stb %g1, [ %o0 ] part_desc->sys_type = *(data + RTEMS_IDE_PARTITION_SYS_TYPE_OFFSET); 400054bc: 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)); 400054c0: 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); 400054c4: 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)); 400054c8: 40 00 43 67 call 40016264 400054cc: 90 07 bf fc add %fp, -4, %o0 part_desc->start = LE_TO_CPU_U32(temp); 400054d0: 7f ff ff ac call 40005380 400054d4: d0 07 bf fc ld [ %fp + -4 ], %o0 memcpy(&temp, data + RTEMS_IDE_PARTITION_SIZE_OFFSET, sizeof(uint32_t)); 400054d8: 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); 400054dc: d0 27 60 04 st %o0, [ %i5 + 4 ] memcpy(&temp, data + RTEMS_IDE_PARTITION_SIZE_OFFSET, sizeof(uint32_t)); 400054e0: 94 10 20 04 mov 4, %o2 400054e4: 40 00 43 60 call 40016264 400054e8: 90 07 bf fc add %fp, -4, %o0 part_desc->size = LE_TO_CPU_U32(temp); 400054ec: 7f ff ff a5 call 40005380 400054f0: d0 07 bf fc ld [ %fp + -4 ], %o0 400054f4: 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) || 400054f8: 82 0e e0 7f and %i3, 0x7f, %g1 400054fc: 80 a0 60 05 cmp %g1, 5 40005500: 02 80 00 0c be 40005530 40005504: 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))); 40005508: 11 10 00 98 sethi %hi(0x40026000), %o0 4000550c: 92 0e e0 ff and %i3, 0xff, %o1 40005510: 90 12 22 b8 or %o0, 0x2b8, %o0 40005514: 40 00 42 e5 call 400160a8 40005518: 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) || 4000551c: 80 a2 20 00 cmp %o0, 0 40005520: 02 80 00 06 be 40005538 40005524: 80 a7 20 00 cmp %i4, 0 ((is_fat_partition(part_desc->sys_type)) && (part_desc->size != 0))) { 40005528: 02 80 00 04 be 40005538 <== NEVER TAKEN 4000552c: 01 00 00 00 nop *new_part_desc = part_desc; 40005530: 10 80 00 04 b 40005540 40005534: fa 26 40 00 st %i5, [ %i1 ] } else { /* empty partition */ free(part_desc); 40005538: 40 00 03 87 call 40006354 4000553c: 90 10 00 1d mov %i5, %o0 } return RTEMS_SUCCESSFUL; 40005540: b0 10 20 00 clr %i0 } 40005544: 81 c7 e0 08 ret 40005548: 81 e8 00 00 restore =============================================================================== 40002ed0 : #endif #include "devfs.h" void devFS_Show(void) { 40002ed0: 9d e3 bf a0 save %sp, -96, %sp rtems_filesystem_location_info_t *rootloc = &rtems_filesystem_root->location; 40002ed4: 40 00 03 6e call 40003c8c 40002ed8: 01 00 00 00 nop if (rootloc->mt_entry->ops == &devFS_ops) { 40002edc: c2 02 20 04 ld [ %o0 + 4 ], %g1 40002ee0: 05 10 00 4b sethi %hi(0x40012c00), %g2 40002ee4: c2 00 60 14 ld [ %g1 + 0x14 ], %g1 40002ee8: 84 10 a3 ec or %g2, 0x3ec, %g2 40002eec: c6 00 60 0c ld [ %g1 + 0xc ], %g3 40002ef0: 80 a0 c0 02 cmp %g3, %g2 40002ef4: 12 80 00 26 bne 40002f8c <== NEVER TAKEN 40002ef8: 33 10 00 4c sethi %hi(0x40013000), %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; 40002efc: c2 00 60 10 ld [ %g1 + 0x10 ], %g1 const devFS_data *data = devFS_get_data(rootloc); size_t i = 0; size_t n = data->count; 40002f00: f4 00 60 04 ld [ %g1 + 4 ], %i2 40002f04: fa 00 40 00 ld [ %g1 ], %i5 size_t j = 0; size_t m = current->namelen; printk("/"); for (j = 0; j < m; ++j) { printk("%c", current->name [j]); 40002f08: 31 10 00 4c sethi %hi(0x40013000), %i0 } printk( 40002f0c: 21 10 00 4c sethi %hi(0x40013000), %l0 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) { 40002f10: b6 10 20 00 clr %i3 if (current->name != NULL) { size_t j = 0; size_t m = current->namelen; printk("/"); 40002f14: b2 16 60 40 or %i1, 0x40, %i1 for (j = 0; j < m; ++j) { printk("%c", current->name [j]); 40002f18: b0 16 20 48 or %i0, 0x48, %i0 } printk( 40002f1c: a0 14 20 50 or %l0, 0x50, %l0 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) { 40002f20: 80 a6 c0 1a cmp %i3, %i2 40002f24: 02 80 00 1a be 40002f8c 40002f28: 01 00 00 00 nop devFS_node *current = nodes + i; if (current->name != NULL) { 40002f2c: c2 07 40 00 ld [ %i5 ], %g1 40002f30: 80 a0 60 00 cmp %g1, 0 40002f34: 22 80 00 14 be,a 40002f84 40002f38: b6 06 e0 01 inc %i3 size_t j = 0; size_t m = current->namelen; 40002f3c: e2 07 60 04 ld [ %i5 + 4 ], %l1 printk("/"); 40002f40: 90 10 00 19 mov %i1, %o0 40002f44: 40 00 03 46 call 40003c5c 40002f48: b8 10 20 00 clr %i4 for (j = 0; j < m; ++j) { 40002f4c: 80 a7 00 11 cmp %i4, %l1 40002f50: 02 80 00 08 be 40002f70 40002f54: 90 10 00 18 mov %i0, %o0 printk("%c", current->name [j]); 40002f58: c2 07 40 00 ld [ %i5 ], %g1 40002f5c: d2 48 40 1c ldsb [ %g1 + %i4 ], %o1 40002f60: 40 00 03 3f call 40003c5c 40002f64: 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) { 40002f68: 10 bf ff fa b 40002f50 40002f6c: 80 a7 00 11 cmp %i4, %l1 printk("%c", current->name [j]); } printk( 40002f70: d2 07 60 08 ld [ %i5 + 8 ], %o1 40002f74: d4 07 60 0c ld [ %i5 + 0xc ], %o2 40002f78: 40 00 03 39 call 40003c5c 40002f7c: 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) { 40002f80: b6 06 e0 01 inc %i3 40002f84: 10 bf ff e7 b 40002f20 40002f88: ba 07 60 14 add %i5, 0x14, %i5 40002f8c: 81 c7 e0 08 ret 40002f90: 81 e8 00 00 restore =============================================================================== 4000cca4 : } void devFS_eval_path( rtems_filesystem_eval_path_context_t *ctx ) { 4000cca4: 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; 4000cca8: c2 06 20 2c ld [ %i0 + 0x2c ], %g1 return node; } void devFS_eval_path( rtems_filesystem_eval_path_context_t *ctx 4000ccac: e0 06 00 00 ld [ %i0 ], %l0 4000ccb0: c2 00 60 10 ld [ %g1 + 0x10 ], %g1 4000ccb4: f4 06 20 04 ld [ %i0 + 4 ], %i2 size_t pathlen, devFS_node **free_node_ptr ) { size_t i = 0; size_t n = data->count; 4000ccb8: e2 00 60 04 ld [ %g1 + 4 ], %l1 4000ccbc: fa 00 40 00 ld [ %g1 ], %i5 devFS_node *nodes = data->nodes; devFS_node *node = NULL; devFS_node *free_node = NULL; 4000ccc0: b8 10 20 00 clr %i4 ) { size_t i = 0; size_t n = data->count; devFS_node *nodes = data->nodes; devFS_node *node = NULL; 4000ccc4: b6 10 20 00 clr %i3 devFS_node *free_node = NULL; for (i = 0; (free_node == NULL || node == NULL) && i < n; ++i) { 4000ccc8: b2 10 20 00 clr %i1 4000cccc: 80 a6 e0 00 cmp %i3, 0 4000ccd0: 02 80 00 0a be 4000ccf8 4000ccd4: 80 a6 40 11 cmp %i1, %l1 4000ccd8: 80 a7 20 00 cmp %i4, 0 4000ccdc: 02 80 00 07 be 4000ccf8 <== NEVER TAKEN 4000cce0: 80 a6 40 11 cmp %i1, %l1 rtems_filesystem_eval_path_get_pathlen(ctx), &free_node ); int eval_flags = rtems_filesystem_eval_path_get_flags(ctx); if (node != NULL) { 4000cce4: 80 a6 e0 00 cmp %i3, 0 4000cce8: 12 80 00 19 bne 4000cd4c 4000ccec: c2 06 20 10 ld [ %i0 + 0x10 ], %g1 rtems_filesystem_eval_path_clear_path(ctx); } else { rtems_filesystem_eval_path_error(ctx, EEXIST); } } else { if ((eval_flags & RTEMS_FS_MAKE) != 0) { 4000ccf0: 10 80 00 1c b 4000cd60 4000ccf4: 80 88 60 20 btst 0x20, %g1 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) { 4000ccf8: 02 bf ff fc be 4000cce8 4000ccfc: 80 a6 e0 00 cmp %i3, 0 devFS_node *current = nodes + i; if (current->name != NULL) { 4000cd00: d0 07 40 00 ld [ %i5 ], %o0 4000cd04: 80 a2 20 00 cmp %o0, 0 4000cd08: 22 80 00 0e be,a 4000cd40 4000cd0c: b8 10 00 1d mov %i5, %i4 if ( 4000cd10: c2 07 60 04 ld [ %i5 + 4 ], %g1 4000cd14: 80 a0 40 1a cmp %g1, %i2 4000cd18: 32 80 00 0b bne,a 4000cd44 4000cd1c: b2 06 60 01 inc %i1 current->namelen == pathlen && memcmp(current->name, path, pathlen) == 0 4000cd20: 92 10 00 10 mov %l0, %o1 4000cd24: 40 00 09 d1 call 4000f468 4000cd28: 94 10 00 1a mov %i2, %o2 4000cd2c: 80 a2 20 00 cmp %o0, 0 4000cd30: 22 80 00 04 be,a 4000cd40 4000cd34: b6 10 00 1d mov %i5, %i3 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) { 4000cd38: 10 80 00 03 b 4000cd44 4000cd3c: b2 06 60 01 inc %i1 4000cd40: b2 06 60 01 inc %i1 4000cd44: 10 bf ff e2 b 4000cccc 4000cd48: ba 07 60 14 add %i5, 0x14, %i5 &free_node ); int eval_flags = rtems_filesystem_eval_path_get_flags(ctx); if (node != NULL) { if ((eval_flags & RTEMS_FS_EXCLUSIVE) == 0) { 4000cd4c: 80 88 60 40 btst 0x40, %g1 4000cd50: 12 80 00 12 bne 4000cd98 4000cd54: b2 10 20 11 mov 0x11, %i1 currentloc->node_access = node; 4000cd58: 10 80 00 0a b 4000cd80 4000cd5c: f6 26 20 20 st %i3, [ %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) { 4000cd60: 02 80 00 0d be 4000cd94 <== NEVER TAKEN 4000cd64: 80 a7 20 00 cmp %i4, 0 if (free_node != NULL) { 4000cd68: 02 80 00 09 be 4000cd8c 4000cd6c: 82 10 21 ff mov 0x1ff, %g1 free_node->mode = S_IRWXU | S_IRWXG | S_IRWXO; 4000cd70: c2 27 20 10 st %g1, [ %i4 + 0x10 ] currentloc->node_access = free_node; 4000cd74: f8 26 20 20 st %i4, [ %i0 + 0x20 ] rtems_filesystem_eval_path_context_t *ctx, const char *token, size_t tokenlen ) { ctx->token = token; 4000cd78: e0 26 20 08 st %l0, [ %i0 + 8 ] ctx->tokenlen = tokenlen; 4000cd7c: f4 26 20 0c st %i2, [ %i0 + 0xc ] static inline void rtems_filesystem_eval_path_clear_path( rtems_filesystem_eval_path_context_t *ctx ) { ctx->pathlen = 0; 4000cd80: c0 26 20 04 clr [ %i0 + 4 ] 4000cd84: 81 c7 e0 08 ret 4000cd88: 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); 4000cd8c: 10 80 00 03 b 4000cd98 4000cd90: b2 10 20 1c mov 0x1c, %i1 } } else { rtems_filesystem_eval_path_error(ctx, ENOENT); 4000cd94: b2 10 20 02 mov 2, %i1 <== NOT EXECUTED 4000cd98: 7f ff e3 09 call 400059bc 4000cd9c: 81 e8 00 00 restore =============================================================================== 400048f8 : const char *name, size_t namelen, mode_t mode, dev_t dev ) { 400048f8: 9d e3 bf a0 save %sp, -96, %sp int rv = 0; if (namelen != 3 || name [0] != 'd' || name [1] != 'e' || name [2] != 'v') { 400048fc: 80 a6 a0 03 cmp %i2, 3 40004900: 12 80 00 0e bne 40004938 40004904: 05 00 00 2c sethi %hi(0xb000), %g2 40004908: c2 4e 40 00 ldsb [ %i1 ], %g1 4000490c: 80 a0 60 64 cmp %g1, 0x64 40004910: 12 80 00 0b bne 4000493c <== NEVER TAKEN 40004914: 03 00 00 08 sethi %hi(0x2000), %g1 40004918: c2 4e 60 01 ldsb [ %i1 + 1 ], %g1 4000491c: 80 a0 60 65 cmp %g1, 0x65 40004920: 12 80 00 07 bne 4000493c <== NEVER TAKEN 40004924: 03 00 00 08 sethi %hi(0x2000), %g1 40004928: c2 4e 60 02 ldsb [ %i1 + 2 ], %g1 4000492c: 80 a0 60 76 cmp %g1, 0x76 40004930: 02 80 00 1a be 40004998 <== ALWAYS TAKEN 40004934: 03 00 00 3c sethi %hi(0xf000), %g1 if (S_ISBLK(mode) || S_ISCHR(mode)) { 40004938: 03 00 00 08 sethi %hi(0x2000), %g1 4000493c: 84 0e c0 02 and %i3, %g2, %g2 40004940: 80 a0 80 01 cmp %g2, %g1 40004944: 12 80 00 1a bne 400049ac 40004948: 01 00 00 00 nop char *dupname = malloc(namelen); 4000494c: 40 00 01 32 call 40004e14 40004950: 90 10 00 1a mov %i2, %o0 if (dupname != NULL) { 40004954: 84 92 20 00 orcc %o0, 0, %g2 40004958: 02 80 00 0c be 40004988 4000495c: 92 10 00 19 mov %i1, %o1 devFS_node *node = parentloc->node_access; 40004960: c2 06 20 08 ld [ %i0 + 8 ], %g1 node->name = dupname; 40004964: c4 20 40 00 st %g2, [ %g1 ] node->namelen = namelen; 40004968: f4 20 60 04 st %i2, [ %g1 + 4 ] node->major = rtems_filesystem_dev_major_t(dev); 4000496c: f8 20 60 08 st %i4, [ %g1 + 8 ] node->minor = rtems_filesystem_dev_minor_t(dev); 40004970: fa 20 60 0c st %i5, [ %g1 + 0xc ] node->mode = mode; 40004974: f6 20 60 10 st %i3, [ %g1 + 0x10 ] memcpy(dupname, name, namelen); 40004978: 40 00 2a e6 call 4000f510 4000497c: 94 10 00 1a mov %i2, %o2 size_t namelen, mode_t mode, dev_t dev ) { int rv = 0; 40004980: 81 c7 e0 08 ret 40004984: 91 e8 20 00 restore %g0, 0, %o0 node->major = rtems_filesystem_dev_major_t(dev); node->minor = rtems_filesystem_dev_minor_t(dev); node->mode = mode; memcpy(dupname, name, namelen); } else { errno = ENOMEM; 40004988: 40 00 2a 8a call 4000f3b0 <__errno> 4000498c: 01 00 00 00 nop 40004990: 10 80 00 0a b 400049b8 40004994: 82 10 20 0c mov 0xc, %g1 ! c <_TLS_Alignment+0xb> } else { errno = ENOTSUP; rv = -1; } } else { if (!S_ISDIR(mode)) { 40004998: b6 0e c0 01 and %i3, %g1, %i3 4000499c: 03 00 00 10 sethi %hi(0x4000), %g1 400049a0: 80 a6 c0 01 cmp %i3, %g1 400049a4: 22 80 00 07 be,a 400049c0 <== ALWAYS TAKEN 400049a8: b0 10 20 00 clr %i0 } else { errno = ENOMEM; rv = -1; } } else { errno = ENOTSUP; 400049ac: 40 00 2a 81 call 4000f3b0 <__errno> 400049b0: 01 00 00 00 nop 400049b4: 82 10 20 86 mov 0x86, %g1 ! 86 <_TLS_Alignment+0x85> 400049b8: c2 22 00 00 st %g1, [ %o0 ] 400049bc: b0 10 3f ff mov -1, %i0 rv = -1; } } return rv; } 400049c0: 81 c7 e0 08 ret 400049c4: 81 e8 00 00 restore =============================================================================== 40003a10 : static rtems_interrupt_lock diskdevs_lock = RTEMS_INTERRUPT_LOCK_INITIALIZER("diskdevs"); static rtems_status_code disk_lock(void) { 40003a10: 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); 40003a14: 03 10 00 70 sethi %hi(0x4001c000), %g1 40003a18: d0 00 62 7c ld [ %g1 + 0x27c ], %o0 ! 4001c27c 40003a1c: 92 10 20 00 clr %o1 40003a20: 94 10 20 00 clr %o2 40003a24: 40 00 14 57 call 40008b80 40003a28: b0 10 20 16 mov 0x16, %i0 if (sc == RTEMS_SUCCESSFUL) { 40003a2c: 80 a2 20 00 cmp %o0, 0 40003a30: 12 80 00 05 bne 40003a44 <== NEVER TAKEN 40003a34: 84 10 20 01 mov 1, %g2 diskdevs_protected = true; 40003a38: 03 10 00 70 sethi %hi(0x4001c000), %g1 return RTEMS_SUCCESSFUL; 40003a3c: 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; 40003a40: c4 28 62 78 stb %g2, [ %g1 + 0x278 ] return RTEMS_SUCCESSFUL; } else { return RTEMS_NOT_CONFIGURED; } } 40003a44: 81 c7 e0 08 ret 40003a48: 81 e8 00 00 restore =============================================================================== 40003be0 : } } static void disk_unlock(void) { 40003be0: 9d e3 bf a0 save %sp, -96, %sp rtems_status_code sc = RTEMS_SUCCESSFUL; diskdevs_protected = false; 40003be4: 03 10 00 70 sethi %hi(0x4001c000), %g1 40003be8: c0 28 62 78 clrb [ %g1 + 0x278 ] ! 4001c278 sc = rtems_semaphore_release(diskdevs_mutex); 40003bec: 03 10 00 70 sethi %hi(0x4001c000), %g1 40003bf0: 40 00 14 2c call 40008ca0 40003bf4: d0 00 62 7c ld [ %g1 + 0x27c ], %o0 ! 4001c27c if (sc != RTEMS_SUCCESSFUL) { 40003bf8: 80 a2 20 00 cmp %o0, 0 40003bfc: 02 80 00 04 be 40003c0c <== ALWAYS TAKEN 40003c00: 11 37 ab 6f sethi %hi(0xdeadbc00), %o0 /* FIXME: Error number */ rtems_fatal_error_occurred(0xdeadbeef); 40003c04: 40 00 15 87 call 40009220 <== NOT EXECUTED 40003c08: 90 12 22 ef or %o0, 0x2ef, %o0 ! deadbeef <== NOT EXECUTED 40003c0c: 81 c7 e0 08 ret 40003c10: 81 e8 00 00 restore =============================================================================== 40004f58 : /* * Drain output queue */ static void drainOutput (struct rtems_termios_tty *tty) 40004f58: 9d e3 bf 98 save %sp, -104, %sp rtems_status_code sc; if (tty->device.outputUsesInterrupts != TERMIOS_POLLED) { rtems_termios_interrupt_lock_acquire (tty, &lock_context); while (tty->rawOutBuf.Tail != tty->rawOutBuf.Head) { tty->rawOutBufState = rob_wait; 40004f5c: ba 10 20 02 mov 2, %i5 { rtems_interrupt_lock_context lock_context; rtems_status_code sc; if (tty->device.outputUsesInterrupts != TERMIOS_POLLED) { rtems_termios_interrupt_lock_acquire (tty, &lock_context); 40004f60: 7f ff ff 5d call 40004cd4 <_ISR_lock_ISR_disable_and_acquire.isra.2> 40004f64: 90 07 bf fc add %fp, -4, %o0 while (tty->rawOutBuf.Tail != tty->rawOutBuf.Head) { 40004f68: c4 06 20 84 ld [ %i0 + 0x84 ], %g2 40004f6c: c2 06 20 80 ld [ %i0 + 0x80 ], %g1 40004f70: 80 a0 80 01 cmp %g2, %g1 40004f74: 02 80 00 0d be 40004fa8 <== ALWAYS TAKEN 40004f78: 90 07 bf fc add %fp, -4, %o0 tty->rawOutBufState = rob_wait; rtems_termios_interrupt_lock_release (tty, &lock_context); 40004f7c: 7f ff ff 5c call 40004cec <_ISR_lock_Release_and_ISR_enable.isra.3><== NOT EXECUTED 40004f80: fa 26 20 94 st %i5, [ %i0 + 0x94 ] <== NOT EXECUTED sc = rtems_semaphore_obtain( 40004f84: d0 06 20 8c ld [ %i0 + 0x8c ], %o0 <== NOT EXECUTED 40004f88: 92 10 20 00 clr %o1 <== NOT EXECUTED 40004f8c: 40 00 09 b5 call 40007660 <== NOT EXECUTED 40004f90: 94 10 20 00 clr %o2 <== NOT EXECUTED tty->rawOutBuf.Semaphore, RTEMS_WAIT, RTEMS_NO_TIMEOUT); if (sc != RTEMS_SUCCESSFUL) 40004f94: 80 a2 20 00 cmp %o0, 0 <== NOT EXECUTED 40004f98: 02 bf ff f2 be 40004f60 <== NOT EXECUTED 40004f9c: 01 00 00 00 nop <== NOT EXECUTED rtems_fatal_error_occurred (sc); 40004fa0: 40 00 0b 79 call 40007d84 <== NOT EXECUTED 40004fa4: 01 00 00 00 nop <== NOT EXECUTED rtems_termios_interrupt_lock_acquire (tty, &lock_context); } rtems_termios_interrupt_lock_release (tty, &lock_context); 40004fa8: 7f ff ff 51 call 40004cec <_ISR_lock_Release_and_ISR_enable.isra.3> 40004fac: 90 07 bf fc add %fp, -4, %o0 40004fb0: 81 c7 e0 08 ret 40004fb4: 81 e8 00 00 restore =============================================================================== 40004004 : int dup( int fildes ) { return fcntl( fildes, F_DUPFD, 0 ); 40004004: 92 10 20 00 clr %o1 40004008: 94 10 20 00 clr %o2 4000400c: 82 13 c0 00 mov %o7, %g1 40004010: 40 00 00 17 call 4000406c 40004014: 9e 10 40 00 mov %g1, %o7 40004018: 40 00 40 e0 call 40014398 <__call_exitprocs+0x144> <== NOT EXECUTED 4000401c: 40 00 42 a4 call 40014aac <__sfvwrite_r+0x48c> <== NOT EXECUTED 40004020: 40 00 42 b0 call 40014ae0 <__sfvwrite_r+0x4c0> <== NOT EXECUTED 40004024: 40 00 42 c8 call 40014b44 <_setlocale_r+0x38> <== NOT EXECUTED 40004028: 40 00 42 d8 call 40014b88 <__locale_charset+0x4> <== NOT EXECUTED 4000402c: 40 00 42 fc call 40014c1c <== NOT EXECUTED 40004030: 40 00 42 fc call 40014c20 <== NOT EXECUTED 40004034: 40 00 42 fc call 40014c24 <== NOT EXECUTED 40004038: 40 00 42 fc call 40014c28 <== NOT EXECUTED 4000403c: 40 00 42 fc call 40014c2c <== NOT EXECUTED 40004040: 40 00 43 0c call 40014c70 <== NOT EXECUTED 40004044: 40 00 43 0c call 40014c74 <== NOT EXECUTED 40004048: 40 00 43 0c call 40014c78 <== NOT EXECUTED 4000404c: 40 00 43 0c call 40014c7c <== NOT EXECUTED 40004050: 40 00 43 0c call 40014c80 <== NOT EXECUTED 40004054: 40 00 43 0c call 40014c84 <== NOT EXECUTED 40004058: 40 00 43 0c call 40014c88 <== NOT EXECUTED 4000405c: 40 00 43 0c call 40014c8c <== NOT EXECUTED 40004060: 40 00 43 0c call 40014c90 <== NOT EXECUTED 40004064: 40 00 43 0c call 40014c94 <== NOT EXECUTED 40004068: 40 00 41 bc call 40014758 <__sfvwrite_r+0x138> <== NOT EXECUTED =============================================================================== 40005cd8 : /* * Echo a typed character */ static void echo (unsigned char c, struct rtems_termios_tty *tty) { 40005cd8: 9d e3 bf 98 save %sp, -104, %sp if ((tty->termios.c_lflag & ECHOCTL) && 40005cdc: c2 06 60 3c ld [ %i1 + 0x3c ], %g1 40005ce0: 80 88 62 00 btst 0x200, %g1 40005ce4: 02 80 00 19 be 40005d48 <== NEVER TAKEN 40005ce8: 03 10 00 5b sethi %hi(0x40016c00), %g1 iscntrl(c) && (c != '\t') && (c != '\n')) { 40005cec: c2 00 61 0c ld [ %g1 + 0x10c ], %g1 ! 40016d0c <__ctype_ptr__> 40005cf0: 82 00 40 18 add %g1, %i0, %g1 40005cf4: 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) && 40005cf8: 80 88 60 20 btst 0x20, %g1 40005cfc: 02 80 00 14 be 40005d4c 40005d00: 90 10 00 18 mov %i0, %o0 iscntrl(c) && (c != '\t') && (c != '\n')) { 40005d04: 82 06 3f f7 add %i0, -9, %g1 40005d08: 82 08 60 ff and %g1, 0xff, %g1 40005d0c: 80 a0 60 01 cmp %g1, 1 40005d10: 08 80 00 0f bleu 40005d4c 40005d14: 82 10 20 5e mov 0x5e, %g1 char echobuf[2]; echobuf[0] = '^'; echobuf[1] = c ^ 0x40; 40005d18: 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] = '^'; 40005d1c: c2 2f bf f8 stb %g1, [ %fp + -8 ] echobuf[1] = c ^ 0x40; 40005d20: f0 2f bf f9 stb %i0, [ %fp + -7 ] rtems_termios_puts (echobuf, 2, tty); 40005d24: 90 07 bf f8 add %fp, -8, %o0 40005d28: 92 10 20 02 mov 2, %o1 40005d2c: 7f ff ff 47 call 40005a48 40005d30: 94 10 00 19 mov %i1, %o2 tty->column += 2; 40005d34: c2 06 60 28 ld [ %i1 + 0x28 ], %g1 40005d38: 82 00 60 02 add %g1, 2, %g1 40005d3c: c2 26 60 28 st %g1, [ %i1 + 0x28 ] 40005d40: 81 c7 e0 08 ret 40005d44: 81 e8 00 00 restore } else { oproc (c, tty); 40005d48: 90 10 00 18 mov %i0, %o0 <== NOT EXECUTED 40005d4c: 7f ff ff 87 call 40005b68 40005d50: 92 10 00 19 mov %i1, %o1 40005d54: 81 c7 e0 08 ret 40005d58: 81 e8 00 00 restore =============================================================================== 40004780 : } void endgrent(void) { if (group_fp != NULL) 40004780: 03 10 00 65 sethi %hi(0x40019400), %g1 40004784: d0 00 63 d8 ld [ %g1 + 0x3d8 ], %o0 ! 400197d8 40004788: 80 a2 20 00 cmp %o0, 0 4000478c: 02 80 00 05 be 400047a0 <== NEVER TAKEN 40004790: 01 00 00 00 nop fclose(group_fp); 40004794: 82 13 c0 00 mov %o7, %g1 40004798: 40 00 30 72 call 40010960 4000479c: 9e 10 40 00 mov %g1, %o7 400047a0: 81 c3 e0 08 retl <== NOT EXECUTED =============================================================================== 400045e0 : } void endpwent(void) { if (passwd_fp != NULL) 400045e0: 03 10 00 66 sethi %hi(0x40019800), %g1 400045e4: d0 00 60 c0 ld [ %g1 + 0xc0 ], %o0 ! 400198c0 400045e8: 80 a2 20 00 cmp %o0, 0 400045ec: 02 80 00 05 be 40004600 <== NEVER TAKEN 400045f0: 01 00 00 00 nop fclose(passwd_fp); 400045f4: 82 13 c0 00 mov %o7, %g1 400045f8: 40 00 30 da call 40010960 400045fc: 9e 10 40 00 mov %g1, %o7 40004600: 81 c3 e0 08 retl <== NOT EXECUTED =============================================================================== 40005d5c : * 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) { 40005d5c: 9d e3 bf a0 save %sp, -96, %sp if (tty->ccount == 0) 40005d60: c2 06 20 20 ld [ %i0 + 0x20 ], %g1 40005d64: 80 a0 60 00 cmp %g1, 0 40005d68: 02 80 00 0f be 40005da4 40005d6c: ba 10 00 18 mov %i0, %i5 return; if (lineFlag) { 40005d70: 80 a6 60 00 cmp %i1, 0 40005d74: 32 80 00 08 bne,a 40005d94 40005d78: c2 06 20 3c ld [ %i0 + 0x3c ], %g1 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); 40005d7c: 35 10 00 57 sethi %hi(0x40015c00), %i2 /* * Back up over the tab */ while (tty->column > col) { rtems_termios_puts ("\b", 1, tty); 40005d80: 31 10 00 57 sethi %hi(0x40015c00), %i0 40005d84: 37 10 00 5b sethi %hi(0x40016c00), %i3 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); 40005d88: b4 16 a0 58 or %i2, 0x58, %i2 /* * Back up over the tab */ while (tty->column > col) { rtems_termios_puts ("\b", 1, tty); 40005d8c: 10 80 00 15 b 40005de0 40005d90: b0 16 20 50 or %i0, 0x50, %i0 erase (struct rtems_termios_tty *tty, int lineFlag) { if (tty->ccount == 0) return; if (lineFlag) { if (!(tty->termios.c_lflag & ECHO)) { 40005d94: 80 88 60 08 btst 8, %g1 40005d98: 32 80 00 05 bne,a 40005dac <== ALWAYS TAKEN 40005d9c: 80 88 60 10 btst 0x10, %g1 tty->ccount = 0; 40005da0: c0 26 20 20 clr [ %i0 + 0x20 ] <== NOT EXECUTED return; 40005da4: 81 c7 e0 08 ret 40005da8: 81 e8 00 00 restore } if (!(tty->termios.c_lflag & ECHOE)) { 40005dac: 12 bf ff f5 bne 40005d80 <== ALWAYS TAKEN 40005db0: 35 10 00 57 sethi %hi(0x40015c00), %i2 tty->ccount = 0; echo (tty->termios.c_cc[VKILL], tty); 40005db4: 10 80 00 11 b 40005df8 <== NOT EXECUTED 40005db8: d0 0e 20 44 ldub [ %i0 + 0x44 ], %o0 <== NOT EXECUTED } while (tty->ccount) { unsigned char c = tty->cbuf[--tty->ccount]; if (tty->termios.c_lflag & ECHO) { 40005dbc: c2 07 60 3c ld [ %i5 + 0x3c ], %g1 return; } } while (tty->ccount) { unsigned char c = tty->cbuf[--tty->ccount]; 40005dc0: 86 00 ff ff add %g3, -1, %g3 40005dc4: c6 27 60 20 st %g3, [ %i5 + 0x20 ] if (tty->termios.c_lflag & ECHO) { 40005dc8: 80 88 60 08 btst 8, %g1 40005dcc: 12 80 00 13 bne 40005e18 <== ALWAYS TAKEN 40005dd0: f8 09 00 03 ldub [ %g4 + %g3 ], %i4 if (tty->column) tty->column--; } } } if (!lineFlag) 40005dd4: 80 a6 60 00 cmp %i1, 0 40005dd8: 02 80 00 66 be 40005f70 40005ddc: 01 00 00 00 nop echo ('\n', tty); return; } } while (tty->ccount) { 40005de0: c6 07 60 20 ld [ %i5 + 0x20 ], %g3 40005de4: 80 a0 e0 00 cmp %g3, 0 40005de8: 32 bf ff f5 bne,a 40005dbc 40005dec: c8 07 60 1c ld [ %i5 + 0x1c ], %g4 40005df0: 81 c7 e0 08 ret 40005df4: 81 e8 00 00 restore if (!(tty->termios.c_lflag & ECHO)) { tty->ccount = 0; return; } if (!(tty->termios.c_lflag & ECHOE)) { tty->ccount = 0; 40005df8: c0 26 20 20 clr [ %i0 + 0x20 ] <== NOT EXECUTED echo (tty->termios.c_cc[VKILL], tty); 40005dfc: 7f ff ff b7 call 40005cd8 <== NOT EXECUTED 40005e00: 92 10 00 18 mov %i0, %o1 <== NOT EXECUTED if (tty->termios.c_lflag & ECHOK) 40005e04: c2 06 20 3c ld [ %i0 + 0x3c ], %g1 <== NOT EXECUTED 40005e08: 80 88 60 20 btst 0x20, %g1 <== NOT EXECUTED 40005e0c: 02 bf ff e6 be 40005da4 <== NOT EXECUTED 40005e10: b0 10 20 0a mov 0xa, %i0 <== NOT EXECUTED 40005e14: 30 80 00 08 b,a 40005e34 <== NOT EXECUTED while (tty->ccount) { unsigned char c = tty->cbuf[--tty->ccount]; if (tty->termios.c_lflag & ECHO) { if (!lineFlag && !(tty->termios.c_lflag & ECHOE)) { 40005e18: 80 a6 60 00 cmp %i1, 0 40005e1c: 32 80 00 08 bne,a 40005e3c 40005e20: b8 0f 20 ff and %i4, 0xff, %i4 40005e24: 80 88 60 10 btst 0x10, %g1 40005e28: 32 80 00 05 bne,a 40005e3c <== ALWAYS TAKEN 40005e2c: b8 0f 20 ff and %i4, 0xff, %i4 echo (tty->termios.c_cc[VERASE], tty); 40005e30: f0 0f 60 43 ldub [ %i5 + 0x43 ], %i0 <== NOT EXECUTED 40005e34: 7f ff ff a9 call 40005cd8 <== NOT EXECUTED 40005e38: 93 e8 00 1d restore %g0, %i5, %o1 <== NOT EXECUTED } else if (c == '\t') { 40005e3c: 80 a7 20 09 cmp %i4, 9 40005e40: 12 80 00 26 bne 40005ed8 40005e44: c4 06 e1 0c ld [ %i3 + 0x10c ], %g2 int col = tty->read_start_column; 40005e48: 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)) { 40005e4c: da 06 e1 0c ld [ %i3 + 0x10c ], %o5 40005e50: 84 10 20 00 clr %g2 if (tty->termios.c_lflag & ECHOCTL) 40005e54: 82 08 62 00 and %g1, 0x200, %g1 int i = 0; /* * Find the character before the tab */ while (i != tty->ccount) { 40005e58: 80 a0 80 03 cmp %g2, %g3 40005e5c: 22 80 00 15 be,a 40005eb0 40005e60: c2 07 60 28 ld [ %i5 + 0x28 ], %g1 c = tty->cbuf[i++]; if (c == '\t') { 40005e64: de 09 00 02 ldub [ %g4 + %g2 ], %o7 40005e68: 80 a3 e0 09 cmp %o7, 9 40005e6c: 32 80 00 04 bne,a 40005e7c 40005e70: 9e 03 40 0f add %o5, %o7, %o7 col = (col | 7) + 1; 40005e74: 10 80 00 0b b 40005ea0 40005e78: b8 17 20 07 or %i4, 7, %i4 } else if (iscntrl (c)) { 40005e7c: de 0b e0 01 ldub [ %o7 + 1 ], %o7 40005e80: 80 8b e0 20 btst 0x20, %o7 40005e84: 22 80 00 08 be,a 40005ea4 <== ALWAYS TAKEN 40005e88: b8 07 20 01 inc %i4 if (tty->termios.c_lflag & ECHOCTL) 40005e8c: 80 a0 60 00 cmp %g1, 0 <== NOT EXECUTED 40005e90: 32 80 00 05 bne,a 40005ea4 <== NOT EXECUTED 40005e94: b8 07 20 02 add %i4, 2, %i4 <== NOT EXECUTED 40005e98: 10 bf ff f0 b 40005e58 <== NOT EXECUTED 40005e9c: 84 00 a0 01 inc %g2 <== NOT EXECUTED col += 2; } else { col++; 40005ea0: b8 07 20 01 inc %i4 40005ea4: 10 bf ff ed b 40005e58 40005ea8: 84 00 a0 01 inc %g2 } /* * Back up over the tab */ while (tty->column > col) { 40005eac: c2 07 60 28 ld [ %i5 + 0x28 ], %g1 40005eb0: 80 a0 40 1c cmp %g1, %i4 40005eb4: 04 bf ff c8 ble 40005dd4 40005eb8: 90 10 00 18 mov %i0, %o0 rtems_termios_puts ("\b", 1, tty); 40005ebc: 92 10 20 01 mov 1, %o1 40005ec0: 7f ff fe e2 call 40005a48 40005ec4: 94 10 00 1d mov %i5, %o2 tty->column--; 40005ec8: c2 07 60 28 ld [ %i5 + 0x28 ], %g1 40005ecc: 82 00 7f ff add %g1, -1, %g1 40005ed0: 10 bf ff f7 b 40005eac 40005ed4: c2 27 60 28 st %g1, [ %i5 + 0x28 ] } } else { if (iscntrl (c) && (tty->termios.c_lflag & ECHOCTL)) { 40005ed8: b8 07 20 01 inc %i4 40005edc: c4 08 80 1c ldub [ %g2 + %i4 ], %g2 40005ee0: 80 88 a0 20 btst 0x20, %g2 40005ee4: 22 80 00 10 be,a 40005f24 <== ALWAYS TAKEN 40005ee8: c2 06 e1 0c ld [ %i3 + 0x10c ], %g1 40005eec: 80 88 62 00 btst 0x200, %g1 <== NOT EXECUTED 40005ef0: 02 80 00 0d be 40005f24 <== NOT EXECUTED 40005ef4: c2 06 e1 0c ld [ %i3 + 0x10c ], %g1 <== NOT EXECUTED rtems_termios_puts ("\b \b", 3, tty); 40005ef8: 90 10 00 1a mov %i2, %o0 <== NOT EXECUTED 40005efc: 92 10 20 03 mov 3, %o1 <== NOT EXECUTED 40005f00: 7f ff fe d2 call 40005a48 <== NOT EXECUTED 40005f04: 94 10 00 1d mov %i5, %o2 <== NOT EXECUTED if (tty->column) 40005f08: c2 07 60 28 ld [ %i5 + 0x28 ], %g1 <== NOT EXECUTED 40005f0c: 80 a0 60 00 cmp %g1, 0 <== NOT EXECUTED 40005f10: 22 80 00 05 be,a 40005f24 <== NOT EXECUTED 40005f14: c2 06 e1 0c ld [ %i3 + 0x10c ], %g1 <== NOT EXECUTED tty->column--; 40005f18: 82 00 7f ff add %g1, -1, %g1 <== NOT EXECUTED 40005f1c: c2 27 60 28 st %g1, [ %i5 + 0x28 ] <== NOT EXECUTED } if (!iscntrl (c) || (tty->termios.c_lflag & ECHOCTL)) { 40005f20: c2 06 e1 0c ld [ %i3 + 0x10c ], %g1 <== NOT EXECUTED 40005f24: c2 08 40 1c ldub [ %g1 + %i4 ], %g1 40005f28: 80 88 60 20 btst 0x20, %g1 40005f2c: 02 80 00 07 be 40005f48 <== ALWAYS TAKEN 40005f30: 90 10 00 1a mov %i2, %o0 40005f34: c2 07 60 3c ld [ %i5 + 0x3c ], %g1 <== NOT EXECUTED 40005f38: 80 88 62 00 btst 0x200, %g1 <== NOT EXECUTED 40005f3c: 02 bf ff a7 be 40005dd8 <== NOT EXECUTED 40005f40: 80 a6 60 00 cmp %i1, 0 <== NOT EXECUTED rtems_termios_puts ("\b \b", 3, tty); 40005f44: 90 10 00 1a mov %i2, %o0 <== NOT EXECUTED 40005f48: 92 10 20 03 mov 3, %o1 40005f4c: 7f ff fe bf call 40005a48 40005f50: 94 10 00 1d mov %i5, %o2 if (tty->column) 40005f54: c2 07 60 28 ld [ %i5 + 0x28 ], %g1 40005f58: 80 a0 60 00 cmp %g1, 0 40005f5c: 02 bf ff 9f be 40005dd8 <== NEVER TAKEN 40005f60: 80 a6 60 00 cmp %i1, 0 tty->column--; 40005f64: 82 00 7f ff add %g1, -1, %g1 40005f68: 10 bf ff 9c b 40005dd8 40005f6c: c2 27 60 28 st %g1, [ %i5 + 0x28 ] 40005f70: 81 c7 e0 08 ret 40005f74: 81 e8 00 00 restore =============================================================================== 40013060 : int fat_buf_access(fat_fs_info_t *fs_info, const uint32_t sec_num, const int op_type, uint8_t **sec_buf) { 40013060: 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); 40013064: c2 0e 20 02 ldub [ %i0 + 2 ], %g1 40013068: c4 0e 20 0c ldub [ %i0 + 0xc ], %g2 4001306c: 84 20 80 01 sub %g2, %g1, %g2 40013070: 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); 40013074: 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 - 40013078: 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); 4001307c: 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) 40013080: c2 0e 20 89 ldub [ %i0 + 0x89 ], %g1 40013084: 80 a0 60 00 cmp %g1, 0 40013088: 02 80 00 06 be 400130a0 4001308c: 01 00 00 00 nop 40013090: c2 06 20 84 ld [ %i0 + 0x84 ], %g1 40013094: 80 a0 40 19 cmp %g1, %i1 40013098: 22 80 00 1c be,a 40013108 4001309c: c2 06 20 8c ld [ %i0 + 0x8c ], %g1 { fat_buf_release(fs_info); 400130a0: 7f ff ff 7f call 40012e9c 400130a4: 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); 400130a8: 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) 400130ac: 80 a6 a0 01 cmp %i2, 1 400130b0: d0 06 20 64 ld [ %i0 + 0x64 ], %o0 400130b4: 12 80 00 06 bne 400130cc 400130b8: 94 06 20 8c add %i0, 0x8c, %o2 sc = rtems_bdbuf_read(fs_info->vol.dd, blk, &fs_info->c.buf); 400130bc: 7f ff f6 e6 call 40010c54 400130c0: 01 00 00 00 nop 400130c4: 10 80 00 05 b 400130d8 400130c8: 80 a2 20 00 cmp %o0, 0 else sc = rtems_bdbuf_get(fs_info->vol.dd, blk, &fs_info->c.buf); 400130cc: 7f ff f6 be call 40010bc4 400130d0: 01 00 00 00 nop if (sc != RTEMS_SUCCESSFUL) 400130d4: 80 a2 20 00 cmp %o0, 0 400130d8: 02 80 00 08 be 400130f8 <== ALWAYS TAKEN 400130dc: 82 10 20 01 mov 1, %g1 rtems_set_errno_and_return_minus_one(EIO); 400130e0: 40 00 24 eb call 4001c48c <__errno> <== NOT EXECUTED 400130e4: b0 10 3f ff mov -1, %i0 <== NOT EXECUTED 400130e8: 82 10 20 05 mov 5, %g1 <== NOT EXECUTED 400130ec: c2 22 00 00 st %g1, [ %o0 ] <== NOT EXECUTED 400130f0: 81 c7 e0 08 ret <== NOT EXECUTED 400130f4: 81 e8 00 00 restore <== NOT EXECUTED fs_info->c.blk_num = sec_num; 400130f8: f2 26 20 84 st %i1, [ %i0 + 0x84 ] fs_info->c.modified = 0; 400130fc: c0 2e 20 88 clrb [ %i0 + 0x88 ] fs_info->c.state = FAT_CACHE_ACTUAL; 40013100: c2 2e 20 89 stb %g1, [ %i0 + 0x89 ] } *sec_buf = &fs_info->c.buf->buffer[blk_ofs]; 40013104: c2 06 20 8c ld [ %i0 + 0x8c ], %g1 40013108: c2 00 60 1c ld [ %g1 + 0x1c ], %g1 4001310c: b8 00 40 1c add %g1, %i4, %i4 40013110: f8 26 c0 00 st %i4, [ %i3 ] return RC_OK; } 40013114: 81 c7 e0 08 ret 40013118: 91 e8 20 00 restore %g0, 0, %o0 =============================================================================== 40012e9c : return RC_OK; } int fat_buf_release(fat_fs_info_t *fs_info) { 40012e9c: 9d e3 bf 98 save %sp, -104, %sp rtems_status_code sc = RTEMS_SUCCESSFUL; if (fs_info->c.state == FAT_CACHE_EMPTY) 40012ea0: c2 0e 20 89 ldub [ %i0 + 0x89 ], %g1 return RC_OK; } int fat_buf_release(fat_fs_info_t *fs_info) { 40012ea4: ba 10 00 18 mov %i0, %i5 rtems_status_code sc = RTEMS_SUCCESSFUL; if (fs_info->c.state == FAT_CACHE_EMPTY) 40012ea8: 80 a0 60 00 cmp %g1, 0 40012eac: 02 80 00 6b be 40013058 40012eb0: b0 10 20 00 clr %i0 return RC_OK; if (fs_info->c.modified) 40012eb4: c2 0f 60 88 ldub [ %i5 + 0x88 ], %g1 40012eb8: 80 a0 60 00 cmp %g1, 0 40012ebc: 02 80 00 5a be 40013024 40012ec0: d0 07 60 8c ld [ %i5 + 0x8c ], %o0 { uint32_t sec_num = fs_info->c.blk_num; 40012ec4: c2 07 60 84 ld [ %i5 + 0x84 ], %g1 bool sec_of_fat = ((sec_num >= fs_info->vol.fat_loc) && 40012ec8: c4 17 60 18 lduh [ %i5 + 0x18 ], %g2 40012ecc: 80 a0 40 02 cmp %g1, %g2 40012ed0: 0a 80 00 05 bcs 40012ee4 40012ed4: b8 10 20 00 clr %i4 40012ed8: c4 07 60 20 ld [ %i5 + 0x20 ], %g2 40012edc: 80 a0 40 02 cmp %g1, %g2 40012ee0: b8 40 20 00 addx %g0, 0, %i4 } static inline uint32_t fat_sector_offset_to_block_offset (const fat_fs_info_t *fs_info, 40012ee4: 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) 40012ee8: 80 a7 20 00 cmp %i4, 0 40012eec: 02 80 00 11 be 40012f30 40012ef0: c6 0f 60 0c ldub [ %i5 + 0xc ], %g3 40012ef4: c8 0f 60 54 ldub [ %i5 + 0x54 ], %g4 40012ef8: 80 a1 20 00 cmp %g4, 0 40012efc: 12 80 00 0d bne 40012f30 <== NEVER TAKEN 40012f00: 84 08 a0 ff and %g2, 0xff, %g2 memcpy(fs_info->sec_buf, 40012f04: d2 02 20 1c ld [ %o0 + 0x1c ], %o1 40012f08: d4 17 40 00 lduh [ %i5 ], %o2 40012f0c: d0 07 60 90 ld [ %i5 + 0x90 ], %o0 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); 40012f10: 86 08 e0 ff and %g3, 0xff, %g3 40012f14: 86 20 c0 02 sub %g3, %g2, %g3 40012f18: 89 30 40 03 srl %g1, %g3, %g4 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); 40012f1c: 87 29 00 03 sll %g4, %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 - 40012f20: 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); 40012f24: 85 28 40 02 sll %g1, %g2, %g2 40012f28: 40 00 27 ae call 4001cde0 40012f2c: 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); 40012f30: 7f ff f7 ed call 40010ee4 40012f34: d0 07 60 8c ld [ %i5 + 0x8c ], %o0 if (sc != RTEMS_SUCCESSFUL) 40012f38: 80 a2 20 00 cmp %o0, 0 40012f3c: 12 80 00 3f bne 40013038 <== NEVER TAKEN 40012f40: 80 a7 20 00 cmp %i4, 0 rtems_set_errno_and_return_minus_one(EIO); fs_info->c.modified = 0; if (sec_of_fat && !fs_info->vol.mirror) 40012f44: 02 80 00 43 be 40013050 40012f48: c0 2f 60 88 clrb [ %i5 + 0x88 ] 40012f4c: c2 0f 60 54 ldub [ %i5 + 0x54 ], %g1 40012f50: 80 a0 60 00 cmp %g1, 0 40012f54: 32 80 00 40 bne,a 40013054 <== NEVER TAKEN 40012f58: c0 2f 60 89 clrb [ %i5 + 0x89 ] <== NOT EXECUTED 40012f5c: b8 10 20 01 mov 1, %i4 { uint8_t i; for (i = 1; i < fs_info->vol.fats; i++) 40012f60: c2 0f 60 0d ldub [ %i5 + 0xd ], %g1 40012f64: 90 0f 20 ff and %i4, 0xff, %o0 40012f68: 80 a2 00 01 cmp %o0, %g1 40012f6c: 3a 80 00 3a bcc,a 40013054 40012f70: c0 2f 60 89 clrb [ %i5 + 0x89 ] { rtems_bdbuf_buffer *bd; sec_num = fs_info->c.blk_num + fs_info->vol.fat_length * i, 40012f74: 7f ff bd e7 call 40002710 <.umul> 40012f78: d2 07 60 1c ld [ %i5 + 0x1c ], %o1 40012f7c: 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); 40012f80: c2 0f 60 02 ldub [ %i5 + 2 ], %g1 40012f84: 90 02 00 1b add %o0, %i3, %o0 40012f88: f6 0f 60 0c ldub [ %i5 + 0xc ], %i3 0); if (blk_ofs == 0 && fs_info->vol.bps == fs_info->vol.bytes_per_block) { sc = rtems_bdbuf_get(fs_info->vol.dd, blk, &bd); 40012f8c: 94 07 bf fc add %fp, -4, %o2 40012f90: b6 26 c0 01 sub %i3, %g1, %i3 40012f94: 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); 40012f98: 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 - 40012f9c: 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); 40012fa0: 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 40012fa4: 80 a6 e0 00 cmp %i3, 0 40012fa8: 12 80 00 0b bne 40012fd4 40012fac: d0 07 60 64 ld [ %i5 + 0x64 ], %o0 && fs_info->vol.bps == fs_info->vol.bytes_per_block) 40012fb0: c4 17 40 00 lduh [ %i5 ], %g2 40012fb4: c2 17 60 0a lduh [ %i5 + 0xa ], %g1 40012fb8: 80 a0 80 01 cmp %g2, %g1 40012fbc: 12 80 00 06 bne 40012fd4 40012fc0: 01 00 00 00 nop { sc = rtems_bdbuf_get(fs_info->vol.dd, blk, &bd); 40012fc4: 7f ff f7 00 call 40010bc4 40012fc8: 01 00 00 00 nop } else { sc = rtems_bdbuf_read(fs_info->vol.dd, blk, &bd); } if ( sc != RTEMS_SUCCESSFUL) 40012fcc: 10 80 00 05 b 40012fe0 40012fd0: 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); 40012fd4: 7f ff f7 20 call 40010c54 40012fd8: 01 00 00 00 nop } if ( sc != RTEMS_SUCCESSFUL) 40012fdc: 80 a2 20 00 cmp %o0, 0 40012fe0: 12 80 00 0d bne 40013014 <== NEVER TAKEN 40012fe4: 01 00 00 00 nop rtems_set_errno_and_return_minus_one(ENOMEM); memcpy(bd->buffer + blk_ofs, fs_info->sec_buf, fs_info->vol.bps); 40012fe8: c2 07 bf fc ld [ %fp + -4 ], %g1 40012fec: d2 07 60 90 ld [ %i5 + 0x90 ], %o1 40012ff0: d0 00 60 1c ld [ %g1 + 0x1c ], %o0 40012ff4: d4 17 40 00 lduh [ %i5 ], %o2 40012ff8: 40 00 27 7a call 4001cde0 40012ffc: 90 02 00 1b add %o0, %i3, %o0 sc = rtems_bdbuf_release_modified(bd); 40013000: 7f ff f7 b9 call 40010ee4 40013004: d0 07 bf fc ld [ %fp + -4 ], %o0 if ( sc != RTEMS_SUCCESSFUL) 40013008: 80 a2 20 00 cmp %o0, 0 4001300c: 22 bf ff d5 be,a 40012f60 <== ALWAYS TAKEN 40013010: b8 07 20 01 inc %i4 rtems_set_errno_and_return_minus_one(ENOMEM); 40013014: 40 00 25 1e call 4001c48c <__errno> <== NOT EXECUTED 40013018: 01 00 00 00 nop <== NOT EXECUTED 4001301c: 10 80 00 0a b 40013044 <== NOT EXECUTED 40013020: 82 10 20 0c mov 0xc, %g1 ! c <_TLS_Alignment+0xb> <== NOT EXECUTED } } } else { sc = rtems_bdbuf_release(fs_info->c.buf); 40013024: 7f ff f7 7b call 40010e10 40013028: 01 00 00 00 nop if (sc != RTEMS_SUCCESSFUL) 4001302c: 80 a2 20 00 cmp %o0, 0 40013030: 22 80 00 09 be,a 40013054 <== ALWAYS TAKEN 40013034: c0 2f 60 89 clrb [ %i5 + 0x89 ] rtems_set_errno_and_return_minus_one(EIO); 40013038: 40 00 25 15 call 4001c48c <__errno> <== NOT EXECUTED 4001303c: 01 00 00 00 nop <== NOT EXECUTED 40013040: 82 10 20 05 mov 5, %g1 ! 5 <_TLS_Alignment+0x4> <== NOT EXECUTED 40013044: c2 22 00 00 st %g1, [ %o0 ] <== NOT EXECUTED 40013048: 81 c7 e0 08 ret <== NOT EXECUTED 4001304c: 91 e8 3f ff restore %g0, -1, %o0 <== NOT EXECUTED } fs_info->c.state = FAT_CACHE_EMPTY; 40013050: c0 2f 60 89 clrb [ %i5 + 0x89 ] return RC_OK; 40013054: b0 10 20 00 clr %i0 } 40013058: 81 c7 e0 08 ret 4001305c: 81 e8 00 00 restore =============================================================================== 40012e48 : 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)) ) 40012e48: 80 a2 60 00 cmp %o1, 0 40012e4c: 12 80 00 0a bne 40012e74 40012e50: c2 0a 20 02 ldub [ %o0 + 2 ], %g1 40012e54: c4 0a 20 0e ldub [ %o0 + 0xe ], %g2 40012e58: 80 88 a0 03 btst 3, %g2 40012e5c: 02 80 00 07 be 40012e78 <== NEVER TAKEN 40012e60: c4 0a 20 0c ldub [ %o0 + 0xc ], %g2 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); 40012e64: d0 02 20 20 ld [ %o0 + 0x20 ], %o0 40012e68: 82 20 80 01 sub %g2, %g1, %g1 40012e6c: 81 c3 e0 08 retl 40012e70: 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); 40012e74: c4 0a 20 0c ldub [ %o0 + 0xc ], %g2 40012e78: c6 0a 20 08 ldub [ %o0 + 8 ], %g3 40012e7c: d0 02 20 34 ld [ %o0 + 0x34 ], %o0 40012e80: 86 20 c0 02 sub %g3, %g2, %g3 40012e84: 82 20 80 01 sub %g2, %g1, %g1 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; 40012e88: 92 02 7f fe add %o1, -2, %o1 40012e8c: 91 32 00 01 srl %o0, %g1, %o0 blk = cln << (fs_info->vol.bpc_log2 - fs_info->vol.bytes_per_block_log2); 40012e90: 93 2a 40 03 sll %o1, %g3, %o1 blk += fat_sector_num_to_block_num(fs_info, fs_info->vol.data_fsec); } return blk; } 40012e94: 81 c3 e0 08 retl 40012e98: 90 02 00 09 add %o0, %o1, %o0 =============================================================================== 400121a0 : 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)) ) 400121a0: 80 a2 60 00 cmp %o1, 0 400121a4: 32 80 00 08 bne,a 400121c4 400121a8: c2 0a 20 05 ldub [ %o0 + 5 ], %g1 400121ac: c2 0a 20 0e ldub [ %o0 + 0xe ], %g1 400121b0: 80 88 60 03 btst 3, %g1 400121b4: 22 80 00 04 be,a 400121c4 <== NEVER TAKEN 400121b8: c2 0a 20 05 ldub [ %o0 + 5 ], %g1 <== NOT EXECUTED return fs_info->vol.rdir_loc; 400121bc: 81 c3 e0 08 retl 400121c0: d0 02 20 20 ld [ %o0 + 0x20 ], %o0 return (((cln - FAT_RSRVD_CLN) << fs_info->vol.spc_log2) + 400121c4: 92 02 7f fe add %o1, -2, %o1 400121c8: 93 2a 40 01 sll %o1, %g1, %o1 400121cc: c2 02 20 34 ld [ %o0 + 0x34 ], %g1 fs_info->vol.data_fsec); } 400121d0: 81 c3 e0 08 retl 400121d4: 90 02 40 01 add %o1, %g1, %o0 =============================================================================== 4001322c : fat_fs_info_t *fs_info, const uint32_t start_cln, const uint32_t offset, const uint32_t count, const uint8_t pattern) { 4001322c: 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)); 40013230: fa 16 20 06 lduh [ %i0 + 6 ], %i5 40013234: ba 27 40 1a sub %i5, %i2, %i5 40013238: 80 a7 40 1b cmp %i5, %i3 4001323c: 38 80 00 02 bgu,a 40013244 <== NEVER TAKEN 40013240: ba 10 00 1b mov %i3, %i5 <== NOT EXECUTED uint32_t cur_blk = fat_cluster_num_to_block_num(fs_info, start_cln); 40013244: 90 10 00 18 mov %i0, %o0 40013248: 7f ff ff 00 call 40012e48 4001324c: 92 10 00 19 mov %i1, %o1 uint32_t blocks_in_offset = offset >> fs_info->vol.bytes_per_block_log2; 40013250: 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; 40013254: 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; 40013258: a3 36 80 01 srl %i2, %g1, %l1 uint32_t ofs_blk = offset - (blocks_in_offset << fs_info->vol.bytes_per_block_log2); 4001325c: 83 2c 40 01 sll %l1, %g1, %g1 40013260: a4 10 20 01 mov 1, %l2 40013264: b4 26 80 01 sub %i2, %g1, %i2 ssize_t bytes_written = 0; ssize_t ret; cur_blk += blocks_in_offset; 40013268: a2 02 00 11 add %o0, %l1, %l1 const uint32_t start_cln, const uint32_t offset, const uint32_t count, const uint8_t pattern) { ssize_t rc = RC_OK; 4001326c: 82 10 20 00 clr %g1 ssize_t bytes_written = 0; ssize_t ret; cur_blk += blocks_in_offset; while ( (RC_OK == rc) 40013270: 80 a7 60 00 cmp %i5, 0 40013274: 02 80 00 2e be 4001332c 40013278: 80 a0 60 00 cmp %g1, 0 4001327c: 32 80 00 2f bne,a 40013338 <== NEVER TAKEN 40013280: b0 10 3f ff mov -1, %i0 <== NOT EXECUTED && (0 < bytes_to_write)) { uint32_t c = MIN(bytes_to_write, (fs_info->vol.bytes_per_block - ofs_blk)); 40013284: c4 16 20 0a lduh [ %i0 + 0xa ], %g2 40013288: 82 20 80 1a sub %g2, %i2, %g1 4001328c: 80 a0 40 1d cmp %g1, %i5 40013290: 08 80 00 03 bleu 4001329c <== ALWAYS TAKEN 40013294: b6 10 00 01 mov %g1, %i3 40013298: b6 10 00 1d mov %i5, %i3 <== 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)); 4001329c: 80 a6 c0 01 cmp %i3, %g1 400132a0: 08 80 00 03 bleu 400132ac <== ALWAYS TAKEN 400132a4: b2 10 00 1b mov %i3, %i1 400132a8: b2 10 00 01 mov %g1, %i1 <== NOT EXECUTED return cmpltd; } static ssize_t fat_block_set ( fat_fs_info_t *fs_info, 400132ac: 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) 400132b0: 80 a6 60 00 cmp %i1, 0 400132b4: 02 80 00 14 be 40013304 <== NEVER TAKEN 400132b8: 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); 400132bc: 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); 400132c0: 90 10 00 18 mov %i0, %o0 400132c4: 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) 400132c8: 80 a6 40 02 cmp %i1, %g2 400132cc: 02 80 00 03 be 400132d8 400132d0: 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); 400132d4: 94 10 20 01 mov 1, %o2 400132d8: 7f ff ff 62 call 40013060 400132dc: 96 07 bf fc add %fp, -4, %o3 if (RC_OK == rc) 400132e0: 80 a2 20 00 cmp %o0, 0 400132e4: 12 80 00 0a bne 4001330c <== NEVER TAKEN 400132e8: 80 a6 c0 08 cmp %i3, %o0 { memset(blk_buf + offset, pattern, bytes_to_write); 400132ec: d0 07 bf fc ld [ %fp + -4 ], %o0 400132f0: 92 10 00 1c mov %i4, %o1 400132f4: 90 02 00 1a add %o0, %i2, %o0 400132f8: 40 00 26 f9 call 4001cedc 400132fc: 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; 40013300: e4 2e 20 88 stb %l2, [ %i0 + 0x88 ] } } if (RC_OK != rc) return rc; else return bytes_to_write; 40013304: 90 10 00 19 mov %i1, %o0 fs_info, cur_blk, ofs_blk, c, pattern); if (c != ret) 40013308: 80 a6 c0 08 cmp %i3, %o0 4001330c: 12 80 00 06 bne 40013324 <== NEVER TAKEN 40013310: 82 10 3f ff mov -1, %g1 rc = -1; else { bytes_to_write -= ret; 40013314: ba 27 40 1b sub %i5, %i3, %i5 bytes_written += ret; 40013318: a0 04 00 1b add %l0, %i3, %l0 ++cur_blk; 4001331c: a2 04 60 01 inc %l1 40013320: 82 10 20 00 clr %g1 40013324: 10 bf ff d3 b 40013270 40013328: b4 10 20 00 clr %i2 } ofs_blk = 0; } if (RC_OK != rc) 4001332c: 12 80 00 03 bne 40013338 <== NEVER TAKEN 40013330: b0 10 3f ff mov -1, %i0 40013334: b0 10 00 10 mov %l0, %i0 return rc; else return bytes_written; } 40013338: 81 c7 e0 08 ret 4001333c: 81 e8 00 00 restore =============================================================================== 40013340 : const uint32_t start_cln, const uint32_t offset, const uint32_t count, const void *buff, const bool overwrite_cluster) { 40013340: 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)); 40013344: e0 16 20 06 lduh [ %i0 + 6 ], %l0 40013348: a0 24 00 1a sub %l0, %i2, %l0 4001334c: 80 a4 00 1b cmp %l0, %i3 40013350: 38 80 00 02 bgu,a 40013358 40013354: a0 10 00 1b mov %i3, %l0 uint32_t cur_blk = fat_cluster_num_to_block_num(fs_info, start_cln); 40013358: 90 10 00 18 mov %i0, %o0 4001335c: 7f ff fe bb call 40012e48 40013360: 92 10 00 19 mov %i1, %o1 uint32_t blocks_in_offset = (offset >> fs_info->vol.bytes_per_block_log2); 40013364: 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; 40013368: 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); 4001336c: a5 36 80 01 srl %i2, %g1, %l2 uint32_t ofs_blk = offset - (blocks_in_offset << fs_info->vol.bytes_per_block_log2); 40013370: 83 2c 80 01 sll %l2, %g1, %g1 40013374: a6 10 20 01 mov 1, %l3 40013378: 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; 4001337c: a4 02 00 12 add %o0, %l2, %l2 const uint32_t offset, const uint32_t count, const void *buff, const bool overwrite_cluster) { ssize_t rc = RC_OK; 40013380: 82 10 20 00 clr %g1 ssize_t ret; uint32_t c; cur_blk += blocks_in_offset; while ( (RC_OK == rc) 40013384: 80 a4 20 00 cmp %l0, 0 40013388: 02 80 00 30 be 40013448 4001338c: 80 a0 60 00 cmp %g1, 0 40013390: 32 80 00 31 bne,a 40013454 <== NEVER TAKEN 40013394: b0 10 3f ff mov -1, %i0 <== NOT EXECUTED && (0 < bytes_to_write)) { c = MIN(bytes_to_write, (fs_info->vol.bytes_per_block - ofs_blk)); 40013398: c4 16 20 0a lduh [ %i0 + 0xa ], %g2 4001339c: 82 20 80 1a sub %g2, %i2, %g1 400133a0: 80 a0 40 10 cmp %g1, %l0 400133a4: 08 80 00 03 bleu 400133b0 400133a8: b6 10 00 01 mov %g1, %i3 400133ac: b6 10 00 10 mov %l0, %i3 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)); 400133b0: 80 a6 c0 01 cmp %i3, %g1 400133b4: 08 80 00 03 bleu 400133c0 <== ALWAYS TAKEN 400133b8: b2 10 00 1b mov %i3, %i1 400133bc: b2 10 00 01 mov %g1, %i1 <== NOT EXECUTED return cmpltd; } static ssize_t fat_block_write( fat_fs_info_t *fs_info, 400133c0: 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) 400133c4: 80 a6 60 00 cmp %i1, 0 400133c8: 02 80 00 16 be 40013420 <== NEVER TAKEN 400133cc: 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); 400133d0: 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); 400133d4: 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 400133d8: 80 a7 60 00 cmp %i5, 0 400133dc: 12 80 00 05 bne 400133f0 400133e0: 93 2c 80 09 sll %l2, %o1, %o1 || (bytes_to_write == fs_info->vol.bytes_per_block)) 400133e4: 80 a6 40 02 cmp %i1, %g2 400133e8: 12 80 00 03 bne 400133f4 400133ec: 94 10 20 01 mov 1, %o2 { rc = fat_buf_access(fs_info, sec_num, FAT_OP_TYPE_GET, &blk_buf); 400133f0: 94 10 20 02 mov 2, %o2 } else rc = fat_buf_access(fs_info, sec_num, FAT_OP_TYPE_READ, &blk_buf); 400133f4: 7f ff ff 1b call 40013060 400133f8: 96 07 bf fc add %fp, -4, %o3 if (RC_OK == rc) 400133fc: 80 a2 20 00 cmp %o0, 0 40013400: 12 80 00 0a bne 40013428 <== NEVER TAKEN 40013404: 80 a6 c0 08 cmp %i3, %o0 { memcpy(blk_buf + offset, buf, bytes_to_write); 40013408: d0 07 bf fc ld [ %fp + -4 ], %o0 4001340c: 92 07 00 11 add %i4, %l1, %o1 40013410: 90 02 00 1a add %o0, %i2, %o0 40013414: 40 00 26 73 call 4001cde0 40013418: 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; 4001341c: e6 2e 20 88 stb %l3, [ %i0 + 0x88 ] } } if (RC_OK != rc) return rc; else return bytes_to_write; 40013420: 90 10 00 19 mov %i1, %o0 cur_blk, ofs_blk, c, &buffer[bytes_written], overwrite_cluster); if (c != ret) 40013424: 80 a6 c0 08 cmp %i3, %o0 40013428: 12 80 00 06 bne 40013440 <== NEVER TAKEN 4001342c: 82 10 3f ff mov -1, %g1 rc = -1; else { bytes_to_write -= ret; 40013430: a0 24 00 1b sub %l0, %i3, %l0 bytes_written += ret; 40013434: a2 04 40 1b add %l1, %i3, %l1 ++cur_blk; 40013438: a4 04 a0 01 inc %l2 4001343c: 82 10 20 00 clr %g1 40013440: 10 bf ff d1 b 40013384 40013444: b4 10 20 00 clr %i2 } ofs_blk = 0; } if (RC_OK != rc) 40013448: 12 80 00 03 bne 40013454 <== NEVER TAKEN 4001344c: b0 10 3f ff mov -1, %i0 40013450: b0 10 00 11 mov %l1, %i0 return rc; else return bytes_written; } 40013454: 81 c7 e0 08 ret 40013458: 81 e8 00 00 restore =============================================================================== 40012708 : int fat_file_close( fat_fs_info_t *fs_info, fat_file_fd_t *fat_fd ) { 40012708: 9d e3 bf a0 save %sp, -96, %sp /* * if links_num field of fat-file descriptor is greater than 1 * decrement only the count of links */ if (fat_fd->links_num > 1) 4001270c: c2 06 60 08 ld [ %i1 + 8 ], %g1 40012710: 80 a0 60 01 cmp %g1, 1 40012714: 08 80 00 04 bleu 40012724 40012718: 82 00 7f ff add %g1, -1, %g1 4001271c: 10 80 00 26 b 400127b4 40012720: c2 26 60 08 st %g1, [ %i1 + 8 ] } else { uint32_t key = fat_construct_key(fs_info, &fat_fd->dir_pos.sname); if (fat_fd->flags & FAT_FILE_REMOVED) 40012724: c2 0e 60 30 ldub [ %i1 + 0x30 ], %g1 40012728: 80 88 60 01 btst 1, %g1 4001272c: 02 80 00 16 be 40012784 40012730: 90 10 00 18 mov %i0, %o0 { rc = fat_file_truncate(fs_info, fat_fd, 0); 40012734: 92 10 00 19 mov %i1, %o1 40012738: 7f ff ff af call 400125f4 4001273c: 94 10 20 00 clr %o2 if (rc == RC_OK) 40012740: 80 a2 20 00 cmp %o0, 0 40012744: 12 80 00 1c bne 400127b4 <== NEVER TAKEN 40012748: 01 00 00 00 nop ) { Chain_Node *next; Chain_Node *previous; next = the_node->next; 4001274c: c4 06 40 00 ld [ %i1 ], %g2 previous = the_node->previous; 40012750: c2 06 60 04 ld [ %i1 + 4 ], %g1 { _hash_delete(fs_info->rhash, key, fat_fd->ino, fat_fd); if (fat_ino_is_unique(fs_info, fat_fd->ino)) 40012754: d2 06 60 0c ld [ %i1 + 0xc ], %o1 next->previous = previous; 40012758: c2 20 a0 04 st %g1, [ %g2 + 4 ] previous->next = next; 4001275c: c4 20 40 00 st %g2, [ %g1 ] 40012760: 40 00 06 00 call 40013f60 40012764: 90 10 00 18 mov %i0, %o0 40012768: 80 a2 20 00 cmp %o0, 0 4001276c: 02 80 00 10 be 400127ac <== ALWAYS TAKEN 40012770: 01 00 00 00 nop fat_free_unique_ino(fs_info, fat_fd->ino); 40012774: d2 06 60 0c ld [ %i1 + 0xc ], %o1 <== NOT EXECUTED 40012778: 40 00 05 ef call 40013f34 <== NOT EXECUTED 4001277c: 90 10 00 18 mov %i0, %o0 <== NOT EXECUTED 40012780: 30 80 00 0b b,a 400127ac <== NOT EXECUTED free(fat_fd); } } else { if (fat_ino_is_unique(fs_info, fat_fd->ino)) 40012784: 40 00 05 f7 call 40013f60 40012788: d2 06 60 0c ld [ %i1 + 0xc ], %o1 4001278c: 80 a2 20 00 cmp %o0, 0 40012790: 22 80 00 04 be,a 400127a0 40012794: c4 06 40 00 ld [ %i1 ], %g2 40012798: 10 80 00 07 b 400127b4 4001279c: c0 26 60 08 clr [ %i1 + 8 ] { Chain_Node *next; Chain_Node *previous; next = the_node->next; previous = the_node->previous; 400127a0: c2 06 60 04 ld [ %i1 + 4 ], %g1 next->previous = previous; 400127a4: c2 20 a0 04 st %g1, [ %g2 + 4 ] previous->next = next; 400127a8: c4 20 40 00 st %g2, [ %g1 ] fat_fd->links_num = 0; } else { _hash_delete(fs_info->vhash, key, fat_fd->ino, fat_fd); free(fat_fd); 400127ac: 7f ff c9 8a call 40004dd4 400127b0: 90 10 00 19 mov %i1, %o0 } /* * flush any modified "cached" buffer back to disk */ rc = fat_buf_release(fs_info); 400127b4: 40 00 01 ba call 40012e9c 400127b8: 81 e8 00 00 restore =============================================================================== 40012890 : fat_file_fd_t *fat_fd, bool zero_fill, uint32_t new_length, uint32_t *a_length ) { 40012890: 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; 40012894: f6 27 00 00 st %i3, [ %i4 ] if (new_length <= fat_fd->fat_file_size) 40012898: c2 06 60 18 ld [ %i1 + 0x18 ], %g1 uint32_t new_length, uint32_t *a_length ) { int rc = RC_OK; uint32_t chain = 0; 4001289c: 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; 400128a0: 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) 400128a4: 80 a6 c0 01 cmp %i3, %g1 400128a8: 08 80 00 86 bleu 40012ac0 400128ac: ba 10 00 18 mov %i0, %i5 return RC_OK; if ((FAT_FD_OF_ROOT_DIR(fat_fd)) && 400128b0: c4 06 60 20 ld [ %i1 + 0x20 ], %g2 400128b4: 80 a0 a0 01 cmp %g2, 1 400128b8: 32 80 00 0b bne,a 400128e4 400128bc: e0 17 60 06 lduh [ %i5 + 6 ], %l0 400128c0: c4 06 60 24 ld [ %i1 + 0x24 ], %g2 400128c4: 80 a0 a0 00 cmp %g2, 0 400128c8: 32 80 00 07 bne,a 400128e4 <== NEVER TAKEN 400128cc: e0 17 60 06 lduh [ %i5 + 6 ], %l0 <== NOT EXECUTED (fs_info->vol.type & (FAT_FAT12 | FAT_FAT16))) 400128d0: 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)) && 400128d4: 80 88 a0 03 btst 3, %g2 400128d8: 12 80 00 37 bne 400129b4 <== ALWAYS TAKEN 400128dc: 01 00 00 00 nop (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))) & 400128e0: e0 17 60 06 lduh [ %i5 + 6 ], %l0 <== NOT EXECUTED 400128e4: 84 04 3f ff add %l0, -1, %g2 400128e8: 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 - 400128ec: a0 24 00 12 sub %l0, %l2, %l0 400128f0: 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; 400128f4: 84 26 c0 01 sub %i3, %g1, %g2 if (bytes2add > bytes_remain) 400128f8: 80 a0 80 10 cmp %g2, %l0 400128fc: 08 80 00 03 bleu 40012908 40012900: a2 10 20 00 clr %l1 bytes2add -= bytes_remain; 40012904: a2 20 80 10 sub %g2, %l0, %l1 else bytes2add = 0; if (zero_fill && bytes_remain > 0) { 40012908: 80 a4 20 00 cmp %l0, 0 4001290c: 02 80 00 17 be 40012968 40012910: 80 a4 60 00 cmp %l1, 0 40012914: 80 a6 a0 00 cmp %i2, 0 40012918: 02 80 00 14 be 40012968 4001291c: 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; 40012920: 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); 40012924: 90 10 00 1d mov %i5, %o0 40012928: 92 10 00 19 mov %i1, %o1 4001292c: 95 30 40 0a srl %g1, %o2, %o2 40012930: 7f ff fe 3b call 4001221c 40012934: 96 07 bf fc add %fp, -4, %o3 if (rc != RC_OK) 40012938: b0 92 60 00 orcc %o1, 0, %i0 4001293c: 12 80 00 22 bne 400129c4 <== NEVER TAKEN 40012940: d2 07 bf fc ld [ %fp + -4 ], %o1 return rc; bytes_written = fat_cluster_set (fs_info, cur_cln, ofs, bytes_remain, 0); 40012944: 90 10 00 1d mov %i5, %o0 40012948: 94 10 00 12 mov %l2, %o2 4001294c: 96 10 00 10 mov %l0, %o3 40012950: 98 10 20 00 clr %o4 40012954: 40 00 02 36 call 4001322c 40012958: b0 10 3f ff mov -1, %i0 if (bytes_remain != bytes_written) 4001295c: 80 a4 00 08 cmp %l0, %o0 40012960: 12 80 00 19 bne 400129c4 <== NEVER TAKEN 40012964: 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) 40012968: 02 80 00 17 be 400129c4 4001296c: b0 10 20 00 clr %i0 return RC_OK; cls2add = ((bytes2add - 1) >> fs_info->vol.bpc_log2) + 1; 40012970: c2 0f 60 08 ldub [ %i5 + 8 ], %g1 40012974: a4 04 7f ff add %l1, -1, %l2 rc = fat_scan_fat_for_free_clusters(fs_info, &chain, cls2add, 40012978: 90 10 00 1d mov %i5, %o0 * file ) - return */ if (bytes2add == 0) return RC_OK; cls2add = ((bytes2add - 1) >> fs_info->vol.bpc_log2) + 1; 4001297c: a5 34 80 01 srl %l2, %g1, %l2 rc = fat_scan_fat_for_free_clusters(fs_info, &chain, cls2add, 40012980: 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; 40012984: a4 04 a0 01 inc %l2 rc = fat_scan_fat_for_free_clusters(fs_info, &chain, cls2add, 40012988: 96 07 bf fc add %fp, -4, %o3 4001298c: 94 10 00 12 mov %l2, %o2 40012990: 98 07 bf f8 add %fp, -8, %o4 40012994: 7f ff fd 90 call 40011fd4 40012998: 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) 4001299c: b0 92 20 00 orcc %o0, 0, %i0 400129a0: 12 80 00 09 bne 400129c4 <== NEVER TAKEN 400129a4: 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)) 400129a8: 80 94 00 01 orcc %l0, %g1, %g0 400129ac: 12 80 00 08 bne 400129cc 400129b0: 80 a4 80 01 cmp %l2, %g1 rtems_set_errno_and_return_minus_one(ENOSPC); 400129b4: 40 00 26 b6 call 4001c48c <__errno> 400129b8: b0 10 3f ff mov -1, %i0 400129bc: 82 10 20 1c mov 0x1c, %g1 400129c0: c2 22 00 00 st %g1, [ %o0 ] 400129c4: 81 c7 e0 08 ret 400129c8: 81 e8 00 00 restore /* check wether we satisfied request for 'cls2add' clusters */ if (cls2add != cls_added) 400129cc: 02 80 00 08 be 400129ec 400129d0: a4 24 80 01 sub %l2, %g1, %l2 { uint32_t missing = (cls2add - cls_added) << fs_info->vol.bpc_log2; 400129d4: c4 0f 60 08 ldub [ %i5 + 8 ], %g2 400129d8: a5 2c 80 02 sll %l2, %g2, %l2 new_length -= bytes2add < missing ? bytes2add : missing; 400129dc: 80 a4 80 11 cmp %l2, %l1 400129e0: 38 80 00 02 bgu,a 400129e8 <== ALWAYS TAKEN 400129e4: a4 10 00 11 mov %l1, %l2 400129e8: b6 26 c0 12 sub %i3, %l2, %i3 } if (cls_added > 0) 400129ec: 80 a0 60 00 cmp %g1, 0 400129f0: 22 80 00 33 be,a 40012abc 400129f4: f6 27 00 00 st %i3, [ %i4 ] { /* add new chain to the end of existing */ if ( fat_fd->fat_file_size == 0 ) 400129f8: d6 06 60 18 ld [ %i1 + 0x18 ], %o3 400129fc: 80 a2 e0 00 cmp %o3, 0 40012a00: 32 80 00 07 bne,a 40012a1c 40012a04: c2 06 60 3c ld [ %i1 + 0x3c ], %g1 { fat_fd->map.disk_cln = fat_fd->cln = chain; 40012a08: c2 07 bf f0 ld [ %fp + -16 ], %g1 fat_fd->map.file_cln = 0; 40012a0c: c0 26 60 34 clr [ %i1 + 0x34 ] if (cls_added > 0) { /* add new chain to the end of existing */ if ( fat_fd->fat_file_size == 0 ) { fat_fd->map.disk_cln = fat_fd->cln = chain; 40012a10: c2 26 60 1c st %g1, [ %i1 + 0x1c ] 40012a14: 10 80 00 19 b 40012a78 40012a18: c2 26 60 38 st %g1, [ %i1 + 0x38 ] fat_fd->map.file_cln = 0; } else { if (fat_fd->map.last_cln != FAT_UNDEFINED_VALUE) 40012a1c: 80 a0 7f ff cmp %g1, -1 40012a20: 22 80 00 04 be,a 40012a30 <== NEVER TAKEN 40012a24: 90 10 00 1d mov %i5, %o0 <== NOT EXECUTED 40012a28: 10 80 00 0a b 40012a50 40012a2c: c2 27 bf f4 st %g1, [ %fp + -12 ] { old_last_cl = fat_fd->map.last_cln; } else { rc = fat_file_ioctl(fs_info, fat_fd, F_CLU_NUM, 40012a30: 92 10 00 19 mov %i1, %o1 <== NOT EXECUTED 40012a34: 94 10 20 01 mov 1, %o2 <== NOT EXECUTED 40012a38: 96 02 ff ff add %o3, -1, %o3 <== NOT EXECUTED 40012a3c: 7f ff ff 60 call 400127bc <== NOT EXECUTED 40012a40: 98 07 bf f4 add %fp, -12, %o4 <== NOT EXECUTED (fat_fd->fat_file_size - 1), &old_last_cl); if ( rc != RC_OK ) 40012a44: b0 92 20 00 orcc %o0, 0, %i0 <== NOT EXECUTED 40012a48: 32 80 00 19 bne,a 40012aac <== NOT EXECUTED 40012a4c: 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); 40012a50: d2 07 bf f4 ld [ %fp + -12 ], %o1 40012a54: d4 07 bf f0 ld [ %fp + -16 ], %o2 40012a58: 7f ff fc 91 call 40011c9c 40012a5c: 90 10 00 1d mov %i5, %o0 40012a60: b0 10 00 08 mov %o0, %i0 if ( rc != RC_OK ) 40012a64: 80 a6 20 00 cmp %i0, 0 40012a68: 12 80 00 11 bne 40012aac <== NEVER TAKEN 40012a6c: 90 10 00 1d mov %i5, %o0 { fat_free_fat_clusters_chain(fs_info, chain); return rc; } fat_buf_release(fs_info); 40012a70: 40 00 01 0b call 40012e9c 40012a74: 01 00 00 00 nop } /* update number of the last cluster of the file */ fat_fd->map.last_cln = last_cl; 40012a78: c2 07 bf f8 ld [ %fp + -8 ], %g1 40012a7c: c2 26 60 3c st %g1, [ %i1 + 0x3c ] if (fat_fd->fat_file_type == FAT_DIRECTORY) 40012a80: c2 06 60 10 ld [ %i1 + 0x10 ], %g1 40012a84: 80 a0 60 00 cmp %g1, 0 40012a88: 32 80 00 0d bne,a 40012abc 40012a8c: f6 27 00 00 st %i3, [ %i4 ] { rc = fat_init_clusters_chain(fs_info, chain); 40012a90: d2 07 bf f0 ld [ %fp + -16 ], %o1 40012a94: 40 00 04 db call 40013e00 40012a98: 90 10 00 1d mov %i5, %o0 if ( rc != RC_OK ) 40012a9c: b0 92 20 00 orcc %o0, 0, %i0 40012aa0: 22 80 00 07 be,a 40012abc <== ALWAYS TAKEN 40012aa4: f6 27 00 00 st %i3, [ %i4 ] { fat_free_fat_clusters_chain(fs_info, chain); 40012aa8: 90 10 00 1d mov %i5, %o0 <== NOT EXECUTED 40012aac: 7f ff fd 1a call 40011f14 <== NOT EXECUTED 40012ab0: d2 07 bf f0 ld [ %fp + -16 ], %o1 <== NOT EXECUTED return rc; 40012ab4: 81 c7 e0 08 ret <== NOT EXECUTED 40012ab8: 81 e8 00 00 restore <== NOT EXECUTED } } } *a_length = new_length; fat_fd->fat_file_size = new_length; 40012abc: f6 26 60 18 st %i3, [ %i1 + 0x18 ] return RC_OK; 40012ac0: b0 10 20 00 clr %i0 } 40012ac4: 81 c7 e0 08 ret 40012ac8: 81 e8 00 00 restore =============================================================================== 400127bc : fat_file_ioctl( fat_fs_info_t *fs_info, fat_file_fd_t *fat_fd, int cmd, ...) { 400127bc: 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); 400127c0: 82 07 a0 50 add %fp, 0x50, %g1 400127c4: f6 27 a0 50 st %i3, [ %fp + 0x50 ] 400127c8: f8 27 a0 54 st %i4, [ %fp + 0x54 ] 400127cc: 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; 400127d0: c0 27 bf f8 clr [ %fp + -8 ] uint32_t *ret; va_list ap; va_start(ap, cmd); switch (cmd) 400127d4: 80 a6 a0 01 cmp %i2, 1 400127d8: 12 80 00 27 bne 40012874 <== NEVER TAKEN 400127dc: c2 27 bf fc st %g1, [ %fp + -4 ] { case F_CLU_NUM: pos = va_arg(ap, uint32_t); ret = va_arg(ap, uint32_t *); 400127e0: 82 07 a0 58 add %fp, 0x58, %g1 400127e4: c2 27 bf fc st %g1, [ %fp + -4 ] /* sanity check */ if ( pos >= fat_fd->fat_file_size ) { 400127e8: c2 06 60 18 ld [ %i1 + 0x18 ], %g1 400127ec: 80 a6 c0 01 cmp %i3, %g1 400127f0: 0a 80 00 08 bcs 40012810 <== ALWAYS TAKEN 400127f4: ba 10 00 1c mov %i4, %i5 va_end(ap); rtems_set_errno_and_return_minus_one( EIO ); 400127f8: 40 00 27 25 call 4001c48c <__errno> <== NOT EXECUTED 400127fc: b0 10 3f ff mov -1, %i0 <== NOT EXECUTED 40012800: 82 10 20 05 mov 5, %g1 <== NOT EXECUTED 40012804: c2 22 00 00 st %g1, [ %o0 ] <== NOT EXECUTED 40012808: 81 c7 e0 08 ret <== NOT EXECUTED 4001280c: 81 e8 00 00 restore <== NOT EXECUTED } if ((FAT_FD_OF_ROOT_DIR(fat_fd)) && 40012810: c2 06 60 20 ld [ %i1 + 0x20 ], %g1 40012814: 80 a0 60 01 cmp %g1, 1 40012818: 32 80 00 0d bne,a 4001284c 4001281c: d4 0e 20 08 ldub [ %i0 + 8 ], %o2 40012820: c2 06 60 24 ld [ %i1 + 0x24 ], %g1 40012824: 80 a0 60 00 cmp %g1, 0 40012828: 32 80 00 09 bne,a 4001284c <== NEVER TAKEN 4001282c: d4 0e 20 08 ldub [ %i0 + 8 ], %o2 <== NOT EXECUTED (fs_info->vol.type & (FAT_FAT12 | FAT_FAT16))) 40012830: 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)) && 40012834: 80 88 60 03 btst 3, %g1 40012838: 22 80 00 05 be,a 4001284c 4001283c: 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; 40012840: c0 27 00 00 clr [ %i4 ] rc = RC_OK; break; 40012844: 10 80 00 11 b 40012888 40012848: 92 10 20 00 clr %o1 } cl_start = pos >> fs_info->vol.bpc_log2; rc = fat_file_lseek(fs_info, fat_fd, cl_start, &cur_cln); 4001284c: 90 10 00 18 mov %i0, %o0 40012850: 92 10 00 19 mov %i1, %o1 40012854: 95 36 c0 0a srl %i3, %o2, %o2 40012858: 7f ff fe 71 call 4001221c 4001285c: 96 07 bf f8 add %fp, -8, %o3 if ( rc != RC_OK ) 40012860: 80 a2 60 00 cmp %o1, 0 40012864: 12 80 00 09 bne 40012888 <== NEVER TAKEN 40012868: c2 07 bf f8 ld [ %fp + -8 ], %g1 break; *ret = cur_cln; break; 4001286c: 10 80 00 07 b 40012888 40012870: c2 27 40 00 st %g1, [ %i5 ] default: errno = EINVAL; 40012874: 40 00 27 06 call 4001c48c <__errno> <== NOT EXECUTED 40012878: 01 00 00 00 nop <== NOT EXECUTED 4001287c: 82 10 20 16 mov 0x16, %g1 ! 16 <_TLS_Alignment+0x15> <== NOT EXECUTED rc = -1; 40012880: 92 10 3f ff mov -1, %o1 <== NOT EXECUTED *ret = cur_cln; break; default: errno = EINVAL; 40012884: c2 22 00 00 st %g1, [ %o0 ] <== NOT EXECUTED rc = -1; break; } va_end(ap); return rc; } 40012888: 81 c7 e0 08 ret 4001288c: 91 e8 00 09 restore %g0, %o1, %o0 =============================================================================== 4001221c : fat_fs_info_t *fs_info, fat_file_fd_t *fat_fd, uint32_t file_cln, uint32_t *disk_cln ) { 4001221c: 9d e3 bf 98 save %sp, -104, %sp int rc = RC_OK; if (file_cln == fat_fd->map.file_cln) 40012220: c2 06 60 34 ld [ %i1 + 0x34 ], %g1 40012224: 80 a6 80 01 cmp %i2, %g1 40012228: 12 80 00 05 bne 4001223c 4001222c: 01 00 00 00 nop *disk_cln = fat_fd->map.disk_cln; 40012230: c2 06 60 38 ld [ %i1 + 0x38 ], %g1 40012234: 10 80 00 1a b 4001229c 40012238: 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) 4001223c: 28 80 00 06 bleu,a 40012254 40012240: c2 06 60 1c ld [ %i1 + 0x1c ], %g1 { cur_cln = fat_fd->map.disk_cln; 40012244: c4 06 60 38 ld [ %i1 + 0x38 ], %g2 count = file_cln - fat_fd->map.file_cln; 40012248: b8 26 80 01 sub %i2, %g1, %i4 4001224c: 10 80 00 04 b 4001225c 40012250: c4 27 bf fc st %g2, [ %fp + -4 ] } else { cur_cln = fat_fd->cln; 40012254: b8 10 00 1a mov %i2, %i4 40012258: c2 27 bf fc st %g1, [ %fp + -4 ] count = file_cln; } /* skip over the clusters */ for (i = 0; i < count; i++) 4001225c: ba 10 20 00 clr %i5 40012260: 80 a7 40 1c cmp %i5, %i4 40012264: 02 80 00 0b be 40012290 40012268: d2 07 bf fc ld [ %fp + -4 ], %o1 { rc = fat_get_fat_cluster(fs_info, cur_cln, &cur_cln); 4001226c: 90 10 00 18 mov %i0, %o0 40012270: 7f ff fe 1d call 40011ae4 40012274: 94 07 bf fc add %fp, -4, %o2 if ( rc != RC_OK ) 40012278: 80 a2 20 00 cmp %o0, 0 4001227c: 22 bf ff f9 be,a 40012260 <== ALWAYS TAKEN 40012280: ba 07 60 01 inc %i5 return rc; 40012284: b1 3a 20 1f sra %o0, 0x1f, %i0 <== NOT EXECUTED 40012288: 81 c7 e0 08 ret <== NOT EXECUTED 4001228c: 93 e8 00 08 restore %g0, %o0, %o1 <== NOT EXECUTED } /* update cache */ fat_fd->map.file_cln = file_cln; 40012290: f4 26 60 34 st %i2, [ %i1 + 0x34 ] fat_fd->map.disk_cln = cur_cln; 40012294: d2 26 60 38 st %o1, [ %i1 + 0x38 ] *disk_cln = cur_cln; 40012298: d2 26 c0 00 st %o1, [ %i3 ] } return RC_OK; 4001229c: b0 10 20 00 clr %i0 } 400122a0: 81 c7 e0 08 ret 400122a4: 93 e8 20 00 restore %g0, 0, %o1 =============================================================================== 400122a8 : fat_file_open( fat_fs_info_t *fs_info, fat_dir_pos_t *dir_pos, fat_file_fd_t **fat_fd ) { 400122a8: 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); 400122ac: 90 10 00 18 mov %i0, %o0 400122b0: 7f ff ff ca call 400121d8 400122b4: 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; 400122b8: 82 0a 20 01 and %o0, 1, %g1 rtems_chain_node *the_node = rtems_chain_first(hash + mod); 400122bc: 85 28 60 02 sll %g1, 2, %g2 400122c0: b7 28 60 04 sll %g1, 4, %i3 400122c4: c2 06 20 6c ld [ %i0 + 0x6c ], %g1 400122c8: b6 26 c0 02 sub %i3, %g2, %i3 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_First( Chain_Control *the_chain ) { return _Chain_Head( the_chain )->next; 400122cc: fa 00 40 1b ld [ %g1 + %i3 ], %i5 400122d0: a0 00 40 1b add %g1, %i3, %l0 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); 400122d4: b8 10 00 08 mov %o0, %i4 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 )); 400122d8: a0 04 20 04 add %l0, 4, %l0 ) { 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) ; ) 400122dc: 80 a7 40 10 cmp %i5, %l0 400122e0: 02 80 00 0e be 40012318 400122e4: 90 10 00 18 mov %i0, %o0 { fat_file_fd_t *ffd = (fat_file_fd_t *)the_node; uint32_t ck = fat_construct_key(fs_info, &ffd->dir_pos.sname); 400122e8: 7f ff ff bc call 400121d8 400122ec: 92 07 60 20 add %i5, 0x20, %o1 if ( (key1) == ck) 400122f0: 80 a7 00 08 cmp %i4, %o0 400122f4: 22 80 00 04 be,a 40012304 400122f8: c2 07 60 08 ld [ %i5 + 8 ], %g1 { *ret = (void *)the_node; return 0; } } the_node = the_node->next; 400122fc: 10 bf ff f8 b 400122dc 40012300: fa 07 40 00 ld [ %i5 ], %i5 /* 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; 40012304: fa 26 80 00 st %i5, [ %i2 ] lfat_fd->links_num++; 40012308: 82 00 60 01 inc %g1 4001230c: c2 27 60 08 st %g1, [ %i5 + 8 ] return rc; 40012310: 81 c7 e0 08 ret 40012314: 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); 40012318: c2 06 20 70 ld [ %i0 + 0x70 ], %g1 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_First( Chain_Control *the_chain ) { return _Chain_Head( the_chain )->next; 4001231c: fa 00 40 1b ld [ %g1 + %i3 ], %i5 40012320: a0 00 40 1b add %g1, %i3, %l0 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 )); 40012324: a0 04 20 04 add %l0, 4, %l0 for ( ; !rtems_chain_is_tail((hash) + mod, the_node) ; ) 40012328: 80 a7 40 10 cmp %i5, %l0 4001232c: 02 80 00 10 be 4001236c <== ALWAYS TAKEN 40012330: 90 10 00 18 mov %i0, %o0 { fat_file_fd_t *ffd = (fat_file_fd_t *)the_node; uint32_t ck = fat_construct_key(fs_info, &ffd->dir_pos.sname); 40012334: 7f ff ff a9 call 400121d8 <== NOT EXECUTED 40012338: 92 07 60 20 add %i5, 0x20, %o1 <== NOT EXECUTED if ( (key1) == ck) 4001233c: 80 a7 00 08 cmp %i4, %o0 <== NOT EXECUTED 40012340: 32 bf ff fa bne,a 40012328 <== NOT EXECUTED 40012344: fa 07 40 00 ld [ %i5 ], %i5 <== NOT EXECUTED { if ( ((key2) == 0) || ((key2) == ffd->ino) ) 40012348: 80 a7 20 00 cmp %i4, 0 <== NOT EXECUTED 4001234c: 22 80 00 09 be,a 40012370 <== NOT EXECUTED 40012350: a0 10 20 00 clr %l0 <== NOT EXECUTED 40012354: c2 07 60 0c ld [ %i5 + 0xc ], %g1 <== NOT EXECUTED 40012358: 80 a7 00 01 cmp %i4, %g1 <== NOT EXECUTED 4001235c: 22 80 00 05 be,a 40012370 <== NOT EXECUTED 40012360: a0 10 20 00 clr %l0 <== NOT EXECUTED { *ret = (void *)the_node; return 0; } } the_node = the_node->next; 40012364: 10 bf ff f1 b 40012328 <== NOT EXECUTED 40012368: fa 07 40 00 ld [ %i5 ], %i5 <== NOT EXECUTED 4001236c: 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)); 40012370: 7f ff cb cb call 4000529c 40012374: 90 10 20 44 mov 0x44, %o0 40012378: d0 26 80 00 st %o0, [ %i2 ] if ( lfat_fd == NULL ) 4001237c: 80 a2 20 00 cmp %o0, 0 40012380: 02 80 00 1c be 400123f0 <== NEVER TAKEN 40012384: ba 10 00 08 mov %o0, %i5 rtems_set_errno_and_return_minus_one( ENOMEM ); memset(lfat_fd, 0, sizeof(fat_file_fd_t)); 40012388: 92 10 20 00 clr %o1 4001238c: 40 00 2a d4 call 4001cedc 40012390: 94 10 20 44 mov 0x44, %o2 lfat_fd->links_num = 1; 40012394: 82 10 20 01 mov 1, %g1 40012398: c2 27 60 08 st %g1, [ %i5 + 8 ] lfat_fd->flags &= ~FAT_FILE_REMOVED; 4001239c: c2 0f 60 30 ldub [ %i5 + 0x30 ], %g1 lfat_fd->map.last_cln = FAT_UNDEFINED_VALUE; lfat_fd->dir_pos = *dir_pos; 400123a0: 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; 400123a4: 82 08 7f fe and %g1, -2, %g1 400123a8: c2 2f 60 30 stb %g1, [ %i5 + 0x30 ] lfat_fd->map.last_cln = FAT_UNDEFINED_VALUE; 400123ac: 82 10 3f ff mov -1, %g1 lfat_fd->dir_pos = *dir_pos; 400123b0: 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; 400123b4: c2 27 60 3c st %g1, [ %i5 + 0x3c ] lfat_fd->dir_pos = *dir_pos; 400123b8: 40 00 2a 8a call 4001cde0 400123bc: 94 10 20 10 mov 0x10, %o2 if ( rc != RC_OK ) 400123c0: 80 a4 20 00 cmp %l0, 0 400123c4: 02 80 00 04 be 400123d4 <== NEVER TAKEN 400123c8: 01 00 00 00 nop 400123cc: 10 80 00 0f b 40012408 400123d0: f8 27 60 0c st %i4, [ %i5 + 0xc ] lfat_fd->ino = key; else { lfat_fd->ino = fat_get_unique_ino(fs_info); 400123d4: 40 00 06 a8 call 40013e74 <== NOT EXECUTED 400123d8: 90 10 00 18 mov %i0, %o0 <== NOT EXECUTED if ( lfat_fd->ino == 0 ) 400123dc: 80 a2 20 00 cmp %o0, 0 <== NOT EXECUTED 400123e0: 12 80 00 0a bne 40012408 <== NOT EXECUTED 400123e4: d0 27 60 0c st %o0, [ %i5 + 0xc ] <== NOT EXECUTED { free((*fat_fd)); 400123e8: 7f ff ca 7b call 40004dd4 <== NOT EXECUTED 400123ec: 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 ); 400123f0: 40 00 28 27 call 4001c48c <__errno> <== NOT EXECUTED 400123f4: b0 10 3f ff mov -1, %i0 <== NOT EXECUTED 400123f8: 82 10 20 0c mov 0xc, %g1 <== NOT EXECUTED 400123fc: c2 22 00 00 st %g1, [ %o0 ] <== NOT EXECUTED 40012400: 81 c7 e0 08 ret <== NOT EXECUTED 40012404: 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_unprotected((hash) + ((key1) % FAT_HASH_MODULE), &(el)->link); 40012408: c2 06 20 6c ld [ %i0 + 0x6c ], %g1 4001240c: b6 00 40 1b add %g1, %i3, %i3 Chain_Control *the_chain, Chain_Node *the_node ) { Chain_Node *tail = _Chain_Tail( the_chain ); Chain_Node *old_last = tail->previous; 40012410: c2 06 e0 08 ld [ %i3 + 8 ], %g1 RTEMS_INLINE_ROUTINE void _Chain_Append_unprotected( Chain_Control *the_chain, Chain_Node *the_node ) { Chain_Node *tail = _Chain_Tail( the_chain ); 40012414: 84 06 e0 04 add %i3, 4, %g2 Chain_Node *old_last = tail->previous; the_node->next = tail; 40012418: c4 27 40 00 st %g2, [ %i5 ] tail->previous = the_node; 4001241c: fa 26 e0 08 st %i5, [ %i3 + 8 ] old_last->next = the_node; 40012420: fa 20 40 00 st %i5, [ %g1 ] the_node->previous = old_last; 40012424: 10 bf ff bb b 40012310 40012428: c2 27 60 04 st %g1, [ %i5 + 4 ] =============================================================================== 40012440 : fat_file_fd_t *fat_fd, uint32_t start, uint32_t count, uint8_t *buf ) { 40012440: 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; 40012444: c0 27 bf fc clr [ %fp + -4 ] fat_file_fd_t *fat_fd, uint32_t start, uint32_t count, uint8_t *buf ) { 40012448: 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) 4001244c: 80 a6 e0 00 cmp %i3, 0 40012450: 02 80 00 67 be 400125ec <== NEVER TAKEN 40012454: 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 ) 40012458: c2 06 60 18 ld [ %i1 + 0x18 ], %g1 4001245c: 80 a6 80 01 cmp %i2, %g1 40012460: 1a 80 00 63 bcc 400125ec 40012464: 80 a6 c0 01 cmp %i3, %g1 return FAT_EOF; if ((count > fat_fd->fat_file_size) || 40012468: 38 80 00 07 bgu,a 40012484 4001246c: b6 20 40 1a sub %g1, %i2, %i3 (start > fat_fd->fat_file_size - count)) 40012470: 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) || 40012474: 80 a6 80 02 cmp %i2, %g2 40012478: 28 80 00 04 bleu,a 40012488 4001247c: c2 06 60 20 ld [ %i1 + 0x20 ], %g1 (start > fat_fd->fat_file_size - count)) count = fat_fd->fat_file_size - start; 40012480: b6 20 40 1a sub %g1, %i2, %i3 if ((FAT_FD_OF_ROOT_DIR(fat_fd)) && 40012484: c2 06 60 20 ld [ %i1 + 0x20 ], %g1 40012488: 80 a0 60 01 cmp %g1, 1 4001248c: 32 80 00 1c bne,a 400124fc 40012490: e4 0f 60 08 ldub [ %i5 + 8 ], %l2 40012494: c2 06 60 24 ld [ %i1 + 0x24 ], %g1 40012498: 80 a0 60 00 cmp %g1, 0 4001249c: 32 80 00 18 bne,a 400124fc <== NEVER TAKEN 400124a0: e4 0f 60 08 ldub [ %i5 + 8 ], %l2 <== NOT EXECUTED (fs_info->vol.type & (FAT_FAT12 | FAT_FAT16))) 400124a4: 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)) && 400124a8: 80 88 60 03 btst 3, %g1 400124ac: 22 80 00 14 be,a 400124fc 400124b0: 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); 400124b4: d2 06 60 1c ld [ %i1 + 0x1c ], %o1 400124b8: 7f ff ff 3a call 400121a0 400124bc: 90 10 00 1d mov %i5, %o0 sec += (start >> fs_info->vol.sec_log2); 400124c0: d2 0f 60 02 ldub [ %i5 + 2 ], %o1 byte = start & (fs_info->vol.bps - 1); 400124c4: 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); 400124c8: 93 36 80 09 srl %i2, %o1, %o1 byte = start & (fs_info->vol.bps - 1); 400124cc: 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); 400124d0: 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); 400124d4: 94 0e 80 0a and %i2, %o2, %o2 400124d8: 90 10 00 1d mov %i5, %o0 400124dc: 96 10 00 1b mov %i3, %o3 400124e0: 40 00 03 0f call 4001311c <_fat_block_read> 400124e4: 98 10 00 1c mov %i4, %o4 if ( ret < 0 ) 400124e8: 80 a2 20 00 cmp %o0, 0 400124ec: 16 80 00 40 bge 400125ec <== ALWAYS TAKEN 400124f0: 01 00 00 00 nop 400124f4: 10 80 00 3e b 400125ec <== NOT EXECUTED 400124f8: 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); 400124fc: f0 17 60 06 lduh [ %i5 + 6 ], %i0 return -1; return ret; } cl_start = start >> fs_info->vol.bpc_log2; 40012500: 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); 40012504: 90 10 00 1d mov %i5, %o0 40012508: 92 10 00 19 mov %i1, %o1 4001250c: 94 10 00 12 mov %l2, %o2 40012510: 7f ff ff 43 call 4001221c 40012514: 96 07 bf fc add %fp, -4, %o3 if (rc != RC_OK) 40012518: 90 92 60 00 orcc %o1, 0, %o0 4001251c: 12 80 00 34 bne 400125ec <== NEVER TAKEN 40012520: 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); 40012524: b1 2e 20 10 sll %i0, 0x10, %i0 40012528: b1 36 20 10 srl %i0, 0x10, %i0 4001252c: b0 06 3f ff add %i0, -1, %i0 40012530: b4 0e 80 18 and %i2, %i0, %i2 40012534: b0 10 20 00 clr %i0 40012538: a2 10 00 1a mov %i2, %l1 rc = fat_file_lseek(fs_info, fat_fd, cl_start, &cur_cln); if (rc != RC_OK) return rc; while (count > 0) 4001253c: 80 a6 e0 00 cmp %i3, 0 40012540: 22 80 00 22 be,a 400125c8 40012544: c2 0f 60 08 ldub [ %i5 + 8 ], %g1 { c = MIN(count, (fs_info->vol.bpc - ofs)); 40012548: e0 17 60 06 lduh [ %i5 + 6 ], %l0 4001254c: a0 24 00 11 sub %l0, %l1, %l0 40012550: 80 a4 00 1b cmp %l0, %i3 40012554: 38 80 00 02 bgu,a 4001255c 40012558: a0 10 00 1b mov %i3, %l0 sec = fat_cluster_num_to_sector_num(fs_info, cur_cln); 4001255c: d2 07 bf fc ld [ %fp + -4 ], %o1 40012560: 7f ff ff 10 call 400121a0 40012564: 90 10 00 1d mov %i5, %o0 sec += (ofs >> fs_info->vol.sec_log2); 40012568: d2 0f 60 02 ldub [ %i5 + 2 ], %o1 byte = ofs & (fs_info->vol.bps - 1); 4001256c: 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); 40012570: 93 34 40 09 srl %l1, %o1, %o1 byte = ofs & (fs_info->vol.bps - 1); 40012574: 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); 40012578: 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); 4001257c: 94 0c 40 0a and %l1, %o2, %o2 40012580: 90 10 00 1d mov %i5, %o0 40012584: 96 10 00 10 mov %l0, %o3 40012588: 40 00 02 e5 call 4001311c <_fat_block_read> 4001258c: 98 07 00 18 add %i4, %i0, %o4 if ( ret < 0 ) 40012590: 80 a2 20 00 cmp %o0, 0 40012594: 06 80 00 15 bl 400125e8 <== NEVER TAKEN 40012598: b6 26 c0 10 sub %i3, %l0, %i3 return -1; count -= c; cmpltd += c; 4001259c: b0 06 00 10 add %i0, %l0, %i0 save_cln = cur_cln; 400125a0: e0 07 bf fc ld [ %fp + -4 ], %l0 rc = fat_get_fat_cluster(fs_info, cur_cln, &cur_cln); 400125a4: 90 10 00 1d mov %i5, %o0 400125a8: 92 10 00 10 mov %l0, %o1 400125ac: 7f ff fd 4e call 40011ae4 400125b0: 94 07 bf fc add %fp, -4, %o2 if ( rc != RC_OK ) 400125b4: 80 a2 20 00 cmp %o0, 0 400125b8: 12 80 00 0d bne 400125ec <== NEVER TAKEN 400125bc: a2 10 20 00 clr %l1 rc = fat_file_lseek(fs_info, fat_fd, cl_start, &cur_cln); if (rc != RC_OK) return rc; while (count > 0) 400125c0: 10 bf ff e0 b 40012540 400125c4: 80 a6 e0 00 cmp %i3, 0 } /* 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); 400125c8: b4 06 bf ff add %i2, -1, %i2 fat_fd->map.disk_cln = save_cln; 400125cc: 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); 400125d0: b4 06 80 18 add %i2, %i0, %i2 fat_fd->map.disk_cln = save_cln; return cmpltd; 400125d4: 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); 400125d8: 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 + 400125dc: a4 06 80 12 add %i2, %l2, %l2 ((save_ofs + cmpltd - 1) >> fs_info->vol.bpc_log2); fat_fd->map.disk_cln = save_cln; return cmpltd; 400125e0: 10 80 00 03 b 400125ec 400125e4: 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; 400125e8: 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; } 400125ec: 81 c7 e0 08 ret 400125f0: 91 e8 00 08 restore %g0, %o0, %o0 =============================================================================== 40012d6c : int fat_file_size( fat_fs_info_t *fs_info, fat_file_fd_t *fat_fd ) { 40012d6c: 9d e3 bf 98 save %sp, -104, %sp int rc = RC_OK; uint32_t cur_cln = fat_fd->cln; 40012d70: c2 06 60 1c ld [ %i1 + 0x1c ], %g1 40012d74: 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)) && 40012d78: c2 06 60 20 ld [ %i1 + 0x20 ], %g1 40012d7c: 80 a0 60 01 cmp %g1, 1 40012d80: 12 80 00 0d bne 40012db4 40012d84: ba 10 00 18 mov %i0, %i5 40012d88: c2 06 60 24 ld [ %i1 + 0x24 ], %g1 40012d8c: 80 a0 60 00 cmp %g1, 0 40012d90: 32 80 00 0a bne,a 40012db8 <== NEVER TAKEN 40012d94: c0 26 60 18 clr [ %i1 + 0x18 ] <== NOT EXECUTED (fs_info->vol.type & (FAT_FAT12 | FAT_FAT16))) 40012d98: 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)) && 40012d9c: 80 88 60 03 btst 3, %g1 40012da0: 22 80 00 06 be,a 40012db8 40012da4: 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; 40012da8: c2 06 20 2c ld [ %i0 + 0x2c ], %g1 40012dac: 10 80 00 18 b 40012e0c 40012db0: c2 26 60 18 st %g1, [ %i1 + 0x18 ] return rc; } fat_fd->fat_file_size = 0; 40012db4: c0 26 60 18 clr [ %i1 + 0x18 ] fat_file_fd_t *fat_fd ) { int rc = RC_OK; uint32_t cur_cln = fat_fd->cln; uint32_t save_cln = 0; 40012db8: 82 10 20 00 clr %g1 return rc; } fat_fd->fat_file_size = 0; while ((cur_cln & fs_info->vol.mask) < fs_info->vol.eoc_val) 40012dbc: f8 07 bf fc ld [ %fp + -4 ], %i4 40012dc0: c6 07 60 10 ld [ %i5 + 0x10 ], %g3 40012dc4: c4 07 60 14 ld [ %i5 + 0x14 ], %g2 40012dc8: 86 0f 00 03 and %i4, %g3, %g3 40012dcc: 80 a0 c0 02 cmp %g3, %g2 40012dd0: 1a 80 00 0e bcc 40012e08 40012dd4: 90 10 00 1d mov %i5, %o0 { save_cln = cur_cln; rc = fat_get_fat_cluster(fs_info, cur_cln, &cur_cln); 40012dd8: 92 10 00 1c mov %i4, %o1 40012ddc: 7f ff fb 42 call 40011ae4 40012de0: 94 07 bf fc add %fp, -4, %o2 if ( rc != RC_OK ) 40012de4: b0 92 20 00 orcc %o0, 0, %i0 40012de8: 12 80 00 0a bne 40012e10 <== NEVER TAKEN 40012dec: 01 00 00 00 nop return rc; fat_fd->fat_file_size += fs_info->vol.bpc; 40012df0: c2 17 60 06 lduh [ %i5 + 6 ], %g1 40012df4: c4 06 60 18 ld [ %i1 + 0x18 ], %g2 40012df8: 82 00 80 01 add %g2, %g1, %g1 40012dfc: 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; 40012e00: 10 bf ff ef b 40012dbc 40012e04: 82 10 00 1c mov %i4, %g1 if ( rc != RC_OK ) return rc; fat_fd->fat_file_size += fs_info->vol.bpc; } fat_fd->map.last_cln = save_cln; 40012e08: c2 26 60 3c st %g1, [ %i1 + 0x3c ] return rc; 40012e0c: b0 10 20 00 clr %i0 } 40012e10: 81 c7 e0 08 ret 40012e14: 81 e8 00 00 restore =============================================================================== 400125f4 : fat_file_truncate( fat_fs_info_t *fs_info, fat_file_fd_t *fat_fd, uint32_t new_length ) { 400125f4: 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; 400125f8: 82 10 3f ff mov -1, %g1 400125fc: c2 27 bf fc st %g1, [ %fp + -4 ] if ( new_length >= fat_fd->fat_file_size ) 40012600: c2 06 60 18 ld [ %i1 + 0x18 ], %g1 40012604: 80 a6 80 01 cmp %i2, %g1 40012608: 0a 80 00 04 bcs 40012618 4001260c: c0 27 bf f8 clr [ %fp + -8 ] return rc; 40012610: 10 80 00 3b b 400126fc 40012614: 92 10 20 00 clr %o1 assert(fat_fd->fat_file_size); 40012618: 80 a0 60 00 cmp %g1, 0 4001261c: 32 80 00 0a bne,a 40012644 <== ALWAYS TAKEN 40012620: c4 0e 20 08 ldub [ %i0 + 8 ], %g2 40012624: 11 10 00 b3 sethi %hi(0x4002cc00), %o0 <== NOT EXECUTED 40012628: 15 10 00 b3 sethi %hi(0x4002cc00), %o2 <== NOT EXECUTED 4001262c: 17 10 00 b3 sethi %hi(0x4002cc00), %o3 <== NOT EXECUTED 40012630: 90 12 21 80 or %o0, 0x180, %o0 <== NOT EXECUTED 40012634: 92 10 22 d4 mov 0x2d4, %o1 <== NOT EXECUTED 40012638: 94 12 a1 e8 or %o2, 0x1e8, %o2 <== NOT EXECUTED 4001263c: 7f ff c9 7e call 40004c34 <__assert_func> <== NOT EXECUTED 40012640: 96 12 e1 d0 or %o3, 0x1d0, %o3 <== NOT EXECUTED cl_start = (new_length + fs_info->vol.bpc - 1) >> fs_info->vol.bpc_log2; 40012644: c6 16 20 06 lduh [ %i0 + 6 ], %g3 40012648: 86 00 ff ff add %g3, -1, %g3 4001264c: b4 00 c0 1a add %g3, %i2, %i2 40012650: b5 36 80 02 srl %i2, %g2, %i2 if ((cl_start << fs_info->vol.bpc_log2) >= fat_fd->fat_file_size) 40012654: 85 2e 80 02 sll %i2, %g2, %g2 40012658: 80 a0 80 01 cmp %g2, %g1 4001265c: 1a bf ff ed bcc 40012610 40012660: 80 a6 a0 00 cmp %i2, 0 return RC_OK; if (cl_start != 0) 40012664: 12 80 00 0b bne 40012690 40012668: 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); 4001266c: 92 10 00 19 mov %i1, %o1 40012670: 94 10 00 1a mov %i2, %o2 40012674: 7f ff fe ea call 4001221c 40012678: 96 07 bf f8 add %fp, -8, %o3 if (rc != RC_OK) 4001267c: 80 a2 60 00 cmp %o1, 0 40012680: 32 80 00 20 bne,a 40012700 <== NEVER TAKEN 40012684: b0 10 00 09 mov %o1, %i0 <== NOT EXECUTED return rc; rc = fat_free_fat_clusters_chain(fs_info, cur_cln); 40012688: 10 80 00 0b b 400126b4 4001268c: 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); 40012690: 92 10 00 19 mov %i1, %o1 40012694: 94 06 bf ff add %i2, -1, %o2 40012698: 7f ff fe e1 call 4001221c 4001269c: 96 07 bf fc add %fp, -4, %o3 if (rc != RC_OK) 400126a0: 80 a2 60 00 cmp %o1, 0 400126a4: 02 bf ff f2 be 4001266c <== ALWAYS TAKEN 400126a8: 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; } 400126ac: 81 c7 e0 08 ret <== NOT EXECUTED 400126b0: 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); 400126b4: 7f ff fe 18 call 40011f14 400126b8: 90 10 00 18 mov %i0, %o0 if (rc != RC_OK) 400126bc: 92 92 20 00 orcc %o0, 0, %o1 400126c0: 12 80 00 0f bne 400126fc <== NEVER TAKEN 400126c4: 80 a6 a0 00 cmp %i2, 0 return rc; if (cl_start != 0) 400126c8: 02 80 00 0d be 400126fc 400126cc: 92 10 20 00 clr %o1 { rc = fat_set_fat_cluster(fs_info, new_last_cln, FAT_GENFAT_EOC); 400126d0: d2 07 bf fc ld [ %fp + -4 ], %o1 400126d4: 90 10 00 18 mov %i0, %o0 400126d8: 7f ff fd 71 call 40011c9c 400126dc: 94 10 3f ff mov -1, %o2 if ( rc != RC_OK ) 400126e0: 92 92 20 00 orcc %o0, 0, %o1 400126e4: 12 80 00 06 bne 400126fc <== NEVER TAKEN 400126e8: c2 07 bf fc ld [ %fp + -4 ], %g1 return rc; fat_fd->map.file_cln = cl_start - 1; 400126ec: b4 06 bf ff add %i2, -1, %i2 fat_fd->map.disk_cln = new_last_cln; 400126f0: 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; 400126f4: f4 26 60 34 st %i2, [ %i1 + 0x34 ] fat_fd->map.disk_cln = new_last_cln; fat_fd->map.last_cln = new_last_cln; 400126f8: c2 26 60 3c st %g1, [ %i1 + 0x3c ] } return RC_OK; } 400126fc: b0 10 00 09 mov %o1, %i0 40012700: 81 c7 e0 08 ret 40012704: 81 e8 00 00 restore =============================================================================== 40012acc : fat_file_fd_t *fat_fd, uint32_t start, uint32_t count, const uint8_t *buf ) { 40012acc: 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; 40012ad0: c0 27 bf f8 clr [ %fp + -8 ] fat_file_fd_t *fat_fd, uint32_t start, uint32_t count, const uint8_t *buf ) { 40012ad4: 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; 40012ad8: c2 06 60 18 ld [ %i1 + 0x18 ], %g1 uint32_t file_cln_initial = fat_fd->map.file_cln; 40012adc: e6 06 60 34 ld [ %i1 + 0x34 ], %l3 uint32_t cln; if ( count == 0 ) 40012ae0: 80 a6 e0 00 cmp %i3, 0 40012ae4: 02 80 00 0a be 40012b0c <== NEVER TAKEN 40012ae8: b0 10 20 00 clr %i0 return cmpltd; if (start >= fat_fd->size_limit) 40012aec: fa 06 60 14 ld [ %i1 + 0x14 ], %i5 40012af0: 80 a6 80 1d cmp %i2, %i5 40012af4: 2a 80 00 08 bcs,a 40012b14 <== ALWAYS TAKEN 40012af8: ba 27 40 1a sub %i5, %i2, %i5 rtems_set_errno_and_return_minus_one(EFBIG); 40012afc: 40 00 26 64 call 4001c48c <__errno> <== NOT EXECUTED 40012b00: b0 10 3f ff mov -1, %i0 <== NOT EXECUTED 40012b04: 82 10 20 1b mov 0x1b, %g1 <== NOT EXECUTED 40012b08: c2 22 00 00 st %g1, [ %o0 ] <== NOT EXECUTED 40012b0c: 81 c7 e0 08 ret 40012b10: 81 e8 00 00 restore 40012b14: 80 a7 40 1b cmp %i5, %i3 40012b18: 38 80 00 02 bgu,a 40012b20 <== ALWAYS TAKEN 40012b1c: 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; 40012b20: 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); 40012b24: b6 07 40 1a add %i5, %i2, %i3 40012b28: 94 40 20 00 addx %g0, 0, %o2 40012b2c: 90 10 00 10 mov %l0, %o0 40012b30: 92 10 00 19 mov %i1, %o1 40012b34: 96 10 00 1b mov %i3, %o3 40012b38: 7f ff ff 56 call 40012890 40012b3c: 98 07 bf f8 add %fp, -8, %o4 if (RC_OK == rc) 40012b40: 80 a2 20 00 cmp %o0, 0 40012b44: 12 bf ff f2 bne 40012b0c 40012b48: b0 10 00 08 mov %o0, %i0 { /* * check whether there was enough room on device to locate * file of 'start + count' bytes */ if (c != (start + count)) 40012b4c: c2 07 bf f8 ld [ %fp + -8 ], %g1 40012b50: 80 a0 40 1b cmp %g1, %i3 40012b54: 32 80 00 02 bne,a 40012b5c 40012b58: ba 20 40 1a sub %g1, %i2, %i5 */ 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)); 40012b5c: 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)) 40012b60: 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)); 40012b64: 80 a0 e0 01 cmp %g3, 1 40012b68: 12 80 00 09 bne 40012b8c 40012b6c: 82 10 20 00 clr %g1 40012b70: c6 06 60 24 ld [ %i1 + 0x24 ], %g3 40012b74: 80 a0 e0 00 cmp %g3, 0 40012b78: 12 80 00 06 bne 40012b90 <== NEVER TAKEN 40012b7c: 80 a0 60 00 cmp %g1, 0 40012b80: 82 08 a0 03 and %g2, 3, %g1 40012b84: 80 a0 00 01 cmp %g0, %g1 40012b88: 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)) 40012b8c: 80 a0 60 00 cmp %g1, 0 40012b90: 02 80 00 12 be 40012bd8 40012b94: f6 0c 20 08 ldub [ %l0 + 8 ], %i3 { cln = fat_fd->cln; 40012b98: d2 06 60 1c ld [ %i1 + 0x1c ], %o1 cln += (start >> fs_info->vol.bpc_log2); byte = start & (fs_info->vol.bpc -1); 40012b9c: 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); 40012ba0: b7 36 80 1b srl %i2, %i3, %i3 byte = start & (fs_info->vol.bpc -1); 40012ba4: 94 02 bf ff add %o2, -1, %o2 ret = fat_cluster_write(fs_info, 40012ba8: 90 10 00 10 mov %l0, %o0 40012bac: 92 06 c0 09 add %i3, %o1, %o1 40012bb0: 94 0e 80 0a and %i2, %o2, %o2 40012bb4: 96 10 00 1d mov %i5, %o3 40012bb8: 98 10 00 1c mov %i4, %o4 40012bbc: 40 00 01 e1 call 40013340 40012bc0: 9a 10 20 00 clr %o5 cln, byte, count, buf, false); if (0 > ret) 40012bc4: 80 a2 20 00 cmp %o0, 0 40012bc8: 36 bf ff d1 bge,a 40012b0c <== ALWAYS TAKEN 40012bcc: b0 10 00 08 mov %o0, %i0 rc = -1; 40012bd0: 10 80 00 4b b 40012cfc <== NOT EXECUTED 40012bd4: 90 10 3f ff mov -1, %o0 <== 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; 40012bd8: 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; 40012bdc: 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); 40012be0: 90 10 00 10 mov %l0, %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; 40012be4: 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); 40012be8: 92 10 00 19 mov %i1, %o1 40012bec: 94 10 00 11 mov %l1, %o2 40012bf0: 7f ff fd 8b call 4001221c 40012bf4: 96 07 bf fc add %fp, -4, %o3 if (RC_OK == rc) 40012bf8: 80 a2 60 00 cmp %o1, 0 40012bfc: 12 80 00 2e bne 40012cb4 <== NEVER TAKEN 40012c00: e4 07 bf fc ld [ %fp + -4 ], %l2 { file_cln_cnt = cur_cln - fat_fd->cln; 40012c04: c2 06 60 1c ld [ %i1 + 0x1c ], %g1 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); 40012c08: b7 2c 40 1b sll %l1, %i3, %i3 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; 40012c0c: 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); 40012c10: 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; 40012c14: 82 10 20 00 clr %g1 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); 40012c18: 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; 40012c1c: aa 10 20 00 clr %l5 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 */ 40012c20: a8 10 20 00 clr %l4 const uint32_t count, const uint8_t *buf, const uint32_t file_cln_initial) { int rc = RC_OK; uint32_t cmpltd = 0; 40012c24: b6 10 20 00 clr %i3 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) 40012c28: 80 a7 60 00 cmp %i5, 0 40012c2c: 02 80 00 17 be 40012c88 40012c30: 80 a0 60 00 cmp %g1, 0 40012c34: 32 80 00 16 bne,a 40012c8c <== NEVER TAKEN 40012c38: c4 0c 20 08 ldub [ %l0 + 8 ], %g2 <== NOT EXECUTED && (bytes_to_write > 0)) { c = MIN(bytes_to_write, (fs_info->vol.bpc - ofs_cln)); 40012c3c: d6 14 20 06 lduh [ %l0 + 6 ], %o3 40012c40: 96 22 c0 18 sub %o3, %i0, %o3 40012c44: 80 a2 c0 1d cmp %o3, %i5 40012c48: 38 80 00 02 bgu,a 40012c50 40012c4c: 96 10 00 1d mov %i5, %o3 if (file_cln_initial < file_cln_cnt) 40012c50: 80 a4 c0 12 cmp %l3, %l2 40012c54: 2a 80 00 02 bcs,a 40012c5c 40012c58: aa 10 20 01 mov 1, %l5 overwrite_cluster = true; ret = fat_cluster_write(fs_info, 40012c5c: d2 07 bf fc ld [ %fp + -4 ], %o1 40012c60: 90 10 00 10 mov %l0, %o0 40012c64: 94 10 00 18 mov %i0, %o2 40012c68: 98 07 00 1b add %i4, %i3, %o4 40012c6c: 40 00 01 b5 call 40013340 40012c70: 9a 0d 60 01 and %l5, 1, %o5 cur_cln, ofs_cln, c, &buf[cmpltd], overwrite_cluster); if (0 > ret) 40012c74: 80 a2 20 00 cmp %o0, 0 40012c78: 16 80 00 13 bge 40012cc4 <== ALWAYS TAKEN 40012c7c: 82 10 3f ff mov -1, %g1 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) 40012c80: 10 bf ff eb b 40012c2c <== NOT EXECUTED 40012c84: 80 a7 60 00 cmp %i5, 0 <== NOT EXECUTED } /* 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); 40012c88: c4 0c 20 08 ldub [ %l0 + 8 ], %g2 40012c8c: b4 06 bf ff add %i2, -1, %i2 fat_fd->map.disk_cln = save_cln; 40012c90: e8 26 60 38 st %l4, [ %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); 40012c94: b4 06 80 1b add %i2, %i3, %i2 40012c98: b5 36 80 02 srl %i2, %g2, %i2 } } /* update cache */ /* XXX: check this - I'm not sure :( */ fat_fd->map.file_cln = start_cln + 40012c9c: 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) 40012ca0: 92 90 60 00 orcc %g1, 0, %o1 40012ca4: 12 80 00 03 bne 40012cb0 <== NEVER TAKEN 40012ca8: e2 26 60 34 st %l1, [ %i1 + 0x34 ] return rc; else return cmpltd; 40012cac: 92 10 00 1b mov %i3, %o1 fat_fd, start, count, buf, file_cln_initial); if (0 > ret) 40012cb0: 80 a2 60 00 cmp %o1, 0 40012cb4: 16 80 00 12 bge 40012cfc <== ALWAYS TAKEN 40012cb8: 90 10 00 09 mov %o1, %o0 40012cbc: 10 80 00 10 b 40012cfc <== NOT EXECUTED 40012cc0: 90 10 3f ff mov -1, %o0 <== NOT EXECUTED if (0 > ret) rc = -1; if (RC_OK == rc) { ++file_cln_cnt; 40012cc4: a4 04 a0 01 inc %l2 bytes_to_write -= ret; cmpltd += ret; 40012cc8: b6 06 c0 08 add %i3, %o0, %i3 save_cln = cur_cln; if (0 < bytes_to_write) 40012ccc: ba a7 40 08 subcc %i5, %o0, %i5 40012cd0: 02 80 00 09 be 40012cf4 40012cd4: e8 07 bf fc ld [ %fp + -4 ], %l4 rc = fat_get_fat_cluster(fs_info, cur_cln, &cur_cln); 40012cd8: 90 10 00 10 mov %l0, %o0 40012cdc: 92 10 00 14 mov %l4, %o1 40012ce0: 7f ff fb 81 call 40011ae4 40012ce4: 94 07 bf fc add %fp, -4, %o2 40012ce8: 82 10 00 08 mov %o0, %g1 ofs_cln = 0; 40012cec: 10 bf ff cf b 40012c28 40012cf0: b0 10 20 00 clr %i0 { ++file_cln_cnt; bytes_to_write -= ret; cmpltd += ret; save_cln = cur_cln; if (0 < bytes_to_write) 40012cf4: 10 bf ff fe b 40012cec 40012cf8: 82 10 20 00 clr %g1 } } if (RC_OK != rc) return rc; else return cmpltd; 40012cfc: b0 10 00 08 mov %o0, %i0 } 40012d00: 81 c7 e0 08 ret 40012d04: 81 e8 00 00 restore =============================================================================== 40011f14 : int fat_free_fat_clusters_chain( fat_fs_info_t *fs_info, uint32_t chain ) { 40011f14: 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; 40011f18: ba 10 20 00 clr %i5 uint32_t chain ) { int rc = RC_OK, rc1 = RC_OK; uint32_t cur_cln = chain; uint32_t next_cln = 0; 40011f1c: 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; 40011f20: b8 10 00 19 mov %i1, %i4 fat_free_fat_clusters_chain( fat_fs_info_t *fs_info, uint32_t chain ) { int rc = RC_OK, rc1 = RC_OK; 40011f24: b6 10 20 00 clr %i3 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) 40011f28: c4 06 20 10 ld [ %i0 + 0x10 ], %g2 40011f2c: c2 06 20 14 ld [ %i0 + 0x14 ], %g1 40011f30: 84 0f 00 02 and %i4, %g2, %g2 40011f34: 80 a0 80 01 cmp %g2, %g1 40011f38: 1a 80 00 1c bcc 40011fa8 40011f3c: 90 10 00 18 mov %i0, %o0 { rc = fat_get_fat_cluster(fs_info, cur_cln, &next_cln); 40011f40: 92 10 00 1c mov %i4, %o1 40011f44: 7f ff fe e8 call 40011ae4 40011f48: 94 07 bf fc add %fp, -4, %o2 if ( rc != RC_OK ) 40011f4c: b4 92 20 00 orcc %o0, 0, %i2 40011f50: 02 80 00 0c be 40011f80 <== ALWAYS TAKEN 40011f54: 90 10 00 18 mov %i0, %o0 { if(fs_info->vol.free_cls != FAT_UNDEFINED_VALUE) 40011f58: c2 06 20 44 ld [ %i0 + 0x44 ], %g1 <== NOT EXECUTED 40011f5c: 80 a0 7f ff cmp %g1, -1 <== NOT EXECUTED 40011f60: 02 80 00 04 be 40011f70 <== NOT EXECUTED 40011f64: ba 07 40 01 add %i5, %g1, %i5 <== NOT EXECUTED fs_info->vol.free_cls += freed_cls_cnt; 40011f68: fa 26 20 44 st %i5, [ %i0 + 0x44 ] <== NOT EXECUTED fat_buf_release(fs_info); 40011f6c: 90 10 00 18 mov %i0, %o0 <== NOT EXECUTED 40011f70: 40 00 03 cb call 40012e9c <== NOT EXECUTED 40011f74: b0 10 00 1a mov %i2, %i0 <== NOT EXECUTED return rc; 40011f78: 81 c7 e0 08 ret <== NOT EXECUTED 40011f7c: 81 e8 00 00 restore <== NOT EXECUTED } rc = fat_set_fat_cluster(fs_info, cur_cln, FAT_GENFAT_FREE); 40011f80: 92 10 00 1c mov %i4, %o1 40011f84: 7f ff ff 46 call 40011c9c 40011f88: 94 10 20 00 clr %o2 if ( rc != RC_OK ) 40011f8c: 80 a2 20 00 cmp %o0, 0 40011f90: 22 80 00 02 be,a 40011f98 <== ALWAYS TAKEN 40011f94: 90 10 00 1b mov %i3, %o0 rc1 = rc; freed_cls_cnt++; 40011f98: ba 07 60 01 inc %i5 cur_cln = next_cln; 40011f9c: f8 07 bf fc ld [ %fp + -4 ], %i4 40011fa0: 10 bf ff e2 b 40011f28 40011fa4: b6 10 00 08 mov %o0, %i3 } fs_info->vol.next_cl = chain; if (fs_info->vol.free_cls != FAT_UNDEFINED_VALUE) 40011fa8: c2 06 20 44 ld [ %i0 + 0x44 ], %g1 40011fac: 80 a0 7f ff cmp %g1, -1 40011fb0: 02 80 00 04 be 40011fc0 <== ALWAYS TAKEN 40011fb4: f2 26 20 4c st %i1, [ %i0 + 0x4c ] fs_info->vol.free_cls += freed_cls_cnt; 40011fb8: ba 07 40 01 add %i5, %g1, %i5 <== NOT EXECUTED 40011fbc: fa 26 20 44 st %i5, [ %i0 + 0x44 ] <== NOT EXECUTED fat_buf_release(fs_info); 40011fc0: 90 10 00 18 mov %i0, %o0 40011fc4: 40 00 03 b6 call 40012e9c 40011fc8: b0 10 00 1b mov %i3, %i0 if (rc1 != RC_OK) return rc1; return RC_OK; } 40011fcc: 81 c7 e0 08 ret 40011fd0: 81 e8 00 00 restore =============================================================================== 40013f34 : 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); 40013f34: c2 02 20 80 ld [ %o0 + 0x80 ], %g1 <== NOT EXECUTED 40013f38: c4 02 20 74 ld [ %o0 + 0x74 ], %g2 <== NOT EXECUTED 40013f3c: 86 10 20 01 mov 1, %g3 <== NOT EXECUTED 40013f40: 92 22 40 01 sub %o1, %g1, %o1 <== NOT EXECUTED 40013f44: 83 32 60 03 srl %o1, 3, %g1 <== NOT EXECUTED 40013f48: 92 0a 60 07 and %o1, 7, %o1 <== NOT EXECUTED 40013f4c: 93 28 c0 09 sll %g3, %o1, %o1 <== NOT EXECUTED 40013f50: c6 08 80 01 ldub [ %g2 + %g1 ], %g3 <== NOT EXECUTED 40013f54: 92 28 c0 09 andn %g3, %o1, %o1 <== NOT EXECUTED 40013f58: 81 c3 e0 08 retl <== NOT EXECUTED 40013f5c: d2 28 80 01 stb %o1, [ %g2 + %g1 ] <== NOT EXECUTED =============================================================================== 40011ae4 : fat_get_fat_cluster( fat_fs_info_t *fs_info, uint32_t cln, uint32_t *ret_val ) { 40011ae4: 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)) ) 40011ae8: 80 a6 60 01 cmp %i1, 1 40011aec: 08 80 00 66 bleu 40011c84 <== NEVER TAKEN 40011af0: ba 10 00 18 mov %i0, %i5 40011af4: c2 06 20 38 ld [ %i0 + 0x38 ], %g1 40011af8: 82 00 60 01 inc %g1 40011afc: 80 a6 40 01 cmp %i1, %g1 40011b00: 18 80 00 61 bgu 40011c84 <== NEVER TAKEN 40011b04: 01 00 00 00 nop rtems_set_errno_and_return_minus_one(EIO); sec = (FAT_FAT_OFFSET(fs_info->vol.type, cln) >> fs_info->vol.sec_log2) + 40011b08: c4 0e 20 0e ldub [ %i0 + 0xe ], %g2 40011b0c: 86 88 a0 01 andcc %g2, 1, %g3 40011b10: 02 80 00 05 be 40011b24 40011b14: 80 88 a0 02 btst 2, %g2 40011b18: 83 36 60 01 srl %i1, 1, %g1 40011b1c: 10 80 00 05 b 40011b30 40011b20: 82 00 40 19 add %g1, %i1, %g1 40011b24: 02 80 00 03 be 40011b30 40011b28: 83 2e 60 02 sll %i1, 2, %g1 40011b2c: 83 2e 60 01 sll %i1, 1, %g1 40011b30: f6 0f 60 02 ldub [ %i5 + 2 ], %i3 40011b34: c8 07 60 58 ld [ %i5 + 0x58 ], %g4 40011b38: 83 30 40 1b srl %g1, %i3, %g1 fs_info->vol.afat_loc; ofs = FAT_FAT_OFFSET(fs_info->vol.type, cln) & (fs_info->vol.bps - 1); 40011b3c: 80 a0 e0 00 cmp %g3, 0 40011b40: 02 80 00 05 be 40011b54 40011b44: b6 00 40 04 add %g1, %g4, %i3 40011b48: b9 36 60 01 srl %i1, 1, %i4 40011b4c: 10 80 00 06 b 40011b64 40011b50: b8 07 00 19 add %i4, %i1, %i4 40011b54: 80 88 a0 02 btst 2, %g2 40011b58: 02 80 00 03 be 40011b64 40011b5c: b9 2e 60 02 sll %i1, 2, %i4 40011b60: b9 2e 60 01 sll %i1, 1, %i4 40011b64: e0 17 40 00 lduh [ %i5 ], %l0 rc = fat_buf_access(fs_info, sec, FAT_OP_TYPE_READ, &sec_buf); 40011b68: 90 10 00 1d mov %i5, %o0 40011b6c: 92 10 00 1b mov %i3, %o1 40011b70: 94 10 20 01 mov 1, %o2 40011b74: 40 00 05 3b call 40013060 40011b78: 96 07 bf fc add %fp, -4, %o3 if (rc != RC_OK) 40011b7c: b0 92 20 00 orcc %o0, 0, %i0 40011b80: 12 80 00 39 bne 40011c64 <== NEVER TAKEN 40011b84: 83 2c 20 10 sll %l0, 0x10, %g1 return rc; switch ( fs_info->vol.type ) 40011b88: c4 0f 60 0e ldub [ %i5 + 0xe ], %g2 40011b8c: 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); 40011b90: 83 30 60 10 srl %g1, 0x10, %g1 40011b94: 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 ) 40011b98: 02 80 00 29 be 40011c3c 40011b9c: 82 0f 00 01 and %i4, %g1, %g1 40011ba0: 80 a0 a0 04 cmp %g2, 4 40011ba4: 02 80 00 32 be 40011c6c 40011ba8: 80 a0 a0 01 cmp %g2, 1 40011bac: 12 80 00 36 bne 40011c84 <== NEVER TAKEN 40011bb0: 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) ) 40011bb4: 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)); 40011bb8: c4 08 c0 01 ldub [ %g3 + %g1 ], %g2 if ( ofs == (fs_info->vol.bps - 1) ) 40011bbc: 88 01 3f ff add %g4, -1, %g4 40011bc0: 80 a0 40 04 cmp %g1, %g4 40011bc4: 12 80 00 10 bne 40011c04 40011bc8: c4 26 80 00 st %g2, [ %i2 ] { rc = fat_buf_access(fs_info, sec + 1, FAT_OP_TYPE_READ, 40011bcc: 90 10 00 1d mov %i5, %o0 40011bd0: 92 06 e0 01 add %i3, 1, %o1 40011bd4: 94 10 20 01 mov 1, %o2 40011bd8: 40 00 05 22 call 40013060 40011bdc: 96 07 bf fc add %fp, -4, %o3 &sec_buf); if (rc != RC_OK) 40011be0: b0 92 20 00 orcc %o0, 0, %i0 40011be4: 12 80 00 20 bne 40011c64 <== NEVER TAKEN 40011be8: c2 07 bf fc ld [ %fp + -4 ], %g1 return rc; *ret_val |= *sec_buf << 8; 40011bec: c4 06 80 00 ld [ %i2 ], %g2 40011bf0: c2 08 40 00 ldub [ %g1 ], %g1 40011bf4: 83 28 60 08 sll %g1, 8, %g1 40011bf8: 82 10 80 01 or %g2, %g1, %g1 40011bfc: 10 80 00 07 b 40011c18 40011c00: c2 26 80 00 st %g1, [ %i2 ] } else { *ret_val |= *(sec_buf + ofs + 1) << 8; 40011c04: 82 00 c0 01 add %g3, %g1, %g1 40011c08: c2 08 60 01 ldub [ %g1 + 1 ], %g1 40011c0c: 83 28 60 08 sll %g1, 8, %g1 40011c10: 84 10 40 02 or %g1, %g2, %g2 40011c14: c4 26 80 00 st %g2, [ %i2 ] } if ( FAT_CLUSTER_IS_ODD(cln) ) 40011c18: 80 8e 60 01 btst 1, %i1 40011c1c: 02 80 00 04 be 40011c2c 40011c20: c2 06 80 00 ld [ %i2 ], %g1 *ret_val = (*ret_val) >> FAT12_SHIFT; 40011c24: 10 80 00 03 b 40011c30 40011c28: 83 30 60 04 srl %g1, 4, %g1 else *ret_val = (*ret_val) & FAT_FAT12_MASK; 40011c2c: 82 08 6f ff and %g1, 0xfff, %g1 40011c30: c2 26 80 00 st %g1, [ %i2 ] default: rtems_set_errno_and_return_minus_one(EIO); break; } return RC_OK; 40011c34: 81 c7 e0 08 ret 40011c38: 91 e8 20 00 restore %g0, 0, %o0 else *ret_val = (*ret_val) & FAT_FAT12_MASK; break; case FAT_FAT16: *ret_val = *((uint16_t *)(sec_buf + ofs)); 40011c3c: c4 07 bf fc ld [ %fp + -4 ], %g2 40011c40: c2 10 80 01 lduh [ %g2 + %g1 ], %g1 *ret_val = CF_LE_W(*ret_val); 40011c44: 05 00 00 3f sethi %hi(0xfc00), %g2 40011c48: 83 28 60 10 sll %g1, 0x10, %g1 40011c4c: 84 10 a3 ff or %g2, 0x3ff, %g2 40011c50: 87 30 60 08 srl %g1, 8, %g3 40011c54: 83 30 60 18 srl %g1, 0x18, %g1 40011c58: 84 08 c0 02 and %g3, %g2, %g2 40011c5c: 82 10 80 01 or %g2, %g1, %g1 40011c60: c2 26 80 00 st %g1, [ %i2 ] break; 40011c64: 81 c7 e0 08 ret 40011c68: 81 e8 00 00 restore case FAT_FAT32: *ret_val = *((uint32_t *)(sec_buf + ofs)); *ret_val = CF_LE_L(*ret_val); 40011c6c: c4 07 bf fc ld [ %fp + -4 ], %g2 40011c70: 7f ff ff 91 call 40011ab4 40011c74: d0 00 80 01 ld [ %g2 + %g1 ], %o0 40011c78: d0 26 80 00 st %o0, [ %i2 ] break; 40011c7c: 81 c7 e0 08 ret 40011c80: 81 e8 00 00 restore default: rtems_set_errno_and_return_minus_one(EIO); 40011c84: 40 00 2a 02 call 4001c48c <__errno> <== NOT EXECUTED 40011c88: b0 10 3f ff mov -1, %i0 <== NOT EXECUTED 40011c8c: 82 10 20 05 mov 5, %g1 <== NOT EXECUTED 40011c90: c2 22 00 00 st %g1, [ %o0 ] <== NOT EXECUTED break; } return RC_OK; } 40011c94: 81 c7 e0 08 ret <== NOT EXECUTED 40011c98: 81 e8 00 00 restore <== NOT EXECUTED =============================================================================== 40013e74 : * 0 means FAILED !!! * */ uint32_t fat_get_unique_ino(fat_fs_info_t *fs_info) { 40013e74: 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)) 40013e78: 39 03 ff ff sethi %hi(0xffffc00), %i4 <== NOT EXECUTED 40013e7c: b8 17 23 ff or %i4, 0x3ff, %i4 ! fffffff <== NOT EXECUTED uint32_t j = 0; bool resrc_unsuff = false; while (!resrc_unsuff) { for (j = 0; j < fs_info->uino_pool_size; j++) 40013e80: c8 06 20 7c ld [ %i0 + 0x7c ], %g4 <== NOT EXECUTED 40013e84: 92 10 20 00 clr %o1 <== NOT EXECUTED 40013e88: 80 a2 40 04 cmp %o1, %g4 <== NOT EXECUTED 40013e8c: 22 80 00 1b be,a 40013ef8 <== NOT EXECUTED 40013e90: c2 06 20 80 ld [ %i0 + 0x80 ], %g1 <== NOT EXECUTED { if (!FAT_UNIQ_INO_IS_BUSY(fs_info->index, fs_info->uino)) 40013e94: c6 06 20 74 ld [ %i0 + 0x74 ], %g3 <== NOT EXECUTED 40013e98: c2 06 20 78 ld [ %i0 + 0x78 ], %g1 <== NOT EXECUTED 40013e9c: 85 30 60 03 srl %g1, 3, %g2 <== NOT EXECUTED 40013ea0: b6 00 c0 02 add %g3, %g2, %i3 <== NOT EXECUTED 40013ea4: f4 08 c0 02 ldub [ %g3 + %g2 ], %i2 <== NOT EXECUTED 40013ea8: c4 48 c0 02 ldsb [ %g3 + %g2 ], %g2 <== NOT EXECUTED 40013eac: ba 08 60 07 and %g1, 7, %i5 <== NOT EXECUTED 40013eb0: 85 38 80 1d sra %g2, %i5, %g2 <== NOT EXECUTED 40013eb4: 80 88 a0 01 btst 1, %g2 <== NOT EXECUTED 40013eb8: 12 80 00 0a bne 40013ee0 <== NOT EXECUTED 40013ebc: 82 00 60 01 inc %g1 <== NOT EXECUTED { FAT_SET_UNIQ_INO_BUSY(fs_info->index, fs_info->uino); 40013ec0: 82 10 20 01 mov 1, %g1 <== NOT EXECUTED 40013ec4: bb 28 40 1d sll %g1, %i5, %i5 <== NOT EXECUTED 40013ec8: ba 17 40 1a or %i5, %i2, %i5 <== NOT EXECUTED 40013ecc: fa 2e c0 00 stb %i5, [ %i3 ] <== NOT EXECUTED return (fs_info->uino_base + fs_info->index); 40013ed0: c4 06 20 78 ld [ %i0 + 0x78 ], %g2 <== NOT EXECUTED 40013ed4: c2 06 20 80 ld [ %i0 + 0x80 ], %g1 <== NOT EXECUTED 40013ed8: 81 c7 e0 08 ret <== NOT EXECUTED 40013edc: 91 e8 80 01 restore %g2, %g1, %o0 <== NOT EXECUTED } fs_info->index++; if (fs_info->index >= fs_info->uino_pool_size) 40013ee0: 80 a0 40 04 cmp %g1, %g4 <== NOT EXECUTED 40013ee4: 3a 80 00 03 bcc,a 40013ef0 <== NOT EXECUTED 40013ee8: c0 26 20 78 clr [ %i0 + 0x78 ] <== NOT EXECUTED 40013eec: 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++) 40013ef0: 10 bf ff e6 b 40013e88 <== NOT EXECUTED 40013ef4: 92 02 60 01 inc %o1 <== 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)) 40013ef8: 93 2a 60 01 sll %o1, 1, %o1 <== NOT EXECUTED 40013efc: 82 27 00 01 sub %i4, %g1, %g1 <== NOT EXECUTED 40013f00: 80 a2 40 01 cmp %o1, %g1 <== NOT EXECUTED 40013f04: 2a 80 00 04 bcs,a 40013f14 <== NOT EXECUTED 40013f08: d0 06 20 74 ld [ %i0 + 0x74 ], %o0 <== NOT EXECUTED resrc_unsuff = true; } else resrc_unsuff = true; } return 0; 40013f0c: 81 c7 e0 08 ret <== NOT EXECUTED 40013f10: 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); 40013f14: 7f ff c7 28 call 40005bb4 <== NOT EXECUTED 40013f18: d2 26 20 7c st %o1, [ %i0 + 0x7c ] <== NOT EXECUTED if (fs_info->uino != NULL) 40013f1c: 80 a2 20 00 cmp %o0, 0 <== NOT EXECUTED 40013f20: 02 bf ff fb be 40013f0c <== NOT EXECUTED 40013f24: d0 26 20 74 st %o0, [ %i0 + 0x74 ] <== NOT EXECUTED fs_info->index = fs_info->uino_pool_size; 40013f28: c2 06 20 7c ld [ %i0 + 0x7c ], %g1 <== NOT EXECUTED 40013f2c: 10 bf ff d5 b 40013e80 <== NOT EXECUTED 40013f30: c2 26 20 78 st %g1, [ %i0 + 0x78 ] <== NOT EXECUTED =============================================================================== 40013e00 : int fat_init_clusters_chain( fat_fs_info_t *fs_info, uint32_t start_cln ) { 40013e00: 9d e3 bf 98 save %sp, -104, %sp int rc = RC_OK; ssize_t ret = 0; uint32_t cur_cln = start_cln; 40013e04: f2 27 bf fc st %i1, [ %fp + -4 ] while ((cur_cln & fs_info->vol.mask) < fs_info->vol.eoc_val) 40013e08: d2 07 bf fc ld [ %fp + -4 ], %o1 40013e0c: c4 06 20 10 ld [ %i0 + 0x10 ], %g2 40013e10: c2 06 20 14 ld [ %i0 + 0x14 ], %g1 40013e14: 84 0a 40 02 and %o1, %g2, %g2 40013e18: 80 a0 80 01 cmp %g2, %g1 40013e1c: 1a 80 00 12 bcc 40013e64 40013e20: 90 10 00 18 mov %i0, %o0 { ret = fat_cluster_set(fs_info, cur_cln, 0, fs_info->vol.bpc, 0); 40013e24: d6 16 20 06 lduh [ %i0 + 6 ], %o3 40013e28: 94 10 20 00 clr %o2 40013e2c: 7f ff fd 00 call 4001322c 40013e30: 98 10 20 00 clr %o4 if ( ret != fs_info->vol.bpc ) 40013e34: c2 16 20 06 lduh [ %i0 + 6 ], %g1 40013e38: 80 a2 00 01 cmp %o0, %g1 40013e3c: 12 80 00 0c bne 40013e6c <== NEVER TAKEN 40013e40: d2 07 bf fc ld [ %fp + -4 ], %o1 { return -1; } rc = fat_get_fat_cluster(fs_info, cur_cln, &cur_cln); 40013e44: 90 10 00 18 mov %i0, %o0 40013e48: 7f ff f7 27 call 40011ae4 40013e4c: 94 07 bf fc add %fp, -4, %o2 if ( rc != RC_OK ) 40013e50: 80 a2 20 00 cmp %o0, 0 40013e54: 02 bf ff ee be 40013e0c <== ALWAYS TAKEN 40013e58: d2 07 bf fc ld [ %fp + -4 ], %o1 } } return rc; } 40013e5c: 81 c7 e0 08 ret <== NOT EXECUTED 40013e60: 91 e8 00 08 restore %g0, %o0, %o0 <== NOT EXECUTED 40013e64: 81 c7 e0 08 ret 40013e68: 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; 40013e6c: 81 c7 e0 08 ret <== NOT EXECUTED 40013e70: 91 e8 3f ff restore %g0, -1, %o0 <== NOT EXECUTED =============================================================================== 4001345c : * 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) { 4001345c: 9d e3 bf 18 save %sp, -232, %sp ssize_t ret = 0; struct stat stat_buf; int i = 0; rtems_bdbuf_buffer *block = NULL; vol->fd = open(device, O_RDWR); 40013460: 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) { 40013464: b4 10 00 18 mov %i0, %i2 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; 40013468: c0 27 bf a4 clr [ %fp + -92 ] vol->fd = open(device, O_RDWR); 4001346c: 7f ff c9 25 call 40005900 40013470: 90 10 00 19 mov %i1, %o0 if (vol->fd < 0) 40013474: 80 a2 20 00 cmp %o0, 0 40013478: 06 80 00 09 bl 4001349c <== NEVER TAKEN 4001347c: d0 26 a0 60 st %o0, [ %i2 + 0x60 ] { rtems_set_errno_and_return_minus_one(ENXIO); } rc = fstat(vol->fd, &stat_buf); 40013480: 7f ff c6 7f call 40004e7c 40013484: 92 07 bf b8 add %fp, -72, %o1 if (rc != 0) 40013488: 80 a2 20 00 cmp %o0, 0 4001348c: 02 80 00 0a be 400134b4 <== ALWAYS TAKEN 40013490: d0 06 20 60 ld [ %i0 + 0x60 ], %o0 { close(vol->fd); 40013494: 7f ff c6 2d call 40004d48 <== NOT EXECUTED 40013498: 01 00 00 00 nop <== NOT EXECUTED rtems_set_errno_and_return_minus_one(ENXIO); 4001349c: 40 00 23 fc call 4001c48c <__errno> <== NOT EXECUTED 400134a0: 01 00 00 00 nop <== NOT EXECUTED 400134a4: 82 10 20 06 mov 6, %g1 ! 6 <_TLS_Alignment+0x5> <== NOT EXECUTED 400134a8: c2 22 00 00 st %g1, [ %o0 ] <== NOT EXECUTED 400134ac: 10 80 01 d9 b 40013c10 <== NOT EXECUTED 400134b0: ba 10 3f ff mov -1, %i5 <== NOT EXECUTED } /* Must be a block device. */ if (!S_ISBLK(stat_buf.st_mode)) 400134b4: c6 07 bf c4 ld [ %fp + -60 ], %g3 400134b8: 05 00 00 3c sethi %hi(0xf000), %g2 400134bc: 86 08 c0 02 and %g3, %g2, %g3 400134c0: 05 00 00 18 sethi %hi(0x6000), %g2 400134c4: 80 a0 c0 02 cmp %g3, %g2 400134c8: 12 bf ff f3 bne 40013494 <== NEVER TAKEN 400134cc: 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); 400134d0: 94 06 20 64 add %i0, 0x64, %o2 400134d4: 40 00 05 51 call 40014a18 400134d8: 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) { 400134dc: ba 92 20 00 orcc %o0, 0, %i5 400134e0: 22 80 00 04 be,a 400134f0 <== ALWAYS TAKEN 400134e4: d0 06 20 64 ld [ %i0 + 0x64 ], %o0 close(vol->fd); 400134e8: 10 bf ff eb b 40013494 <== NOT EXECUTED 400134ec: d0 06 20 60 ld [ %i0 + 0x60 ], %o0 <== NOT EXECUTED rtems_set_errno_and_return_minus_one(ENXIO); } /* Read boot record */ /* FIXME: Asserts FAT_MAX_BPB_SIZE < bdbuf block size */ sc = rtems_bdbuf_read( vol->dd, 0, &block); 400134f0: 92 10 20 00 clr %o1 400134f4: 7f ff f5 d8 call 40010c54 400134f8: 94 07 bf a4 add %fp, -92, %o2 if (sc != RTEMS_SUCCESSFUL) 400134fc: 80 a2 20 00 cmp %o0, 0 40013500: 12 80 00 31 bne 400135c4 <== NEVER TAKEN 40013504: 01 00 00 00 nop { close(vol->fd); rtems_set_errno_and_return_minus_one( EIO); } memcpy( boot_rec, block->buffer, FAT_MAX_BPB_SIZE); 40013508: d0 07 bf a4 ld [ %fp + -92 ], %o0 4001350c: c8 02 20 1c ld [ %o0 + 0x1c ], %g4 40013510: c2 09 20 13 ldub [ %g4 + 0x13 ], %g1 40013514: c4 09 20 0b ldub [ %g4 + 0xb ], %g2 40013518: c2 2f bf 98 stb %g1, [ %fp + -104 ] 4001351c: c2 09 20 14 ldub [ %g4 + 0x14 ], %g1 40013520: c6 09 20 0c ldub [ %g4 + 0xc ], %g3 40013524: c2 2f bf 87 stb %g1, [ %fp + -121 ] 40013528: c2 09 20 20 ldub [ %g4 + 0x20 ], %g1 4001352c: f8 09 20 0d ldub [ %g4 + 0xd ], %i4 40013530: c2 2f bf 86 stb %g1, [ %fp + -122 ] 40013534: c2 09 20 21 ldub [ %g4 + 0x21 ], %g1 40013538: ee 09 20 0e ldub [ %g4 + 0xe ], %l7 4001353c: c2 2f bf 85 stb %g1, [ %fp + -123 ] 40013540: c2 09 20 22 ldub [ %g4 + 0x22 ], %g1 40013544: f0 09 20 0f ldub [ %g4 + 0xf ], %i0 40013548: c2 2f bf 9b stb %g1, [ %fp + -101 ] 4001354c: c2 09 20 23 ldub [ %g4 + 0x23 ], %g1 40013550: f2 09 20 10 ldub [ %g4 + 0x10 ], %i1 40013554: c2 2f bf 8f stb %g1, [ %fp + -113 ] 40013558: c2 09 20 24 ldub [ %g4 + 0x24 ], %g1 4001355c: ea 09 20 11 ldub [ %g4 + 0x11 ], %l5 40013560: c2 2f bf 9a stb %g1, [ %fp + -102 ] 40013564: c2 09 20 25 ldub [ %g4 + 0x25 ], %g1 40013568: ec 09 20 12 ldub [ %g4 + 0x12 ], %l6 4001356c: c2 2f bf 99 stb %g1, [ %fp + -103 ] 40013570: c2 09 20 26 ldub [ %g4 + 0x26 ], %g1 40013574: e6 09 20 16 ldub [ %g4 + 0x16 ], %l3 40013578: c2 2f bf 9c stb %g1, [ %fp + -100 ] 4001357c: c2 09 20 27 ldub [ %g4 + 0x27 ], %g1 40013580: e8 09 20 17 ldub [ %g4 + 0x17 ], %l4 40013584: c2 2f bf 97 stb %g1, [ %fp + -105 ] 40013588: c2 09 20 2c ldub [ %g4 + 0x2c ], %g1 4001358c: f6 09 20 28 ldub [ %g4 + 0x28 ], %i3 40013590: c2 2f bf 9f stb %g1, [ %fp + -97 ] 40013594: c2 09 20 2d ldub [ %g4 + 0x2d ], %g1 40013598: e4 09 20 2e ldub [ %g4 + 0x2e ], %l2 4001359c: c2 2f bf 9e stb %g1, [ %fp + -98 ] 400135a0: c2 09 20 30 ldub [ %g4 + 0x30 ], %g1 400135a4: e2 09 20 2f ldub [ %g4 + 0x2f ], %l1 400135a8: e0 09 20 31 ldub [ %g4 + 0x31 ], %l0 400135ac: c2 2f bf 9d stb %g1, [ %fp + -99 ] sc = rtems_bdbuf_release( block); 400135b0: 7f ff f6 18 call 40010e10 400135b4: c4 3f bf 78 std %g2, [ %fp + -136 ] if (sc != RTEMS_SUCCESSFUL) 400135b8: 80 a2 20 00 cmp %o0, 0 400135bc: 02 80 00 08 be 400135dc <== ALWAYS TAKEN 400135c0: c4 1f bf 78 ldd [ %fp + -136 ], %g2 { close(vol->fd); 400135c4: 7f ff c5 e1 call 40004d48 <== NOT EXECUTED 400135c8: d0 06 a0 60 ld [ %i2 + 0x60 ], %o0 <== NOT EXECUTED rtems_set_errno_and_return_minus_one( EIO ); 400135cc: 40 00 23 b0 call 4001c48c <__errno> <== NOT EXECUTED 400135d0: 01 00 00 00 nop <== NOT EXECUTED 400135d4: 10 bf ff b5 b 400134a8 <== NOT EXECUTED 400135d8: 82 10 20 05 mov 5, %g1 ! 5 <_TLS_Alignment+0x4> <== NOT EXECUTED } /* Evaluate boot record */ vol->bps = FAT_GET_BR_BYTES_PER_SECTOR(boot_rec); 400135dc: 86 08 e0 ff and %g3, 0xff, %g3 400135e0: 84 08 a0 ff and %g2, 0xff, %g2 400135e4: 87 28 e0 08 sll %g3, 8, %g3 400135e8: 84 10 c0 02 or %g3, %g2, %g2 if ( (vol->bps != 512) && 400135ec: 87 28 a0 10 sll %g2, 0x10, %g3 400135f0: 87 30 e0 10 srl %g3, 0x10, %g3 400135f4: 80 a0 e2 00 cmp %g3, 0x200 400135f8: 02 80 00 0b be 40013624 <== ALWAYS TAKEN 400135fc: c4 36 80 00 sth %g2, [ %i2 ] 40013600: 80 a0 e4 00 cmp %g3, 0x400 <== NOT EXECUTED 40013604: 22 80 00 09 be,a 40013628 <== NOT EXECUTED 40013608: 87 28 a0 10 sll %g2, 0x10, %g3 <== NOT EXECUTED (vol->bps != 1024) && 4001360c: 80 a0 e8 00 cmp %g3, 0x800 <== NOT EXECUTED 40013610: 02 80 00 05 be 40013624 <== NOT EXECUTED 40013614: 09 00 00 04 sethi %hi(0x1000), %g4 <== NOT EXECUTED (vol->bps != 2048) && 40013618: 80 a0 c0 04 cmp %g3, %g4 <== NOT EXECUTED 4001361c: 12 80 00 dc bne 4001398c <== NOT EXECUTED 40013620: 01 00 00 00 nop <== 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; 40013624: 87 28 a0 10 sll %g2, 0x10, %g3 40013628: c0 2e a0 03 clrb [ %i2 + 3 ] 4001362c: 87 30 e0 19 srl %g3, 0x19, %g3 40013630: 80 88 e0 01 btst 1, %g3 40013634: 12 80 00 06 bne 4001364c <== ALWAYS TAKEN 40013638: 87 38 e0 01 sra %g3, 1, %g3 i >>= 1, vol->sec_mul++); 4001363c: c8 0e a0 03 ldub [ %i2 + 3 ], %g4 <== NOT EXECUTED 40013640: 88 01 20 01 inc %g4 <== NOT EXECUTED 40013644: 10 bf ff fb b 40013630 <== NOT EXECUTED 40013648: c8 2e a0 03 stb %g4, [ %i2 + 3 ] <== NOT EXECUTED for (vol->sec_log2 = 0, i = vol->bps; (i & 1) == 0; 4001364c: 93 28 a0 10 sll %g2, 0x10, %o1 40013650: c0 2e a0 02 clrb [ %i2 + 2 ] 40013654: 89 32 60 10 srl %o1, 0x10, %g4 40013658: 80 89 20 01 btst 1, %g4 4001365c: 12 80 00 06 bne 40013674 40013660: 89 39 20 01 sra %g4, 1, %g4 i >>= 1, vol->sec_log2++); 40013664: c6 0e a0 02 ldub [ %i2 + 2 ], %g3 40013668: 86 00 e0 01 inc %g3 4001366c: 10 bf ff fb b 40013658 40013670: c6 2e a0 02 stb %g3, [ %i2 + 2 ] /* Assign the sector size as bdbuf block size for now. * If possible the bdbuf block size will get increased to the cluster * size at the end of this method for better performance */ sc = rtems_bdbuf_set_block_size (vol->dd, vol->bps, true); 40013674: d0 06 a0 64 ld [ %i2 + 0x64 ], %o0 40013678: 93 32 60 10 srl %o1, 0x10, %o1 4001367c: 7f ff f6 51 call 40010fc0 40013680: 94 10 20 01 mov 1, %o2 if (sc != RTEMS_SUCCESSFUL) 40013684: 80 a2 20 00 cmp %o0, 0 40013688: 12 80 00 c1 bne 4001398c <== NEVER TAKEN 4001368c: 86 10 20 01 mov 1, %g3 { close(vol->fd); rtems_set_errno_and_return_minus_one( EINVAL ); } vol->bytes_per_block = vol->bps; 40013690: d2 16 80 00 lduh [ %i2 ], %o1 vol->bytes_per_block_log2 = vol->sec_log2; 40013694: c4 0e a0 02 ldub [ %i2 + 2 ], %g2 if (sc != RTEMS_SUCCESSFUL) { close(vol->fd); rtems_set_errno_and_return_minus_one( EINVAL ); } vol->bytes_per_block = vol->bps; 40013698: d2 36 a0 0a sth %o1, [ %i2 + 0xa ] vol->bytes_per_block_log2 = vol->sec_log2; 4001369c: c4 2e a0 0c stb %g2, [ %i2 + 0xc ] vol->sectors_per_block = 1; 400136a0: c6 2e a0 09 stb %g3, [ %i2 + 9 ] vol->spc = FAT_GET_BR_SECTORS_PER_CLUSTER(boot_rec); /* * "sectors per cluster" of zero is invalid * (and would hang the following loop) */ if (vol->spc == 0) 400136a4: 88 8f 20 ff andcc %i4, 0xff, %g4 400136a8: 02 80 00 b9 be 4001398c <== NEVER TAKEN 400136ac: f8 2e a0 04 stb %i4, [ %i2 + 4 ] { close(vol->fd); rtems_set_errno_and_return_minus_one(EINVAL); } for (vol->spc_log2 = 0, i = vol->spc; (i & 1) == 0; 400136b0: c0 2e a0 05 clrb [ %i2 + 5 ] 400136b4: 80 89 20 01 btst 1, %g4 400136b8: 12 80 00 06 bne 400136d0 400136bc: c6 0e a0 05 ldub [ %i2 + 5 ], %g3 i >>= 1, vol->spc_log2++); 400136c0: 86 00 e0 01 inc %g3 400136c4: 89 39 20 01 sra %g4, 1, %g4 400136c8: 10 bf ff fb b 400136b4 400136cc: c6 2e a0 05 stb %g3, [ %i2 + 5 ] /* * "bytes per cluster" value greater than 32K is invalid */ if ((vol->bpc = vol->bps << vol->spc_log2) > MS_BYTES_PER_CLUSTER_LIMIT) 400136d0: 93 2a 60 10 sll %o1, 0x10, %o1 400136d4: 93 32 60 10 srl %o1, 0x10, %o1 400136d8: 87 2a 40 03 sll %o1, %g3, %g3 400136dc: 9f 28 e0 10 sll %g3, 0x10, %o7 400136e0: 09 20 00 00 sethi %hi(0x80000000), %g4 400136e4: 80 a3 c0 04 cmp %o7, %g4 400136e8: 18 80 00 a9 bgu 4001398c <== NEVER TAKEN 400136ec: c6 36 a0 06 sth %g3, [ %i2 + 6 ] { close(vol->fd); rtems_set_errno_and_return_minus_one(EINVAL); } for (vol->bpc_log2 = 0, i = vol->bpc; (i & 1) == 0; 400136f0: 09 00 00 3f sethi %hi(0xfc00), %g4 400136f4: c0 2e a0 08 clrb [ %i2 + 8 ] 400136f8: 88 11 23 ff or %g4, 0x3ff, %g4 400136fc: 86 08 c0 04 and %g3, %g4, %g3 40013700: 80 88 e0 01 btst 1, %g3 40013704: 12 80 00 06 bne 4001371c 40013708: 87 38 e0 01 sra %g3, 1, %g3 i >>= 1, vol->bpc_log2++); 4001370c: c8 0e a0 08 ldub [ %i2 + 8 ], %g4 40013710: 88 01 20 01 inc %g4 40013714: 10 bf ff fb b 40013700 40013718: c8 2e a0 08 stb %g4, [ %i2 + 8 ] 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)) / 4001371c: 86 02 7f ff add %o1, -1, %g3 40013720: c4 27 bf 78 st %g2, [ %fp + -136 ] } 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); 40013724: f2 2e a0 0d stb %i1, [ %i2 + 0xd ] vol->fat_loc = FAT_GET_BR_RESERVED_SECTORS_NUM(boot_rec); 40013728: b0 0e 20 ff and %i0, 0xff, %i0 4001372c: ae 0d e0 ff and %l7, 0xff, %l7 40013730: b1 2e 20 08 sll %i0, 8, %i0 vol->rdir_entrs = FAT_GET_BR_FILES_PER_ROOT_DIR(boot_rec); 40013734: ac 0d a0 ff and %l6, 0xff, %l6 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); 40013738: ae 16 00 17 or %i0, %l7, %l7 vol->rdir_entrs = FAT_GET_BR_FILES_PER_ROOT_DIR(boot_rec); 4001373c: ad 2d a0 08 sll %l6, 8, %l6 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); 40013740: ee 36 a0 18 sth %l7, [ %i2 + 0x18 ] vol->rdir_entrs = FAT_GET_BR_FILES_PER_ROOT_DIR(boot_rec); 40013744: aa 0d 60 ff and %l5, 0xff, %l5 40013748: aa 15 80 15 or %l6, %l5, %l5 4001374c: ea 36 a0 24 sth %l5, [ %i2 + 0x24 ] /* calculate the count of sectors occupied by the root directory */ vol->rdir_secs = ((vol->rdir_entrs * FAT_DIRENTRY_SIZE) + (vol->bps - 1)) / 40013750: ab 2d 60 10 sll %l5, 0x10, %l5 40013754: 91 35 60 0b srl %l5, 0xb, %o0 40013758: 7f ff bc 2a call 40002800 <.div> 4001375c: 90 02 00 03 add %o0, %g3, %o0 vol->bps; vol->rdir_size = vol->rdir_secs << vol->sec_log2; 40013760: c4 07 bf 78 ld [ %fp + -136 ], %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)) / 40013764: d0 26 a0 28 st %o0, [ %i2 + 0x28 ] vol->bps; vol->rdir_size = vol->rdir_secs << vol->sec_log2; 40013768: 85 2a 00 02 sll %o0, %g2, %g2 4001376c: c4 26 a0 2c st %g2, [ %i2 + 0x2c ] if ( (FAT_GET_BR_SECTORS_PER_FAT(boot_rec)) != 0) 40013770: a8 0d 20 ff and %l4, 0xff, %l4 40013774: a6 0c e0 ff and %l3, 0xff, %l3 40013778: a9 2d 20 08 sll %l4, 8, %l4 4001377c: a6 15 00 13 or %l4, %l3, %l3 40013780: a7 2c e0 10 sll %l3, 0x10, %l3 40013784: 80 a4 e0 00 cmp %l3, 0 40013788: 02 80 00 05 be 4001379c 4001378c: aa 10 00 08 mov %o0, %l5 vol->fat_length = FAT_GET_BR_SECTORS_PER_FAT(boot_rec); 40013790: a7 34 e0 10 srl %l3, 0x10, %l3 40013794: 10 80 00 0d b 400137c8 40013798: e6 26 a0 1c st %l3, [ %i2 + 0x1c ] else vol->fat_length = FAT_GET_BR_SECTORS_PER_FAT32(boot_rec); 4001379c: c6 0f bf 99 ldub [ %fp + -103 ], %g3 400137a0: c4 0f bf 9c ldub [ %fp + -100 ], %g2 400137a4: 87 28 e0 08 sll %g3, 8, %g3 400137a8: 85 28 a0 10 sll %g2, 0x10, %g2 400137ac: c2 0f bf 97 ldub [ %fp + -105 ], %g1 400137b0: 84 10 c0 02 or %g3, %g2, %g2 400137b4: c6 0f bf 9a ldub [ %fp + -102 ], %g3 400137b8: 84 10 80 03 or %g2, %g3, %g2 400137bc: 87 28 60 18 sll %g1, 0x18, %g3 400137c0: 84 10 80 03 or %g2, %g3, %g2 400137c4: c4 26 a0 1c st %g2, [ %i2 + 0x1c ] vol->data_fsec = vol->fat_loc + vol->fats * vol->fat_length + 400137c8: d2 06 a0 1c ld [ %i2 + 0x1c ], %o1 400137cc: 7f ff bb d1 call 40002710 <.umul> 400137d0: 90 0e 60 ff and %i1, 0xff, %o0 vol->rdir_secs; /* for FAT12/16 root dir starts at(sector) */ vol->rdir_loc = vol->fat_loc + vol->fats * vol->fat_length; if ( (FAT_GET_BR_TOTAL_SECTORS_NUM16(boot_rec)) != 0) 400137d4: c4 0f bf 87 ldub [ %fp + -121 ], %g2 400137d8: c6 0f bf 98 ldub [ %fp + -104 ], %g3 if ( (FAT_GET_BR_SECTORS_PER_FAT(boot_rec)) != 0) vol->fat_length = FAT_GET_BR_SECTORS_PER_FAT(boot_rec); else vol->fat_length = FAT_GET_BR_SECTORS_PER_FAT32(boot_rec); vol->data_fsec = vol->fat_loc + vol->fats * vol->fat_length + 400137dc: af 2d e0 10 sll %l7, 0x10, %l7 400137e0: af 35 e0 10 srl %l7, 0x10, %l7 400137e4: 90 05 c0 08 add %l7, %o0, %o0 400137e8: aa 05 40 08 add %l5, %o0, %l5 vol->rdir_secs; /* for FAT12/16 root dir starts at(sector) */ vol->rdir_loc = vol->fat_loc + vol->fats * vol->fat_length; 400137ec: d0 26 a0 20 st %o0, [ %i2 + 0x20 ] if ( (FAT_GET_BR_TOTAL_SECTORS_NUM16(boot_rec)) != 0) 400137f0: 85 28 a0 08 sll %g2, 8, %g2 400137f4: 84 10 80 03 or %g2, %g3, %g2 400137f8: 85 28 a0 10 sll %g2, 0x10, %g2 400137fc: 80 a0 a0 00 cmp %g2, 0 40013800: 02 80 00 04 be 40013810 40013804: ea 26 a0 34 st %l5, [ %i2 + 0x34 ] vol->tot_secs = FAT_GET_BR_TOTAL_SECTORS_NUM16(boot_rec); 40013808: 10 80 00 0c b 40013838 4001380c: 85 30 a0 10 srl %g2, 0x10, %g2 else vol->tot_secs = FAT_GET_BR_TOTAL_SECTORS_NUM32(boot_rec); 40013810: c6 0f bf 85 ldub [ %fp + -123 ], %g3 40013814: c4 0f bf 9b ldub [ %fp + -101 ], %g2 40013818: 87 28 e0 08 sll %g3, 8, %g3 4001381c: 85 28 a0 10 sll %g2, 0x10, %g2 40013820: c2 0f bf 8f ldub [ %fp + -113 ], %g1 40013824: 84 10 c0 02 or %g3, %g2, %g2 40013828: c6 0f bf 86 ldub [ %fp + -122 ], %g3 4001382c: 84 10 80 03 or %g2, %g3, %g2 40013830: 87 28 60 18 sll %g1, 0x18, %g3 40013834: 84 10 80 03 or %g2, %g3, %g2 40013838: c4 26 a0 30 st %g2, [ %i2 + 0x30 ] data_secs = vol->tot_secs - vol->data_fsec; 4001383c: d0 06 a0 30 ld [ %i2 + 0x30 ], %o0 vol->data_cls = data_secs / vol->spc; 40013840: 92 0f 20 ff and %i4, 0xff, %o1 40013844: 7f ff bb ed call 400027f8 <.udiv> 40013848: 90 22 00 15 sub %o0, %l5, %o0 /* determine FAT type at least */ if ( vol->data_cls < FAT_FAT12_MAX_CLN) 4001384c: 80 a2 2f f4 cmp %o0, 0xff4 40013850: 18 80 00 08 bgu 40013870 40013854: d0 26 a0 38 st %o0, [ %i2 + 0x38 ] { vol->type = FAT_FAT12; 40013858: 84 10 20 01 mov 1, %g2 4001385c: c4 2e a0 0e stb %g2, [ %i2 + 0xe ] vol->mask = FAT_FAT12_MASK; 40013860: 84 10 2f ff mov 0xfff, %g2 40013864: c4 26 a0 10 st %g2, [ %i2 + 0x10 ] vol->eoc_val = FAT_FAT12_EOC; 40013868: 10 80 00 11 b 400138ac 4001386c: 84 10 2f f8 mov 0xff8, %g2 } else { if ( vol->data_cls < FAT_FAT16_MAX_CLN) 40013870: 05 00 00 3f sethi %hi(0xfc00), %g2 40013874: 86 10 a3 f4 or %g2, 0x3f4, %g3 ! fff4 <_TLS_Alignment+0xfff3> 40013878: 80 a2 00 03 cmp %o0, %g3 4001387c: 38 80 00 04 bgu,a 4001388c 40013880: 05 03 ff ff sethi %hi(0xffffc00), %g2 { vol->type = FAT_FAT16; 40013884: 10 80 00 06 b 4001389c 40013888: 86 10 20 02 mov 2, %g3 vol->mask = FAT_FAT16_MASK; vol->eoc_val = FAT_FAT16_EOC; } else if ( vol->data_cls < FAT_FAT32_MASK - 1 ) 4001388c: 86 10 a3 fd or %g2, 0x3fd, %g3 40013890: 80 a2 00 03 cmp %o0, %g3 40013894: 18 80 00 3e bgu 4001398c <== NEVER TAKEN 40013898: 86 10 20 04 mov 4, %g3 { vol->type = FAT_FAT32; 4001389c: c6 2e a0 0e stb %g3, [ %i2 + 0xe ] vol->mask = FAT_FAT32_MASK; 400138a0: 86 10 a3 ff or %g2, 0x3ff, %g3 vol->eoc_val = FAT_FAT32_EOC; 400138a4: 84 10 a3 f8 or %g2, 0x3f8, %g2 vol->eoc_val = FAT_FAT16_EOC; } else if ( vol->data_cls < FAT_FAT32_MASK - 1 ) { vol->type = FAT_FAT32; vol->mask = FAT_FAT32_MASK; 400138a8: c6 26 a0 10 st %g3, [ %i2 + 0x10 ] vol->eoc_val = FAT_FAT32_EOC; 400138ac: c4 26 a0 14 st %g2, [ %i2 + 0x14 ] close(vol->fd); rtems_set_errno_and_return_minus_one( EINVAL ); } } if (vol->type == FAT_FAT32) 400138b0: c4 0e a0 0e ldub [ %i2 + 0xe ], %g2 400138b4: 80 a0 a0 04 cmp %g2, 4 400138b8: 12 80 00 61 bne 40013a3c 400138bc: 82 10 3f ff mov -1, %g1 { vol->rdir_cl = FAT_GET_BR_FAT32_ROOT_CLUSTER(boot_rec); 400138c0: c4 0f bf 9e ldub [ %fp + -98 ], %g2 400138c4: a4 0c a0 ff and %l2, 0xff, %l2 400138c8: 85 28 a0 08 sll %g2, 8, %g2 400138cc: a5 2c a0 10 sll %l2, 0x10, %l2 400138d0: a4 10 80 12 or %g2, %l2, %l2 400138d4: c4 0f bf 9f ldub [ %fp + -97 ], %g2 400138d8: a3 2c 60 18 sll %l1, 0x18, %l1 400138dc: a4 14 80 02 or %l2, %g2, %l2 vol->mirror = FAT_GET_BR_EXT_FLAGS(boot_rec) & FAT_BR_EXT_FLAGS_MIRROR; 400138e0: 84 0e ff 80 and %i3, -128, %g2 } } if (vol->type == FAT_FAT32) { vol->rdir_cl = FAT_GET_BR_FAT32_ROOT_CLUSTER(boot_rec); 400138e4: a2 14 80 11 or %l2, %l1, %l1 vol->mirror = FAT_GET_BR_EXT_FLAGS(boot_rec) & FAT_BR_EXT_FLAGS_MIRROR; 400138e8: c4 2e a0 54 stb %g2, [ %i2 + 0x54 ] if (vol->mirror) 400138ec: 80 88 a0 80 btst 0x80, %g2 400138f0: 02 80 00 05 be 40013904 <== ALWAYS TAKEN 400138f4: e2 26 a0 3c st %l1, [ %i2 + 0x3c ] vol->afat = FAT_GET_BR_EXT_FLAGS(boot_rec) & FAT_BR_EXT_FLAGS_FAT_NUM; 400138f8: b6 0e e0 0f and %i3, 0xf, %i3 <== NOT EXECUTED 400138fc: 10 80 00 03 b 40013908 <== NOT EXECUTED 40013900: f6 2e a0 5c stb %i3, [ %i2 + 0x5c ] <== NOT EXECUTED else vol->afat = 0; 40013904: c0 2e a0 5c clrb [ %i2 + 0x5c ] vol->info_sec = FAT_GET_BR_FAT32_FS_INFO_SECTOR(boot_rec); 40013908: f2 0f bf 9d ldub [ %fp + -99 ], %i1 4001390c: a0 0c 20 ff and %l0, 0xff, %l0 40013910: a1 2c 20 08 sll %l0, 8, %l0 40013914: b2 14 00 19 or %l0, %i1, %i1 40013918: f2 36 a0 40 sth %i1, [ %i2 + 0x40 ] if( vol->info_sec == 0 ) 4001391c: b3 2e 60 10 sll %i1, 0x10, %i1 40013920: 93 36 60 10 srl %i1, 0x10, %o1 40013924: 80 a2 60 00 cmp %o1, 0 40013928: 02 80 00 19 be 4001398c <== NEVER TAKEN 4001392c: 94 10 20 00 clr %o2 close(vol->fd); rtems_set_errno_and_return_minus_one( EINVAL ); } else { ret = _fat_block_read(fs_info, vol->info_sec , 0, 40013930: 90 10 00 1a mov %i2, %o0 40013934: 96 10 20 04 mov 4, %o3 40013938: 7f ff fd f9 call 4001311c <_fat_block_read> 4001393c: 98 07 bf a8 add %fp, -88, %o4 FAT_FSI_LEADSIG_SIZE, fs_info_sector); if ( ret < 0 ) 40013940: 80 a2 20 00 cmp %o0, 0 40013944: 06 80 00 22 bl 400139cc <== NEVER TAKEN 40013948: c4 0f bf aa ldub [ %fp + -86 ], %g2 { close(vol->fd); return -1; } if (FAT_GET_FSINFO_LEAD_SIGNATURE(fs_info_sector) != 4001394c: c6 0f bf a9 ldub [ %fp + -87 ], %g3 40013950: 85 28 a0 10 sll %g2, 0x10, %g2 40013954: 87 28 e0 08 sll %g3, 8, %g3 40013958: 86 10 c0 02 or %g3, %g2, %g3 4001395c: c4 0f bf a8 ldub [ %fp + -88 ], %g2 40013960: 86 10 c0 02 or %g3, %g2, %g3 40013964: c4 0f bf ab ldub [ %fp + -85 ], %g2 40013968: 85 28 a0 18 sll %g2, 0x18, %g2 4001396c: 86 10 c0 02 or %g3, %g2, %g3 40013970: 05 10 58 54 sethi %hi(0x41615000), %g2 40013974: 84 10 a2 52 or %g2, 0x252, %g2 ! 41615252 40013978: 80 a0 c0 02 cmp %g3, %g2 4001397c: 02 80 00 0a be 400139a4 <== ALWAYS TAKEN 40013980: 90 10 00 1a mov %i2, %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); 40013984: 7f ff fd 46 call 40012e9c <== NOT EXECUTED 40013988: 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); 4001398c: 7f ff c4 ef call 40004d48 <== NOT EXECUTED 40013990: d0 06 a0 60 ld [ %i2 + 0x60 ], %o0 <== NOT EXECUTED rtems_set_errno_and_return_minus_one( EINVAL ); 40013994: 40 00 22 be call 4001c48c <__errno> <== NOT EXECUTED 40013998: 01 00 00 00 nop <== NOT EXECUTED 4001399c: 10 bf fe c3 b 400134a8 <== NOT EXECUTED 400139a0: 82 10 20 16 mov 0x16, %g1 ! 16 <_TLS_Alignment+0x15> <== NOT EXECUTED } else { ret = _fat_block_read(fs_info, vol->info_sec , FAT_FSI_INFO, 400139a4: d2 16 a0 40 lduh [ %i2 + 0x40 ], %o1 400139a8: 94 10 21 e4 mov 0x1e4, %o2 400139ac: 96 10 20 0c mov 0xc, %o3 400139b0: 7f ff fd db call 4001311c <_fat_block_read> 400139b4: 98 07 bf a8 add %fp, -88, %o4 FAT_USEFUL_INFO_SIZE, fs_info_sector); if ( ret < 0 ) 400139b8: 80 a2 20 00 cmp %o0, 0 400139bc: 16 80 00 08 bge 400139dc <== ALWAYS TAKEN 400139c0: 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); 400139c4: 7f ff fd 36 call 40012e9c <== NOT EXECUTED 400139c8: 90 10 00 1a mov %i2, %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); 400139cc: 7f ff c4 df call 40004d48 <== NOT EXECUTED 400139d0: d0 06 a0 60 ld [ %i2 + 0x60 ], %o0 <== NOT EXECUTED 400139d4: 10 80 00 8f b 40013c10 <== NOT EXECUTED 400139d8: ba 10 3f ff mov -1, %i5 <== NOT EXECUTED return -1; } vol->free_cls_in_fs_info = FAT_GET_FSINFO_FREE_CLUSTER_COUNT(fs_info_sector); 400139dc: c4 0f bf ae ldub [ %fp + -82 ], %g2 400139e0: 87 28 e0 08 sll %g3, 8, %g3 400139e4: 85 28 a0 10 sll %g2, 0x10, %g2 400139e8: 84 10 c0 02 or %g3, %g2, %g2 400139ec: c6 0f bf ac ldub [ %fp + -84 ], %g3 400139f0: 84 10 80 03 or %g2, %g3, %g2 400139f4: c6 0f bf af ldub [ %fp + -81 ], %g3 400139f8: 87 28 e0 18 sll %g3, 0x18, %g3 400139fc: 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); 40013a00: c6 0f bf b1 ldub [ %fp + -79 ], %g3 _fat_block_release(fs_info); close(vol->fd); return -1; } vol->free_cls_in_fs_info = 40013a04: c4 26 a0 48 st %g2, [ %i2 + 0x48 ] FAT_GET_FSINFO_FREE_CLUSTER_COUNT(fs_info_sector); vol->free_cls = vol->free_cls_in_fs_info; 40013a08: c4 26 a0 44 st %g2, [ %i2 + 0x44 ] vol->next_cl_in_fs_info = FAT_GET_FSINFO_NEXT_FREE_CLUSTER(fs_info_sector); 40013a0c: c4 0f bf b2 ldub [ %fp + -78 ], %g2 40013a10: 87 28 e0 08 sll %g3, 8, %g3 40013a14: 85 28 a0 10 sll %g2, 0x10, %g2 40013a18: 84 10 c0 02 or %g3, %g2, %g2 40013a1c: c6 0f bf b0 ldub [ %fp + -80 ], %g3 40013a20: 84 10 80 03 or %g2, %g3, %g2 40013a24: c6 0f bf b3 ldub [ %fp + -77 ], %g3 40013a28: 87 28 e0 18 sll %g3, 0x18, %g3 40013a2c: 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 = 40013a30: c4 26 a0 50 st %g2, [ %i2 + 0x50 ] 40013a34: 10 80 00 07 b 40013a50 40013a38: c4 26 a0 4c st %g2, [ %i2 + 0x4c ] } } } else { vol->rdir_cl = 0; 40013a3c: c0 26 a0 3c clr [ %i2 + 0x3c ] vol->mirror = 0; 40013a40: c0 2e a0 54 clrb [ %i2 + 0x54 ] vol->afat = 0; 40013a44: c0 2e a0 5c clrb [ %i2 + 0x5c ] vol->free_cls = FAT_UNDEFINED_VALUE; 40013a48: c2 26 a0 44 st %g1, [ %i2 + 0x44 ] vol->next_cl = FAT_UNDEFINED_VALUE; 40013a4c: c2 26 a0 4c st %g1, [ %i2 + 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); 40013a50: 7f ff fd 13 call 40012e9c 40013a54: 90 10 00 1a mov %i2, %o0 vol->next_cl = FAT_UNDEFINED_VALUE; } _fat_block_release(fs_info); vol->afat_loc = vol->fat_loc + vol->fat_length * vol->afat; 40013a58: d2 06 a0 1c ld [ %i2 + 0x1c ], %o1 40013a5c: 7f ff bb 2d call 40002710 <.umul> 40013a60: d0 0e a0 5c ldub [ %i2 + 0x5c ], %o0 40013a64: c4 16 a0 18 lduh [ %i2 + 0x18 ], %g2 /* set up collection of fat-files fd */ fs_info->vhash = calloc(FAT_HASH_SIZE, sizeof(rtems_chain_control)); 40013a68: 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; 40013a6c: 90 02 00 02 add %o0, %g2, %o0 40013a70: d0 26 a0 58 st %o0, [ %i2 + 0x58 ] /* set up collection of fat-files fd */ fs_info->vhash = calloc(FAT_HASH_SIZE, sizeof(rtems_chain_control)); 40013a74: 7f ff c4 a0 call 40004cf4 40013a78: 90 10 20 02 mov 2, %o0 if ( fs_info->vhash == NULL ) 40013a7c: 80 a2 20 00 cmp %o0, 0 40013a80: 02 80 00 12 be 40013ac8 <== NEVER TAKEN 40013a84: d0 26 a0 6c st %o0, [ %i2 + 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 ); 40013a88: 84 02 20 04 add %o0, 4, %g2 40013a8c: 86 02 20 10 add %o0, 0x10, %g3 head->next = tail; 40013a90: 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 ); 40013a94: 84 02 20 0c add %o0, 0xc, %g2 head->next = tail; head->previous = NULL; 40013a98: c0 22 20 04 clr [ %o0 + 4 ] tail->previous = head; 40013a9c: 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; 40013aa0: c6 22 20 0c st %g3, [ %o0 + 0xc ] head->previous = NULL; 40013aa4: c0 22 20 10 clr [ %o0 + 0x10 ] tail->previous = head; 40013aa8: 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)); 40013aac: 92 10 20 0c mov 0xc, %o1 40013ab0: 7f ff c4 91 call 40004cf4 40013ab4: 90 10 20 02 mov 2, %o0 if ( fs_info->rhash == NULL ) 40013ab8: 80 a2 20 00 cmp %o0, 0 40013abc: 12 80 00 06 bne 40013ad4 <== ALWAYS TAKEN 40013ac0: d0 26 a0 70 st %o0, [ %i2 + 0x70 ] 40013ac4: 30 80 00 21 b,a 40013b48 <== 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); 40013ac8: 7f ff c4 a0 call 40004d48 <== NOT EXECUTED 40013acc: d0 06 a0 60 ld [ %i2 + 0x60 ], %o0 <== NOT EXECUTED 40013ad0: 30 80 00 31 b,a 40013b94 <== 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 ); 40013ad4: 84 02 20 04 add %o0, 4, %g2 head->next = tail; 40013ad8: 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 ); 40013adc: 84 02 20 0c add %o0, 0xc, %g2 head->next = tail; head->previous = NULL; 40013ae0: c0 22 20 04 clr [ %o0 + 4 ] tail->previous = head; 40013ae4: c4 22 20 14 st %g2, [ %o0 + 0x14 ] 40013ae8: 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; 40013aec: 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 ); 40013af0: 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; 40013af4: 84 10 21 00 mov 0x100, %g2 head->next = tail; 40013af8: c6 22 20 0c st %g3, [ %o0 + 0xc ] 40013afc: c4 26 a0 7c st %g2, [ %i2 + 0x7c ] fs_info->uino_base = (vol->tot_secs << vol->sec_mul) << 4; 40013b00: c6 06 a0 30 ld [ %i2 + 0x30 ], %g3 40013b04: c4 0e a0 03 ldub [ %i2 + 3 ], %g2 fs_info->index = 0; 40013b08: c0 26 a0 78 clr [ %i2 + 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; 40013b0c: 85 28 c0 02 sll %g3, %g2, %g2 40013b10: 85 28 a0 04 sll %g2, 4, %g2 fs_info->index = 0; fs_info->uino = (char *)calloc(fs_info->uino_pool_size, sizeof(char)); 40013b14: 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; 40013b18: c4 26 a0 80 st %g2, [ %i2 + 0x80 ] fs_info->index = 0; fs_info->uino = (char *)calloc(fs_info->uino_pool_size, sizeof(char)); 40013b1c: 7f ff c4 76 call 40004cf4 40013b20: 92 10 20 01 mov 1, %o1 if ( fs_info->uino == NULL ) 40013b24: 80 a2 20 00 cmp %o0, 0 40013b28: 12 80 00 0c bne 40013b58 <== ALWAYS TAKEN 40013b2c: d0 26 a0 74 st %o0, [ %i2 + 0x74 ] { close(vol->fd); 40013b30: 7f ff c4 86 call 40004d48 <== NOT EXECUTED 40013b34: d0 06 a0 60 ld [ %i2 + 0x60 ], %o0 <== NOT EXECUTED free(fs_info->vhash); 40013b38: 7f ff c4 a7 call 40004dd4 <== NOT EXECUTED 40013b3c: d0 06 a0 6c ld [ %i2 + 0x6c ], %o0 <== NOT EXECUTED free(fs_info->rhash); 40013b40: 10 80 00 13 b 40013b8c <== NOT EXECUTED 40013b44: d0 06 a0 70 ld [ %i2 + 0x70 ], %o0 <== 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); 40013b48: 7f ff c4 80 call 40004d48 <== NOT EXECUTED 40013b4c: d0 06 a0 60 ld [ %i2 + 0x60 ], %o0 <== NOT EXECUTED free(fs_info->vhash); 40013b50: 10 80 00 0f b 40013b8c <== NOT EXECUTED 40013b54: d0 06 a0 6c ld [ %i2 + 0x6c ], %o0 <== NOT EXECUTED close(vol->fd); free(fs_info->vhash); free(fs_info->rhash); rtems_set_errno_and_return_minus_one( ENOMEM ); } fs_info->sec_buf = (uint8_t *)calloc(vol->bps, sizeof(uint8_t)); 40013b58: d0 16 80 00 lduh [ %i2 ], %o0 40013b5c: 7f ff c4 66 call 40004cf4 40013b60: 92 10 20 01 mov 1, %o1 if (fs_info->sec_buf == NULL) 40013b64: 80 a2 20 00 cmp %o0, 0 40013b68: 12 80 00 0f bne 40013ba4 <== ALWAYS TAKEN 40013b6c: d0 26 a0 90 st %o0, [ %i2 + 0x90 ] { close(vol->fd); 40013b70: 7f ff c4 76 call 40004d48 <== NOT EXECUTED 40013b74: d0 06 a0 60 ld [ %i2 + 0x60 ], %o0 <== NOT EXECUTED free(fs_info->vhash); 40013b78: 7f ff c4 97 call 40004dd4 <== NOT EXECUTED 40013b7c: d0 06 a0 6c ld [ %i2 + 0x6c ], %o0 <== NOT EXECUTED free(fs_info->rhash); 40013b80: 7f ff c4 95 call 40004dd4 <== NOT EXECUTED 40013b84: d0 06 a0 70 ld [ %i2 + 0x70 ], %o0 <== NOT EXECUTED free(fs_info->uino); 40013b88: d0 06 a0 74 ld [ %i2 + 0x74 ], %o0 <== NOT EXECUTED 40013b8c: 7f ff c4 92 call 40004dd4 <== NOT EXECUTED 40013b90: 01 00 00 00 nop <== NOT EXECUTED rtems_set_errno_and_return_minus_one( ENOMEM ); 40013b94: 40 00 22 3e call 4001c48c <__errno> <== NOT EXECUTED 40013b98: 01 00 00 00 nop <== NOT EXECUTED 40013b9c: 10 bf fe 43 b 400134a8 <== NOT EXECUTED 40013ba0: 82 10 20 0c mov 0xc, %g1 ! c <_TLS_Alignment+0xb> <== 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; 40013ba4: c4 0e a0 04 ldub [ %i2 + 4 ], %g2 40013ba8: c6 06 a0 34 ld [ %i2 + 0x34 ], %g3 40013bac: 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) 40013bb0: 80 88 80 03 btst %g2, %g3 40013bb4: 12 80 00 17 bne 40013c10 <== NEVER TAKEN 40013bb8: 01 00 00 00 nop && (FAT_FAT32 == vol->type || is_cluster_aligned(vol, vol->rdir_loc))) 40013bbc: c6 0e a0 0e ldub [ %i2 + 0xe ], %g3 40013bc0: 80 a0 e0 04 cmp %g3, 4 40013bc4: 22 80 00 07 be,a 40013be0 40013bc8: d0 06 a0 64 ld [ %i2 + 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; 40013bcc: c6 06 a0 20 ld [ %i2 + 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))) 40013bd0: 80 88 80 03 btst %g2, %g3 40013bd4: 12 80 00 0f bne 40013c10 <== NEVER TAKEN 40013bd8: 01 00 00 00 nop { sc = rtems_bdbuf_set_block_size (vol->dd, vol->bpc, true); 40013bdc: d0 06 a0 64 ld [ %i2 + 0x64 ], %o0 40013be0: d2 16 a0 06 lduh [ %i2 + 6 ], %o1 40013be4: 7f ff f4 f7 call 40010fc0 40013be8: 94 10 20 01 mov 1, %o2 if (sc == RTEMS_SUCCESSFUL) 40013bec: 80 a2 20 00 cmp %o0, 0 40013bf0: 12 80 00 08 bne 40013c10 <== NEVER TAKEN 40013bf4: 01 00 00 00 nop { vol->bytes_per_block = vol->bpc; 40013bf8: c4 16 a0 06 lduh [ %i2 + 6 ], %g2 40013bfc: c4 36 a0 0a sth %g2, [ %i2 + 0xa ] vol->bytes_per_block_log2 = vol->bpc_log2; 40013c00: c4 0e a0 08 ldub [ %i2 + 8 ], %g2 40013c04: c4 2e a0 0c stb %g2, [ %i2 + 0xc ] vol->sectors_per_block = vol->spc; 40013c08: c4 0e a0 04 ldub [ %i2 + 4 ], %g2 40013c0c: c4 2e a0 09 stb %g2, [ %i2 + 9 ] } } return RC_OK; } 40013c10: 81 c7 e0 08 ret 40013c14: 91 e8 00 1d restore %g0, %i5, %o0 =============================================================================== 40011fd4 : uint32_t count, uint32_t *cls_added, uint32_t *last_cl, bool zero_fill ) { 40011fd4: 9d e3 bf 98 save %sp, -104, %sp int rc = RC_OK; uint32_t cl4find = 2; uint32_t save_cln = FAT_UNDEFINED_VALUE; uint32_t data_cls_val = fs_info->vol.data_cls + 2; 40011fd8: c2 06 20 38 ld [ %i0 + 0x38 ], %g1 uint32_t i = 2; if (fs_info->vol.next_cl - 2 < fs_info->vol.data_cls) 40011fdc: e2 06 20 4c ld [ %i0 + 0x4c ], %l1 uint32_t count, uint32_t *cls_added, uint32_t *last_cl, bool zero_fill ) { 40011fe0: a0 10 00 18 mov %i0, %l0 uint32_t cl4find = 2; uint32_t save_cln = FAT_UNDEFINED_VALUE; uint32_t data_cls_val = fs_info->vol.data_cls + 2; uint32_t i = 2; if (fs_info->vol.next_cl - 2 < fs_info->vol.data_cls) 40011fe4: 84 04 7f fe add %l1, -2, %g2 40011fe8: 80 a0 80 01 cmp %g2, %g1 40011fec: 0a 80 00 03 bcs 40011ff8 40011ff0: a8 00 60 02 add %g1, 2, %l4 uint32_t *last_cl, bool zero_fill ) { int rc = RC_OK; uint32_t cl4find = 2; 40011ff4: a2 10 20 02 mov 2, %l1 uint32_t i = 2; if (fs_info->vol.next_cl - 2 < fs_info->vol.data_cls) cl4find = fs_info->vol.next_cl; *cls_added = 0; 40011ff8: c0 26 c0 00 clr [ %i3 ] { int rc = RC_OK; uint32_t cl4find = 2; uint32_t save_cln = FAT_UNDEFINED_VALUE; uint32_t data_cls_val = fs_info->vol.data_cls + 2; uint32_t i = 2; 40011ffc: a6 10 20 02 mov 2, %l3 bool zero_fill ) { int rc = RC_OK; uint32_t cl4find = 2; uint32_t save_cln = FAT_UNDEFINED_VALUE; 40012000: a4 10 3f ff mov -1, %l2 /* * 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 (*cls_added != count && i < data_cls_val) 40012004: c2 06 c0 00 ld [ %i3 ], %g1 40012008: 80 a0 40 1a cmp %g1, %i2 4001200c: 12 80 00 0b bne 40012038 40012010: 80 a4 c0 14 cmp %l3, %l4 cl4find++; if (cl4find >= data_cls_val) cl4find = 2; } *last_cl = save_cln; 40012014: e4 27 00 00 st %l2, [ %i4 ] fs_info->vol.next_cl = save_cln; if (fs_info->vol.free_cls != FAT_UNDEFINED_VALUE) 40012018: c2 04 20 44 ld [ %l0 + 0x44 ], %g1 4001201c: 80 a0 7f ff cmp %g1, -1 40012020: 02 80 00 5b be 4001218c <== ALWAYS TAKEN 40012024: e4 24 20 4c st %l2, [ %l0 + 0x4c ] fs_info->vol.free_cls -= (*cls_added); 40012028: c4 06 c0 00 ld [ %i3 ], %g2 <== NOT EXECUTED 4001202c: 82 20 40 02 sub %g1, %g2, %g1 <== NOT EXECUTED 40012030: 10 80 00 57 b 4001218c <== NOT EXECUTED 40012034: c2 24 20 44 st %g1, [ %l0 + 0x44 ] <== 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 (*cls_added != count && i < data_cls_val) 40012038: 1a bf ff f7 bcc 40012014 4001203c: 90 10 00 10 mov %l0, %o0 { uint32_t next_cln = 0; 40012040: c0 27 bf fc clr [ %fp + -4 ] rc = fat_get_fat_cluster(fs_info, cl4find, &next_cln); 40012044: 92 10 00 11 mov %l1, %o1 40012048: 7f ff fe a7 call 40011ae4 4001204c: 94 07 bf fc add %fp, -4, %o2 if ( rc != RC_OK ) 40012050: 80 a2 20 00 cmp %o0, 0 40012054: 02 80 00 07 be 40012070 <== ALWAYS TAKEN 40012058: c2 06 c0 00 ld [ %i3 ], %g1 */ while (*cls_added != count && i < data_cls_val) { uint32_t next_cln = 0; rc = fat_get_fat_cluster(fs_info, cl4find, &next_cln); 4001205c: b0 10 00 08 mov %o0, %i0 <== NOT EXECUTED if ( rc != RC_OK ) { if (*cls_added != 0) 40012060: 80 a0 60 00 cmp %g1, 0 <== NOT EXECUTED 40012064: 02 80 00 1e be 400120dc <== NOT EXECUTED 40012068: 90 10 00 10 mov %l0, %o0 <== NOT EXECUTED 4001206c: 30 80 00 1a b,a 400120d4 <== NOT EXECUTED fat_free_fat_clusters_chain(fs_info, (*chain)); return rc; } if (next_cln == FAT_GENFAT_FREE) 40012070: c4 07 bf fc ld [ %fp + -4 ], %g2 40012074: 80 a0 a0 00 cmp %g2, 0 40012078: 32 80 00 33 bne,a 40012144 4001207c: a2 04 60 01 inc %l1 /* * 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) 40012080: 80 a0 60 00 cmp %g1, 0 40012084: 12 80 00 0d bne 400120b8 40012088: 90 10 00 10 mov %l0, %o0 { *chain = cl4find; 4001208c: e2 26 40 00 st %l1, [ %i1 ] rc = fat_set_fat_cluster(fs_info, cl4find, FAT_GENFAT_EOC); 40012090: 92 10 00 11 mov %l1, %o1 40012094: 7f ff ff 02 call 40011c9c 40012098: 94 10 3f ff mov -1, %o2 if ( rc != RC_OK ) 4001209c: 80 a2 20 00 cmp %o0, 0 400120a0: 12 80 00 2e bne 40012158 <== NEVER TAKEN 400120a4: 80 a7 60 00 cmp %i5, 0 rc = fat_set_fat_cluster(fs_info, save_cln, cl4find); if ( rc != RC_OK ) goto cleanup; } if (zero_fill) 400120a8: 22 80 00 17 be,a 40012104 400120ac: c2 06 c0 00 ld [ %i3 ], %g1 { ssize_t bytes_written = 400120b0: 10 80 00 19 b 40012114 400120b4: d6 14 20 06 lduh [ %l0 + 6 ], %o3 } } else { /* set EOC value to new allocated cluster */ rc = fat_set_fat_cluster(fs_info, cl4find, FAT_GENFAT_EOC); 400120b8: 92 10 00 11 mov %l1, %o1 400120bc: 7f ff fe f8 call 40011c9c 400120c0: 94 10 3f ff mov -1, %o2 400120c4: b0 10 00 08 mov %o0, %i0 if ( rc != RC_OK ) 400120c8: 80 a6 20 00 cmp %i0, 0 400120cc: 02 80 00 06 be 400120e4 <== ALWAYS TAKEN 400120d0: 90 10 00 10 mov %l0, %o0 { /* cleanup activity */ fat_free_fat_clusters_chain(fs_info, (*chain)); 400120d4: 7f ff ff 90 call 40011f14 <== NOT EXECUTED 400120d8: d2 06 40 00 ld [ %i1 ], %o1 <== NOT EXECUTED return rc; 400120dc: 81 c7 e0 08 ret <== NOT EXECUTED 400120e0: 81 e8 00 00 restore <== NOT EXECUTED } rc = fat_set_fat_cluster(fs_info, save_cln, cl4find); 400120e4: 92 10 00 12 mov %l2, %o1 400120e8: 7f ff fe ed call 40011c9c 400120ec: 94 10 00 11 mov %l1, %o2 if ( rc != RC_OK ) 400120f0: b0 92 20 00 orcc %o0, 0, %i0 400120f4: 02 bf ff ed be 400120a8 <== ALWAYS TAKEN 400120f8: 80 a7 60 00 cmp %i5, 0 return RC_OK; cleanup: /* cleanup activity */ fat_free_fat_clusters_chain(fs_info, (*chain)); 400120fc: 10 80 00 1a b 40012164 <== NOT EXECUTED 40012100: d2 06 40 00 ld [ %i1 ], %o1 <== NOT EXECUTED goto cleanup; } } save_cln = cl4find; (*cls_added)++; 40012104: a4 10 00 11 mov %l1, %l2 40012108: 82 00 60 01 inc %g1 4001210c: 10 80 00 0d b 40012140 40012110: c2 26 c0 00 st %g1, [ %i3 ] goto cleanup; } if (zero_fill) { ssize_t bytes_written = 40012114: 90 10 00 10 mov %l0, %o0 40012118: 92 10 00 11 mov %l1, %o1 4001211c: 94 10 20 00 clr %o2 40012120: 40 00 04 43 call 4001322c 40012124: 98 10 20 00 clr %o4 fat_cluster_set(fs_info, cl4find, 0, fs_info->vol.bpc, 0); if (fs_info->vol.bpc != bytes_written) 40012128: c2 14 20 06 lduh [ %l0 + 6 ], %g1 4001212c: 80 a0 40 08 cmp %g1, %o0 40012130: 22 bf ff f5 be,a 40012104 <== ALWAYS TAKEN 40012134: c2 06 c0 00 ld [ %i3 ], %g1 { rc = -1; 40012138: 10 80 00 0a b 40012160 <== NOT EXECUTED 4001213c: b0 10 3f ff mov -1, %i0 <== NOT EXECUTED save_cln = cl4find; (*cls_added)++; } i++; cl4find++; 40012140: a2 04 60 01 inc %l1 if (cl4find >= data_cls_val) 40012144: 80 a4 40 14 cmp %l1, %l4 40012148: 0a bf ff af bcs 40012004 4001214c: a6 04 e0 01 inc %l3 cl4find = 2; 40012150: 10 bf ff ad b 40012004 40012154: a2 10 20 02 mov 2, %l1 * wouldn't work properly */ if (*cls_added == 0) { *chain = cl4find; rc = fat_set_fat_cluster(fs_info, cl4find, FAT_GENFAT_EOC); 40012158: 81 c7 e0 08 ret <== NOT EXECUTED 4001215c: 91 e8 00 08 restore %g0, %o0, %o0 <== NOT EXECUTED return RC_OK; cleanup: /* cleanup activity */ fat_free_fat_clusters_chain(fs_info, (*chain)); 40012160: d2 06 40 00 ld [ %i1 ], %o1 <== NOT EXECUTED 40012164: 7f ff ff 6c call 40011f14 <== NOT EXECUTED 40012168: 90 10 00 10 mov %l0, %o0 <== NOT EXECUTED /* trying to save last allocated cluster for future use */ fat_set_fat_cluster(fs_info, cl4find, FAT_GENFAT_FREE); 4001216c: 90 10 00 10 mov %l0, %o0 <== NOT EXECUTED 40012170: 92 10 00 11 mov %l1, %o1 <== NOT EXECUTED 40012174: 7f ff fe ca call 40011c9c <== NOT EXECUTED 40012178: 94 10 20 00 clr %o2 <== NOT EXECUTED fat_buf_release(fs_info); 4001217c: 40 00 03 48 call 40012e9c <== NOT EXECUTED 40012180: 90 10 00 10 mov %l0, %o0 <== NOT EXECUTED return rc; 40012184: 81 c7 e0 08 ret <== NOT EXECUTED 40012188: 81 e8 00 00 restore <== NOT EXECUTED fs_info->vol.next_cl = save_cln; if (fs_info->vol.free_cls != FAT_UNDEFINED_VALUE) fs_info->vol.free_cls -= (*cls_added); fat_buf_release(fs_info); 4001218c: 90 10 00 10 mov %l0, %o0 40012190: 40 00 03 43 call 40012e9c 40012194: b0 10 20 00 clr %i0 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; } 40012198: 81 c7 e0 08 ret 4001219c: 81 e8 00 00 restore =============================================================================== 40013198 : fat_fs_info_t *fs_info, uint32_t start, uint32_t offset, uint32_t count, const void *buff) { 40013198: 9d e3 bf 98 save %sp, -104, %sp int rc = RC_OK; ssize_t cmpltd = 0; 4001319c: a0 10 20 00 clr %l0 } static inline void fat_buf_mark_modified(fat_fs_info_t *fs_info) { fs_info->c.modified = true; 400131a0: a2 10 20 01 mov 1, %l1 uint32_t sec_num = start; uint32_t ofs = offset; uint8_t *sec_buf; uint32_t c = 0; while(count > 0) 400131a4: 80 a6 e0 00 cmp %i3, 0 400131a8: 02 80 00 1d be 4001321c 400131ac: 01 00 00 00 nop { c = MIN(count, (fs_info->vol.bps - ofs)); 400131b0: fa 16 00 00 lduh [ %i0 ], %i5 400131b4: ba 27 40 1a sub %i5, %i2, %i5 400131b8: 80 a7 40 1b cmp %i5, %i3 400131bc: 38 80 00 02 bgu,a 400131c4 400131c0: ba 10 00 1b mov %i3, %i5 if (c == fs_info->vol.bytes_per_block) 400131c4: c2 16 20 0a lduh [ %i0 + 0xa ], %g1 rc = fat_buf_access(fs_info, sec_num, FAT_OP_TYPE_GET, &sec_buf); 400131c8: 90 10 00 18 mov %i0, %o0 400131cc: 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) 400131d0: 80 a7 40 01 cmp %i5, %g1 400131d4: 02 80 00 03 be 400131e0 <== NEVER TAKEN 400131d8: 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); 400131dc: 94 10 20 01 mov 1, %o2 400131e0: 7f ff ff a0 call 40013060 400131e4: 96 07 bf fc add %fp, -4, %o3 if (rc != RC_OK) 400131e8: 80 a2 20 00 cmp %o0, 0 400131ec: 12 80 00 0e bne 40013224 <== NEVER TAKEN 400131f0: d0 07 bf fc ld [ %fp + -4 ], %o0 return -1; memcpy((sec_buf + ofs), (buff + cmpltd), c); 400131f4: 92 07 00 10 add %i4, %l0, %o1 400131f8: 90 02 00 1a add %o0, %i2, %o0 400131fc: 94 10 00 1d mov %i5, %o2 40013200: 40 00 26 f8 call 4001cde0 40013204: b6 26 c0 1d sub %i3, %i5, %i3 fat_buf_mark_modified(fs_info); count -= c; cmpltd +=c; 40013208: a0 07 40 10 add %i5, %l0, %l0 4001320c: e2 2e 20 88 stb %l1, [ %i0 + 0x88 ] sec_num++; 40013210: b2 06 60 01 inc %i1 ofs = 0; 40013214: 10 bf ff e4 b 400131a4 40013218: b4 10 20 00 clr %i2 4001321c: 81 c7 e0 08 ret 40013220: 91 e8 00 10 restore %g0, %l0, %o0 } return cmpltd; } 40013224: 81 c7 e0 08 ret <== NOT EXECUTED 40013228: 91 e8 3f ff restore %g0, -1, %o0 <== NOT EXECUTED =============================================================================== 40011c9c : fat_set_fat_cluster( fat_fs_info_t *fs_info, uint32_t cln, uint32_t in_val ) { 40011c9c: 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; 40011ca0: c0 27 bf fc clr [ %fp + -4 ] /* sanity check */ if ( (cln < 2) || (cln > (fs_info->vol.data_cls + 1)) ) 40011ca4: 80 a6 60 01 cmp %i1, 1 40011ca8: 08 80 00 95 bleu 40011efc <== NEVER TAKEN 40011cac: ba 10 00 18 mov %i0, %i5 40011cb0: c2 06 20 38 ld [ %i0 + 0x38 ], %g1 40011cb4: 82 00 60 01 inc %g1 40011cb8: 80 a6 40 01 cmp %i1, %g1 40011cbc: 18 80 00 90 bgu 40011efc <== NEVER TAKEN 40011cc0: 01 00 00 00 nop rtems_set_errno_and_return_minus_one(EIO); sec = (FAT_FAT_OFFSET(fs_info->vol.type, cln) >> fs_info->vol.sec_log2) + 40011cc4: c2 0e 20 0e ldub [ %i0 + 0xe ], %g1 40011cc8: 84 88 60 01 andcc %g1, 1, %g2 40011ccc: 02 80 00 05 be 40011ce0 40011cd0: 80 88 60 02 btst 2, %g1 40011cd4: a1 36 60 01 srl %i1, 1, %l0 40011cd8: 10 80 00 05 b 40011cec 40011cdc: a0 04 00 19 add %l0, %i1, %l0 40011ce0: 02 80 00 03 be 40011cec 40011ce4: a1 2e 60 02 sll %i1, 2, %l0 40011ce8: a1 2e 60 01 sll %i1, 1, %l0 40011cec: 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); 40011cf0: 80 a0 a0 00 cmp %g2, 0 /* 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) + 40011cf4: a1 34 00 03 srl %l0, %g3, %l0 40011cf8: 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); 40011cfc: 02 80 00 05 be 40011d10 40011d00: a0 04 00 03 add %l0, %g3, %l0 40011d04: b7 36 60 01 srl %i1, 1, %i3 40011d08: 10 80 00 06 b 40011d20 40011d0c: b6 06 c0 19 add %i3, %i1, %i3 40011d10: 80 88 60 02 btst 2, %g1 40011d14: 02 80 00 03 be 40011d20 40011d18: b7 2e 60 02 sll %i1, 2, %i3 40011d1c: b7 2e 60 01 sll %i1, 1, %i3 40011d20: f8 17 40 00 lduh [ %i5 ], %i4 rc = fat_buf_access(fs_info, sec, FAT_OP_TYPE_READ, &sec_buf); 40011d24: 90 10 00 1d mov %i5, %o0 40011d28: 92 10 00 10 mov %l0, %o1 40011d2c: 94 10 20 01 mov 1, %o2 40011d30: 40 00 04 cc call 40013060 40011d34: 96 07 bf fc add %fp, -4, %o3 if (rc != RC_OK) 40011d38: b0 92 20 00 orcc %o0, 0, %i0 40011d3c: 12 80 00 4c bne 40011e6c <== NEVER TAKEN 40011d40: 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); 40011d44: b9 37 20 10 srl %i4, 0x10, %i4 40011d48: b8 07 3f ff add %i4, -1, %i4 40011d4c: 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 ) 40011d50: f6 0f 60 0e ldub [ %i5 + 0xe ], %i3 40011d54: 80 a6 e0 02 cmp %i3, 2 40011d58: 02 80 00 53 be 40011ea4 40011d5c: 80 a6 e0 04 cmp %i3, 4 40011d60: 02 80 00 5b be 40011ecc 40011d64: 80 a6 e0 01 cmp %i3, 1 40011d68: 12 80 00 65 bne 40011efc <== NEVER TAKEN 40011d6c: 80 8e 60 01 btst 1, %i1 { case FAT_FAT12: if ( FAT_CLUSTER_IS_ODD(cln) ) 40011d70: 02 80 00 23 be 40011dfc 40011d74: c2 07 bf fc ld [ %fp + -4 ], %g1 { fat16_clv = ((uint16_t )in_val) << FAT_FAT12_SHIFT; *(sec_buf + ofs) &= 0x0F; 40011d78: c4 08 40 1c ldub [ %g1 + %i4 ], %g2 *(sec_buf + ofs) |= (uint8_t)(fat16_clv & 0x00F0); 40011d7c: 87 2e a0 04 sll %i2, 4, %g3 { case FAT_FAT12: if ( FAT_CLUSTER_IS_ODD(cln) ) { fat16_clv = ((uint16_t )in_val) << FAT_FAT12_SHIFT; *(sec_buf + ofs) &= 0x0F; 40011d80: 84 08 a0 0f and %g2, 0xf, %g2 40011d84: c4 28 40 1c stb %g2, [ %g1 + %i4 ] *(sec_buf + ofs) |= (uint8_t)(fat16_clv & 0x00F0); 40011d88: c2 07 bf fc ld [ %fp + -4 ], %g1 40011d8c: c4 08 40 1c ldub [ %g1 + %i4 ], %g2 40011d90: 84 10 c0 02 or %g3, %g2, %g2 40011d94: c4 28 40 1c stb %g2, [ %g1 + %i4 ] fat_buf_mark_modified(fs_info); if ( ofs == (fs_info->vol.bps - 1) ) 40011d98: c2 17 40 00 lduh [ %i5 ], %g1 40011d9c: 82 00 7f ff add %g1, -1, %g1 40011da0: 80 a7 00 01 cmp %i4, %g1 40011da4: 12 80 00 0f bne 40011de0 40011da8: f6 2f 60 88 stb %i3, [ %i5 + 0x88 ] { rc = fat_buf_access(fs_info, sec + 1, FAT_OP_TYPE_READ, 40011dac: 90 10 00 1d mov %i5, %o0 40011db0: 92 04 20 01 add %l0, 1, %o1 40011db4: 94 10 20 01 mov 1, %o2 40011db8: 40 00 04 aa call 40013060 40011dbc: 96 07 bf fc add %fp, -4, %o3 &sec_buf); if (rc != RC_OK) 40011dc0: b0 92 20 00 orcc %o0, 0, %i0 40011dc4: 12 80 00 2a bne 40011e6c <== NEVER TAKEN 40011dc8: c2 07 bf fc ld [ %fp + -4 ], %g1 return rc; *sec_buf &= 0x00; *sec_buf |= (uint8_t)((fat16_clv & 0xFF00)>>8); 40011dcc: b5 2e a0 14 sll %i2, 0x14, %i2 rc = fat_buf_access(fs_info, sec + 1, FAT_OP_TYPE_READ, &sec_buf); if (rc != RC_OK) return rc; *sec_buf &= 0x00; 40011dd0: c0 28 40 00 clrb [ %g1 ] *sec_buf |= (uint8_t)((fat16_clv & 0xFF00)>>8); 40011dd4: b5 36 a0 18 srl %i2, 0x18, %i2 40011dd8: 10 80 00 21 b 40011e5c 40011ddc: c2 07 bf fc ld [ %fp + -4 ], %g1 fat_buf_mark_modified(fs_info); } else { *(sec_buf + ofs + 1) &= 0x00; 40011de0: c2 07 bf fc ld [ %fp + -4 ], %g1 40011de4: b8 07 20 01 inc %i4 *(sec_buf + ofs + 1) |= (uint8_t )((fat16_clv & 0xFF00)>>8); 40011de8: b5 2e a0 14 sll %i2, 0x14, %i2 fat_buf_mark_modified(fs_info); } else { *(sec_buf + ofs + 1) &= 0x00; 40011dec: c0 28 40 1c clrb [ %g1 + %i4 ] *(sec_buf + ofs + 1) |= (uint8_t )((fat16_clv & 0xFF00)>>8); 40011df0: b5 36 a0 18 srl %i2, 0x18, %i2 40011df4: 10 80 00 27 b 40011e90 40011df8: c2 07 bf fc ld [ %fp + -4 ], %g1 } } else { fat16_clv = ((uint16_t )in_val) & FAT_FAT12_MASK; *(sec_buf + ofs) &= 0x00; 40011dfc: c0 28 40 1c clrb [ %g1 + %i4 ] *(sec_buf + ofs) |= (uint8_t)(fat16_clv & 0x00FF); 40011e00: 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; 40011e04: b4 0e af ff and %i2, 0xfff, %i2 *(sec_buf + ofs) &= 0x00; *(sec_buf + ofs) |= (uint8_t)(fat16_clv & 0x00FF); 40011e08: c4 08 40 1c ldub [ %g1 + %i4 ], %g2 40011e0c: 84 16 80 02 or %i2, %g2, %g2 40011e10: c4 28 40 1c stb %g2, [ %g1 + %i4 ] fat_buf_mark_modified(fs_info); if ( ofs == (fs_info->vol.bps - 1) ) 40011e14: c2 17 40 00 lduh [ %i5 ], %g1 40011e18: 82 00 7f ff add %g1, -1, %g1 40011e1c: 80 a7 00 01 cmp %i4, %g1 40011e20: 12 80 00 15 bne 40011e74 <== ALWAYS TAKEN 40011e24: f6 2f 60 88 stb %i3, [ %i5 + 0x88 ] { rc = fat_buf_access(fs_info, sec + 1, FAT_OP_TYPE_READ, 40011e28: 90 10 00 1d mov %i5, %o0 <== NOT EXECUTED 40011e2c: 92 04 20 01 add %l0, 1, %o1 <== NOT EXECUTED 40011e30: 94 10 20 01 mov 1, %o2 <== NOT EXECUTED 40011e34: 40 00 04 8b call 40013060 <== NOT EXECUTED 40011e38: 96 07 bf fc add %fp, -4, %o3 <== NOT EXECUTED &sec_buf); if (rc != RC_OK) 40011e3c: b0 92 20 00 orcc %o0, 0, %i0 <== NOT EXECUTED 40011e40: 12 80 00 0b bne 40011e6c <== NOT EXECUTED 40011e44: c2 07 bf fc ld [ %fp + -4 ], %g1 <== NOT EXECUTED return rc; *sec_buf &= 0xF0; *sec_buf |= (uint8_t)((fat16_clv & 0xFF00)>>8); 40011e48: 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; 40011e4c: c4 08 40 00 ldub [ %g1 ], %g2 <== NOT EXECUTED 40011e50: 84 08 bf f0 and %g2, -16, %g2 <== NOT EXECUTED 40011e54: c4 28 40 00 stb %g2, [ %g1 ] <== NOT EXECUTED *sec_buf |= (uint8_t)((fat16_clv & 0xFF00)>>8); 40011e58: c2 07 bf fc ld [ %fp + -4 ], %g1 <== NOT EXECUTED 40011e5c: c4 08 40 00 ldub [ %g1 ], %g2 40011e60: b4 16 80 02 or %i2, %g2, %i2 40011e64: f4 28 40 00 stb %i2, [ %g1 ] } static inline void fat_buf_mark_modified(fat_fs_info_t *fs_info) { fs_info->c.modified = true; 40011e68: f6 2f 60 88 stb %i3, [ %i5 + 0x88 ] 40011e6c: 81 c7 e0 08 ret 40011e70: 81 e8 00 00 restore fat_buf_mark_modified(fs_info); } else { *(sec_buf + ofs + 1) &= 0xF0; 40011e74: c2 07 bf fc ld [ %fp + -4 ], %g1 40011e78: b8 07 20 01 inc %i4 40011e7c: c4 08 40 1c ldub [ %g1 + %i4 ], %g2 *(sec_buf + ofs+1) |= (uint8_t)((fat16_clv & 0xFF00)>>8); 40011e80: b5 36 a0 08 srl %i2, 8, %i2 fat_buf_mark_modified(fs_info); } else { *(sec_buf + ofs + 1) &= 0xF0; 40011e84: 84 08 bf f0 and %g2, -16, %g2 40011e88: c4 28 40 1c stb %g2, [ %g1 + %i4 ] *(sec_buf + ofs+1) |= (uint8_t)((fat16_clv & 0xFF00)>>8); 40011e8c: c2 07 bf fc ld [ %fp + -4 ], %g1 40011e90: c4 08 40 1c ldub [ %g1 + %i4 ], %g2 40011e94: b4 16 80 02 or %i2, %g2, %i2 40011e98: f4 28 40 1c stb %i2, [ %g1 + %i4 ] 40011e9c: 81 c7 e0 08 ret 40011ea0: 81 e8 00 00 restore 40011ea4: 03 00 00 3f sethi %hi(0xfc00), %g1 40011ea8: 82 10 63 ff or %g1, 0x3ff, %g1 ! ffff <_TLS_Alignment+0xfffe> 40011eac: 82 0e 80 01 and %i2, %g1, %g1 } break; case FAT_FAT16: *((uint16_t *)(sec_buf + ofs)) = (uint16_t )(CT_LE_W(in_val)); 40011eb0: 83 28 60 08 sll %g1, 8, %g1 40011eb4: b5 2e a0 10 sll %i2, 0x10, %i2 40011eb8: b5 36 a0 18 srl %i2, 0x18, %i2 40011ebc: b4 10 40 1a or %g1, %i2, %i2 } } break; case FAT_FAT16: *((uint16_t *)(sec_buf + ofs)) = 40011ec0: c2 07 bf fc ld [ %fp + -4 ], %g1 40011ec4: 10 80 00 0a b 40011eec 40011ec8: 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)); 40011ecc: 11 3c 00 00 sethi %hi(0xf0000000), %o0 40011ed0: 7f ff fe f9 call 40011ab4 40011ed4: 90 2e 80 08 andn %i2, %o0, %o0 *((uint32_t *)(sec_buf + ofs)) &= CT_LE_L(0xF0000000); 40011ed8: c2 07 bf fc ld [ %fp + -4 ], %g1 40011edc: c4 00 40 1c ld [ %g1 + %i4 ], %g2 40011ee0: 84 08 a0 f0 and %g2, 0xf0, %g2 *((uint32_t *)(sec_buf + ofs)) |= fat32_clv; 40011ee4: 90 12 00 02 or %o0, %g2, %o0 40011ee8: d0 20 40 1c st %o0, [ %g1 + %i4 ] 40011eec: 82 10 20 01 mov 1, %g1 40011ef0: c2 2f 60 88 stb %g1, [ %i5 + 0x88 ] 40011ef4: 81 c7 e0 08 ret 40011ef8: 81 e8 00 00 restore fat_buf_mark_modified(fs_info); break; default: rtems_set_errno_and_return_minus_one(EIO); 40011efc: 40 00 29 64 call 4001c48c <__errno> <== NOT EXECUTED 40011f00: b0 10 3f ff mov -1, %i0 <== NOT EXECUTED 40011f04: 82 10 20 05 mov 5, %g1 <== NOT EXECUTED 40011f08: c2 22 00 00 st %g1, [ %o0 ] <== NOT EXECUTED break; } return RC_OK; } 40011f0c: 81 c7 e0 08 ret <== NOT EXECUTED 40011f10: 81 e8 00 00 restore <== NOT EXECUTED =============================================================================== 40013cd8 : * RC_OK on success, or -1 if error occured * and errno set appropriately */ int fat_shutdown_drive(fat_fs_info_t *fs_info) { 40013cd8: 9d e3 bf a0 save %sp, -96, %sp 40013cdc: ba 10 00 18 mov %i0, %i5 int rc = RC_OK; int i = 0; rc = fat_sync(fs_info); 40013ce0: 7f ff ff ce call 40013c18 40013ce4: 90 10 00 18 mov %i0, %o0 rc = -1; for (i = 0; i < FAT_HASH_SIZE; i++) { rtems_chain_node *node = NULL; rtems_chain_control *the_chain = fs_info->vhash + i; 40013ce8: f8 07 60 6c ld [ %i5 + 0x6c ], %i4 { int rc = RC_OK; int i = 0; rc = fat_sync(fs_info); if ( rc != RC_OK ) 40013cec: 80 a0 00 08 cmp %g0, %o0 RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( const Chain_Control *the_chain ) { return _Chain_Immutable_first( the_chain ) == _Chain_Immutable_tail( the_chain ); 40013cf0: b6 07 20 04 add %i4, 4, %i3 40013cf4: b0 60 20 00 subx %g0, 0, %i0 */ RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_first( const Chain_Control *the_chain ) { return _Chain_Immutable_head( the_chain )->next; 40013cf8: d0 07 00 00 ld [ %i4 ], %o0 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Get_unprotected( Chain_Control *the_chain ) { if ( !_Chain_Is_empty(the_chain)) 40013cfc: 80 a2 00 1b cmp %o0, %i3 40013d00: 22 80 00 08 be,a 40013d20 40013d04: c2 07 60 6c ld [ %i5 + 0x6c ], %g1 Chain_Control *the_chain ) { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *old_first = head->next; Chain_Node *new_first = old_first->next; 40013d08: c2 02 00 00 ld [ %o0 ], %g1 head->next = new_first; 40013d0c: c2 27 00 00 st %g1, [ %i4 ] { rtems_chain_node *node = NULL; rtems_chain_control *the_chain = fs_info->vhash + i; while ( (node = rtems_chain_get_unprotected(the_chain)) != NULL ) free(node); 40013d10: 7f ff c4 31 call 40004dd4 40013d14: f8 20 60 04 st %i4, [ %g1 + 4 ] */ RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_first( const Chain_Control *the_chain ) { return _Chain_Immutable_head( the_chain )->next; 40013d18: 10 bf ff f9 b 40013cfc 40013d1c: d0 07 00 00 ld [ %i4 ], %o0 rc = -1; for (i = 0; i < FAT_HASH_SIZE; i++) { rtems_chain_node *node = NULL; rtems_chain_control *the_chain = fs_info->vhash + i; 40013d20: b8 00 60 0c add %g1, 0xc, %i4 RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( const Chain_Control *the_chain ) { return _Chain_Immutable_first( the_chain ) == _Chain_Immutable_tail( the_chain ); 40013d24: b6 00 60 10 add %g1, 0x10, %i3 */ RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_first( const Chain_Control *the_chain ) { return _Chain_Immutable_head( the_chain )->next; 40013d28: d0 07 00 00 ld [ %i4 ], %o0 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Get_unprotected( Chain_Control *the_chain ) { if ( !_Chain_Is_empty(the_chain)) 40013d2c: 80 a2 00 1b cmp %o0, %i3 40013d30: 22 80 00 08 be,a 40013d50 <== ALWAYS TAKEN 40013d34: f8 07 60 70 ld [ %i5 + 0x70 ], %i4 Chain_Control *the_chain ) { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *old_first = head->next; Chain_Node *new_first = old_first->next; 40013d38: c2 02 00 00 ld [ %o0 ], %g1 <== NOT EXECUTED head->next = new_first; 40013d3c: c2 27 00 00 st %g1, [ %i4 ] <== NOT EXECUTED while ( (node = rtems_chain_get_unprotected(the_chain)) != NULL ) free(node); 40013d40: 7f ff c4 25 call 40004dd4 <== NOT EXECUTED 40013d44: f8 20 60 04 st %i4, [ %g1 + 4 ] <== NOT EXECUTED */ RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_first( const Chain_Control *the_chain ) { return _Chain_Immutable_head( the_chain )->next; 40013d48: 10 bf ff f9 b 40013d2c <== NOT EXECUTED 40013d4c: d0 07 00 00 ld [ %i4 ], %o0 <== NOT EXECUTED RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( const Chain_Control *the_chain ) { return _Chain_Immutable_first( the_chain ) == _Chain_Immutable_tail( the_chain ); 40013d50: b6 07 20 04 add %i4, 4, %i3 */ RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_first( const Chain_Control *the_chain ) { return _Chain_Immutable_head( the_chain )->next; 40013d54: d0 07 00 00 ld [ %i4 ], %o0 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Get_unprotected( Chain_Control *the_chain ) { if ( !_Chain_Is_empty(the_chain)) 40013d58: 80 a2 00 1b cmp %o0, %i3 40013d5c: 22 80 00 08 be,a 40013d7c <== ALWAYS TAKEN 40013d60: c2 07 60 70 ld [ %i5 + 0x70 ], %g1 Chain_Control *the_chain ) { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *old_first = head->next; Chain_Node *new_first = old_first->next; 40013d64: c2 02 00 00 ld [ %o0 ], %g1 <== NOT EXECUTED head->next = new_first; 40013d68: c2 27 00 00 st %g1, [ %i4 ] <== NOT EXECUTED { rtems_chain_node *node = NULL; rtems_chain_control *the_chain = fs_info->rhash + i; while ( (node = rtems_chain_get_unprotected(the_chain)) != NULL ) free(node); 40013d6c: 7f ff c4 1a call 40004dd4 <== NOT EXECUTED 40013d70: f8 20 60 04 st %i4, [ %g1 + 4 ] <== NOT EXECUTED */ RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_first( const Chain_Control *the_chain ) { return _Chain_Immutable_head( the_chain )->next; 40013d74: 10 bf ff f9 b 40013d58 <== NOT EXECUTED 40013d78: d0 07 00 00 ld [ %i4 ], %o0 <== NOT EXECUTED } for (i = 0; i < FAT_HASH_SIZE; i++) { rtems_chain_node *node = NULL; rtems_chain_control *the_chain = fs_info->rhash + i; 40013d7c: b8 00 60 0c add %g1, 0xc, %i4 RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( const Chain_Control *the_chain ) { return _Chain_Immutable_first( the_chain ) == _Chain_Immutable_tail( the_chain ); 40013d80: b6 00 60 10 add %g1, 0x10, %i3 */ RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_first( const Chain_Control *the_chain ) { return _Chain_Immutable_head( the_chain )->next; 40013d84: d0 07 00 00 ld [ %i4 ], %o0 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Get_unprotected( Chain_Control *the_chain ) { if ( !_Chain_Is_empty(the_chain)) 40013d88: 80 a2 00 1b cmp %o0, %i3 40013d8c: 02 80 00 08 be 40013dac <== ALWAYS TAKEN 40013d90: 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; 40013d94: c2 02 00 00 ld [ %o0 ], %g1 <== NOT EXECUTED head->next = new_first; 40013d98: c2 27 00 00 st %g1, [ %i4 ] <== NOT EXECUTED while ( (node = rtems_chain_get_unprotected(the_chain)) != NULL ) free(node); 40013d9c: 7f ff c4 0e call 40004dd4 <== NOT EXECUTED 40013da0: f8 20 60 04 st %i4, [ %g1 + 4 ] <== NOT EXECUTED */ RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_first( const Chain_Control *the_chain ) { return _Chain_Immutable_head( the_chain )->next; 40013da4: 10 bf ff f9 b 40013d88 <== NOT EXECUTED 40013da8: d0 07 00 00 ld [ %i4 ], %o0 <== NOT EXECUTED } free(fs_info->vhash); 40013dac: 7f ff c4 0a call 40004dd4 40013db0: d0 07 60 6c ld [ %i5 + 0x6c ], %o0 free(fs_info->rhash); 40013db4: 7f ff c4 08 call 40004dd4 40013db8: d0 07 60 70 ld [ %i5 + 0x70 ], %o0 free(fs_info->uino); 40013dbc: 7f ff c4 06 call 40004dd4 40013dc0: d0 07 60 74 ld [ %i5 + 0x74 ], %o0 free(fs_info->sec_buf); 40013dc4: 7f ff c4 04 call 40004dd4 40013dc8: d0 07 60 90 ld [ %i5 + 0x90 ], %o0 close(fs_info->vol.fd); 40013dcc: 7f ff c3 df call 40004d48 40013dd0: d0 07 60 60 ld [ %i5 + 0x60 ], %o0 if (rc) 40013dd4: 80 a6 20 00 cmp %i0, 0 40013dd8: 02 80 00 08 be 40013df8 <== ALWAYS TAKEN 40013ddc: 01 00 00 00 nop errno = EIO; 40013de0: 40 00 21 ab call 4001c48c <__errno> <== NOT EXECUTED 40013de4: 01 00 00 00 nop <== NOT EXECUTED 40013de8: 82 10 20 05 mov 5, %g1 ! 5 <_TLS_Alignment+0x4> <== NOT EXECUTED 40013dec: c2 22 00 00 st %g1, [ %o0 ] <== NOT EXECUTED 40013df0: 81 c7 e0 08 ret <== NOT EXECUTED 40013df4: 81 e8 00 00 restore <== NOT EXECUTED return rc; } 40013df8: 81 c7 e0 08 ret 40013dfc: 81 e8 00 00 restore =============================================================================== 40013c18 : return RC_OK; } int fat_sync(fat_fs_info_t *fs_info) { 40013c18: 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) 40013c1c: c4 0e 20 0e ldub [ %i0 + 0xe ], %g2 return RC_OK; } int fat_sync(fat_fs_info_t *fs_info) { 40013c20: 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; 40013c24: 90 10 20 00 clr %o0 if (fs_info->vol.type == FAT_FAT32) 40013c28: 80 a0 a0 04 cmp %g2, 4 40013c2c: 12 80 00 20 bne 40013cac 40013c30: b0 10 20 00 clr %i0 { uint32_t free_count = fs_info->vol.free_cls; 40013c34: f6 07 60 44 ld [ %i5 + 0x44 ], %i3 uint32_t next_free = fs_info->vol.next_cl; if (free_count != fs_info->vol.free_cls_in_fs_info) 40013c38: c2 07 60 48 ld [ %i5 + 0x48 ], %g1 40013c3c: 80 a6 c0 01 cmp %i3, %g1 40013c40: 02 80 00 0d be 40013c74 <== ALWAYS TAKEN 40013c44: f8 07 60 4c ld [ %i5 + 0x4c ], %i4 { uint32_t le_free_count = CT_LE_L(free_count); 40013c48: 7f ff fc 74 call 40012e18 <== NOT EXECUTED 40013c4c: 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, 40013c50: d2 17 60 40 lduh [ %i5 + 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); 40013c54: d0 27 bf fc st %o0, [ %fp + -4 ] <== NOT EXECUTED fs_info->vol.free_cls_in_fs_info = free_count; 40013c58: f6 27 60 48 st %i3, [ %i5 + 0x48 ] <== NOT EXECUTED ret1 = fat_sector_write(fs_info, 40013c5c: 90 10 00 1d mov %i5, %o0 <== NOT EXECUTED 40013c60: 94 10 21 e8 mov 0x1e8, %o2 <== NOT EXECUTED 40013c64: 96 10 20 04 mov 4, %o3 <== NOT EXECUTED 40013c68: 7f ff fd 4c call 40013198 <== NOT EXECUTED 40013c6c: 98 07 bf fc add %fp, -4, %o4 <== NOT EXECUTED 40013c70: b0 10 00 08 mov %o0, %i0 <== 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) 40013c74: c4 07 60 50 ld [ %i5 + 0x50 ], %g2 40013c78: 80 a7 00 02 cmp %i4, %g2 40013c7c: 02 80 00 0c be 40013cac 40013c80: 90 10 20 00 clr %o0 { uint32_t le_next_free = CT_LE_L(next_free); 40013c84: 7f ff fc 65 call 40012e18 40013c88: 90 10 00 1c mov %i4, %o0 fs_info->vol.next_cl_in_fs_info = next_free; ret2 = fat_sector_write(fs_info, 40013c8c: 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); 40013c90: d0 27 bf fc st %o0, [ %fp + -4 ] fs_info->vol.next_cl_in_fs_info = next_free; 40013c94: f8 27 60 50 st %i4, [ %i5 + 0x50 ] ret2 = fat_sector_write(fs_info, 40013c98: 90 10 00 1d mov %i5, %o0 40013c9c: 94 10 21 ec mov 0x1ec, %o2 40013ca0: 96 10 20 04 mov 4, %o3 40013ca4: 7f ff fd 3d call 40013198 40013ca8: 98 07 bf fc add %fp, -4, %o4 sizeof(le_next_free), &le_next_free); } } if ( (ret1 < 0) || (ret2 < 0) ) 40013cac: b0 16 00 08 or %i0, %o0, %i0 rc = fat_fat32_update_fsinfo_sector(fs_info); if ( rc != RC_OK ) rc = -1; fat_buf_release(fs_info); 40013cb0: 7f ff fc 7b call 40012e9c 40013cb4: 90 10 00 1d mov %i5, %o0 if (rtems_bdbuf_syncdev(fs_info->vol.dd) != RTEMS_SUCCESSFUL) 40013cb8: d0 07 60 64 ld [ %i5 + 0x64 ], %o0 40013cbc: 7f ff f4 a6 call 40010f54 40013cc0: b1 3e 20 1f sra %i0, 0x1f, %i0 40013cc4: 80 a2 20 00 cmp %o0, 0 40013cc8: 32 80 00 02 bne,a 40013cd0 <== NEVER TAKEN 40013ccc: b0 10 3f ff mov -1, %i0 <== NOT EXECUTED rc = -1; return rc; } 40013cd0: 81 c7 e0 08 ret 40013cd4: 81 e8 00 00 restore =============================================================================== 40004458 : /** * compatible with SVr4, 4.4BSD and X/OPEN - Change Directory */ int fchdir( int fd ) { 40004458: 9d e3 bf 40 save %sp, -192, %sp st.st_mode = 0; st.st_uid = 0; st.st_gid = 0; rtems_libio_check_fd( fd ); 4000445c: 03 10 00 5f sethi %hi(0x40017c00), %g1 40004460: c2 00 62 40 ld [ %g1 + 0x240 ], %g1 ! 40017e40 int rv = 0; rtems_libio_t *iop; struct stat st; rtems_filesystem_location_info_t loc; st.st_mode = 0; 40004464: c0 27 bf c4 clr [ %fp + -60 ] st.st_uid = 0; 40004468: c0 37 bf ca clrh [ %fp + -54 ] st.st_gid = 0; rtems_libio_check_fd( fd ); 4000446c: 80 a6 00 01 cmp %i0, %g1 40004470: 0a 80 00 08 bcs 40004490 40004474: c0 37 bf cc clrh [ %fp + -52 ] 40004478: 40 00 31 cc call 40010ba8 <__errno> 4000447c: 01 00 00 00 nop 40004480: 82 10 20 09 mov 9, %g1 ! 9 <_TLS_Alignment+0x8> 40004484: c2 22 00 00 st %g1, [ %o0 ] 40004488: 10 80 00 33 b 40004554 4000448c: 90 10 3f ff mov -1, %o0 iop = rtems_libio_iop( fd ); 40004490: 83 2e 20 03 sll %i0, 3, %g1 40004494: b1 2e 20 06 sll %i0, 6, %i0 40004498: b0 26 00 01 sub %i0, %g1, %i0 4000449c: 03 10 00 65 sethi %hi(0x40019400), %g1 400044a0: fa 00 62 30 ld [ %g1 + 0x230 ], %i5 ! 40019630 400044a4: ba 07 40 18 add %i5, %i0, %i5 rtems_libio_check_is_open( iop ); 400044a8: c2 07 60 10 ld [ %i5 + 0x10 ], %g1 400044ac: 80 88 61 00 btst 0x100, %g1 400044b0: 02 bf ff f2 be 40004478 400044b4: 01 00 00 00 nop rtems_filesystem_instance_lock( &iop->pathinfo ); 400044b8: d0 07 60 28 ld [ %i5 + 0x28 ], %o0 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 ); 400044bc: c2 02 20 0c ld [ %o0 + 0xc ], %g1 400044c0: c2 00 40 00 ld [ %g1 ], %g1 400044c4: 9f c0 40 00 call %g1 400044c8: b6 07 60 14 add %i5, 0x14, %i3 rv = (*iop->pathinfo.handlers->fstat_h)( &iop->pathinfo, &st ); 400044cc: c2 07 60 24 ld [ %i5 + 0x24 ], %g1 400044d0: 90 10 00 1b mov %i3, %o0 400044d4: c2 00 60 18 ld [ %g1 + 0x18 ], %g1 400044d8: 9f c0 40 00 call %g1 400044dc: 92 07 bf b8 add %fp, -72, %o1 if ( rv == 0 ) { 400044e0: b8 92 20 00 orcc %o0, 0, %i4 400044e4: 32 80 00 13 bne,a 40004530 <== NEVER TAKEN 400044e8: d0 07 60 28 ld [ %i5 + 0x28 ], %o0 <== NOT EXECUTED bool access_ok = rtems_filesystem_check_access( 400044ec: d2 07 bf c4 ld [ %fp + -60 ], %o1 400044f0: d4 17 bf ca lduh [ %fp + -54 ], %o2 400044f4: d6 17 bf cc lduh [ %fp + -52 ], %o3 400044f8: 40 00 04 4e call 40005630 400044fc: 90 10 20 01 mov 1, %o0 st.st_mode, st.st_uid, st.st_gid ); if ( access_ok ) { 40004500: 80 a2 20 00 cmp %o0, 0 40004504: 02 80 00 06 be 4000451c 40004508: 90 07 bf a0 add %fp, -96, %o0 rtems_filesystem_location_clone( &loc, &iop->pathinfo ); 4000450c: 40 00 23 96 call 4000d364 40004510: 92 10 00 1b mov %i3, %o1 40004514: 10 80 00 07 b 40004530 40004518: d0 07 60 28 ld [ %i5 + 0x28 ], %o0 } else { errno = EACCES; 4000451c: 40 00 31 a3 call 40010ba8 <__errno> 40004520: b8 10 3f ff mov -1, %i4 40004524: 82 10 20 0d mov 0xd, %g1 40004528: c2 22 00 00 st %g1, [ %o0 ] rtems_libio_check_fd( fd ); iop = rtems_libio_iop( fd ); rtems_libio_check_is_open( iop ); rtems_filesystem_instance_lock( &iop->pathinfo ); 4000452c: d0 07 60 28 ld [ %i5 + 0x28 ], %o0 const rtems_filesystem_location_info_t *loc ) { const rtems_filesystem_mount_table_entry_t *mt_entry = loc->mt_entry; (*mt_entry->ops->unlock_h)( mt_entry ); 40004530: c2 02 20 0c ld [ %o0 + 0xc ], %g1 40004534: c2 00 60 04 ld [ %g1 + 4 ], %g1 40004538: 9f c0 40 00 call %g1 4000453c: 01 00 00 00 nop rv = -1; } } rtems_filesystem_instance_unlock( &iop->pathinfo ); if ( rv == 0 ) { 40004540: 90 97 20 00 orcc %i4, 0, %o0 40004544: 12 80 00 04 bne 40004554 40004548: 01 00 00 00 nop rv = rtems_filesystem_chdir( &loc ); 4000454c: 40 00 23 6a call 4000d2f4 40004550: 90 07 bf a0 add %fp, -96, %o0 } return rv; } 40004554: 81 c7 e0 08 ret 40004558: 91 e8 00 08 restore %g0, %o0, %o0 =============================================================================== 4003140c : int fcntl( int fd, int cmd, ... ) { 4003140c: 9d e3 bf 98 save %sp, -104, %sp int fd2; int flags; int mask; int ret = 0; rtems_libio_check_fd( fd ); 40031410: 05 10 00 db sethi %hi(0x40036c00), %g2 40031414: c6 00 a1 5c ld [ %g2 + 0x15c ], %g3 ! 40036d5c ... ) { int ret; va_list ap; va_start( ap, cmd ); 40031418: 82 07 a0 4c add %fp, 0x4c, %g1 4003141c: f4 27 a0 4c st %i2, [ %fp + 0x4c ] 40031420: f6 27 a0 50 st %i3, [ %fp + 0x50 ] 40031424: f8 27 a0 54 st %i4, [ %fp + 0x54 ] 40031428: fa 27 a0 58 st %i5, [ %fp + 0x58 ] int fd2; int flags; int mask; int ret = 0; rtems_libio_check_fd( fd ); 4003142c: 80 a6 00 03 cmp %i0, %g3 40031430: 1a 80 00 4f bcc 4003156c 40031434: c2 27 bf fc st %g1, [ %fp + -4 ] iop = rtems_libio_iop( fd ); 40031438: 09 10 01 21 sethi %hi(0x40048400), %g4 4003143c: c4 01 22 98 ld [ %g4 + 0x298 ], %g2 ! 40048698 40031440: b9 2e 20 03 sll %i0, 3, %i4 40031444: bb 2e 20 06 sll %i0, 6, %i5 40031448: ba 27 40 1c sub %i5, %i4, %i5 4003144c: ba 00 80 1d add %g2, %i5, %i5 rtems_libio_check_is_open(iop); 40031450: d0 07 60 10 ld [ %i5 + 0x10 ], %o0 40031454: 80 8a 21 00 btst 0x100, %o0 40031458: 02 80 00 45 be 4003156c 4003145c: b4 10 00 04 mov %g4, %i2 /* * This switch should contain all the cases from POSIX. */ switch ( cmd ) { 40031460: 80 a6 60 14 cmp %i1, 0x14 40031464: 18 80 00 92 bgu 400316ac <== NEVER TAKEN 40031468: 89 2e 60 02 sll %i1, 2, %g4 4003146c: 39 10 00 c4 sethi %hi(0x40031000), %i4 40031470: b8 17 23 b8 or %i4, 0x3b8, %i4 ! 400313b8 <_calloc_r+0x14> 40031474: c8 07 00 04 ld [ %i4 + %g4 ], %g4 40031478: 81 c1 00 00 jmp %g4 4003147c: 01 00 00 00 nop static int duplicate_iop( rtems_libio_t *iop ) { int rv = 0; rtems_libio_t *diop = rtems_libio_allocate(); 40031480: 7f ff 5b a9 call 40008324 40031484: 01 00 00 00 nop if (diop != NULL) { 40031488: b8 92 20 00 orcc %o0, 0, %i4 4003148c: 02 80 00 9c be 400316fc <== NEVER TAKEN 40031490: b0 10 3f ff mov -1, %i0 int oflag = rtems_libio_to_fcntl_flags( iop->flags ); 40031494: 7f ff 5b 8e call 400082cc 40031498: d0 07 60 10 ld [ %i5 + 0x10 ], %o0 oflag &= ~O_CREAT; diop->flags |= rtems_libio_fcntl_flags( oflag ); 4003149c: f0 07 20 10 ld [ %i4 + 0x10 ], %i0 rtems_libio_t *diop = rtems_libio_allocate(); if (diop != NULL) { int oflag = rtems_libio_to_fcntl_flags( iop->flags ); oflag &= ~O_CREAT; 400314a0: b6 0a 3d ff and %o0, -513, %i3 diop->flags |= rtems_libio_fcntl_flags( oflag ); 400314a4: 7f ff 5b 7d call 40008298 400314a8: 90 10 00 1b mov %i3, %o0 400314ac: 90 12 00 18 or %o0, %i0, %o0 400314b0: d0 27 20 10 st %o0, [ %i4 + 0x10 ] rtems_filesystem_instance_lock( &iop->pathinfo ); 400314b4: d0 07 60 28 ld [ %i5 + 0x28 ], %o0 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 ); 400314b8: c2 02 20 0c ld [ %o0 + 0xc ], %g1 400314bc: c2 00 40 00 ld [ %g1 ], %g1 400314c0: 9f c0 40 00 call %g1 400314c4: 01 00 00 00 nop rtems_filesystem_location_clone( &diop->pathinfo, &iop->pathinfo ); 400314c8: 92 07 60 14 add %i5, 0x14, %o1 400314cc: 7f ff 94 9c call 4001673c 400314d0: 90 07 20 14 add %i4, 0x14, %o0 int oflag = rtems_libio_to_fcntl_flags( iop->flags ); oflag &= ~O_CREAT; diop->flags |= rtems_libio_fcntl_flags( oflag ); rtems_filesystem_instance_lock( &iop->pathinfo ); 400314d4: d0 07 60 28 ld [ %i5 + 0x28 ], %o0 const rtems_filesystem_location_info_t *loc ) { const rtems_filesystem_mount_table_entry_t *mt_entry = loc->mt_entry; (*mt_entry->ops->unlock_h)( mt_entry ); 400314d8: c2 02 20 0c ld [ %o0 + 0xc ], %g1 400314dc: c2 00 60 04 ld [ %g1 + 4 ], %g1 400314e0: 9f c0 40 00 call %g1 400314e4: 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 ); 400314e8: c2 07 20 24 ld [ %i4 + 0x24 ], %g1 400314ec: 90 10 00 1c mov %i4, %o0 400314f0: c2 00 40 00 ld [ %g1 ], %g1 400314f4: 92 10 20 00 clr %o1 400314f8: 94 10 00 1b mov %i3, %o2 400314fc: 9f c0 40 00 call %g1 40031500: 96 10 20 00 clr %o3 if ( rv == 0 ) { 40031504: b0 92 20 00 orcc %o0, 0, %i0 40031508: 12 80 00 11 bne 4003154c <== NEVER TAKEN 4003150c: 01 00 00 00 nop rv = diop - rtems_libio_iops; 40031510: f0 06 a2 98 ld [ %i2 + 0x298 ], %i0 40031514: b8 27 00 18 sub %i4, %i0, %i4 40031518: b9 3f 20 03 sra %i4, 3, %i4 4003151c: 85 2f 20 03 sll %i4, 3, %g2 40031520: 83 2f 20 06 sll %i4, 6, %g1 40031524: 82 00 80 01 add %g2, %g1, %g1 40031528: 85 28 60 06 sll %g1, 6, %g2 4003152c: 82 00 40 02 add %g1, %g2, %g1 40031530: 82 00 40 1c add %g1, %i4, %g1 40031534: b1 28 60 0f sll %g1, 0xf, %i0 40031538: 82 00 40 18 add %g1, %i0, %g1 4003153c: 83 28 60 03 sll %g1, 3, %g1 40031540: b8 00 40 1c add %g1, %i4, %i4 40031544: 10 80 00 5f b 400316c0 40031548: b0 20 00 1c neg %i4, %i0 } else { rtems_libio_free( diop ); 4003154c: 7f ff 5b 8c call 4000837c <== NOT EXECUTED 40031550: 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) { 40031554: 10 80 00 5c b 400316c4 <== NOT EXECUTED 40031558: 80 a6 20 00 cmp %i0, 0 <== NOT EXECUTED case F_DUPFD: /* dup */ ret = duplicate_iop( iop ); break; case F_DUP2FD: /* dup2 */ fd2 = va_arg( ap, int ); 4003155c: f0 00 40 00 ld [ %g1 ], %i0 static int duplicate2_iop( rtems_libio_t *iop, int fd2 ) { rtems_libio_t *iop2; int rv = 0; rtems_libio_check_fd( fd2 ); 40031560: 80 a6 00 03 cmp %i0, %g3 40031564: 0a 80 00 06 bcs 4003157c <== ALWAYS TAKEN 40031568: b9 2e 20 03 sll %i0, 3, %i4 4003156c: 7f ff be 4c call 40020e9c <__errno> 40031570: 01 00 00 00 nop 40031574: 10 80 00 51 b 400316b8 40031578: 82 10 20 09 mov 9, %g1 ! 9 <_TLS_Alignment+0x8> iop2 = rtems_libio_iop( fd2 ); 4003157c: 83 2e 20 06 sll %i0, 6, %g1 40031580: b8 20 40 1c sub %g1, %i4, %i4 40031584: b8 00 80 1c add %g2, %i4, %i4 if (iop != iop2) 40031588: 80 a7 40 1c cmp %i5, %i4 4003158c: 22 80 00 50 be,a 400316cc <== NEVER TAKEN 40031590: b0 10 20 00 clr %i0 <== NOT EXECUTED { int oflag; if ((iop2->flags & LIBIO_FLAGS_OPEN) != 0) { 40031594: c2 07 20 10 ld [ %i4 + 0x10 ], %g1 40031598: 80 88 61 00 btst 0x100, %g1 4003159c: 32 80 00 23 bne,a 40031628 <== ALWAYS TAKEN 400315a0: c2 07 20 24 ld [ %i4 + 0x24 ], %g1 rv = (*iop2->pathinfo.handlers->close_h)( iop2 ); } if (rv == 0) { oflag = rtems_libio_to_fcntl_flags( iop->flags ); 400315a4: 7f ff 5b 4a call 400082cc 400315a8: d0 07 60 10 ld [ %i5 + 0x10 ], %o0 oflag &= ~O_CREAT; iop2->flags |= rtems_libio_fcntl_flags( oflag ); 400315ac: f4 07 20 10 ld [ %i4 + 0x10 ], %i2 rv = (*iop2->pathinfo.handlers->close_h)( iop2 ); } if (rv == 0) { oflag = rtems_libio_to_fcntl_flags( iop->flags ); oflag &= ~O_CREAT; 400315b0: b6 0a 3d ff and %o0, -513, %i3 iop2->flags |= rtems_libio_fcntl_flags( oflag ); 400315b4: 7f ff 5b 39 call 40008298 400315b8: 90 10 00 1b mov %i3, %o0 400315bc: 90 12 00 1a or %o0, %i2, %o0 400315c0: d0 27 20 10 st %o0, [ %i4 + 0x10 ] rtems_filesystem_instance_lock( &iop->pathinfo ); 400315c4: d0 07 60 28 ld [ %i5 + 0x28 ], %o0 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 ); 400315c8: c2 02 20 0c ld [ %o0 + 0xc ], %g1 400315cc: c2 00 40 00 ld [ %g1 ], %g1 400315d0: 9f c0 40 00 call %g1 400315d4: 01 00 00 00 nop rtems_filesystem_location_clone( &iop2->pathinfo, &iop->pathinfo ); 400315d8: 92 07 60 14 add %i5, 0x14, %o1 400315dc: 7f ff 94 58 call 4001673c 400315e0: 90 07 20 14 add %i4, 0x14, %o0 if (rv == 0) { oflag = rtems_libio_to_fcntl_flags( iop->flags ); oflag &= ~O_CREAT; iop2->flags |= rtems_libio_fcntl_flags( oflag ); rtems_filesystem_instance_lock( &iop->pathinfo ); 400315e4: d0 07 60 28 ld [ %i5 + 0x28 ], %o0 const rtems_filesystem_location_info_t *loc ) { const rtems_filesystem_mount_table_entry_t *mt_entry = loc->mt_entry; (*mt_entry->ops->unlock_h)( mt_entry ); 400315e8: c2 02 20 0c ld [ %o0 + 0xc ], %g1 400315ec: c2 00 60 04 ld [ %g1 + 4 ], %g1 400315f0: 9f c0 40 00 call %g1 400315f4: 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 = (*iop2->pathinfo.handlers->open_h)( iop2, NULL, oflag, 0 ); 400315f8: c2 07 20 24 ld [ %i4 + 0x24 ], %g1 400315fc: 90 10 00 1c mov %i4, %o0 40031600: c2 00 40 00 ld [ %g1 ], %g1 40031604: 92 10 20 00 clr %o1 40031608: 94 10 00 1b mov %i3, %o2 4003160c: 9f c0 40 00 call %g1 40031610: 96 10 20 00 clr %o3 if ( rv == 0 ) { 40031614: 80 a2 20 00 cmp %o0, 0 40031618: 02 80 00 2b be 400316c4 <== ALWAYS TAKEN 4003161c: 80 a6 20 00 cmp %i0, 0 else iop->flags &= ~LIBIO_FLAGS_CLOSE_ON_EXEC; break; case F_GETFL: /* more flags (cloexec) */ ret = rtems_libio_to_fcntl_flags( iop->flags ); 40031620: 10 80 00 28 b 400316c0 <== NOT EXECUTED 40031624: b0 10 00 08 mov %o0, %i0 <== NOT EXECUTED if (iop != iop2) { int oflag; if ((iop2->flags & LIBIO_FLAGS_OPEN) != 0) { rv = (*iop2->pathinfo.handlers->close_h)( iop2 ); 40031628: c2 00 60 04 ld [ %g1 + 4 ], %g1 4003162c: 9f c0 40 00 call %g1 40031630: 90 10 00 1c mov %i4, %o0 } if (rv == 0) { 40031634: 80 a2 20 00 cmp %o0, 0 40031638: 32 80 00 22 bne,a 400316c0 <== NEVER TAKEN 4003163c: b0 10 00 08 mov %o0, %i0 <== NOT EXECUTED 40031640: 30 bf ff d9 b,a 400315a4 fd2 = va_arg( ap, int ); ret = duplicate2_iop( iop, fd2 ); break; case F_GETFD: /* get f_flags */ ret = ((iop->flags & LIBIO_FLAGS_CLOSE_ON_EXEC) != 0); 40031644: b1 32 20 0b srl %o0, 0xb, %i0 40031648: 10 80 00 21 b 400316cc 4003164c: 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 ) ) 40031650: c2 00 40 00 ld [ %g1 ], %g1 40031654: 80 a0 60 00 cmp %g1, 0 40031658: 22 80 00 0e be,a 40031690 4003165c: 90 0a 37 ff and %o0, -2049, %o0 iop->flags |= LIBIO_FLAGS_CLOSE_ON_EXEC; 40031660: 10 80 00 0c b 40031690 40031664: 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 ); 40031668: 7f ff 5b 19 call 400082cc 4003166c: 01 00 00 00 nop 40031670: 10 80 00 14 b 400316c0 40031674: b0 10 00 08 mov %o0, %i0 break; case F_SETFL: flags = rtems_libio_fcntl_flags( va_arg( ap, int ) ); 40031678: 7f ff 5b 08 call 40008298 4003167c: 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); 40031680: c2 07 60 10 ld [ %i5 + 0x10 ], %g1 40031684: 90 0a 22 01 and %o0, 0x201, %o0 40031688: 82 08 7d fe and %g1, -514, %g1 4003168c: 90 12 00 01 or %o0, %g1, %o0 40031690: d0 27 60 10 st %o0, [ %i5 + 0x10 ] { rtems_libio_t *iop; int fd2; int flags; int mask; int ret = 0; 40031694: 10 80 00 0e b 400316cc 40031698: b0 10 20 00 clr %i0 errno = ENOTSUP; ret = -1; break; case F_GETOWN: /* for sockets. */ errno = ENOTSUP; 4003169c: 7f ff be 00 call 40020e9c <__errno> 400316a0: 01 00 00 00 nop 400316a4: 10 80 00 05 b 400316b8 400316a8: 82 10 20 86 mov 0x86, %g1 ! 86 <_TLS_Alignment+0x85> ret = -1; break; default: errno = EINVAL; 400316ac: 7f ff bd fc call 40020e9c <__errno> 400316b0: 01 00 00 00 nop 400316b4: 82 10 20 16 mov 0x16, %g1 ! 16 <_TLS_Alignment+0x15> 400316b8: 10 80 00 10 b 400316f8 400316bc: 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) { 400316c0: 80 a6 20 00 cmp %i0, 0 400316c4: 06 80 00 0e bl 400316fc <== NEVER TAKEN 400316c8: 01 00 00 00 nop int err = (*iop->pathinfo.handlers->fcntl_h)( iop, cmd ); 400316cc: c2 07 60 24 ld [ %i5 + 0x24 ], %g1 400316d0: 90 10 00 1d mov %i5, %o0 400316d4: c2 00 60 28 ld [ %g1 + 0x28 ], %g1 400316d8: 9f c0 40 00 call %g1 400316dc: 92 10 00 19 mov %i1, %o1 if (err) { 400316e0: ba 92 20 00 orcc %o0, 0, %i5 400316e4: 02 80 00 06 be 400316fc <== ALWAYS TAKEN 400316e8: 01 00 00 00 nop errno = err; 400316ec: 7f ff bd ec call 40020e9c <__errno> <== NOT EXECUTED 400316f0: 01 00 00 00 nop <== NOT EXECUTED 400316f4: fa 22 00 00 st %i5, [ %o0 ] <== NOT EXECUTED * filesystem specific handler a chance to process this. */ if (ret >= 0) { int err = (*iop->pathinfo.handlers->fcntl_h)( iop, cmd ); if (err) { 400316f8: b0 10 3f ff mov -1, %i0 va_list ap; va_start( ap, cmd ); ret = vfcntl(fd,cmd,ap); va_end(ap); return ret; } 400316fc: 81 c7 e0 08 ret 40031700: 81 e8 00 00 restore =============================================================================== 4000487c : #include int fdatasync( int fd ) { 4000487c: 9d e3 bf a0 save %sp, -96, %sp rtems_libio_t *iop; rtems_libio_check_fd( fd ); 40004880: 03 10 00 60 sethi %hi(0x40018000), %g1 40004884: c2 00 62 00 ld [ %g1 + 0x200 ], %g1 ! 40018200 40004888: 80 a6 00 01 cmp %i0, %g1 4000488c: 0a 80 00 08 bcs 400048ac <== ALWAYS TAKEN 40004890: 83 2e 20 03 sll %i0, 3, %g1 40004894: 40 00 32 bc call 40011384 <__errno> 40004898: b0 10 3f ff mov -1, %i0 4000489c: 82 10 20 09 mov 9, %g1 400048a0: c2 22 00 00 st %g1, [ %o0 ] 400048a4: 81 c7 e0 08 ret 400048a8: 81 e8 00 00 restore iop = rtems_libio_iop( fd ); 400048ac: b1 2e 20 06 sll %i0, 6, %i0 400048b0: b0 26 00 01 sub %i0, %g1, %i0 400048b4: 03 10 00 66 sethi %hi(0x40019800), %g1 400048b8: d0 00 61 f0 ld [ %g1 + 0x1f0 ], %o0 ! 400199f0 400048bc: 90 02 00 18 add %o0, %i0, %o0 rtems_libio_check_is_open(iop); 400048c0: c2 02 20 10 ld [ %o0 + 0x10 ], %g1 400048c4: 80 88 61 00 btst 0x100, %g1 400048c8: 02 bf ff f3 be 40004894 <== NEVER TAKEN 400048cc: 80 88 60 04 btst 4, %g1 rtems_libio_check_permissions_with_error( iop, LIBIO_FLAGS_WRITE, EBADF ); 400048d0: 02 bf ff f1 be 40004894 400048d4: 01 00 00 00 nop /* * Now process the fdatasync(). */ return (*iop->pathinfo.handlers->fdatasync_h)( iop ); 400048d8: c2 02 20 24 ld [ %o0 + 0x24 ], %g1 400048dc: c2 00 60 24 ld [ %g1 + 0x24 ], %g1 400048e0: 9f c0 40 00 call %g1 400048e4: 01 00 00 00 nop } 400048e8: 81 c7 e0 08 ret 400048ec: 91 e8 00 08 restore %g0, %o0, %o0 =============================================================================== 4000e194 : int fifo_open( pipe_control_t **pipep, rtems_libio_t *iop ) { 4000e194: 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) { 4000e198: 35 10 00 92 sethi %hi(0x40024800), %i2 4000e19c: c2 06 a1 c8 ld [ %i2 + 0x1c8 ], %g1 ! 400249c8 int fifo_open( pipe_control_t **pipep, rtems_libio_t *iop ) { 4000e1a0: b6 10 00 18 mov %i0, %i3 static int pipe_lock(void) { rtems_status_code sc = RTEMS_SUCCESSFUL; if (pipe_semaphore == RTEMS_ID_NONE) { 4000e1a4: 80 a0 60 00 cmp %g1, 0 4000e1a8: 02 80 00 0b be 4000e1d4 4000e1ac: b0 16 a1 c8 or %i2, 0x1c8, %i0 rtems_libio_unlock(); } if (sc == RTEMS_SUCCESSFUL) { sc = rtems_semaphore_obtain(pipe_semaphore, RTEMS_WAIT, RTEMS_NO_TIMEOUT); 4000e1b0: d0 06 a1 c8 ld [ %i2 + 0x1c8 ], %o0 4000e1b4: 92 10 20 00 clr %o1 4000e1b8: 7f ff eb eb call 40009164 4000e1bc: 94 10 20 00 clr %o2 } if (sc == RTEMS_SUCCESSFUL) { 4000e1c0: 80 a2 20 00 cmp %o0, 0 4000e1c4: 22 80 00 1c be,a 4000e234 <== ALWAYS TAKEN 4000e1c8: fa 06 c0 00 ld [ %i3 ], %i5 return 0; } else { return -ENOMEM; 4000e1cc: 81 c7 e0 08 ret <== NOT EXECUTED 4000e1d0: 91 e8 3f f4 restore %g0, -12, %o0 <== NOT EXECUTED extern pthread_key_t rtems_current_user_env_key; static inline void rtems_libio_lock( void ) { rtems_semaphore_obtain( rtems_libio_semaphore, RTEMS_WAIT, RTEMS_NO_TIMEOUT ); 4000e1d4: 3b 10 00 93 sethi %hi(0x40024c00), %i5 4000e1d8: d0 07 62 3c ld [ %i5 + 0x23c ], %o0 ! 40024e3c 4000e1dc: 92 10 20 00 clr %o1 4000e1e0: 7f ff eb e1 call 40009164 4000e1e4: 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) { 4000e1e8: c2 06 a1 c8 ld [ %i2 + 0x1c8 ], %g1 4000e1ec: 80 a0 60 00 cmp %g1, 0 4000e1f0: 12 80 00 0a bne 4000e218 <== NEVER TAKEN 4000e1f4: b8 10 20 00 clr %i4 sc = rtems_semaphore_create( 4000e1f8: 11 14 12 54 sethi %hi(0x50495000), %o0 4000e1fc: 92 10 20 01 mov 1, %o1 4000e200: 90 12 20 45 or %o0, 0x45, %o0 4000e204: 94 10 20 54 mov 0x54, %o2 4000e208: 96 10 20 00 clr %o3 4000e20c: 7f ff eb 23 call 40008e98 4000e210: 98 10 00 18 mov %i0, %o4 4000e214: b8 10 00 08 mov %o0, %i4 } static inline void rtems_libio_unlock( void ) { rtems_semaphore_release( rtems_libio_semaphore ); 4000e218: 7f ff ec 1b call 40009284 4000e21c: d0 07 62 3c ld [ %i5 + 0x23c ], %o0 } rtems_libio_unlock(); } if (sc == RTEMS_SUCCESSFUL) { 4000e220: 80 a7 20 00 cmp %i4, 0 4000e224: 02 bf ff e4 be 4000e1b4 4000e228: d0 06 a1 c8 ld [ %i2 + 0x1c8 ], %o0 } if (sc == RTEMS_SUCCESSFUL) { return 0; } else { return -ENOMEM; 4000e22c: 81 c7 e0 08 ret 4000e230: 91 e8 3f f4 restore %g0, -12, %o0 err = pipe_lock(); if (err) return err; pipe = *pipep; if (pipe == NULL) { 4000e234: 80 a7 60 00 cmp %i5, 0 4000e238: 32 80 00 54 bne,a 4000e388 4000e23c: d0 07 60 28 ld [ %i5 + 0x28 ], %o0 { static char c = 'a'; pipe_control_t *pipe; int err = -ENOMEM; pipe = malloc(sizeof(pipe_control_t)); 4000e240: 7f ff db ca call 40005168 4000e244: 90 10 20 34 mov 0x34, %o0 if (pipe == NULL) 4000e248: ba 92 20 00 orcc %o0, 0, %i5 4000e24c: 02 80 00 e1 be 4000e5d0 <== NEVER TAKEN 4000e250: 92 10 20 00 clr %o1 return err; memset(pipe, 0, sizeof(pipe_control_t)); 4000e254: 40 00 11 24 call 400126e4 4000e258: 94 10 20 34 mov 0x34, %o2 pipe->Size = PIPE_BUF; 4000e25c: 82 10 22 00 mov 0x200, %g1 pipe->Buffer = malloc(pipe->Size); 4000e260: 90 10 22 00 mov 0x200, %o0 4000e264: 7f ff db c1 call 40005168 4000e268: c2 27 60 04 st %g1, [ %i5 + 4 ] if (! pipe->Buffer) 4000e26c: 80 a2 20 00 cmp %o0, 0 4000e270: 02 80 00 40 be 4000e370 <== NEVER TAKEN 4000e274: d0 27 40 00 st %o0, [ %i5 ] goto err_buf; err = -ENOMEM; if (rtems_barrier_create( rtems_build_name ('P', 'I', 'r', c), 4000e278: 39 10 00 8d sethi %hi(0x40023400), %i4 4000e27c: d0 4f 23 1c ldsb [ %i4 + 0x31c ], %o0 ! 4002371c if (! pipe->Buffer) goto err_buf; err = -ENOMEM; if (rtems_barrier_create( 4000e280: 31 14 12 5c sethi %hi(0x50497000), %i0 4000e284: 82 16 22 00 or %i0, 0x200, %g1 ! 50497200 4000e288: 92 10 20 00 clr %o1 4000e28c: 90 12 00 01 or %o0, %g1, %o0 4000e290: 94 10 20 00 clr %o2 4000e294: 40 00 05 b4 call 4000f964 4000e298: 96 07 60 2c add %i5, 0x2c, %o3 4000e29c: 80 a2 20 00 cmp %o0, 0 4000e2a0: 12 80 00 32 bne 4000e368 4000e2a4: d0 4f 23 1c ldsb [ %i4 + 0x31c ], %o0 rtems_build_name ('P', 'I', 'r', c), RTEMS_BARRIER_MANUAL_RELEASE, 0, &pipe->readBarrier) != RTEMS_SUCCESSFUL) goto err_rbar; if (rtems_barrier_create( 4000e2a8: 03 14 12 5d sethi %hi(0x50497400), %g1 4000e2ac: 82 10 63 00 or %g1, 0x300, %g1 ! 50497700 4000e2b0: 92 10 20 00 clr %o1 4000e2b4: 90 12 00 01 or %o0, %g1, %o0 4000e2b8: 94 10 20 00 clr %o2 4000e2bc: 40 00 05 aa call 4000f964 4000e2c0: 96 07 60 30 add %i5, 0x30, %o3 4000e2c4: 80 a2 20 00 cmp %o0, 0 4000e2c8: 12 80 00 26 bne 4000e360 4000e2cc: d0 4f 23 1c ldsb [ %i4 + 0x31c ], %o0 rtems_build_name ('P', 'I', 'w', c), RTEMS_BARRIER_MANUAL_RELEASE, 0, &pipe->writeBarrier) != RTEMS_SUCCESSFUL) goto err_wbar; if (rtems_semaphore_create( 4000e2d0: b0 16 23 00 or %i0, 0x300, %i0 4000e2d4: 92 10 20 01 mov 1, %o1 4000e2d8: 90 12 00 18 or %o0, %i0, %o0 4000e2dc: 94 10 20 10 mov 0x10, %o2 4000e2e0: 96 10 20 00 clr %o3 4000e2e4: 7f ff ea ed call 40008e98 4000e2e8: 98 07 60 28 add %i5, 0x28, %o4 4000e2ec: 80 a2 20 00 cmp %o0, 0 4000e2f0: 12 80 00 1a bne 4000e358 4000e2f4: 94 07 bf fc add %fp, -4, %o2 RTEMS_INLINE_ROUTINE Barrier_Control *_Barrier_Get ( Objects_Id id, Objects_Locations *location ) { return (Barrier_Control *) 4000e2f8: d2 07 60 2c ld [ %i5 + 0x2c ], %o1 4000e2fc: 21 10 00 96 sethi %hi(0x40025800), %l0 4000e300: 7f ff f2 2c call 4000abb0 <_Objects_Get> 4000e304: 90 14 23 78 or %l0, 0x378, %o0 ! 40025b78 <_Barrier_Information> { Objects_Locations location; Barrier_Control *the_barrier; the_barrier = _Barrier_Get(pipe->readBarrier, &location); the_barrier->Barrier.Wait_queue.state |= STATES_INTERRUPTIBLE_BY_SIGNAL; 4000e308: c2 02 20 4c ld [ %o0 + 0x4c ], %g1 4000e30c: 31 04 00 00 sethi %hi(0x10000000), %i0 4000e310: 82 10 40 18 or %g1, %i0, %g1 RTEMS_INLINE_ROUTINE void _Objects_Put( Objects_Control *the_object ) { (void) the_object; _Thread_Enable_dispatch(); 4000e314: 7f ff f5 78 call 4000b8f4 <_Thread_Enable_dispatch> 4000e318: c2 22 20 4c st %g1, [ %o0 + 0x4c ] 4000e31c: d2 07 60 30 ld [ %i5 + 0x30 ], %o1 4000e320: 94 07 bf fc add %fp, -4, %o2 4000e324: 7f ff f2 23 call 4000abb0 <_Objects_Get> 4000e328: 90 14 23 78 or %l0, 0x378, %o0 _Objects_Put( &the_barrier->Object ); the_barrier = _Barrier_Get(pipe->writeBarrier, &location); the_barrier->Barrier.Wait_queue.state |= STATES_INTERRUPTIBLE_BY_SIGNAL; 4000e32c: c2 02 20 4c ld [ %o0 + 0x4c ], %g1 4000e330: b0 10 40 18 or %g1, %i0, %i0 4000e334: 7f ff f5 70 call 4000b8f4 <_Thread_Enable_dispatch> 4000e338: f0 22 20 4c st %i0, [ %o0 + 0x4c ] #ifdef RTEMS_POSIX_API pipe_interruptible(pipe); #endif *pipep = pipe; if (c ++ == 'z') 4000e33c: c2 0f 23 1c ldub [ %i4 + 0x31c ], %g1 4000e340: c4 4f 23 1c ldsb [ %i4 + 0x31c ], %g2 4000e344: 80 a0 a0 7a cmp %g2, 0x7a 4000e348: 12 80 00 0e bne 4000e380 4000e34c: 82 00 60 01 inc %g1 c = 'a'; 4000e350: 10 80 00 0c b 4000e380 4000e354: 82 10 20 61 mov 0x61, %g1 return 0; err_sem: rtems_barrier_delete(pipe->writeBarrier); 4000e358: 40 00 05 b0 call 4000fa18 4000e35c: d0 07 60 30 ld [ %i5 + 0x30 ], %o0 err_wbar: rtems_barrier_delete(pipe->readBarrier); 4000e360: 40 00 05 ae call 4000fa18 4000e364: d0 07 60 2c ld [ %i5 + 0x2c ], %o0 err_rbar: free(pipe->Buffer); 4000e368: 7f ff da 73 call 40004d34 4000e36c: d0 07 40 00 ld [ %i5 ], %o0 err_buf: free(pipe); 4000e370: 7f ff da 71 call 40004d34 4000e374: 90 10 00 1d mov %i5, %o0 if (err) goto out; } if (! PIPE_LOCK(pipe)) err = -EINTR; 4000e378: 10 80 00 12 b 4000e3c0 4000e37c: b0 10 3f f4 mov -12, %i0 #ifdef RTEMS_POSIX_API pipe_interruptible(pipe); #endif *pipep = pipe; if (c ++ == 'z') 4000e380: c2 2f 23 1c stb %g1, [ %i4 + 0x31c ] err = pipe_alloc(&pipe); if (err) goto out; } if (! PIPE_LOCK(pipe)) 4000e384: d0 07 60 28 ld [ %i5 + 0x28 ], %o0 4000e388: 92 10 20 00 clr %o1 4000e38c: 7f ff eb 76 call 40009164 4000e390: 94 10 20 00 clr %o2 err = -EINTR; if (*pipep == NULL) { 4000e394: c2 06 c0 00 ld [ %i3 ], %g1 err = pipe_alloc(&pipe); if (err) goto out; } if (! PIPE_LOCK(pipe)) 4000e398: 80 a0 00 08 cmp %g0, %o0 4000e39c: b0 60 20 00 subx %g0, 0, %i0 err = -EINTR; if (*pipep == NULL) { 4000e3a0: 80 a0 60 00 cmp %g1, 0 4000e3a4: 12 80 00 07 bne 4000e3c0 4000e3a8: b0 0e 3f fc and %i0, -4, %i0 if (err) 4000e3ac: 80 a6 20 00 cmp %i0, 0 4000e3b0: 22 80 00 04 be,a 4000e3c0 <== ALWAYS TAKEN 4000e3b4: fa 26 c0 00 st %i5, [ %i3 ] pipe_free(pipe); 4000e3b8: 7f ff ff 3f call 4000e0b4 <== NOT EXECUTED 4000e3bc: 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); 4000e3c0: 7f ff eb b1 call 40009284 4000e3c4: d0 06 a1 c8 ld [ %i2 + 0x1c8 ], %o0 pipe_control_t *pipe; unsigned int prevCounter; int err; err = pipe_new(pipep); if (err) 4000e3c8: 80 a6 20 00 cmp %i0, 0 4000e3cc: 12 80 00 83 bne 4000e5d8 4000e3d0: 01 00 00 00 nop return err; pipe = *pipep; switch (LIBIO_ACCMODE(iop)) { 4000e3d4: c2 06 60 10 ld [ %i1 + 0x10 ], %g1 4000e3d8: 82 08 60 06 and %g1, 6, %g1 4000e3dc: 80 a0 60 04 cmp %g1, 4 4000e3e0: 02 80 00 2f be 4000e49c 4000e3e4: fa 06 c0 00 ld [ %i3 ], %i5 4000e3e8: 80 a0 60 06 cmp %g1, 6 4000e3ec: 02 80 00 58 be 4000e54c 4000e3f0: 80 a0 60 02 cmp %g1, 2 4000e3f4: 32 80 00 6d bne,a 4000e5a8 <== NEVER TAKEN 4000e3f8: d0 07 60 28 ld [ %i5 + 0x28 ], %o0 <== NOT EXECUTED case LIBIO_FLAGS_READ: pipe->readerCounter ++; 4000e3fc: c2 07 60 20 ld [ %i5 + 0x20 ], %g1 4000e400: 82 00 60 01 inc %g1 4000e404: c2 27 60 20 st %g1, [ %i5 + 0x20 ] if (pipe->Readers ++ == 0) 4000e408: c2 07 60 10 ld [ %i5 + 0x10 ], %g1 4000e40c: 84 00 60 01 add %g1, 1, %g2 4000e410: 80 a0 60 00 cmp %g1, 0 4000e414: 12 80 00 05 bne 4000e428 <== NEVER TAKEN 4000e418: c4 27 60 10 st %g2, [ %i5 + 0x10 ] PIPE_WAKEUPWRITERS(pipe); 4000e41c: d0 07 60 30 ld [ %i5 + 0x30 ], %o0 4000e420: 40 00 05 ae call 4000fad8 4000e424: 92 07 bf fc add %fp, -4, %o1 if (pipe->Writers == 0) { 4000e428: c2 07 60 14 ld [ %i5 + 0x14 ], %g1 4000e42c: 80 a0 60 00 cmp %g1, 0 4000e430: 32 80 00 5e bne,a 4000e5a8 4000e434: d0 07 60 28 ld [ %i5 + 0x28 ], %o0 /* Not an error */ if (LIBIO_NODELAY(iop)) 4000e438: c2 06 60 10 ld [ %i1 + 0x10 ], %g1 4000e43c: 80 88 60 01 btst 1, %g1 4000e440: 32 80 00 5a bne,a 4000e5a8 4000e444: d0 07 60 28 ld [ %i5 + 0x28 ], %o0 break; prevCounter = pipe->writerCounter; 4000e448: f8 07 60 24 ld [ %i5 + 0x24 ], %i4 err = -EINTR; /* Wait until a writer opens the pipe */ do { PIPE_UNLOCK(pipe); 4000e44c: 7f ff eb 8e call 40009284 4000e450: d0 07 60 28 ld [ %i5 + 0x28 ], %o0 if (! PIPE_READWAIT(pipe)) 4000e454: d0 07 60 2c ld [ %i5 + 0x2c ], %o0 4000e458: 40 00 05 b6 call 4000fb30 4000e45c: 92 10 20 00 clr %o1 4000e460: 80 a2 20 00 cmp %o0, 0 4000e464: 12 80 00 55 bne 4000e5b8 <== NEVER TAKEN 4000e468: 92 10 20 00 clr %o1 goto out_error; if (! PIPE_LOCK(pipe)) 4000e46c: d0 07 60 28 ld [ %i5 + 0x28 ], %o0 4000e470: 7f ff eb 3d call 40009164 4000e474: 94 10 20 00 clr %o2 4000e478: 80 a2 20 00 cmp %o0, 0 4000e47c: 32 80 00 50 bne,a 4000e5bc <== NEVER TAKEN 4000e480: b0 10 3f fc mov -4, %i0 <== NOT EXECUTED goto out_error; } while (prevCounter == pipe->writerCounter); 4000e484: c2 07 60 24 ld [ %i5 + 0x24 ], %g1 4000e488: 80 a7 00 01 cmp %i4, %g1 4000e48c: 02 bf ff f0 be 4000e44c <== NEVER TAKEN 4000e490: 01 00 00 00 nop if (pipe->Writers ++ == 0) PIPE_WAKEUPREADERS(pipe); break; } PIPE_UNLOCK(pipe); 4000e494: 10 80 00 45 b 4000e5a8 4000e498: d0 07 60 28 ld [ %i5 + 0x28 ], %o0 } while (prevCounter == pipe->writerCounter); } break; case LIBIO_FLAGS_WRITE: pipe->writerCounter ++; 4000e49c: c2 07 60 24 ld [ %i5 + 0x24 ], %g1 4000e4a0: 82 00 60 01 inc %g1 4000e4a4: c2 27 60 24 st %g1, [ %i5 + 0x24 ] if (pipe->Writers ++ == 0) 4000e4a8: c2 07 60 14 ld [ %i5 + 0x14 ], %g1 4000e4ac: 84 00 60 01 add %g1, 1, %g2 4000e4b0: 80 a0 60 00 cmp %g1, 0 4000e4b4: 12 80 00 05 bne 4000e4c8 <== NEVER TAKEN 4000e4b8: c4 27 60 14 st %g2, [ %i5 + 0x14 ] PIPE_WAKEUPREADERS(pipe); 4000e4bc: d0 07 60 2c ld [ %i5 + 0x2c ], %o0 4000e4c0: 40 00 05 86 call 4000fad8 4000e4c4: 92 07 bf fc add %fp, -4, %o1 if (pipe->Readers == 0 && LIBIO_NODELAY(iop)) { 4000e4c8: c2 07 60 10 ld [ %i5 + 0x10 ], %g1 4000e4cc: 80 a0 60 00 cmp %g1, 0 4000e4d0: 32 80 00 36 bne,a 4000e5a8 4000e4d4: d0 07 60 28 ld [ %i5 + 0x28 ], %o0 4000e4d8: c2 06 60 10 ld [ %i1 + 0x10 ], %g1 4000e4dc: 80 88 60 01 btst 1, %g1 4000e4e0: 22 80 00 07 be,a 4000e4fc 4000e4e4: f8 07 60 20 ld [ %i5 + 0x20 ], %i4 PIPE_UNLOCK(pipe); 4000e4e8: d0 07 60 28 ld [ %i5 + 0x28 ], %o0 4000e4ec: 7f ff eb 66 call 40009284 4000e4f0: b0 10 3f fa mov -6, %i0 err = -ENXIO; goto out_error; 4000e4f4: 10 80 00 33 b 4000e5c0 4000e4f8: 90 10 00 1b mov %i3, %o0 if (pipe->Readers == 0) { prevCounter = pipe->readerCounter; err = -EINTR; do { PIPE_UNLOCK(pipe); 4000e4fc: 7f ff eb 62 call 40009284 4000e500: d0 07 60 28 ld [ %i5 + 0x28 ], %o0 if (! PIPE_WRITEWAIT(pipe)) 4000e504: d0 07 60 30 ld [ %i5 + 0x30 ], %o0 4000e508: 40 00 05 8a call 4000fb30 4000e50c: 92 10 20 00 clr %o1 4000e510: 80 a2 20 00 cmp %o0, 0 4000e514: 12 80 00 29 bne 4000e5b8 <== NEVER TAKEN 4000e518: 92 10 20 00 clr %o1 goto out_error; if (! PIPE_LOCK(pipe)) 4000e51c: d0 07 60 28 ld [ %i5 + 0x28 ], %o0 4000e520: 7f ff eb 11 call 40009164 4000e524: 94 10 20 00 clr %o2 4000e528: 80 a2 20 00 cmp %o0, 0 4000e52c: 12 80 00 24 bne 4000e5bc <== NEVER TAKEN 4000e530: b0 10 3f fc mov -4, %i0 goto out_error; } while (prevCounter == pipe->readerCounter); 4000e534: c2 07 60 20 ld [ %i5 + 0x20 ], %g1 4000e538: 80 a7 00 01 cmp %i4, %g1 4000e53c: 02 bf ff f0 be 4000e4fc <== NEVER TAKEN 4000e540: 01 00 00 00 nop if (pipe->Writers ++ == 0) PIPE_WAKEUPREADERS(pipe); break; } PIPE_UNLOCK(pipe); 4000e544: 10 80 00 19 b 4000e5a8 4000e548: d0 07 60 28 ld [ %i5 + 0x28 ], %o0 } while (prevCounter == pipe->readerCounter); } break; case LIBIO_FLAGS_READ_WRITE: pipe->readerCounter ++; 4000e54c: c2 07 60 20 ld [ %i5 + 0x20 ], %g1 4000e550: 82 00 60 01 inc %g1 4000e554: c2 27 60 20 st %g1, [ %i5 + 0x20 ] if (pipe->Readers ++ == 0) 4000e558: c2 07 60 10 ld [ %i5 + 0x10 ], %g1 4000e55c: 84 00 60 01 add %g1, 1, %g2 4000e560: 80 a0 60 00 cmp %g1, 0 4000e564: 12 80 00 05 bne 4000e578 <== NEVER TAKEN 4000e568: c4 27 60 10 st %g2, [ %i5 + 0x10 ] PIPE_WAKEUPWRITERS(pipe); 4000e56c: d0 07 60 30 ld [ %i5 + 0x30 ], %o0 4000e570: 40 00 05 5a call 4000fad8 4000e574: 92 07 bf fc add %fp, -4, %o1 pipe->writerCounter ++; 4000e578: c2 07 60 24 ld [ %i5 + 0x24 ], %g1 4000e57c: 82 00 60 01 inc %g1 4000e580: c2 27 60 24 st %g1, [ %i5 + 0x24 ] if (pipe->Writers ++ == 0) 4000e584: c2 07 60 14 ld [ %i5 + 0x14 ], %g1 4000e588: 84 00 60 01 add %g1, 1, %g2 4000e58c: 80 a0 60 00 cmp %g1, 0 4000e590: 12 80 00 05 bne 4000e5a4 <== NEVER TAKEN 4000e594: c4 27 60 14 st %g2, [ %i5 + 0x14 ] PIPE_WAKEUPREADERS(pipe); 4000e598: d0 07 60 2c ld [ %i5 + 0x2c ], %o0 4000e59c: 40 00 05 4f call 4000fad8 4000e5a0: 92 07 bf fc add %fp, -4, %o1 break; } PIPE_UNLOCK(pipe); 4000e5a4: d0 07 60 28 ld [ %i5 + 0x28 ], %o0 4000e5a8: 7f ff eb 37 call 40009284 4000e5ac: b0 10 20 00 clr %i0 return 0; 4000e5b0: 81 c7 e0 08 ret 4000e5b4: 81 e8 00 00 restore /* Not an error */ if (LIBIO_NODELAY(iop)) break; prevCounter = pipe->writerCounter; err = -EINTR; 4000e5b8: b0 10 3f fc mov -4, %i0 <== NOT EXECUTED PIPE_UNLOCK(pipe); return 0; out_error: pipe_release(pipep, iop); 4000e5bc: 90 10 00 1b mov %i3, %o0 <== NOT EXECUTED 4000e5c0: 7f ff fe c8 call 4000e0e0 4000e5c4: 92 10 00 19 mov %i1, %o1 return err; 4000e5c8: 81 c7 e0 08 ret 4000e5cc: 81 e8 00 00 restore if (err) goto out; } if (! PIPE_LOCK(pipe)) err = -EINTR; 4000e5d0: 10 bf ff 7c b 4000e3c0 <== NOT EXECUTED 4000e5d4: b0 10 3f f4 mov -12, %i0 <== NOT EXECUTED return 0; out_error: pipe_release(pipep, iop); return err; } 4000e5d8: 81 c7 e0 08 ret 4000e5dc: 81 e8 00 00 restore =============================================================================== 4000a4cc : */ long fpathconf( int fd, int name ) { 4000a4cc: 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); 4000a4d0: 03 10 00 4c sethi %hi(0x40013000), %g1 4000a4d4: c2 00 63 64 ld [ %g1 + 0x364 ], %g1 ! 40013364 4000a4d8: 80 a6 00 01 cmp %i0, %g1 4000a4dc: 2a 80 00 06 bcs,a 4000a4f4 4000a4e0: 83 2e 20 03 sll %i0, 3, %g1 4000a4e4: 40 00 0a 10 call 4000cd24 <__errno> 4000a4e8: 01 00 00 00 nop 4000a4ec: 10 80 00 3b b 4000a5d8 4000a4f0: 82 10 20 09 mov 9, %g1 ! 9 <_TLS_Alignment+0x8> iop = rtems_libio_iop(fd); 4000a4f4: b1 2e 20 06 sll %i0, 6, %i0 4000a4f8: b0 26 00 01 sub %i0, %g1, %i0 4000a4fc: 03 10 00 52 sethi %hi(0x40014800), %g1 4000a500: c2 00 61 dc ld [ %g1 + 0x1dc ], %g1 ! 400149dc 4000a504: b0 00 40 18 add %g1, %i0, %i0 rtems_libio_check_is_open(iop); 4000a508: c2 06 20 10 ld [ %i0 + 0x10 ], %g1 4000a50c: 80 88 61 00 btst 0x100, %g1 4000a510: 02 bf ff f5 be 4000a4e4 <== NEVER TAKEN 4000a514: 80 a6 60 0b cmp %i1, 0xb /* * Now process the information request. */ the_limits = iop->pathinfo.mt_entry->pathconf_limits_and_options; 4000a518: c2 06 20 28 ld [ %i0 + 0x28 ], %g1 switch ( name ) { 4000a51c: 18 80 00 2c bgu 4000a5cc 4000a520: c2 00 60 2c ld [ %g1 + 0x2c ], %g1 4000a524: b3 2e 60 02 sll %i1, 2, %i1 4000a528: 05 10 00 29 sethi %hi(0x4000a400), %g2 4000a52c: 84 10 a0 9c or %g2, 0x9c, %g2 ! 4000a49c <_close_r+0x10> 4000a530: c4 00 80 19 ld [ %g2 + %i1 ], %g2 4000a534: 81 c0 80 00 jmp %g2 4000a538: 01 00 00 00 nop case _PC_LINK_MAX: return_value = the_limits->link_max; 4000a53c: f0 00 40 00 ld [ %g1 ], %i0 break; 4000a540: 81 c7 e0 08 ret 4000a544: 81 e8 00 00 restore case _PC_MAX_CANON: return_value = the_limits->max_canon; 4000a548: f0 00 60 04 ld [ %g1 + 4 ], %i0 break; 4000a54c: 81 c7 e0 08 ret 4000a550: 81 e8 00 00 restore case _PC_MAX_INPUT: return_value = the_limits->max_input; 4000a554: f0 00 60 08 ld [ %g1 + 8 ], %i0 break; 4000a558: 81 c7 e0 08 ret 4000a55c: 81 e8 00 00 restore case _PC_NAME_MAX: return_value = the_limits->name_max; 4000a560: f0 00 60 0c ld [ %g1 + 0xc ], %i0 break; 4000a564: 81 c7 e0 08 ret 4000a568: 81 e8 00 00 restore case _PC_PATH_MAX: return_value = the_limits->path_max; 4000a56c: f0 00 60 10 ld [ %g1 + 0x10 ], %i0 break; 4000a570: 81 c7 e0 08 ret 4000a574: 81 e8 00 00 restore case _PC_PIPE_BUF: return_value = the_limits->pipe_buf; 4000a578: f0 00 60 14 ld [ %g1 + 0x14 ], %i0 break; 4000a57c: 81 c7 e0 08 ret 4000a580: 81 e8 00 00 restore case _PC_CHOWN_RESTRICTED: return_value = the_limits->posix_chown_restrictions; 4000a584: f0 00 60 1c ld [ %g1 + 0x1c ], %i0 break; 4000a588: 81 c7 e0 08 ret 4000a58c: 81 e8 00 00 restore case _PC_NO_TRUNC: return_value = the_limits->posix_no_trunc; 4000a590: f0 00 60 20 ld [ %g1 + 0x20 ], %i0 break; 4000a594: 81 c7 e0 08 ret 4000a598: 81 e8 00 00 restore case _PC_VDISABLE: return_value = the_limits->posix_vdisable; 4000a59c: f0 00 60 2c ld [ %g1 + 0x2c ], %i0 break; 4000a5a0: 81 c7 e0 08 ret 4000a5a4: 81 e8 00 00 restore case _PC_ASYNC_IO: return_value = the_limits->posix_async_io; 4000a5a8: f0 00 60 18 ld [ %g1 + 0x18 ], %i0 break; 4000a5ac: 81 c7 e0 08 ret 4000a5b0: 81 e8 00 00 restore case _PC_PRIO_IO: return_value = the_limits->posix_prio_io; 4000a5b4: f0 00 60 24 ld [ %g1 + 0x24 ], %i0 break; 4000a5b8: 81 c7 e0 08 ret 4000a5bc: 81 e8 00 00 restore case _PC_SYNC_IO: return_value = the_limits->posix_sync_io; 4000a5c0: f0 00 60 28 ld [ %g1 + 0x28 ], %i0 break; 4000a5c4: 81 c7 e0 08 ret 4000a5c8: 81 e8 00 00 restore default: rtems_set_errno_and_return_minus_one( EINVAL ); 4000a5cc: 40 00 09 d6 call 4000cd24 <__errno> 4000a5d0: 01 00 00 00 nop 4000a5d4: 82 10 20 16 mov 0x16, %g1 ! 16 <_TLS_Alignment+0x15> 4000a5d8: c2 22 00 00 st %g1, [ %o0 ] break; } return return_value; } 4000a5dc: 81 c7 e0 08 ret 4000a5e0: 91 e8 3f ff restore %g0, -1, %o0 =============================================================================== 4000380c : #include void free( void *ptr ) { 4000380c: 9d e3 bf a0 save %sp, -96, %sp MSBUMP(free_calls, 1); 40003810: 03 10 00 60 sethi %hi(0x40018000), %g1 40003814: 82 10 63 40 or %g1, 0x340, %g1 ! 40018340 40003818: c4 00 60 0c ld [ %g1 + 0xc ], %g2 #include void free( void *ptr ) { 4000381c: b2 10 00 18 mov %i0, %i1 MSBUMP(free_calls, 1); 40003820: 84 00 a0 01 inc %g2 if ( !ptr ) 40003824: 80 a6 20 00 cmp %i0, 0 40003828: 02 80 00 21 be 400038ac 4000382c: c4 20 60 0c st %g2, [ %g1 + 0xc ] #endif } RTEMS_INLINE_ROUTINE System_state_Codes _System_state_Get ( void ) { return _System_state_Current; 40003830: 03 10 00 62 sethi %hi(0x40018800), %g1 return; /* * Do not attempt to free memory if in a critical section or ISR. */ if ( _System_state_Is_up(_System_state_Get()) && 40003834: c2 00 60 f4 ld [ %g1 + 0xf4 ], %g1 ! 400188f4 <_System_state_Current> 40003838: 80 a0 60 02 cmp %g1, 2 4000383c: 12 80 00 09 bne 40003860 <== NEVER TAKEN 40003840: 03 10 00 5c sethi %hi(0x40017000), %g1 !malloc_is_system_state_OK() ) { 40003844: 40 00 00 82 call 40003a4c 40003848: 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()) && 4000384c: 80 a2 20 00 cmp %o0, 0 40003850: 12 80 00 04 bne 40003860 40003854: 03 10 00 5c sethi %hi(0x40017000), %g1 !malloc_is_system_state_OK() ) { malloc_deferred_free(ptr); 40003858: 40 00 00 8e call 40003a90 4000385c: 81 e8 00 00 restore } /* * If configured, update the statistics */ if ( rtems_malloc_statistics_helpers ) 40003860: c2 00 60 bc ld [ %g1 + 0xbc ], %g1 40003864: 80 a0 60 00 cmp %g1, 0 40003868: 02 80 00 06 be 40003880 4000386c: 3b 10 00 5a sethi %hi(0x40016800), %i5 (*rtems_malloc_statistics_helpers->at_free)(ptr); 40003870: c2 00 60 08 ld [ %g1 + 8 ], %g1 40003874: 9f c0 40 00 call %g1 40003878: 90 10 00 19 mov %i1, %o0 if ( !_Protected_heap_Free( RTEMS_Malloc_Heap, ptr ) ) { 4000387c: 3b 10 00 5a sethi %hi(0x40016800), %i5 40003880: d0 07 63 28 ld [ %i5 + 0x328 ], %o0 ! 40016b28 40003884: 40 00 16 b0 call 40009344 <_Protected_heap_Free> 40003888: 92 10 00 19 mov %i1, %o1 4000388c: 80 a2 20 00 cmp %o0, 0 40003890: 12 80 00 07 bne 400038ac 40003894: c2 07 63 28 ld [ %i5 + 0x328 ], %g1 printk( "Program heap: free of bad pointer %p -- range %p - %p \n", 40003898: 31 10 00 56 sethi %hi(0x40015800), %i0 4000389c: f4 00 60 18 ld [ %g1 + 0x18 ], %i2 400038a0: f6 00 60 1c ld [ %g1 + 0x1c ], %i3 400038a4: 40 00 02 d0 call 400043e4 400038a8: 91 ee 22 20 restore %i0, 0x220, %o0 400038ac: 81 c7 e0 08 ret 400038b0: 81 e8 00 00 restore =============================================================================== 40014c8c : int fstat( int fd, struct stat *sbuf ) { 40014c8c: 9d e3 bf a0 save %sp, -96, %sp rtems_libio_t *iop; /* * Check to see if we were passed a valid pointer. */ if ( !sbuf ) 40014c90: 80 a6 60 00 cmp %i1, 0 40014c94: 32 80 00 06 bne,a 40014cac <== ALWAYS TAKEN 40014c98: 03 10 00 5a sethi %hi(0x40016800), %g1 rtems_set_errno_and_return_minus_one( EFAULT ); 40014c9c: 7f ff eb 61 call 4000fa20 <__errno> <== NOT EXECUTED 40014ca0: 01 00 00 00 nop <== NOT EXECUTED 40014ca4: 10 80 00 12 b 40014cec <== NOT EXECUTED 40014ca8: 82 10 20 0e mov 0xe, %g1 ! e <_TLS_Alignment+0xd> <== NOT EXECUTED /* * Now process the stat() request. */ iop = rtems_libio_iop( fd ); 40014cac: c2 00 63 30 ld [ %g1 + 0x330 ], %g1 40014cb0: 80 a6 00 01 cmp %i0, %g1 40014cb4: 1a 80 00 0b bcc 40014ce0 40014cb8: 83 2e 20 03 sll %i0, 3, %g1 40014cbc: b1 2e 20 06 sll %i0, 6, %i0 40014cc0: b0 26 00 01 sub %i0, %g1, %i0 40014cc4: 03 10 00 60 sethi %hi(0x40018000), %g1 40014cc8: c2 00 63 30 ld [ %g1 + 0x330 ], %g1 ! 40018330 40014ccc: b0 00 40 18 add %g1, %i0, %i0 rtems_libio_check_fd( fd ); rtems_libio_check_is_open(iop); 40014cd0: c2 06 20 10 ld [ %i0 + 0x10 ], %g1 40014cd4: 80 88 61 00 btst 0x100, %g1 40014cd8: 12 80 00 08 bne 40014cf8 40014cdc: 94 10 20 48 mov 0x48, %o2 /* * Now process the stat() request. */ iop = rtems_libio_iop( fd ); rtems_libio_check_fd( fd ); 40014ce0: 7f ff eb 50 call 4000fa20 <__errno> 40014ce4: 01 00 00 00 nop 40014ce8: 82 10 20 09 mov 9, %g1 ! 9 <_TLS_Alignment+0x8> 40014cec: c2 22 00 00 st %g1, [ %o0 ] 40014cf0: 81 c7 e0 08 ret 40014cf4: 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) ); 40014cf8: 90 10 00 19 mov %i1, %o0 40014cfc: 7f ff ed 6e call 400102b4 40014d00: 92 10 20 00 clr %o1 return (*iop->pathinfo.handlers->fstat_h)( &iop->pathinfo, sbuf ); 40014d04: c2 06 20 24 ld [ %i0 + 0x24 ], %g1 40014d08: 90 06 20 14 add %i0, 0x14, %o0 40014d0c: c2 00 60 18 ld [ %g1 + 0x18 ], %g1 40014d10: 9f c0 40 00 call %g1 40014d14: 92 10 00 19 mov %i1, %o1 } 40014d18: 81 c7 e0 08 ret 40014d1c: 91 e8 00 08 restore %g0, %o0, %o0 =============================================================================== 4000396c : 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) { 4000396c: 03 10 00 70 sethi %hi(0x4001c000), %g1 40003970: c2 00 62 80 ld [ %g1 + 0x280 ], %g1 ! 4001c280 40003974: 80 a2 00 01 cmp %o0, %g1 40003978: 1a 80 00 1f bcc 400039f4 <== NEVER TAKEN 4000397c: 03 10 00 70 sethi %hi(0x4001c000), %g1 40003980: c2 00 62 84 ld [ %g1 + 0x284 ], %g1 ! 4001c284 40003984: 80 a0 60 00 cmp %g1, 0 40003988: 02 80 00 1b be 400039f4 <== NEVER TAKEN 4000398c: 01 00 00 00 nop rtems_disk_device_table *dtab = disktab + major; 40003990: 91 2a 20 03 sll %o0, 3, %o0 40003994: 84 00 40 08 add %g1, %o0, %g2 if (minor < dtab->size && dtab->minor != NULL) { 40003998: c4 00 a0 04 ld [ %g2 + 4 ], %g2 4000399c: 80 a2 40 02 cmp %o1, %g2 400039a0: 1a 80 00 15 bcc 400039f4 <== NEVER TAKEN 400039a4: 01 00 00 00 nop 400039a8: c2 00 40 08 ld [ %g1 + %o0 ], %g1 400039ac: 80 a0 60 00 cmp %g1, 0 400039b0: 02 80 00 11 be 400039f4 <== NEVER TAKEN 400039b4: 93 2a 60 02 sll %o1, 2, %o1 rtems_disk_device *dd = dtab->minor [minor]; 400039b8: c2 00 40 09 ld [ %g1 + %o1 ], %g1 if (dd != NULL && !lookup_only) { 400039bc: 80 a0 60 00 cmp %g1, 0 400039c0: 02 80 00 10 be 40003a00 400039c4: 90 10 00 01 mov %g1, %o0 400039c8: 80 a2 a0 01 cmp %o2, 1 400039cc: 02 80 00 0d be 40003a00 400039d0: 01 00 00 00 nop if (!dd->deleted) { 400039d4: c4 08 60 40 ldub [ %g1 + 0x40 ], %g2 400039d8: 80 a0 a0 00 cmp %g2, 0 400039dc: 12 80 00 09 bne 40003a00 400039e0: 90 10 20 00 clr %o0 ++dd->uses; 400039e4: c4 00 60 14 ld [ %g1 + 0x14 ], %g2 400039e8: 84 00 a0 01 inc %g2 400039ec: 10 80 00 04 b 400039fc 400039f0: c4 20 60 14 st %g2, [ %g1 + 0x14 ] return dd; } } return NULL; 400039f4: 81 c3 e0 08 retl <== NOT EXECUTED 400039f8: 90 10 20 00 clr %o0 <== NOT EXECUTED if (major < disktab_size && disktab != NULL) { rtems_disk_device_table *dtab = disktab + major; if (minor < dtab->size && dtab->minor != NULL) { rtems_disk_device *dd = dtab->minor [minor]; 400039fc: 90 10 00 01 mov %g1, %o0 return dd; } } return NULL; } 40003a00: 81 c3 e0 08 retl =============================================================================== 40005430 : * 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, 40005430: 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); 40005434: 40 00 05 40 call 40006934 40005438: 90 10 22 04 mov 0x204, %o0 if (s == NULL) { return RTEMS_NO_MEMORY; 4000543c: 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) 40005440: 80 a2 20 00 cmp %o0, 0 40005444: 02 80 00 0f be 40005480 <== NEVER TAKEN 40005448: ba 10 00 08 mov %o0, %i5 { return RTEMS_NO_MEMORY; } n = read(fd, s->data, RTEMS_IDE_SECTOR_SIZE); 4000544c: 90 10 00 18 mov %i0, %o0 40005450: 92 07 60 04 add %i5, 4, %o1 40005454: 40 00 07 7e call 4000724c 40005458: 94 10 22 00 mov 0x200, %o2 if (n != RTEMS_IDE_SECTOR_SIZE) 4000545c: 80 a2 22 00 cmp %o0, 0x200 40005460: 22 80 00 06 be,a 40005478 <== ALWAYS TAKEN 40005464: f2 27 40 00 st %i1, [ %i5 ] { free(s); 40005468: 40 00 03 bb call 40006354 <== NOT EXECUTED 4000546c: 90 10 00 1d mov %i5, %o0 <== NOT EXECUTED return RTEMS_IO_ERROR; 40005470: 10 80 00 04 b 40005480 <== NOT EXECUTED 40005474: 82 10 20 1b mov 0x1b, %g1 <== NOT EXECUTED } s->sector_num = sector_num; *sector = s; 40005478: fa 26 80 00 st %i5, [ %i2 ] return RTEMS_SUCCESSFUL; 4000547c: 82 10 20 00 clr %g1 } 40005480: 81 c7 e0 08 ret 40005484: 91 e8 00 01 restore %g0, %g1, %o0 =============================================================================== 40031714 : int getdents( int dd_fd, char *dd_buf, int dd_len ) { 40031714: 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 ); 40031718: 03 10 00 db sethi %hi(0x40036c00), %g1 4003171c: c2 00 61 5c ld [ %g1 + 0x15c ], %g1 ! 40036d5c 40031720: 80 a6 00 01 cmp %i0, %g1 40031724: 1a 80 00 08 bcc 40031744 <== NEVER TAKEN 40031728: ba 10 20 00 clr %i5 4003172c: 83 2e 20 03 sll %i0, 3, %g1 40031730: b1 2e 20 06 sll %i0, 6, %i0 40031734: b0 26 00 01 sub %i0, %g1, %i0 40031738: 03 10 01 21 sethi %hi(0x40048400), %g1 4003173c: fa 00 62 98 ld [ %g1 + 0x298 ], %i5 ! 40048698 40031740: ba 07 40 18 add %i5, %i0, %i5 /* * Make sure we are working on a directory */ type = rtems_filesystem_node_type( &iop->pathinfo ); 40031744: 7f ff 61 4c call 40009c74 40031748: 90 07 60 14 add %i5, 0x14, %o0 if ( type != RTEMS_FILESYSTEM_DIRECTORY ) 4003174c: 80 a2 20 00 cmp %o0, 0 40031750: 22 80 00 08 be,a 40031770 40031754: c2 07 60 24 ld [ %i5 + 0x24 ], %g1 rtems_set_errno_and_return_minus_one( ENOTDIR ); 40031758: 7f ff bd d1 call 40020e9c <__errno> 4003175c: b0 10 3f ff mov -1, %i0 40031760: 82 10 20 14 mov 0x14, %g1 40031764: c2 22 00 00 st %g1, [ %o0 ] 40031768: 81 c7 e0 08 ret 4003176c: 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 ); 40031770: 90 10 00 1d mov %i5, %o0 40031774: c2 00 60 08 ld [ %g1 + 8 ], %g1 40031778: 92 10 00 19 mov %i1, %o1 4003177c: 9f c0 40 00 call %g1 40031780: 94 10 00 1a mov %i2, %o2 } 40031784: 81 c7 e0 08 ret 40031788: 91 e8 00 08 restore %g0, %o0, %o0 =============================================================================== 40004064 : /** * Initialize useable but dummy databases */ void init_etc_passwd_group(void) { 40004064: 9d e3 bf a0 save %sp, -96, %sp FILE *fp; static char etc_passwd_initted = 0; if (etc_passwd_initted) 40004068: 03 10 00 63 sethi %hi(0x40018c00), %g1 4000406c: c4 48 63 9c ldsb [ %g1 + 0x39c ], %g2 ! 40018f9c 40004070: 80 a0 a0 00 cmp %g2, 0 40004074: 12 80 00 2d bne 40004128 40004078: 84 10 20 01 mov 1, %g2 return; etc_passwd_initted = 1; mkdir("/etc", 0777); 4000407c: 92 10 21 ff mov 0x1ff, %o1 FILE *fp; static char etc_passwd_initted = 0; if (etc_passwd_initted) return; etc_passwd_initted = 1; 40004080: c4 28 63 9c stb %g2, [ %g1 + 0x39c ] mkdir("/etc", 0777); 40004084: 11 10 00 5b sethi %hi(0x40016c00), %o0 40004088: 40 00 01 63 call 40004614 4000408c: 90 12 22 f0 or %o0, 0x2f0, %o0 ! 40016ef0 /* * Initialize /etc/passwd */ if ((fp = fopen("/etc/passwd", "r")) != NULL) { 40004090: 3b 10 00 5b sethi %hi(0x40016c00), %i5 40004094: 39 10 00 5b sethi %hi(0x40016c00), %i4 40004098: 90 17 62 f8 or %i5, 0x2f8, %o0 4000409c: 40 00 32 c5 call 40010bb0 400040a0: 92 17 23 08 or %i4, 0x308, %o1 400040a4: 80 a2 20 00 cmp %o0, 0 400040a8: 12 80 00 0c bne 400040d8 400040ac: 13 10 00 5b sethi %hi(0x40016c00), %o1 fclose(fp); } else if ((fp = fopen("/etc/passwd", "w")) != NULL) { 400040b0: 90 17 62 f8 or %i5, 0x2f8, %o0 400040b4: 40 00 32 bf call 40010bb0 400040b8: 92 12 63 10 or %o1, 0x310, %o1 400040bc: ba 92 20 00 orcc %o0, 0, %i5 400040c0: 02 80 00 08 be 400040e0 <== NEVER TAKEN 400040c4: 11 10 00 5b sethi %hi(0x40016c00), %o0 fprintf(fp, "root:*:0:0:root::/:/bin/sh\n" 400040c8: 92 10 00 1d mov %i5, %o1 400040cc: 40 00 32 e4 call 40010c5c 400040d0: 90 12 23 18 or %o0, 0x318, %o0 "rtems:*:1:1:RTEMS Application::/:/bin/sh\n" "tty:!:2:2:tty owner::/:/bin/false\n" ); fclose(fp); 400040d4: 90 10 00 1d mov %i5, %o0 400040d8: 40 00 30 e4 call 40010468 400040dc: 01 00 00 00 nop } /* * Initialize /etc/group */ if ((fp = fopen("/etc/group", "r")) != NULL) { 400040e0: 3b 10 00 5b sethi %hi(0x40016c00), %i5 400040e4: 92 17 23 08 or %i4, 0x308, %o1 400040e8: 40 00 32 b2 call 40010bb0 400040ec: 90 17 63 80 or %i5, 0x380, %o0 400040f0: b0 92 20 00 orcc %o0, 0, %i0 400040f4: 12 80 00 0b bne 40004120 400040f8: 90 17 63 80 or %i5, 0x380, %o0 fclose(fp); } else if ((fp = fopen("/etc/group", "w")) != NULL) { 400040fc: 13 10 00 5b sethi %hi(0x40016c00), %o1 40004100: 40 00 32 ac call 40010bb0 40004104: 92 12 63 10 or %o1, 0x310, %o1 ! 40016f10 40004108: b0 92 20 00 orcc %o0, 0, %i0 4000410c: 02 80 00 07 be 40004128 <== NEVER TAKEN 40004110: 11 10 00 5b sethi %hi(0x40016c00), %o0 fprintf( fp, "root:x:0:root\n" 40004114: 92 10 00 18 mov %i0, %o1 40004118: 40 00 32 d1 call 40010c5c 4000411c: 90 12 23 90 or %o0, 0x390, %o0 "rtems:x:1:rtems\n" "tty:x:2:tty\n" ); fclose(fp); 40004120: 40 00 30 d2 call 40010468 40004124: 81 e8 00 00 restore 40004128: 81 c7 e0 08 ret 4000412c: 81 e8 00 00 restore =============================================================================== 40005f78 : /* * Process a single input character */ static int iproc (unsigned char c, struct rtems_termios_tty *tty) { 40005f78: 9d e3 bf a0 save %sp, -96, %sp if (tty->termios.c_iflag & ISTRIP) 40005f7c: c4 06 60 30 ld [ %i1 + 0x30 ], %g2 40005f80: 80 88 a0 20 btst 0x20, %g2 40005f84: 32 80 00 02 bne,a 40005f8c <== NEVER TAKEN 40005f88: b0 0e 20 7f and %i0, 0x7f, %i0 <== NOT EXECUTED c &= 0x7f; if (tty->termios.c_iflag & IUCLC) 40005f8c: 80 88 a2 00 btst 0x200, %g2 40005f90: 02 80 00 0c be 40005fc0 40005f94: 80 a6 20 0d cmp %i0, 0xd c = tolower (c); 40005f98: 03 10 00 5b sethi %hi(0x40016c00), %g1 40005f9c: c2 00 61 0c ld [ %g1 + 0x10c ], %g1 ! 40016d0c <__ctype_ptr__> 40005fa0: 82 00 40 18 add %g1, %i0, %g1 40005fa4: c2 08 60 01 ldub [ %g1 + 1 ], %g1 40005fa8: 82 08 60 03 and %g1, 3, %g1 40005fac: 80 a0 60 01 cmp %g1, 1 40005fb0: 22 80 00 02 be,a 40005fb8 40005fb4: b0 06 20 20 add %i0, 0x20, %i0 40005fb8: b0 0e 20 ff and %i0, 0xff, %i0 if (c == '\r') { 40005fbc: 80 a6 20 0d cmp %i0, 0xd 40005fc0: 12 80 00 0a bne 40005fe8 40005fc4: 80 a6 20 0a cmp %i0, 0xa if (tty->termios.c_iflag & IGNCR) 40005fc8: 80 88 a0 80 btst 0x80, %g2 40005fcc: 12 80 00 5c bne 4000613c <== NEVER TAKEN 40005fd0: 82 10 20 00 clr %g1 return 0; if (tty->termios.c_iflag & ICRNL) 40005fd4: 80 88 a1 00 btst 0x100, %g2 40005fd8: 32 80 00 0d bne,a 4000600c <== ALWAYS TAKEN 40005fdc: 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)) { 40005fe0: 10 80 00 0c b 40006010 <== NOT EXECUTED 40005fe4: 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)) { 40005fe8: 12 80 00 07 bne 40006004 40005fec: 80 a6 20 00 cmp %i0, 0 40005ff0: 80 88 a0 40 btst 0x40, %g2 40005ff4: 32 80 00 06 bne,a 4000600c <== NEVER TAKEN 40005ff8: b0 10 20 0d mov 0xd, %i0 <== NOT EXECUTED c = '\r'; } if ((c != '\0') && (tty->termios.c_lflag & ICANON)) { 40005ffc: 10 80 00 05 b 40006010 40006000: c2 06 60 3c ld [ %i1 + 0x3c ], %g1 40006004: 02 80 00 3a be 400060ec <== NEVER TAKEN 40006008: 03 10 00 5a sethi %hi(0x40016800), %g1 4000600c: c2 06 60 3c ld [ %i1 + 0x3c ], %g1 40006010: 80 88 60 02 btst 2, %g1 40006014: 22 80 00 36 be,a 400060ec 40006018: 03 10 00 5a sethi %hi(0x40016800), %g1 if (c == tty->termios.c_cc[VERASE]) { 4000601c: c4 0e 60 43 ldub [ %i1 + 0x43 ], %g2 erase (tty, 0); 40006020: 90 10 00 19 mov %i1, %o0 } else if ((c == '\n') && (tty->termios.c_iflag & INLCR)) { c = '\r'; } if ((c != '\0') && (tty->termios.c_lflag & ICANON)) { if (c == tty->termios.c_cc[VERASE]) { 40006024: 80 a0 80 18 cmp %g2, %i0 40006028: 02 80 00 08 be 40006048 4000602c: 92 10 20 00 clr %o1 erase (tty, 0); return 0; } else if (c == tty->termios.c_cc[VKILL]) { 40006030: c4 0e 60 44 ldub [ %i1 + 0x44 ], %g2 40006034: 80 a0 80 18 cmp %g2, %i0 40006038: 32 80 00 08 bne,a 40006058 4000603c: c4 0e 60 45 ldub [ %i1 + 0x45 ], %g2 erase (tty, 1); 40006040: 90 10 00 19 mov %i1, %o0 40006044: 92 10 20 01 mov 1, %o1 40006048: 7f ff ff 45 call 40005d5c 4000604c: 01 00 00 00 nop return 0; 40006050: 10 80 00 3b b 4000613c 40006054: 82 10 20 00 clr %g1 ! 0 <_TLS_BSS_size> } else if (c == tty->termios.c_cc[VEOF]) { 40006058: 80 a0 80 18 cmp %g2, %i0 4000605c: 02 80 00 37 be 40006138 <== NEVER TAKEN 40006060: 80 a6 20 0a cmp %i0, 0xa return 1; } else if (c == '\n') { 40006064: 32 80 00 0f bne,a 400060a0 40006068: c4 0e 60 4c ldub [ %i1 + 0x4c ], %g2 if (tty->termios.c_lflag & (ECHO | ECHONL)) 4000606c: 80 88 60 48 btst 0x48, %g1 40006070: 22 80 00 06 be,a 40006088 <== NEVER TAKEN 40006074: c2 06 60 20 ld [ %i1 + 0x20 ], %g1 <== NOT EXECUTED echo (c, tty); 40006078: 90 10 20 0a mov 0xa, %o0 4000607c: 7f ff ff 17 call 40005cd8 40006080: 92 10 00 19 mov %i1, %o1 tty->cbuf[tty->ccount++] = c; 40006084: c2 06 60 20 ld [ %i1 + 0x20 ], %g1 40006088: c4 06 60 1c ld [ %i1 + 0x1c ], %g2 4000608c: 86 00 60 01 add %g1, 1, %g3 40006090: c6 26 60 20 st %g3, [ %i1 + 0x20 ] 40006094: 86 10 20 0a mov 0xa, %g3 40006098: 10 80 00 28 b 40006138 4000609c: c6 28 80 01 stb %g3, [ %g2 + %g1 ] return 1; } else if ((c == tty->termios.c_cc[VEOL]) || 400060a0: 80 a0 80 18 cmp %g2, %i0 400060a4: 02 80 00 07 be 400060c0 <== NEVER TAKEN 400060a8: 80 88 60 08 btst 8, %g1 400060ac: c4 0e 60 51 ldub [ %i1 + 0x51 ], %g2 400060b0: 80 a0 80 18 cmp %g2, %i0 400060b4: 32 80 00 0e bne,a 400060ec <== ALWAYS TAKEN 400060b8: 03 10 00 5a sethi %hi(0x40016800), %g1 (c == tty->termios.c_cc[VEOL2])) { if (tty->termios.c_lflag & ECHO) 400060bc: 80 88 60 08 btst 8, %g1 <== NOT EXECUTED 400060c0: 22 80 00 06 be,a 400060d8 <== NOT EXECUTED 400060c4: c2 06 60 20 ld [ %i1 + 0x20 ], %g1 <== NOT EXECUTED echo (c, tty); 400060c8: 90 10 00 18 mov %i0, %o0 <== NOT EXECUTED 400060cc: 7f ff ff 03 call 40005cd8 <== NOT EXECUTED 400060d0: 92 10 00 19 mov %i1, %o1 <== NOT EXECUTED tty->cbuf[tty->ccount++] = c; 400060d4: c2 06 60 20 ld [ %i1 + 0x20 ], %g1 <== NOT EXECUTED 400060d8: c4 06 60 1c ld [ %i1 + 0x1c ], %g2 <== NOT EXECUTED 400060dc: 86 00 60 01 add %g1, 1, %g3 <== NOT EXECUTED 400060e0: c6 26 60 20 st %g3, [ %i1 + 0x20 ] <== NOT EXECUTED 400060e4: 10 80 00 15 b 40006138 <== NOT EXECUTED 400060e8: f0 28 80 01 stb %i0, [ %g2 + %g1 ] <== NOT EXECUTED } /* * FIXME: Should do IMAXBEL handling somehow */ if (tty->ccount < (CBUFSIZE-1)) { 400060ec: c6 06 60 20 ld [ %i1 + 0x20 ], %g3 400060f0: c4 00 63 64 ld [ %g1 + 0x364 ], %g2 400060f4: 84 00 bf ff add %g2, -1, %g2 400060f8: 80 a0 c0 02 cmp %g3, %g2 400060fc: 1a 80 00 10 bcc 4000613c <== NEVER TAKEN 40006100: 82 10 20 00 clr %g1 if (tty->termios.c_lflag & ECHO) 40006104: c2 06 60 3c ld [ %i1 + 0x3c ], %g1 40006108: 80 88 60 08 btst 8, %g1 4000610c: 22 80 00 06 be,a 40006124 <== NEVER TAKEN 40006110: c2 06 60 20 ld [ %i1 + 0x20 ], %g1 <== NOT EXECUTED echo (c, tty); 40006114: 90 10 00 18 mov %i0, %o0 40006118: 7f ff fe f0 call 40005cd8 4000611c: 92 10 00 19 mov %i1, %o1 tty->cbuf[tty->ccount++] = c; 40006120: c2 06 60 20 ld [ %i1 + 0x20 ], %g1 40006124: c4 06 60 1c ld [ %i1 + 0x1c ], %g2 40006128: 86 00 60 01 add %g1, 1, %g3 4000612c: c6 26 60 20 st %g3, [ %i1 + 0x20 ] 40006130: 10 bf ff c8 b 40006050 40006134: f0 28 80 01 stb %i0, [ %g2 + %g1 ] else if (c == tty->termios.c_cc[VKILL]) { erase (tty, 1); return 0; } else if (c == tty->termios.c_cc[VEOF]) { return 1; 40006138: 82 10 20 01 mov 1, %g1 if (tty->termios.c_lflag & ECHO) echo (c, tty); tty->cbuf[tty->ccount++] = c; } return 0; } 4000613c: 81 c7 e0 08 ret 40006140: 91 e8 00 01 restore %g0, %g1, %o0 =============================================================================== 40029570 : int killinfo( pid_t pid, int sig, const union sigval *value ) { 40029570: 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() ) 40029574: 7f ff ff 2c call 40029224 40029578: 01 00 00 00 nop 4002957c: 80 a6 00 08 cmp %i0, %o0 40029580: 02 80 00 06 be 40029598 40029584: 80 a6 60 00 cmp %i1, 0 rtems_set_errno_and_return_minus_one( ESRCH ); 40029588: 7f ff b9 41 call 40017a8c <__errno> 4002958c: 01 00 00 00 nop 40029590: 10 80 00 07 b 400295ac 40029594: 82 10 20 03 mov 3, %g1 ! 3 <_TLS_Alignment+0x2> /* * Validate the signal passed. */ if ( !sig ) 40029598: 12 80 00 08 bne 400295b8 4002959c: ba 06 7f ff add %i1, -1, %i5 rtems_set_errno_and_return_minus_one( EINVAL ); 400295a0: 7f ff b9 3b call 40017a8c <__errno> 400295a4: 01 00 00 00 nop 400295a8: 82 10 20 16 mov 0x16, %g1 ! 16 <_TLS_Alignment+0x15> 400295ac: c2 22 00 00 st %g1, [ %o0 ] 400295b0: 81 c7 e0 08 ret 400295b4: 91 e8 3f ff restore %g0, -1, %o0 if ( !is_valid_signo(sig) ) 400295b8: 80 a7 60 1f cmp %i5, 0x1f 400295bc: 18 bf ff f9 bgu 400295a0 400295c0: 23 10 00 c3 sethi %hi(0x40030c00), %l1 rtems_set_errno_and_return_minus_one( EINVAL ); /* * If the signal is being ignored, then we are out of here. */ if ( _POSIX_signals_Vectors[ sig ].sa_handler == SIG_IGN ) 400295c4: b1 2e 60 02 sll %i1, 2, %i0 400295c8: a2 14 60 cc or %l1, 0xcc, %l1 400295cc: a1 2e 60 04 sll %i1, 4, %l0 400295d0: 82 24 00 18 sub %l0, %i0, %g1 400295d4: 82 04 40 01 add %l1, %g1, %g1 400295d8: c2 00 60 08 ld [ %g1 + 8 ], %g1 400295dc: 80 a0 60 01 cmp %g1, 1 400295e0: 02 80 00 92 be 40029828 400295e4: 80 a6 60 08 cmp %i1, 8 /* * 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 ) ) 400295e8: 02 80 00 06 be 40029600 400295ec: 80 a6 60 04 cmp %i1, 4 400295f0: 02 80 00 04 be 40029600 400295f4: 80 a6 60 0b cmp %i1, 0xb 400295f8: 12 80 00 08 bne 40029618 400295fc: 82 10 20 01 mov 1, %g1 return pthread_kill( pthread_self(), sig ); 40029600: 40 00 01 1f call 40029a7c 40029604: 01 00 00 00 nop 40029608: 40 00 00 f0 call 400299c8 4002960c: 92 10 00 19 mov %i1, %o1 40029610: 81 c7 e0 08 ret 40029614: 91 e8 00 08 restore %g0, %o0, %o0 /* * Build up a siginfo structure */ siginfo = &siginfo_struct; siginfo->si_signo = sig; 40029618: f2 27 bf f4 st %i1, [ %fp + -12 ] siginfo->si_code = SI_USER; 4002961c: c2 27 bf f8 st %g1, [ %fp + -8 ] if ( !value ) { 40029620: 80 a6 a0 00 cmp %i2, 0 40029624: 12 80 00 04 bne 40029634 40029628: bb 28 40 1d sll %g1, %i5, %i5 4002962c: 10 80 00 04 b 4002963c 40029630: c0 27 bf fc clr [ %fp + -4 ] siginfo->si_value.sival_int = 0; } else { siginfo->si_value = *value; 40029634: c2 06 80 00 ld [ %i2 ], %g1 40029638: 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 disable_level = _Thread_Dispatch_disable_level; 4002963c: c4 01 a0 10 ld [ %g6 + 0x10 ], %g2 _ISR_Disable( level ); _Profiling_Thread_dispatch_disable( _Per_CPU_Get(), disable_level ); #endif ++disable_level; 40029640: 84 00 a0 01 inc %g2 _Thread_Dispatch_disable_level = disable_level; 40029644: c4 21 a0 10 st %g2, [ %g6 + 0x10 ] /* * 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; 40029648: d0 01 a0 18 ld [ %g6 + 0x18 ], %o0 api = the_thread->API_Extensions[ THREAD_API_POSIX ]; if ( _POSIX_signals_Is_interested( api, mask ) ) { 4002964c: c4 02 21 30 ld [ %o0 + 0x130 ], %g2 40029650: c4 00 a0 dc ld [ %g2 + 0xdc ], %g2 40029654: 80 af 40 02 andncc %i5, %g2, %g0 40029658: 12 80 00 50 bne 40029798 4002965c: 03 10 00 c3 sethi %hi(0x40030c00), %g1 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_First( Chain_Control *the_chain ) { return _Chain_Head( the_chain )->next; 40029660: d0 00 62 58 ld [ %g1 + 0x258 ], %o0 ! 40030e58 <_POSIX_signals_Wait_queue> /* 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 ); 40029664: 05 10 00 c3 sethi %hi(0x40030c00), %g2 40029668: 84 10 a2 5c or %g2, 0x25c, %g2 ! 40030e5c <_POSIX_signals_Wait_queue+0x4> 4002966c: 80 a2 00 02 cmp %o0, %g2 40029670: 02 80 00 0c be 400296a0 40029674: 03 10 00 b8 sethi %hi(0x4002e000), %g1 #endif /* * Is this thread is actually blocked waiting for the signal? */ if (the_thread->Wait.option & mask) 40029678: c8 02 20 30 ld [ %o0 + 0x30 ], %g4 4002967c: 80 8f 40 04 btst %i5, %g4 40029680: 12 80 00 46 bne 40029798 40029684: c6 02 21 30 ld [ %o0 + 0x130 ], %g3 /* * Is this thread is blocked waiting for another signal but has * not blocked this one? */ if (~api->signals_blocked & mask) 40029688: c6 00 e0 dc ld [ %g3 + 0xdc ], %g3 4002968c: 80 af 40 03 andncc %i5, %g3, %g0 40029690: 12 80 00 43 bne 4002979c 40029694: 92 10 00 19 mov %i1, %o1 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 ) { 40029698: 10 bf ff f5 b 4002966c 4002969c: d0 02 00 00 ld [ %o0 ], %o0 * NOTES: * * + rtems internal threads do not receive signals. */ interested = NULL; interested_priority = PRIORITY_MAXIMUM + 1; 400296a0: c6 08 60 f8 ldub [ %g1 + 0xf8 ], %g3 * * NOTES: * * + rtems internal threads do not receive signals. */ interested = NULL; 400296a4: 90 10 20 00 clr %o0 interested_priority = PRIORITY_MAXIMUM + 1; 400296a8: 86 00 e0 01 inc %g3 for (the_api = OBJECTS_CLASSIC_API; the_api <= OBJECTS_APIS_LAST; the_api++) { 400296ac: b8 10 20 02 mov 2, %i4 /* * This can occur when no one is interested and an API is not configured. */ if ( !_Objects_Information_table[ the_api ] ) 400296b0: 19 10 00 c0 sethi %hi(0x40030000), %o4 */ RTEMS_INLINE_ROUTINE bool _States_Is_interruptible_by_signal ( States_Control the_states ) { return (the_states & STATES_INTERRUPTIBLE_BY_SIGNAL); 400296b4: 35 04 00 00 sethi %hi(0x10000000), %i2 400296b8: 85 2f 20 02 sll %i4, 2, %g2 400296bc: 88 13 23 60 or %o4, 0x360, %g4 400296c0: c4 01 00 02 ld [ %g4 + %g2 ], %g2 400296c4: 80 a0 a0 00 cmp %g2, 0 400296c8: 02 80 00 2d be 4002977c <== NEVER TAKEN 400296cc: b6 10 20 01 mov 1, %i3 continue; the_info = _Objects_Information_table[ the_api ][ 1 ]; 400296d0: c4 00 a0 04 ld [ %g2 + 4 ], %g2 */ if ( !the_info ) continue; #endif maximum = the_info->maximum; 400296d4: d6 10 a0 10 lduh [ %g2 + 0x10 ], %o3 object_table = the_info->local_table; 400296d8: d4 00 a0 1c ld [ %g2 + 0x1c ], %o2 for ( index = 1 ; index <= maximum ; index++ ) { 400296dc: 80 a6 c0 0b cmp %i3, %o3 400296e0: 18 80 00 27 bgu 4002977c 400296e4: 85 2e e0 02 sll %i3, 2, %g2 the_thread = (Thread_Control *) object_table[ index ]; 400296e8: c4 02 80 02 ld [ %o2 + %g2 ], %g2 if ( !the_thread ) 400296ec: 80 a0 a0 00 cmp %g2, 0 400296f0: 22 bf ff fb be,a 400296dc 400296f4: 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 ) 400296f8: c8 00 a0 14 ld [ %g2 + 0x14 ], %g4 400296fc: 80 a1 00 03 cmp %g4, %g3 40029700: 38 bf ff f7 bgu,a 400296dc 40029704: b6 06 e0 01 inc %i3 #if defined(RTEMS_DEBUG) if ( !api ) continue; #endif if ( !_POSIX_signals_Is_interested( api, mask ) ) 40029708: de 00 a1 30 ld [ %g2 + 0x130 ], %o7 4002970c: de 03 e0 dc ld [ %o7 + 0xdc ], %o7 40029710: 80 af 40 0f andncc %i5, %o7, %g0 40029714: 22 bf ff f2 be,a 400296dc 40029718: 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 ) { 4002971c: 80 a1 00 03 cmp %g4, %g3 40029720: 2a 80 00 14 bcs,a 40029770 40029724: 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 ) ) { 40029728: 80 a2 20 00 cmp %o0, 0 4002972c: 22 bf ff ec be,a 400296dc <== NEVER TAKEN 40029730: b6 06 e0 01 inc %i3 <== NOT EXECUTED 40029734: da 02 20 10 ld [ %o0 + 0x10 ], %o5 40029738: 80 a3 60 00 cmp %o5, 0 4002973c: 22 bf ff e8 be,a 400296dc <== NEVER TAKEN 40029740: b6 06 e0 01 inc %i3 <== NOT EXECUTED /* preferred ready over blocked */ DEBUG_STEP("5"); if ( _States_Is_ready( the_thread->current_state ) ) { 40029744: de 00 a0 10 ld [ %g2 + 0x10 ], %o7 40029748: 80 a3 e0 00 cmp %o7, 0 4002974c: 22 80 00 09 be,a 40029770 40029750: 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) ) { 40029754: 80 8b 40 1a btst %o5, %i2 40029758: 32 bf ff e1 bne,a 400296dc 4002975c: b6 06 e0 01 inc %i3 DEBUG_STEP("7"); if ( _States_Is_interruptible_by_signal(the_thread->current_state) ) { 40029760: 80 8b c0 1a btst %o7, %i2 40029764: 22 bf ff de be,a 400296dc 40029768: b6 06 e0 01 inc %i3 4002976c: 86 10 00 04 mov %g4, %g3 40029770: 90 10 00 02 mov %g2, %o0 #endif maximum = the_info->maximum; object_table = the_info->local_table; for ( index = 1 ; index <= maximum ; index++ ) { 40029774: 10 bf ff da b 400296dc 40029778: b6 06 e0 01 inc %i3 * + 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++) { 4002977c: b8 07 20 01 inc %i4 40029780: 80 a7 20 04 cmp %i4, 4 40029784: 12 bf ff ce bne 400296bc 40029788: 85 2f 20 02 sll %i4, 2, %g2 } } } } if ( interested ) { 4002978c: 80 a2 20 00 cmp %o0, 0 40029790: 02 80 00 0b be 400297bc 40029794: 01 00 00 00 nop /* * 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 ) ) { 40029798: 92 10 00 19 mov %i1, %o1 4002979c: 40 00 00 30 call 4002985c <_POSIX_signals_Unblock_thread> 400297a0: 94 07 bf f4 add %fp, -12, %o2 400297a4: 80 a2 20 00 cmp %o0, 0 400297a8: 02 80 00 05 be 400297bc 400297ac: 01 00 00 00 nop _Thread_Enable_dispatch(); 400297b0: 7f ff 92 83 call 4000e1bc <_Thread_Enable_dispatch> 400297b4: b0 10 20 00 clr %i0 ! 0 <_TLS_BSS_size> 400297b8: 30 80 00 1d b,a 4002982c /* * 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 ); 400297bc: 40 00 00 1e call 40029834 <_POSIX_signals_Set_process_signals> 400297c0: 90 10 00 1d mov %i5, %o0 if ( _POSIX_signals_Vectors[ sig ].sa_flags == SA_SIGINFO ) { 400297c4: b8 24 00 18 sub %l0, %i0, %i4 400297c8: c2 04 40 1c ld [ %l1 + %i4 ], %g1 400297cc: 80 a0 60 02 cmp %g1, 2 400297d0: 12 bf ff f8 bne 400297b0 400297d4: 11 10 00 c3 sethi %hi(0x40030c00), %o0 psiginfo = (POSIX_signals_Siginfo_node *) 400297d8: 7f ff 8a df call 4000c354 <_Chain_Get> 400297dc: 90 12 22 4c or %o0, 0x24c, %o0 ! 40030e4c <_POSIX_signals_Inactive_siginfo> _Chain_Get( &_POSIX_signals_Inactive_siginfo ); if ( !psiginfo ) { 400297e0: ba 92 20 00 orcc %o0, 0, %i5 400297e4: 12 80 00 08 bne 40029804 400297e8: 92 07 bf f4 add %fp, -12, %o1 _Thread_Enable_dispatch(); 400297ec: 7f ff 92 74 call 4000e1bc <_Thread_Enable_dispatch> 400297f0: 01 00 00 00 nop rtems_set_errno_and_return_minus_one( EAGAIN ); 400297f4: 7f ff b8 a6 call 40017a8c <__errno> 400297f8: 01 00 00 00 nop 400297fc: 10 bf ff 6c b 400295ac 40029800: 82 10 20 0b mov 0xb, %g1 ! b <_TLS_Alignment+0xa> } psiginfo->Info = *siginfo; 40029804: 90 07 60 08 add %i5, 8, %o0 40029808: 7f ff bf 77 call 400195e4 4002980c: 94 10 20 0c mov 0xc, %o2 _Chain_Append( &_POSIX_signals_Siginfo[ sig ], &psiginfo->Node ); 40029810: 11 10 00 c3 sethi %hi(0x40030c00), %o0 40029814: 92 10 00 1d mov %i5, %o1 40029818: 90 12 22 9c or %o0, 0x29c, %o0 4002981c: 7f ff 8a c2 call 4000c324 <_Chain_Append> 40029820: 90 02 00 1c add %o0, %i4, %o0 40029824: 30 bf ff e3 b,a 400297b0 /* * If the signal is being ignored, then we are out of here. */ if ( _POSIX_signals_Vectors[ sig ].sa_handler == SIG_IGN ) return 0; 40029828: b0 10 20 00 clr %i0 } DEBUG_STEP("\n"); _Thread_Enable_dispatch(); return 0; } 4002982c: 81 c7 e0 08 ret 40029830: 81 e8 00 00 restore =============================================================================== 40003b60 : #include void *malloc( size_t size ) { 40003b60: 9d e3 bf a0 save %sp, -96, %sp void *return_this; MSBUMP(malloc_calls, 1); 40003b64: 03 10 00 60 sethi %hi(0x40018000), %g1 40003b68: 82 10 63 40 or %g1, 0x340, %g1 ! 40018340 40003b6c: c4 00 60 04 ld [ %g1 + 4 ], %g2 40003b70: 84 00 a0 01 inc %g2 /* * If some free's have been deferred, then do them now. */ malloc_deferred_frees_process(); 40003b74: 7f ff ff ba call 40003a5c 40003b78: c4 20 60 04 st %g2, [ %g1 + 4 ] /* * Validate the parameters */ if ( !size ) 40003b7c: 80 a6 20 00 cmp %i0, 0 40003b80: 02 80 00 22 be 40003c08 40003b84: 03 10 00 62 sethi %hi(0x40018800), %g1 return (void *) 0; /* * Do not attempt to allocate memory if not in correct system state. */ if ( _System_state_Is_up(_System_state_Get()) && 40003b88: c2 00 60 f4 ld [ %g1 + 0xf4 ], %g1 ! 400188f4 <_System_state_Current> 40003b8c: 80 a0 60 02 cmp %g1, 2 40003b90: 02 80 00 0c be 40003bc0 40003b94: 39 10 00 5a sethi %hi(0x40016800), %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 ); 40003b98: d0 07 23 28 ld [ %i4 + 0x328 ], %o0 ! 40016b28 40003b9c: 92 10 00 18 mov %i0, %o1 40003ba0: 94 10 20 00 clr %o2 40003ba4: 40 00 15 da call 4000930c <_Protected_heap_Allocate_aligned_with_boundary> 40003ba8: 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 ) { 40003bac: ba 92 20 00 orcc %o0, 0, %i5 40003bb0: 12 80 00 18 bne 40003c10 40003bb4: 03 10 00 5c sethi %hi(0x40017000), %g1 return_this = (*rtems_malloc_extend_handler)( RTEMS_Malloc_Heap, size ); 40003bb8: 10 80 00 09 b 40003bdc 40003bbc: d0 07 23 28 ld [ %i4 + 0x328 ], %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() ) 40003bc0: 7f ff ff a3 call 40003a4c 40003bc4: 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()) && 40003bc8: 80 a2 20 00 cmp %o0, 0 40003bcc: 12 bf ff f3 bne 40003b98 <== ALWAYS TAKEN 40003bd0: 01 00 00 00 nop if ( !return_this ) { return_this = (*rtems_malloc_extend_handler)( RTEMS_Malloc_Heap, size ); if ( !return_this ) { errno = ENOMEM; return (void *) 0; 40003bd4: 81 c7 e0 08 ret <== NOT EXECUTED 40003bd8: 91 e8 20 00 restore %g0, 0, %o0 <== NOT EXECUTED */ return_this = _Protected_heap_Allocate( RTEMS_Malloc_Heap, size ); if ( !return_this ) { return_this = (*rtems_malloc_extend_handler)( RTEMS_Malloc_Heap, size ); 40003bdc: 03 10 00 55 sethi %hi(0x40015400), %g1 40003be0: c2 00 62 64 ld [ %g1 + 0x264 ], %g1 ! 40015664 40003be4: 9f c0 40 00 call %g1 40003be8: 92 10 00 18 mov %i0, %o1 if ( !return_this ) { 40003bec: ba 92 20 00 orcc %o0, 0, %i5 40003bf0: 12 80 00 08 bne 40003c10 40003bf4: 03 10 00 5c sethi %hi(0x40017000), %g1 errno = ENOMEM; 40003bf8: 40 00 2f 8a call 4000fa20 <__errno> 40003bfc: 01 00 00 00 nop 40003c00: 82 10 20 0c mov 0xc, %g1 ! c <_TLS_Alignment+0xb> 40003c04: c2 22 00 00 st %g1, [ %o0 ] return (void *) 0; 40003c08: 81 c7 e0 08 ret 40003c0c: 91 e8 20 00 restore %g0, 0, %o0 } /* * If the user wants us to dirty the allocated memory, then do it. */ if ( rtems_malloc_dirty_helper ) 40003c10: c2 00 60 b8 ld [ %g1 + 0xb8 ], %g1 40003c14: 80 a0 60 00 cmp %g1, 0 40003c18: 02 80 00 04 be 40003c28 40003c1c: 90 10 00 1d mov %i5, %o0 (*rtems_malloc_dirty_helper)( return_this, size ); 40003c20: 9f c0 40 00 call %g1 40003c24: 92 10 00 18 mov %i0, %o1 /* * If configured, update the statistics */ if ( rtems_malloc_statistics_helpers ) 40003c28: 03 10 00 5c sethi %hi(0x40017000), %g1 40003c2c: c2 00 60 bc ld [ %g1 + 0xbc ], %g1 ! 400170bc 40003c30: 80 a0 60 00 cmp %g1, 0 40003c34: 02 80 00 05 be 40003c48 40003c38: b0 10 00 1d mov %i5, %i0 (*rtems_malloc_statistics_helpers->at_malloc)(return_this); 40003c3c: c2 00 60 04 ld [ %g1 + 4 ], %g1 40003c40: 9f c0 40 00 call %g1 40003c44: 90 10 00 1d mov %i5, %o0 return return_this; } 40003c48: 81 c7 e0 08 ret 40003c4c: 81 e8 00 00 restore =============================================================================== 4000e234 : int memfile_ftruncate( rtems_libio_t *iop, off_t length ) { 4000e234: 9d e3 bf 98 save %sp, -104, %sp IMFS_jnode_t *the_jnode; the_jnode = iop->pathinfo.node_access; 4000e238: fa 06 20 1c ld [ %i0 + 0x1c ], %i5 * 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 ) 4000e23c: c2 07 60 50 ld [ %i5 + 0x50 ], %g1 4000e240: 80 a0 40 19 cmp %g1, %i1 4000e244: 06 80 00 09 bl 4000e268 <== NEVER TAKEN 4000e248: 90 10 00 1d mov %i5, %o0 4000e24c: 32 80 00 0d bne,a 4000e280 <== NEVER TAKEN 4000e250: f2 27 60 50 st %i1, [ %i5 + 0x50 ] <== NOT EXECUTED 4000e254: c2 07 60 54 ld [ %i5 + 0x54 ], %g1 4000e258: 80 a0 40 1a cmp %g1, %i2 4000e25c: 3a 80 00 09 bcc,a 4000e280 4000e260: f2 27 60 50 st %i1, [ %i5 + 0x50 ] return IMFS_memfile_extend( the_jnode, true, length ); 4000e264: 90 10 00 1d mov %i5, %o0 4000e268: 92 10 20 01 mov 1, %o1 4000e26c: 94 10 00 19 mov %i1, %o2 4000e270: 7f ff ff 8b call 4000e09c 4000e274: 96 10 00 1a mov %i2, %o3 4000e278: 81 c7 e0 08 ret 4000e27c: 91 e8 00 08 restore %g0, %o0, %o0 /* * 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; 4000e280: f4 27 60 54 st %i2, [ %i5 + 0x54 ] static inline void IMFS_mtime_ctime_update( IMFS_jnode_t *jnode ) { struct timeval now; gettimeofday( &now, 0 ); 4000e284: 90 07 bf f8 add %fp, -8, %o0 4000e288: 7f ff d5 8b call 400038b4 4000e28c: 92 10 20 00 clr %o1 jnode->stat_mtime = now.tv_sec; 4000e290: c2 07 bf f8 ld [ %fp + -8 ], %g1 4000e294: c2 27 60 44 st %g1, [ %i5 + 0x44 ] jnode->stat_ctime = now.tv_sec; 4000e298: c2 27 60 48 st %g1, [ %i5 + 0x48 ] IMFS_mtime_ctime_update(the_jnode); return 0; } 4000e29c: 81 c7 e0 08 ret 4000e2a0: 91 e8 20 00 restore %g0, 0, %o0 =============================================================================== 4000e470 : rtems_libio_t *iop, const char *pathname, int oflag, mode_t mode ) { 4000e470: 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) 4000e474: c2 06 20 10 ld [ %i0 + 0x10 ], %g1 4000e478: 80 88 60 04 btst 4, %g1 4000e47c: 12 80 00 04 bne 4000e48c 4000e480: d0 06 20 1c ld [ %i0 + 0x1c ], %o0 if ((count != 0) && (IMFS_memfile_write(the_jnode, 0, buffer, count) == -1)) return -1; } return 0; 4000e484: 81 c7 e0 08 ret 4000e488: 91 e8 20 00 restore %g0, 0, %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; 4000e48c: 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)) { 4000e490: c2 00 40 00 ld [ %g1 ], %g1 4000e494: 80 a0 60 05 cmp %g1, 5 4000e498: 12 bf ff fb bne 4000e484 <== ALWAYS TAKEN 4000e49c: 03 10 00 58 sethi %hi(0x40016000), %g1 uint32_t count = the_jnode->info.linearfile.size; 4000e4a0: d8 02 20 54 ld [ %o0 + 0x54 ], %o4 <== NOT EXECUTED const unsigned char *buffer = the_jnode->info.linearfile.direct; 4000e4a4: d6 02 20 58 ld [ %o0 + 0x58 ], %o3 <== NOT EXECUTED the_jnode->control = &IMFS_node_control_memfile; the_jnode->info.file.size = 0; 4000e4a8: 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; 4000e4ac: 82 10 62 2c or %g1, 0x22c, %g1 <== NOT EXECUTED the_jnode->info.file.size = 0; 4000e4b0: 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; 4000e4b4: c2 22 20 4c st %g1, [ %o0 + 0x4c ] <== NOT EXECUTED the_jnode->info.file.size = 0; the_jnode->info.file.indirect = 0; 4000e4b8: c0 22 20 58 clr [ %o0 + 0x58 ] <== NOT EXECUTED the_jnode->info.file.doubly_indirect = 0; 4000e4bc: c0 22 20 5c clr [ %o0 + 0x5c ] <== NOT EXECUTED the_jnode->info.file.triply_indirect = 0; if ((count != 0) 4000e4c0: 80 a3 20 00 cmp %o4, 0 <== NOT EXECUTED 4000e4c4: 02 bf ff f0 be 4000e484 <== NOT EXECUTED 4000e4c8: c0 22 20 60 clr [ %o0 + 0x60 ] <== NOT EXECUTED && (IMFS_memfile_write(the_jnode, 0, buffer, count) == -1)) 4000e4cc: 92 10 20 00 clr %o1 <== NOT EXECUTED 4000e4d0: 7f ff ff 75 call 4000e2a4 <== NOT EXECUTED 4000e4d4: 94 10 20 00 clr %o2 <== NOT EXECUTED 4000e4d8: 90 38 00 08 xnor %g0, %o0, %o0 <== NOT EXECUTED 4000e4dc: 80 a0 00 08 cmp %g0, %o0 <== NOT EXECUTED 4000e4e0: b0 40 3f ff addx %g0, -1, %i0 <== NOT EXECUTED return -1; } return 0; } 4000e4e4: 81 c7 e0 08 ret <== NOT EXECUTED 4000e4e8: 81 e8 00 00 restore <== NOT EXECUTED =============================================================================== 40003d70 : const char *target, const char *filesystemtype, rtems_filesystem_options_t options, const void *data ) { 40003d70: 9d e3 bf 50 save %sp, -176, %sp int rv = 0; if ( 40003d74: 80 a6 e0 01 cmp %i3, 1 40003d78: 18 80 00 b3 bgu 40004044 40003d7c: 01 00 00 00 nop options == RTEMS_FILESYSTEM_READ_ONLY || options == RTEMS_FILESYSTEM_READ_WRITE ) { rtems_filesystem_fsmount_me_t fsmount_me_h = 40003d80: 40 00 21 7d call 4000c374 40003d84: 90 10 00 1a mov %i2, %o0 rtems_filesystem_get_mount_handler( filesystemtype ); if ( fsmount_me_h != NULL ) { 40003d88: a4 92 20 00 orcc %o0, 0, %l2 40003d8c: 02 80 00 ae be 40004044 40003d90: 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 : "/"; 40003d94: 12 80 00 04 bne 40003da4 40003d98: 01 00 00 00 nop 40003d9c: 23 10 00 56 sethi %hi(0x40015800), %l1 40003da0: a2 14 62 58 or %l1, 0x258, %l1 ! 40015a58 size_t filesystemtype_size = strlen( filesystemtype ) + 1; 40003da4: 40 00 32 7f call 400107a0 40003da8: 90 10 00 1a mov %i2, %o0 size_t source_size = source_or_null != NULL ? strlen( source_or_null ) + 1 : 0; 40003dac: 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; 40003db0: ba 10 00 08 mov %o0, %i5 size_t source_size = source_or_null != NULL ? strlen( source_or_null ) + 1 : 0; 40003db4: 02 80 00 06 be 40003dcc 40003db8: aa 02 20 01 add %o0, 1, %l5 40003dbc: 40 00 32 79 call 400107a0 40003dc0: 90 10 00 18 mov %i0, %o0 40003dc4: 10 80 00 03 b 40003dd0 40003dc8: a0 02 20 01 add %o0, 1, %l0 40003dcc: 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 40003dd0: 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; 40003dd4: 40 00 32 73 call 400107a0 40003dd8: 90 10 00 11 mov %l1, %o0 size_t size = sizeof( rtems_filesystem_mount_table_entry_t ) + filesystemtype_size + source_size + target_size 40003ddc: 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; 40003de0: a8 02 20 01 add %o0, 1, %l4 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 ); 40003de4: 90 10 20 01 mov 1, %o0 40003de8: 7f ff fe 74 call 400037b8 40003dec: 92 02 40 14 add %o1, %l4, %o1 if ( mt_entry != NULL ) { 40003df0: ba 92 20 00 orcc %o0, 0, %i5 40003df4: 02 80 00 9c be 40004064 <== NEVER TAKEN 40003df8: 82 07 60 64 add %i5, 0x64, %g1 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 ); 40003dfc: 92 10 00 1a mov %i2, %o1 40003e00: 90 10 00 01 mov %g1, %o0 40003e04: 40 00 30 ed call 400101b8 40003e08: 94 10 00 15 mov %l5, %o2 mt_entry->type = str; 40003e0c: d0 27 60 34 st %o0, [ %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 = 40003e10: a6 07 60 40 add %i5, 0x40, %l3 memcpy( str, filesystemtype, filesystemtype_size ); mt_entry->type = str; str += filesystemtype_size; if ( source_or_null != NULL ) { 40003e14: 80 a6 20 00 cmp %i0, 0 40003e18: 02 80 00 08 be 40003e38 40003e1c: 82 02 00 15 add %o0, %l5, %g1 memcpy( str, source_or_null, source_size ); 40003e20: 90 10 00 01 mov %g1, %o0 40003e24: 92 10 00 18 mov %i0, %o1 40003e28: 40 00 30 e4 call 400101b8 40003e2c: 94 10 00 10 mov %l0, %o2 mt_entry->dev = str; 40003e30: d0 27 60 38 st %o0, [ %i5 + 0x38 ] str += source_size; 40003e34: 82 02 00 10 add %o0, %l0, %g1 } memcpy( str, target, target_size ); 40003e38: 90 10 00 01 mov %g1, %o0 40003e3c: 92 10 00 11 mov %l1, %o1 40003e40: 40 00 30 de call 400101b8 40003e44: 94 10 00 14 mov %l4, %o2 mt_entry->target = str; str += target_size; mt_entry->mounted = true; 40003e48: 82 10 20 01 mov 1, %g1 40003e4c: 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; 40003e50: 03 10 00 56 sethi %hi(0x40015800), %g1 40003e54: 82 10 62 5c or %g1, 0x25c, %g1 ! 40015a5c 40003e58: c2 27 60 2c st %g1, [ %i5 + 0x2c ] mt_fs_root->location.mt_entry = mt_entry; mt_fs_root->reference_count = 1; 40003e5c: 82 10 20 01 mov 1, %g1 mt_entry->dev = str; str += source_size; } memcpy( str, target, target_size ); mt_entry->target = str; 40003e60: d0 27 60 30 st %o0, [ %i5 + 0x30 ] mt_entry->mounted = true; mt_entry->mt_fs_root = mt_fs_root; mt_entry->pathconf_limits_and_options = &rtems_filesystem_default_pathconf; mt_fs_root->location.mt_entry = mt_entry; mt_fs_root->reference_count = 1; 40003e64: c2 27 60 58 st %g1, [ %i5 + 0x58 ] void *starting_address, size_t number_nodes, size_t node_size ) { _Chain_Initialize( 40003e68: 90 07 60 14 add %i5, 0x14, %o0 40003e6c: 92 10 00 13 mov %l3, %o1 40003e70: 94 10 20 01 mov 1, %o2 40003e74: 96 10 20 24 mov 0x24, %o3 memcpy( str, target, target_size ); mt_entry->target = str; str += target_size; mt_entry->mounted = true; mt_entry->mt_fs_root = mt_fs_root; 40003e78: e6 27 60 24 st %l3, [ %i5 + 0x24 ] 40003e7c: 40 00 10 a3 call 40008108 <_Chain_Initialize> 40003e80: fa 27 60 54 st %i5, [ %i5 + 0x54 ] filesystemtype, &target_length ); if ( mt_entry != NULL ) { mt_entry->writeable = options == RTEMS_FILESYSTEM_READ_WRITE; 40003e84: b6 0e e0 01 and %i3, 1, %i3 rv = (*fsmount_me_h)( mt_entry, data ); 40003e88: 90 10 00 1d mov %i5, %o0 filesystemtype, &target_length ); if ( mt_entry != NULL ) { mt_entry->writeable = options == RTEMS_FILESYSTEM_READ_WRITE; 40003e8c: f6 2f 60 29 stb %i3, [ %i5 + 0x29 ] rv = (*fsmount_me_h)( mt_entry, data ); 40003e90: 9f c4 80 00 call %l2 40003e94: 92 10 00 1c mov %i4, %o1 if ( rv == 0 ) { 40003e98: b0 92 20 00 orcc %o0, 0, %i0 40003e9c: 12 80 00 6e bne 40004054 40003ea0: 80 a6 60 00 cmp %i1, 0 if ( target != NULL ) { 40003ea4: 02 80 00 38 be 40003f84 40003ea8: 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 = 40003eac: 94 10 20 1f mov 0x1f, %o2 40003eb0: 40 00 02 1c call 40004720 40003eb4: 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; 40003eb8: c2 02 20 14 ld [ %o0 + 0x14 ], %g1 return (*mt_entry->ops->are_nodes_equal_h)( 40003ebc: c4 00 60 0c ld [ %g1 + 0xc ], %g2 40003ec0: c4 00 a0 10 ld [ %g2 + 0x10 ], %g2 40003ec4: 9f c0 80 00 call %g2 40003ec8: 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 ) ) { 40003ecc: 80 a2 20 00 cmp %o0, 0 40003ed0: 12 80 00 22 bne 40003f58 40003ed4: 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( 40003ed8: 40 00 03 3f call 40004bd4 40003edc: 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 ); 40003ee0: 40 00 03 47 call 40004bfc 40003ee4: 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 ); 40003ee8: 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; 40003eec: d0 27 60 20 st %o0, [ %i5 + 0x20 ] rv = (*mt_point_node->location.mt_entry->ops->mount_h)( mt_entry ); 40003ef0: 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 ); 40003ef4: 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 ); 40003ef8: c2 00 60 30 ld [ %g1 + 0x30 ], %g1 40003efc: 9f c0 40 00 call %g1 40003f00: 90 10 00 1d mov %i5, %o0 if ( rv == 0 ) { 40003f04: b0 92 20 00 orcc %o0, 0, %i0 40003f08: 12 80 00 11 bne 40003f4c 40003f0c: 92 10 20 00 clr %o1 extern pthread_key_t rtems_current_user_env_key; static inline void rtems_libio_lock( void ) { rtems_semaphore_obtain( rtems_libio_semaphore, RTEMS_WAIT, RTEMS_NO_TIMEOUT ); 40003f10: 39 10 00 60 sethi %hi(0x40018000), %i4 40003f14: d0 07 23 38 ld [ %i4 + 0x338 ], %o0 ! 40018338 40003f18: 40 00 0d d2 call 40007660 40003f1c: 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; 40003f20: 03 10 00 5a sethi %hi(0x40016800), %g1 40003f24: 82 10 63 4c or %g1, 0x34c, %g1 ! 40016b4c 40003f28: c4 00 60 08 ld [ %g1 + 8 ], %g2 the_node->next = tail; 40003f2c: 86 00 60 04 add %g1, 4, %g3 tail->previous = the_node; 40003f30: fa 20 60 08 st %i5, [ %g1 + 8 ] ) { Chain_Node *tail = _Chain_Tail( the_chain ); Chain_Node *old_last = tail->previous; the_node->next = tail; 40003f34: c6 27 40 00 st %g3, [ %i5 ] } static inline void rtems_libio_unlock( void ) { rtems_semaphore_release( rtems_libio_semaphore ); 40003f38: d0 07 23 38 ld [ %i4 + 0x338 ], %o0 tail->previous = the_node; old_last->next = the_node; 40003f3c: fa 20 80 00 st %i5, [ %g2 ] 40003f40: 40 00 0e 10 call 40007780 40003f44: c4 27 60 04 st %g2, [ %i5 + 4 ] 40003f48: 30 80 00 08 b,a 40003f68 &rtems_filesystem_mount_table, &mt_entry->mt_node ); rtems_filesystem_mt_unlock(); } else { rtems_filesystem_global_location_release( mt_point_node ); 40003f4c: 40 00 02 f0 call 40004b0c 40003f50: 90 10 00 1c mov %i4, %o0 40003f54: 30 80 00 05 b,a 40003f68 } } else { rtems_filesystem_eval_path_error( &ctx, EBUSY ); 40003f58: 90 07 bf c8 add %fp, -56, %o0 40003f5c: 92 10 20 10 mov 0x10, %o1 40003f60: 40 00 01 81 call 40004564 40003f64: b0 10 3f ff mov -1, %i0 rv = -1; } rtems_filesystem_eval_path_cleanup( &ctx ); 40003f68: 40 00 01 f6 call 40004740 40003f6c: 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 ) { 40003f70: 80 a6 20 00 cmp %i0, 0 40003f74: 02 80 00 41 be 40004078 40003f78: 01 00 00 00 nop (*mt_entry->ops->fsunmount_me_h)( mt_entry ); 40003f7c: 10 80 00 2e b 40004034 40003f80: c2 07 60 0c ld [ %i5 + 0xc ], %g1 extern pthread_key_t rtems_current_user_env_key; static inline void rtems_libio_lock( void ) { rtems_semaphore_obtain( rtems_libio_semaphore, RTEMS_WAIT, RTEMS_NO_TIMEOUT ); 40003f84: 39 10 00 60 sethi %hi(0x40018000), %i4 40003f88: d0 07 23 38 ld [ %i4 + 0x338 ], %o0 ! 40018338 40003f8c: 92 10 20 00 clr %o1 40003f90: 40 00 0d b4 call 40007660 40003f94: 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; 40003f98: 05 10 00 5a sethi %hi(0x40016800), %g2 ) { int rv = 0; rtems_filesystem_mt_lock(); if ( rtems_chain_is_empty( &rtems_filesystem_mount_table ) ) { 40003f9c: c6 00 a3 4c ld [ %g2 + 0x34c ], %g3 ! 40016b4c 40003fa0: 82 10 a3 4c or %g2, 0x34c, %g1 40003fa4: 84 00 60 04 add %g1, 4, %g2 40003fa8: 80 a0 c0 02 cmp %g3, %g2 40003fac: 12 80 00 08 bne 40003fcc <== NEVER TAKEN 40003fb0: 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; 40003fb4: c4 00 60 08 ld [ %g1 + 8 ], %g2 the_node->next = tail; 40003fb8: c6 27 40 00 st %g3, [ %i5 ] tail->previous = the_node; 40003fbc: fa 20 60 08 st %i5, [ %g1 + 8 ] old_last->next = the_node; 40003fc0: fa 20 80 00 st %i5, [ %g2 ] the_node->previous = old_last; 40003fc4: 10 80 00 06 b 40003fdc 40003fc8: c4 27 60 04 st %g2, [ %i5 + 4 ] rtems_chain_append_unprotected( &rtems_filesystem_mount_table, &mt_entry->mt_node ); } else { errno = EINVAL; 40003fcc: 40 00 2e 95 call 4000fa20 <__errno> <== NOT EXECUTED 40003fd0: b0 10 3f ff mov -1, %i0 <== NOT EXECUTED 40003fd4: 82 10 20 16 mov 0x16, %g1 <== NOT EXECUTED 40003fd8: c2 22 00 00 st %g1, [ %o0 ] <== NOT EXECUTED } static inline void rtems_libio_unlock( void ) { rtems_semaphore_release( rtems_libio_semaphore ); 40003fdc: 40 00 0d e9 call 40007780 40003fe0: d0 07 23 38 ld [ %i4 + 0x338 ], %o0 rv = -1; } rtems_filesystem_mt_unlock(); if ( rv == 0 ) { 40003fe4: 80 a6 20 00 cmp %i0, 0 40003fe8: 32 80 00 13 bne,a 40004034 <== NEVER TAKEN 40003fec: 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 ); 40003ff0: 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 = 40003ff4: 40 00 02 94 call 40004a44 40003ff8: 90 10 00 1d mov %i5, %o0 40003ffc: b8 10 00 08 mov %o0, %i4 rtems_filesystem_global_location_obtain( &mt_entry->mt_fs_root ); rtems_filesystem_global_location_t *new_fs_current = 40004000: 40 00 02 91 call 40004a44 40004004: 90 10 00 1d mov %i5, %o0 rtems_filesystem_global_location_obtain( &mt_entry->mt_fs_root ); rtems_filesystem_global_location_assign( &rtems_filesystem_root, 40004008: 40 00 01 03 call 40004414 4000400c: ba 10 00 08 mov %o0, %i5 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 = rtems_filesystem_global_location_obtain( &mt_entry->mt_fs_root ); rtems_filesystem_global_location_assign( 40004010: 92 10 00 1c mov %i4, %o1 40004014: 40 00 02 d2 call 40004b5c 40004018: 90 02 20 04 add %o0, 4, %o0 &rtems_filesystem_root, new_fs_root ); rtems_filesystem_global_location_assign( &rtems_filesystem_current, 4000401c: 40 00 00 fe call 40004414 40004020: 01 00 00 00 nop rtems_filesystem_global_location_assign( &rtems_filesystem_root, new_fs_root ); rtems_filesystem_global_location_assign( 40004024: 40 00 02 ce call 40004b5c 40004028: 92 10 00 1d mov %i5, %o1 4000402c: 81 c7 e0 08 ret 40004030: 81 e8 00 00 restore } else { rv = register_root_file_system( mt_entry ); } if ( rv != 0 ) { (*mt_entry->ops->fsunmount_me_h)( mt_entry ); 40004034: c2 00 60 3c ld [ %g1 + 0x3c ], %g1 40004038: 9f c0 40 00 call %g1 4000403c: 90 10 00 1d mov %i5, %o0 40004040: 30 80 00 05 b,a 40004054 } else { errno = EINVAL; rv = -1; } } else { errno = EINVAL; 40004044: 40 00 2e 77 call 4000fa20 <__errno> 40004048: 01 00 00 00 nop 4000404c: 10 80 00 09 b 40004070 40004050: 82 10 20 16 mov 0x16, %g1 ! 16 <_TLS_Alignment+0x15> (*mt_entry->ops->fsunmount_me_h)( mt_entry ); } } if ( rv != 0 ) { free( mt_entry ); 40004054: 7f ff fd ee call 4000380c 40004058: 90 10 00 1d mov %i5, %o0 4000405c: 81 c7 e0 08 ret 40004060: 81 e8 00 00 restore } } else { errno = ENOMEM; 40004064: 40 00 2e 6f call 4000fa20 <__errno> <== NOT EXECUTED 40004068: 01 00 00 00 nop <== NOT EXECUTED 4000406c: 82 10 20 0c mov 0xc, %g1 ! c <_TLS_Alignment+0xb> <== NOT EXECUTED 40004070: c2 22 00 00 st %g1, [ %o0 ] rv = -1; 40004074: b0 10 3f ff mov -1, %i0 errno = EINVAL; rv = -1; } return rv; } 40004078: 81 c7 e0 08 ret 4000407c: 81 e8 00 00 restore =============================================================================== 40008774 : const char *target, const char *filesystemtype, rtems_filesystem_options_t options, const void *data ) { 40008774: 9d e3 bf a0 save %sp, -96, %sp int rv = -1; if (target != NULL) { 40008778: 90 96 60 00 orcc %i1, 0, %o0 4000877c: 02 80 00 09 be 400087a0 40008780: 01 00 00 00 nop rv = rtems_mkdir(target, S_IRWXU | S_IRWXG | S_IRWXO); 40008784: 40 00 02 6e call 4000913c 40008788: 92 10 21 ff mov 0x1ff, %o1 ! 1ff <_TLS_Alignment+0x1fe> if (rv == 0) { 4000878c: 80 a2 20 00 cmp %o0, 0 40008790: 12 80 00 09 bne 400087b4 <== NEVER TAKEN 40008794: 01 00 00 00 nop rv = mount( 40008798: 40 00 00 09 call 400087bc 4000879c: 81 e8 00 00 restore options, data ); } } else { errno = EINVAL; 400087a0: 40 00 61 bf call 40020e9c <__errno> 400087a4: 01 00 00 00 nop 400087a8: 82 10 20 16 mov 0x16, %g1 ! 16 <_TLS_Alignment+0x15> 400087ac: c2 22 00 00 st %g1, [ %o0 ] const char *filesystemtype, rtems_filesystem_options_t options, const void *data ) { int rv = -1; 400087b0: 90 10 3f ff mov -1, %o0 } else { errno = EINVAL; } return rv; } 400087b4: 81 c7 e0 08 ret 400087b8: 91 e8 00 08 restore %g0, %o0, %o0 =============================================================================== 400182dc : const uint8_t *entry, const size_t entry_size, const uint8_t *filename, const size_t filename_size_remaining, bool *is_matching) { 400182dc: 9d e3 bf 28 save %sp, -216, %sp ssize_t size_remaining = filename_size_remaining; int eno = 0; uint8_t entry_normalized[MSDOS_LFN_ENTRY_SIZE_UTF8]; size_t bytes_in_entry_normalized = sizeof ( entry_normalized ); 400182e0: 82 10 20 70 mov 0x70, %g1 400182e4: c2 27 bf 8c st %g1, [ %fp + -116 ] eno = (*converter->handler->utf8_normalize_and_fold) ( 400182e8: c2 06 00 00 ld [ %i0 ], %g1 400182ec: 94 10 00 1a mov %i2, %o2 400182f0: c2 00 60 10 ld [ %g1 + 0x10 ], %g1 400182f4: 90 10 00 18 mov %i0, %o0 400182f8: 92 10 00 19 mov %i1, %o1 400182fc: 96 07 bf 90 add %fp, -112, %o3 40018300: 9f c0 40 00 call %g1 40018304: 98 07 bf 8c add %fp, -116, %o4 converter, &entry[0], entry_size, &entry_normalized[0], &bytes_in_entry_normalized); if (eno == 0) { 40018308: b4 92 20 00 orcc %o0, 0, %i2 4001830c: 12 80 00 10 bne 4001834c <== NEVER TAKEN 40018310: d4 07 bf 8c ld [ %fp + -116 ], %o2 printf ( "MSFS:[6] entry_normalized:%s" "name:%s\n", entry, filename ); #endif if (bytes_in_entry_normalized <= size_remaining) { 40018314: 80 a2 80 1c cmp %o2, %i4 40018318: 38 80 00 10 bgu,a 40018358 4001831c: c0 2f 40 00 clrb [ %i5 ] size_remaining = size_remaining - bytes_in_entry_normalized; 40018320: b4 27 00 0a sub %i4, %o2, %i2 if (0 == memcmp ( &entry_normalized[0], 40018324: 90 07 bf 90 add %fp, -112, %o0 40018328: 40 00 12 84 call 4001cd38 4001832c: 92 06 c0 1a add %i3, %i2, %o1 40018330: 80 a2 20 00 cmp %o0, 0 40018334: 32 80 00 09 bne,a 40018358 40018338: c0 2f 40 00 clrb [ %i5 ] &filename[size_remaining], bytes_in_entry_normalized)) { *is_matching = true; 4001833c: 82 10 20 01 mov 1, %g1 "name:%s\n", entry, filename ); #endif if (bytes_in_entry_normalized <= size_remaining) { size_remaining = size_remaining - bytes_in_entry_normalized; 40018340: b8 10 00 1a mov %i2, %i4 40018344: 10 80 00 05 b 40018358 40018348: c2 2f 40 00 stb %g1, [ %i5 ] } } if (eno != 0) { size_remaining = -1; errno = eno; 4001834c: 40 00 10 50 call 4001c48c <__errno> <== NOT EXECUTED 40018350: b8 10 3f ff mov -1, %i4 <== NOT EXECUTED 40018354: f4 22 00 00 st %i2, [ %o0 ] <== NOT EXECUTED } return size_remaining; } 40018358: 81 c7 e0 08 ret 4001835c: 91 e8 00 1c restore %g0, %i4, %o0 =============================================================================== 40017d70 : msdos_node_type_t type, const char *name, int name_len, mode_t mode, const fat_file_fd_t *link_fd) { 40017d70: 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; 40017d74: 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); 40017d78: 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; 40017d7c: 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; 40017d80: 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); 40017d84: 94 10 20 20 mov 0x20, %o2 40017d88: c2 27 bf 78 st %g1, [ %fp + -136 ] dir_pos->lname.ofs = FAT_FILE_SHORT_NAME; 40017d8c: 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; 40017d90: e2 06 20 08 ld [ %i0 + 8 ], %l1 fat_file_fd_t *fat_fd = NULL; 40017d94: c0 27 bf 6c clr [ %fp + -148 ] time_t time_ret = 0; uint16_t time_val = 0; 40017d98: c0 37 bf 68 clrh [ %fp + -152 ] uint16_t date = 0; 40017d9c: 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; 40017da0: c0 27 bf 70 clr [ %fp + -144 ] dir_pos->sname.ofs = 0; 40017da4: 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); 40017da8: a4 07 bf 80 add %fp, -128, %l2 40017dac: 40 00 14 4c call 4001cedc 40017db0: 90 10 00 12 mov %l2, %o0 memset(dot_dotdot, 0, MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE * 2); 40017db4: 90 07 bf c0 add %fp, -64, %o0 40017db8: 92 10 20 00 clr %o1 40017dbc: 40 00 14 48 call 4001cedc 40017dc0: 94 10 20 40 mov 0x40, %o2 if (name_len > MSDOS_NAME_MAX_LFN_WITH_DOT) { 40017dc4: 80 a6 e1 04 cmp %i3, 0x104 40017dc8: 04 80 00 06 ble 40017de0 <== ALWAYS TAKEN 40017dcc: a0 10 00 18 mov %i0, %l0 rtems_set_errno_and_return_minus_one(ENAMETOOLONG); 40017dd0: 40 00 11 af call 4001c48c <__errno> <== NOT EXECUTED 40017dd4: 01 00 00 00 nop <== NOT EXECUTED 40017dd8: 10 80 00 0e b 40017e10 <== NOT EXECUTED 40017ddc: 82 10 20 5b mov 0x5b, %g1 ! 5b <_TLS_Alignment+0x5a> <== NOT EXECUTED } name_type = msdos_long_to_short (fs_info->converter, 40017de0: d0 07 20 a4 ld [ %i4 + 0xa4 ], %o0 40017de4: 92 10 00 1a mov %i2, %o1 40017de8: 94 10 00 1b mov %i3, %o2 40017dec: 96 10 00 12 mov %l2, %o3 40017df0: 40 00 01 87 call 4001840c 40017df4: 98 10 20 0b mov 0xb, %o4 name, name_len, MSDOS_DIR_NAME(short_node), MSDOS_NAME_MAX); if (name_type == MSDOS_NAME_INVALID) { 40017df8: b0 92 20 00 orcc %o0, 0, %i0 40017dfc: 32 80 00 08 bne,a 40017e1c <== ALWAYS TAKEN 40017e00: c0 2f bf 8c clrb [ %fp + -116 ] rtems_set_errno_and_return_minus_one(EINVAL); 40017e04: 40 00 11 a2 call 4001c48c <__errno> <== NOT EXECUTED 40017e08: 01 00 00 00 nop <== NOT EXECUTED 40017e0c: 82 10 20 16 mov 0x16, %g1 ! 16 <_TLS_Alignment+0x15> <== NOT EXECUTED 40017e10: c2 22 00 00 st %g1, [ %o0 ] <== NOT EXECUTED 40017e14: 81 c7 e0 08 ret <== NOT EXECUTED 40017e18: 91 e8 3f ff restore %g0, -1, %o0 <== 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); 40017e1c: 40 00 23 3e call 40020b14