=============================================================================== 0200b5f0 : int IMFS_chown( const rtems_filesystem_location_info_t *loc, uid_t owner, gid_t group ) { 200b5f0: 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(); 200b5f4: 40 00 02 4a call 200bf1c 200b5f8: fa 06 20 08 ld [ %i0 + 8 ], %i5 if ( ( st_uid != jnode->st_uid ) && ( st_uid != 0 ) ) 200b5fc: c2 17 60 3c lduh [ %i5 + 0x3c ], %g1 200b600: 91 2a 20 10 sll %o0, 0x10, %o0 200b604: 91 32 20 10 srl %o0, 0x10, %o0 200b608: 80 a2 00 01 cmp %o0, %g1 200b60c: 02 80 00 0a be 200b634 200b610: 80 a2 20 00 cmp %o0, 0 200b614: 22 80 00 09 be,a 200b638 <== NEVER TAKEN 200b618: f2 37 60 3c sth %i1, [ %i5 + 0x3c ] <== NOT EXECUTED rtems_set_errno_and_return_minus_one( EPERM ); 200b61c: 40 00 10 14 call 200f66c <__errno> 200b620: b0 10 3f ff mov -1, %i0 200b624: 82 10 20 01 mov 1, %g1 200b628: c2 22 00 00 st %g1, [ %o0 ] 200b62c: 81 c7 e0 08 ret 200b630: 81 e8 00 00 restore #endif jnode->st_uid = owner; 200b634: f2 37 60 3c sth %i1, [ %i5 + 0x3c ] jnode->st_gid = group; 200b638: f4 37 60 3e sth %i2, [ %i5 + 0x3e ] IMFS_update_ctime( jnode ); 200b63c: 90 07 bf f8 add %fp, -8, %o0 200b640: 7f ff e0 06 call 2003658 200b644: 92 10 20 00 clr %o1 200b648: c2 07 bf f8 ld [ %fp + -8 ], %g1 200b64c: c2 27 60 48 st %g1, [ %i5 + 0x48 ] return 0; } 200b650: 81 c7 e0 08 ret 200b654: 91 e8 20 00 restore %g0, 0, %o0 =============================================================================== 02005690 : */ static void IMFS_dump_directory( IMFS_jnode_t *the_directory, int level ) { 2005690: 9d e3 bf a0 save %sp, -96, %sp the_node = the_node->next ) { the_jnode = (IMFS_jnode_t *) the_node; for ( i=0 ; i<=level ; i++ ) fprintf(stdout, "...." ); 2005694: 35 00 80 87 sethi %hi(0x2021c00), %i2 2005698: 39 00 80 8f sethi %hi(0x2023c00), %i4 case IMFS_FIFO: fprintf(stdout, " FIFO not printed\n" ); return; default: fprintf(stdout, " bad type %d\n", IMFS_type( the_jnode ) ); 200569c: 21 00 80 87 sethi %hi(0x2021c00), %l0 return; } puts(""); 20056a0: 23 00 80 87 sethi %hi(0x2021c00), %l1 case IMFS_SYM_LINK: fprintf(stdout, " links not printed\n" ); return; case IMFS_FIFO: fprintf(stdout, " FIFO not printed\n" ); 20056a4: 25 00 80 87 sethi %hi(0x2021c00), %l2 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_First( Chain_Control *the_chain ) { return _Chain_Head( the_chain )->next; 20056a8: 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, "...." ); 20056ac: b4 16 a2 a0 or %i2, 0x2a0, %i2 20056b0: b8 17 23 d0 or %i4, 0x3d0, %i4 case IMFS_FIFO: fprintf(stdout, " FIFO not printed\n" ); return; default: fprintf(stdout, " bad type %d\n", IMFS_type( the_jnode ) ); 20056b4: a0 14 23 10 or %l0, 0x310, %l0 return; } puts(""); 20056b8: a2 14 62 38 or %l1, 0x238, %l1 IMFS_assert( level >= 0 ); IMFS_assert( IMFS_is_directory( the_directory ) ); the_chain = &the_directory->info.directory.Entries; for ( the_node = rtems_chain_first( the_chain ); 20056bc: 10 80 00 4d b 20057f0 20056c0: a4 14 a2 f8 or %l2, 0x2f8, %l2 the_node = the_node->next ) { the_jnode = (IMFS_jnode_t *) the_node; for ( i=0 ; i<=level ; i++ ) fprintf(stdout, "...." ); 20056c4: 90 10 00 1a mov %i2, %o0 20056c8: 40 00 38 f0 call 2013a88 20056cc: b6 06 e0 01 inc %i3 20056d0: 10 80 00 03 b 20056dc 20056d4: c2 07 00 00 ld [ %i4 ], %g1 20056d8: c2 07 00 00 ld [ %i4 ], %g1 !rtems_chain_is_tail( the_chain, the_node ); the_node = the_node->next ) { the_jnode = (IMFS_jnode_t *) the_node; for ( i=0 ; i<=level ; i++ ) 20056dc: 80 a6 c0 19 cmp %i3, %i1 20056e0: 04 bf ff f9 ble 20056c4 20056e4: d2 00 60 08 ld [ %g1 + 8 ], %o1 IMFS_jnode_t *the_jnode ) { IMFS_assert( the_jnode ); fprintf(stdout, "%s", the_jnode->name ); 20056e8: 40 00 38 e8 call 2013a88 20056ec: 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; 20056f0: c2 07 60 4c ld [ %i5 + 0x4c ], %g1 20056f4: d4 00 40 00 ld [ %g1 ], %o2 switch( IMFS_type( the_jnode ) ) { 20056f8: 80 a2 a0 06 cmp %o2, 6 20056fc: 38 80 00 2d bgu,a 20057b0 <== NEVER TAKEN 2005700: c2 07 00 00 ld [ %i4 ], %g1 <== NOT EXECUTED 2005704: 95 2a a0 02 sll %o2, 2, %o2 2005708: 03 00 80 15 sethi %hi(0x2005400), %g1 200570c: 82 10 62 74 or %g1, 0x274, %g1 ! 2005674 2005710: c2 00 40 0a ld [ %g1 + %o2 ], %g1 2005714: 81 c0 40 00 jmp %g1 2005718: 01 00 00 00 nop case IMFS_DIRECTORY: fprintf(stdout, "/" ); 200571c: c2 07 00 00 ld [ %i4 ], %g1 2005720: 90 10 20 2f mov 0x2f, %o0 2005724: 40 00 38 a5 call 20139b8 2005728: d2 00 60 08 ld [ %g1 + 8 ], %o1 200572c: 30 80 00 26 b,a 20057c4 break; case IMFS_DEVICE: fprintf(stdout, " (device %" PRId32 ", %" PRId32 ")", 2005730: c2 07 00 00 ld [ %i4 ], %g1 2005734: 13 00 80 87 sethi %hi(0x2021c00), %o1 2005738: d0 00 60 08 ld [ %g1 + 8 ], %o0 200573c: 92 12 62 a8 or %o1, 0x2a8, %o1 2005740: 10 80 00 08 b 2005760 2005744: 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)", 2005748: c2 07 00 00 ld [ %i4 ], %g1 200574c: d4 07 60 54 ld [ %i5 + 0x54 ], %o2 2005750: d0 00 60 08 ld [ %g1 + 8 ], %o0 2005754: d6 07 60 58 ld [ %i5 + 0x58 ], %o3 2005758: 13 00 80 87 sethi %hi(0x2021c00), %o1 200575c: 92 12 62 c0 or %o1, 0x2c0, %o1 ! 2021ec0 2005760: 40 00 38 7a call 2013948 2005764: 01 00 00 00 nop 2005768: 30 80 00 17 b,a 20057c4 the_jnode->info.file.indirect, the_jnode->info.file.doubly_indirect, the_jnode->info.file.triply_indirect ); #else fprintf(stdout, " (file %" PRId32 ")", 200576c: c2 07 00 00 ld [ %i4 ], %g1 2005770: d4 07 60 54 ld [ %i5 + 0x54 ], %o2 2005774: d0 00 60 08 ld [ %g1 + 8 ], %o0 2005778: 13 00 80 87 sethi %hi(0x2021c00), %o1 200577c: 40 00 38 73 call 2013948 2005780: 92 12 62 d0 or %o1, 0x2d0, %o1 ! 2021ed0 2005784: 30 80 00 10 b,a 20057c4 case IMFS_HARD_LINK: fprintf(stdout, " links not printed\n" ); return; case IMFS_SYM_LINK: fprintf(stdout, " links not printed\n" ); 2005788: 11 00 80 87 sethi %hi(0x2021c00), %o0 200578c: c2 07 00 00 ld [ %i4 ], %g1 2005790: 10 80 00 04 b 20057a0 2005794: 90 12 22 e0 or %o0, 0x2e0, %o0 return; case IMFS_FIFO: fprintf(stdout, " FIFO not printed\n" ); 2005798: c2 07 00 00 ld [ %i4 ], %g1 200579c: 90 10 00 12 mov %l2, %o0 20057a0: 40 00 38 ba call 2013a88 20057a4: d2 00 60 08 ld [ %g1 + 8 ], %o1 } static inline bool IMFS_is_directory( const IMFS_jnode_t *node ) { return node->control->imfs_type == IMFS_DIRECTORY; 20057a8: 10 80 00 0a b 20057d0 20057ac: c2 07 60 4c ld [ %i5 + 0x4c ], %g1 return; default: fprintf(stdout, " bad type %d\n", IMFS_type( the_jnode ) ); 20057b0: 92 10 00 10 mov %l0, %o1 <== NOT EXECUTED 20057b4: 40 00 38 65 call 2013948 <== NOT EXECUTED 20057b8: d0 00 60 08 ld [ %g1 + 8 ], %o0 <== NOT EXECUTED 20057bc: 10 80 00 05 b 20057d0 <== NOT EXECUTED 20057c0: c2 07 60 4c ld [ %i5 + 0x4c ], %g1 <== NOT EXECUTED return; } puts(""); 20057c4: 40 00 3f 98 call 2015624 20057c8: 90 10 00 11 mov %l1, %o0 20057cc: 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 ) ) 20057d0: c2 00 40 00 ld [ %g1 ], %g1 20057d4: 80 a0 60 00 cmp %g1, 0 20057d8: 32 80 00 06 bne,a 20057f0 20057dc: fa 07 40 00 ld [ %i5 ], %i5 IMFS_dump_directory( the_jnode, level + 1 ); 20057e0: 90 10 00 1d mov %i5, %o0 20057e4: 7f ff ff ab call 2005690 20057e8: 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 ) { 20057ec: fa 07 40 00 ld [ %i5 ], %i5 RTEMS_INLINE_ROUTINE bool _Chain_Is_tail( const Chain_Control *the_chain, const Chain_Node *the_node ) { return (the_node == _Chain_Immutable_tail( the_chain )); 20057f0: 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 ); 20057f4: 80 a7 40 01 cmp %i5, %g1 20057f8: 12 bf ff b8 bne 20056d8 20057fc: b6 10 20 00 clr %i3 fprintf(stdout, "...." ); IMFS_print_jnode( the_jnode ); if ( IMFS_is_directory( the_jnode ) ) IMFS_dump_directory( the_jnode, level + 1 ); } } 2005800: 81 c7 e0 08 ret 2005804: 81 e8 00 00 restore =============================================================================== 0200b794 : rtems_filesystem_eval_path_context_t *ctx, void *arg, const char *token, size_t tokenlen ) { 200b794: 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; 200b798: f8 06 20 20 ld [ %i0 + 0x20 ], %i4 bool access_ok = rtems_filesystem_eval_path_check_access( 200b79c: 90 10 00 18 mov %i0, %o0 200b7a0: d4 07 20 30 ld [ %i4 + 0x30 ], %o2 200b7a4: d6 17 20 3c lduh [ %i4 + 0x3c ], %o3 200b7a8: d8 17 20 3e lduh [ %i4 + 0x3e ], %o4 200b7ac: 40 00 02 f3 call 200c378 200b7b0: 92 10 20 01 mov 1, %o1 dir->st_mode, dir->st_uid, dir->st_gid ); if ( access_ok ) { 200b7b4: 80 8a 20 ff btst 0xff, %o0 200b7b8: 12 80 00 04 bne 200b7c8 200b7bc: 80 a6 e0 01 cmp %i3, 1 void *arg, const char *token, size_t tokenlen ) { rtems_filesystem_eval_path_generic_status status = 200b7c0: 81 c7 e0 08 ret 200b7c4: 91 e8 20 01 restore %g0, 1, %o0 static inline bool rtems_filesystem_is_current_directory( const char *token, size_t tokenlen ) { return tokenlen == 1 && token [0] == '.'; 200b7c8: 12 80 00 06 bne 200b7e0 200b7cc: 82 10 20 00 clr %g1 200b7d0: c2 4e 80 00 ldsb [ %i2 ], %g1 200b7d4: 82 18 60 2e xor %g1, 0x2e, %g1 200b7d8: 80 a0 00 01 cmp %g0, %g1 200b7dc: 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 ) ) { 200b7e0: 80 a0 60 00 cmp %g1, 0 200b7e4: 12 80 00 2b bne 200b890 200b7e8: 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] == '.'; 200b7ec: 12 80 00 0b bne 200b818 200b7f0: 80 a0 60 00 cmp %g1, 0 200b7f4: c4 4e 80 00 ldsb [ %i2 ], %g2 200b7f8: 80 a0 a0 2e cmp %g2, 0x2e 200b7fc: 12 80 00 07 bne 200b818 200b800: 80 a0 60 00 cmp %g1, 0 200b804: c2 4e a0 01 ldsb [ %i2 + 1 ], %g1 200b808: 82 18 60 2e xor %g1, 0x2e, %g1 200b80c: 80 a0 00 01 cmp %g0, %g1 200b810: 82 60 3f ff subx %g0, -1, %g1 return dir; } else { if ( rtems_filesystem_is_parent_directory( token, tokenlen ) ) { 200b814: 80 a0 60 00 cmp %g1, 0 200b818: 22 80 00 04 be,a 200b828 200b81c: fa 07 20 50 ld [ %i4 + 0x50 ], %i5 return dir->Parent; 200b820: 10 80 00 17 b 200b87c 200b824: 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 ); 200b828: 10 80 00 10 b 200b868 200b82c: b2 07 20 54 add %i4, 0x54, %i1 while ( current != tail ) { IMFS_jnode_t *entry = (IMFS_jnode_t *) current; bool match = strncmp( entry->name, token, tokenlen ) == 0 200b830: 92 10 00 1a mov %i2, %o1 200b834: 40 00 15 47 call 2010d50 200b838: 94 10 00 1b mov %i3, %o2 && entry->name [tokenlen] == '\0'; 200b83c: 80 a2 20 00 cmp %o0, 0 200b840: 12 80 00 06 bne 200b858 200b844: 82 10 20 00 clr %g1 200b848: 82 07 40 1b add %i5, %i3, %g1 200b84c: c2 48 60 0c ldsb [ %g1 + 0xc ], %g1 200b850: 80 a0 00 01 cmp %g0, %g1 200b854: 82 60 3f ff subx %g0, -1, %g1 if ( match ) { 200b858: 80 a0 60 00 cmp %g1, 0 200b85c: 12 80 00 09 bne 200b880 200b860: 80 a7 60 00 cmp %i5, 0 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Next( Chain_Node *the_node ) { return the_node->next; 200b864: fa 07 40 00 ld [ %i5 ], %i5 } else { rtems_chain_control *entries = &dir->info.directory.Entries; rtems_chain_node *current = rtems_chain_first( entries ); rtems_chain_node *tail = rtems_chain_tail( entries ); while ( current != tail ) { 200b868: 80 a7 40 19 cmp %i5, %i1 200b86c: 12 bf ff f1 bne 200b830 200b870: 90 07 60 0c add %i5, 0xc, %o0 rtems_filesystem_eval_path_restart( ctx, fs_root_ptr ); } } } } else { status = RTEMS_FILESYSTEM_EVAL_PATH_GENERIC_NO_ENTRY; 200b874: 81 c7 e0 08 ret 200b878: 91 e8 20 02 restore %g0, 2, %o0 ); if ( access_ok ) { IMFS_jnode_t *entry = IMFS_search_in_directory( dir, token, tokenlen ); if ( entry != NULL ) { 200b87c: 80 a7 60 00 cmp %i5, 0 200b880: 32 80 00 06 bne,a 200b898 200b884: c2 06 20 04 ld [ %i0 + 4 ], %g1 rtems_filesystem_eval_path_restart( ctx, fs_root_ptr ); } } } } else { status = RTEMS_FILESYSTEM_EVAL_PATH_GENERIC_NO_ENTRY; 200b888: 81 c7 e0 08 ret 200b88c: 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 ) ) { 200b890: ba 10 00 1c mov %i4, %i5 if ( access_ok ) { IMFS_jnode_t *entry = IMFS_search_in_directory( dir, token, tokenlen ); if ( entry != NULL ) { bool terminal = !rtems_filesystem_eval_path_has_path( ctx ); 200b894: c2 06 20 04 ld [ %i0 + 4 ], %g1 static inline int rtems_filesystem_eval_path_get_flags( const rtems_filesystem_eval_path_context_t *ctx ) { return ctx->flags; 200b898: c6 06 20 10 ld [ %i0 + 0x10 ], %g3 200b89c: 80 a0 00 01 cmp %g0, %g1 rtems_chain_extract_unprotected( &node->Node ); } static inline IMFS_jnode_types_t IMFS_type( const IMFS_jnode_t *node ) { return node->control->imfs_type; 200b8a0: c2 07 60 4c ld [ %i5 + 0x4c ], %g1 200b8a4: 84 60 3f ff subx %g0, -1, %g2 200b8a8: c2 00 40 00 ld [ %g1 ], %g1 static inline void rtems_filesystem_eval_path_clear_token( rtems_filesystem_eval_path_context_t *ctx ) { ctx->tokenlen = 0; 200b8ac: c0 26 20 0c clr [ %i0 + 0xc ] bool follow_sym_link = (eval_flags & RTEMS_FS_FOLLOW_SYM_LINK) != 0; IMFS_jnode_types_t type = IMFS_type( entry ); rtems_filesystem_eval_path_clear_token( ctx ); if ( type == IMFS_HARD_LINK && (follow_hard_link || !terminal)) { 200b8b0: 80 a0 60 02 cmp %g1, 2 200b8b4: 12 80 00 0a bne 200b8dc 200b8b8: 88 10 00 02 mov %g2, %g4 200b8bc: 80 a0 a0 00 cmp %g2, 0 200b8c0: 22 80 00 2b be,a 200b96c 200b8c4: fa 07 60 50 ld [ %i5 + 0x50 ], %i5 200b8c8: 80 88 e0 08 btst 8, %g3 200b8cc: 22 80 00 29 be,a 200b970 200b8d0: c2 17 20 34 lduh [ %i4 + 0x34 ], %g1 entry = entry->info.hard_link.link_node; 200b8d4: 10 80 00 26 b 200b96c 200b8d8: fa 07 60 50 ld [ %i5 + 0x50 ], %i5 } if ( type == IMFS_SYM_LINK && (follow_sym_link || !terminal)) { 200b8dc: 80 a0 60 03 cmp %g1, 3 200b8e0: 12 80 00 10 bne 200b920 200b8e4: 80 a0 60 00 cmp %g1, 0 200b8e8: 80 a0 a0 00 cmp %g2, 0 200b8ec: 02 80 00 04 be 200b8fc 200b8f0: 80 88 e0 10 btst 0x10, %g3 200b8f4: 22 80 00 1f be,a 200b970 200b8f8: c2 17 20 34 lduh [ %i4 + 0x34 ], %g1 const char *target = entry->info.sym_link.name; 200b8fc: fa 07 60 50 ld [ %i5 + 0x50 ], %i5 rtems_filesystem_eval_path_recursive( ctx, target, strlen( target ) ); 200b900: 40 00 14 e2 call 2010c88 200b904: 90 10 00 1d mov %i5, %o0 200b908: 92 10 00 1d mov %i5, %o1 200b90c: 94 10 00 08 mov %o0, %o2 200b910: 7f ff e4 38 call 20049f0 200b914: 90 10 00 18 mov %i0, %o0 void *arg, const char *token, size_t tokenlen ) { rtems_filesystem_eval_path_generic_status status = 200b918: 81 c7 e0 08 ret 200b91c: 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 ) { 200b920: 32 80 00 14 bne,a 200b970 200b924: c2 17 20 34 lduh [ %i4 + 0x34 ], %g1 if ( node->info.directory.mt_fs != NULL ) { 200b928: d2 07 60 5c ld [ %i5 + 0x5c ], %o1 200b92c: 80 a2 60 00 cmp %o1, 0 200b930: 02 80 00 0f be 200b96c 200b934: 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( 200b938: d4 07 60 30 ld [ %i5 + 0x30 ], %o2 200b93c: d6 17 60 3c lduh [ %i5 + 0x3c ], %o3 200b940: 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; 200b944: 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( 200b948: 40 00 02 8c call 200c378 200b94c: 92 10 20 01 mov 1, %o1 RTEMS_FS_PERMS_EXEC, entry->st_mode, entry->st_uid, entry->st_gid ); if ( access_ok ) { 200b950: 80 8a 20 ff btst 0xff, %o0 200b954: 02 80 00 04 be 200b964 <== NEVER TAKEN 200b958: 90 10 00 18 mov %i0, %o0 rtems_filesystem_eval_path_restart( ctx, fs_root_ptr ); 200b95c: 7f ff e4 0c call 200498c 200b960: 92 10 00 1c mov %i4, %o1 void *arg, const char *token, size_t tokenlen ) { rtems_filesystem_eval_path_generic_status status = 200b964: 81 c7 e0 08 ret 200b968: 91 e8 20 01 restore %g0, 1, %o0 } else { rtems_filesystem_global_location_t **fs_root_ptr = IMFS_is_mount_point( entry, type ); if ( fs_root_ptr == NULL ) { --dir->reference_count; 200b96c: c2 17 20 34 lduh [ %i4 + 0x34 ], %g1 200b970: 82 00 7f ff add %g1, -1, %g1 200b974: c2 37 20 34 sth %g1, [ %i4 + 0x34 ] ++entry->reference_count; 200b978: c2 17 60 34 lduh [ %i5 + 0x34 ], %g1 200b97c: 82 00 60 01 inc %g1 200b980: c2 37 60 34 sth %g1, [ %i5 + 0x34 ] static inline void IMFS_Set_handlers( rtems_filesystem_location_info_t *loc ) { IMFS_jnode_t *node = (IMFS_jnode_t *) loc->node_access; loc->handlers = node->control->handlers; 200b984: c2 07 60 4c ld [ %i5 + 0x4c ], %g1 currentloc->node_access = entry; 200b988: fa 26 20 20 st %i5, [ %i0 + 0x20 ] 200b98c: c2 00 60 04 ld [ %g1 + 4 ], %g1 200b990: c2 26 20 28 st %g1, [ %i0 + 0x28 ] void *arg, const char *token, size_t tokenlen ) { rtems_filesystem_eval_path_generic_status status = 200b994: b0 09 20 ff and %g4, 0xff, %i0 status = RTEMS_FILESYSTEM_EVAL_PATH_GENERIC_NO_ENTRY; } } return status; } 200b998: 81 c7 e0 08 ret 200b99c: 81 e8 00 00 restore =============================================================================== 0200b9b8 : int IMFS_fchmod( const rtems_filesystem_location_info_t *loc, mode_t mode ) { 200b9b8: 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(); 200b9bc: 40 00 01 58 call 200bf1c 200b9c0: fa 06 20 08 ld [ %i0 + 8 ], %i5 if ( ( st_uid != jnode->st_uid ) && ( st_uid != 0 ) ) 200b9c4: c2 17 60 3c lduh [ %i5 + 0x3c ], %g1 200b9c8: 91 2a 20 10 sll %o0, 0x10, %o0 200b9cc: 91 32 20 10 srl %o0, 0x10, %o0 200b9d0: 80 a2 00 01 cmp %o0, %g1 200b9d4: 02 80 00 0a be 200b9fc 200b9d8: 80 a2 20 00 cmp %o0, 0 200b9dc: 22 80 00 09 be,a 200ba00 <== NEVER TAKEN 200b9e0: c2 07 60 30 ld [ %i5 + 0x30 ], %g1 <== NOT EXECUTED rtems_set_errno_and_return_minus_one( EPERM ); 200b9e4: 40 00 0f 22 call 200f66c <__errno> 200b9e8: b0 10 3f ff mov -1, %i0 200b9ec: 82 10 20 01 mov 1, %g1 200b9f0: c2 22 00 00 st %g1, [ %o0 ] 200b9f4: 81 c7 e0 08 ret 200b9f8: 81 e8 00 00 restore /* * Change only the RWX permissions on the jnode to mode. */ jnode->st_mode &= ~(S_IRWXU | S_IRWXG | S_IRWXO | S_ISUID | S_ISGID | S_ISVTX); 200b9fc: c2 07 60 30 ld [ %i5 + 0x30 ], %g1 jnode->st_mode |= mode & (S_IRWXU | S_IRWXG | S_IRWXO | S_ISUID | S_ISGID | S_ISVTX); IMFS_update_ctime( jnode ); 200ba00: 90 07 bf f8 add %fp, -8, %o0 /* * Change only the RWX permissions on the jnode to mode. */ jnode->st_mode &= ~(S_IRWXU | S_IRWXG | S_IRWXO | S_ISUID | S_ISGID | S_ISVTX); 200ba04: 82 08 70 00 and %g1, -4096, %g1 jnode->st_mode |= mode & (S_IRWXU | S_IRWXG | S_IRWXO | S_ISUID | S_ISGID | S_ISVTX); IMFS_update_ctime( jnode ); 200ba08: 92 10 20 00 clr %o1 /* * Change only the RWX permissions on the jnode to mode. */ jnode->st_mode &= ~(S_IRWXU | S_IRWXG | S_IRWXO | S_ISUID | S_ISGID | S_ISVTX); jnode->st_mode |= mode & (S_IRWXU | S_IRWXG | S_IRWXO | S_ISUID | S_ISGID | S_ISVTX); 200ba0c: b2 0e 6f ff and %i1, 0xfff, %i1 200ba10: b2 16 40 01 or %i1, %g1, %i1 IMFS_update_ctime( jnode ); 200ba14: 7f ff df 11 call 2003658 200ba18: f2 27 60 30 st %i1, [ %i5 + 0x30 ] 200ba1c: c2 07 bf f8 ld [ %fp + -8 ], %g1 200ba20: c2 27 60 48 st %g1, [ %i5 + 0x48 ] return 0; } 200ba24: 81 c7 e0 08 ret 200ba28: 91 e8 20 00 restore %g0, 0, %o0 =============================================================================== 02003890 : static ssize_t IMFS_fifo_write( rtems_libio_t *iop, const void *buffer, size_t count ) { 2003890: 9d e3 bf 98 save %sp, -104, %sp IMFS_jnode_t *jnode = iop->pathinfo.node_access; 2003894: fa 06 20 1c ld [ %i0 + 0x1c ], %i5 int err = pipe_write(JNODE2PIPE(jnode), buffer, count, iop); 2003898: 96 10 00 18 mov %i0, %o3 200389c: d0 07 60 50 ld [ %i5 + 0x50 ], %o0 20038a0: 92 10 00 19 mov %i1, %o1 20038a4: 40 00 2a 97 call 200e300 20038a8: 94 10 00 1a mov %i2, %o2 if (err > 0) { 20038ac: b0 92 20 00 orcc %o0, 0, %i0 20038b0: 04 80 00 09 ble 20038d4 20038b4: 90 07 bf f8 add %fp, -8, %o0 IMFS_mtime_ctime_update(jnode); 20038b8: 40 00 04 0e call 20048f0 20038bc: 92 10 20 00 clr %o1 20038c0: c2 07 bf f8 ld [ %fp + -8 ], %g1 20038c4: c2 27 60 44 st %g1, [ %i5 + 0x44 ] 20038c8: c2 27 60 48 st %g1, [ %i5 + 0x48 ] 20038cc: 81 c7 e0 08 ret 20038d0: 81 e8 00 00 restore } IMFS_FIFO_RETURN(err); 20038d4: 80 a6 20 00 cmp %i0, 0 20038d8: 02 80 00 06 be 20038f0 <== NEVER TAKEN 20038dc: 01 00 00 00 nop 20038e0: 40 00 37 66 call 2011678 <__errno> 20038e4: b0 20 00 18 neg %i0 20038e8: f0 22 00 00 st %i0, [ %o0 ] 20038ec: b0 10 3f ff mov -1, %i0 } 20038f0: 81 c7 e0 08 ret 20038f4: 81 e8 00 00 restore =============================================================================== 0200ba2c : ((IMFS_jnode_t *)( rtems_chain_head( jnode_get_control( jnode ) )->next)) void IMFS_fsunmount( rtems_filesystem_mount_table_entry_t *temp_mt_entry ) { 200ba2c: 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; 200ba30: f6 06 20 24 ld [ %i0 + 0x24 ], %i3 200ba34: b8 07 bf e8 add %fp, -24, %i4 200ba38: 92 10 00 1b mov %i3, %o1 200ba3c: 90 10 00 1c mov %i4, %o0 200ba40: 40 00 11 5c call 200ffb0 200ba44: 94 10 20 18 mov 0x18, %o2 jnode = (IMFS_jnode_t *)loc.node_access; 200ba48: 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; 200ba4c: c0 26 e0 08 clr [ %i3 + 8 ] 200ba50: b6 10 00 1c mov %i4, %i3 200ba54: c2 07 60 4c ld [ %i5 + 0x4c ], %g1 do { next = jnode->Parent; 200ba58: f8 07 60 08 ld [ %i5 + 8 ], %i4 200ba5c: 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 ) ) { 200ba60: 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; 200ba64: fa 27 bf f0 st %i5, [ %fp + -16 ] IMFS_Set_handlers( &loc ); if ( !IMFS_is_directory( jnode ) || jnode_has_no_children( jnode ) ) { 200ba68: 80 a0 60 00 cmp %g1, 0 200ba6c: 12 80 00 07 bne 200ba88 200ba70: c4 27 bf f8 st %g2, [ %fp + -8 ] 200ba74: 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 ); 200ba78: 82 07 60 54 add %i5, 0x54, %g1 200ba7c: 80 a0 80 01 cmp %g2, %g1 200ba80: 32 80 00 10 bne,a 200bac0 200ba84: c2 07 60 4c ld [ %i5 + 0x4c ], %g1 result = IMFS_rmnod( NULL, &loc ); 200ba88: 90 10 20 00 clr %o0 200ba8c: 7f ff dd 7d call 2003080 200ba90: 92 10 00 1b mov %i3, %o1 if ( result != 0 ) 200ba94: 80 a2 20 00 cmp %o0, 0 200ba98: 02 80 00 04 be 200baa8 <== ALWAYS TAKEN 200ba9c: 11 37 ab 6f sethi %hi(0xdeadbc00), %o0 rtems_fatal_error_occurred( 0xdeadbeef ); 200baa0: 7f ff f0 e6 call 2007e38 <== NOT EXECUTED 200baa4: 90 12 22 ef or %o0, 0x2ef, %o0 ! deadbeef <== NOT EXECUTED IMFS_node_destroy( jnode ); 200baa8: 7f ff dc a4 call 2002d38 200baac: 90 10 00 1d mov %i5, %o0 jnode = next; } if ( jnode != NULL ) { 200bab0: 80 a7 20 00 cmp %i4, 0 200bab4: 02 80 00 0e be 200baec 200bab8: 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; 200babc: c2 07 60 4c ld [ %i5 + 0x4c ], %g1 if ( IMFS_is_directory( jnode ) ) { 200bac0: c2 00 40 00 ld [ %g1 ], %g1 200bac4: 80 a0 60 00 cmp %g1, 0 200bac8: 32 bf ff e4 bne,a 200ba58 <== NEVER TAKEN 200bacc: 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; 200bad0: 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 ); 200bad4: 84 07 60 54 add %i5, 0x54, %g2 if ( jnode_has_children( jnode ) ) 200bad8: 80 a0 40 02 cmp %g1, %g2 200badc: 02 bf ff de be 200ba54 200bae0: 80 a0 60 00 cmp %g1, 0 jnode = jnode_get_first_child( jnode ); } } } while (jnode != NULL); 200bae4: 12 bf ff dc bne 200ba54 <== ALWAYS TAKEN 200bae8: ba 10 00 01 mov %g1, %i5 200baec: 81 c7 e0 08 ret 200baf0: 81 e8 00 00 restore =============================================================================== 02002c2c : 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] ) { 2002c2c: 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 ) ); 2002c30: 90 10 20 01 mov 1, %o0 2002c34: 40 00 01 ac call 20032e4 2002c38: 92 10 20 24 mov 0x24, %o1 if ( fs_info != NULL ) { 2002c3c: ba 92 20 00 orcc %o0, 0, %i5 2002c40: 02 80 00 24 be 2002cd0 2002c44: 03 00 80 74 sethi %hi(0x201d000), %g1 IMFS_jnode_t *root_node; fs_info->instance = imfs_instance++; 2002c48: c4 00 61 bc ld [ %g1 + 0x1bc ], %g2 ! 201d1bc memcpy( 2002c4c: 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++; 2002c50: c4 27 40 00 st %g2, [ %i5 ] 2002c54: 84 00 a0 01 inc %g2 memcpy( 2002c58: 94 10 20 1c mov 0x1c, %o2 IMFS_fs_info_t *fs_info = calloc( 1, sizeof( *fs_info ) ); if ( fs_info != NULL ) { IMFS_jnode_t *root_node; fs_info->instance = imfs_instance++; 2002c5c: c4 20 61 bc st %g2, [ %g1 + 0x1bc ] memcpy( 2002c60: 40 00 34 d4 call 200ffb0 2002c64: 90 07 60 08 add %i5, 8, %o0 fs_info->node_controls, node_controls, sizeof( fs_info->node_controls ) ); root_node = IMFS_allocate_node( 2002c68: d2 07 60 08 ld [ %i5 + 8 ], %o1 2002c6c: 90 10 00 1d mov %i5, %o0 2002c70: 15 00 80 6b sethi %hi(0x201ac00), %o2 2002c74: 96 10 20 00 clr %o3 2002c78: 94 12 a1 28 or %o2, 0x128, %o2 2002c7c: 19 00 00 10 sethi %hi(0x4000), %o4 2002c80: 9a 10 20 00 clr %o5 2002c84: 40 00 22 75 call 200b658 2002c88: 98 13 21 ed or %o4, 0x1ed, %o4 "", 0, (S_IFDIR | 0755), NULL ); if ( root_node != NULL ) { 2002c8c: 80 a2 20 00 cmp %o0, 0 2002c90: 02 80 00 10 be 2002cd0 <== NEVER TAKEN 2002c94: 03 00 80 6d sethi %hi(0x201b400), %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; 2002c98: 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; 2002c9c: 82 10 62 14 or %g1, 0x214, %g1 2002ca0: c4 00 a0 04 ld [ %g2 + 4 ], %g2 2002ca4: c2 26 20 2c st %g1, [ %i0 + 0x2c ] mt_entry->mt_fs_root->location.node_access = root_node; 2002ca8: c2 06 20 24 ld [ %i0 + 0x24 ], %g1 0, (S_IFDIR | 0755), NULL ); if ( root_node != NULL ) { mt_entry->fs_info = fs_info; 2002cac: fa 26 20 08 st %i5, [ %i0 + 8 ] mt_entry->ops = op_table; 2002cb0: f2 26 20 0c st %i1, [ %i0 + 0xc ] 2002cb4: 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; 2002cb8: d0 20 60 08 st %o0, [ %g1 + 8 ] errno = ENOMEM; rv = -1; } if ( rv == 0 ) { IMFS_determine_bytes_per_block( 2002cbc: 86 10 20 06 mov 6, %g3 2002cc0: 03 00 80 72 sethi %hi(0x201c800), %g1 int bit_mask; /* * check, whether requested bytes per block is valid */ for (bit_mask = 16; !is_valid && (bit_mask <= 512); bit_mask <<= 1) { 2002cc4: 84 10 20 10 mov 0x10, %g2 errno = ENOMEM; rv = -1; } if ( rv == 0 ) { IMFS_determine_bytes_per_block( 2002cc8: 10 80 00 08 b 2002ce8 2002ccc: c2 00 61 f0 ld [ %g1 + 0x1f0 ], %g1 } else { errno = ENOMEM; rv = -1; } } else { errno = ENOMEM; 2002cd0: 40 00 32 67 call 200f66c <__errno> 2002cd4: b0 10 3f ff mov -1, %i0 2002cd8: 82 10 20 0c mov 0xc, %g1 2002cdc: c2 22 00 00 st %g1, [ %o0 ] 2002ce0: 81 c7 e0 08 ret 2002ce4: 81 e8 00 00 restore /* * check, whether requested bytes per block is valid */ for (bit_mask = 16; !is_valid && (bit_mask <= 512); bit_mask <<= 1) { if (bit_mask == requested_bytes_per_block) { 2002ce8: 80 a0 80 01 cmp %g2, %g1 2002cec: 22 80 00 09 be,a 2002d10 2002cf0: 05 00 80 74 sethi %hi(0x201d000), %g2 is_valid = true; break; } if(bit_mask > requested_bytes_per_block) 2002cf4: 34 80 00 06 bg,a 2002d0c 2002cf8: 82 10 20 80 mov 0x80, %g1 int bit_mask; /* * check, whether requested bytes per block is valid */ for (bit_mask = 16; !is_valid && (bit_mask <= 512); bit_mask <<= 1) { 2002cfc: 86 80 ff ff addcc %g3, -1, %g3 2002d00: 12 bf ff fa bne 2002ce8 <== ALWAYS TAKEN 2002d04: 85 28 a0 01 sll %g2, 1, %g2 if(bit_mask > requested_bytes_per_block) break; } *dest_bytes_per_block = ((is_valid) ? requested_bytes_per_block : default_bytes_per_block); 2002d08: 82 10 20 80 mov 0x80, %g1 <== NOT EXECUTED break; } if(bit_mask > requested_bytes_per_block) break; } *dest_bytes_per_block = ((is_valid) 2002d0c: 05 00 80 74 sethi %hi(0x201d000), %g2 2002d10: c2 20 a1 b8 st %g1, [ %g2 + 0x1b8 ] ! 201d1b8 2002d14: b0 10 20 00 clr %i0 IMFS_MEMFILE_DEFAULT_BYTES_PER_BLOCK ); } return rv; } 2002d18: 81 c7 e0 08 ret 2002d1c: 81 e8 00 00 restore =============================================================================== 02004874 : const char *path, mode_t mode, const IMFS_node_control *node_control, void *context ) { 2004874: 9d e3 bf 48 save %sp, -184, %sp int rv = 0; mode &= ~rtems_filesystem_umask; 2004878: 03 00 80 85 sethi %hi(0x2021400), %g1 200487c: c2 00 60 a4 ld [ %g1 + 0xa4 ], %g1 ! 20214a4 switch (mode & S_IFMT) { 2004880: 05 00 00 08 sethi %hi(0x2000), %g2 void *context ) { int rv = 0; mode &= ~rtems_filesystem_umask; 2004884: c2 00 60 08 ld [ %g1 + 8 ], %g1 2004888: b2 2e 40 01 andn %i1, %g1, %i1 switch (mode & S_IFMT) { 200488c: 03 00 00 3c sethi %hi(0xf000), %g1 2004890: 82 0e 40 01 and %i1, %g1, %g1 2004894: 80 a0 40 02 cmp %g1, %g2 2004898: 22 80 00 3a be,a 2004980 200489c: c2 06 80 00 ld [ %i2 ], %g1 20048a0: 38 80 00 04 bgu,a 20048b0 <== ALWAYS TAKEN 20048a4: 05 00 00 18 sethi %hi(0x6000), %g2 20048a8: 10 80 00 05 b 20048bc <== NOT EXECUTED 20048ac: 05 00 00 04 sethi %hi(0x1000), %g2 <== NOT EXECUTED 20048b0: 80 a0 40 02 cmp %g1, %g2 20048b4: 02 80 00 32 be 200497c 20048b8: 05 00 00 20 sethi %hi(0x8000), %g2 20048bc: 80 a0 40 02 cmp %g1, %g2 20048c0: 22 80 00 30 be,a 2004980 <== NEVER TAKEN 20048c4: c2 06 80 00 ld [ %i2 ], %g1 <== NOT EXECUTED 20048c8: 30 80 00 27 b,a 2004964 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 = 20048cc: 94 10 20 78 mov 0x78, %o2 20048d0: 40 00 07 fa call 20068b8 20048d4: 90 07 bf c8 add %fp, -56, %o0 rtems_filesystem_eval_path_start( &ctx, path, eval_flags ); if ( IMFS_is_imfs_instance( currentloc ) ) { 20048d8: 7f ff ff d5 call 200482c 20048dc: ba 10 00 08 mov %o0, %i5 20048e0: 80 8a 20 ff btst 0xff, %o0 20048e4: 02 80 00 19 be 2004948 20048e8: 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( 20048ec: 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; 20048f0: f6 27 bf b0 st %i3, [ %fp + -80 ] new_node = IMFS_create_node_with_control( 20048f4: 90 10 00 1d mov %i5, %o0 20048f8: 92 10 00 1a mov %i2, %o1 20048fc: 98 10 00 19 mov %i1, %o4 2004900: 9a 07 bf b0 add %fp, -80, %o5 2004904: 40 00 2d 7a call 200feec 2004908: b0 10 3f ff mov -1, %i0 rtems_filesystem_eval_path_get_tokenlen( &ctx ), mode, &info ); if ( new_node != NULL ) { 200490c: 80 a2 20 00 cmp %o0, 0 2004910: 02 80 00 11 be 2004954 2004914: 92 10 20 00 clr %o1 IMFS_jnode_t *parent = currentloc->node_access; 2004918: fa 07 60 08 ld [ %i5 + 8 ], %i5 IMFS_update_ctime( parent ); 200491c: 40 00 02 90 call 200535c 2004920: 90 07 bf a8 add %fp, -88, %o0 2004924: c2 07 bf a8 ld [ %fp + -88 ], %g1 IMFS_update_mtime( parent ); 2004928: 90 07 bf a8 add %fp, -88, %o0 ); if ( new_node != NULL ) { IMFS_jnode_t *parent = currentloc->node_access; IMFS_update_ctime( parent ); 200492c: c2 27 60 48 st %g1, [ %i5 + 0x48 ] IMFS_update_mtime( parent ); 2004930: 40 00 02 8b call 200535c 2004934: 92 10 20 00 clr %o1 2004938: c2 07 bf a8 ld [ %fp + -88 ], %g1 200493c: b0 10 20 00 clr %i0 2004940: 10 80 00 05 b 2004954 2004944: c2 27 60 44 st %g1, [ %i5 + 0x44 ] } else { rv = -1; } } else { rtems_filesystem_eval_path_error( &ctx, ENOTSUP ); 2004948: 92 10 20 86 mov 0x86, %o1 200494c: 40 00 07 45 call 2006660 2004950: b0 10 3f ff mov -1, %i0 rv = -1; } rtems_filesystem_eval_path_cleanup( &ctx ); 2004954: 40 00 08 15 call 20069a8 2004958: 90 07 bf c8 add %fp, -56, %o0 200495c: 81 c7 e0 08 ret 2004960: 81 e8 00 00 restore } else { errno = EINVAL; 2004964: 40 00 3d a3 call 2013ff0 <__errno> 2004968: b0 10 3f ff mov -1, %i0 200496c: 82 10 20 16 mov 0x16, %g1 2004970: c2 22 00 00 st %g1, [ %o0 ] 2004974: 81 c7 e0 08 ret 2004978: 81 e8 00 00 restore rv = -1; break; } if ( rv == 0 ) { if ( node_control->imfs_type == IMFS_GENERIC ) { 200497c: c2 06 80 00 ld [ %i2 ], %g1 2004980: 80 a0 60 07 cmp %g1, 7 2004984: 02 bf ff d2 be 20048cc 2004988: 92 10 00 18 mov %i0, %o1 200498c: 30 bf ff f6 b,a 2004964 =============================================================================== 0200e194 : */ MEMFILE_STATIC int IMFS_memfile_addblock( IMFS_jnode_t *the_jnode, unsigned int block ) { 200e194: 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 ); 200e198: 94 10 20 01 mov 1, %o2 200e19c: 90 10 00 18 mov %i0, %o0 200e1a0: 7f ff fe d7 call 200dcfc 200e1a4: 92 10 00 19 mov %i1, %o1 if ( *block_entry_ptr ) 200e1a8: c2 02 00 00 ld [ %o0 ], %g1 IMFS_assert( IMFS_type( the_jnode ) == IMFS_MEMORY_FILE ); /* * Obtain the pointer for the specified block number */ block_entry_ptr = IMFS_memfile_get_block_pointer( the_jnode, block, 1 ); 200e1ac: ba 10 00 08 mov %o0, %i5 if ( *block_entry_ptr ) 200e1b0: 80 a0 60 00 cmp %g1, 0 200e1b4: 12 80 00 08 bne 200e1d4 200e1b8: b0 10 20 00 clr %i0 return 0; /* * There is no memory for this block number so allocate it. */ memory = memfile_alloc_block(); 200e1bc: 7f ff fe c3 call 200dcc8 200e1c0: 01 00 00 00 nop if ( !memory ) 200e1c4: 80 a2 20 00 cmp %o0, 0 200e1c8: 22 80 00 03 be,a 200e1d4 <== NEVER TAKEN 200e1cc: b0 10 20 01 mov 1, %i0 <== NOT EXECUTED return 1; *block_entry_ptr = memory; 200e1d0: d0 27 40 00 st %o0, [ %i5 ] return 0; 200e1d4: 81 c7 e0 08 ret 200e1d8: 81 e8 00 00 restore =============================================================================== 0200e3a8 : MEMFILE_STATIC int IMFS_memfile_extend( IMFS_jnode_t *the_jnode, bool zero_fill, off_t new_length ) { 200e3a8: 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 ) 200e3ac: 03 00 80 74 sethi %hi(0x201d000), %g1 200e3b0: fa 00 61 b8 ld [ %g1 + 0x1b8 ], %i5 ! 201d1b8 200e3b4: b9 37 60 02 srl %i5, 2, %i4 200e3b8: 92 10 00 1c mov %i4, %o1 200e3bc: 40 00 28 11 call 2018400 <.umul> 200e3c0: 90 07 20 01 add %i4, 1, %o0 200e3c4: 92 10 00 1c mov %i4, %o1 200e3c8: 40 00 28 0e call 2018400 <.umul> 200e3cc: 90 02 20 01 inc %o0 200e3d0: 92 10 00 1d mov %i5, %o1 200e3d4: 40 00 28 0b call 2018400 <.umul> 200e3d8: 90 02 3f ff add %o0, -1, %o0 200e3dc: 82 10 20 00 clr %g1 200e3e0: 80 a0 40 1a cmp %g1, %i2 200e3e4: 34 80 00 0b bg,a 200e410 <== NEVER TAKEN 200e3e8: f8 06 20 50 ld [ %i0 + 0x50 ], %i4 <== NOT EXECUTED 200e3ec: 80 a0 40 1a cmp %g1, %i2 200e3f0: 12 80 00 04 bne 200e400 <== NEVER TAKEN 200e3f4: 80 a2 00 1b cmp %o0, %i3 200e3f8: 38 80 00 06 bgu,a 200e410 200e3fc: f8 06 20 50 ld [ %i0 + 0x50 ], %i4 rtems_set_errno_and_return_minus_one( EFBIG ); 200e400: 40 00 04 9b call 200f66c <__errno> 200e404: 01 00 00 00 nop 200e408: 10 80 00 3c b 200e4f8 200e40c: 82 10 20 1b mov 0x1b, %g1 ! 1b /* * Verify new file size is actually larger than current size */ if ( new_length <= the_jnode->info.file.size ) 200e410: 80 a6 80 1c cmp %i2, %i4 200e414: 14 80 00 07 bg 200e430 <== NEVER TAKEN 200e418: e0 06 20 54 ld [ %i0 + 0x54 ], %l0 200e41c: 80 a6 80 1c cmp %i2, %i4 200e420: 12 80 00 48 bne 200e540 <== NEVER TAKEN 200e424: 80 a6 c0 10 cmp %i3, %l0 200e428: 08 80 00 46 bleu 200e540 <== NEVER TAKEN 200e42c: 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; 200e430: a3 3f 60 1f sra %i5, 0x1f, %l1 200e434: 96 10 00 1d mov %i5, %o3 200e438: 94 10 00 11 mov %l1, %o2 200e43c: 90 10 00 1a mov %i2, %o0 200e440: 40 00 29 82 call 2018a48 <__divdi3> 200e444: 92 10 00 1b mov %i3, %o1 old_blocks = the_jnode->info.file.size / IMFS_MEMFILE_BYTES_PER_BLOCK; 200e448: 94 10 00 11 mov %l1, %o2 200e44c: 90 10 00 1c mov %i4, %o0 200e450: 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; 200e454: a4 10 00 09 mov %o1, %l2 old_blocks = the_jnode->info.file.size / IMFS_MEMFILE_BYTES_PER_BLOCK; 200e458: 40 00 29 7c call 2018a48 <__divdi3> 200e45c: 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++ ) { 200e460: 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; 200e464: 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; 200e468: b8 10 00 09 mov %o1, %i4 * Now allocate each of those blocks. */ for ( block=old_blocks ; block<=new_blocks ; block++ ) { if ( !IMFS_memfile_addblock( the_jnode, block ) ) { if ( zero_fill ) { size_t count = IMFS_MEMFILE_BYTES_PER_BLOCK - offset; 200e46c: 27 00 80 74 sethi %hi(0x201d000), %l3 /* * Calculate the number of range of blocks to allocate */ new_blocks = new_length / IMFS_MEMFILE_BYTES_PER_BLOCK; old_blocks = the_jnode->info.file.size / IMFS_MEMFILE_BYTES_PER_BLOCK; offset = the_jnode->info.file.size - old_blocks * IMFS_MEMFILE_BYTES_PER_BLOCK; 200e470: 40 00 27 e4 call 2018400 <.umul> 200e474: 92 10 00 1d mov %i5, %o1 /* * Now allocate each of those blocks. */ for ( block=old_blocks ; block<=new_blocks ; block++ ) { 200e478: 10 80 00 23 b 200e504 200e47c: a0 24 00 08 sub %l0, %o0, %l0 if ( !IMFS_memfile_addblock( the_jnode, block ) ) { 200e480: 7f ff ff 45 call 200e194 200e484: 92 10 00 1d mov %i5, %o1 200e488: 80 a2 20 00 cmp %o0, 0 200e48c: 12 80 00 15 bne 200e4e0 <== NEVER TAKEN 200e490: 80 a6 60 00 cmp %i1, 0 if ( zero_fill ) { 200e494: 22 80 00 1c be,a 200e504 200e498: a2 04 60 01 inc %l1 size_t count = IMFS_MEMFILE_BYTES_PER_BLOCK - offset; 200e49c: e8 04 e1 b8 ld [ %l3 + 0x1b8 ], %l4 block_p *block_ptr = 200e4a0: 92 10 00 1d mov %i5, %o1 200e4a4: 94 10 20 00 clr %o2 200e4a8: 7f ff fe 15 call 200dcfc 200e4ac: 90 10 00 18 mov %i0, %o0 IMFS_memfile_get_block_pointer( the_jnode, block, 0 ); memset( &(*block_ptr) [offset], 0, count); 200e4b0: 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; 200e4b4: 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); 200e4b8: 90 02 00 10 add %o0, %l0, %o0 200e4bc: 92 10 20 00 clr %o1 200e4c0: 94 10 00 14 mov %l4, %o2 200e4c4: 40 00 06 f8 call 20100a4 200e4c8: a0 10 20 00 clr %l0 200e4cc: 10 80 00 0e b 200e504 200e4d0: a2 04 60 01 inc %l1 offset = 0; } } else { for ( ; block>=old_blocks ; block-- ) { IMFS_memfile_remove_block( the_jnode, block ); 200e4d4: 90 10 00 18 mov %i0, %o0 <== NOT EXECUTED 200e4d8: 7f ff ff a8 call 200e378 <== NOT EXECUTED 200e4dc: ba 07 7f ff add %i5, -1, %i5 <== NOT EXECUTED memset( &(*block_ptr) [offset], 0, count); offset = 0; } } else { for ( ; block>=old_blocks ; block-- ) { 200e4e0: 80 a7 40 1c cmp %i5, %i4 <== NOT EXECUTED 200e4e4: 1a bf ff fc bcc 200e4d4 <== NOT EXECUTED 200e4e8: 92 10 00 1d mov %i5, %o1 <== NOT EXECUTED IMFS_memfile_remove_block( the_jnode, block ); } rtems_set_errno_and_return_minus_one( ENOSPC ); 200e4ec: 40 00 04 60 call 200f66c <__errno> <== NOT EXECUTED 200e4f0: 01 00 00 00 nop <== NOT EXECUTED 200e4f4: 82 10 20 1c mov 0x1c, %g1 ! 1c <== NOT EXECUTED 200e4f8: c2 22 00 00 st %g1, [ %o0 ] 200e4fc: 81 c7 e0 08 ret 200e500: 91 e8 3f ff restore %g0, -1, %o0 * * This routine insures that the in-memory file is of the length * specified. If necessary, it will allocate memory blocks to * extend the file. */ MEMFILE_STATIC int IMFS_memfile_extend( 200e504: 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++ ) { 200e508: 80 a7 40 12 cmp %i5, %l2 200e50c: 08 bf ff dd bleu 200e480 200e510: 90 10 00 18 mov %i0, %o0 /* * Set the new length of the file. */ the_jnode->info.file.size = new_length; IMFS_update_ctime(the_jnode); 200e514: 92 10 20 00 clr %o1 } /* * Set the new length of the file. */ the_jnode->info.file.size = new_length; 200e518: f4 3e 20 50 std %i2, [ %i0 + 0x50 ] IMFS_update_ctime(the_jnode); 200e51c: 7f ff d4 4f call 2003658 200e520: 90 07 bf f8 add %fp, -8, %o0 200e524: c2 07 bf f8 ld [ %fp + -8 ], %g1 IMFS_update_mtime(the_jnode); 200e528: 90 07 bf f8 add %fp, -8, %o0 /* * Set the new length of the file. */ the_jnode->info.file.size = new_length; IMFS_update_ctime(the_jnode); 200e52c: c2 26 20 48 st %g1, [ %i0 + 0x48 ] IMFS_update_mtime(the_jnode); 200e530: 7f ff d4 4a call 2003658 200e534: 92 10 20 00 clr %o1 200e538: c2 07 bf f8 ld [ %fp + -8 ], %g1 200e53c: c2 26 20 44 st %g1, [ %i0 + 0x44 ] return 0; } 200e540: 81 c7 e0 08 ret 200e544: 91 e8 20 00 restore %g0, 0, %o0 =============================================================================== 0200dcfc : #endif IMFS_jnode_t *the_jnode, unsigned int block, int malloc_it ) { 200dcfc: 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 ) { 200dd00: 03 00 80 74 sethi %hi(0x201d000), %g1 200dd04: fa 00 61 b8 ld [ %g1 + 0x1b8 ], %i5 ! 201d1b8 200dd08: bb 37 60 02 srl %i5, 2, %i5 200dd0c: 82 07 7f ff add %i5, -1, %g1 200dd10: 80 a6 40 01 cmp %i1, %g1 200dd14: 18 80 00 18 bgu 200dd74 200dd18: 90 07 60 01 add %i5, 1, %o0 p = info->indirect; if ( malloc_it ) { 200dd1c: 80 a6 a0 00 cmp %i2, 0 200dd20: 02 80 00 10 be 200dd60 200dd24: c2 06 20 58 ld [ %i0 + 0x58 ], %g1 if ( !p ) { 200dd28: 80 a0 60 00 cmp %g1, 0 200dd2c: 32 80 00 0a bne,a 200dd54 200dd30: f0 06 20 58 ld [ %i0 + 0x58 ], %i0 p = memfile_alloc_block(); 200dd34: 7f ff ff e5 call 200dcc8 200dd38: 01 00 00 00 nop if ( !p ) 200dd3c: 80 a2 20 00 cmp %o0, 0 200dd40: 32 80 00 04 bne,a 200dd50 <== ALWAYS TAKEN 200dd44: d0 26 20 58 st %o0, [ %i0 + 0x58 ] return 0; 200dd48: 81 c7 e0 08 ret <== NOT EXECUTED 200dd4c: 91 e8 20 00 restore %g0, 0, %o0 <== NOT EXECUTED info->indirect = p; } return &info->indirect[ my_block ]; 200dd50: f0 06 20 58 ld [ %i0 + 0x58 ], %i0 200dd54: b3 2e 60 02 sll %i1, 2, %i1 200dd58: 81 c7 e0 08 ret 200dd5c: 91 ee 00 19 restore %i0, %i1, %o0 } if ( !p ) 200dd60: 80 a0 60 00 cmp %g1, 0 200dd64: 02 bf ff f9 be 200dd48 <== NEVER TAKEN 200dd68: b3 2e 60 02 sll %i1, 2, %i1 return 0; return &info->indirect[ my_block ]; 200dd6c: 81 c7 e0 08 ret 200dd70: 91 e8 40 19 restore %g1, %i1, %o0 /* * Is the block number in the doubly indirect portion? */ if ( my_block <= LAST_DOUBLY_INDIRECT ) { 200dd74: 40 00 29 a3 call 2018400 <.umul> 200dd78: 92 10 00 1d mov %i5, %o1 200dd7c: 82 02 3f ff add %o0, -1, %g1 200dd80: 80 a6 40 01 cmp %i1, %g1 200dd84: 18 80 00 2c bgu 200de34 200dd88: b8 10 00 08 mov %o0, %i4 my_block -= FIRST_DOUBLY_INDIRECT; 200dd8c: b2 26 40 1d sub %i1, %i5, %i1 singly = my_block % IMFS_MEMFILE_BLOCK_SLOTS; 200dd90: 92 10 00 1d mov %i5, %o1 200dd94: 40 00 2a 81 call 2018798 <.urem> 200dd98: 90 10 00 19 mov %i1, %o0 doubly = my_block / IMFS_MEMFILE_BLOCK_SLOTS; 200dd9c: 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; 200dda0: b8 10 00 08 mov %o0, %i4 doubly = my_block / IMFS_MEMFILE_BLOCK_SLOTS; 200dda4: 40 00 29 d1 call 20184e8 <.udiv> 200dda8: 90 10 00 19 mov %i1, %o0 p = info->doubly_indirect; if ( malloc_it ) { 200ddac: 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; 200ddb0: ba 10 00 08 mov %o0, %i5 p = info->doubly_indirect; if ( malloc_it ) { 200ddb4: 02 80 00 17 be 200de10 200ddb8: d0 06 20 5c ld [ %i0 + 0x5c ], %o0 if ( !p ) { 200ddbc: 80 a2 20 00 cmp %o0, 0 200ddc0: 12 80 00 08 bne 200dde0 200ddc4: bb 2f 60 02 sll %i5, 2, %i5 p = memfile_alloc_block(); 200ddc8: 7f ff ff c0 call 200dcc8 200ddcc: 01 00 00 00 nop if ( !p ) 200ddd0: 80 a2 20 00 cmp %o0, 0 200ddd4: 02 bf ff dd be 200dd48 <== NEVER TAKEN 200ddd8: 01 00 00 00 nop return 0; info->doubly_indirect = p; 200dddc: d0 26 20 5c st %o0, [ %i0 + 0x5c ] } p1 = (block_p *)p[ doubly ]; 200dde0: b6 02 00 1d add %o0, %i5, %i3 200dde4: d0 02 00 1d ld [ %o0 + %i5 ], %o0 if ( !p1 ) { 200dde8: 80 a2 20 00 cmp %o0, 0 200ddec: 12 80 00 4a bne 200df14 200ddf0: b1 2f 20 02 sll %i4, 2, %i0 p1 = memfile_alloc_block(); 200ddf4: 7f ff ff b5 call 200dcc8 200ddf8: 01 00 00 00 nop if ( !p1 ) 200ddfc: 80 a2 20 00 cmp %o0, 0 200de00: 02 bf ff d2 be 200dd48 <== NEVER TAKEN 200de04: 01 00 00 00 nop return 0; p[ doubly ] = (block_p) p1; 200de08: 10 80 00 43 b 200df14 200de0c: d0 26 c0 00 st %o0, [ %i3 ] } return (block_p *)&p1[ singly ]; } if ( !p ) 200de10: 80 a2 20 00 cmp %o0, 0 200de14: 02 bf ff cd be 200dd48 <== NEVER TAKEN 200de18: bb 2f 60 02 sll %i5, 2, %i5 return 0; p = (block_p *)p[ doubly ]; 200de1c: c2 02 00 1d ld [ %o0 + %i5 ], %g1 if ( !p ) 200de20: 80 a0 60 00 cmp %g1, 0 200de24: 02 bf ff c9 be 200dd48 <== NEVER TAKEN 200de28: 01 00 00 00 nop return 0; return (block_p *)&p[ singly ]; 200de2c: 10 80 00 48 b 200df4c 200de30: b1 2f 20 02 sll %i4, 2, %i0 } /* * Is the block number in the triply indirect portion? */ if ( my_block <= LAST_TRIPLY_INDIRECT ) { 200de34: 90 02 20 01 inc %o0 200de38: 40 00 29 72 call 2018400 <.umul> 200de3c: 92 10 00 1d mov %i5, %o1 200de40: 90 02 3f ff add %o0, -1, %o0 200de44: 80 a6 40 08 cmp %i1, %o0 200de48: 18 bf ff c0 bgu 200dd48 <== NEVER TAKEN 200de4c: b2 26 40 1c sub %i1, %i4, %i1 my_block -= FIRST_TRIPLY_INDIRECT; singly = my_block % IMFS_MEMFILE_BLOCK_SLOTS; 200de50: 92 10 00 1d mov %i5, %o1 200de54: 40 00 2a 51 call 2018798 <.urem> 200de58: 90 10 00 19 mov %i1, %o0 doubly = my_block / IMFS_MEMFILE_BLOCK_SLOTS; 200de5c: 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; 200de60: b6 10 00 08 mov %o0, %i3 doubly = my_block / IMFS_MEMFILE_BLOCK_SLOTS; 200de64: 40 00 29 a1 call 20184e8 <.udiv> 200de68: 90 10 00 19 mov %i1, %o0 triply = doubly / IMFS_MEMFILE_BLOCK_SLOTS; 200de6c: 92 10 00 1d mov %i5, %o1 200de70: 40 00 29 9e call 20184e8 <.udiv> 200de74: b2 10 00 08 mov %o0, %i1 doubly %= IMFS_MEMFILE_BLOCK_SLOTS; 200de78: 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; 200de7c: b8 10 00 08 mov %o0, %i4 doubly %= IMFS_MEMFILE_BLOCK_SLOTS; 200de80: 40 00 2a 46 call 2018798 <.urem> 200de84: 90 10 00 19 mov %i1, %o0 p = info->triply_indirect; if ( malloc_it ) { 200de88: 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; 200de8c: ba 10 00 08 mov %o0, %i5 p = info->triply_indirect; if ( malloc_it ) { 200de90: 02 80 00 23 be 200df1c 200de94: d0 06 20 60 ld [ %i0 + 0x60 ], %o0 if ( !p ) { 200de98: 80 a2 20 00 cmp %o0, 0 200de9c: 12 80 00 08 bne 200debc 200dea0: b9 2f 20 02 sll %i4, 2, %i4 p = memfile_alloc_block(); 200dea4: 7f ff ff 89 call 200dcc8 200dea8: 01 00 00 00 nop if ( !p ) 200deac: 80 a2 20 00 cmp %o0, 0 200deb0: 02 bf ff a6 be 200dd48 <== NEVER TAKEN 200deb4: 01 00 00 00 nop return 0; info->triply_indirect = p; 200deb8: d0 26 20 60 st %o0, [ %i0 + 0x60 ] } p1 = (block_p *) p[ triply ]; 200debc: b4 02 00 1c add %o0, %i4, %i2 200dec0: d0 02 00 1c ld [ %o0 + %i4 ], %o0 if ( !p1 ) { 200dec4: 80 a2 20 00 cmp %o0, 0 200dec8: 12 80 00 08 bne 200dee8 200decc: bb 2f 60 02 sll %i5, 2, %i5 p1 = memfile_alloc_block(); 200ded0: 7f ff ff 7e call 200dcc8 200ded4: 01 00 00 00 nop if ( !p1 ) 200ded8: 80 a2 20 00 cmp %o0, 0 200dedc: 02 bf ff 9b be 200dd48 <== NEVER TAKEN 200dee0: 01 00 00 00 nop return 0; p[ triply ] = (block_p) p1; 200dee4: d0 26 80 00 st %o0, [ %i2 ] } p2 = (block_p *)p1[ doubly ]; 200dee8: b8 02 00 1d add %o0, %i5, %i4 200deec: d0 02 00 1d ld [ %o0 + %i5 ], %o0 if ( !p2 ) { 200def0: 80 a2 20 00 cmp %o0, 0 200def4: 12 80 00 08 bne 200df14 200def8: b1 2e e0 02 sll %i3, 2, %i0 p2 = memfile_alloc_block(); 200defc: 7f ff ff 73 call 200dcc8 200df00: 01 00 00 00 nop if ( !p2 ) 200df04: 80 a2 20 00 cmp %o0, 0 200df08: 02 bf ff 90 be 200dd48 <== NEVER TAKEN 200df0c: 01 00 00 00 nop return 0; p1[ doubly ] = (block_p) p2; 200df10: d0 27 00 00 st %o0, [ %i4 ] } return (block_p *)&p2[ singly ]; 200df14: 81 c7 e0 08 ret 200df18: 91 ea 00 18 restore %o0, %i0, %o0 } if ( !p ) 200df1c: 80 a2 20 00 cmp %o0, 0 200df20: 02 bf ff 8a be 200dd48 <== NEVER TAKEN 200df24: b9 2f 20 02 sll %i4, 2, %i4 return 0; p1 = (block_p *) p[ triply ]; 200df28: c2 02 00 1c ld [ %o0 + %i4 ], %g1 if ( !p1 ) 200df2c: 80 a0 60 00 cmp %g1, 0 200df30: 02 bf ff 86 be 200dd48 <== NEVER TAKEN 200df34: bb 2f 60 02 sll %i5, 2, %i5 return 0; p2 = (block_p *)p1[ doubly ]; 200df38: c2 00 40 1d ld [ %g1 + %i5 ], %g1 if ( !p2 ) 200df3c: 80 a0 60 00 cmp %g1, 0 200df40: 02 bf ff 82 be 200dd48 <== NEVER TAKEN 200df44: 01 00 00 00 nop return 0; return (block_p *)&p2[ singly ]; 200df48: b1 2e e0 02 sll %i3, 2, %i0 /* * This means the requested block number is out of range. */ return 0; } 200df4c: 81 c7 e0 08 ret 200df50: 91 e8 40 18 restore %g1, %i0, %o0 =============================================================================== 0200df54 : IMFS_jnode_t *the_jnode, off_t start, unsigned char *destination, unsigned int length ) { 200df54: 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; 200df58: c2 06 20 4c ld [ %i0 + 0x4c ], %g1 200df5c: 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 ) { 200df60: c2 00 40 00 ld [ %g1 ], %g1 IMFS_jnode_t *the_jnode, off_t start, unsigned char *destination, unsigned int length ) { 200df64: a0 10 00 19 mov %i1, %l0 200df68: 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 ) { 200df6c: 80 a0 60 05 cmp %g1, 5 200df70: 12 80 00 17 bne 200dfcc 200df74: 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)) 200df78: f4 1e 20 50 ldd [ %i0 + 0x50 ], %i2 200df7c: 82 10 20 00 clr %g1 200df80: 86 a6 c0 11 subcc %i3, %l1, %g3 200df84: 84 66 80 19 subx %i2, %i1, %g2 200df88: 80 a0 40 02 cmp %g1, %g2 200df8c: 14 80 00 07 bg 200dfa8 <== NEVER TAKEN 200df90: d2 06 20 58 ld [ %i0 + 0x58 ], %o1 200df94: 80 a0 40 02 cmp %g1, %g2 200df98: 12 80 00 06 bne 200dfb0 <== NEVER TAKEN 200df9c: 80 a7 00 03 cmp %i4, %g3 200dfa0: 28 80 00 05 bleu,a 200dfb4 <== NEVER TAKEN 200dfa4: b0 10 00 1c mov %i4, %i0 <== NOT EXECUTED my_length = the_jnode->info.linearfile.size - start; 200dfa8: 10 80 00 03 b 200dfb4 200dfac: b0 26 c0 11 sub %i3, %l1, %i0 /* * Linear files (as created from a tar file are easier to handle * than block files). */ my_length = length; 200dfb0: b0 10 00 1c mov %i4, %i0 <== NOT EXECUTED file_ptr = (unsigned char *)the_jnode->info.linearfile.direct; if (my_length > (the_jnode->info.linearfile.size - start)) my_length = the_jnode->info.linearfile.size - start; memcpy(dest, &file_ptr[start], my_length); 200dfb4: 90 10 00 12 mov %l2, %o0 200dfb8: 92 02 40 11 add %o1, %l1, %o1 200dfbc: 40 00 07 fd call 200ffb0 200dfc0: 94 10 00 18 mov %i0, %o2 return copied; memcpy( dest, &(*block_ptr)[ 0 ], my_length ); copied += my_length; } IMFS_update_atime( the_jnode ); 200dfc4: 10 80 00 5d b 200e138 200dfc8: 90 07 bf f8 add %fp, -8, %o0 /* * If the last byte we are supposed to read is past the end of this * in memory file, then shorten the length to read. */ last_byte = start + length; if ( last_byte > the_jnode->info.file.size ) 200dfcc: c6 06 20 50 ld [ %i0 + 0x50 ], %g3 200dfd0: 88 10 20 00 clr %g4 /* * If the last byte we are supposed to read is past the end of this * in memory file, then shorten the length to read. */ last_byte = start + length; 200dfd4: 82 10 00 1a mov %i2, %g1 if ( last_byte > the_jnode->info.file.size ) 200dfd8: c4 06 20 54 ld [ %i0 + 0x54 ], %g2 200dfdc: 80 a1 00 03 cmp %g4, %g3 200dfe0: 14 80 00 08 bg 200e000 <== NEVER TAKEN 200dfe4: b6 07 00 1a add %i4, %i2, %i3 200dfe8: 80 a1 00 03 cmp %g4, %g3 200dfec: 32 80 00 07 bne,a 200e008 <== NEVER TAKEN 200dff0: 03 00 80 74 sethi %hi(0x201d000), %g1 <== NOT EXECUTED 200dff4: 80 a6 c0 02 cmp %i3, %g2 200dff8: 28 80 00 04 bleu,a 200e008 200dffc: 03 00 80 74 sethi %hi(0x201d000), %g1 my_length = the_jnode->info.file.size - start; 200e000: b8 20 80 01 sub %g2, %g1, %i4 */ /* * Phase 1: possibly the last part of one block */ start_offset = start % IMFS_MEMFILE_BYTES_PER_BLOCK; 200e004: 03 00 80 74 sethi %hi(0x201d000), %g1 200e008: f6 00 61 b8 ld [ %g1 + 0x1b8 ], %i3 ! 201d1b8 200e00c: 90 10 00 10 mov %l0, %o0 200e010: b5 3e e0 1f sra %i3, 0x1f, %i2 200e014: 96 10 00 1b mov %i3, %o3 200e018: 94 10 00 1a mov %i2, %o2 200e01c: 40 00 2b 76 call 2018df4 <__moddi3> 200e020: 92 10 00 11 mov %l1, %o1 block = start / IMFS_MEMFILE_BYTES_PER_BLOCK; 200e024: 94 10 00 1a mov %i2, %o2 */ /* * Phase 1: possibly the last part of one block */ start_offset = start % IMFS_MEMFILE_BYTES_PER_BLOCK; 200e028: a6 10 00 09 mov %o1, %l3 block = start / IMFS_MEMFILE_BYTES_PER_BLOCK; 200e02c: 90 10 00 10 mov %l0, %o0 200e030: 92 10 00 11 mov %l1, %o1 200e034: 40 00 2a 85 call 2018a48 <__divdi3> 200e038: 96 10 00 1b mov %i3, %o3 if ( start_offset ) { 200e03c: 80 a4 e0 00 cmp %l3, 0 200e040: 02 80 00 18 be 200e0a0 200e044: b4 10 00 09 mov %o1, %i2 to_copy = IMFS_MEMFILE_BYTES_PER_BLOCK - start_offset; 200e048: b6 26 c0 13 sub %i3, %l3, %i3 200e04c: 80 a7 00 1b cmp %i4, %i3 200e050: 08 80 00 03 bleu 200e05c 200e054: b2 10 00 1c mov %i4, %i1 200e058: 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 ); 200e05c: 90 10 00 1d mov %i5, %o0 200e060: 92 10 00 1a mov %i2, %o1 200e064: 94 10 20 00 clr %o2 200e068: 7f ff ff 25 call 200dcfc 200e06c: b0 10 20 00 clr %i0 if ( !block_ptr ) 200e070: 80 a2 20 00 cmp %o0, 0 200e074: 02 80 00 35 be 200e148 <== NEVER TAKEN 200e078: 94 10 00 19 mov %i1, %o2 return copied; memcpy( dest, &(*block_ptr)[ start_offset ], to_copy ); 200e07c: d2 02 00 00 ld [ %o0 ], %o1 200e080: 90 10 00 12 mov %l2, %o0 200e084: 92 02 40 13 add %o1, %l3, %o1 200e088: 40 00 07 ca call 200ffb0 200e08c: a4 04 80 19 add %l2, %i1, %l2 dest += to_copy; block++; 200e090: b4 06 a0 01 inc %i2 my_length -= to_copy; 200e094: b8 27 00 19 sub %i4, %i1, %i4 copied += to_copy; 200e098: 10 80 00 03 b 200e0a4 200e09c: b0 10 00 19 mov %i1, %i0 */ last_byte = start + length; if ( last_byte > the_jnode->info.file.size ) my_length = the_jnode->info.file.size - start; copied = 0; 200e0a0: b0 10 20 00 clr %i0 } /* * Phase 2: all of zero of more blocks */ to_copy = IMFS_MEMFILE_BYTES_PER_BLOCK; 200e0a4: 03 00 80 74 sethi %hi(0x201d000), %g1 * is considered an error. Read from an offset for more bytes than * are between the offset and the end of the file will result in * reading the data between offset and the end of the file (truncated * read). */ MEMFILE_STATIC ssize_t IMFS_memfile_read( 200e0a8: a4 24 80 18 sub %l2, %i0, %l2 } /* * Phase 2: all of zero of more blocks */ to_copy = IMFS_MEMFILE_BYTES_PER_BLOCK; 200e0ac: f6 00 61 b8 ld [ %g1 + 0x1b8 ], %i3 while ( my_length >= IMFS_MEMFILE_BYTES_PER_BLOCK ) { 200e0b0: 10 80 00 0f b 200e0ec 200e0b4: a0 10 00 01 mov %g1, %l0 block_ptr = IMFS_memfile_get_block_pointer( the_jnode, block, 0 ); 200e0b8: 90 10 00 1d mov %i5, %o0 200e0bc: 92 10 00 1a mov %i2, %o1 200e0c0: 7f ff ff 0f call 200dcfc 200e0c4: 94 10 20 00 clr %o2 if ( !block_ptr ) 200e0c8: 82 92 20 00 orcc %o0, 0, %g1 200e0cc: 02 80 00 1f be 200e148 <== NEVER TAKEN 200e0d0: 90 10 00 19 mov %i1, %o0 return copied; memcpy( dest, &(*block_ptr)[ 0 ], to_copy ); 200e0d4: d2 00 40 00 ld [ %g1 ], %o1 200e0d8: 94 10 00 1b mov %i3, %o2 200e0dc: 40 00 07 b5 call 200ffb0 200e0e0: b4 06 a0 01 inc %i2 dest += to_copy; block++; my_length -= to_copy; 200e0e4: b8 27 00 1b sub %i4, %i3, %i4 copied += to_copy; 200e0e8: b0 06 00 1b add %i0, %i3, %i0 /* * Phase 2: all of zero of more blocks */ to_copy = IMFS_MEMFILE_BYTES_PER_BLOCK; while ( my_length >= IMFS_MEMFILE_BYTES_PER_BLOCK ) { 200e0ec: c2 04 21 b8 ld [ %l0 + 0x1b8 ], %g1 200e0f0: 80 a7 00 01 cmp %i4, %g1 200e0f4: 1a bf ff f1 bcc 200e0b8 200e0f8: b2 04 80 18 add %l2, %i0, %i1 /* * Phase 3: possibly the first part of one block */ IMFS_assert( my_length < IMFS_MEMFILE_BYTES_PER_BLOCK ); if ( my_length ) { 200e0fc: 80 a7 20 00 cmp %i4, 0 200e100: 02 80 00 0e be 200e138 200e104: 90 07 bf f8 add %fp, -8, %o0 block_ptr = IMFS_memfile_get_block_pointer( the_jnode, block, 0 ); 200e108: 90 10 00 1d mov %i5, %o0 200e10c: 92 10 00 1a mov %i2, %o1 200e110: 7f ff fe fb call 200dcfc 200e114: 94 10 20 00 clr %o2 if ( !block_ptr ) 200e118: 82 92 20 00 orcc %o0, 0, %g1 200e11c: 02 80 00 0b be 200e148 <== NEVER TAKEN 200e120: 90 10 00 19 mov %i1, %o0 return copied; memcpy( dest, &(*block_ptr)[ 0 ], my_length ); 200e124: d2 00 40 00 ld [ %g1 ], %o1 200e128: 94 10 00 1c mov %i4, %o2 200e12c: 40 00 07 a1 call 200ffb0 200e130: b0 07 00 18 add %i4, %i0, %i0 copied += my_length; } IMFS_update_atime( the_jnode ); 200e134: 90 07 bf f8 add %fp, -8, %o0 200e138: 7f ff d5 48 call 2003658 200e13c: 92 10 20 00 clr %o1 200e140: c2 07 bf f8 ld [ %fp + -8 ], %g1 200e144: c2 27 60 40 st %g1, [ %i5 + 0x40 ] return copied; } 200e148: 81 c7 e0 08 ret 200e14c: 81 e8 00 00 restore =============================================================================== 0200e24c : * is better to stick to simple, easy to understand algorithms. */ IMFS_jnode_t *IMFS_memfile_remove( IMFS_jnode_t *the_jnode ) { 200e24c: 9d e3 bf a0 save %sp, -96, %sp /* * Eventually this could be set smarter at each call to * memfile_free_blocks_in_table to greatly speed this up. */ to_free = IMFS_MEMFILE_BLOCK_SLOTS; 200e250: 03 00 80 74 sethi %hi(0x201d000), %g1 200e254: fa 00 61 b8 ld [ %g1 + 0x1b8 ], %i5 ! 201d1b8 * + doubly indirect * + triply indirect */ info = &the_jnode->info.file; if ( info->indirect ) { 200e258: c2 06 20 58 ld [ %i0 + 0x58 ], %g1 200e25c: 80 a0 60 00 cmp %g1, 0 200e260: 02 80 00 05 be 200e274 200e264: bb 37 60 02 srl %i5, 2, %i5 memfile_free_blocks_in_table( &info->indirect, to_free ); 200e268: 90 06 20 58 add %i0, 0x58, %o0 200e26c: 7f ff ff e5 call 200e200 200e270: 92 10 00 1d mov %i5, %o1 } if ( info->doubly_indirect ) { 200e274: c2 06 20 5c ld [ %i0 + 0x5c ], %g1 200e278: b8 10 20 00 clr %i4 200e27c: 80 a0 60 00 cmp %g1, 0 200e280: 12 80 00 0d bne 200e2b4 200e284: 37 00 80 74 sethi %hi(0x201d000), %i3 } memfile_free_blocks_in_table( &info->doubly_indirect, to_free ); } if ( info->triply_indirect ) { 200e288: 10 80 00 15 b 200e2dc 200e28c: c2 06 20 60 ld [ %i0 + 0x60 ], %g1 * a significant difference in the performance of this routine. * * Regardless until the IMFS implementation is proven, it * is better to stick to simple, easy to understand algorithms. */ IMFS_jnode_t *IMFS_memfile_remove( 200e290: 83 2f 20 02 sll %i4, 2, %g1 memfile_free_blocks_in_table( &info->indirect, to_free ); } if ( info->doubly_indirect ) { for ( i=0 ; idoubly_indirect[i] ) { 200e294: 90 00 80 01 add %g2, %g1, %o0 200e298: c2 00 80 01 ld [ %g2 + %g1 ], %g1 200e29c: 80 a0 60 00 cmp %g1, 0 200e2a0: 22 80 00 05 be,a 200e2b4 <== NEVER TAKEN 200e2a4: b8 07 20 01 inc %i4 <== NOT EXECUTED memfile_free_blocks_in_table( 200e2a8: 7f ff ff d6 call 200e200 200e2ac: 92 10 00 1d mov %i5, %o1 if ( info->indirect ) { memfile_free_blocks_in_table( &info->indirect, to_free ); } if ( info->doubly_indirect ) { for ( i=0 ; i 200e2c4: c4 06 20 5c ld [ %i0 + 0x5c ], %g2 if ( info->doubly_indirect[i] ) { memfile_free_blocks_in_table( (block_p **)&info->doubly_indirect[i], to_free ); } } memfile_free_blocks_in_table( &info->doubly_indirect, to_free ); 200e2c8: 90 06 20 5c add %i0, 0x5c, %o0 200e2cc: 7f ff ff cd call 200e200 200e2d0: 92 10 00 1d mov %i5, %o1 } if ( info->triply_indirect ) { 200e2d4: c2 06 20 60 ld [ %i0 + 0x60 ], %g1 200e2d8: b8 10 20 00 clr %i4 200e2dc: 80 a0 60 00 cmp %g1, 0 200e2e0: 12 80 00 1c bne 200e350 200e2e4: 33 00 80 74 sethi %hi(0x201d000), %i1 200e2e8: 81 c7 e0 08 ret 200e2ec: 81 e8 00 00 restore * a significant difference in the performance of this routine. * * Regardless until the IMFS implementation is proven, it * is better to stick to simple, easy to understand algorithms. */ IMFS_jnode_t *IMFS_memfile_remove( 200e2f0: a1 2f 20 02 sll %i4, 2, %l0 } if ( info->triply_indirect ) { for ( i=0 ; itriply_indirect[i]; 200e2f4: f6 00 40 10 ld [ %g1 + %l0 ], %i3 if ( !p ) /* ensure we have a valid pointer */ 200e2f8: 80 a6 e0 00 cmp %i3, 0 200e2fc: 02 80 00 1b be 200e368 <== NEVER TAKEN 200e300: 90 06 20 60 add %i0, 0x60, %o0 200e304: 10 80 00 09 b 200e328 200e308: b4 10 20 00 clr %i2 break; for ( j=0 ; j <== NEVER TAKEN 200e314: 90 10 00 1b mov %i3, %o0 memfile_free_blocks_in_table( (block_p **)&p[j], to_free); 200e318: 7f ff ff ba call 200e200 200e31c: 92 10 00 1d mov %i5, %o1 if ( info->triply_indirect ) { for ( i=0 ; itriply_indirect[i]; if ( !p ) /* ensure we have a valid pointer */ break; for ( j=0 ; j 200e338: c2 06 c0 00 ld [ %i3 ], %g1 if ( p[j] ) { memfile_free_blocks_in_table( (block_p **)&p[j], to_free); } } memfile_free_blocks_in_table( 200e33c: d0 06 20 60 ld [ %i0 + 0x60 ], %o0 200e340: 92 10 00 1d mov %i5, %o1 200e344: 90 02 00 10 add %o0, %l0, %o0 200e348: 7f ff ff ae call 200e200 200e34c: b8 07 20 01 inc %i4 memfile_free_blocks_in_table( &info->doubly_indirect, to_free ); } if ( info->triply_indirect ) { for ( i=0 ; i 200e360: c2 06 20 60 ld [ %i0 + 0x60 ], %g1 } } memfile_free_blocks_in_table( (block_p **)&info->triply_indirect[i], to_free ); } memfile_free_blocks_in_table( 200e364: 90 06 20 60 add %i0, 0x60, %o0 200e368: 7f ff ff a6 call 200e200 200e36c: 92 10 00 1d mov %i5, %o1 (block_p **)&info->triply_indirect, to_free ); } return the_jnode; } 200e370: 81 c7 e0 08 ret 200e374: 81 e8 00 00 restore =============================================================================== 0200e378 : */ MEMFILE_STATIC int IMFS_memfile_remove_block( IMFS_jnode_t *the_jnode, unsigned int block ) { 200e378: 9d e3 bf a0 save %sp, -96, %sp <== NOT EXECUTED block_p *block_ptr; block_p ptr; block_ptr = IMFS_memfile_get_block_pointer( the_jnode, block, 0 ); 200e37c: 94 10 20 00 clr %o2 <== NOT EXECUTED 200e380: 92 10 00 19 mov %i1, %o1 <== NOT EXECUTED 200e384: 7f ff fe 5e call 200dcfc <== NOT EXECUTED 200e388: 90 10 00 18 mov %i0, %o0 <== NOT EXECUTED 200e38c: 82 10 00 08 mov %o0, %g1 <== NOT EXECUTED IMFS_assert( block_ptr ); ptr = *block_ptr; 200e390: d0 02 00 00 ld [ %o0 ], %o0 <== NOT EXECUTED *block_ptr = 0; memfile_free_block( ptr ); return 1; } 200e394: b0 10 20 01 mov 1, %i0 <== NOT EXECUTED block_ptr = IMFS_memfile_get_block_pointer( the_jnode, block, 0 ); IMFS_assert( block_ptr ); ptr = *block_ptr; *block_ptr = 0; memfile_free_block( ptr ); 200e398: 7f ff ff 91 call 200e1dc <== NOT EXECUTED 200e39c: c0 20 40 00 clr [ %g1 ] <== NOT EXECUTED return 1; } 200e3a0: 81 c7 e0 08 ret <== NOT EXECUTED 200e3a4: 81 e8 00 00 restore <== NOT EXECUTED =============================================================================== 0200e548 : IMFS_jnode_t *the_jnode, off_t start, const unsigned char *source, unsigned int length ) { 200e548: 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 ) { 200e54c: c2 06 20 50 ld [ %i0 + 0x50 ], %g1 200e550: 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; 200e554: 96 07 00 1a add %i4, %i2, %o3 if ( last_byte > the_jnode->info.file.size ) { 200e558: 80 a0 c0 01 cmp %g3, %g1 200e55c: 14 80 00 1b bg 200e5c8 <== NEVER TAKEN 200e560: c4 06 20 54 ld [ %i0 + 0x54 ], %g2 200e564: 80 a0 c0 01 cmp %g3, %g1 200e568: 32 80 00 06 bne,a 200e580 <== NEVER TAKEN 200e56c: 03 00 80 74 sethi %hi(0x201d000), %g1 <== NOT EXECUTED 200e570: 80 a2 c0 02 cmp %o3, %g2 200e574: 18 80 00 16 bgu 200e5cc 200e578: 80 a6 40 01 cmp %i1, %g1 */ /* * Phase 1: possibly the last part of one block */ start_offset = start % IMFS_MEMFILE_BYTES_PER_BLOCK; 200e57c: 03 00 80 74 sethi %hi(0x201d000), %g1 200e580: fa 00 61 b8 ld [ %g1 + 0x1b8 ], %i5 ! 201d1b8 200e584: 92 10 00 1a mov %i2, %o1 200e588: a3 3f 60 1f sra %i5, 0x1f, %l1 200e58c: 96 10 00 1d mov %i5, %o3 200e590: 94 10 00 11 mov %l1, %o2 200e594: 40 00 2a 18 call 2018df4 <__moddi3> 200e598: 90 10 00 19 mov %i1, %o0 block = start / IMFS_MEMFILE_BYTES_PER_BLOCK; 200e59c: 90 10 00 19 mov %i1, %o0 */ /* * Phase 1: possibly the last part of one block */ start_offset = start % IMFS_MEMFILE_BYTES_PER_BLOCK; 200e5a0: a0 10 00 09 mov %o1, %l0 block = start / IMFS_MEMFILE_BYTES_PER_BLOCK; 200e5a4: 94 10 00 11 mov %l1, %o2 200e5a8: 92 10 00 1a mov %i2, %o1 200e5ac: 40 00 29 27 call 2018a48 <__divdi3> 200e5b0: 96 10 00 1d mov %i5, %o3 if ( start_offset ) { 200e5b4: 80 a4 20 00 cmp %l0, 0 200e5b8: 12 80 00 17 bne 200e614 200e5bc: b4 10 00 09 mov %o1, %i2 status = IMFS_memfile_extend( the_jnode, zero_fill, last_byte ); if ( status ) return status; } copied = 0; 200e5c0: 10 80 00 28 b 200e660 200e5c4: 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; 200e5c8: 80 a6 40 01 cmp %i1, %g1 <== NOT EXECUTED 200e5cc: 14 80 00 09 bg 200e5f0 <== NEVER TAKEN 200e5d0: 92 10 20 01 mov 1, %o1 200e5d4: 80 a6 40 01 cmp %i1, %g1 200e5d8: 32 80 00 06 bne,a 200e5f0 <== NEVER TAKEN 200e5dc: 92 10 20 00 clr %o1 <== NOT EXECUTED 200e5e0: 80 a6 80 02 cmp %i2, %g2 200e5e4: 18 80 00 04 bgu 200e5f4 200e5e8: 90 10 00 18 mov %i0, %o0 200e5ec: 92 10 20 00 clr %o1 status = IMFS_memfile_extend( the_jnode, zero_fill, last_byte ); 200e5f0: 90 10 00 18 mov %i0, %o0 200e5f4: 92 0a 60 01 and %o1, 1, %o1 200e5f8: 7f ff ff 6c call 200e3a8 200e5fc: 94 10 20 00 clr %o2 if ( status ) 200e600: 82 92 20 00 orcc %o0, 0, %g1 200e604: 22 bf ff df be,a 200e580 200e608: 03 00 80 74 sethi %hi(0x201d000), %g1 } IMFS_mtime_ctime_update( the_jnode ); return copied; } 200e60c: 81 c7 e0 08 ret 200e610: 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; 200e614: ba 27 40 10 sub %i5, %l0, %i5 200e618: 80 a7 40 1c cmp %i5, %i4 200e61c: 38 80 00 02 bgu,a 200e624 200e620: 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 ); 200e624: 90 10 00 18 mov %i0, %o0 200e628: 92 10 00 1a mov %i2, %o1 200e62c: 7f ff fd b4 call 200dcfc 200e630: 94 10 20 00 clr %o2 if ( !block_ptr ) 200e634: 80 a2 20 00 cmp %o0, 0 200e638: 02 80 00 36 be 200e710 <== NEVER TAKEN 200e63c: 82 10 20 00 clr %g1 block, to_copy, src ); #endif memcpy( &(*block_ptr)[ start_offset ], src, to_copy ); 200e640: d0 02 00 00 ld [ %o0 ], %o0 200e644: 92 10 00 1b mov %i3, %o1 200e648: 90 02 00 10 add %o0, %l0, %o0 200e64c: 94 10 00 1d mov %i5, %o2 200e650: 40 00 06 58 call 200ffb0 200e654: b6 06 c0 1d add %i3, %i5, %i3 src += to_copy; block++; 200e658: b4 06 a0 01 inc %i2 my_length -= to_copy; 200e65c: b8 27 00 1d sub %i4, %i5, %i4 /* * Phase 2: all of zero of more blocks */ to_copy = IMFS_MEMFILE_BYTES_PER_BLOCK; 200e660: 03 00 80 74 sethi %hi(0x201d000), %g1 * IMFS_memfile_write * * This routine writes the specified data buffer into the in memory * file pointed to by the_jnode. The file is extended as needed. */ MEMFILE_STATIC ssize_t IMFS_memfile_write( 200e664: b6 26 c0 1d sub %i3, %i5, %i3 /* * Phase 2: all of zero of more blocks */ to_copy = IMFS_MEMFILE_BYTES_PER_BLOCK; 200e668: f2 00 61 b8 ld [ %g1 + 0x1b8 ], %i1 while ( my_length >= IMFS_MEMFILE_BYTES_PER_BLOCK ) { 200e66c: 10 80 00 0f b 200e6a8 200e670: a2 10 00 01 mov %g1, %l1 block_ptr = IMFS_memfile_get_block_pointer( the_jnode, block, 0 ); 200e674: 90 10 00 18 mov %i0, %o0 200e678: 92 10 00 1a mov %i2, %o1 200e67c: 7f ff fd a0 call 200dcfc 200e680: 94 10 20 00 clr %o2 if ( !block_ptr ) 200e684: 80 a2 20 00 cmp %o0, 0 200e688: 02 80 00 21 be 200e70c <== NEVER TAKEN 200e68c: 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 ); 200e690: d0 02 00 00 ld [ %o0 ], %o0 200e694: 92 10 00 10 mov %l0, %o1 200e698: 40 00 06 46 call 200ffb0 200e69c: b4 06 a0 01 inc %i2 src += to_copy; block++; my_length -= to_copy; 200e6a0: b8 27 00 19 sub %i4, %i1, %i4 * IMFS_memfile_write * * This routine writes the specified data buffer into the in memory * file pointed to by the_jnode. The file is extended as needed. */ MEMFILE_STATIC ssize_t IMFS_memfile_write( 200e6a4: ba 07 40 19 add %i5, %i1, %i5 /* * Phase 2: all of zero of more blocks */ to_copy = IMFS_MEMFILE_BYTES_PER_BLOCK; while ( my_length >= IMFS_MEMFILE_BYTES_PER_BLOCK ) { 200e6a8: c2 04 61 b8 ld [ %l1 + 0x1b8 ], %g1 200e6ac: 80 a7 00 01 cmp %i4, %g1 200e6b0: 1a bf ff f1 bcc 200e674 200e6b4: a0 06 c0 1d add %i3, %i5, %l0 * Phase 3: possibly the first part of one block */ IMFS_assert( my_length < IMFS_MEMFILE_BYTES_PER_BLOCK ); to_copy = my_length; if ( my_length ) { 200e6b8: 80 a7 20 00 cmp %i4, 0 200e6bc: 02 80 00 0f be 200e6f8 200e6c0: 90 07 bf f8 add %fp, -8, %o0 block_ptr = IMFS_memfile_get_block_pointer( the_jnode, block, 0 ); 200e6c4: 90 10 00 18 mov %i0, %o0 200e6c8: 92 10 00 1a mov %i2, %o1 200e6cc: 7f ff fd 8c call 200dcfc 200e6d0: 94 10 20 00 clr %o2 if ( !block_ptr ) 200e6d4: 80 a2 20 00 cmp %o0, 0 200e6d8: 02 80 00 0e be 200e710 <== NEVER TAKEN 200e6dc: 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 ); 200e6e0: d0 02 00 00 ld [ %o0 ], %o0 200e6e4: 92 10 00 10 mov %l0, %o1 200e6e8: 94 10 00 1c mov %i4, %o2 200e6ec: 40 00 06 31 call 200ffb0 200e6f0: ba 07 40 1c add %i5, %i4, %i5 my_length = 0; copied += to_copy; } IMFS_mtime_ctime_update( the_jnode ); 200e6f4: 90 07 bf f8 add %fp, -8, %o0 200e6f8: 7f ff d3 d8 call 2003658 200e6fc: 92 10 20 00 clr %o1 200e700: c2 07 bf f8 ld [ %fp + -8 ], %g1 200e704: c2 26 20 44 st %g1, [ %i0 + 0x44 ] 200e708: c2 26 20 48 st %g1, [ %i0 + 0x48 ] */ to_copy = IMFS_MEMFILE_BYTES_PER_BLOCK; while ( my_length >= IMFS_MEMFILE_BYTES_PER_BLOCK ) { block_ptr = IMFS_memfile_get_block_pointer( the_jnode, block, 0 ); if ( !block_ptr ) 200e70c: 82 10 00 1d mov %i5, %g1 } IMFS_mtime_ctime_update( the_jnode ); return copied; } 200e710: b0 10 00 01 mov %g1, %i0 200e714: 81 c7 e0 08 ret 200e718: 81 e8 00 00 restore =============================================================================== 02002e20 : const char *name, size_t namelen, mode_t mode, dev_t dev ) { 2002e20: 9d e3 bf 80 save %sp, -128, %sp dev_t dev, IMFS_jnode_types_t *type, IMFS_types_union *info ) { if ( S_ISDIR( mode ) ) { 2002e24: 05 00 00 3c sethi %hi(0xf000), %g2 2002e28: 07 00 00 10 sethi %hi(0x4000), %g3 2002e2c: 84 0e c0 02 and %i3, %g2, %g2 2002e30: 80 a0 80 03 cmp %g2, %g3 2002e34: 02 80 00 12 be 2002e7c 2002e38: 07 00 00 20 sethi %hi(0x8000), %g3 *type = IMFS_DIRECTORY; } else if ( S_ISREG( mode ) ) { 2002e3c: 80 a0 80 03 cmp %g2, %g3 2002e40: 02 80 00 11 be 2002e84 2002e44: 09 00 00 2c sethi %hi(0xb000), %g4 *type = IMFS_MEMORY_FILE; } else if ( S_ISBLK( mode ) || S_ISCHR( mode ) ) { 2002e48: 07 00 00 08 sethi %hi(0x2000), %g3 2002e4c: 88 0e c0 04 and %i3, %g4, %g4 2002e50: 80 a1 00 03 cmp %g4, %g3 2002e54: 12 80 00 05 bne 2002e68 2002e58: 07 00 00 04 sethi %hi(0x1000), %g3 *type = IMFS_DEVICE; rtems_filesystem_split_dev_t( 2002e5c: f8 3f bf e8 std %i4, [ %fp + -24 ] if ( S_ISDIR( mode ) ) { *type = IMFS_DIRECTORY; } else if ( S_ISREG( mode ) ) { *type = IMFS_MEMORY_FILE; } else if ( S_ISBLK( mode ) || S_ISCHR( mode ) ) { *type = IMFS_DEVICE; 2002e60: 10 80 00 0a b 2002e88 2002e64: 82 10 20 01 mov 1, %g1 rtems_filesystem_split_dev_t( dev, info->device.major, info->device.minor ); } else if (S_ISFIFO( mode )) { 2002e68: 80 a0 80 03 cmp %g2, %g3 2002e6c: 32 80 00 08 bne,a 2002e8c <== NEVER TAKEN 2002e70: c4 06 20 14 ld [ %i0 + 0x14 ], %g2 <== NOT EXECUTED *type = IMFS_FIFO; 2002e74: 10 80 00 05 b 2002e88 2002e78: 82 10 20 06 mov 6, %g1 IMFS_jnode_types_t *type, IMFS_types_union *info ) { if ( S_ISDIR( mode ) ) { *type = IMFS_DIRECTORY; 2002e7c: 10 80 00 03 b 2002e88 2002e80: 82 10 20 00 clr %g1 2002e84: 82 10 20 04 mov 4, %g1 size_t namelen, mode_t mode, const IMFS_types_union *info ) { const IMFS_fs_info_t *fs_info = 2002e88: c4 06 20 14 ld [ %i0 + 0x14 ], %g2 (const IMFS_fs_info_t *) parentloc->mt_entry->fs_info; return IMFS_create_node_with_control( 2002e8c: 82 00 60 02 add %g1, 2, %g1 2002e90: c4 00 a0 08 ld [ %g2 + 8 ], %g2 2002e94: 83 28 60 02 sll %g1, 2, %g1 2002e98: d2 00 80 01 ld [ %g2 + %g1 ], %o1 2002e9c: 90 10 00 18 mov %i0, %o0 2002ea0: 94 10 00 19 mov %i1, %o2 2002ea4: 96 10 00 1a mov %i2, %o3 2002ea8: 98 10 00 1b mov %i3, %o4 2002eac: 40 00 22 1e call 200b724 2002eb0: 9a 07 bf e8 add %fp, -24, %o5 IMFS_jnode_t *new_node; get_type_and_info_by_mode_and_dev( mode, dev, &type, &info ); new_node = IMFS_create_node( parentloc, type, name, namelen, mode, &info ); if ( new_node != NULL ) { 2002eb4: 80 a2 20 00 cmp %o0, 0 2002eb8: 02 80 00 0e be 2002ef0 2002ebc: 90 07 bf e0 add %fp, -32, %o0 IMFS_jnode_t *parent = parentloc->node_access; 2002ec0: fa 06 20 08 ld [ %i0 + 8 ], %i5 IMFS_update_ctime( parent ); 2002ec4: 40 00 01 e5 call 2003658 2002ec8: 92 10 20 00 clr %o1 2002ecc: c2 07 bf e0 ld [ %fp + -32 ], %g1 IMFS_update_mtime( parent ); 2002ed0: 90 07 bf e0 add %fp, -32, %o0 new_node = IMFS_create_node( parentloc, type, name, namelen, mode, &info ); if ( new_node != NULL ) { IMFS_jnode_t *parent = parentloc->node_access; IMFS_update_ctime( parent ); 2002ed4: c2 27 60 48 st %g1, [ %i5 + 0x48 ] IMFS_update_mtime( parent ); 2002ed8: 40 00 01 e0 call 2003658 2002edc: 92 10 20 00 clr %o1 2002ee0: c2 07 bf e0 ld [ %fp + -32 ], %g1 2002ee4: c2 27 60 44 st %g1, [ %i5 + 0x44 ] size_t namelen, mode_t mode, dev_t dev ) { int rv = 0; 2002ee8: 81 c7 e0 08 ret 2002eec: 91 e8 20 00 restore %g0, 0, %o0 } else { rv = -1; } return rv; } 2002ef0: 81 c7 e0 08 ret 2002ef4: 91 e8 3f ff restore %g0, -1, %o0 =============================================================================== 02002ef8 : #endif #include "imfs.h" int IMFS_mount( rtems_filesystem_mount_table_entry_t *mt_entry ) { 2002ef8: 9d e3 bf a0 save %sp, -96, %sp int rv = 0; IMFS_jnode_t *node = mt_entry->mt_point_node->location.node_access; 2002efc: c2 06 20 20 ld [ %i0 + 0x20 ], %g1 2002f00: 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; 2002f04: c4 00 60 4c ld [ %g1 + 0x4c ], %g2 if ( IMFS_is_directory( node ) ) { 2002f08: c4 00 80 00 ld [ %g2 ], %g2 2002f0c: 80 a0 a0 00 cmp %g2, 0 2002f10: 12 80 00 0d bne 2002f44 2002f14: 01 00 00 00 nop if ( node->info.directory.mt_fs == NULL ) { 2002f18: c4 00 60 5c ld [ %g1 + 0x5c ], %g2 2002f1c: 80 a0 a0 00 cmp %g2, 0 2002f20: 12 80 00 05 bne 2002f34 <== NEVER TAKEN 2002f24: 01 00 00 00 nop node->info.directory.mt_fs = mt_entry; 2002f28: f0 20 60 5c st %i0, [ %g1 + 0x5c ] #include "imfs.h" int IMFS_mount( rtems_filesystem_mount_table_entry_t *mt_entry ) { int rv = 0; 2002f2c: 81 c7 e0 08 ret 2002f30: 91 e8 20 00 restore %g0, 0, %o0 if ( IMFS_is_directory( node ) ) { if ( node->info.directory.mt_fs == NULL ) { node->info.directory.mt_fs = mt_entry; } else { errno = EBUSY; 2002f34: 40 00 31 ce call 200f66c <__errno> <== NOT EXECUTED 2002f38: 01 00 00 00 nop <== NOT EXECUTED 2002f3c: 10 80 00 05 b 2002f50 <== NOT EXECUTED 2002f40: 82 10 20 10 mov 0x10, %g1 ! 10 <== NOT EXECUTED rv = -1; } } else { errno = ENOTDIR; 2002f44: 40 00 31 ca call 200f66c <__errno> 2002f48: 01 00 00 00 nop 2002f4c: 82 10 20 14 mov 0x14, %g1 ! 14 2002f50: c2 22 00 00 st %g1, [ %o0 ] rv = -1; } return rv; } 2002f54: 81 c7 e0 08 ret 2002f58: 91 e8 3f ff restore %g0, -1, %o0 =============================================================================== 0200bb74 : } static IMFS_jnode_t *IMFS_node_remove_directory( IMFS_jnode_t *node ) { 200bb74: 9d e3 bf a0 save %sp, -96, %sp if ( !rtems_chain_is_empty( &node->info.directory.Entries ) ) { 200bb78: 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 ); 200bb7c: 82 06 20 54 add %i0, 0x54, %g1 200bb80: 80 a0 80 01 cmp %g2, %g1 200bb84: 22 80 00 06 be,a 200bb9c 200bb88: c2 06 20 5c ld [ %i0 + 0x5c ], %g1 errno = ENOTEMPTY; 200bb8c: 40 00 0e b8 call 200f66c <__errno> 200bb90: 01 00 00 00 nop 200bb94: 10 80 00 08 b 200bbb4 200bb98: 82 10 20 5a mov 0x5a, %g1 ! 5a node = NULL; } else if ( IMFS_is_mount_point( node ) ) { 200bb9c: 80 a0 60 00 cmp %g1, 0 200bba0: 02 80 00 07 be 200bbbc <== ALWAYS TAKEN 200bba4: 01 00 00 00 nop errno = EBUSY; 200bba8: 40 00 0e b1 call 200f66c <__errno> <== NOT EXECUTED 200bbac: 01 00 00 00 nop <== NOT EXECUTED 200bbb0: 82 10 20 10 mov 0x10, %g1 ! 10 <== NOT EXECUTED 200bbb4: c2 22 00 00 st %g1, [ %o0 ] 200bbb8: b0 10 20 00 clr %i0 node = NULL; } return node; } 200bbbc: 81 c7 e0 08 ret 200bbc0: 81 e8 00 00 restore =============================================================================== 02002f5c : rtems_filesystem_node_types_t IMFS_node_type( const rtems_filesystem_location_info_t *loc ) { const IMFS_jnode_t *node = loc->node_access; 2002f5c: 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; 2002f60: c2 00 a0 4c ld [ %g2 + 0x4c ], %g1 2002f64: 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 ) { 2002f68: 80 a0 60 02 cmp %g1, 2 2002f6c: 02 80 00 06 be 2002f84 2002f70: 80 a0 60 05 cmp %g1, 5 2002f74: 12 80 00 08 bne 2002f94 <== ALWAYS TAKEN 2002f78: 90 10 20 04 mov 4, %o0 2002f7c: 81 c3 e0 08 retl <== NOT EXECUTED 2002f80: 01 00 00 00 nop <== NOT EXECUTED 2002f84: c2 00 a0 50 ld [ %g2 + 0x50 ], %g1 2002f88: c2 00 60 4c ld [ %g1 + 0x4c ], %g1 case IMFS_HARD_LINK: type = IMFS_type( node->info.hard_link.link_node ); break; 2002f8c: 81 c3 e0 08 retl 2002f90: d0 00 40 00 ld [ %g1 ], %o0 type = imfs_type; break; } return type; } 2002f94: 81 c3 e0 08 retl 2002f98: 90 10 00 01 mov %g1, %o0 =============================================================================== 02002fd8 : const rtems_filesystem_location_info_t *oldloc, const rtems_filesystem_location_info_t *newparentloc, const char *name, size_t namelen ) { 2002fd8: 9d e3 bf 98 save %sp, -104, %sp int rv = 0; IMFS_jnode_t *node = oldloc->node_access; 2002fdc: 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 ) { 2002fe0: c2 07 60 08 ld [ %i5 + 8 ], %g1 2002fe4: 80 a0 60 00 cmp %g1, 0 2002fe8: 02 80 00 20 be 2003068 <== NEVER TAKEN 2002fec: f4 06 a0 08 ld [ %i2 + 8 ], %i2 if ( namelen < IMFS_NAME_MAX ) { 2002ff0: 80 a7 20 1f cmp %i4, 0x1f 2002ff4: 18 80 00 19 bgu 2003058 <== NEVER TAKEN 2002ff8: 94 10 00 1c mov %i4, %o2 memcpy( node->name, name, namelen ); 2002ffc: 92 10 00 1b mov %i3, %o1 2003000: 40 00 33 ec call 200ffb0 2003004: 90 07 60 0c add %i5, 0xc, %o0 node->name [namelen] = '\0'; 2003008: b8 07 40 1c add %i5, %i4, %i4 200300c: c0 2f 20 0c clrb [ %i4 + 0xc ] ) { Chain_Node *next; Chain_Node *previous; next = the_node->next; 2003010: c4 07 40 00 ld [ %i5 ], %g2 previous = the_node->previous; 2003014: c2 07 60 04 ld [ %i5 + 4 ], %g1 IMFS_remove_from_directory( node ); IMFS_add_to_directory( new_parent, node ); IMFS_update_ctime( node ); 2003018: 90 07 bf f8 add %fp, -8, %o0 next->previous = previous; 200301c: c2 20 a0 04 st %g1, [ %g2 + 4 ] previous->next = next; 2003020: 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; 2003024: 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; 2003028: 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 ); 200302c: 84 06 a0 54 add %i2, 0x54, %g2 Chain_Node *old_last = tail->previous; the_node->next = tail; tail->previous = the_node; 2003030: fa 26 a0 58 st %i5, [ %i2 + 0x58 ] ) { Chain_Node *tail = _Chain_Tail( the_chain ); Chain_Node *old_last = tail->previous; the_node->next = tail; 2003034: c4 27 40 00 st %g2, [ %i5 ] tail->previous = the_node; old_last->next = the_node; 2003038: fa 20 40 00 st %i5, [ %g1 ] the_node->previous = old_last; 200303c: c2 27 60 04 st %g1, [ %i5 + 4 ] 2003040: 40 00 01 86 call 2003658 2003044: 92 10 20 00 clr %o1 2003048: c2 07 bf f8 ld [ %fp + -8 ], %g1 200304c: c2 27 60 48 st %g1, [ %i5 + 0x48 ] const rtems_filesystem_location_info_t *newparentloc, const char *name, size_t namelen ) { int rv = 0; 2003050: 81 c7 e0 08 ret 2003054: 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; 2003058: 40 00 31 85 call 200f66c <__errno> <== NOT EXECUTED 200305c: 01 00 00 00 nop <== NOT EXECUTED 2003060: 10 80 00 05 b 2003074 <== NOT EXECUTED 2003064: 82 10 20 5b mov 0x5b, %g1 ! 5b <== NOT EXECUTED rv = -1; } } else { errno = EINVAL; 2003068: 40 00 31 81 call 200f66c <__errno> <== NOT EXECUTED 200306c: 01 00 00 00 nop <== NOT EXECUTED 2003070: 82 10 20 16 mov 0x16, %g1 ! 16 <== NOT EXECUTED 2003074: c2 22 00 00 st %g1, [ %o0 ] <== NOT EXECUTED rv = -1; } return rv; } 2003078: 81 c7 e0 08 ret <== NOT EXECUTED 200307c: 91 e8 3f ff restore %g0, -1, %o0 <== NOT EXECUTED =============================================================================== 02003158 : #endif #include "imfs.h" int IMFS_unmount( rtems_filesystem_mount_table_entry_t *mt_entry ) { 2003158: 9d e3 bf a0 save %sp, -96, %sp int rv = 0; IMFS_jnode_t *node = mt_entry->mt_point_node->location.node_access; 200315c: c2 06 20 20 ld [ %i0 + 0x20 ], %g1 2003160: 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; 2003164: c4 00 60 4c ld [ %g1 + 0x4c ], %g2 if ( IMFS_is_directory( node ) ) { 2003168: c4 00 80 00 ld [ %g2 ], %g2 200316c: 80 a0 a0 00 cmp %g2, 0 2003170: 12 80 00 0d bne 20031a4 <== NEVER TAKEN 2003174: 01 00 00 00 nop if ( node->info.directory.mt_fs == mt_entry ) { 2003178: c4 00 60 5c ld [ %g1 + 0x5c ], %g2 200317c: 80 a0 80 18 cmp %g2, %i0 2003180: 12 80 00 05 bne 2003194 <== NEVER TAKEN 2003184: 01 00 00 00 nop node->info.directory.mt_fs = NULL; 2003188: c0 20 60 5c clr [ %g1 + 0x5c ] #include "imfs.h" int IMFS_unmount( rtems_filesystem_mount_table_entry_t *mt_entry ) { int rv = 0; 200318c: 81 c7 e0 08 ret 2003190: 91 e8 20 00 restore %g0, 0, %o0 if ( IMFS_is_directory( node ) ) { if ( node->info.directory.mt_fs == mt_entry ) { node->info.directory.mt_fs = NULL; } else { errno = EINVAL; 2003194: 40 00 31 36 call 200f66c <__errno> <== NOT EXECUTED 2003198: 01 00 00 00 nop <== NOT EXECUTED 200319c: 10 80 00 05 b 20031b0 <== NOT EXECUTED 20031a0: 82 10 20 16 mov 0x16, %g1 ! 16 <== NOT EXECUTED rv = -1; } } else { errno = ENOTDIR; 20031a4: 40 00 31 32 call 200f66c <__errno> <== NOT EXECUTED 20031a8: 01 00 00 00 nop <== NOT EXECUTED 20031ac: 82 10 20 14 mov 0x14, %g1 ! 14 <== NOT EXECUTED 20031b0: c2 22 00 00 st %g1, [ %o0 ] <== NOT EXECUTED rv = -1; } return rv; } 20031b4: 81 c7 e0 08 ret <== NOT EXECUTED 20031b8: 91 e8 3f ff restore %g0, -1, %o0 <== NOT EXECUTED =============================================================================== 02003844 : void RTEMS_Malloc_Initialize( const Heap_Area *areas, size_t area_count, Heap_Initialization_or_extend_handler extend ) { 2003844: 9d e3 bf a0 save %sp, -96, %sp Heap_Control *heap = RTEMS_Malloc_Heap; 2003848: 03 00 80 72 sethi %hi(0x201c800), %g1 200384c: f6 00 61 b0 ld [ %g1 + 0x1b0 ], %i3 ! 201c9b0 if ( !rtems_configuration_get_unified_work_area() ) { 2003850: 03 00 80 69 sethi %hi(0x201a400), %g1 2003854: c2 08 63 a9 ldub [ %g1 + 0x3a9 ], %g1 ! 201a7a9 2003858: 80 a0 60 00 cmp %g1, 0 200385c: 12 80 00 1b bne 20038c8 2003860: 03 00 80 74 sethi %hi(0x201d000), %g1 2003864: 3b 00 80 22 sethi %hi(0x2008800), %i5 2003868: b8 10 20 00 clr %i4 200386c: 10 80 00 0b b 2003898 2003870: ba 17 60 b0 or %i5, 0xb0, %i5 uintptr_t page_size = CPU_HEAP_ALIGNMENT; size_t i; for (i = 0; i < area_count; ++i) { const Heap_Area *area = &areas [i]; uintptr_t space_available = (*init_or_extend)( 2003874: d4 06 20 04 ld [ %i0 + 4 ], %o2 2003878: 90 10 00 1b mov %i3, %o0 200387c: 9f c7 40 00 call %i5 2003880: 96 10 20 08 mov 8, %o3 area->begin, area->size, page_size ); if ( space_available > 0 ) { 2003884: 80 a2 20 00 cmp %o0, 0 2003888: 32 80 00 02 bne,a 2003890 <== ALWAYS TAKEN 200388c: 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) { 2003890: b8 07 20 01 inc %i4 2003894: b0 06 20 08 add %i0, 8, %i0 2003898: 80 a7 00 19 cmp %i4, %i1 200389c: 32 bf ff f6 bne,a 2003874 20038a0: d2 06 00 00 ld [ %i0 ], %o1 if ( space_available > 0 ) { init_or_extend = extend; } } if ( init_or_extend == _Heap_Initialize ) { 20038a4: 03 00 80 22 sethi %hi(0x2008800), %g1 20038a8: 82 10 60 b0 or %g1, 0xb0, %g1 ! 20088b0 <_Heap_Initialize> 20038ac: 80 a7 40 01 cmp %i5, %g1 20038b0: 12 80 00 06 bne 20038c8 20038b4: 03 00 80 74 sethi %hi(0x201d000), %g1 _Internal_error_Occurred( 20038b8: 90 10 20 00 clr %o0 20038bc: 92 10 20 01 mov 1, %o1 20038c0: 40 00 14 8f call 2008afc <_Internal_error_Occurred> 20038c4: 94 10 20 17 mov 0x17, %o2 } /* * If configured, initialize the statistics support */ if ( rtems_malloc_statistics_helpers != NULL ) { 20038c8: c2 00 61 90 ld [ %g1 + 0x190 ], %g1 20038cc: 80 a0 60 00 cmp %g1, 0 20038d0: 02 80 00 05 be 20038e4 20038d4: 3b 00 80 75 sethi %hi(0x201d400), %i5 (*rtems_malloc_statistics_helpers->initialize)(); 20038d8: c2 00 40 00 ld [ %g1 ], %g1 20038dc: 9f c0 40 00 call %g1 20038e0: 01 00 00 00 nop } MSBUMP( space_available, _Protected_heap_Get_size( heap ) ); 20038e4: f8 07 60 50 ld [ %i5 + 0x50 ], %i4 20038e8: 40 00 16 dd call 200945c <_Protected_heap_Get_size> 20038ec: 90 10 00 1b mov %i3, %o0 20038f0: 90 02 00 1c add %o0, %i4, %o0 20038f4: d0 27 60 50 st %o0, [ %i5 + 0x50 ] 20038f8: 81 c7 e0 08 ret 20038fc: 81 e8 00 00 restore =============================================================================== 020224b8 : static rtems_printk_plugin_t print_handler; static void Stack_check_Dump_threads_usage( Thread_Control *the_thread ) { 20224b8: 9d e3 bf 98 save %sp, -104, %sp /* * Obtain interrupt stack information */ #if (CPU_ALLOCATE_INTERRUPT_STACK == TRUE) if (the_thread == (Thread_Control *) -1) { 20224bc: 80 a6 3f ff cmp %i0, -1 20224c0: 32 80 00 0a bne,a 20224e8 20224c4: e0 06 21 40 ld [ %i0 + 0x140 ], %l0 if (!Stack_check_Interrupt_stack.area) 20224c8: 3b 00 81 8a sethi %hi(0x2062800), %i5 20224cc: ba 17 62 9c or %i5, 0x29c, %i5 ! 2062a9c 20224d0: c2 07 60 04 ld [ %i5 + 4 ], %g1 20224d4: 80 a0 60 00 cmp %g1, 0 20224d8: 02 80 00 4c be 2022608 <== NEVER TAKEN 20224dc: a0 10 20 00 clr %l0 return; stack = &Stack_check_Interrupt_stack; the_thread = 0; 20224e0: 10 80 00 04 b 20224f0 20224e4: b0 10 20 00 clr %i0 current = 0; } else #endif { stack = &the_thread->Start.Initial_stack; 20224e8: ba 06 20 b4 add %i0, 0xb4, %i5 current = (void *)_CPU_Context_Get_SP( &the_thread->Registers ); } low = Stack_check_usable_stack_start(stack); 20224ec: c2 07 60 04 ld [ %i5 + 4 ], %g1 size = Stack_check_usable_stack_size(stack); 20224f0: f2 07 40 00 ld [ %i5 ], %i1 { stack = &the_thread->Start.Initial_stack; current = (void *)_CPU_Context_Get_SP( &the_thread->Registers ); } low = Stack_check_usable_stack_start(stack); 20224f4: 84 00 60 10 add %g1, 0x10, %g2 size = Stack_check_usable_stack_size(stack); 20224f8: b2 06 7f f0 add %i1, -16, %i1 /* * start at lower memory and find first word that does not * match pattern */ base += PATTERN_SIZE_WORDS; 20224fc: 82 00 60 20 add %g1, 0x20, %g1 for (ebase = base + length; base < ebase; base++) 2022500: 86 0e 7f fc and %i1, -4, %g3 if (*base != U32_PATTERN) 2022504: 09 29 69 69 sethi %hi(0xa5a5a400), %g4 * start at lower memory and find first word that does not * match pattern */ base += PATTERN_SIZE_WORDS; for (ebase = base + length; base < ebase; base++) 2022508: 86 00 40 03 add %g1, %g3, %g3 if (*base != U32_PATTERN) 202250c: 10 80 00 06 b 2022524 2022510: 88 11 21 a5 or %g4, 0x1a5, %g4 2022514: 80 a7 00 04 cmp %i4, %g4 2022518: 12 80 00 08 bne 2022538 202251c: 80 a0 60 00 cmp %g1, 0 * start at lower memory and find first word that does not * match pattern */ base += PATTERN_SIZE_WORDS; for (ebase = base + length; base < ebase; base++) 2022520: 82 00 60 04 add %g1, 4, %g1 2022524: 80 a0 40 03 cmp %g1, %g3 2022528: 2a bf ff fb bcs,a 2022514 <== ALWAYS TAKEN 202252c: f8 00 40 00 ld [ %g1 ], %i4 high_water_mark = Stack_check_find_high_water_mark(low, size); if ( high_water_mark ) used = Stack_check_Calculate_used( low, size, high_water_mark ); else used = 0; 2022530: 10 80 00 06 b 2022548 <== NOT EXECUTED 2022534: b8 10 20 00 clr %i4 <== NOT EXECUTED low = Stack_check_usable_stack_start(stack); size = Stack_check_usable_stack_size(stack); high_water_mark = Stack_check_find_high_water_mark(low, size); if ( high_water_mark ) 2022538: 02 80 00 04 be 2022548 <== NEVER TAKEN 202253c: b8 10 20 00 clr %i4 used = Stack_check_Calculate_used( low, size, high_water_mark ); 2022540: b8 00 80 19 add %g2, %i1, %i4 2022544: b8 27 00 01 sub %i4, %g1, %i4 else used = 0; #if (CPU_ALLOCATE_INTERRUPT_STACK == TRUE) if ( the_thread ) 2022548: 80 a6 20 00 cmp %i0, 0 202254c: 02 80 00 12 be 2022594 2022550: 03 00 81 86 sethi %hi(0x2061800), %g1 #endif { (*print_handler)( 2022554: f6 06 20 08 ld [ %i0 + 8 ], %i3 2022558: f4 00 60 a8 ld [ %g1 + 0xa8 ], %i2 202255c: 03 00 81 86 sethi %hi(0x2061800), %g1 2022560: e2 00 60 a4 ld [ %g1 + 0xa4 ], %l1 ! 20618a4 2022564: 94 07 bf f8 add %fp, -8, %o2 2022568: 90 10 00 1b mov %i3, %o0 202256c: 7f ff b2 49 call 200ee90 2022570: 92 10 20 05 mov 5, %o1 2022574: 13 00 81 61 sethi %hi(0x2058400), %o1 2022578: 96 10 00 08 mov %o0, %o3 202257c: 92 12 63 f0 or %o1, 0x3f0, %o1 2022580: 90 10 00 11 mov %l1, %o0 2022584: 9f c6 80 00 call %i2 2022588: 94 10 00 1b mov %i3, %o2 (*print_handler)( print_context, " %010p - %010p %010p %8" PRId32 " ", stack->area, stack->area + stack->size - 1, 202258c: 10 80 00 0a b 20225b4 2022590: d4 07 60 04 ld [ %i5 + 4 ], %o2 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 ); 2022594: 05 00 81 86 sethi %hi(0x2061800), %g2 2022598: c2 00 60 a8 ld [ %g1 + 0xa8 ], %g1 202259c: d0 00 a0 a4 ld [ %g2 + 0xa4 ], %o0 20225a0: 13 00 81 62 sethi %hi(0x2058800), %o1 20225a4: 94 10 3f ff mov -1, %o2 20225a8: 9f c0 40 00 call %g1 20225ac: 92 12 60 00 mov %o1, %o1 (*print_handler)( print_context, " %010p - %010p %010p %8" PRId32 " ", stack->area, stack->area + stack->size - 1, 20225b0: d4 07 60 04 ld [ %i5 + 4 ], %o2 else { (*print_handler)( print_context, "0x%08" PRIx32 " INTR", ~0 ); } #endif (*print_handler)( 20225b4: 35 00 81 86 sethi %hi(0x2061800), %i2 20225b8: 37 00 81 86 sethi %hi(0x2061800), %i3 print_context, " %010p - %010p %010p %8" PRId32 " ", stack->area, stack->area + stack->size - 1, 20225bc: d6 07 40 00 ld [ %i5 ], %o3 else { (*print_handler)( print_context, "0x%08" PRIx32 " INTR", ~0 ); } #endif (*print_handler)( 20225c0: c2 06 a0 a8 ld [ %i2 + 0xa8 ], %g1 20225c4: d0 06 e0 a4 ld [ %i3 + 0xa4 ], %o0 print_context, " %010p - %010p %010p %8" PRId32 " ", stack->area, stack->area + stack->size - 1, 20225c8: 96 02 ff ff add %o3, -1, %o3 else { (*print_handler)( print_context, "0x%08" PRIx32 " INTR", ~0 ); } #endif (*print_handler)( 20225cc: 13 00 81 62 sethi %hi(0x2058800), %o1 20225d0: 96 02 80 0b add %o2, %o3, %o3 20225d4: 92 12 60 10 or %o1, 0x10, %o1 20225d8: 98 10 00 10 mov %l0, %o4 20225dc: 9f c0 40 00 call %g1 20225e0: 9a 10 00 19 mov %i1, %o5 stack->area + stack->size - 1, current, size ); if (Stack_check_Initialized == 0) { 20225e4: 03 00 81 86 sethi %hi(0x2061800), %g1 20225e8: c2 00 60 a0 ld [ %g1 + 0xa0 ], %g1 ! 20618a0 (*print_handler)( print_context, "Unavailable\n" ); 20225ec: d0 06 e0 a4 ld [ %i3 + 0xa4 ], %o0 stack->area + stack->size - 1, current, size ); if (Stack_check_Initialized == 0) { 20225f0: 80 a0 60 00 cmp %g1, 0 20225f4: 12 80 00 07 bne 2022610 <== ALWAYS TAKEN 20225f8: c2 06 a0 a8 ld [ %i2 + 0xa8 ], %g1 (*print_handler)( print_context, "Unavailable\n" ); 20225fc: 13 00 81 62 sethi %hi(0x2058800), %o1 <== NOT EXECUTED 2022600: 9f c0 40 00 call %g1 <== NOT EXECUTED 2022604: 92 12 60 30 or %o1, 0x30, %o1 ! 2058830 <== NOT EXECUTED 2022608: 81 c7 e0 08 ret <== NOT EXECUTED 202260c: 81 e8 00 00 restore <== NOT EXECUTED } else { (*print_handler)( print_context, "%8" PRId32 "\n", used ); 2022610: 13 00 81 62 sethi %hi(0x2058800), %o1 2022614: 94 10 00 1c mov %i4, %o2 2022618: 9f c0 40 00 call %g1 202261c: 92 12 60 40 or %o1, 0x40, %o1 2022620: 81 c7 e0 08 ret 2022624: 81 e8 00 00 restore =============================================================================== 02022710 : Thread_Control *running, bool pattern_ok ) RTEMS_COMPILER_NO_RETURN_ATTRIBUTE; void Stack_check_report_blown_task(Thread_Control *running, bool pattern_ok) { 2022710: 9d e3 bf 80 save %sp, -128, %sp Stack_Control *stack = &running->Start.Initial_stack; void *pattern_area = Stack_check_Get_pattern(stack); char name[32]; printk("BLOWN STACK!!!\n"); 2022714: 11 00 81 62 sethi %hi(0x2058800), %o0 ) 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); 2022718: fa 06 20 b8 ld [ %i0 + 0xb8 ], %i5 char name[32]; printk("BLOWN STACK!!!\n"); 202271c: 7f ff 86 96 call 2004174 2022720: 90 12 20 48 or %o0, 0x48, %o0 printk("task control block: 0x%08" PRIxPTR "\n", running); 2022724: 92 10 00 18 mov %i0, %o1 2022728: 11 00 81 62 sethi %hi(0x2058800), %o0 202272c: 7f ff 86 92 call 2004174 2022730: 90 12 20 58 or %o0, 0x58, %o0 ! 2058858 printk("task ID: 0x%08lx\n", (unsigned long) running->Object.id); 2022734: d2 06 20 08 ld [ %i0 + 8 ], %o1 2022738: 11 00 81 62 sethi %hi(0x2058800), %o0 202273c: 7f ff 86 8e call 2004174 2022740: 90 12 20 78 or %o0, 0x78, %o0 ! 2058878 printk( 2022744: d2 06 20 0c ld [ %i0 + 0xc ], %o1 2022748: 11 00 81 62 sethi %hi(0x2058800), %o0 202274c: 7f ff 86 8a call 2004174 2022750: 90 12 20 90 or %o0, 0x90, %o0 ! 2058890 "task name: 0x%08" PRIx32 "\n", running->Object.name.name_u32 ); printk( 2022754: d0 06 20 08 ld [ %i0 + 8 ], %o0 2022758: 94 07 bf e0 add %fp, -32, %o2 202275c: 7f ff b1 cd call 200ee90 2022760: 92 10 20 20 mov 0x20, %o1 2022764: 92 10 00 08 mov %o0, %o1 2022768: 11 00 81 62 sethi %hi(0x2058800), %o0 202276c: 7f ff 86 82 call 2004174 2022770: 90 12 20 a8 or %o0, 0xa8, %o0 ! 20588a8 ); printk( "task stack area (%lu Bytes): 0x%08" PRIxPTR " .. 0x%08" PRIxPTR "\n", (unsigned long) stack->size, stack->area, ((char *) stack->area + stack->size) 2022774: d4 06 20 b8 ld [ %i0 + 0xb8 ], %o2 2022778: d2 06 20 b4 ld [ %i0 + 0xb4 ], %o1 ); printk( "task name string: %s\n", rtems_object_get_name(running->Object.id, sizeof(name), name) ); printk( 202277c: 11 00 81 62 sethi %hi(0x2058800), %o0 2022780: 96 02 80 09 add %o2, %o1, %o3 2022784: 7f ff 86 7c call 2004174 2022788: 90 12 20 c0 or %o0, 0xc0, %o0 "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) { 202278c: 80 a6 60 00 cmp %i1, 0 2022790: 32 80 00 09 bne,a 20227b4 <== NEVER TAKEN 2022794: d2 06 20 0c ld [ %i0 + 0xc ], %o1 <== NOT EXECUTED printk( 2022798: 11 00 81 62 sethi %hi(0x2058800), %o0 202279c: 92 10 20 10 mov 0x10, %o1 20227a0: 90 12 20 f0 or %o0, 0xf0, %o0 20227a4: 94 07 60 08 add %i5, 8, %o2 20227a8: 7f ff 86 73 call 2004174 20227ac: 96 07 60 18 add %i5, 0x18, %o3 rtems_configuration_get_user_multiprocessing_table()->node ); } #endif rtems_fatal( 20227b0: d2 06 20 0c ld [ %i0 + 0xc ], %o1 20227b4: 7f ff 94 e6 call 2007b4c 20227b8: 90 10 20 09 mov 9, %o0 =============================================================================== 0200a790 <_CORE_RWLock_Release>: #include CORE_RWLock_Status _CORE_RWLock_Release( CORE_RWLock_Control *the_rwlock ) { 200a790: 9d e3 bf a0 save %sp, -96, %sp ISR_Level level; Thread_Control *executing = _Thread_Executing; 200a794: 03 00 80 83 sethi %hi(0x2020c00), %g1 * Otherwise, we have to block. * If locked for reading and no waiters, then OK to read. * If any thread is waiting, then we wait. */ _ISR_Disable( level ); 200a798: 7f ff e4 d2 call 2003ae0 200a79c: fa 00 60 10 ld [ %g1 + 0x10 ], %i5 ! 2020c10 <_Per_CPU_Information+0x10> 200a7a0: 84 10 00 08 mov %o0, %g2 if ( the_rwlock->current_state == CORE_RWLOCK_UNLOCKED){ 200a7a4: c2 06 20 44 ld [ %i0 + 0x44 ], %g1 200a7a8: 80 a0 60 00 cmp %g1, 0 200a7ac: 12 80 00 08 bne 200a7cc <_CORE_RWLock_Release+0x3c> 200a7b0: 80 a0 60 01 cmp %g1, 1 _ISR_Enable( level ); 200a7b4: 7f ff e4 cf call 2003af0 200a7b8: b0 10 20 00 clr %i0 executing->Wait.return_code = CORE_RWLOCK_UNAVAILABLE; 200a7bc: 82 10 20 02 mov 2, %g1 200a7c0: c2 27 60 34 st %g1, [ %i5 + 0x34 ] 200a7c4: 81 c7 e0 08 ret 200a7c8: 81 e8 00 00 restore return CORE_RWLOCK_SUCCESSFUL; } if ( the_rwlock->current_state == CORE_RWLOCK_LOCKED_FOR_READING ) { 200a7cc: 32 80 00 0b bne,a 200a7f8 <_CORE_RWLock_Release+0x68> 200a7d0: c0 27 60 34 clr [ %i5 + 0x34 ] the_rwlock->number_of_readers -= 1; 200a7d4: c2 06 20 48 ld [ %i0 + 0x48 ], %g1 200a7d8: 82 00 7f ff add %g1, -1, %g1 if ( the_rwlock->number_of_readers != 0 ) { 200a7dc: 80 a0 60 00 cmp %g1, 0 200a7e0: 02 80 00 05 be 200a7f4 <_CORE_RWLock_Release+0x64> 200a7e4: c2 26 20 48 st %g1, [ %i0 + 0x48 ] /* must be unlocked again */ _ISR_Enable( level ); 200a7e8: 7f ff e4 c2 call 2003af0 200a7ec: b0 10 20 00 clr %i0 return CORE_RWLOCK_SUCCESSFUL; 200a7f0: 30 80 00 24 b,a 200a880 <_CORE_RWLock_Release+0xf0> } } /* CORE_RWLOCK_LOCKED_FOR_WRITING or READING with readers */ executing->Wait.return_code = CORE_RWLOCK_SUCCESSFUL; 200a7f4: c0 27 60 34 clr [ %i5 + 0x34 ] /* * Implicitly transition to "unlocked" and find another thread interested * in obtaining this rwlock. */ the_rwlock->current_state = CORE_RWLOCK_UNLOCKED; 200a7f8: c0 26 20 44 clr [ %i0 + 0x44 ] _ISR_Enable( level ); 200a7fc: 7f ff e4 bd call 2003af0 200a800: 90 10 00 02 mov %g2, %o0 next = _Thread_queue_Dequeue( &the_rwlock->Wait_queue ); 200a804: 40 00 07 b3 call 200c6d0 <_Thread_queue_Dequeue> 200a808: 90 10 00 18 mov %i0, %o0 if ( next ) { 200a80c: 80 a2 20 00 cmp %o0, 0 200a810: 22 80 00 1c be,a 200a880 <_CORE_RWLock_Release+0xf0> 200a814: b0 10 20 00 clr %i0 if ( next->Wait.option == CORE_RWLOCK_THREAD_WAITING_FOR_WRITE ) { 200a818: c2 02 20 30 ld [ %o0 + 0x30 ], %g1 200a81c: 80 a0 60 01 cmp %g1, 1 200a820: 32 80 00 05 bne,a 200a834 <_CORE_RWLock_Release+0xa4> 200a824: c2 06 20 48 ld [ %i0 + 0x48 ], %g1 the_rwlock->current_state = CORE_RWLOCK_LOCKED_FOR_WRITING; 200a828: 82 10 20 02 mov 2, %g1 return CORE_RWLOCK_SUCCESSFUL; 200a82c: 10 80 00 14 b 200a87c <_CORE_RWLock_Release+0xec> 200a830: c2 26 20 44 st %g1, [ %i0 + 0x44 ] } /* * Must be CORE_RWLOCK_THREAD_WAITING_FOR_READING */ the_rwlock->number_of_readers += 1; 200a834: 82 00 60 01 inc %g1 200a838: c2 26 20 48 st %g1, [ %i0 + 0x48 ] the_rwlock->current_state = CORE_RWLOCK_LOCKED_FOR_READING; 200a83c: 82 10 20 01 mov 1, %g1 200a840: 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 ); 200a844: 40 00 08 df call 200cbc0 <_Thread_queue_First> 200a848: 90 10 00 18 mov %i0, %o0 if ( !next || 200a84c: 92 92 20 00 orcc %o0, 0, %o1 200a850: 22 80 00 0c be,a 200a880 <_CORE_RWLock_Release+0xf0> 200a854: b0 10 20 00 clr %i0 200a858: c2 02 60 30 ld [ %o1 + 0x30 ], %g1 200a85c: 80 a0 60 01 cmp %g1, 1 200a860: 02 80 00 07 be 200a87c <_CORE_RWLock_Release+0xec> <== NEVER TAKEN 200a864: 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; 200a868: c2 06 20 48 ld [ %i0 + 0x48 ], %g1 200a86c: 82 00 60 01 inc %g1 _Thread_queue_Extract( &the_rwlock->Wait_queue, next ); 200a870: 40 00 08 85 call 200ca84 <_Thread_queue_Extract> 200a874: c2 26 20 48 st %g1, [ %i0 + 0x48 ] } 200a878: 30 bf ff f3 b,a 200a844 <_CORE_RWLock_Release+0xb4> } /* indentation is to match _ISR_Disable at top */ return CORE_RWLOCK_SUCCESSFUL; } 200a87c: b0 10 20 00 clr %i0 200a880: 81 c7 e0 08 ret 200a884: 81 e8 00 00 restore =============================================================================== 0200a888 <_CORE_RWLock_Timeout>: void _CORE_RWLock_Timeout( Objects_Id id, void *ignored ) { 200a888: 9d e3 bf 98 save %sp, -104, %sp Thread_Control *the_thread; Objects_Locations location; the_thread = _Thread_Get( id, &location ); 200a88c: 90 10 00 18 mov %i0, %o0 200a890: 40 00 06 b5 call 200c364 <_Thread_Get> 200a894: 92 07 bf fc add %fp, -4, %o1 switch ( location ) { 200a898: c2 07 bf fc ld [ %fp + -4 ], %g1 200a89c: 80 a0 60 00 cmp %g1, 0 200a8a0: 12 80 00 08 bne 200a8c0 <_CORE_RWLock_Timeout+0x38> <== NEVER TAKEN 200a8a4: 01 00 00 00 nop #if defined(RTEMS_MULTIPROCESSING) case OBJECTS_REMOTE: /* impossible */ #endif break; case OBJECTS_LOCAL: _Thread_queue_Process_timeout( the_thread ); 200a8a8: 40 00 09 03 call 200ccb4 <_Thread_queue_Process_timeout> 200a8ac: 01 00 00 00 nop * * This routine decrements the thread dispatch level. */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_decrement_disable_level(void) { uint32_t level = _Thread_Dispatch_disable_level; 200a8b0: 03 00 80 81 sethi %hi(0x2020400), %g1 200a8b4: c4 00 62 e0 ld [ %g1 + 0x2e0 ], %g2 ! 20206e0 <_Thread_Dispatch_disable_level> --level; 200a8b8: 84 00 bf ff add %g2, -1, %g2 _Thread_Dispatch_disable_level = level; 200a8bc: c4 20 62 e0 st %g2, [ %g1 + 0x2e0 ] 200a8c0: 81 c7 e0 08 ret 200a8c4: 81 e8 00 00 restore =============================================================================== 020085d8 <_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 ) { 20085d8: 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)) ) { 20085dc: 90 10 00 18 mov %i0, %o0 20085e0: 40 00 07 83 call 200a3ec <_Thread_queue_Dequeue> 20085e4: ba 10 00 18 mov %i0, %i5 20085e8: 80 a2 20 00 cmp %o0, 0 20085ec: 12 80 00 0e bne 2008624 <_CORE_semaphore_Surrender+0x4c> 20085f0: 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 ); 20085f4: 7f ff e7 f4 call 20025c4 20085f8: 01 00 00 00 nop if ( the_semaphore->count < the_semaphore->Attributes.maximum_count ) 20085fc: c2 07 60 48 ld [ %i5 + 0x48 ], %g1 2008600: c4 07 60 40 ld [ %i5 + 0x40 ], %g2 2008604: 80 a0 40 02 cmp %g1, %g2 2008608: 1a 80 00 05 bcc 200861c <_CORE_semaphore_Surrender+0x44> <== NEVER TAKEN 200860c: b0 10 20 04 mov 4, %i0 the_semaphore->count += 1; 2008610: 82 00 60 01 inc %g1 { Thread_Control *the_thread; ISR_Level level; CORE_semaphore_Status status; status = CORE_SEMAPHORE_STATUS_SUCCESSFUL; 2008614: b0 10 20 00 clr %i0 #endif } else { _ISR_Disable( level ); if ( the_semaphore->count < the_semaphore->Attributes.maximum_count ) the_semaphore->count += 1; 2008618: c2 27 60 48 st %g1, [ %i5 + 0x48 ] else status = CORE_SEMAPHORE_MAXIMUM_COUNT_EXCEEDED; _ISR_Enable( level ); 200861c: 7f ff e7 ee call 20025d4 2008620: 01 00 00 00 nop } return status; } 2008624: 81 c7 e0 08 ret 2008628: 81 e8 00 00 restore =============================================================================== 02007260 <_Event_Surrender>: rtems_event_set event_in, Event_Control *event, Thread_blocking_operation_States *sync_state, States_Control wait_state ) { 2007260: 9d e3 bf a0 save %sp, -96, %sp rtems_event_set pending_events; rtems_event_set event_condition; rtems_event_set seized_events; rtems_option option_set; option_set = the_thread->Wait.option; 2007264: e0 06 20 30 ld [ %i0 + 0x30 ], %l0 _ISR_Disable( level ); 2007268: 7f ff ec d7 call 20025c4 200726c: ba 10 00 18 mov %i0, %i5 2007270: b0 10 00 08 mov %o0, %i0 RTEMS_INLINE_ROUTINE void _Event_sets_Post( rtems_event_set the_new_events, rtems_event_set *the_event_set ) { *the_event_set |= the_new_events; 2007274: c2 06 80 00 ld [ %i2 ], %g1 2007278: b2 16 40 01 or %i1, %g1, %i1 200727c: f2 26 80 00 st %i1, [ %i2 ] _Event_sets_Post( event_in, &event->pending_events ); pending_events = event->pending_events; event_condition = the_thread->Wait.count; 2007280: c4 07 60 24 ld [ %i5 + 0x24 ], %g2 seized_events = _Event_sets_Get( pending_events, event_condition ); /* * No events were seized in this operation */ if ( _Event_sets_Is_empty( seized_events ) ) { 2007284: 82 8e 40 02 andcc %i1, %g2, %g1 2007288: 02 80 00 3d be 200737c <_Event_Surrender+0x11c> 200728c: 07 00 80 76 sethi %hi(0x201d800), %g3 /* * If we are in an ISR and sending to the current thread, then * we have a critical section issue to deal with. */ if ( _ISR_Is_in_progress() && 2007290: 86 10 e2 f0 or %g3, 0x2f0, %g3 ! 201daf0 <_Per_CPU_Information> 2007294: c8 00 e0 08 ld [ %g3 + 8 ], %g4 2007298: 80 a1 20 00 cmp %g4, 0 200729c: 22 80 00 18 be,a 20072fc <_Event_Surrender+0x9c> 20072a0: c6 07 60 10 ld [ %i5 + 0x10 ], %g3 20072a4: c6 00 e0 10 ld [ %g3 + 0x10 ], %g3 20072a8: 80 a7 40 03 cmp %i5, %g3 20072ac: 32 80 00 14 bne,a 20072fc <_Event_Surrender+0x9c> 20072b0: c6 07 60 10 ld [ %i5 + 0x10 ], %g3 _Thread_Is_executing( the_thread ) && ((*sync_state == THREAD_BLOCKING_OPERATION_TIMEOUT) || 20072b4: c6 06 c0 00 ld [ %i3 ], %g3 20072b8: 86 00 ff ff add %g3, -1, %g3 /* * If we are in an ISR and sending to the current thread, then * we have a critical section issue to deal with. */ if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) && 20072bc: 80 a0 e0 01 cmp %g3, 1 20072c0: 38 80 00 0f bgu,a 20072fc <_Event_Surrender+0x9c> 20072c4: c6 07 60 10 ld [ %i5 + 0x10 ], %g3 ((*sync_state == THREAD_BLOCKING_OPERATION_TIMEOUT) || (*sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED)) ) { if ( seized_events == event_condition || _Options_Is_any(option_set) ) { 20072c8: 80 a0 40 02 cmp %g1, %g2 20072cc: 02 80 00 04 be 20072dc <_Event_Surrender+0x7c> 20072d0: 80 8c 20 02 btst 2, %l0 20072d4: 02 80 00 2a be 200737c <_Event_Surrender+0x11c> <== NEVER TAKEN 20072d8: 01 00 00 00 nop RTEMS_INLINE_ROUTINE rtems_event_set _Event_sets_Clear( rtems_event_set the_event_set, rtems_event_set the_mask ) { return ( the_event_set & ~(the_mask) ); 20072dc: 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; 20072e0: c4 07 60 28 ld [ %i5 + 0x28 ], %g2 if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) && ((*sync_state == THREAD_BLOCKING_OPERATION_TIMEOUT) || (*sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED)) ) { if ( seized_events == event_condition || _Options_Is_any(option_set) ) { event->pending_events = _Event_sets_Clear( 20072e4: f2 26 80 00 st %i1, [ %i2 ] pending_events, seized_events ); the_thread->Wait.count = 0; 20072e8: c0 27 60 24 clr [ %i5 + 0x24 ] *(rtems_event_set *)the_thread->Wait.return_argument = seized_events; 20072ec: c2 20 80 00 st %g1, [ %g2 ] *sync_state = THREAD_BLOCKING_OPERATION_SATISFIED; 20072f0: 82 10 20 03 mov 3, %g1 20072f4: 10 80 00 22 b 200737c <_Event_Surrender+0x11c> 20072f8: c2 26 c0 00 st %g1, [ %i3 ] } /* * Otherwise, this is a normal send to another thread */ if ( _States_Are_set( the_thread->current_state, wait_state ) ) { 20072fc: 80 8f 00 03 btst %i4, %g3 2007300: 02 80 00 1f be 200737c <_Event_Surrender+0x11c> 2007304: 80 a0 40 02 cmp %g1, %g2 if ( seized_events == event_condition || _Options_Is_any( option_set ) ) { 2007308: 02 80 00 04 be 2007318 <_Event_Surrender+0xb8> 200730c: 80 8c 20 02 btst 2, %l0 2007310: 02 80 00 1b be 200737c <_Event_Surrender+0x11c> <== NEVER TAKEN 2007314: 01 00 00 00 nop event->pending_events = _Event_sets_Clear( pending_events, seized_events ); the_thread->Wait.count = 0; *(rtems_event_set *)the_thread->Wait.return_argument = seized_events; 2007318: c4 07 60 28 ld [ %i5 + 0x28 ], %g2 200731c: b2 2e 40 01 andn %i1, %g1, %i1 /* * Otherwise, this is a normal send to another thread */ if ( _States_Are_set( the_thread->current_state, wait_state ) ) { if ( seized_events == event_condition || _Options_Is_any( option_set ) ) { event->pending_events = _Event_sets_Clear( 2007320: f2 26 80 00 st %i1, [ %i2 ] pending_events, seized_events ); the_thread->Wait.count = 0; 2007324: c0 27 60 24 clr [ %i5 + 0x24 ] *(rtems_event_set *)the_thread->Wait.return_argument = seized_events; 2007328: c2 20 80 00 st %g1, [ %g2 ] _ISR_Flash( level ); 200732c: 7f ff ec aa call 20025d4 2007330: 90 10 00 18 mov %i0, %o0 2007334: 7f ff ec a4 call 20025c4 2007338: 01 00 00 00 nop if ( !_Watchdog_Is_active( &the_thread->Timer ) ) { 200733c: c2 07 60 50 ld [ %i5 + 0x50 ], %g1 2007340: 80 a0 60 02 cmp %g1, 2 2007344: 02 80 00 06 be 200735c <_Event_Surrender+0xfc> 2007348: 82 10 20 03 mov 3, %g1 _ISR_Enable( level ); 200734c: 7f ff ec a2 call 20025d4 2007350: 33 04 01 ff sethi %hi(0x1007fc00), %i1 RTEMS_INLINE_ROUTINE void _Thread_Unblock ( Thread_Control *the_thread ) { _Thread_Clear_state( the_thread, STATES_BLOCKED ); 2007354: 10 80 00 08 b 2007374 <_Event_Surrender+0x114> 2007358: b2 16 63 f8 or %i1, 0x3f8, %i1 ! 1007fff8 RTEMS_INLINE_ROUTINE void _Watchdog_Deactivate( Watchdog_Control *the_watchdog ) { the_watchdog->state = WATCHDOG_REMOVE_IT; 200735c: c2 27 60 50 st %g1, [ %i5 + 0x50 ] _Thread_Unblock( the_thread ); } else { _Watchdog_Deactivate( &the_thread->Timer ); _ISR_Enable( level ); 2007360: 7f ff ec 9d call 20025d4 2007364: 33 04 01 ff sethi %hi(0x1007fc00), %i1 (void) _Watchdog_Remove( &the_thread->Timer ); 2007368: 40 00 0e b7 call 200ae44 <_Watchdog_Remove> 200736c: 90 07 60 48 add %i5, 0x48, %o0 2007370: b2 16 63 f8 or %i1, 0x3f8, %i1 2007374: 40 00 0a 49 call 2009c98 <_Thread_Clear_state> 2007378: 91 e8 00 1d restore %g0, %i5, %o0 _Thread_Unblock( the_thread ); } return; } } _ISR_Enable( level ); 200737c: 7f ff ec 96 call 20025d4 2007380: 81 e8 00 00 restore =============================================================================== 02007384 <_Event_Timeout>: void _Event_Timeout( Objects_Id id, void *arg ) { 2007384: 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 ); 2007388: 90 10 00 18 mov %i0, %o0 200738c: 40 00 0b 3d call 200a080 <_Thread_Get> 2007390: 92 07 bf fc add %fp, -4, %o1 switch ( location ) { 2007394: c2 07 bf fc ld [ %fp + -4 ], %g1 2007398: 80 a0 60 00 cmp %g1, 0 200739c: 12 80 00 1b bne 2007408 <_Event_Timeout+0x84> <== NEVER TAKEN 20073a0: 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 ); 20073a4: 7f ff ec 88 call 20025c4 20073a8: 01 00 00 00 nop RTEMS_INLINE_ROUTINE bool _Thread_Is_executing ( const Thread_Control *the_thread ) { return ( the_thread == _Thread_Executing ); 20073ac: 03 00 80 76 sethi %hi(0x201d800), %g1 return; } #endif the_thread->Wait.count = 0; if ( _Thread_Is_executing( the_thread ) ) { 20073b0: c2 00 63 00 ld [ %g1 + 0x300 ], %g1 ! 201db00 <_Per_CPU_Information+0x10> 20073b4: 80 a7 40 01 cmp %i5, %g1 20073b8: 12 80 00 08 bne 20073d8 <_Event_Timeout+0x54> 20073bc: c0 27 60 24 clr [ %i5 + 0x24 ] if ( *sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED ) 20073c0: c2 06 40 00 ld [ %i1 ], %g1 20073c4: 80 a0 60 01 cmp %g1, 1 20073c8: 12 80 00 05 bne 20073dc <_Event_Timeout+0x58> 20073cc: 82 10 20 06 mov 6, %g1 *sync_state = THREAD_BLOCKING_OPERATION_TIMEOUT; 20073d0: 82 10 20 02 mov 2, %g1 20073d4: c2 26 40 00 st %g1, [ %i1 ] } the_thread->Wait.return_code = RTEMS_TIMEOUT; 20073d8: 82 10 20 06 mov 6, %g1 20073dc: c2 27 60 34 st %g1, [ %i5 + 0x34 ] _ISR_Enable( level ); 20073e0: 7f ff ec 7d call 20025d4 20073e4: 01 00 00 00 nop RTEMS_INLINE_ROUTINE void _Thread_Unblock ( Thread_Control *the_thread ) { _Thread_Clear_state( the_thread, STATES_BLOCKED ); 20073e8: 90 10 00 1d mov %i5, %o0 20073ec: 13 04 01 ff sethi %hi(0x1007fc00), %o1 20073f0: 40 00 0a 2a call 2009c98 <_Thread_Clear_state> 20073f4: 92 12 63 f8 or %o1, 0x3f8, %o1 ! 1007fff8 * * This routine decrements the thread dispatch level. */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_decrement_disable_level(void) { uint32_t level = _Thread_Dispatch_disable_level; 20073f8: 03 00 80 75 sethi %hi(0x201d400), %g1 20073fc: c4 00 61 d0 ld [ %g1 + 0x1d0 ], %g2 ! 201d5d0 <_Thread_Dispatch_disable_level> --level; 2007400: 84 00 bf ff add %g2, -1, %g2 _Thread_Dispatch_disable_level = level; 2007404: c4 20 61 d0 st %g2, [ %g1 + 0x1d0 ] 2007408: 81 c7 e0 08 ret 200740c: 81 e8 00 00 restore =============================================================================== 0200d550 <_Heap_Free>: return do_free; } #endif bool _Heap_Free( Heap_Control *heap, void *alloc_begin_ptr ) { 200d550: 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 ) { 200d554: 80 a6 60 00 cmp %i1, 0 200d558: 02 80 00 7a be 200d740 <_Heap_Free+0x1f0> 200d55c: 88 10 20 01 mov 1, %g4 200d560: d2 06 20 10 ld [ %i0 + 0x10 ], %o1 200d564: 40 00 2c 8d call 2018798 <.urem> 200d568: 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 200d56c: f6 06 20 20 ld [ %i0 + 0x20 ], %i3 RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down( uintptr_t value, uintptr_t alignment ) { return value - (value % alignment); 200d570: 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); 200d574: 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; 200d578: 80 a2 00 1b cmp %o0, %i3 200d57c: 0a 80 00 05 bcs 200d590 <_Heap_Free+0x40> 200d580: 82 10 20 00 clr %g1 200d584: c2 06 20 24 ld [ %i0 + 0x24 ], %g1 200d588: 80 a0 40 08 cmp %g1, %o0 200d58c: 82 60 3f ff subx %g0, -1, %g1 } alloc_begin = (uintptr_t) alloc_begin_ptr; block = _Heap_Block_of_alloc_area( alloc_begin, heap->page_size ); if ( !_Heap_Is_block_in_heap( heap, block ) ) { 200d590: 80 a0 60 00 cmp %g1, 0 200d594: 02 80 00 6b be 200d740 <_Heap_Free+0x1f0> 200d598: 88 10 20 00 clr %g4 - HEAP_BLOCK_HEADER_SIZE); } RTEMS_INLINE_ROUTINE uintptr_t _Heap_Block_size( const Heap_Block *block ) { return block->size_and_flag & ~HEAP_PREV_BLOCK_USED; 200d59c: f8 02 20 04 ld [ %o0 + 4 ], %i4 200d5a0: 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); 200d5a4: 82 02 00 02 add %o0, %g2, %g1 const Heap_Control *heap, const Heap_Block *block ) { return (uintptr_t) block >= (uintptr_t) heap->first_block && (uintptr_t) block <= (uintptr_t) heap->last_block; 200d5a8: 80 a0 40 1b cmp %g1, %i3 200d5ac: 0a 80 00 05 bcs 200d5c0 <_Heap_Free+0x70> <== NEVER TAKEN 200d5b0: 86 10 20 00 clr %g3 200d5b4: c6 06 20 24 ld [ %i0 + 0x24 ], %g3 200d5b8: 80 a0 c0 01 cmp %g3, %g1 200d5bc: 86 60 3f ff subx %g0, -1, %g3 _Heap_Protection_block_check( heap, block ); block_size = _Heap_Block_size( block ); next_block = _Heap_Block_at( block, block_size ); if ( !_Heap_Is_block_in_heap( heap, next_block ) ) { 200d5c0: 80 a0 e0 00 cmp %g3, 0 200d5c4: 02 80 00 5f be 200d740 <_Heap_Free+0x1f0> <== NEVER TAKEN 200d5c8: 88 10 20 00 clr %g4 block->size_and_flag = size | flag; } RTEMS_INLINE_ROUTINE bool _Heap_Is_prev_used( const Heap_Block *block ) { return block->size_and_flag & HEAP_PREV_BLOCK_USED; 200d5cc: fa 00 60 04 ld [ %g1 + 4 ], %i5 return false; } _Heap_Protection_block_check( heap, next_block ); if ( !_Heap_Is_prev_used( next_block ) ) { 200d5d0: 80 8f 60 01 btst 1, %i5 200d5d4: 22 80 00 5c be,a 200d744 <_Heap_Free+0x1f4> <== NEVER TAKEN 200d5d8: b0 09 20 01 and %g4, 1, %i0 <== NOT EXECUTED if ( !_Heap_Protection_determine_block_free( heap, block ) ) { return true; } next_block_size = _Heap_Block_size( next_block ); next_is_free = next_block != heap->last_block 200d5dc: c8 06 20 24 ld [ %i0 + 0x24 ], %g4 && !_Heap_Is_prev_used( _Heap_Block_at( next_block, next_block_size )); 200d5e0: 80 a0 40 04 cmp %g1, %g4 200d5e4: 02 80 00 07 be 200d600 <_Heap_Free+0xb0> 200d5e8: ba 0f 7f fe and %i5, -2, %i5 200d5ec: 86 00 40 1d add %g1, %i5, %g3 200d5f0: f4 00 e0 04 ld [ %g3 + 4 ], %i2 200d5f4: b4 1e a0 01 xor %i2, 1, %i2 200d5f8: 10 80 00 03 b 200d604 <_Heap_Free+0xb4> 200d5fc: b4 0e a0 01 and %i2, 1, %i2 200d600: b4 10 20 00 clr %i2 if ( !_Heap_Is_prev_used( block ) ) { 200d604: 80 8f 20 01 btst 1, %i4 200d608: 12 80 00 26 bne 200d6a0 <_Heap_Free+0x150> 200d60c: 80 8e a0 ff btst 0xff, %i2 uintptr_t const prev_size = block->prev_size; 200d610: 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); 200d614: 86 22 00 1c sub %o0, %i4, %g3 const Heap_Control *heap, const Heap_Block *block ) { return (uintptr_t) block >= (uintptr_t) heap->first_block && (uintptr_t) block <= (uintptr_t) heap->last_block; 200d618: 80 a0 c0 1b cmp %g3, %i3 200d61c: 0a 80 00 04 bcs 200d62c <_Heap_Free+0xdc> <== NEVER TAKEN 200d620: b2 10 20 00 clr %i1 200d624: 80 a1 00 03 cmp %g4, %g3 200d628: b2 60 3f ff subx %g0, -1, %i1 Heap_Block * const prev_block = _Heap_Block_at( block, -prev_size ); if ( !_Heap_Is_block_in_heap( heap, prev_block ) ) { 200d62c: 80 a6 60 00 cmp %i1, 0 200d630: 02 80 00 44 be 200d740 <_Heap_Free+0x1f0> <== NEVER TAKEN 200d634: 88 10 20 00 clr %g4 block->size_and_flag = size | flag; } RTEMS_INLINE_ROUTINE bool _Heap_Is_prev_used( const Heap_Block *block ) { return block->size_and_flag & HEAP_PREV_BLOCK_USED; 200d638: f6 00 e0 04 ld [ %g3 + 4 ], %i3 return( false ); } /* As we always coalesce free blocks, the block that preceedes prev_block must have been used. */ if ( !_Heap_Is_prev_used ( prev_block) ) { 200d63c: 80 8e e0 01 btst 1, %i3 200d640: 02 80 00 40 be 200d740 <_Heap_Free+0x1f0> <== NEVER TAKEN 200d644: 80 8e a0 ff btst 0xff, %i2 _HAssert( false ); return( false ); } if ( next_is_free ) { /* coalesce both */ 200d648: 22 80 00 0f be,a 200d684 <_Heap_Free+0x134> 200d64c: b8 00 80 1c add %g2, %i4, %i4 return _Heap_Free_list_tail(heap)->prev; } RTEMS_INLINE_ROUTINE void _Heap_Free_list_remove( Heap_Block *block ) { Heap_Block *next = block->next; 200d650: c8 00 60 08 ld [ %g1 + 8 ], %g4 Heap_Block *prev = block->prev; 200d654: c2 00 60 0c ld [ %g1 + 0xc ], %g1 uintptr_t const size = block_size + prev_size + next_block_size; 200d658: ba 00 80 1d add %g2, %i5, %i5 prev->next = next; 200d65c: c8 20 60 08 st %g4, [ %g1 + 8 ] next->prev = prev; 200d660: c2 21 20 0c st %g1, [ %g4 + 0xc ] _Heap_Free_list_remove( next_block ); stats->free_blocks -= 1; 200d664: c2 06 20 38 ld [ %i0 + 0x38 ], %g1 _HAssert( false ); return( false ); } if ( next_is_free ) { /* coalesce both */ uintptr_t const size = block_size + prev_size + next_block_size; 200d668: b8 07 40 1c add %i5, %i4, %i4 _Heap_Free_list_remove( next_block ); stats->free_blocks -= 1; 200d66c: 82 00 7f ff add %g1, -1, %g1 200d670: c2 26 20 38 st %g1, [ %i0 + 0x38 ] prev_block->size_and_flag = size | HEAP_PREV_BLOCK_USED; next_block = _Heap_Block_at( prev_block, size ); _HAssert(!_Heap_Is_prev_used( next_block)); next_block->prev_size = size; 200d674: f8 20 c0 1c st %i4, [ %g3 + %i4 ] if ( next_is_free ) { /* coalesce both */ uintptr_t const size = block_size + prev_size + next_block_size; _Heap_Free_list_remove( next_block ); stats->free_blocks -= 1; prev_block->size_and_flag = size | HEAP_PREV_BLOCK_USED; 200d678: 82 17 20 01 or %i4, 1, %g1 200d67c: 10 80 00 27 b 200d718 <_Heap_Free+0x1c8> 200d680: c2 20 e0 04 st %g1, [ %g3 + 4 ] next_block = _Heap_Block_at( prev_block, size ); _HAssert(!_Heap_Is_prev_used( next_block)); next_block->prev_size = size; } else { /* coalesce prev */ uintptr_t const size = block_size + prev_size; prev_block->size_and_flag = size | HEAP_PREV_BLOCK_USED; 200d684: 88 17 20 01 or %i4, 1, %g4 200d688: c8 20 e0 04 st %g4, [ %g3 + 4 ] next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED; 200d68c: c6 00 60 04 ld [ %g1 + 4 ], %g3 next_block->prev_size = size; 200d690: f8 22 00 02 st %i4, [ %o0 + %g2 ] _HAssert(!_Heap_Is_prev_used( next_block)); next_block->prev_size = size; } else { /* coalesce prev */ uintptr_t const size = block_size + prev_size; prev_block->size_and_flag = size | HEAP_PREV_BLOCK_USED; next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED; 200d694: 86 08 ff fe and %g3, -2, %g3 200d698: 10 80 00 20 b 200d718 <_Heap_Free+0x1c8> 200d69c: c6 20 60 04 st %g3, [ %g1 + 4 ] next_block->prev_size = size; } } else if ( next_is_free ) { /* coalesce next */ 200d6a0: 22 80 00 0d be,a 200d6d4 <_Heap_Free+0x184> 200d6a4: c6 06 20 08 ld [ %i0 + 8 ], %g3 RTEMS_INLINE_ROUTINE void _Heap_Free_list_replace( Heap_Block *old_block, Heap_Block *new_block ) { Heap_Block *next = old_block->next; 200d6a8: c8 00 60 08 ld [ %g1 + 8 ], %g4 Heap_Block *prev = old_block->prev; 200d6ac: c2 00 60 0c ld [ %g1 + 0xc ], %g1 new_block->next = next; 200d6b0: c8 22 20 08 st %g4, [ %o0 + 8 ] new_block->prev = prev; 200d6b4: c2 22 20 0c st %g1, [ %o0 + 0xc ] uintptr_t const size = block_size + next_block_size; 200d6b8: 86 07 40 02 add %i5, %g2, %g3 next->prev = new_block; prev->next = new_block; 200d6bc: d0 20 60 08 st %o0, [ %g1 + 8 ] Heap_Block *prev = old_block->prev; new_block->next = next; new_block->prev = prev; next->prev = new_block; 200d6c0: d0 21 20 0c st %o0, [ %g4 + 0xc ] _Heap_Free_list_replace( next_block, block ); block->size_and_flag = size | HEAP_PREV_BLOCK_USED; 200d6c4: 82 10 e0 01 or %g3, 1, %g1 next_block = _Heap_Block_at( block, size ); next_block->prev_size = size; 200d6c8: c6 22 00 03 st %g3, [ %o0 + %g3 ] next_block->prev_size = size; } } else if ( next_is_free ) { /* coalesce next */ uintptr_t const size = block_size + next_block_size; _Heap_Free_list_replace( next_block, block ); block->size_and_flag = size | HEAP_PREV_BLOCK_USED; 200d6cc: 10 80 00 13 b 200d718 <_Heap_Free+0x1c8> 200d6d0: c2 22 20 04 st %g1, [ %o0 + 4 ] ) { Heap_Block *next = block_before->next; new_block->next = next; new_block->prev = block_before; 200d6d4: f0 22 20 0c st %i0, [ %o0 + 0xc ] Heap_Block *new_block ) { Heap_Block *next = block_before->next; new_block->next = next; 200d6d8: c6 22 20 08 st %g3, [ %o0 + 8 ] new_block->prev = block_before; block_before->next = new_block; next->prev = new_block; 200d6dc: d0 20 e0 0c st %o0, [ %g3 + 0xc ] next_block->prev_size = size; } else { /* no coalesce */ /* Add 'block' to the head of the free blocks list as it tends to produce less fragmentation than adding to the tail. */ _Heap_Free_list_insert_after( _Heap_Free_list_head( heap), block ); block->size_and_flag = block_size | HEAP_PREV_BLOCK_USED; 200d6e0: 86 10 a0 01 or %g2, 1, %g3 200d6e4: c6 22 20 04 st %g3, [ %o0 + 4 ] next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED; 200d6e8: c6 00 60 04 ld [ %g1 + 4 ], %g3 next_block->prev_size = block_size; 200d6ec: c4 22 00 02 st %g2, [ %o0 + %g2 ] } else { /* no coalesce */ /* Add 'block' to the head of the free blocks list as it tends to produce less fragmentation than adding to the tail. */ _Heap_Free_list_insert_after( _Heap_Free_list_head( heap), block ); block->size_and_flag = block_size | HEAP_PREV_BLOCK_USED; next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED; 200d6f0: 86 08 ff fe and %g3, -2, %g3 200d6f4: c6 20 60 04 st %g3, [ %g1 + 4 ] next_block->prev_size = block_size; /* Statistics */ ++stats->free_blocks; 200d6f8: c2 06 20 38 ld [ %i0 + 0x38 ], %g1 if ( stats->max_free_blocks < stats->free_blocks ) { 200d6fc: c6 06 20 3c ld [ %i0 + 0x3c ], %g3 block->size_and_flag = block_size | HEAP_PREV_BLOCK_USED; next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED; next_block->prev_size = block_size; /* Statistics */ ++stats->free_blocks; 200d700: 82 00 60 01 inc %g1 { Heap_Block *next = block_before->next; new_block->next = next; new_block->prev = block_before; block_before->next = new_block; 200d704: d0 26 20 08 st %o0, [ %i0 + 8 ] if ( stats->max_free_blocks < stats->free_blocks ) { 200d708: 80 a0 c0 01 cmp %g3, %g1 200d70c: 1a 80 00 03 bcc 200d718 <_Heap_Free+0x1c8> 200d710: c2 26 20 38 st %g1, [ %i0 + 0x38 ] stats->max_free_blocks = stats->free_blocks; 200d714: c2 26 20 3c st %g1, [ %i0 + 0x3c ] } } /* Statistics */ --stats->used_blocks; 200d718: c2 06 20 40 ld [ %i0 + 0x40 ], %g1 200d71c: 82 00 7f ff add %g1, -1, %g1 200d720: c2 26 20 40 st %g1, [ %i0 + 0x40 ] ++stats->frees; 200d724: c2 06 20 50 ld [ %i0 + 0x50 ], %g1 200d728: 82 00 60 01 inc %g1 200d72c: c2 26 20 50 st %g1, [ %i0 + 0x50 ] stats->free_size += block_size; 200d730: c2 06 20 30 ld [ %i0 + 0x30 ], %g1 200d734: 84 00 40 02 add %g1, %g2, %g2 200d738: c4 26 20 30 st %g2, [ %i0 + 0x30 ] * If NULL return true so a free on NULL is considered a valid release. This * is a special case that could be handled by the in heap check how-ever that * would result in false being returned which is wrong. */ if ( alloc_begin_ptr == NULL ) { return true; 200d73c: 88 10 20 01 mov 1, %g4 --stats->used_blocks; ++stats->frees; stats->free_size += block_size; return( true ); } 200d740: b0 09 20 01 and %g4, 1, %i0 200d744: 81 c7 e0 08 ret 200d748: 81 e8 00 00 restore =============================================================================== 0200a750 <_Heap_Greedy_allocate>: Heap_Block *_Heap_Greedy_allocate( Heap_Control *heap, const uintptr_t *block_sizes, size_t block_count ) { 200a750: 9d e3 bf a0 save %sp, -96, %sp Heap_Block *allocated_blocks = NULL; Heap_Block *blocks = NULL; Heap_Block *current; size_t i; for (i = 0; i < block_count; ++i) { 200a754: b6 10 20 00 clr %i3 Heap_Block *_Heap_Greedy_allocate( Heap_Control *heap, const uintptr_t *block_sizes, size_t block_count ) { 200a758: ba 10 00 18 mov %i0, %i5 Heap_Block *allocated_blocks = NULL; Heap_Block *blocks = NULL; Heap_Block *current; size_t i; for (i = 0; i < block_count; ++i) { 200a75c: 10 80 00 11 b 200a7a0 <_Heap_Greedy_allocate+0x50> 200a760: b8 10 20 00 clr %i4 * @brief See _Heap_Allocate_aligned_with_boundary() with alignment and * boundary equals zero. */ RTEMS_INLINE_ROUTINE void *_Heap_Allocate( Heap_Control *heap, uintptr_t size ) { return _Heap_Allocate_aligned_with_boundary( heap, size, 0, 0 ); 200a764: d2 06 40 01 ld [ %i1 + %g1 ], %o1 200a768: 90 10 00 1d mov %i5, %o0 200a76c: 94 10 20 00 clr %o2 200a770: 40 00 1d 8e call 2011da8 <_Heap_Allocate_aligned_with_boundary> 200a774: 96 10 20 00 clr %o3 void *next = _Heap_Allocate( heap, block_sizes [i] ); if ( next != NULL ) { 200a778: 82 92 20 00 orcc %o0, 0, %g1 200a77c: 22 80 00 09 be,a 200a7a0 <_Heap_Greedy_allocate+0x50> <== NEVER TAKEN 200a780: b6 06 e0 01 inc %i3 <== NOT EXECUTED RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down( uintptr_t value, uintptr_t alignment ) { return value - (value % alignment); 200a784: d2 07 60 10 ld [ %i5 + 0x10 ], %o1 200a788: 40 00 4a 8c call 201d1b8 <.urem> 200a78c: b0 00 7f f8 add %g1, -8, %i0 uintptr_t alloc_begin, uintptr_t page_size ) { return (Heap_Block *) (_Heap_Align_down( alloc_begin, page_size ) - HEAP_BLOCK_HEADER_SIZE); 200a790: 90 26 00 08 sub %i0, %o0, %o0 Heap_Block *next_block = _Heap_Block_of_alloc_area( (uintptr_t) next, heap->page_size ); next_block->next = allocated_blocks; 200a794: f8 22 20 08 st %i4, [ %o0 + 8 ] 200a798: b8 10 00 08 mov %o0, %i4 Heap_Block *allocated_blocks = NULL; Heap_Block *blocks = NULL; Heap_Block *current; size_t i; for (i = 0; i < block_count; ++i) { 200a79c: b6 06 e0 01 inc %i3 200a7a0: 80 a6 c0 1a cmp %i3, %i2 200a7a4: 12 bf ff f0 bne 200a764 <_Heap_Greedy_allocate+0x14> 200a7a8: 83 2e e0 02 sll %i3, 2, %g1 200a7ac: 10 80 00 0a b 200a7d4 <_Heap_Greedy_allocate+0x84> 200a7b0: b0 10 20 00 clr %i0 allocated_blocks = next_block; } } while ( (current = _Heap_Free_list_first( heap )) != free_list_tail ) { _Heap_Block_allocate( 200a7b4: 90 10 00 1d mov %i5, %o0 } RTEMS_INLINE_ROUTINE uintptr_t _Heap_Block_size( const Heap_Block *block ) { return block->size_and_flag & ~HEAP_PREV_BLOCK_USED; 200a7b8: 96 0a ff fe and %o3, -2, %o3 200a7bc: 92 10 00 1b mov %i3, %o1 200a7c0: 94 06 e0 08 add %i3, 8, %o2 200a7c4: 40 00 00 cb call 200aaf0 <_Heap_Block_allocate> 200a7c8: 96 02 ff f8 add %o3, -8, %o3 current, _Heap_Alloc_area_of_block( current ), _Heap_Block_size( current ) - HEAP_BLOCK_HEADER_SIZE ); current->next = blocks; 200a7cc: f0 26 e0 08 st %i0, [ %i3 + 8 ] 200a7d0: b0 10 00 1b mov %i3, %i0 return &heap->free_list; } RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Free_list_first( Heap_Control *heap ) { return _Heap_Free_list_head(heap)->next; 200a7d4: f6 07 60 08 ld [ %i5 + 8 ], %i3 next_block->next = allocated_blocks; allocated_blocks = next_block; } } while ( (current = _Heap_Free_list_first( heap )) != free_list_tail ) { 200a7d8: 80 a6 c0 1d cmp %i3, %i5 200a7dc: 32 bf ff f6 bne,a 200a7b4 <_Heap_Greedy_allocate+0x64> 200a7e0: d6 06 e0 04 ld [ %i3 + 4 ], %o3 current->next = blocks; blocks = current; } while ( allocated_blocks != NULL ) { 200a7e4: 10 80 00 07 b 200a800 <_Heap_Greedy_allocate+0xb0> 200a7e8: 80 a7 20 00 cmp %i4, 0 current = allocated_blocks; allocated_blocks = allocated_blocks->next; _Heap_Free( heap, (void *) _Heap_Alloc_area_of_block( current ) ); 200a7ec: 92 07 20 08 add %i4, 8, %o1 200a7f0: 90 10 00 1d mov %i5, %o0 200a7f4: 40 00 1d de call 2011f6c <_Heap_Free> 200a7f8: b8 10 00 1b mov %i3, %i4 current->next = blocks; blocks = current; } while ( allocated_blocks != NULL ) { 200a7fc: 80 a7 20 00 cmp %i4, 0 200a800: 32 bf ff fb bne,a 200a7ec <_Heap_Greedy_allocate+0x9c> 200a804: f6 07 20 08 ld [ %i4 + 8 ], %i3 allocated_blocks = allocated_blocks->next; _Heap_Free( heap, (void *) _Heap_Alloc_area_of_block( current ) ); } return blocks; } 200a808: 81 c7 e0 08 ret 200a80c: 81 e8 00 00 restore =============================================================================== 020120f0 <_Heap_Iterate>: void _Heap_Iterate( Heap_Control *heap, Heap_Block_visitor visitor, void *visitor_arg ) { 20120f0: 9d e3 bf a0 save %sp, -96, %sp Heap_Block *current = heap->first_block; Heap_Block *end = heap->last_block; bool stop = false; 20120f4: 90 10 20 00 clr %o0 Heap_Control *heap, Heap_Block_visitor visitor, void *visitor_arg ) { Heap_Block *current = heap->first_block; 20120f8: c2 06 20 20 ld [ %i0 + 0x20 ], %g1 Heap_Block *end = heap->last_block; bool stop = false; while ( !stop && current != end ) { 20120fc: 10 80 00 0a b 2012124 <_Heap_Iterate+0x34> 2012100: f8 06 20 24 ld [ %i0 + 0x24 ], %i4 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 ); 2012104: 90 10 00 01 mov %g1, %o0 2012108: 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); 201210c: 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; 2012110: d4 07 60 04 ld [ %i5 + 4 ], %o2 2012114: 96 10 00 1a mov %i2, %o3 2012118: 9f c6 40 00 call %i1 201211c: 94 0a a0 01 and %o2, 1, %o2 2012120: 82 10 00 1d mov %i5, %g1 { Heap_Block *current = heap->first_block; Heap_Block *end = heap->last_block; bool stop = false; while ( !stop && current != end ) { 2012124: 80 a0 40 1c cmp %g1, %i4 2012128: 02 80 00 05 be 201213c <_Heap_Iterate+0x4c> 201212c: 90 1a 20 01 xor %o0, 1, %o0 2012130: 80 8a 20 ff btst 0xff, %o0 2012134: 32 bf ff f4 bne,a 2012104 <_Heap_Iterate+0x14> <== ALWAYS TAKEN 2012138: d2 00 60 04 ld [ %g1 + 4 ], %o1 201213c: 81 c7 e0 08 ret 2012140: 81 e8 00 00 restore =============================================================================== 0200d874 <_Heap_Size_of_alloc_area>: bool _Heap_Size_of_alloc_area( Heap_Control *heap, void *alloc_begin_ptr, uintptr_t *alloc_size ) { 200d874: 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); 200d878: d2 06 20 10 ld [ %i0 + 0x10 ], %o1 200d87c: 40 00 2b c7 call 2018798 <.urem> 200d880: 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 200d884: 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); 200d888: 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); 200d88c: 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; 200d890: 80 a2 00 04 cmp %o0, %g4 200d894: 0a 80 00 05 bcs 200d8a8 <_Heap_Size_of_alloc_area+0x34> 200d898: 82 10 20 00 clr %g1 200d89c: c2 06 20 24 ld [ %i0 + 0x24 ], %g1 200d8a0: 80 a0 40 08 cmp %g1, %o0 200d8a4: 82 60 3f ff subx %g0, -1, %g1 uintptr_t const alloc_begin = (uintptr_t) alloc_begin_ptr; Heap_Block *block = _Heap_Block_of_alloc_area( alloc_begin, page_size ); Heap_Block *next_block = NULL; uintptr_t block_size = 0; if ( !_Heap_Is_block_in_heap( heap, block ) ) { 200d8a8: 80 a0 60 00 cmp %g1, 0 200d8ac: 02 80 00 15 be 200d900 <_Heap_Size_of_alloc_area+0x8c> 200d8b0: 86 10 20 00 clr %g3 - HEAP_BLOCK_HEADER_SIZE); } RTEMS_INLINE_ROUTINE uintptr_t _Heap_Block_size( const Heap_Block *block ) { return block->size_and_flag & ~HEAP_PREV_BLOCK_USED; 200d8b4: c2 02 20 04 ld [ %o0 + 4 ], %g1 200d8b8: 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); 200d8bc: 82 02 00 01 add %o0, %g1, %g1 const Heap_Control *heap, const Heap_Block *block ) { return (uintptr_t) block >= (uintptr_t) heap->first_block && (uintptr_t) block <= (uintptr_t) heap->last_block; 200d8c0: 80 a0 40 04 cmp %g1, %g4 200d8c4: 0a 80 00 05 bcs 200d8d8 <_Heap_Size_of_alloc_area+0x64> <== NEVER TAKEN 200d8c8: 84 10 20 00 clr %g2 200d8cc: c4 06 20 24 ld [ %i0 + 0x24 ], %g2 200d8d0: 80 a0 80 01 cmp %g2, %g1 200d8d4: 84 60 3f ff subx %g0, -1, %g2 } block_size = _Heap_Block_size( block ); next_block = _Heap_Block_at( block, block_size ); if ( 200d8d8: 80 a0 a0 00 cmp %g2, 0 200d8dc: 02 80 00 09 be 200d900 <_Heap_Size_of_alloc_area+0x8c> <== NEVER TAKEN 200d8e0: 86 10 20 00 clr %g3 block->size_and_flag = size | flag; } RTEMS_INLINE_ROUTINE bool _Heap_Is_prev_used( const Heap_Block *block ) { return block->size_and_flag & HEAP_PREV_BLOCK_USED; 200d8e4: c4 00 60 04 ld [ %g1 + 4 ], %g2 !_Heap_Is_block_in_heap( heap, next_block ) || !_Heap_Is_prev_used( next_block ) 200d8e8: 80 88 a0 01 btst 1, %g2 200d8ec: 02 80 00 05 be 200d900 <_Heap_Size_of_alloc_area+0x8c> <== NEVER TAKEN 200d8f0: 82 20 40 19 sub %g1, %i1, %g1 return false; } *alloc_size = (uintptr_t) next_block + HEAP_ALLOC_BONUS - alloc_begin; return true; 200d8f4: 86 10 20 01 mov 1, %g3 || !_Heap_Is_prev_used( next_block ) ) { return false; } *alloc_size = (uintptr_t) next_block + HEAP_ALLOC_BONUS - alloc_begin; 200d8f8: 82 00 60 04 add %g1, 4, %g1 200d8fc: c2 26 80 00 st %g1, [ %i2 ] return true; } 200d900: b0 08 e0 01 and %g3, 1, %i0 200d904: 81 c7 e0 08 ret 200d908: 81 e8 00 00 restore =============================================================================== 02009708 <_Heap_Walk>: bool _Heap_Walk( Heap_Control *heap, int source, bool dump ) { 2009708: 9d e3 bf 80 save %sp, -128, %sp 200970c: ac 10 00 19 mov %i1, %l6 uintptr_t const page_size = heap->page_size; 2009710: f8 06 20 10 ld [ %i0 + 0x10 ], %i4 uintptr_t const min_block_size = heap->min_block_size; 2009714: f6 06 20 14 ld [ %i0 + 0x14 ], %i3 Heap_Block *const first_block = heap->first_block; 2009718: 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; 200971c: 80 a6 a0 00 cmp %i2, 0 2009720: 02 80 00 05 be 2009734 <_Heap_Walk+0x2c> 2009724: e0 06 20 24 ld [ %i0 + 0x24 ], %l0 2009728: 3b 00 80 25 sethi %hi(0x2009400), %i5 200972c: 10 80 00 04 b 200973c <_Heap_Walk+0x34> 2009730: ba 17 62 b8 or %i5, 0x2b8, %i5 ! 20096b8 <_Heap_Walk_print> 2009734: 3b 00 80 25 sethi %hi(0x2009400), %i5 2009738: ba 17 62 b0 or %i5, 0x2b0, %i5 ! 20096b0 <_Heap_Walk_print_nothing> if ( !_System_state_Is_up( _System_state_Get() ) ) { 200973c: 05 00 80 7f sethi %hi(0x201fc00), %g2 2009740: c4 00 a2 e8 ld [ %g2 + 0x2e8 ], %g2 ! 201fee8 <_System_state_Current> 2009744: 80 a0 a0 03 cmp %g2, 3 2009748: 22 80 00 04 be,a 2009758 <_Heap_Walk+0x50> 200974c: c4 06 20 1c ld [ %i0 + 0x1c ], %g2 return true; 2009750: 10 80 01 2a b 2009bf8 <_Heap_Walk+0x4f0> 2009754: b0 10 20 01 mov 1, %i0 Heap_Block *const first_free_block = _Heap_Free_list_first( heap ); Heap_Block *const last_free_block = _Heap_Free_list_last( heap ); Heap_Block *const first_block = heap->first_block; Heap_Block *const last_block = heap->last_block; (*printer)( 2009758: da 06 20 18 ld [ %i0 + 0x18 ], %o5 200975c: c4 23 a0 5c st %g2, [ %sp + 0x5c ] 2009760: f2 23 a0 60 st %i1, [ %sp + 0x60 ] 2009764: e0 23 a0 64 st %l0, [ %sp + 0x64 ] 2009768: c4 06 20 08 ld [ %i0 + 8 ], %g2 200976c: 90 10 00 16 mov %l6, %o0 2009770: c4 23 a0 68 st %g2, [ %sp + 0x68 ] 2009774: c4 06 20 0c ld [ %i0 + 0xc ], %g2 2009778: 92 10 20 00 clr %o1 200977c: c4 23 a0 6c st %g2, [ %sp + 0x6c ] 2009780: 15 00 80 71 sethi %hi(0x201c400), %o2 2009784: 96 10 00 1c mov %i4, %o3 2009788: 94 12 a1 30 or %o2, 0x130, %o2 200978c: 9f c7 40 00 call %i5 2009790: 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 ) { 2009794: 80 a7 20 00 cmp %i4, 0 2009798: 12 80 00 07 bne 20097b4 <_Heap_Walk+0xac> 200979c: 80 8f 20 07 btst 7, %i4 (*printer)( source, true, "page size is zero\n" ); 20097a0: 15 00 80 71 sethi %hi(0x201c400), %o2 20097a4: 90 10 00 16 mov %l6, %o0 20097a8: 92 10 20 01 mov 1, %o1 20097ac: 10 80 00 37 b 2009888 <_Heap_Walk+0x180> 20097b0: 94 12 a1 c8 or %o2, 0x1c8, %o2 return false; } if ( !_Addresses_Is_aligned( (void *) page_size ) ) { 20097b4: 22 80 00 08 be,a 20097d4 <_Heap_Walk+0xcc> 20097b8: 90 10 00 1b mov %i3, %o0 (*printer)( 20097bc: 15 00 80 71 sethi %hi(0x201c400), %o2 20097c0: 90 10 00 16 mov %l6, %o0 20097c4: 92 10 20 01 mov 1, %o1 20097c8: 94 12 a1 e0 or %o2, 0x1e0, %o2 20097cc: 10 80 01 12 b 2009c14 <_Heap_Walk+0x50c> 20097d0: 96 10 00 1c mov %i4, %o3 RTEMS_INLINE_ROUTINE bool _Heap_Is_aligned( uintptr_t value, uintptr_t alignment ) { return (value % alignment) == 0; 20097d4: 7f ff e0 ec call 2001b84 <.urem> 20097d8: 92 10 00 1c mov %i4, %o1 ); return false; } if ( !_Heap_Is_aligned( min_block_size, page_size ) ) { 20097dc: 80 a2 20 00 cmp %o0, 0 20097e0: 22 80 00 08 be,a 2009800 <_Heap_Walk+0xf8> 20097e4: 90 06 60 08 add %i1, 8, %o0 (*printer)( 20097e8: 15 00 80 71 sethi %hi(0x201c400), %o2 20097ec: 90 10 00 16 mov %l6, %o0 20097f0: 92 10 20 01 mov 1, %o1 20097f4: 94 12 a2 00 or %o2, 0x200, %o2 20097f8: 10 80 01 07 b 2009c14 <_Heap_Walk+0x50c> 20097fc: 96 10 00 1b mov %i3, %o3 2009800: 7f ff e0 e1 call 2001b84 <.urem> 2009804: 92 10 00 1c mov %i4, %o1 ); return false; } if ( 2009808: 80 a2 20 00 cmp %o0, 0 200980c: 22 80 00 07 be,a 2009828 <_Heap_Walk+0x120> 2009810: c4 06 60 04 ld [ %i1 + 4 ], %g2 !_Heap_Is_aligned( _Heap_Alloc_area_of_block( first_block ), page_size ) ) { (*printer)( 2009814: 15 00 80 71 sethi %hi(0x201c400), %o2 2009818: 90 10 00 16 mov %l6, %o0 200981c: 92 10 20 01 mov 1, %o1 2009820: 10 80 00 fc b 2009c10 <_Heap_Walk+0x508> 2009824: 94 12 a2 28 or %o2, 0x228, %o2 ); return false; } if ( !_Heap_Is_prev_used( first_block ) ) { 2009828: 80 88 a0 01 btst 1, %g2 200982c: 32 80 00 07 bne,a 2009848 <_Heap_Walk+0x140> 2009830: f4 04 20 04 ld [ %l0 + 4 ], %i2 (*printer)( 2009834: 15 00 80 71 sethi %hi(0x201c400), %o2 2009838: 90 10 00 16 mov %l6, %o0 200983c: 92 10 20 01 mov 1, %o1 2009840: 10 80 00 12 b 2009888 <_Heap_Walk+0x180> 2009844: 94 12 a2 60 or %o2, 0x260, %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; 2009848: 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); 200984c: 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; 2009850: c4 06 a0 04 ld [ %i2 + 4 ], %g2 ); return false; } if ( _Heap_Is_free( last_block ) ) { 2009854: 80 88 a0 01 btst 1, %g2 2009858: 12 80 00 07 bne 2009874 <_Heap_Walk+0x16c> 200985c: 80 a6 80 19 cmp %i2, %i1 (*printer)( 2009860: 15 00 80 71 sethi %hi(0x201c400), %o2 2009864: 90 10 00 16 mov %l6, %o0 2009868: 92 10 20 01 mov 1, %o1 200986c: 10 80 00 07 b 2009888 <_Heap_Walk+0x180> 2009870: 94 12 a2 90 or %o2, 0x290, %o2 ); return false; } if ( 2009874: 02 80 00 0a be 200989c <_Heap_Walk+0x194> 2009878: 15 00 80 71 sethi %hi(0x201c400), %o2 _Heap_Block_at( last_block, _Heap_Block_size( last_block ) ) != first_block ) { (*printer)( 200987c: 90 10 00 16 mov %l6, %o0 2009880: 92 10 20 01 mov 1, %o1 2009884: 94 12 a2 a8 or %o2, 0x2a8, %o2 2009888: 9f c7 40 00 call %i5 200988c: b0 10 20 00 clr %i0 2009890: b0 0e 20 ff and %i0, 0xff, %i0 2009894: 81 c7 e0 08 ret 2009898: 81 e8 00 00 restore int source, Heap_Walk_printer printer, Heap_Control *heap ) { uintptr_t const page_size = heap->page_size; 200989c: 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; 20098a0: d6 06 20 08 ld [ %i0 + 8 ], %o3 const Heap_Block *const free_list_tail = _Heap_Free_list_tail( heap ); 20098a4: 10 80 00 30 b 2009964 <_Heap_Walk+0x25c> 20098a8: b2 10 00 18 mov %i0, %i1 const Heap_Control *heap, const Heap_Block *block ) { return (uintptr_t) block >= (uintptr_t) heap->first_block && (uintptr_t) block <= (uintptr_t) heap->last_block; 20098ac: 80 a0 c0 0b cmp %g3, %o3 20098b0: 18 80 00 05 bgu 20098c4 <_Heap_Walk+0x1bc> 20098b4: 84 10 20 00 clr %g2 20098b8: c4 06 20 24 ld [ %i0 + 0x24 ], %g2 20098bc: 80 a0 80 0b cmp %g2, %o3 20098c0: 84 60 3f ff subx %g0, -1, %g2 const Heap_Block *const first_free_block = _Heap_Free_list_first( heap ); const Heap_Block *prev_block = free_list_tail; const Heap_Block *free_block = first_free_block; while ( free_block != free_list_tail ) { if ( !_Heap_Is_block_in_heap( heap, free_block ) ) { 20098c4: 80 a0 a0 00 cmp %g2, 0 20098c8: 32 80 00 07 bne,a 20098e4 <_Heap_Walk+0x1dc> 20098cc: 90 02 e0 08 add %o3, 8, %o0 (*printer)( 20098d0: 15 00 80 71 sethi %hi(0x201c400), %o2 20098d4: 90 10 00 16 mov %l6, %o0 20098d8: 92 10 20 01 mov 1, %o1 20098dc: 10 80 00 ce b 2009c14 <_Heap_Walk+0x50c> 20098e0: 94 12 a2 d8 or %o2, 0x2d8, %o2 RTEMS_INLINE_ROUTINE bool _Heap_Is_aligned( uintptr_t value, uintptr_t alignment ) { return (value % alignment) == 0; 20098e4: d6 27 bf fc st %o3, [ %fp + -4 ] 20098e8: 7f ff e0 a7 call 2001b84 <.urem> 20098ec: 92 10 00 11 mov %l1, %o1 ); return false; } if ( 20098f0: 80 a2 20 00 cmp %o0, 0 20098f4: 02 80 00 07 be 2009910 <_Heap_Walk+0x208> 20098f8: d6 07 bf fc ld [ %fp + -4 ], %o3 !_Heap_Is_aligned( _Heap_Alloc_area_of_block( free_block ), page_size ) ) { (*printer)( 20098fc: 15 00 80 71 sethi %hi(0x201c400), %o2 2009900: 90 10 00 16 mov %l6, %o0 2009904: 92 10 20 01 mov 1, %o1 2009908: 10 80 00 c3 b 2009c14 <_Heap_Walk+0x50c> 200990c: 94 12 a2 f8 or %o2, 0x2f8, %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; 2009910: c4 02 e0 04 ld [ %o3 + 4 ], %g2 2009914: 84 08 bf fe and %g2, -2, %g2 block->size_and_flag = size | flag; } RTEMS_INLINE_ROUTINE bool _Heap_Is_prev_used( const Heap_Block *block ) { return block->size_and_flag & HEAP_PREV_BLOCK_USED; 2009918: 84 02 c0 02 add %o3, %g2, %g2 200991c: c4 00 a0 04 ld [ %g2 + 4 ], %g2 ); return false; } if ( _Heap_Is_used( free_block ) ) { 2009920: 80 88 a0 01 btst 1, %g2 2009924: 22 80 00 07 be,a 2009940 <_Heap_Walk+0x238> 2009928: d8 02 e0 0c ld [ %o3 + 0xc ], %o4 (*printer)( 200992c: 15 00 80 71 sethi %hi(0x201c400), %o2 2009930: 90 10 00 16 mov %l6, %o0 2009934: 92 10 20 01 mov 1, %o1 2009938: 10 80 00 b7 b 2009c14 <_Heap_Walk+0x50c> 200993c: 94 12 a3 28 or %o2, 0x328, %o2 ); return false; } if ( free_block->prev != prev_block ) { 2009940: 80 a3 00 19 cmp %o4, %i1 2009944: 02 80 00 07 be 2009960 <_Heap_Walk+0x258> 2009948: b2 10 00 0b mov %o3, %i1 (*printer)( 200994c: 15 00 80 71 sethi %hi(0x201c400), %o2 2009950: 90 10 00 16 mov %l6, %o0 2009954: 92 10 20 01 mov 1, %o1 2009958: 10 80 00 4d b 2009a8c <_Heap_Walk+0x384> 200995c: 94 12 a3 48 or %o2, 0x348, %o2 return false; } prev_block = free_block; free_block = free_block->next; 2009960: 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 ) { 2009964: 80 a2 c0 18 cmp %o3, %i0 2009968: 32 bf ff d1 bne,a 20098ac <_Heap_Walk+0x1a4> 200996c: c6 06 20 20 ld [ %i0 + 0x20 ], %g3 Heap_Block *const last_free_block = _Heap_Free_list_last( heap ); bool const prev_used = _Heap_Is_prev_used( block ); uintptr_t const block_size = _Heap_Block_size( block ); Heap_Block *const next_block = _Heap_Block_at( block, block_size ); (*printer)( 2009970: 2b 00 80 72 sethi %hi(0x201c800), %l5 const Heap_Block *const free_list_tail = _Heap_Free_list_tail( heap ); const Heap_Block *const first_free_block = _Heap_Free_list_first( heap ); const Heap_Block *prev_block = free_list_tail; const Heap_Block *free_block = first_free_block; while ( free_block != free_list_tail ) { 2009974: b2 10 00 1a mov %i2, %i1 Heap_Block *const last_free_block = _Heap_Free_list_last( heap ); bool const prev_used = _Heap_Is_prev_used( block ); uintptr_t const block_size = _Heap_Block_size( block ); Heap_Block *const next_block = _Heap_Block_at( block, block_size ); (*printer)( 2009978: aa 15 60 48 or %l5, 0x48, %l5 " (= first free)" : (block->prev == free_list_head ? " (= head)" : ""), block->next, block->next == last_free_block ? " (= last free)" : (block->next == free_list_tail ? " (= tail)" : "") 200997c: 23 00 80 72 sethi %hi(0x201c800), %l1 2009980: 2f 00 80 71 sethi %hi(0x201c400), %l7 - HEAP_BLOCK_HEADER_SIZE); } RTEMS_INLINE_ROUTINE uintptr_t _Heap_Block_size( const Heap_Block *block ) { return block->size_and_flag & ~HEAP_PREV_BLOCK_USED; 2009984: 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; 2009988: d8 06 20 20 ld [ %i0 + 0x20 ], %o4 uintptr_t const block_begin = (uintptr_t) block; uintptr_t const block_size = _Heap_Block_size( block ); bool const prev_used = _Heap_Is_prev_used( block ); Heap_Block *const next_block = _Heap_Block_at( block, block_size ); uintptr_t const next_block_begin = (uintptr_t) next_block; bool const is_not_last_block = block != last_block; 200998c: 9e 1e 40 10 xor %i1, %l0, %o7 2009990: 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; 2009994: a8 0c bf fe and %l2, -2, %l4 2009998: 9a 40 20 00 addx %g0, 0, %o5 RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); 200999c: a6 06 40 14 add %i1, %l4, %l3 block->size_and_flag = size | flag; } RTEMS_INLINE_ROUTINE bool _Heap_Is_prev_used( const Heap_Block *block ) { return block->size_and_flag & HEAP_PREV_BLOCK_USED; 20099a0: 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; 20099a4: 80 a3 00 13 cmp %o4, %l3 20099a8: 18 80 00 05 bgu 20099bc <_Heap_Walk+0x2b4> <== NEVER TAKEN 20099ac: 9e 10 20 00 clr %o7 20099b0: de 06 20 24 ld [ %i0 + 0x24 ], %o7 20099b4: 80 a3 c0 13 cmp %o7, %l3 20099b8: 9e 60 3f ff subx %g0, -1, %o7 if ( !_Heap_Is_block_in_heap( heap, next_block ) ) { 20099bc: 80 a3 e0 00 cmp %o7, 0 20099c0: 32 80 00 07 bne,a 20099dc <_Heap_Walk+0x2d4> 20099c4: da 27 bf f8 st %o5, [ %fp + -8 ] (*printer)( 20099c8: 15 00 80 71 sethi %hi(0x201c400), %o2 20099cc: 90 10 00 16 mov %l6, %o0 20099d0: 92 10 20 01 mov 1, %o1 20099d4: 10 80 00 2c b 2009a84 <_Heap_Walk+0x37c> 20099d8: 94 12 a3 80 or %o2, 0x380, %o2 RTEMS_INLINE_ROUTINE bool _Heap_Is_aligned( uintptr_t value, uintptr_t alignment ) { return (value % alignment) == 0; 20099dc: 90 10 00 14 mov %l4, %o0 20099e0: 7f ff e0 69 call 2001b84 <.urem> 20099e4: 92 10 00 1c mov %i4, %o1 20099e8: da 07 bf f8 ld [ %fp + -8 ], %o5 ); return false; } if ( !_Heap_Is_aligned( block_size, page_size ) && is_not_last_block ) { 20099ec: 80 a2 20 00 cmp %o0, 0 20099f0: 02 80 00 0c be 2009a20 <_Heap_Walk+0x318> 20099f4: 9e 0b 60 ff and %o5, 0xff, %o7 20099f8: 80 a3 e0 00 cmp %o7, 0 20099fc: 02 80 00 19 be 2009a60 <_Heap_Walk+0x358> 2009a00: 80 a6 40 13 cmp %i1, %l3 (*printer)( 2009a04: 15 00 80 71 sethi %hi(0x201c400), %o2 2009a08: 90 10 00 16 mov %l6, %o0 2009a0c: 92 10 20 01 mov 1, %o1 2009a10: 94 12 a3 b0 or %o2, 0x3b0, %o2 2009a14: 96 10 00 19 mov %i1, %o3 2009a18: 10 80 00 1d b 2009a8c <_Heap_Walk+0x384> 2009a1c: 98 10 00 14 mov %l4, %o4 ); return false; } if ( block_size < min_block_size && is_not_last_block ) { 2009a20: 80 a3 e0 00 cmp %o7, 0 2009a24: 02 80 00 0f be 2009a60 <_Heap_Walk+0x358> 2009a28: 80 a6 40 13 cmp %i1, %l3 2009a2c: 80 a5 00 1b cmp %l4, %i3 2009a30: 1a 80 00 0c bcc 2009a60 <_Heap_Walk+0x358> 2009a34: 80 a6 40 13 cmp %i1, %l3 (*printer)( 2009a38: 90 10 00 16 mov %l6, %o0 2009a3c: 92 10 20 01 mov 1, %o1 2009a40: 15 00 80 71 sethi %hi(0x201c400), %o2 2009a44: 96 10 00 19 mov %i1, %o3 2009a48: 94 12 a3 e0 or %o2, 0x3e0, %o2 2009a4c: 98 10 00 14 mov %l4, %o4 2009a50: 9f c7 40 00 call %i5 2009a54: 9a 10 00 1b mov %i3, %o5 "block 0x%08x: next block 0x%08x is not a successor\n", block, next_block ); return false; 2009a58: 10 80 00 68 b 2009bf8 <_Heap_Walk+0x4f0> 2009a5c: b0 10 20 00 clr %i0 ); return false; } if ( next_block_begin <= block_begin && is_not_last_block ) { 2009a60: 2a 80 00 10 bcs,a 2009aa0 <_Heap_Walk+0x398> 2009a64: de 04 e0 04 ld [ %l3 + 4 ], %o7 2009a68: 80 8b 60 ff btst 0xff, %o5 2009a6c: 22 80 00 0d be,a 2009aa0 <_Heap_Walk+0x398> 2009a70: de 04 e0 04 ld [ %l3 + 4 ], %o7 (*printer)( 2009a74: 15 00 80 72 sethi %hi(0x201c800), %o2 2009a78: 90 10 00 16 mov %l6, %o0 2009a7c: 92 10 20 01 mov 1, %o1 2009a80: 94 12 a0 10 or %o2, 0x10, %o2 2009a84: 96 10 00 19 mov %i1, %o3 2009a88: 98 10 00 13 mov %l3, %o4 2009a8c: 9f c7 40 00 call %i5 2009a90: b0 10 20 00 clr %i0 2009a94: b0 0e 20 ff and %i0, 0xff, %i0 2009a98: 81 c7 e0 08 ret 2009a9c: 81 e8 00 00 restore ); return false; } if ( !_Heap_Is_prev_used( next_block ) ) { 2009aa0: 80 8b e0 01 btst 1, %o7 2009aa4: 12 80 00 3f bne 2009ba0 <_Heap_Walk+0x498> 2009aa8: 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 ? 2009aac: 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)( 2009ab0: d8 06 20 08 ld [ %i0 + 8 ], %o4 2009ab4: 80 a3 40 0c cmp %o5, %o4 2009ab8: 02 80 00 08 be 2009ad8 <_Heap_Walk+0x3d0> 2009abc: 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)" : ""), 2009ac0: 80 a3 40 18 cmp %o5, %i0 2009ac4: 12 80 00 07 bne 2009ae0 <_Heap_Walk+0x3d8> 2009ac8: 96 14 60 b8 or %l1, 0xb8, %o3 2009acc: 17 00 80 71 sethi %hi(0x201c400), %o3 2009ad0: 10 80 00 04 b 2009ae0 <_Heap_Walk+0x3d8> 2009ad4: 96 12 e1 00 or %o3, 0x100, %o3 ! 201c500 <__log2table+0x130> Heap_Block *const last_free_block = _Heap_Free_list_last( heap ); bool const prev_used = _Heap_Is_prev_used( block ); uintptr_t const block_size = _Heap_Block_size( block ); Heap_Block *const next_block = _Heap_Block_at( block, block_size ); (*printer)( 2009ad8: 03 00 80 71 sethi %hi(0x201c400), %g1 2009adc: 96 10 60 f0 or %g1, 0xf0, %o3 ! 201c4f0 <__log2table+0x120> block->prev, block->prev == first_free_block ? " (= first free)" : (block->prev == free_list_head ? " (= head)" : ""), block->next, block->next == last_free_block ? 2009ae0: 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)( 2009ae4: 80 a3 00 0f cmp %o4, %o7 2009ae8: 02 80 00 06 be 2009b00 <_Heap_Walk+0x3f8> 2009aec: 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)" : "") 2009af0: 12 80 00 06 bne 2009b08 <_Heap_Walk+0x400> 2009af4: 9e 14 60 b8 or %l1, 0xb8, %o7 2009af8: 10 80 00 04 b 2009b08 <_Heap_Walk+0x400> 2009afc: 9e 15 e1 20 or %l7, 0x120, %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)( 2009b00: 03 00 80 71 sethi %hi(0x201c400), %g1 2009b04: 9e 10 61 10 or %g1, 0x110, %o7 ! 201c510 <__log2table+0x140> 2009b08: d6 23 a0 5c st %o3, [ %sp + 0x5c ] 2009b0c: d8 23 a0 60 st %o4, [ %sp + 0x60 ] 2009b10: de 23 a0 64 st %o7, [ %sp + 0x64 ] 2009b14: 90 10 00 16 mov %l6, %o0 2009b18: 92 10 20 00 clr %o1 2009b1c: 94 10 00 15 mov %l5, %o2 2009b20: 96 10 00 19 mov %i1, %o3 2009b24: 9f c7 40 00 call %i5 2009b28: 98 10 00 14 mov %l4, %o4 block->next == last_free_block ? " (= last free)" : (block->next == free_list_tail ? " (= tail)" : "") ); if ( block_size != next_block->prev_size ) { 2009b2c: da 04 c0 00 ld [ %l3 ], %o5 2009b30: 80 a5 00 0d cmp %l4, %o5 2009b34: 02 80 00 0c be 2009b64 <_Heap_Walk+0x45c> 2009b38: 80 a4 a0 00 cmp %l2, 0 (*printer)( 2009b3c: e6 23 a0 5c st %l3, [ %sp + 0x5c ] 2009b40: 90 10 00 16 mov %l6, %o0 2009b44: 92 10 20 01 mov 1, %o1 2009b48: 15 00 80 72 sethi %hi(0x201c800), %o2 2009b4c: 96 10 00 19 mov %i1, %o3 2009b50: 94 12 a0 80 or %o2, 0x80, %o2 2009b54: 9f c7 40 00 call %i5 2009b58: 98 10 00 14 mov %l4, %o4 "block 0x%08x: next block 0x%08x is not a successor\n", block, next_block ); return false; 2009b5c: 10 bf ff ce b 2009a94 <_Heap_Walk+0x38c> 2009b60: b0 10 20 00 clr %i0 ); return false; } if ( !prev_used ) { 2009b64: 32 80 00 0a bne,a 2009b8c <_Heap_Walk+0x484> 2009b68: c6 06 20 08 ld [ %i0 + 8 ], %g3 (*printer)( 2009b6c: 15 00 80 72 sethi %hi(0x201c800), %o2 2009b70: 90 10 00 16 mov %l6, %o0 2009b74: 92 10 20 01 mov 1, %o1 2009b78: 10 80 00 26 b 2009c10 <_Heap_Walk+0x508> 2009b7c: 94 12 a0 c0 or %o2, 0xc0, %o2 { const Heap_Block *const free_list_tail = _Heap_Free_list_tail( heap ); const Heap_Block *free_block = _Heap_Free_list_first( heap ); while ( free_block != free_list_tail ) { if ( free_block == block ) { 2009b80: 22 80 00 19 be,a 2009be4 <_Heap_Walk+0x4dc> 2009b84: b2 10 00 13 mov %l3, %i1 return true; } free_block = free_block->next; 2009b88: c6 00 e0 08 ld [ %g3 + 8 ], %g3 ) { const Heap_Block *const free_list_tail = _Heap_Free_list_tail( heap ); const Heap_Block *free_block = _Heap_Free_list_first( heap ); while ( free_block != free_list_tail ) { 2009b8c: 80 a0 c0 18 cmp %g3, %i0 2009b90: 12 bf ff fc bne 2009b80 <_Heap_Walk+0x478> 2009b94: 80 a0 c0 19 cmp %g3, %i1 return false; } if ( !_Heap_Walk_is_in_free_list( heap, block ) ) { (*printer)( 2009b98: 10 80 00 1b b 2009c04 <_Heap_Walk+0x4fc> 2009b9c: 15 00 80 72 sethi %hi(0x201c800), %o2 if ( !_Heap_Is_prev_used( next_block ) ) { if ( !_Heap_Walk_check_free_block( source, printer, heap, block ) ) { return false; } } else if (prev_used) { 2009ba0: 80 a4 a0 00 cmp %l2, 0 2009ba4: 02 80 00 09 be 2009bc8 <_Heap_Walk+0x4c0> 2009ba8: 92 10 20 00 clr %o1 (*printer)( 2009bac: 15 00 80 72 sethi %hi(0x201c800), %o2 2009bb0: 96 10 00 19 mov %i1, %o3 2009bb4: 94 12 a0 f0 or %o2, 0xf0, %o2 2009bb8: 9f c7 40 00 call %i5 2009bbc: 98 10 00 14 mov %l4, %o4 2009bc0: 10 80 00 09 b 2009be4 <_Heap_Walk+0x4dc> 2009bc4: b2 10 00 13 mov %l3, %i1 "block 0x%08x: size %u\n", block, block_size ); } else { (*printer)( 2009bc8: da 06 40 00 ld [ %i1 ], %o5 2009bcc: 15 00 80 72 sethi %hi(0x201c800), %o2 2009bd0: 96 10 00 19 mov %i1, %o3 2009bd4: 94 12 a1 08 or %o2, 0x108, %o2 2009bd8: 9f c7 40 00 call %i5 2009bdc: 98 10 00 14 mov %l4, %o4 2009be0: b2 10 00 13 mov %l3, %i1 block->prev_size ); } block = next_block; } while ( block != first_block ); 2009be4: 80 a4 c0 1a cmp %l3, %i2 2009be8: 32 bf ff 68 bne,a 2009988 <_Heap_Walk+0x280> 2009bec: e4 06 60 04 ld [ %i1 + 4 ], %l2 2009bf0: 10 80 00 02 b 2009bf8 <_Heap_Walk+0x4f0> 2009bf4: b0 10 20 01 mov 1, %i0 2009bf8: b0 0e 20 ff and %i0, 0xff, %i0 2009bfc: 81 c7 e0 08 ret 2009c00: 81 e8 00 00 restore return false; } if ( !_Heap_Walk_is_in_free_list( heap, block ) ) { (*printer)( 2009c04: 90 10 00 16 mov %l6, %o0 2009c08: 92 10 20 01 mov 1, %o1 2009c0c: 94 12 a1 30 or %o2, 0x130, %o2 2009c10: 96 10 00 19 mov %i1, %o3 2009c14: 9f c7 40 00 call %i5 2009c18: b0 10 20 00 clr %i0 2009c1c: b0 0e 20 ff and %i0, 0xff, %i0 2009c20: 81 c7 e0 08 ret 2009c24: 81 e8 00 00 restore =============================================================================== 02008afc <_Internal_error_Occurred>: void _Internal_error_Occurred( Internal_errors_Source the_source, bool is_internal, Internal_errors_t the_error ) { 2008afc: 9d e3 bf 90 save %sp, -112, %sp Internal_errors_t error ) { User_extensions_Fatal_context ctx = { source, is_internal, error }; _User_extensions_Iterate( &ctx, _User_extensions_Fatal_visitor ); 2008b00: 13 00 80 2a sethi %hi(0x200a800), %o1 2008b04: 90 07 bf f4 add %fp, -12, %o0 2008b08: 92 12 63 b8 or %o1, 0x3b8, %o1 Internal_errors_Source source, bool is_internal, Internal_errors_t error ) { User_extensions_Fatal_context ctx = { source, is_internal, error }; 2008b0c: f0 27 bf f4 st %i0, [ %fp + -12 ] 2008b10: f2 2f bf f8 stb %i1, [ %fp + -8 ] _User_extensions_Iterate( &ctx, _User_extensions_Fatal_visitor ); 2008b14: 40 00 08 34 call 200abe4 <_User_extensions_Iterate> 2008b18: f4 27 bf fc st %i2, [ %fp + -4 ] _User_extensions_Fatal( the_source, is_internal, the_error ); _Internal_errors_What_happened.the_source = the_source; 2008b1c: 05 00 80 76 sethi %hi(0x201d800), %g2 <== NOT EXECUTED 2008b20: 82 10 a2 dc or %g2, 0x2dc, %g1 ! 201dadc <_Internal_errors_What_happened><== NOT EXECUTED 2008b24: f0 20 a2 dc st %i0, [ %g2 + 0x2dc ] <== NOT EXECUTED _Internal_errors_What_happened.is_internal = is_internal; 2008b28: f2 28 60 04 stb %i1, [ %g1 + 4 ] <== NOT EXECUTED _Internal_errors_What_happened.the_error = the_error; 2008b2c: 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; 2008b30: 84 10 20 05 mov 5, %g2 <== NOT EXECUTED 2008b34: 03 00 80 76 sethi %hi(0x201d800), %g1 <== NOT EXECUTED _System_state_Set( SYSTEM_STATE_FAILED ); _CPU_Fatal_halt( the_error ); 2008b38: 7f ff e6 a3 call 20025c4 <== NOT EXECUTED 2008b3c: c4 20 62 e8 st %g2, [ %g1 + 0x2e8 ] ! 201dae8 <_System_state_Current><== NOT EXECUTED 2008b40: 82 10 00 08 mov %o0, %g1 <== NOT EXECUTED 2008b44: 30 80 00 00 b,a 2008b44 <_Internal_error_Occurred+0x48> <== NOT EXECUTED =============================================================================== 02008bb0 <_Objects_Allocate>: #endif Objects_Control *_Objects_Allocate( Objects_Information *information ) { 2008bb0: 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 ) 2008bb4: c2 06 20 18 ld [ %i0 + 0x18 ], %g1 2008bb8: 80 a0 60 00 cmp %g1, 0 2008bbc: 12 80 00 04 bne 2008bcc <_Objects_Allocate+0x1c> <== ALWAYS TAKEN 2008bc0: ba 10 00 18 mov %i0, %i5 return NULL; 2008bc4: 81 c7 e0 08 ret 2008bc8: 91 e8 20 00 restore %g0, 0, %o0 /* * OK. The manager should be initialized and configured to have objects. * With any luck, it is safe to attempt to allocate an object. */ the_object = (Objects_Control *) _Chain_Get( &information->Inactive ); 2008bcc: b8 06 20 20 add %i0, 0x20, %i4 2008bd0: 7f ff fd 85 call 20081e4 <_Chain_Get> 2008bd4: 90 10 00 1c mov %i4, %o0 if ( information->auto_extend ) { 2008bd8: c2 0f 60 12 ldub [ %i5 + 0x12 ], %g1 2008bdc: 80 a0 60 00 cmp %g1, 0 2008be0: 02 80 00 1d be 2008c54 <_Objects_Allocate+0xa4> 2008be4: b0 10 00 08 mov %o0, %i0 /* * If the list is empty then we are out of objects and need to * extend information base. */ if ( !the_object ) { 2008be8: 80 a2 20 00 cmp %o0, 0 2008bec: 32 80 00 0a bne,a 2008c14 <_Objects_Allocate+0x64> 2008bf0: c4 07 60 08 ld [ %i5 + 8 ], %g2 _Objects_Extend_information( information ); 2008bf4: 40 00 00 21 call 2008c78 <_Objects_Extend_information> 2008bf8: 90 10 00 1d mov %i5, %o0 the_object = (Objects_Control *) _Chain_Get( &information->Inactive ); 2008bfc: 7f ff fd 7a call 20081e4 <_Chain_Get> 2008c00: 90 10 00 1c mov %i4, %o0 } if ( the_object ) { 2008c04: b0 92 20 00 orcc %o0, 0, %i0 2008c08: 02 bf ff ef be 2008bc4 <_Objects_Allocate+0x14> 2008c0c: 01 00 00 00 nop uint32_t block; block = (uint32_t) _Objects_Get_index( the_object->id ) - 2008c10: c4 07 60 08 ld [ %i5 + 8 ], %g2 2008c14: d0 06 20 08 ld [ %i0 + 8 ], %o0 _Objects_Get_index( information->minimum_id ); block /= information->allocation_size; 2008c18: d2 17 60 14 lduh [ %i5 + 0x14 ], %o1 } if ( the_object ) { uint32_t block; block = (uint32_t) _Objects_Get_index( the_object->id ) - 2008c1c: 03 00 00 3f sethi %hi(0xfc00), %g1 2008c20: 82 10 63 ff or %g1, 0x3ff, %g1 ! ffff 2008c24: 90 0a 00 01 and %o0, %g1, %o0 2008c28: 82 08 80 01 and %g2, %g1, %g1 _Objects_Get_index( information->minimum_id ); block /= information->allocation_size; 2008c2c: 40 00 3e 2f call 20184e8 <.udiv> 2008c30: 90 22 00 01 sub %o0, %g1, %o0 information->inactive_per_block[ block ]--; 2008c34: c2 07 60 30 ld [ %i5 + 0x30 ], %g1 2008c38: 91 2a 20 02 sll %o0, 2, %o0 2008c3c: c4 00 40 08 ld [ %g1 + %o0 ], %g2 2008c40: 84 00 bf ff add %g2, -1, %g2 2008c44: c4 20 40 08 st %g2, [ %g1 + %o0 ] information->inactive--; 2008c48: c2 17 60 2c lduh [ %i5 + 0x2c ], %g1 2008c4c: 82 00 7f ff add %g1, -1, %g1 2008c50: c2 37 60 2c sth %g1, [ %i5 + 0x2c ] ); } #endif return the_object; } 2008c54: 81 c7 e0 08 ret 2008c58: 81 e8 00 00 restore =============================================================================== 02008fe0 <_Objects_Get_information>: Objects_Information *_Objects_Get_information( Objects_APIs the_api, uint16_t the_class ) { 2008fe0: 9d e3 bf a0 save %sp, -96, %sp Objects_Information *info; int the_class_api_maximum; if ( !the_class ) 2008fe4: 80 a6 60 00 cmp %i1, 0 2008fe8: 12 80 00 04 bne 2008ff8 <_Objects_Get_information+0x18> 2008fec: 01 00 00 00 nop return NULL; 2008ff0: 81 c7 e0 08 ret 2008ff4: 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 ); 2008ff8: 40 00 12 45 call 200d90c <_Objects_API_maximum_class> 2008ffc: 90 10 00 18 mov %i0, %o0 if ( the_class_api_maximum == 0 ) 2009000: 80 a2 20 00 cmp %o0, 0 2009004: 02 bf ff fb be 2008ff0 <_Objects_Get_information+0x10> 2009008: 80 a6 40 08 cmp %i1, %o0 return NULL; if ( the_class > (uint32_t) the_class_api_maximum ) 200900c: 18 bf ff f9 bgu 2008ff0 <_Objects_Get_information+0x10> 2009010: 03 00 80 75 sethi %hi(0x201d400), %g1 return NULL; if ( !_Objects_Information_table[ the_api ] ) 2009014: b1 2e 20 02 sll %i0, 2, %i0 2009018: 82 10 61 34 or %g1, 0x134, %g1 200901c: c2 00 40 18 ld [ %g1 + %i0 ], %g1 2009020: 80 a0 60 00 cmp %g1, 0 2009024: 02 bf ff f3 be 2008ff0 <_Objects_Get_information+0x10> <== NEVER TAKEN 2009028: b3 2e 60 02 sll %i1, 2, %i1 return NULL; info = _Objects_Information_table[ the_api ][ the_class ]; 200902c: f0 00 40 19 ld [ %g1 + %i1 ], %i0 if ( !info ) 2009030: 80 a6 20 00 cmp %i0, 0 2009034: 02 bf ff ef be 2008ff0 <_Objects_Get_information+0x10> <== NEVER TAKEN 2009038: 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 ) 200903c: c2 16 20 10 lduh [ %i0 + 0x10 ], %g1 2009040: 80 a0 60 00 cmp %g1, 0 2009044: 02 bf ff eb be 2008ff0 <_Objects_Get_information+0x10> 2009048: 01 00 00 00 nop return NULL; #endif return info; } 200904c: 81 c7 e0 08 ret 2009050: 81 e8 00 00 restore =============================================================================== 0201b3d8 <_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; 201b3d8: c2 02 20 08 ld [ %o0 + 8 ], %g1 201b3dc: 92 22 40 01 sub %o1, %g1, %o1 if ( information->maximum >= index ) { 201b3e0: 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; 201b3e4: 92 02 60 01 inc %o1 if ( information->maximum >= index ) { 201b3e8: 80 a0 40 09 cmp %g1, %o1 201b3ec: 0a 80 00 09 bcs 201b410 <_Objects_Get_no_protection+0x38> 201b3f0: 93 2a 60 02 sll %o1, 2, %o1 if ( (the_object = information->local_table[ index ]) != NULL ) { 201b3f4: c2 02 20 1c ld [ %o0 + 0x1c ], %g1 201b3f8: d0 00 40 09 ld [ %g1 + %o1 ], %o0 201b3fc: 80 a2 20 00 cmp %o0, 0 201b400: 02 80 00 05 be 201b414 <_Objects_Get_no_protection+0x3c> <== NEVER TAKEN 201b404: 82 10 20 01 mov 1, %g1 *location = OBJECTS_LOCAL; return the_object; 201b408: 81 c3 e0 08 retl 201b40c: 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; 201b410: 82 10 20 01 mov 1, %g1 return NULL; 201b414: 90 10 20 00 clr %o0 } 201b418: 81 c3 e0 08 retl 201b41c: c2 22 80 00 st %g1, [ %o2 ] =============================================================================== 0200d0e8 <_Objects_Id_to_name>: Objects_Name_or_id_lookup_errors _Objects_Id_to_name ( Objects_Id id, Objects_Name *name ) { 200d0e8: 9d e3 bf 98 save %sp, -104, %sp /* * Caller is trusted for name != NULL. */ tmpId = (id == OBJECTS_ID_OF_SELF) ? _Thread_Executing->Object.id : id; 200d0ec: 80 a6 20 00 cmp %i0, 0 200d0f0: 12 80 00 06 bne 200d108 <_Objects_Id_to_name+0x20> 200d0f4: 83 36 20 18 srl %i0, 0x18, %g1 200d0f8: 03 00 80 b7 sethi %hi(0x202dc00), %g1 200d0fc: c2 00 63 30 ld [ %g1 + 0x330 ], %g1 ! 202df30 <_Per_CPU_Information+0x10> 200d100: f0 00 60 08 ld [ %g1 + 8 ], %i0 200d104: 83 36 20 18 srl %i0, 0x18, %g1 200d108: 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 ) 200d10c: 84 00 7f ff add %g1, -1, %g2 200d110: 80 a0 a0 02 cmp %g2, 2 200d114: 08 80 00 18 bleu 200d174 <_Objects_Id_to_name+0x8c> 200d118: 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; 200d11c: 81 c7 e0 08 ret 200d120: 91 e8 20 03 restore %g0, 3, %o0 if ( !_Objects_Information_table[ the_api ] ) return OBJECTS_INVALID_ID; the_class = _Objects_Get_class( tmpId ); information = _Objects_Information_table[ the_api ][ the_class ]; 200d124: 85 28 a0 02 sll %g2, 2, %g2 200d128: d0 00 40 02 ld [ %g1 + %g2 ], %o0 if ( !information ) 200d12c: 80 a2 20 00 cmp %o0, 0 200d130: 02 bf ff fb be 200d11c <_Objects_Id_to_name+0x34> <== NEVER TAKEN 200d134: 01 00 00 00 nop return OBJECTS_INVALID_ID; #if defined(RTEMS_SCORE_OBJECT_ENABLE_STRING_NAMES) if ( information->is_string ) 200d138: c2 0a 20 38 ldub [ %o0 + 0x38 ], %g1 200d13c: 80 a0 60 00 cmp %g1, 0 200d140: 12 bf ff f7 bne 200d11c <_Objects_Id_to_name+0x34> <== NEVER TAKEN 200d144: 92 10 00 18 mov %i0, %o1 return OBJECTS_INVALID_ID; #endif the_object = _Objects_Get( information, tmpId, &ignored_location ); 200d148: 7f ff ff cb call 200d074 <_Objects_Get> 200d14c: 94 07 bf fc add %fp, -4, %o2 if ( !the_object ) 200d150: 80 a2 20 00 cmp %o0, 0 200d154: 02 bf ff f2 be 200d11c <_Objects_Id_to_name+0x34> 200d158: 01 00 00 00 nop return OBJECTS_INVALID_ID; *name = the_object->name; 200d15c: c2 02 20 0c ld [ %o0 + 0xc ], %g1 _Thread_Enable_dispatch(); return OBJECTS_NAME_OR_ID_LOOKUP_SUCCESSFUL; 200d160: b0 10 20 00 clr %i0 the_object = _Objects_Get( information, tmpId, &ignored_location ); if ( !the_object ) return OBJECTS_INVALID_ID; *name = the_object->name; _Thread_Enable_dispatch(); 200d164: 40 00 03 d0 call 200e0a4 <_Thread_Enable_dispatch> 200d168: c2 26 40 00 st %g1, [ %i1 ] 200d16c: 81 c7 e0 08 ret 200d170: 81 e8 00 00 restore the_api = _Objects_Get_API( tmpId ); if ( !_Objects_Is_api_valid( the_api ) ) return OBJECTS_INVALID_ID; if ( !_Objects_Information_table[ the_api ] ) 200d174: 05 00 80 b6 sethi %hi(0x202d800), %g2 200d178: 84 10 a1 24 or %g2, 0x124, %g2 ! 202d924 <_Objects_Information_table> 200d17c: c2 00 80 01 ld [ %g2 + %g1 ], %g1 200d180: 80 a0 60 00 cmp %g1, 0 200d184: 12 bf ff e8 bne 200d124 <_Objects_Id_to_name+0x3c> 200d188: 85 36 20 1b srl %i0, 0x1b, %g2 200d18c: 30 bf ff e4 b,a 200d11c <_Objects_Id_to_name+0x34> =============================================================================== 0200ee88 <_POSIX_Keys_Run_destructors>: */ void _POSIX_Keys_Run_destructors( Thread_Control *thread ) { 200ee88: 9d e3 bf a0 save %sp, -96, %sp Objects_Maximum thread_index = _Objects_Get_index( thread->Object.id ); 200ee8c: c2 06 20 08 ld [ %i0 + 8 ], %g1 for ( index = 1 ; index <= max ; ++index ) { POSIX_Keys_Control *key = (POSIX_Keys_Control *) _POSIX_Keys_Information.local_table [ index ]; if ( key != NULL && key->destructor != NULL ) { void *value = key->Values [ thread_api ][ thread_index ]; 200ee90: 39 00 00 3f sethi %hi(0xfc00), %i4 200ee94: b5 30 60 18 srl %g1, 0x18, %i2 200ee98: b8 17 23 ff or %i4, 0x3ff, %i4 200ee9c: b4 0e a0 07 and %i2, 7, %i2 200eea0: b8 08 40 1c and %g1, %i4, %i4 200eea4: b4 06 a0 04 add %i2, 4, %i2 200eea8: b9 2f 20 02 sll %i4, 2, %i4 * * Reference: 17.1.1.2 P1003.1c/Draft 10, p. 163, line 99. */ while ( !done ) { Objects_Maximum index = 0; Objects_Maximum max = _POSIX_Keys_Information.maximum; 200eeac: 37 00 80 76 sethi %hi(0x201d800), %i3 for ( index = 1 ; index <= max ; ++index ) { POSIX_Keys_Control *key = (POSIX_Keys_Control *) _POSIX_Keys_Information.local_table [ index ]; if ( key != NULL && key->destructor != NULL ) { void *value = key->Values [ thread_api ][ thread_index ]; 200eeb0: b5 2e a0 02 sll %i2, 2, %i2 * * Reference: 17.1.1.2 P1003.1c/Draft 10, p. 163, line 99. */ while ( !done ) { Objects_Maximum index = 0; Objects_Maximum max = _POSIX_Keys_Information.maximum; 200eeb4: 82 16 e1 bc or %i3, 0x1bc, %g1 done = true; for ( index = 1 ; index <= max ; ++index ) { 200eeb8: ba 10 20 01 mov 1, %i5 */ while ( !done ) { Objects_Maximum index = 0; Objects_Maximum max = _POSIX_Keys_Information.maximum; done = true; 200eebc: 84 10 20 01 mov 1, %g2 for ( index = 1 ; index <= max ; ++index ) { 200eec0: 10 80 00 18 b 200ef20 <_POSIX_Keys_Run_destructors+0x98> 200eec4: f2 10 60 10 lduh [ %g1 + 0x10 ], %i1 POSIX_Keys_Control *key = (POSIX_Keys_Control *) _POSIX_Keys_Information.local_table [ index ]; 200eec8: 86 16 e1 bc or %i3, 0x1bc, %g3 Objects_Maximum max = _POSIX_Keys_Information.maximum; done = true; for ( index = 1 ; index <= max ; ++index ) { POSIX_Keys_Control *key = (POSIX_Keys_Control *) 200eecc: c6 00 e0 1c ld [ %g3 + 0x1c ], %g3 200eed0: 83 28 60 02 sll %g1, 2, %g1 200eed4: c2 00 c0 01 ld [ %g3 + %g1 ], %g1 _POSIX_Keys_Information.local_table [ index ]; if ( key != NULL && key->destructor != NULL ) { 200eed8: 80 a0 60 00 cmp %g1, 0 200eedc: 22 80 00 11 be,a 200ef20 <_POSIX_Keys_Run_destructors+0x98> 200eee0: ba 07 60 01 inc %i5 200eee4: c6 00 60 10 ld [ %g1 + 0x10 ], %g3 200eee8: 80 a0 e0 00 cmp %g3, 0 200eeec: 02 80 00 0c be 200ef1c <_POSIX_Keys_Run_destructors+0x94> 200eef0: 86 00 40 1a add %g1, %i2, %g3 void *value = key->Values [ thread_api ][ thread_index ]; 200eef4: c6 00 e0 04 ld [ %g3 + 4 ], %g3 200eef8: d0 00 c0 1c ld [ %g3 + %i4 ], %o0 if ( value != NULL ) { 200eefc: 80 a2 20 00 cmp %o0, 0 200ef00: 22 80 00 08 be,a 200ef20 <_POSIX_Keys_Run_destructors+0x98><== ALWAYS TAKEN 200ef04: ba 07 60 01 inc %i5 key->Values [ thread_api ][ thread_index ] = NULL; 200ef08: c0 20 c0 1c clr [ %g3 + %i4 ] <== NOT EXECUTED (*key->destructor)( value ); 200ef0c: c2 00 60 10 ld [ %g1 + 0x10 ], %g1 <== NOT EXECUTED 200ef10: 9f c0 40 00 call %g1 <== NOT EXECUTED 200ef14: 01 00 00 00 nop <== NOT EXECUTED done = false; 200ef18: 84 10 20 00 clr %g2 ! 0 <== NOT EXECUTED Objects_Maximum index = 0; Objects_Maximum max = _POSIX_Keys_Information.maximum; done = true; for ( index = 1 ; index <= max ; ++index ) { 200ef1c: ba 07 60 01 inc %i5 200ef20: 83 2f 60 10 sll %i5, 0x10, %g1 200ef24: 83 30 60 10 srl %g1, 0x10, %g1 200ef28: 80 a0 40 19 cmp %g1, %i1 200ef2c: 08 bf ff e7 bleu 200eec8 <_POSIX_Keys_Run_destructors+0x40> 200ef30: 80 88 a0 ff btst 0xff, %g2 * number of iterations. An infinite loop may happen if destructors set * thread specific data. This can be considered dubious. * * Reference: 17.1.1.2 P1003.1c/Draft 10, p. 163, line 99. */ while ( !done ) { 200ef34: 02 bf ff e1 be 200eeb8 <_POSIX_Keys_Run_destructors+0x30> <== NEVER TAKEN 200ef38: 82 16 e1 bc or %i3, 0x1bc, %g1 done = false; } } } } } 200ef3c: 81 c7 e0 08 ret 200ef40: 81 e8 00 00 restore =============================================================================== 0200c850 <_POSIX_Message_queue_Receive_support>: size_t msg_len, unsigned int *msg_prio, bool wait, Watchdog_Interval timeout ) { 200c850: 9d e3 bf 98 save %sp, -104, %sp RTEMS_INLINE_ROUTINE POSIX_Message_queue_Control_fd *_POSIX_Message_queue_Get_fd ( mqd_t id, Objects_Locations *location ) { return (POSIX_Message_queue_Control_fd *) _Objects_Get( 200c854: 11 00 80 a9 sethi %hi(0x202a400), %o0 200c858: 92 10 00 18 mov %i0, %o1 200c85c: 90 12 23 e0 or %o0, 0x3e0, %o0 200c860: 40 00 0c d5 call 200fbb4 <_Objects_Get> 200c864: 94 07 bf f8 add %fp, -8, %o2 Objects_Locations location; size_t length_out; bool do_wait; the_mq_fd = _POSIX_Message_queue_Get_fd( mqdes, &location ); switch ( location ) { 200c868: c2 07 bf f8 ld [ %fp + -8 ], %g1 200c86c: 80 a0 60 00 cmp %g1, 0 200c870: 12 80 00 40 bne 200c970 <_POSIX_Message_queue_Receive_support+0x120> 200c874: 01 00 00 00 nop case OBJECTS_LOCAL: if ( (the_mq_fd->oflag & O_ACCMODE) == O_WRONLY ) { 200c878: c2 02 20 14 ld [ %o0 + 0x14 ], %g1 200c87c: 84 08 60 03 and %g1, 3, %g2 200c880: 80 a0 a0 01 cmp %g2, 1 200c884: 32 80 00 05 bne,a 200c898 <_POSIX_Message_queue_Receive_support+0x48> 200c888: d0 02 20 10 ld [ %o0 + 0x10 ], %o0 _Thread_Enable_dispatch(); 200c88c: 40 00 10 a8 call 2010b2c <_Thread_Enable_dispatch> 200c890: 01 00 00 00 nop 200c894: 30 80 00 37 b,a 200c970 <_POSIX_Message_queue_Receive_support+0x120> rtems_set_errno_and_return_minus_one( EBADF ); } the_mq = the_mq_fd->Queue; if ( msg_len < the_mq->Message_queue.maximum_message_size ) { 200c898: c4 02 20 68 ld [ %o0 + 0x68 ], %g2 200c89c: 80 a6 80 02 cmp %i2, %g2 200c8a0: 1a 80 00 08 bcc 200c8c0 <_POSIX_Message_queue_Receive_support+0x70> 200c8a4: 84 10 3f ff mov -1, %g2 _Thread_Enable_dispatch(); 200c8a8: 40 00 10 a1 call 2010b2c <_Thread_Enable_dispatch> 200c8ac: 01 00 00 00 nop rtems_set_errno_and_return_minus_one( EMSGSIZE ); 200c8b0: 40 00 28 1f call 201692c <__errno> 200c8b4: 01 00 00 00 nop 200c8b8: 10 80 00 31 b 200c97c <_POSIX_Message_queue_Receive_support+0x12c> 200c8bc: 82 10 20 7a mov 0x7a, %g1 ! 7a /* * Now if something goes wrong, we return a "length" of -1 * to indicate an error. */ length_out = -1; 200c8c0: c4 27 bf fc st %g2, [ %fp + -4 ] /* * A timed receive with a bad time will do a poll regardless. */ if ( wait ) 200c8c4: 80 a7 20 00 cmp %i4, 0 200c8c8: 02 80 00 05 be 200c8dc <_POSIX_Message_queue_Receive_support+0x8c> 200c8cc: 98 10 20 00 clr %o4 do_wait = (the_mq_fd->oflag & O_NONBLOCK) ? false : true; 200c8d0: 99 30 60 0e srl %g1, 0xe, %o4 200c8d4: 98 1b 20 01 xor %o4, 1, %o4 200c8d8: 98 0b 20 01 and %o4, 1, %o4 do_wait = wait; /* * Now perform the actual message receive */ _CORE_message_queue_Seize( 200c8dc: 90 02 20 1c add %o0, 0x1c, %o0 200c8e0: 92 10 00 18 mov %i0, %o1 200c8e4: 94 10 00 19 mov %i1, %o2 200c8e8: 96 07 bf fc add %fp, -4, %o3 200c8ec: 98 0b 20 01 and %o4, 1, %o4 200c8f0: 40 00 08 7e call 200eae8 <_CORE_message_queue_Seize> 200c8f4: 9a 10 00 1d mov %i5, %o5 &length_out, do_wait, timeout ); _Thread_Enable_dispatch(); 200c8f8: 40 00 10 8d call 2010b2c <_Thread_Enable_dispatch> 200c8fc: 01 00 00 00 nop if (msg_prio) { 200c900: 80 a6 e0 00 cmp %i3, 0 200c904: 02 80 00 08 be 200c924 <_POSIX_Message_queue_Receive_support+0xd4><== NEVER TAKEN 200c908: 03 00 80 aa sethi %hi(0x202a800), %g1 *msg_prio = _POSIX_Message_queue_Priority_from_core( _Thread_Executing->Wait.count 200c90c: c2 00 60 70 ld [ %g1 + 0x70 ], %g1 ! 202a870 <_Per_CPU_Information+0x10> RTEMS_INLINE_ROUTINE unsigned int _POSIX_Message_queue_Priority_from_core( CORE_message_queue_Submit_types priority ) { /* absolute value without a library dependency */ return (unsigned int) ((priority >= 0) ? priority : -priority); 200c910: c4 00 60 24 ld [ %g1 + 0x24 ], %g2 200c914: 83 38 a0 1f sra %g2, 0x1f, %g1 200c918: 84 18 40 02 xor %g1, %g2, %g2 200c91c: 82 20 80 01 sub %g2, %g1, %g1 timeout ); _Thread_Enable_dispatch(); if (msg_prio) { *msg_prio = _POSIX_Message_queue_Priority_from_core( 200c920: c2 26 c0 00 st %g1, [ %i3 ] _Thread_Executing->Wait.count ); } if ( !_Thread_Executing->Wait.return_code ) 200c924: 3b 00 80 aa sethi %hi(0x202a800), %i5 200c928: ba 17 60 60 or %i5, 0x60, %i5 ! 202a860 <_Per_CPU_Information> 200c92c: c2 07 60 10 ld [ %i5 + 0x10 ], %g1 200c930: c2 00 60 34 ld [ %g1 + 0x34 ], %g1 200c934: 80 a0 60 00 cmp %g1, 0 200c938: 12 80 00 05 bne 200c94c <_POSIX_Message_queue_Receive_support+0xfc> 200c93c: 01 00 00 00 nop return length_out; 200c940: f0 07 bf fc ld [ %fp + -4 ], %i0 200c944: 81 c7 e0 08 ret 200c948: 81 e8 00 00 restore rtems_set_errno_and_return_minus_one( 200c94c: 40 00 27 f8 call 201692c <__errno> 200c950: b0 10 3f ff mov -1, %i0 200c954: c2 07 60 10 ld [ %i5 + 0x10 ], %g1 200c958: b8 10 00 08 mov %o0, %i4 200c95c: 40 00 00 96 call 200cbb4 <_POSIX_Message_queue_Translate_core_message_queue_return_code> 200c960: d0 00 60 34 ld [ %g1 + 0x34 ], %o0 200c964: d0 27 00 00 st %o0, [ %i4 ] 200c968: 81 c7 e0 08 ret 200c96c: 81 e8 00 00 restore #endif case OBJECTS_ERROR: break; } rtems_set_errno_and_return_minus_one( EBADF ); 200c970: 40 00 27 ef call 201692c <__errno> 200c974: 01 00 00 00 nop 200c978: 82 10 20 09 mov 9, %g1 ! 9 200c97c: c2 22 00 00 st %g1, [ %o0 ] 200c980: b0 10 3f ff mov -1, %i0 } 200c984: 81 c7 e0 08 ret 200c988: 81 e8 00 00 restore =============================================================================== 0200ec78 <_POSIX_Semaphore_Create_support>: size_t name_len, int pshared, unsigned int value, POSIX_Semaphore_Control **the_sem ) { 200ec78: 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) 200ec7c: 80 a6 a0 00 cmp %i2, 0 200ec80: 22 80 00 06 be,a 200ec98 <_POSIX_Semaphore_Create_support+0x20> 200ec84: 03 00 80 88 sethi %hi(0x2022000), %g1 rtems_set_errno_and_return_minus_one( ENOSYS ); 200ec88: 40 00 0a 42 call 2011590 <__errno> 200ec8c: 01 00 00 00 nop 200ec90: 10 80 00 10 b 200ecd0 <_POSIX_Semaphore_Create_support+0x58> 200ec94: 82 10 20 58 mov 0x58, %g1 ! 58 * * This rountine increments the thread dispatch level */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_increment_disable_level(void) { uint32_t level = _Thread_Dispatch_disable_level; 200ec98: c4 00 60 90 ld [ %g1 + 0x90 ], %g2 ++level; 200ec9c: 84 00 a0 01 inc %g2 _Thread_Dispatch_disable_level = level; 200eca0: c4 20 60 90 st %g2, [ %g1 + 0x90 ] * _POSIX_Semaphore_Allocate */ RTEMS_INLINE_ROUTINE POSIX_Semaphore_Control *_POSIX_Semaphore_Allocate( void ) { return (POSIX_Semaphore_Control *) 200eca4: 21 00 80 88 sethi %hi(0x2022000), %l0 200eca8: 7f ff ee d9 call 200a80c <_Objects_Allocate> 200ecac: 90 14 23 64 or %l0, 0x364, %o0 ! 2022364 <_POSIX_Semaphore_Information> _Thread_Disable_dispatch(); the_semaphore = _POSIX_Semaphore_Allocate(); if ( !the_semaphore ) { 200ecb0: ba 92 20 00 orcc %o0, 0, %i5 200ecb4: 12 80 00 0a bne 200ecdc <_POSIX_Semaphore_Create_support+0x64> 200ecb8: 80 a6 20 00 cmp %i0, 0 _Thread_Enable_dispatch(); 200ecbc: 7f ff f4 0b call 200bce8 <_Thread_Enable_dispatch> 200ecc0: 01 00 00 00 nop rtems_set_errno_and_return_minus_one( ENOSPC ); 200ecc4: 40 00 0a 33 call 2011590 <__errno> 200ecc8: 01 00 00 00 nop 200eccc: 82 10 20 1c mov 0x1c, %g1 ! 1c 200ecd0: c2 22 00 00 st %g1, [ %o0 ] 200ecd4: 81 c7 e0 08 ret 200ecd8: 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 ) { 200ecdc: 02 80 00 10 be 200ed1c <_POSIX_Semaphore_Create_support+0xa4> 200ece0: 90 10 00 18 mov %i0, %o0 name = _Workspace_String_duplicate( name_arg, name_len ); 200ece4: 40 00 04 45 call 200fdf8 <_Workspace_String_duplicate> 200ece8: 92 10 00 19 mov %i1, %o1 if ( !name ) { 200ecec: b4 92 20 00 orcc %o0, 0, %i2 200ecf0: 12 80 00 0d bne 200ed24 <_POSIX_Semaphore_Create_support+0xac><== ALWAYS TAKEN 200ecf4: 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 ); 200ecf8: 90 14 23 64 or %l0, 0x364, %o0 <== NOT EXECUTED 200ecfc: 7f ff ef a3 call 200ab88 <_Objects_Free> <== NOT EXECUTED 200ed00: 92 10 00 1d mov %i5, %o1 <== NOT EXECUTED _POSIX_Semaphore_Free( the_semaphore ); _Thread_Enable_dispatch(); 200ed04: 7f ff f3 f9 call 200bce8 <_Thread_Enable_dispatch> <== NOT EXECUTED 200ed08: 01 00 00 00 nop <== NOT EXECUTED rtems_set_errno_and_return_minus_one( ENOMEM ); 200ed0c: 40 00 0a 21 call 2011590 <__errno> <== NOT EXECUTED 200ed10: 01 00 00 00 nop <== NOT EXECUTED 200ed14: 10 bf ff ef b 200ecd0 <_POSIX_Semaphore_Create_support+0x58><== NOT EXECUTED 200ed18: 82 10 20 0c mov 0xc, %g1 ! c <== NOT EXECUTED } } else { name = NULL; 200ed1c: b4 10 20 00 clr %i2 } the_semaphore->process_shared = pshared; if ( name ) { 200ed20: 80 a6 a0 00 cmp %i2, 0 200ed24: 02 80 00 08 be 200ed44 <_POSIX_Semaphore_Create_support+0xcc> 200ed28: c0 27 60 10 clr [ %i5 + 0x10 ] the_semaphore->named = true; 200ed2c: 82 10 20 01 mov 1, %g1 200ed30: c2 2f 60 14 stb %g1, [ %i5 + 0x14 ] the_semaphore->open_count = 1; 200ed34: 82 10 20 01 mov 1, %g1 200ed38: c2 27 60 18 st %g1, [ %i5 + 0x18 ] the_semaphore->linked = true; 200ed3c: 10 80 00 05 b 200ed50 <_POSIX_Semaphore_Create_support+0xd8> 200ed40: c2 2f 60 15 stb %g1, [ %i5 + 0x15 ] } else { the_semaphore->named = false; 200ed44: c0 2f 60 14 clrb [ %i5 + 0x14 ] the_semaphore->open_count = 0; 200ed48: c0 27 60 18 clr [ %i5 + 0x18 ] the_semaphore->linked = false; 200ed4c: 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; 200ed50: 82 10 3f ff mov -1, %g1 _CORE_semaphore_Initialize( &the_semaphore->Semaphore, the_sem_attr, value ); 200ed54: 90 07 60 1c add %i5, 0x1c, %o0 the_sem_attr->discipline = CORE_SEMAPHORE_DISCIPLINES_FIFO; /* * This effectively disables limit checking. */ the_sem_attr->maximum_count = 0xFFFFFFFF; 200ed58: c2 27 60 5c st %g1, [ %i5 + 0x5c ] _CORE_semaphore_Initialize( &the_semaphore->Semaphore, the_sem_attr, value ); 200ed5c: 92 07 60 5c add %i5, 0x5c, %o1 200ed60: 94 10 00 1b mov %i3, %o2 200ed64: 7f ff ed 1f call 200a1e0 <_CORE_semaphore_Initialize> 200ed68: c0 27 60 60 clr [ %i5 + 0x60 ] Objects_Information *information, Objects_Control *the_object, const char *name ) { _Objects_Set_local_object( 200ed6c: c2 17 60 0a lduh [ %i5 + 0xa ], %g1 #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 200ed70: 05 00 80 88 sethi %hi(0x2022000), %g2 200ed74: c4 00 a3 80 ld [ %g2 + 0x380 ], %g2 ! 2022380 <_POSIX_Semaphore_Information+0x1c> 200ed78: 83 28 60 02 sll %g1, 2, %g1 200ed7c: fa 20 80 01 st %i5, [ %g2 + %g1 ] the_object ); #if defined(RTEMS_SCORE_OBJECT_ENABLE_STRING_NAMES) /* ASSERT: information->is_string */ the_object->name.name_p = name; 200ed80: f4 27 60 0c st %i2, [ %i5 + 0xc ] &_POSIX_Semaphore_Information, &the_semaphore->Object, name ); *the_sem = the_semaphore; 200ed84: fa 27 00 00 st %i5, [ %i4 ] _Thread_Enable_dispatch(); 200ed88: 7f ff f3 d8 call 200bce8 <_Thread_Enable_dispatch> 200ed8c: b0 10 20 00 clr %i0 return 0; } 200ed90: 81 c7 e0 08 ret 200ed94: 81 e8 00 00 restore =============================================================================== 0200c75c <_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 ]; 200c75c: c2 02 21 5c ld [ %o0 + 0x15c ], %g1 if ( thread_support->cancelability_state == PTHREAD_CANCEL_ENABLE && 200c760: c4 00 60 d8 ld [ %g1 + 0xd8 ], %g2 200c764: 80 a0 a0 00 cmp %g2, 0 200c768: 12 80 00 12 bne 200c7b0 <_POSIX_Thread_Evaluate_cancellation_and_enable_dispatch+0x54><== NEVER TAKEN 200c76c: 01 00 00 00 nop 200c770: c4 00 60 dc ld [ %g1 + 0xdc ], %g2 200c774: 80 a0 a0 01 cmp %g2, 1 200c778: 12 80 00 0e bne 200c7b0 <_POSIX_Thread_Evaluate_cancellation_and_enable_dispatch+0x54> 200c77c: 01 00 00 00 nop thread_support->cancelability_type == PTHREAD_CANCEL_ASYNCHRONOUS && 200c780: c2 00 60 e0 ld [ %g1 + 0xe0 ], %g1 200c784: 80 a0 60 00 cmp %g1, 0 200c788: 02 80 00 0a be 200c7b0 <_POSIX_Thread_Evaluate_cancellation_and_enable_dispatch+0x54> 200c78c: 01 00 00 00 nop * * This routine decrements the thread dispatch level. */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_decrement_disable_level(void) { uint32_t level = _Thread_Dispatch_disable_level; 200c790: 03 00 80 76 sethi %hi(0x201d800), %g1 200c794: c4 00 62 30 ld [ %g1 + 0x230 ], %g2 ! 201da30 <_Thread_Dispatch_disable_level> thread_support->cancelation_requested ) { _Thread_Unnest_dispatch(); _POSIX_Thread_Exit( the_thread, PTHREAD_CANCELED ); 200c798: 92 10 3f ff mov -1, %o1 --level; 200c79c: 84 00 bf ff add %g2, -1, %g2 _Thread_Dispatch_disable_level = level; 200c7a0: c4 20 62 30 st %g2, [ %g1 + 0x230 ] 200c7a4: 82 13 c0 00 mov %o7, %g1 200c7a8: 40 00 01 b5 call 200ce7c <_POSIX_Thread_Exit> 200c7ac: 9e 10 40 00 mov %g1, %o7 } else _Thread_Enable_dispatch(); 200c7b0: 82 13 c0 00 mov %o7, %g1 200c7b4: 7f ff f6 54 call 200a104 <_Thread_Enable_dispatch> 200c7b8: 9e 10 40 00 mov %g1, %o7 =============================================================================== 0200db0c <_POSIX_Thread_Translate_sched_param>: int policy, struct sched_param *param, Thread_CPU_budget_algorithms *budget_algorithm, Thread_CPU_budget_algorithm_callout *budget_callout ) { 200db0c: 9d e3 bf a0 save %sp, -96, %sp if ( !_POSIX_Priority_Is_valid( param->sched_priority ) ) 200db10: 7f ff ff f4 call 200dae0 <_POSIX_Priority_Is_valid> 200db14: d0 06 40 00 ld [ %i1 ], %o0 200db18: 80 8a 20 ff btst 0xff, %o0 200db1c: 32 80 00 04 bne,a 200db2c <_POSIX_Thread_Translate_sched_param+0x20><== ALWAYS TAKEN 200db20: c0 26 80 00 clr [ %i2 ] return EINVAL; 200db24: 81 c7 e0 08 ret 200db28: 91 e8 20 16 restore %g0, 0x16, %o0 *budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_NONE; *budget_callout = NULL; if ( policy == SCHED_OTHER ) { 200db2c: 80 a6 20 00 cmp %i0, 0 200db30: 12 80 00 06 bne 200db48 <_POSIX_Thread_Translate_sched_param+0x3c> 200db34: c0 26 c0 00 clr [ %i3 ] *budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE; 200db38: 82 10 20 01 mov 1, %g1 200db3c: c2 26 80 00 st %g1, [ %i2 ] return 0; 200db40: 81 c7 e0 08 ret 200db44: 81 e8 00 00 restore } if ( policy == SCHED_FIFO ) { 200db48: 80 a6 20 01 cmp %i0, 1 200db4c: 02 80 00 29 be 200dbf0 <_POSIX_Thread_Translate_sched_param+0xe4> 200db50: 80 a6 20 02 cmp %i0, 2 *budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_NONE; return 0; } if ( policy == SCHED_RR ) { 200db54: 12 80 00 04 bne 200db64 <_POSIX_Thread_Translate_sched_param+0x58> 200db58: 80 a6 20 04 cmp %i0, 4 *budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_EXHAUST_TIMESLICE; 200db5c: 10 80 00 25 b 200dbf0 <_POSIX_Thread_Translate_sched_param+0xe4> 200db60: f0 26 80 00 st %i0, [ %i2 ] return 0; } if ( policy == SCHED_SPORADIC ) { 200db64: 12 bf ff f0 bne 200db24 <_POSIX_Thread_Translate_sched_param+0x18> 200db68: 01 00 00 00 nop if ( (param->sched_ss_repl_period.tv_sec == 0) && 200db6c: c2 06 60 08 ld [ %i1 + 8 ], %g1 200db70: 80 a0 60 00 cmp %g1, 0 200db74: 32 80 00 07 bne,a 200db90 <_POSIX_Thread_Translate_sched_param+0x84> 200db78: c2 06 60 10 ld [ %i1 + 0x10 ], %g1 200db7c: c2 06 60 0c ld [ %i1 + 0xc ], %g1 200db80: 80 a0 60 00 cmp %g1, 0 200db84: 02 bf ff e8 be 200db24 <_POSIX_Thread_Translate_sched_param+0x18> 200db88: 01 00 00 00 nop (param->sched_ss_repl_period.tv_nsec == 0) ) return EINVAL; if ( (param->sched_ss_init_budget.tv_sec == 0) && 200db8c: c2 06 60 10 ld [ %i1 + 0x10 ], %g1 200db90: 80 a0 60 00 cmp %g1, 0 200db94: 12 80 00 06 bne 200dbac <_POSIX_Thread_Translate_sched_param+0xa0> 200db98: 01 00 00 00 nop 200db9c: c2 06 60 14 ld [ %i1 + 0x14 ], %g1 200dba0: 80 a0 60 00 cmp %g1, 0 200dba4: 02 bf ff e0 be 200db24 <_POSIX_Thread_Translate_sched_param+0x18> 200dba8: 01 00 00 00 nop (param->sched_ss_init_budget.tv_nsec == 0) ) return EINVAL; if ( _Timespec_To_ticks( ¶m->sched_ss_repl_period ) < 200dbac: 7f ff f7 6b call 200b958 <_Timespec_To_ticks> 200dbb0: 90 06 60 08 add %i1, 8, %o0 200dbb4: ba 10 00 08 mov %o0, %i5 _Timespec_To_ticks( ¶m->sched_ss_init_budget ) ) 200dbb8: 7f ff f7 68 call 200b958 <_Timespec_To_ticks> 200dbbc: 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 ) < 200dbc0: 80 a7 40 08 cmp %i5, %o0 200dbc4: 0a bf ff d8 bcs 200db24 <_POSIX_Thread_Translate_sched_param+0x18> 200dbc8: 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 ) ) 200dbcc: 7f ff ff c5 call 200dae0 <_POSIX_Priority_Is_valid> 200dbd0: d0 06 60 04 ld [ %i1 + 4 ], %o0 200dbd4: 80 8a 20 ff btst 0xff, %o0 200dbd8: 02 bf ff d3 be 200db24 <_POSIX_Thread_Translate_sched_param+0x18> 200dbdc: 82 10 20 03 mov 3, %g1 return EINVAL; *budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_CALLOUT; 200dbe0: c2 26 80 00 st %g1, [ %i2 ] *budget_callout = _POSIX_Threads_Sporadic_budget_callout; 200dbe4: 03 00 80 1e sethi %hi(0x2007800), %g1 200dbe8: 82 10 63 f4 or %g1, 0x3f4, %g1 ! 2007bf4 <_POSIX_Threads_Sporadic_budget_callout> 200dbec: c2 26 c0 00 st %g1, [ %i3 ] return 0; } return EINVAL; } 200dbf0: 81 c7 e0 08 ret 200dbf4: 91 e8 20 00 restore %g0, 0, %o0 =============================================================================== 0200cac8 <_POSIX_Threads_Delete_extension>: */ static void _POSIX_Threads_Delete_extension( Thread_Control *executing __attribute__((unused)), Thread_Control *deleted ) { 200cac8: 9d e3 bf a0 save %sp, -96, %sp Thread_Control *the_thread; POSIX_API_Control *api; void **value_ptr; api = deleted->API_Extensions[ THREAD_API_POSIX ]; 200cacc: f0 06 61 5c ld [ %i1 + 0x15c ], %i0 /* * Run the POSIX cancellation handlers */ _POSIX_Threads_cancel_run( deleted ); 200cad0: 40 00 08 d4 call 200ee20 <_POSIX_Threads_cancel_run> 200cad4: 90 10 00 19 mov %i1, %o0 /* * Run all the key destructors */ _POSIX_Keys_Run_destructors( deleted ); 200cad8: 90 10 00 19 mov %i1, %o0 200cadc: 40 00 08 eb call 200ee88 <_POSIX_Keys_Run_destructors> 200cae0: ba 06 20 44 add %i0, 0x44, %i5 /* * Wakeup all the tasks which joined with this one */ value_ptr = (void **) deleted->Wait.return_argument; while ( (the_thread = _Thread_queue_Dequeue( &api->Join_List )) ) 200cae4: 10 80 00 03 b 200caf0 <_POSIX_Threads_Delete_extension+0x28> 200cae8: f8 06 60 28 ld [ %i1 + 0x28 ], %i4 *(void **)the_thread->Wait.return_argument = value_ptr; 200caec: f8 20 40 00 st %i4, [ %g1 ] <== NOT EXECUTED /* * Wakeup all the tasks which joined with this one */ value_ptr = (void **) deleted->Wait.return_argument; while ( (the_thread = _Thread_queue_Dequeue( &api->Join_List )) ) 200caf0: 7f ff f6 3f call 200a3ec <_Thread_queue_Dequeue> 200caf4: 90 10 00 1d mov %i5, %o0 200caf8: 80 a2 20 00 cmp %o0, 0 200cafc: 32 bf ff fc bne,a 200caec <_POSIX_Threads_Delete_extension+0x24><== NEVER TAKEN 200cb00: c2 02 20 28 ld [ %o0 + 0x28 ], %g1 <== NOT EXECUTED *(void **)the_thread->Wait.return_argument = value_ptr; if ( api->schedpolicy == SCHED_SPORADIC ) 200cb04: c2 06 20 84 ld [ %i0 + 0x84 ], %g1 200cb08: 80 a0 60 04 cmp %g1, 4 200cb0c: 32 80 00 05 bne,a 200cb20 <_POSIX_Threads_Delete_extension+0x58> 200cb10: c0 26 61 5c clr [ %i1 + 0x15c ] (void) _Watchdog_Remove( &api->Sporadic_timer ); 200cb14: 7f ff f8 cc call 200ae44 <_Watchdog_Remove> 200cb18: 90 06 20 a8 add %i0, 0xa8, %o0 deleted->API_Extensions[ THREAD_API_POSIX ] = NULL; 200cb1c: c0 26 61 5c clr [ %i1 + 0x15c ] _Workspace_Free( api ); 200cb20: 7f ff f9 6a call 200b0c8 <_Workspace_Free> 200cb24: 81 e8 00 00 restore =============================================================================== 02007950 <_POSIX_Threads_Initialize_user_threads_body>: #include #include #include void _POSIX_Threads_Initialize_user_threads_body(void) { 2007950: 9d e3 bf 58 save %sp, -168, %sp uint32_t maximum; posix_initialization_threads_table *user_threads; pthread_t thread_id; pthread_attr_t attr; user_threads = Configuration_POSIX_API.User_initialization_threads_table; 2007954: 03 00 80 85 sethi %hi(0x2021400), %g1 2007958: 82 10 63 74 or %g1, 0x374, %g1 ! 2021774 maximum = Configuration_POSIX_API.number_of_initialization_threads; 200795c: f6 00 60 30 ld [ %g1 + 0x30 ], %i3 if ( !user_threads || maximum == 0 ) 2007960: 80 a6 e0 00 cmp %i3, 0 2007964: 02 80 00 1d be 20079d8 <_POSIX_Threads_Initialize_user_threads_body+0x88><== NEVER TAKEN 2007968: fa 00 60 34 ld [ %g1 + 0x34 ], %i5 200796c: 80 a7 60 00 cmp %i5, 0 2007970: 02 80 00 1a be 20079d8 <_POSIX_Threads_Initialize_user_threads_body+0x88><== NEVER TAKEN 2007974: b8 10 20 00 clr %i4 for ( index=0 ; index < maximum ; index++ ) { /* * There is no way for these calls to fail in this situation. */ (void) pthread_attr_init( &attr ); 2007978: 40 00 18 a0 call 200dbf8 200797c: 90 07 bf c0 add %fp, -64, %o0 (void) pthread_attr_setinheritsched( &attr, PTHREAD_EXPLICIT_SCHED ); 2007980: 92 10 20 02 mov 2, %o1 2007984: 40 00 18 a9 call 200dc28 2007988: 90 07 bf c0 add %fp, -64, %o0 (void) pthread_attr_setstacksize(&attr, user_threads[ index ].stack_size); 200798c: d2 07 60 04 ld [ %i5 + 4 ], %o1 2007990: 40 00 18 b5 call 200dc64 2007994: 90 07 bf c0 add %fp, -64, %o0 status = pthread_create( 2007998: d4 07 40 00 ld [ %i5 ], %o2 200799c: 90 07 bf bc add %fp, -68, %o0 20079a0: 92 07 bf c0 add %fp, -64, %o1 20079a4: 96 10 20 00 clr %o3 20079a8: 7f ff ff 18 call 2007608 20079ac: ba 07 60 08 add %i5, 8, %i5 &thread_id, &attr, user_threads[ index ].thread_entry, NULL ); if ( status ) 20079b0: 80 a2 20 00 cmp %o0, 0 20079b4: 02 80 00 05 be 20079c8 <_POSIX_Threads_Initialize_user_threads_body+0x78> 20079b8: 94 10 00 08 mov %o0, %o2 _Internal_error_Occurred( INTERNAL_ERROR_POSIX_API, true, status ); 20079bc: 90 10 20 02 mov 2, %o0 20079c0: 40 00 08 0a call 20099e8 <_Internal_error_Occurred> 20079c4: 92 10 20 01 mov 1, %o1 * * Setting the attributes explicitly is critical, since we don't want * to inherit the idle tasks attributes. */ for ( index=0 ; index < maximum ; index++ ) { 20079c8: b8 07 20 01 inc %i4 20079cc: 80 a7 00 1b cmp %i4, %i3 20079d0: 12 bf ff ea bne 2007978 <_POSIX_Threads_Initialize_user_threads_body+0x28><== NEVER TAKEN 20079d4: 01 00 00 00 nop 20079d8: 81 c7 e0 08 ret 20079dc: 81 e8 00 00 restore =============================================================================== 0200cc1c <_POSIX_Threads_Sporadic_budget_TSR>: */ void _POSIX_Threads_Sporadic_budget_TSR( Objects_Id id __attribute__((unused)), void *argument ) { 200cc1c: 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 ]; 200cc20: fa 06 61 5c ld [ %i1 + 0x15c ], %i5 /* ticks is guaranteed to be at least one */ ticks = _Timespec_To_ticks( &api->schedparam.sched_ss_init_budget ); 200cc24: 40 00 03 fd call 200dc18 <_Timespec_To_ticks> 200cc28: 90 07 60 98 add %i5, 0x98, %o0 RTEMS_INLINE_ROUTINE Priority_Control _POSIX_Priority_To_core( int priority ) { return (Priority_Control) (POSIX_SCHEDULER_MAXIMUM_PRIORITY - priority + 1); 200cc2c: 03 00 80 72 sethi %hi(0x201c800), %g1 200cc30: d2 08 61 2c ldub [ %g1 + 0x12c ], %o1 ! 201c92c 200cc34: c2 07 60 88 ld [ %i5 + 0x88 ], %g1 the_thread->cpu_time_budget = ticks; 200cc38: d0 26 60 74 st %o0, [ %i1 + 0x74 ] 200cc3c: 92 22 40 01 sub %o1, %g1, %o1 */ #if 0 printk( "TSR %d %d %d\n", the_thread->resource_count, the_thread->current_priority, new_priority ); #endif if ( the_thread->resource_count == 0 ) { 200cc40: c2 06 60 1c ld [ %i1 + 0x1c ], %g1 200cc44: 80 a0 60 00 cmp %g1, 0 200cc48: 12 80 00 09 bne 200cc6c <_POSIX_Threads_Sporadic_budget_TSR+0x50><== NEVER TAKEN 200cc4c: 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 ) { 200cc50: c2 06 60 14 ld [ %i1 + 0x14 ], %g1 200cc54: 80 a0 40 09 cmp %g1, %o1 200cc58: 08 80 00 06 bleu 200cc70 <_POSIX_Threads_Sporadic_budget_TSR+0x54> 200cc5c: 90 07 60 90 add %i5, 0x90, %o0 _Thread_Change_priority( the_thread, new_priority, true ); 200cc60: 90 10 00 19 mov %i1, %o0 200cc64: 7f ff f3 c9 call 2009b88 <_Thread_Change_priority> 200cc68: 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 ); 200cc6c: 90 07 60 90 add %i5, 0x90, %o0 200cc70: 40 00 03 ea call 200dc18 <_Timespec_To_ticks> 200cc74: 31 00 80 75 sethi %hi(0x201d400), %i0 ) { the_watchdog->initial = units; _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 200cc78: b0 16 22 6c or %i0, 0x26c, %i0 ! 201d66c <_Watchdog_Ticks_chain> Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 200cc7c: d0 27 60 b4 st %o0, [ %i5 + 0xb4 ] _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 200cc80: 7f ff f8 19 call 200ace4 <_Watchdog_Insert> 200cc84: 93 ef 60 a8 restore %i5, 0xa8, %o1 =============================================================================== 0200cc88 <_POSIX_Threads_Sporadic_budget_callout>: ) { POSIX_API_Control *api; uint32_t new_priority; api = the_thread->API_Extensions[ THREAD_API_POSIX ]; 200cc88: c4 02 21 5c ld [ %o0 + 0x15c ], %g2 /* * This will prevent the thread from consuming its entire "budget" * while at low priority. */ the_thread->cpu_time_budget = 0xFFFFFFFF; /* XXX should be based on MAX_U32 */ 200cc8c: 86 10 3f ff mov -1, %g3 200cc90: c4 00 a0 8c ld [ %g2 + 0x8c ], %g2 200cc94: c6 22 20 74 st %g3, [ %o0 + 0x74 ] 200cc98: 07 00 80 72 sethi %hi(0x201c800), %g3 200cc9c: d2 08 e1 2c ldub [ %g3 + 0x12c ], %o1 ! 201c92c 200cca0: 92 22 40 02 sub %o1, %g2, %o1 */ #if 0 printk( "callout %d %d %d\n", the_thread->resource_count, the_thread->current_priority, new_priority ); #endif if ( the_thread->resource_count == 0 ) { 200cca4: c4 02 20 1c ld [ %o0 + 0x1c ], %g2 200cca8: 80 a0 a0 00 cmp %g2, 0 200ccac: 12 80 00 09 bne 200ccd0 <_POSIX_Threads_Sporadic_budget_callout+0x48><== NEVER TAKEN 200ccb0: 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 ) { 200ccb4: c2 02 20 14 ld [ %o0 + 0x14 ], %g1 200ccb8: 80 a0 40 09 cmp %g1, %o1 200ccbc: 1a 80 00 05 bcc 200ccd0 <_POSIX_Threads_Sporadic_budget_callout+0x48><== NEVER TAKEN 200ccc0: 94 10 20 01 mov 1, %o2 _Thread_Change_priority( the_thread, new_priority, true ); 200ccc4: 82 13 c0 00 mov %o7, %g1 200ccc8: 7f ff f3 b0 call 2009b88 <_Thread_Change_priority> 200cccc: 9e 10 40 00 mov %g1, %o7 200ccd0: 81 c3 e0 08 retl <== NOT EXECUTED =============================================================================== 02007408 <_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) { 2007408: 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; 200740c: c2 06 60 68 ld [ %i1 + 0x68 ], %g1 2007410: 82 00 60 01 inc %g1 2007414: c2 26 60 68 st %g1, [ %i1 + 0x68 ] /* The timer must be reprogrammed */ if ( ( ptimer->timer_data.it_interval.tv_sec != 0 ) || 2007418: c2 06 60 54 ld [ %i1 + 0x54 ], %g1 200741c: 80 a0 60 00 cmp %g1, 0 2007420: 32 80 00 07 bne,a 200743c <_POSIX_Timer_TSR+0x34> 2007424: d2 06 60 64 ld [ %i1 + 0x64 ], %o1 2007428: c2 06 60 58 ld [ %i1 + 0x58 ], %g1 200742c: 80 a0 60 00 cmp %g1, 0 2007430: 02 80 00 1f be 20074ac <_POSIX_Timer_TSR+0xa4> <== NEVER TAKEN 2007434: 82 10 20 04 mov 4, %g1 ( ptimer->timer_data.it_interval.tv_nsec != 0 ) ) { activated = _POSIX_Timer_Insert_helper( 2007438: d2 06 60 64 ld [ %i1 + 0x64 ], %o1 200743c: d4 06 60 08 ld [ %i1 + 8 ], %o2 2007440: 90 06 60 10 add %i1, 0x10, %o0 2007444: 17 00 80 1d sethi %hi(0x2007400), %o3 2007448: 98 10 00 19 mov %i1, %o4 200744c: 40 00 18 3b call 200d538 <_POSIX_Timer_Insert_helper> 2007450: 96 12 e0 08 or %o3, 8, %o3 ptimer->ticks, ptimer->Object.id, _POSIX_Timer_TSR, ptimer ); if ( !activated ) 2007454: 80 8a 20 ff btst 0xff, %o0 2007458: 02 80 00 1a be 20074c0 <_POSIX_Timer_TSR+0xb8> <== NEVER TAKEN 200745c: 90 07 bf f8 add %fp, -8, %o0 2007460: 13 00 80 77 sethi %hi(0x201dc00), %o1 2007464: 40 00 05 ed call 2008c18 <_TOD_Get_with_nanoseconds> 2007468: 92 12 63 68 or %o1, 0x368, %o1 ! 201df68 <_TOD> /* After the signal handler returns, the count of expirations of the * timer must be set to 0. */ ptimer->overrun = 0; } 200746c: 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); 2007470: 94 10 20 00 clr %o2 2007474: 90 10 00 1c mov %i4, %o0 2007478: 92 10 00 1d mov %i5, %o1 200747c: 17 0e e6 b2 sethi %hi(0x3b9ac800), %o3 2007480: 40 00 48 66 call 2019618 <__divdi3> 2007484: 96 12 e2 00 or %o3, 0x200, %o3 ! 3b9aca00 _timespec->tv_nsec = (long) (*_timestamp % 1000000000L); 2007488: 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); 200748c: d2 26 60 6c st %o1, [ %i1 + 0x6c ] _timespec->tv_nsec = (long) (*_timestamp % 1000000000L); 2007490: 94 10 20 00 clr %o2 2007494: 92 10 00 1d mov %i5, %o1 2007498: 17 0e e6 b2 sethi %hi(0x3b9ac800), %o3 200749c: 40 00 49 4a call 20199c4 <__moddi3> 20074a0: 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; 20074a4: 82 10 20 03 mov 3, %g1 20074a8: 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 ) ) { 20074ac: d0 06 60 38 ld [ %i1 + 0x38 ], %o0 20074b0: d2 06 60 44 ld [ %i1 + 0x44 ], %o1 20074b4: 40 00 17 10 call 200d0f4 20074b8: 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; 20074bc: c0 26 60 68 clr [ %i1 + 0x68 ] 20074c0: 81 c7 e0 08 ret 20074c4: 81 e8 00 00 restore =============================================================================== 0200ef44 <_POSIX_signals_Check_signal>: bool _POSIX_signals_Check_signal( POSIX_API_Control *api, int signo, bool is_global ) { 200ef44: 9d e3 bf 68 save %sp, -152, %sp siginfo_t siginfo_struct; sigset_t saved_signals_blocked; Thread_Wait_information stored_thread_wait_information; if ( ! _POSIX_signals_Clear_signals( api, signo, &siginfo_struct, 200ef48: 98 10 20 01 mov 1, %o4 200ef4c: 90 10 00 18 mov %i0, %o0 200ef50: 92 10 00 19 mov %i1, %o1 200ef54: 94 07 bf cc add %fp, -52, %o2 200ef58: 40 00 00 2e call 200f010 <_POSIX_signals_Clear_signals> 200ef5c: 96 10 00 1a mov %i2, %o3 200ef60: 80 8a 20 ff btst 0xff, %o0 200ef64: 02 80 00 28 be 200f004 <_POSIX_signals_Check_signal+0xc0> 200ef68: 82 10 20 00 clr %g1 #endif /* * Just to prevent sending a signal which is currently being ignored. */ if ( _POSIX_signals_Vectors[ signo ].sa_handler == SIG_IGN ) 200ef6c: 85 2e 60 02 sll %i1, 2, %g2 200ef70: 35 00 80 76 sethi %hi(0x201d800), %i2 200ef74: b7 2e 60 04 sll %i1, 4, %i3 200ef78: b4 16 a3 50 or %i2, 0x350, %i2 200ef7c: b6 26 c0 02 sub %i3, %g2, %i3 200ef80: 84 06 80 1b add %i2, %i3, %g2 200ef84: fa 00 a0 08 ld [ %g2 + 8 ], %i5 200ef88: 80 a7 60 01 cmp %i5, 1 200ef8c: 02 80 00 1e be 200f004 <_POSIX_signals_Check_signal+0xc0> <== NEVER TAKEN 200ef90: 90 07 bf d8 add %fp, -40, %o0 return false; /* * Block the signals requested in sa_mask */ saved_signals_blocked = api->signals_blocked; 200ef94: f8 06 20 d0 ld [ %i0 + 0xd0 ], %i4 api->signals_blocked |= _POSIX_signals_Vectors[ signo ].sa_mask; 200ef98: c2 00 a0 04 ld [ %g2 + 4 ], %g1 200ef9c: 82 10 40 1c or %g1, %i4, %g1 200efa0: c2 26 20 d0 st %g1, [ %i0 + 0xd0 ] /* * We have to save the blocking information of the current wait queue * because the signal handler may subsequently go on and put the thread * on a wait queue, for its own purposes. */ memcpy( &stored_thread_wait_information, &_Thread_Executing->Wait, 200efa4: 03 00 80 76 sethi %hi(0x201d800), %g1 200efa8: d2 00 63 00 ld [ %g1 + 0x300 ], %o1 ! 201db00 <_Per_CPU_Information+0x10> 200efac: 94 10 20 28 mov 0x28, %o2 200efb0: 40 00 04 00 call 200ffb0 200efb4: 92 02 60 20 add %o1, 0x20, %o1 sizeof( Thread_Wait_information )); /* * Here, the signal handler function executes */ switch ( _POSIX_signals_Vectors[ signo ].sa_flags ) { 200efb8: c2 06 80 1b ld [ %i2 + %i3 ], %g1 200efbc: 80 a0 60 02 cmp %g1, 2 200efc0: 12 80 00 07 bne 200efdc <_POSIX_signals_Check_signal+0x98> 200efc4: 90 10 00 19 mov %i1, %o0 case SA_SIGINFO: (*_POSIX_signals_Vectors[ signo ].sa_sigaction)( 200efc8: 92 07 bf cc add %fp, -52, %o1 200efcc: 9f c7 40 00 call %i5 200efd0: 94 10 20 00 clr %o2 signo, &siginfo_struct, NULL /* context is undefined per 1003.1b-1993, p. 66 */ ); break; 200efd4: 10 80 00 05 b 200efe8 <_POSIX_signals_Check_signal+0xa4> 200efd8: 03 00 80 76 sethi %hi(0x201d800), %g1 default: (*_POSIX_signals_Vectors[ signo ].sa_handler)( signo ); 200efdc: 9f c7 40 00 call %i5 200efe0: 01 00 00 00 nop } /* * Restore the blocking information */ memcpy( &_Thread_Executing->Wait, &stored_thread_wait_information, 200efe4: 03 00 80 76 sethi %hi(0x201d800), %g1 200efe8: d0 00 63 00 ld [ %g1 + 0x300 ], %o0 ! 201db00 <_Per_CPU_Information+0x10> 200efec: 92 07 bf d8 add %fp, -40, %o1 200eff0: 90 02 20 20 add %o0, 0x20, %o0 200eff4: 40 00 03 ef call 200ffb0 200eff8: 94 10 20 28 mov 0x28, %o2 /* * Restore the previous set of blocked signals */ api->signals_blocked = saved_signals_blocked; return true; 200effc: 82 10 20 01 mov 1, %g1 sizeof( Thread_Wait_information )); /* * Restore the previous set of blocked signals */ api->signals_blocked = saved_signals_blocked; 200f000: f8 26 20 d0 st %i4, [ %i0 + 0xd0 ] return true; } 200f004: b0 08 60 01 and %g1, 1, %i0 200f008: 81 c7 e0 08 ret 200f00c: 81 e8 00 00 restore =============================================================================== 0200f5c8 <_POSIX_signals_Clear_process_signals>: */ void _POSIX_signals_Clear_process_signals( int signo ) { 200f5c8: 9d e3 bf a0 save %sp, -96, %sp 200f5cc: 82 06 3f ff add %i0, -1, %g1 200f5d0: ba 10 20 01 mov 1, %i5 clear_signal = true; mask = signo_to_mask( signo ); ISR_Level level; _ISR_Disable( level ); 200f5d4: 7f ff cb fc call 20025c4 200f5d8: bb 2f 40 01 sll %i5, %g1, %i5 if ( _POSIX_signals_Vectors[ signo ].sa_flags == SA_SIGINFO ) { 200f5dc: 05 00 80 76 sethi %hi(0x201d800), %g2 200f5e0: 83 2e 20 02 sll %i0, 2, %g1 200f5e4: 84 10 a3 50 or %g2, 0x350, %g2 200f5e8: b1 2e 20 04 sll %i0, 4, %i0 200f5ec: 82 26 00 01 sub %i0, %g1, %g1 200f5f0: c4 00 80 01 ld [ %g2 + %g1 ], %g2 200f5f4: 80 a0 a0 02 cmp %g2, 2 200f5f8: 32 80 00 0c bne,a 200f628 <_POSIX_signals_Clear_process_signals+0x60> 200f5fc: 03 00 80 77 sethi %hi(0x201dc00), %g1 if ( !_Chain_Is_empty( &_POSIX_signals_Siginfo[ signo ] ) ) 200f600: 05 00 80 77 sethi %hi(0x201dc00), %g2 200f604: 84 10 a1 48 or %g2, 0x148, %g2 ! 201dd48 <_POSIX_signals_Siginfo> 200f608: 86 00 40 02 add %g1, %g2, %g3 200f60c: c2 00 40 02 ld [ %g1 + %g2 ], %g1 RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( const Chain_Control *the_chain ) { return _Chain_Immutable_first( the_chain ) == _Chain_Immutable_tail( the_chain ); 200f610: 86 00 e0 04 add %g3, 4, %g3 200f614: 80 a0 40 03 cmp %g1, %g3 200f618: 02 80 00 04 be 200f628 <_POSIX_signals_Clear_process_signals+0x60><== ALWAYS TAKEN 200f61c: 03 00 80 77 sethi %hi(0x201dc00), %g1 clear_signal = false; } if ( clear_signal ) { _POSIX_signals_Pending &= ~mask; } _ISR_Enable( level ); 200f620: 7f ff cb ed call 20025d4 200f624: 91 e8 00 08 restore %g0, %o0, %o0 if ( _POSIX_signals_Vectors[ signo ].sa_flags == SA_SIGINFO ) { if ( !_Chain_Is_empty( &_POSIX_signals_Siginfo[ signo ] ) ) clear_signal = false; } if ( clear_signal ) { _POSIX_signals_Pending &= ~mask; 200f628: c4 00 61 44 ld [ %g1 + 0x144 ], %g2 200f62c: ba 28 80 1d andn %g2, %i5, %i5 200f630: 10 bf ff fc b 200f620 <_POSIX_signals_Clear_process_signals+0x58> 200f634: fa 20 61 44 st %i5, [ %g1 + 0x144 ] =============================================================================== 02008200 <_POSIX_signals_Get_lowest>: sigset_t set ) { int signo; for ( signo = SIGRTMIN ; signo <= SIGRTMAX ; signo++ ) { 2008200: 82 10 20 1b mov 0x1b, %g1 2008204: 84 10 20 01 mov 1, %g2 #include #include #include #include static int _POSIX_signals_Get_lowest( 2008208: 86 00 7f ff add %g1, -1, %g3 200820c: 87 28 80 03 sll %g2, %g3, %g3 ) { int signo; for ( signo = SIGRTMIN ; signo <= SIGRTMAX ; signo++ ) { if ( set & signo_to_mask( signo ) ) { 2008210: 80 88 c0 08 btst %g3, %o0 2008214: 12 80 00 11 bne 2008258 <_POSIX_signals_Get_lowest+0x58> <== NEVER TAKEN 2008218: 01 00 00 00 nop sigset_t set ) { int signo; for ( signo = SIGRTMIN ; signo <= SIGRTMAX ; signo++ ) { 200821c: 82 00 60 01 inc %g1 2008220: 80 a0 60 20 cmp %g1, 0x20 2008224: 12 bf ff fa bne 200820c <_POSIX_signals_Get_lowest+0xc> 2008228: 86 00 7f ff add %g1, -1, %g3 200822c: 82 10 20 01 mov 1, %g1 2008230: 84 10 20 01 mov 1, %g2 #include #include #include #include static int _POSIX_signals_Get_lowest( 2008234: 86 00 7f ff add %g1, -1, %g3 2008238: 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 ) ) { 200823c: 80 88 c0 08 btst %g3, %o0 2008240: 12 80 00 06 bne 2008258 <_POSIX_signals_Get_lowest+0x58> 2008244: 01 00 00 00 nop */ #if (SIGHUP != 1) #error "Assumption that SIGHUP==1 violated!!" #endif for ( signo = SIGHUP ; signo <= __SIGLASTNOTRT ; signo++ ) { 2008248: 82 00 60 01 inc %g1 200824c: 80 a0 60 1b cmp %g1, 0x1b 2008250: 12 bf ff fa bne 2008238 <_POSIX_signals_Get_lowest+0x38> <== ALWAYS TAKEN 2008254: 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; } 2008258: 81 c3 e0 08 retl 200825c: 90 10 00 01 mov %g1, %o0 =============================================================================== 0200c854 <_POSIX_signals_Post_switch_hook>: */ static void _POSIX_signals_Post_switch_hook( Thread_Control *the_thread ) { 200c854: 9d e3 bf a0 save %sp, -96, %sp /* * We need to ensure that if the signal handler executes a call * which overwrites the unblocking status, we restore it. */ hold_errno = _Thread_Executing->Wait.return_code; 200c858: 03 00 80 76 sethi %hi(0x201d800), %g1 POSIX_API_Control *api; int signo; ISR_Level level; int hold_errno; api = the_thread->API_Extensions[ THREAD_API_POSIX ]; 200c85c: fa 06 21 5c ld [ %i0 + 0x15c ], %i5 /* * We need to ensure that if the signal handler executes a call * which overwrites the unblocking status, we restore it. */ hold_errno = _Thread_Executing->Wait.return_code; 200c860: c2 00 63 00 ld [ %g1 + 0x300 ], %g1 /* * api may be NULL in case of a thread close in progress */ if ( !api ) 200c864: 80 a7 60 00 cmp %i5, 0 200c868: 02 80 00 11 be 200c8ac <_POSIX_signals_Post_switch_hook+0x58><== NEVER TAKEN 200c86c: f6 00 60 34 ld [ %g1 + 0x34 ], %i3 * processed at all. No point in doing this loop otherwise. */ while (1) { _ISR_Disable( level ); if ( !(~api->signals_blocked & (api->signals_pending | _POSIX_signals_Pending)) ) { 200c870: 35 00 80 77 sethi %hi(0x201dc00), %i2 * * The first thing done is to check there are any signals to be * processed at all. No point in doing this loop otherwise. */ while (1) { _ISR_Disable( level ); 200c874: 7f ff d7 54 call 20025c4 200c878: 01 00 00 00 nop if ( !(~api->signals_blocked & (api->signals_pending | _POSIX_signals_Pending)) ) { 200c87c: c4 06 a1 44 ld [ %i2 + 0x144 ], %g2 200c880: c2 07 60 d4 ld [ %i5 + 0xd4 ], %g1 200c884: 82 10 80 01 or %g2, %g1, %g1 * The first thing done is to check there are any signals to be * processed at all. No point in doing this loop otherwise. */ while (1) { _ISR_Disable( level ); if ( !(~api->signals_blocked & 200c888: c4 07 60 d0 ld [ %i5 + 0xd0 ], %g2 200c88c: 80 a8 40 02 andncc %g1, %g2, %g0 200c890: 12 80 00 09 bne 200c8b4 <_POSIX_signals_Post_switch_hook+0x60> 200c894: 01 00 00 00 nop (api->signals_pending | _POSIX_signals_Pending)) ) { _ISR_Enable( level ); 200c898: 7f ff d7 4f call 20025d4 200c89c: 01 00 00 00 nop _POSIX_signals_Check_signal( api, signo, false ); _POSIX_signals_Check_signal( api, signo, true ); } } _Thread_Executing->Wait.return_code = hold_errno; 200c8a0: 03 00 80 76 sethi %hi(0x201d800), %g1 200c8a4: c2 00 63 00 ld [ %g1 + 0x300 ], %g1 ! 201db00 <_Per_CPU_Information+0x10> 200c8a8: f6 20 60 34 st %i3, [ %g1 + 0x34 ] 200c8ac: 81 c7 e0 08 ret 200c8b0: 81 e8 00 00 restore if ( !(~api->signals_blocked & (api->signals_pending | _POSIX_signals_Pending)) ) { _ISR_Enable( level ); break; } _ISR_Enable( level ); 200c8b4: 7f ff d7 48 call 20025d4 200c8b8: b8 10 20 1b mov 0x1b, %i4 for ( signo = SIGRTMIN ; signo <= SIGRTMAX ; signo++ ) { _POSIX_signals_Check_signal( api, signo, false ); 200c8bc: 92 10 00 1c mov %i4, %o1 200c8c0: 94 10 20 00 clr %o2 200c8c4: 40 00 09 a0 call 200ef44 <_POSIX_signals_Check_signal> 200c8c8: 90 10 00 1d mov %i5, %o0 _POSIX_signals_Check_signal( api, signo, true ); 200c8cc: 92 10 00 1c mov %i4, %o1 200c8d0: 90 10 00 1d mov %i5, %o0 200c8d4: 40 00 09 9c call 200ef44 <_POSIX_signals_Check_signal> 200c8d8: 94 10 20 01 mov 1, %o2 _ISR_Enable( level ); break; } _ISR_Enable( level ); for ( signo = SIGRTMIN ; signo <= SIGRTMAX ; signo++ ) { 200c8dc: b8 07 20 01 inc %i4 200c8e0: 80 a7 20 20 cmp %i4, 0x20 200c8e4: 12 bf ff f7 bne 200c8c0 <_POSIX_signals_Post_switch_hook+0x6c> 200c8e8: 92 10 00 1c mov %i4, %o1 200c8ec: 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 ); 200c8f0: 92 10 00 1c mov %i4, %o1 200c8f4: 94 10 20 00 clr %o2 200c8f8: 40 00 09 93 call 200ef44 <_POSIX_signals_Check_signal> 200c8fc: 90 10 00 1d mov %i5, %o0 _POSIX_signals_Check_signal( api, signo, true ); 200c900: 92 10 00 1c mov %i4, %o1 200c904: 90 10 00 1d mov %i5, %o0 200c908: 40 00 09 8f call 200ef44 <_POSIX_signals_Check_signal> 200c90c: 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++ ) { 200c910: b8 07 20 01 inc %i4 200c914: 80 a7 20 1b cmp %i4, 0x1b 200c918: 12 bf ff f7 bne 200c8f4 <_POSIX_signals_Post_switch_hook+0xa0> 200c91c: 92 10 00 1c mov %i4, %o1 200c920: 30 bf ff d5 b,a 200c874 <_POSIX_signals_Post_switch_hook+0x20> =============================================================================== 0201a2ac <_POSIX_signals_Unblock_thread>: bool _POSIX_signals_Unblock_thread( Thread_Control *the_thread, int signo, siginfo_t *info ) { 201a2ac: 9d e3 bf a0 save %sp, -96, %sp /* * Is the thread is specifically waiting for a signal? */ if ( _States_Is_interruptible_signal( the_thread->current_state ) ) { 201a2b0: c2 06 20 10 ld [ %i0 + 0x10 ], %g1 201a2b4: 3b 04 00 20 sethi %hi(0x10008000), %i5 201a2b8: 84 06 7f ff add %i1, -1, %g2 201a2bc: 86 10 20 01 mov 1, %g3 201a2c0: b8 08 40 1d and %g1, %i5, %i4 { POSIX_API_Control *api; sigset_t mask; siginfo_t *the_info = NULL; api = the_thread->API_Extensions[ THREAD_API_POSIX ]; 201a2c4: c8 06 21 5c ld [ %i0 + 0x15c ], %g4 /* * Is the thread is specifically waiting for a signal? */ if ( _States_Is_interruptible_signal( the_thread->current_state ) ) { 201a2c8: 80 a7 00 1d cmp %i4, %i5 201a2cc: 12 80 00 1e bne 201a344 <_POSIX_signals_Unblock_thread+0x98> 201a2d0: 85 28 c0 02 sll %g3, %g2, %g2 if ( (the_thread->Wait.option & mask) || (~api->signals_blocked & mask) ) { 201a2d4: c2 06 20 30 ld [ %i0 + 0x30 ], %g1 201a2d8: 80 88 80 01 btst %g2, %g1 201a2dc: 12 80 00 08 bne 201a2fc <_POSIX_signals_Unblock_thread+0x50> 201a2e0: 82 10 20 04 mov 4, %g1 201a2e4: c2 01 20 d0 ld [ %g4 + 0xd0 ], %g1 201a2e8: 80 a8 80 01 andncc %g2, %g1, %g0 201a2ec: 32 80 00 04 bne,a 201a2fc <_POSIX_signals_Unblock_thread+0x50> 201a2f0: 82 10 20 04 mov 4, %g1 } else if ( the_thread->current_state == STATES_READY ) { if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) ) _Thread_Dispatch_necessary = true; } } return false; 201a2f4: 10 80 00 3d b 201a3e8 <_POSIX_signals_Unblock_thread+0x13c> 201a2f8: b0 10 20 00 clr %i0 */ if ( _States_Is_interruptible_signal( the_thread->current_state ) ) { if ( (the_thread->Wait.option & mask) || (~api->signals_blocked & mask) ) { the_thread->Wait.return_code = EINTR; 201a2fc: c2 26 20 34 st %g1, [ %i0 + 0x34 ] the_info = (siginfo_t *) the_thread->Wait.return_argument; if ( !info ) { 201a300: 80 a6 a0 00 cmp %i2, 0 201a304: 12 80 00 07 bne 201a320 <_POSIX_signals_Unblock_thread+0x74> 201a308: d0 06 20 28 ld [ %i0 + 0x28 ], %o0 the_info->si_signo = signo; the_info->si_code = SI_USER; 201a30c: 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; 201a310: f2 22 00 00 st %i1, [ %o0 ] the_info->si_code = SI_USER; 201a314: c2 22 20 04 st %g1, [ %o0 + 4 ] the_info->si_value.sival_int = 0; 201a318: 10 80 00 05 b 201a32c <_POSIX_signals_Unblock_thread+0x80> 201a31c: c0 22 20 08 clr [ %o0 + 8 ] } else { *the_info = *info; 201a320: 92 10 00 1a mov %i2, %o1 201a324: 7f ff d7 23 call 200ffb0 201a328: 94 10 20 0c mov 0xc, %o2 } _Thread_queue_Extract_with_proxy( the_thread ); 201a32c: 90 10 00 18 mov %i0, %o0 201a330: 7f ff c1 1c call 200a7a0 <_Thread_queue_Extract_with_proxy> 201a334: b0 10 20 01 mov 1, %i0 201a338: b0 0e 20 01 and %i0, 1, %i0 201a33c: 81 c7 e0 08 ret 201a340: 81 e8 00 00 restore } /* * Thread is not waiting due to a sigwait. */ if ( ~api->signals_blocked & mask ) { 201a344: c8 01 20 d0 ld [ %g4 + 0xd0 ], %g4 201a348: 80 a8 80 04 andncc %g2, %g4, %g0 201a34c: 02 80 00 26 be 201a3e4 <_POSIX_signals_Unblock_thread+0x138> 201a350: 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 ) ) { 201a354: 80 88 40 02 btst %g1, %g2 201a358: 02 80 00 17 be 201a3b4 <_POSIX_signals_Unblock_thread+0x108> 201a35c: 80 a0 60 00 cmp %g1, 0 the_thread->Wait.return_code = EINTR; 201a360: 84 10 20 04 mov 4, %g2 201a364: 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) ) 201a368: 05 00 00 ef sethi %hi(0x3bc00), %g2 201a36c: 84 10 a2 e0 or %g2, 0x2e0, %g2 ! 3bee0 201a370: 80 88 40 02 btst %g1, %g2 201a374: 02 80 00 06 be 201a38c <_POSIX_signals_Unblock_thread+0xe0> 201a378: 80 88 60 08 btst 8, %g1 _Thread_queue_Extract_with_proxy( the_thread ); 201a37c: 7f ff c1 09 call 200a7a0 <_Thread_queue_Extract_with_proxy> 201a380: 90 10 00 18 mov %i0, %o0 } else if ( the_thread->current_state == STATES_READY ) { if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) ) _Thread_Dispatch_necessary = true; } } return false; 201a384: 10 80 00 19 b 201a3e8 <_POSIX_signals_Unblock_thread+0x13c> 201a388: 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) ) { 201a38c: 22 80 00 17 be,a 201a3e8 <_POSIX_signals_Unblock_thread+0x13c><== NEVER TAKEN 201a390: b0 10 20 00 clr %i0 <== NOT EXECUTED (void) _Watchdog_Remove( &the_thread->Timer ); 201a394: 7f ff c2 ac call 200ae44 <_Watchdog_Remove> 201a398: 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 ); 201a39c: 90 10 00 18 mov %i0, %o0 201a3a0: 13 04 01 ff sethi %hi(0x1007fc00), %o1 201a3a4: 7f ff be 3d call 2009c98 <_Thread_Clear_state> 201a3a8: 92 12 63 f8 or %o1, 0x3f8, %o1 ! 1007fff8 } else if ( the_thread->current_state == STATES_READY ) { if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) ) _Thread_Dispatch_necessary = true; } } return false; 201a3ac: 10 80 00 0f b 201a3e8 <_POSIX_signals_Unblock_thread+0x13c> 201a3b0: 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 ) { 201a3b4: 32 80 00 0d bne,a 201a3e8 <_POSIX_signals_Unblock_thread+0x13c><== NEVER TAKEN 201a3b8: b0 10 20 00 clr %i0 <== NOT EXECUTED if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) ) 201a3bc: 03 00 80 76 sethi %hi(0x201d800), %g1 201a3c0: 82 10 62 f0 or %g1, 0x2f0, %g1 ! 201daf0 <_Per_CPU_Information> 201a3c4: c4 00 60 08 ld [ %g1 + 8 ], %g2 201a3c8: 80 a0 a0 00 cmp %g2, 0 201a3cc: 22 80 00 07 be,a 201a3e8 <_POSIX_signals_Unblock_thread+0x13c> 201a3d0: b0 10 20 00 clr %i0 201a3d4: c4 00 60 10 ld [ %g1 + 0x10 ], %g2 201a3d8: 80 a6 00 02 cmp %i0, %g2 201a3dc: 22 80 00 02 be,a 201a3e4 <_POSIX_signals_Unblock_thread+0x138><== ALWAYS TAKEN 201a3e0: c6 28 60 0c stb %g3, [ %g1 + 0xc ] _Thread_Dispatch_necessary = true; } } return false; 201a3e4: b0 10 20 00 clr %i0 } 201a3e8: b0 0e 20 01 and %i0, 1, %i0 201a3ec: 81 c7 e0 08 ret 201a3f0: 81 e8 00 00 restore =============================================================================== 0200a1f0 <_RBTree_Extract_unprotected>: */ void _RBTree_Extract_unprotected( RBTree_Control *the_rbtree, RBTree_Node *the_node ) { 200a1f0: 9d e3 bf a0 save %sp, -96, %sp RBTree_Node *leaf, *target; RBTree_Color victim_color; RBTree_Direction dir; if (!the_node) return; 200a1f4: 80 a6 60 00 cmp %i1, 0 200a1f8: 02 80 00 69 be 200a39c <_RBTree_Extract_unprotected+0x1ac> 200a1fc: 01 00 00 00 nop /* check if min needs to be updated */ if (the_node == the_rbtree->first[RBT_LEFT]) { 200a200: c2 06 20 08 ld [ %i0 + 8 ], %g1 200a204: 80 a6 40 01 cmp %i1, %g1 200a208: 32 80 00 07 bne,a 200a224 <_RBTree_Extract_unprotected+0x34> 200a20c: c2 06 20 0c ld [ %i0 + 0xc ], %g1 */ RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_Successor_unprotected( const RBTree_Node *node ) { return _RBTree_Next_unprotected( node, RBT_RIGHT ); 200a210: 90 10 00 19 mov %i1, %o0 200a214: 40 00 01 31 call 200a6d8 <_RBTree_Next_unprotected> 200a218: 92 10 20 01 mov 1, %o1 RBTree_Node *next; next = _RBTree_Successor_unprotected(the_node); the_rbtree->first[RBT_LEFT] = next; 200a21c: d0 26 20 08 st %o0, [ %i0 + 8 ] } /* Check if max needs to be updated. min=max for 1 element trees so * do not use else if here. */ if (the_node == the_rbtree->first[RBT_RIGHT]) { 200a220: c2 06 20 0c ld [ %i0 + 0xc ], %g1 200a224: 80 a6 40 01 cmp %i1, %g1 200a228: 32 80 00 07 bne,a 200a244 <_RBTree_Extract_unprotected+0x54> 200a22c: fa 06 60 04 ld [ %i1 + 4 ], %i5 */ RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_Predecessor_unprotected( const RBTree_Node *node ) { return _RBTree_Next_unprotected( node, RBT_LEFT ); 200a230: 90 10 00 19 mov %i1, %o0 200a234: 40 00 01 29 call 200a6d8 <_RBTree_Next_unprotected> 200a238: 92 10 20 00 clr %o1 RBTree_Node *previous; previous = _RBTree_Predecessor_unprotected(the_node); the_rbtree->first[RBT_RIGHT] = previous; 200a23c: d0 26 20 0c st %o0, [ %i0 + 0xc ] * either max in node->child[RBT_LEFT] or min in node->child[RBT_RIGHT], * and replace the_node with the target node. This maintains the binary * search tree property, but may violate the red-black properties. */ if (the_node->child[RBT_LEFT] && the_node->child[RBT_RIGHT]) { 200a240: fa 06 60 04 ld [ %i1 + 4 ], %i5 200a244: 80 a7 60 00 cmp %i5, 0 200a248: 02 80 00 36 be 200a320 <_RBTree_Extract_unprotected+0x130> 200a24c: f8 06 60 08 ld [ %i1 + 8 ], %i4 200a250: 80 a7 20 00 cmp %i4, 0 200a254: 32 80 00 05 bne,a 200a268 <_RBTree_Extract_unprotected+0x78> 200a258: c2 07 60 08 ld [ %i5 + 8 ], %g1 200a25c: 10 80 00 35 b 200a330 <_RBTree_Extract_unprotected+0x140> 200a260: b8 10 00 1d mov %i5, %i4 target = the_node->child[RBT_LEFT]; /* find max in node->child[RBT_LEFT] */ while (target->child[RBT_RIGHT]) target = target->child[RBT_RIGHT]; 200a264: c2 07 60 08 ld [ %i5 + 8 ], %g1 200a268: 80 a0 60 00 cmp %g1, 0 200a26c: 32 bf ff fe bne,a 200a264 <_RBTree_Extract_unprotected+0x74> 200a270: ba 10 00 01 mov %g1, %i5 * target's position (target is the right child of target->parent) * when target vacates it. if there is no child, then target->parent * should become NULL. This may cause the coloring to be violated. * For now we store the color of the node being deleted in victim_color. */ leaf = target->child[RBT_LEFT]; 200a274: f8 07 60 04 ld [ %i5 + 4 ], %i4 if(leaf) { 200a278: 80 a7 20 00 cmp %i4, 0 200a27c: 02 80 00 05 be 200a290 <_RBTree_Extract_unprotected+0xa0> 200a280: 01 00 00 00 nop leaf->parent = target->parent; 200a284: c2 07 40 00 ld [ %i5 ], %g1 200a288: 10 80 00 04 b 200a298 <_RBTree_Extract_unprotected+0xa8> 200a28c: c2 27 00 00 st %g1, [ %i4 ] } else { /* fix the tree here if the child is a null leaf. */ _RBTree_Extract_validate_unprotected(target); 200a290: 7f ff ff 73 call 200a05c <_RBTree_Extract_validate_unprotected> 200a294: 90 10 00 1d mov %i5, %o0 } victim_color = target->color; dir = target != target->parent->child[0]; 200a298: c4 07 40 00 ld [ %i5 ], %g2 leaf->parent = target->parent; } else { /* fix the tree here if the child is a null leaf. */ _RBTree_Extract_validate_unprotected(target); } victim_color = target->color; 200a29c: c2 07 60 0c ld [ %i5 + 0xc ], %g1 dir = target != target->parent->child[0]; 200a2a0: c6 00 a0 04 ld [ %g2 + 4 ], %g3 200a2a4: 86 1f 40 03 xor %i5, %g3, %g3 200a2a8: 80 a0 00 03 cmp %g0, %g3 200a2ac: 86 40 20 00 addx %g0, 0, %g3 target->parent->child[dir] = leaf; 200a2b0: 87 28 e0 02 sll %g3, 2, %g3 200a2b4: 84 00 80 03 add %g2, %g3, %g2 200a2b8: f8 20 a0 04 st %i4, [ %g2 + 4 ] /* now replace the_node with target */ dir = the_node != the_node->parent->child[0]; 200a2bc: c4 06 40 00 ld [ %i1 ], %g2 200a2c0: c6 00 a0 04 ld [ %g2 + 4 ], %g3 200a2c4: 86 1e 40 03 xor %i1, %g3, %g3 200a2c8: 80 a0 00 03 cmp %g0, %g3 200a2cc: 86 40 20 00 addx %g0, 0, %g3 the_node->parent->child[dir] = target; 200a2d0: 87 28 e0 02 sll %g3, 2, %g3 200a2d4: 84 00 80 03 add %g2, %g3, %g2 200a2d8: fa 20 a0 04 st %i5, [ %g2 + 4 ] /* set target's new children to the original node's children */ target->child[RBT_RIGHT] = the_node->child[RBT_RIGHT]; 200a2dc: c4 06 60 08 ld [ %i1 + 8 ], %g2 200a2e0: c4 27 60 08 st %g2, [ %i5 + 8 ] if (the_node->child[RBT_RIGHT]) 200a2e4: c4 06 60 08 ld [ %i1 + 8 ], %g2 200a2e8: 80 a0 a0 00 cmp %g2, 0 200a2ec: 32 80 00 02 bne,a 200a2f4 <_RBTree_Extract_unprotected+0x104><== ALWAYS TAKEN 200a2f0: fa 20 80 00 st %i5, [ %g2 ] the_node->child[RBT_RIGHT]->parent = target; target->child[RBT_LEFT] = the_node->child[RBT_LEFT]; 200a2f4: c4 06 60 04 ld [ %i1 + 4 ], %g2 200a2f8: c4 27 60 04 st %g2, [ %i5 + 4 ] if (the_node->child[RBT_LEFT]) 200a2fc: c4 06 60 04 ld [ %i1 + 4 ], %g2 200a300: 80 a0 a0 00 cmp %g2, 0 200a304: 32 80 00 02 bne,a 200a30c <_RBTree_Extract_unprotected+0x11c> 200a308: fa 20 80 00 st %i5, [ %g2 ] /* finally, update the parent node and recolor. target has completely * replaced the_node, and target's child has moved up the tree if needed. * the_node is no longer part of the tree, although it has valid pointers * still. */ target->parent = the_node->parent; 200a30c: c4 06 40 00 ld [ %i1 ], %g2 200a310: c4 27 40 00 st %g2, [ %i5 ] target->color = the_node->color; 200a314: c4 06 60 0c ld [ %i1 + 0xc ], %g2 200a318: 10 80 00 14 b 200a368 <_RBTree_Extract_unprotected+0x178> 200a31c: c4 27 60 0c st %g2, [ %i5 + 0xc ] * violated. We will fix it later. * For now we store the color of the node being deleted in victim_color. */ leaf = the_node->child[RBT_LEFT] ? the_node->child[RBT_LEFT] : the_node->child[RBT_RIGHT]; if( leaf ) { 200a320: 80 a7 20 00 cmp %i4, 0 200a324: 32 80 00 04 bne,a 200a334 <_RBTree_Extract_unprotected+0x144> 200a328: c2 06 40 00 ld [ %i1 ], %g1 200a32c: 30 80 00 04 b,a 200a33c <_RBTree_Extract_unprotected+0x14c> leaf->parent = the_node->parent; 200a330: c2 06 40 00 ld [ %i1 ], %g1 200a334: 10 80 00 04 b 200a344 <_RBTree_Extract_unprotected+0x154> 200a338: c2 27 00 00 st %g1, [ %i4 ] } else { /* fix the tree here if the child is a null leaf. */ _RBTree_Extract_validate_unprotected(the_node); 200a33c: 7f ff ff 48 call 200a05c <_RBTree_Extract_validate_unprotected> 200a340: 90 10 00 19 mov %i1, %o0 } victim_color = the_node->color; /* remove the_node from the tree */ dir = the_node != the_node->parent->child[0]; 200a344: c4 06 40 00 ld [ %i1 ], %g2 leaf->parent = the_node->parent; } else { /* fix the tree here if the child is a null leaf. */ _RBTree_Extract_validate_unprotected(the_node); } victim_color = the_node->color; 200a348: c2 06 60 0c ld [ %i1 + 0xc ], %g1 /* remove the_node from the tree */ dir = the_node != the_node->parent->child[0]; 200a34c: c6 00 a0 04 ld [ %g2 + 4 ], %g3 200a350: 86 1e 40 03 xor %i1, %g3, %g3 200a354: 80 a0 00 03 cmp %g0, %g3 200a358: 86 40 20 00 addx %g0, 0, %g3 the_node->parent->child[dir] = leaf; 200a35c: 87 28 e0 02 sll %g3, 2, %g3 200a360: 84 00 80 03 add %g2, %g3, %g2 200a364: f8 20 a0 04 st %i4, [ %g2 + 4 ] /* fix coloring. leaf has moved up the tree. The color of the deleted * node is in victim_color. There are two cases: * 1. Deleted a red node, its child must be black. Nothing must be done. * 2. Deleted a black node, its child must be red. Paint child black. */ if (victim_color == RBT_BLACK) { /* eliminate case 1 */ 200a368: 80 a0 60 00 cmp %g1, 0 200a36c: 32 80 00 06 bne,a 200a384 <_RBTree_Extract_unprotected+0x194> 200a370: c2 06 20 04 ld [ %i0 + 4 ], %g1 if (leaf) { 200a374: 80 a7 20 00 cmp %i4, 0 200a378: 32 80 00 02 bne,a 200a380 <_RBTree_Extract_unprotected+0x190> 200a37c: c0 27 20 0c clr [ %i4 + 0xc ] /* Wipe the_node */ _RBTree_Set_off_rbtree(the_node); /* set root to black, if it exists */ if (the_rbtree->root) the_rbtree->root->color = RBT_BLACK; 200a380: c2 06 20 04 ld [ %i0 + 4 ], %g1 */ RTEMS_INLINE_ROUTINE void _RBTree_Set_off_rbtree( RBTree_Node *node ) { node->parent = node->child[RBT_LEFT] = node->child[RBT_RIGHT] = NULL; 200a384: c0 26 60 08 clr [ %i1 + 8 ] 200a388: c0 26 60 04 clr [ %i1 + 4 ] 200a38c: 80 a0 60 00 cmp %g1, 0 200a390: 02 80 00 03 be 200a39c <_RBTree_Extract_unprotected+0x1ac> 200a394: c0 26 40 00 clr [ %i1 ] 200a398: c0 20 60 0c clr [ %g1 + 0xc ] 200a39c: 81 c7 e0 08 ret 200a3a0: 81 e8 00 00 restore =============================================================================== 0200b3e4 <_RBTree_Initialize>: void *starting_address, size_t number_nodes, size_t node_size, bool is_unique ) { 200b3e4: 9d e3 bf a0 save %sp, -96, %sp size_t count; RBTree_Node *next; /* TODO: Error message? */ if (!the_rbtree) return; 200b3e8: 80 a6 20 00 cmp %i0, 0 200b3ec: 02 80 00 10 be 200b42c <_RBTree_Initialize+0x48> <== NEVER TAKEN 200b3f0: 01 00 00 00 nop RBTree_Control *the_rbtree, RBTree_Compare_function compare_function, bool is_unique ) { the_rbtree->permanent_null = NULL; 200b3f4: c0 26 00 00 clr [ %i0 ] the_rbtree->root = NULL; 200b3f8: c0 26 20 04 clr [ %i0 + 4 ] the_rbtree->first[0] = NULL; 200b3fc: c0 26 20 08 clr [ %i0 + 8 ] the_rbtree->first[1] = NULL; 200b400: c0 26 20 0c clr [ %i0 + 0xc ] the_rbtree->compare_function = compare_function; 200b404: f2 26 20 10 st %i1, [ %i0 + 0x10 ] /* could do sanity checks here */ _RBTree_Initialize_empty(the_rbtree, compare_function, is_unique); count = number_nodes; next = starting_address; while ( count-- ) { 200b408: 10 80 00 06 b 200b420 <_RBTree_Initialize+0x3c> 200b40c: fa 2e 20 14 stb %i5, [ %i0 + 0x14 ] _RBTree_Insert_unprotected(the_rbtree, next); 200b410: 90 10 00 18 mov %i0, %o0 200b414: 7f ff ff 2e call 200b0cc <_RBTree_Insert_unprotected> 200b418: b4 06 80 1c add %i2, %i4, %i2 200b41c: b6 06 ff ff add %i3, -1, %i3 /* could do sanity checks here */ _RBTree_Initialize_empty(the_rbtree, compare_function, is_unique); count = number_nodes; next = starting_address; while ( count-- ) { 200b420: 80 a6 e0 00 cmp %i3, 0 200b424: 12 bf ff fb bne 200b410 <_RBTree_Initialize+0x2c> 200b428: 92 10 00 1a mov %i2, %o1 200b42c: 81 c7 e0 08 ret 200b430: 81 e8 00 00 restore =============================================================================== 0200a444 <_RBTree_Insert_unprotected>: */ RBTree_Node *_RBTree_Insert_unprotected( RBTree_Control *the_rbtree, RBTree_Node *the_node ) { 200a444: 9d e3 bf a0 save %sp, -96, %sp if(!the_node) return (RBTree_Node*)-1; 200a448: 80 a6 60 00 cmp %i1, 0 200a44c: 02 80 00 7c be 200a63c <_RBTree_Insert_unprotected+0x1f8> 200a450: ba 10 00 18 mov %i0, %i5 RBTree_Node *iter_node = the_rbtree->root; 200a454: f0 06 20 04 ld [ %i0 + 4 ], %i0 int compare_result; if (!iter_node) { /* special case: first node inserted */ 200a458: b6 96 20 00 orcc %i0, 0, %i3 200a45c: 32 80 00 0c bne,a 200a48c <_RBTree_Insert_unprotected+0x48> 200a460: c2 07 60 10 ld [ %i5 + 0x10 ], %g1 the_node->color = RBT_BLACK; 200a464: c0 26 60 0c clr [ %i1 + 0xc ] the_rbtree->root = the_node; 200a468: f2 27 60 04 st %i1, [ %i5 + 4 ] the_rbtree->first[0] = the_rbtree->first[1] = the_node; 200a46c: f2 27 60 0c st %i1, [ %i5 + 0xc ] 200a470: f2 27 60 08 st %i1, [ %i5 + 8 ] the_node->parent = (RBTree_Node *) the_rbtree; 200a474: fa 26 40 00 st %i5, [ %i1 ] the_node->child[RBT_LEFT] = the_node->child[RBT_RIGHT] = NULL; 200a478: c0 26 60 08 clr [ %i1 + 8 ] 200a47c: c0 26 60 04 clr [ %i1 + 4 ] 200a480: 81 c7 e0 08 ret 200a484: 81 e8 00 00 restore } else { /* typical binary search tree insert, descend tree to leaf and insert */ while (iter_node) { compare_result = the_rbtree->compare_function(the_node, iter_node); 200a488: c2 07 60 10 ld [ %i5 + 0x10 ], %g1 200a48c: 90 10 00 19 mov %i1, %o0 200a490: 9f c0 40 00 call %g1 200a494: 92 10 00 18 mov %i0, %o1 if ( the_rbtree->is_unique && _RBTree_Is_equal( compare_result ) ) 200a498: c2 0f 60 14 ldub [ %i5 + 0x14 ], %g1 200a49c: 80 a0 60 00 cmp %g1, 0 200a4a0: 02 80 00 05 be 200a4b4 <_RBTree_Insert_unprotected+0x70> 200a4a4: b8 38 00 08 xnor %g0, %o0, %i4 200a4a8: 80 a2 20 00 cmp %o0, 0 200a4ac: 02 80 00 65 be 200a640 <_RBTree_Insert_unprotected+0x1fc> 200a4b0: 01 00 00 00 nop return iter_node; RBTree_Direction dir = !_RBTree_Is_lesser( compare_result ); 200a4b4: b9 37 20 1f srl %i4, 0x1f, %i4 if (!iter_node->child[dir]) { 200a4b8: 83 2f 20 02 sll %i4, 2, %g1 200a4bc: 82 06 00 01 add %i0, %g1, %g1 200a4c0: f0 00 60 04 ld [ %g1 + 4 ], %i0 200a4c4: 80 a6 20 00 cmp %i0, 0 200a4c8: 32 bf ff f0 bne,a 200a488 <_RBTree_Insert_unprotected+0x44> 200a4cc: b6 10 00 18 mov %i0, %i3 the_node->child[RBT_LEFT] = the_node->child[RBT_RIGHT] = NULL; 200a4d0: c0 26 60 08 clr [ %i1 + 8 ] 200a4d4: c0 26 60 04 clr [ %i1 + 4 ] the_node->color = RBT_RED; 200a4d8: 84 10 20 01 mov 1, %g2 iter_node->child[dir] = the_node; 200a4dc: f2 20 60 04 st %i1, [ %g1 + 4 ] if ( the_rbtree->is_unique && _RBTree_Is_equal( compare_result ) ) return iter_node; RBTree_Direction dir = !_RBTree_Is_lesser( compare_result ); if (!iter_node->child[dir]) { the_node->child[RBT_LEFT] = the_node->child[RBT_RIGHT] = NULL; the_node->color = RBT_RED; 200a4e0: c4 26 60 0c st %g2, [ %i1 + 0xc ] iter_node->child[dir] = the_node; the_node->parent = iter_node; 200a4e4: f6 26 40 00 st %i3, [ %i1 ] /* update min/max */ compare_result = the_rbtree->compare_function( 200a4e8: c2 07 60 10 ld [ %i5 + 0x10 ], %g1 RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_First( const RBTree_Control *the_rbtree, RBTree_Direction dir ) { return the_rbtree->first[dir]; 200a4ec: b6 07 20 02 add %i4, 2, %i3 200a4f0: 85 2e e0 02 sll %i3, 2, %g2 200a4f4: d2 07 40 02 ld [ %i5 + %g2 ], %o1 200a4f8: 9f c0 40 00 call %g1 200a4fc: 90 10 00 19 mov %i1, %o0 the_node, _RBTree_First(the_rbtree, dir) ); if ( (!dir && _RBTree_Is_lesser(compare_result)) || 200a500: 80 a7 20 00 cmp %i4, 0 200a504: 12 80 00 06 bne 200a51c <_RBTree_Insert_unprotected+0xd8> 200a508: 80 a2 20 00 cmp %o0, 0 200a50c: 36 80 00 3c bge,a 200a5fc <_RBTree_Insert_unprotected+0x1b8> 200a510: d0 06 40 00 ld [ %i1 ], %o0 (dir && _RBTree_Is_greater(compare_result)) ) { the_rbtree->first[dir] = the_node; 200a514: 10 80 00 04 b 200a524 <_RBTree_Insert_unprotected+0xe0> 200a518: b7 2e e0 02 sll %i3, 2, %i3 compare_result = the_rbtree->compare_function( the_node, _RBTree_First(the_rbtree, dir) ); if ( (!dir && _RBTree_Is_lesser(compare_result)) || (dir && _RBTree_Is_greater(compare_result)) ) { 200a51c: 04 80 00 37 ble 200a5f8 <_RBTree_Insert_unprotected+0x1b4> 200a520: b7 2e e0 02 sll %i3, 2, %i3 the_rbtree->first[dir] = the_node; 200a524: 10 80 00 35 b 200a5f8 <_RBTree_Insert_unprotected+0x1b4> 200a528: f2 27 40 1b st %i1, [ %i5 + %i3 ] const RBTree_Node *the_node ) { if(!the_node) return NULL; if(!(the_node->parent)) return NULL; if(!(the_node->parent->parent)) return NULL; 200a52c: 02 80 00 13 be 200a578 <_RBTree_Insert_unprotected+0x134> <== NEVER TAKEN 200a530: 82 10 20 00 clr %g1 if(!(the_node->parent->parent->parent)) return NULL; 200a534: c2 07 40 00 ld [ %i5 ], %g1 200a538: 80 a0 60 00 cmp %g1, 0 200a53c: 02 80 00 0f be 200a578 <_RBTree_Insert_unprotected+0x134> <== NEVER TAKEN 200a540: 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]) 200a544: c2 07 60 04 ld [ %i5 + 4 ], %g1 200a548: 80 a2 00 01 cmp %o0, %g1 200a54c: 22 80 00 02 be,a 200a554 <_RBTree_Insert_unprotected+0x110> 200a550: 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); 200a554: 80 a0 60 00 cmp %g1, 0 200a558: 02 80 00 09 be 200a57c <_RBTree_Insert_unprotected+0x138> 200a55c: 84 10 20 00 clr %g2 200a560: c4 00 60 0c ld [ %g1 + 0xc ], %g2 200a564: 80 a0 a0 01 cmp %g2, 1 200a568: 32 80 00 05 bne,a 200a57c <_RBTree_Insert_unprotected+0x138> 200a56c: 84 10 20 00 clr %g2 200a570: 10 80 00 03 b 200a57c <_RBTree_Insert_unprotected+0x138> 200a574: 84 10 20 01 mov 1, %g2 200a578: 84 10 20 00 clr %g2 <== NOT EXECUTED while (_RBTree_Is_red(_RBTree_Parent(the_node))) { u = _RBTree_Parent_sibling(the_node); g = the_node->parent->parent; /* if uncle is red, repaint uncle/parent black and grandparent red */ if(_RBTree_Is_red(u)) { 200a57c: 80 a0 a0 00 cmp %g2, 0 200a580: 22 80 00 08 be,a 200a5a0 <_RBTree_Insert_unprotected+0x15c> 200a584: c2 07 60 04 ld [ %i5 + 4 ], %g1 the_node->parent->color = RBT_BLACK; 200a588: c0 22 20 0c clr [ %o0 + 0xc ] u->color = RBT_BLACK; 200a58c: c0 20 60 0c clr [ %g1 + 0xc ] g->color = RBT_RED; 200a590: b2 10 00 1d mov %i5, %i1 200a594: 82 10 20 01 mov 1, %g1 200a598: 10 80 00 18 b 200a5f8 <_RBTree_Insert_unprotected+0x1b4> 200a59c: c2 27 60 0c st %g1, [ %i5 + 0xc ] the_node = g; } else { /* if uncle is black */ RBTree_Direction dir = the_node != the_node->parent->child[0]; RBTree_Direction pdir = the_node->parent != g->child[0]; 200a5a0: 82 1a 00 01 xor %o0, %g1, %g1 200a5a4: 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]; 200a5a8: c2 02 20 04 ld [ %o0 + 4 ], %g1 RBTree_Direction pdir = the_node->parent != g->child[0]; 200a5ac: 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]; 200a5b0: 82 1e 40 01 xor %i1, %g1, %g1 200a5b4: 80 a0 00 01 cmp %g0, %g1 200a5b8: 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) { 200a5bc: 80 a0 40 1c cmp %g1, %i4 200a5c0: 22 80 00 08 be,a 200a5e0 <_RBTree_Insert_unprotected+0x19c> 200a5c4: c2 06 40 00 ld [ %i1 ], %g1 _RBTree_Rotate(the_node->parent, pdir); 200a5c8: 7f ff ff 80 call 200a3c8 <_RBTree_Rotate> 200a5cc: 92 10 00 1c mov %i4, %o1 the_node = the_node->child[pdir]; 200a5d0: 83 2f 20 02 sll %i4, 2, %g1 200a5d4: b2 06 40 01 add %i1, %g1, %i1 200a5d8: f2 06 60 04 ld [ %i1 + 4 ], %i1 } the_node->parent->color = RBT_BLACK; 200a5dc: c2 06 40 00 ld [ %i1 ], %g1 g->color = RBT_RED; 200a5e0: 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; 200a5e4: c0 20 60 0c clr [ %g1 + 0xc ] g->color = RBT_RED; 200a5e8: d2 27 60 0c st %o1, [ %i5 + 0xc ] /* now rotate grandparent in the other branch direction (toward uncle) */ _RBTree_Rotate(g, (1-pdir)); 200a5ec: 90 10 00 1d mov %i5, %o0 200a5f0: 7f ff ff 76 call 200a3c8 <_RBTree_Rotate> 200a5f4: 92 22 40 1c sub %o1, %i4, %o1 */ RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_Parent( const RBTree_Node *the_node ) { if (!the_node->parent->parent) return NULL; 200a5f8: d0 06 40 00 ld [ %i1 ], %o0 200a5fc: fa 02 00 00 ld [ %o0 ], %i5 200a600: 80 a7 60 00 cmp %i5, 0 200a604: 22 80 00 06 be,a 200a61c <_RBTree_Insert_unprotected+0x1d8> 200a608: 82 10 20 00 clr %g1 */ RTEMS_INLINE_ROUTINE bool _RBTree_Is_red( const RBTree_Node *the_node ) { return (the_node && the_node->color == RBT_RED); 200a60c: c2 02 20 0c ld [ %o0 + 0xc ], %g1 200a610: 82 18 60 01 xor %g1, 1, %g1 200a614: 80 a0 00 01 cmp %g0, %g1 200a618: 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))) { 200a61c: 80 a0 60 00 cmp %g1, 0 200a620: 12 bf ff c3 bne 200a52c <_RBTree_Insert_unprotected+0xe8> 200a624: 80 a7 60 00 cmp %i5, 0 /* now rotate grandparent in the other branch direction (toward uncle) */ _RBTree_Rotate(g, (1-pdir)); } } if(!the_node->parent->parent) the_node->color = RBT_BLACK; 200a628: 12 80 00 06 bne 200a640 <_RBTree_Insert_unprotected+0x1fc> 200a62c: 01 00 00 00 nop 200a630: c0 26 60 0c clr [ %i1 + 0xc ] 200a634: 81 c7 e0 08 ret 200a638: 81 e8 00 00 restore RBTree_Node *_RBTree_Insert_unprotected( RBTree_Control *the_rbtree, RBTree_Node *the_node ) { if(!the_node) return (RBTree_Node*)-1; 200a63c: b0 10 3f ff mov -1, %i0 /* verify red-black properties */ _RBTree_Validate_insert_unprotected(the_node); } return (RBTree_Node*)0; } 200a640: 81 c7 e0 08 ret 200a644: 81 e8 00 00 restore =============================================================================== 0200a678 <_RBTree_Iterate_unprotected>: const RBTree_Control *rbtree, RBTree_Direction dir, RBTree_Visitor visitor, void *visitor_arg ) { 200a678: 9d e3 bf a0 save %sp, -96, %sp RBTree_Direction opp_dir = _RBTree_Opposite_direction( dir ); const RBTree_Node *current = _RBTree_First( rbtree, opp_dir ); bool stop = false; 200a67c: b8 10 20 00 clr %i4 */ RTEMS_INLINE_ROUTINE RBTree_Direction _RBTree_Opposite_direction( RBTree_Direction the_dir ) { return (RBTree_Direction) !((int) the_dir); 200a680: 80 a0 00 19 cmp %g0, %i1 200a684: 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]; 200a688: 82 00 60 02 add %g1, 2, %g1 200a68c: 83 28 60 02 sll %g1, 2, %g1 while ( !stop && current != NULL ) { 200a690: 10 80 00 0a b 200a6b8 <_RBTree_Iterate_unprotected+0x40> 200a694: fa 06 00 01 ld [ %i0 + %g1 ], %i5 stop = (*visitor)( current, dir, visitor_arg ); 200a698: 92 10 00 19 mov %i1, %o1 200a69c: 9f c6 80 00 call %i2 200a6a0: 94 10 00 1b mov %i3, %o2 current = _RBTree_Next_unprotected( current, dir ); 200a6a4: 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 ); 200a6a8: b8 10 00 08 mov %o0, %i4 current = _RBTree_Next_unprotected( current, dir ); 200a6ac: 40 00 00 0b call 200a6d8 <_RBTree_Next_unprotected> 200a6b0: 90 10 00 1d mov %i5, %o0 200a6b4: ba 10 00 08 mov %o0, %i5 { RBTree_Direction opp_dir = _RBTree_Opposite_direction( dir ); const RBTree_Node *current = _RBTree_First( rbtree, opp_dir ); bool stop = false; while ( !stop && current != NULL ) { 200a6b8: 80 a7 60 00 cmp %i5, 0 200a6bc: 02 80 00 05 be 200a6d0 <_RBTree_Iterate_unprotected+0x58> 200a6c0: b8 1f 20 01 xor %i4, 1, %i4 200a6c4: 80 8f 20 ff btst 0xff, %i4 200a6c8: 12 bf ff f4 bne 200a698 <_RBTree_Iterate_unprotected+0x20><== ALWAYS TAKEN 200a6cc: 90 10 00 1d mov %i5, %o0 200a6d0: 81 c7 e0 08 ret 200a6d4: 81 e8 00 00 restore =============================================================================== 02009fe0 <_RBTree_Rotate>: RBTree_Node *the_node, RBTree_Direction dir ) { RBTree_Node *c; if (the_node == NULL) return; 2009fe0: 80 a2 20 00 cmp %o0, 0 2009fe4: 02 80 00 1c be 200a054 <_RBTree_Rotate+0x74> <== NEVER TAKEN 2009fe8: 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); 2009fec: 86 60 3f ff subx %g0, -1, %g3 RBTree_Direction dir ) { RBTree_Node *c; if (the_node == NULL) return; if (the_node->child[_RBTree_Opposite_direction(dir)] == NULL) return; 2009ff0: 87 28 e0 02 sll %g3, 2, %g3 2009ff4: 86 02 00 03 add %o0, %g3, %g3 2009ff8: c2 00 e0 04 ld [ %g3 + 4 ], %g1 2009ffc: 80 a0 60 00 cmp %g1, 0 200a000: 02 80 00 15 be 200a054 <_RBTree_Rotate+0x74> <== NEVER TAKEN 200a004: 93 2a 60 02 sll %o1, 2, %o1 c = the_node->child[_RBTree_Opposite_direction(dir)]; the_node->child[_RBTree_Opposite_direction(dir)] = c->child[dir]; 200a008: 84 00 40 09 add %g1, %o1, %g2 200a00c: c8 00 a0 04 ld [ %g2 + 4 ], %g4 200a010: c8 20 e0 04 st %g4, [ %g3 + 4 ] if (c->child[dir]) 200a014: c4 00 a0 04 ld [ %g2 + 4 ], %g2 200a018: 80 a0 a0 00 cmp %g2, 0 200a01c: 32 80 00 02 bne,a 200a024 <_RBTree_Rotate+0x44> 200a020: d0 20 80 00 st %o0, [ %g2 ] c->child[dir]->parent = the_node; c->child[dir] = the_node; the_node->parent->child[the_node != the_node->parent->child[0]] = c; 200a024: c4 02 00 00 ld [ %o0 ], %g2 the_node->child[_RBTree_Opposite_direction(dir)] = c->child[dir]; if (c->child[dir]) c->child[dir]->parent = the_node; c->child[dir] = the_node; 200a028: 92 00 40 09 add %g1, %o1, %o1 200a02c: d0 22 60 04 st %o0, [ %o1 + 4 ] the_node->parent->child[the_node != the_node->parent->child[0]] = c; 200a030: c6 00 a0 04 ld [ %g2 + 4 ], %g3 c->parent = the_node->parent; 200a034: c4 20 40 00 st %g2, [ %g1 ] if (c->child[dir]) c->child[dir]->parent = the_node; c->child[dir] = the_node; the_node->parent->child[the_node != the_node->parent->child[0]] = c; 200a038: 86 1a 00 03 xor %o0, %g3, %g3 c->parent = the_node->parent; the_node->parent = c; 200a03c: c2 22 00 00 st %g1, [ %o0 ] if (c->child[dir]) c->child[dir]->parent = the_node; c->child[dir] = the_node; the_node->parent->child[the_node != the_node->parent->child[0]] = c; 200a040: 80 a0 00 03 cmp %g0, %g3 200a044: 86 40 20 00 addx %g0, 0, %g3 200a048: 87 28 e0 02 sll %g3, 2, %g3 200a04c: 86 00 80 03 add %g2, %g3, %g3 200a050: c2 20 e0 04 st %g1, [ %g3 + 4 ] 200a054: 81 c3 e0 08 retl =============================================================================== 02009f90 <_RBTree_Sibling>: */ RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_Sibling( const RBTree_Node *the_node ) { if(!the_node) return NULL; 2009f90: 80 a2 20 00 cmp %o0, 0 2009f94: 02 80 00 10 be 2009fd4 <_RBTree_Sibling+0x44> <== NEVER TAKEN 2009f98: 82 10 20 00 clr %g1 if(!(the_node->parent)) return NULL; 2009f9c: c4 02 00 00 ld [ %o0 ], %g2 2009fa0: 80 a0 a0 00 cmp %g2, 0 2009fa4: 22 80 00 0d be,a 2009fd8 <_RBTree_Sibling+0x48> <== NEVER TAKEN 2009fa8: 90 10 00 01 mov %g1, %o0 <== NOT EXECUTED if(!(the_node->parent->parent)) return NULL; 2009fac: c2 00 80 00 ld [ %g2 ], %g1 2009fb0: 80 a0 60 00 cmp %g1, 0 2009fb4: 02 80 00 08 be 2009fd4 <_RBTree_Sibling+0x44> 2009fb8: 82 10 20 00 clr %g1 if(the_node == the_node->parent->child[RBT_LEFT]) 2009fbc: c2 00 a0 04 ld [ %g2 + 4 ], %g1 2009fc0: 80 a2 00 01 cmp %o0, %g1 2009fc4: 22 80 00 04 be,a 2009fd4 <_RBTree_Sibling+0x44> 2009fc8: c2 00 a0 08 ld [ %g2 + 8 ], %g1 return the_node->parent->child[RBT_RIGHT]; 2009fcc: 81 c3 e0 08 retl 2009fd0: 90 10 00 01 mov %g1, %o0 else return the_node->parent->child[RBT_LEFT]; } 2009fd4: 90 10 00 01 mov %g1, %o0 2009fd8: 81 c3 e0 08 retl =============================================================================== 02008820 <_RTEMS_signal_Post_switch_hook>: #include #include #include static void _RTEMS_signal_Post_switch_hook( Thread_Control *executing ) { 2008820: 9d e3 bf 98 save %sp, -104, %sp RTEMS_API_Control *api; ASR_Information *asr; rtems_signal_set signal_set; Modes_Control prev_mode; api = executing->API_Extensions[ THREAD_API_RTEMS ]; 2008824: fa 06 21 58 ld [ %i0 + 0x158 ], %i5 if ( !api ) 2008828: 80 a7 60 00 cmp %i5, 0 200882c: 02 80 00 1c be 200889c <_RTEMS_signal_Post_switch_hook+0x7c><== NEVER TAKEN 2008830: 01 00 00 00 nop * Signal Processing */ asr = &api->Signal; _ISR_Disable( level ); 2008834: 7f ff eb 45 call 2003548 2008838: 01 00 00 00 nop signal_set = asr->signals_posted; 200883c: f8 07 60 14 ld [ %i5 + 0x14 ], %i4 asr->signals_posted = 0; 2008840: c0 27 60 14 clr [ %i5 + 0x14 ] _ISR_Enable( level ); 2008844: 7f ff eb 45 call 2003558 2008848: 01 00 00 00 nop if ( !signal_set ) /* similar to _ASR_Are_signals_pending( asr ) */ 200884c: 80 a7 20 00 cmp %i4, 0 2008850: 02 80 00 13 be 200889c <_RTEMS_signal_Post_switch_hook+0x7c> 2008854: 94 07 bf fc add %fp, -4, %o2 return; asr->nest_level += 1; 2008858: c2 07 60 1c ld [ %i5 + 0x1c ], %g1 rtems_task_mode( asr->mode_set, RTEMS_ALL_MODE_MASKS, &prev_mode ); 200885c: d0 07 60 10 ld [ %i5 + 0x10 ], %o0 if ( !signal_set ) /* similar to _ASR_Are_signals_pending( asr ) */ return; asr->nest_level += 1; 2008860: 82 00 60 01 inc %g1 2008864: c2 27 60 1c st %g1, [ %i5 + 0x1c ] rtems_task_mode( asr->mode_set, RTEMS_ALL_MODE_MASKS, &prev_mode ); 2008868: 37 00 00 3f sethi %hi(0xfc00), %i3 200886c: 40 00 01 03 call 2008c78 2008870: 92 16 e3 ff or %i3, 0x3ff, %o1 ! ffff (*asr->handler)( signal_set ); 2008874: c2 07 60 0c ld [ %i5 + 0xc ], %g1 2008878: 9f c0 40 00 call %g1 200887c: 90 10 00 1c mov %i4, %o0 asr->nest_level -= 1; 2008880: c2 07 60 1c ld [ %i5 + 0x1c ], %g1 rtems_task_mode( prev_mode, RTEMS_ALL_MODE_MASKS, &prev_mode ); 2008884: 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; 2008888: 82 00 7f ff add %g1, -1, %g1 rtems_task_mode( prev_mode, RTEMS_ALL_MODE_MASKS, &prev_mode ); 200888c: 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; 2008890: c2 27 60 1c st %g1, [ %i5 + 0x1c ] rtems_task_mode( prev_mode, RTEMS_ALL_MODE_MASKS, &prev_mode ); 2008894: 40 00 00 f9 call 2008c78 2008898: 94 07 bf fc add %fp, -4, %o2 200889c: 81 c7 e0 08 ret 20088a0: 81 e8 00 00 restore =============================================================================== 02032df4 <_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 ) { 2032df4: 9d e3 bf 98 save %sp, -104, %sp */ static inline void _TOD_Get_uptime( Timestamp_Control *time ) { _TOD_Get_with_nanoseconds( time, &_TOD.uptime ); 2032df8: 13 00 81 87 sethi %hi(0x2061c00), %o1 #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ Timestamp_Control uptime; #endif Thread_Control *owning_thread = the_period->owner; 2032dfc: f6 06 20 40 ld [ %i0 + 0x40 ], %i3 2032e00: 90 07 bf f8 add %fp, -8, %o0 2032e04: 7f ff 55 55 call 2008358 <_TOD_Get_with_nanoseconds> 2032e08: 92 12 63 90 or %o1, 0x390, %o1 /* * Determine elapsed wall time since period initiated. */ #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ _TOD_Get_uptime( &uptime ); _Timestamp_Subtract( 2032e0c: c4 1f bf f8 ldd [ %fp + -8 ], %g2 const Timestamp64_Control *_start, const Timestamp64_Control *_end, Timestamp64_Control *_result ) { *_result = *_end - *_start; 2032e10: f8 1e 20 50 ldd [ %i0 + 0x50 ], %i4 * Determine cpu usage since period initiated. */ used = owning_thread->cpu_time_used; #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ if (owning_thread == _Thread_Executing) { 2032e14: 09 00 81 89 sethi %hi(0x2062400), %g4 2032e18: ba a0 c0 1d subcc %g3, %i5, %i5 2032e1c: 88 11 21 60 or %g4, 0x160, %g4 2032e20: b8 60 80 1c subx %g2, %i4, %i4 2032e24: f8 3e 40 00 std %i4, [ %i1 ] 2032e28: fa 01 20 10 ld [ %g4 + 0x10 ], %i5 #endif /* * Determine cpu usage since period initiated. */ used = owning_thread->cpu_time_used; 2032e2c: d8 1e e0 80 ldd [ %i3 + 0x80 ], %o4 #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ if (owning_thread == _Thread_Executing) { 2032e30: 80 a6 c0 1d cmp %i3, %i5 2032e34: 12 80 00 15 bne 2032e88 <_Rate_monotonic_Get_status+0x94> 2032e38: 82 10 20 01 mov 1, %g1 2032e3c: f8 19 20 20 ldd [ %g4 + 0x20 ], %i4 2032e40: 86 a0 c0 1d subcc %g3, %i5, %g3 2032e44: 84 60 80 1c subx %g2, %i4, %g2 static inline void _Timestamp64_implementation_Add_to( Timestamp64_Control *_time, const Timestamp64_Control *_add ) { *_time += *_add; 2032e48: ba 83 40 03 addcc %o5, %g3, %i5 2032e4c: b8 43 00 02 addx %o4, %g2, %i4 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 2032e50: c4 1e 20 48 ldd [ %i0 + 0x48 ], %g2 /* * The cpu usage info was reset while executing. Can't * determine a status. */ if (_Timestamp_Less_than(&used, &the_period->cpu_usage_period_initiated)) 2032e54: 80 a0 80 1c cmp %g2, %i4 2032e58: 34 80 00 0c bg,a 2032e88 <_Rate_monotonic_Get_status+0x94><== NEVER TAKEN 2032e5c: 82 10 20 00 clr %g1 <== NOT EXECUTED 2032e60: 32 80 00 06 bne,a 2032e78 <_Rate_monotonic_Get_status+0x84> 2032e64: 86 a7 40 03 subcc %i5, %g3, %g3 2032e68: 80 a0 c0 1d cmp %g3, %i5 2032e6c: 18 80 00 06 bgu 2032e84 <_Rate_monotonic_Get_status+0x90> 2032e70: 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; 2032e74: 82 10 20 01 mov 1, %g1 const Timestamp64_Control *_start, const Timestamp64_Control *_end, Timestamp64_Control *_result ) { *_result = *_end - *_start; 2032e78: 84 67 00 02 subx %i4, %g2, %g2 2032e7c: 10 80 00 03 b 2032e88 <_Rate_monotonic_Get_status+0x94> 2032e80: 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; 2032e84: 82 10 20 00 clr %g1 return false; *cpu_since_last_period = used - the_period->cpu_usage_period_initiated; #endif return true; } 2032e88: b0 08 60 01 and %g1, 1, %i0 2032e8c: 81 c7 e0 08 ret 2032e90: 81 e8 00 00 restore =============================================================================== 020331fc <_Rate_monotonic_Timeout>: void _Rate_monotonic_Timeout( Objects_Id id, void *ignored ) { 20331fc: 9d e3 bf 98 save %sp, -104, %sp 2033200: 11 00 81 8a sethi %hi(0x2062800), %o0 2033204: 92 10 00 18 mov %i0, %o1 2033208: 90 12 23 24 or %o0, 0x324, %o0 203320c: 7f ff 56 fa call 2008df4 <_Objects_Get> 2033210: 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 ) { 2033214: c2 07 bf fc ld [ %fp + -4 ], %g1 2033218: 80 a0 60 00 cmp %g1, 0 203321c: 12 80 00 24 bne 20332ac <_Rate_monotonic_Timeout+0xb0> <== NEVER TAKEN 2033220: ba 10 00 08 mov %o0, %i5 case OBJECTS_LOCAL: the_thread = the_period->owner; 2033224: d0 02 20 40 ld [ %o0 + 0x40 ], %o0 if ( _States_Is_waiting_for_period( the_thread->current_state ) && 2033228: 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); 203322c: c4 02 20 10 ld [ %o0 + 0x10 ], %g2 2033230: 80 88 80 01 btst %g2, %g1 2033234: 22 80 00 0b be,a 2033260 <_Rate_monotonic_Timeout+0x64> 2033238: c2 07 60 38 ld [ %i5 + 0x38 ], %g1 203323c: c4 02 20 20 ld [ %o0 + 0x20 ], %g2 2033240: c2 07 60 08 ld [ %i5 + 8 ], %g1 2033244: 80 a0 80 01 cmp %g2, %g1 2033248: 32 80 00 06 bne,a 2033260 <_Rate_monotonic_Timeout+0x64> 203324c: c2 07 60 38 ld [ %i5 + 0x38 ], %g1 RTEMS_INLINE_ROUTINE void _Thread_Unblock ( Thread_Control *the_thread ) { _Thread_Clear_state( the_thread, STATES_BLOCKED ); 2033250: 13 04 01 ff sethi %hi(0x1007fc00), %o1 2033254: 7f ff 59 b2 call 200991c <_Thread_Clear_state> 2033258: 92 12 63 f8 or %o1, 0x3f8, %o1 ! 1007fff8 203325c: 30 80 00 06 b,a 2033274 <_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 ) { 2033260: 80 a0 60 01 cmp %g1, 1 2033264: 12 80 00 0d bne 2033298 <_Rate_monotonic_Timeout+0x9c> 2033268: 82 10 20 04 mov 4, %g1 the_period->state = RATE_MONOTONIC_EXPIRED_WHILE_BLOCKING; 203326c: 82 10 20 03 mov 3, %g1 2033270: c2 27 60 38 st %g1, [ %i5 + 0x38 ] _Rate_monotonic_Initiate_statistics( the_period ); 2033274: 7f ff ff 51 call 2032fb8 <_Rate_monotonic_Initiate_statistics> 2033278: 90 10 00 1d mov %i5, %o0 Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 203327c: c2 07 60 3c ld [ %i5 + 0x3c ], %g1 _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 2033280: 11 00 81 88 sethi %hi(0x2062000), %o0 Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 2033284: c2 27 60 1c st %g1, [ %i5 + 0x1c ] _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 2033288: 90 12 20 dc or %o0, 0xdc, %o0 203328c: 7f ff 5d b7 call 200a968 <_Watchdog_Insert> 2033290: 92 07 60 10 add %i5, 0x10, %o1 2033294: 30 80 00 02 b,a 203329c <_Rate_monotonic_Timeout+0xa0> _Watchdog_Insert_ticks( &the_period->Timer, the_period->next_length ); } else the_period->state = RATE_MONOTONIC_EXPIRED; 2033298: c2 27 60 38 st %g1, [ %i5 + 0x38 ] * * This routine decrements the thread dispatch level. */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_decrement_disable_level(void) { uint32_t level = _Thread_Dispatch_disable_level; 203329c: 03 00 81 88 sethi %hi(0x2062000), %g1 20332a0: c4 00 60 40 ld [ %g1 + 0x40 ], %g2 ! 2062040 <_Thread_Dispatch_disable_level> --level; 20332a4: 84 00 bf ff add %g2, -1, %g2 _Thread_Dispatch_disable_level = level; 20332a8: c4 20 60 40 st %g2, [ %g1 + 0x40 ] 20332ac: 81 c7 e0 08 ret 20332b0: 81 e8 00 00 restore =============================================================================== 02032e94 <_Rate_monotonic_Update_statistics>: } static void _Rate_monotonic_Update_statistics( Rate_monotonic_Control *the_period ) { 2032e94: 9d e3 bf 90 save %sp, -112, %sp /* * Update the counts. */ stats = &the_period->Statistics; stats->count++; 2032e98: c2 06 20 58 ld [ %i0 + 0x58 ], %g1 2032e9c: 82 00 60 01 inc %g1 2032ea0: c2 26 20 58 st %g1, [ %i0 + 0x58 ] if ( the_period->state == RATE_MONOTONIC_EXPIRED ) 2032ea4: c2 06 20 38 ld [ %i0 + 0x38 ], %g1 2032ea8: 80 a0 60 04 cmp %g1, 4 2032eac: 12 80 00 05 bne 2032ec0 <_Rate_monotonic_Update_statistics+0x2c> 2032eb0: 90 10 00 18 mov %i0, %o0 stats->missed_count++; 2032eb4: c2 06 20 5c ld [ %i0 + 0x5c ], %g1 2032eb8: 82 00 60 01 inc %g1 2032ebc: c2 26 20 5c st %g1, [ %i0 + 0x5c ] /* * Grab status for time statistics. */ valid_status = 2032ec0: 92 07 bf f8 add %fp, -8, %o1 2032ec4: 7f ff ff cc call 2032df4 <_Rate_monotonic_Get_status> 2032ec8: 94 07 bf f0 add %fp, -16, %o2 _Rate_monotonic_Get_status( the_period, &since_last_period, &executed ); if (!valid_status) 2032ecc: 80 8a 20 ff btst 0xff, %o0 2032ed0: 02 80 00 38 be 2032fb0 <_Rate_monotonic_Update_statistics+0x11c> 2032ed4: c4 1f bf f0 ldd [ %fp + -16 ], %g2 static inline void _Timestamp64_implementation_Add_to( Timestamp64_Control *_time, const Timestamp64_Control *_add ) { *_time += *_add; 2032ed8: 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 ) ) 2032edc: c2 06 20 60 ld [ %i0 + 0x60 ], %g1 2032ee0: b6 87 40 03 addcc %i5, %g3, %i3 2032ee4: b4 47 00 02 addx %i4, %g2, %i2 2032ee8: 80 a0 40 02 cmp %g1, %g2 2032eec: 14 80 00 09 bg 2032f10 <_Rate_monotonic_Update_statistics+0x7c> 2032ef0: f4 3e 20 70 std %i2, [ %i0 + 0x70 ] 2032ef4: 80 a0 40 02 cmp %g1, %g2 2032ef8: 32 80 00 08 bne,a 2032f18 <_Rate_monotonic_Update_statistics+0x84><== NEVER TAKEN 2032efc: c2 06 20 68 ld [ %i0 + 0x68 ], %g1 <== NOT EXECUTED 2032f00: c2 06 20 64 ld [ %i0 + 0x64 ], %g1 2032f04: 80 a0 40 03 cmp %g1, %g3 2032f08: 28 80 00 04 bleu,a 2032f18 <_Rate_monotonic_Update_statistics+0x84> 2032f0c: c2 06 20 68 ld [ %i0 + 0x68 ], %g1 stats->min_cpu_time = executed; 2032f10: c4 3e 20 60 std %g2, [ %i0 + 0x60 ] if ( _Timestamp_Greater_than( &executed, &stats->max_cpu_time ) ) 2032f14: c2 06 20 68 ld [ %i0 + 0x68 ], %g1 2032f18: 80 a0 40 02 cmp %g1, %g2 2032f1c: 26 80 00 0a bl,a 2032f44 <_Rate_monotonic_Update_statistics+0xb0><== NEVER TAKEN 2032f20: c4 3e 20 68 std %g2, [ %i0 + 0x68 ] <== NOT EXECUTED 2032f24: 80 a0 40 02 cmp %g1, %g2 2032f28: 32 80 00 08 bne,a 2032f48 <_Rate_monotonic_Update_statistics+0xb4><== NEVER TAKEN 2032f2c: c4 1f bf f8 ldd [ %fp + -8 ], %g2 <== NOT EXECUTED 2032f30: c2 06 20 6c ld [ %i0 + 0x6c ], %g1 2032f34: 80 a0 40 03 cmp %g1, %g3 2032f38: 3a 80 00 04 bcc,a 2032f48 <_Rate_monotonic_Update_statistics+0xb4> 2032f3c: c4 1f bf f8 ldd [ %fp + -8 ], %g2 stats->max_cpu_time = executed; 2032f40: 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 ); 2032f44: c4 1f bf f8 ldd [ %fp + -8 ], %g2 2032f48: f8 1e 20 88 ldd [ %i0 + 0x88 ], %i4 if ( _Timestamp_Less_than( &since_last_period, &stats->min_wall_time ) ) 2032f4c: c2 06 20 78 ld [ %i0 + 0x78 ], %g1 2032f50: b6 87 40 03 addcc %i5, %g3, %i3 2032f54: b4 47 00 02 addx %i4, %g2, %i2 2032f58: 80 a0 40 02 cmp %g1, %g2 2032f5c: 14 80 00 09 bg 2032f80 <_Rate_monotonic_Update_statistics+0xec> 2032f60: f4 3e 20 88 std %i2, [ %i0 + 0x88 ] 2032f64: 80 a0 40 02 cmp %g1, %g2 2032f68: 32 80 00 08 bne,a 2032f88 <_Rate_monotonic_Update_statistics+0xf4><== NEVER TAKEN 2032f6c: c2 06 20 80 ld [ %i0 + 0x80 ], %g1 <== NOT EXECUTED 2032f70: c2 06 20 7c ld [ %i0 + 0x7c ], %g1 2032f74: 80 a0 40 03 cmp %g1, %g3 2032f78: 28 80 00 04 bleu,a 2032f88 <_Rate_monotonic_Update_statistics+0xf4> 2032f7c: c2 06 20 80 ld [ %i0 + 0x80 ], %g1 stats->min_wall_time = since_last_period; 2032f80: c4 3e 20 78 std %g2, [ %i0 + 0x78 ] if ( _Timestamp_Greater_than( &since_last_period, &stats->max_wall_time ) ) 2032f84: c2 06 20 80 ld [ %i0 + 0x80 ], %g1 2032f88: 80 a0 40 02 cmp %g1, %g2 2032f8c: 26 80 00 09 bl,a 2032fb0 <_Rate_monotonic_Update_statistics+0x11c><== NEVER TAKEN 2032f90: c4 3e 20 80 std %g2, [ %i0 + 0x80 ] <== NOT EXECUTED 2032f94: 80 a0 40 02 cmp %g1, %g2 2032f98: 12 80 00 06 bne 2032fb0 <_Rate_monotonic_Update_statistics+0x11c><== NEVER TAKEN 2032f9c: 01 00 00 00 nop 2032fa0: c2 06 20 84 ld [ %i0 + 0x84 ], %g1 2032fa4: 80 a0 40 03 cmp %g1, %g3 2032fa8: 2a 80 00 02 bcs,a 2032fb0 <_Rate_monotonic_Update_statistics+0x11c> 2032fac: c4 3e 20 80 std %g2, [ %i0 + 0x80 ] 2032fb0: 81 c7 e0 08 ret 2032fb4: 81 e8 00 00 restore =============================================================================== 02009ff8 <_Scheduler_CBS_Allocate>: #include void *_Scheduler_CBS_Allocate( Thread_Control *the_thread ) { 2009ff8: 9d e3 bf a0 save %sp, -96, %sp void *sched; Scheduler_CBS_Per_thread *schinfo; sched = _Workspace_Allocate(sizeof(Scheduler_CBS_Per_thread)); 2009ffc: 40 00 06 bb call 200bae8 <_Workspace_Allocate> 200a000: 90 10 20 1c mov 0x1c, %o0 if ( sched ) { 200a004: 80 a2 20 00 cmp %o0, 0 200a008: 02 80 00 06 be 200a020 <_Scheduler_CBS_Allocate+0x28> <== NEVER TAKEN 200a00c: 82 10 20 02 mov 2, %g1 the_thread->scheduler_info = sched; 200a010: d0 26 20 88 st %o0, [ %i0 + 0x88 ] schinfo = (Scheduler_CBS_Per_thread *)(the_thread->scheduler_info); schinfo->edf_per_thread.thread = the_thread; 200a014: f0 22 00 00 st %i0, [ %o0 ] schinfo->edf_per_thread.queue_state = SCHEDULER_EDF_QUEUE_STATE_NEVER_HAS_BEEN; 200a018: c2 22 20 14 st %g1, [ %o0 + 0x14 ] schinfo->cbs_server = NULL; 200a01c: c0 22 20 18 clr [ %o0 + 0x18 ] } return sched; } 200a020: 81 c7 e0 08 ret 200a024: 91 e8 00 08 restore %g0, %o0, %o0 =============================================================================== 0200b338 <_Scheduler_CBS_Budget_callout>: Scheduler_CBS_Server **_Scheduler_CBS_Server_list; void _Scheduler_CBS_Budget_callout( Thread_Control *the_thread ) { 200b338: 9d e3 bf 98 save %sp, -104, %sp Priority_Control new_priority; Scheduler_CBS_Per_thread *sched_info; Scheduler_CBS_Server_id server_id; /* Put violating task to background until the end of period. */ new_priority = the_thread->Start.initial_priority; 200b33c: d2 06 20 ac ld [ %i0 + 0xac ], %o1 if ( the_thread->real_priority != new_priority ) 200b340: c2 06 20 18 ld [ %i0 + 0x18 ], %g1 200b344: 80 a0 40 09 cmp %g1, %o1 200b348: 32 80 00 02 bne,a 200b350 <_Scheduler_CBS_Budget_callout+0x18><== ALWAYS TAKEN 200b34c: d2 26 20 18 st %o1, [ %i0 + 0x18 ] the_thread->real_priority = new_priority; if ( the_thread->current_priority != new_priority ) 200b350: c2 06 20 14 ld [ %i0 + 0x14 ], %g1 200b354: 80 a0 40 09 cmp %g1, %o1 200b358: 02 80 00 04 be 200b368 <_Scheduler_CBS_Budget_callout+0x30><== NEVER TAKEN 200b35c: 90 10 00 18 mov %i0, %o0 _Thread_Change_priority(the_thread, new_priority, true); 200b360: 40 00 01 83 call 200b96c <_Thread_Change_priority> 200b364: 94 10 20 01 mov 1, %o2 /* Invoke callback function if any. */ sched_info = (Scheduler_CBS_Per_thread *) the_thread->scheduler_info; 200b368: fa 06 20 88 ld [ %i0 + 0x88 ], %i5 if ( sched_info->cbs_server->cbs_budget_overrun ) { 200b36c: c2 07 60 18 ld [ %i5 + 0x18 ], %g1 200b370: c4 00 60 0c ld [ %g1 + 0xc ], %g2 200b374: 80 a0 a0 00 cmp %g2, 0 200b378: 02 80 00 09 be 200b39c <_Scheduler_CBS_Budget_callout+0x64><== NEVER TAKEN 200b37c: 01 00 00 00 nop _Scheduler_CBS_Get_server_id( 200b380: d0 00 40 00 ld [ %g1 ], %o0 200b384: 7f ff ff d7 call 200b2e0 <_Scheduler_CBS_Get_server_id> 200b388: 92 07 bf fc add %fp, -4, %o1 sched_info->cbs_server->task_id, &server_id ); sched_info->cbs_server->cbs_budget_overrun( server_id ); 200b38c: c2 07 60 18 ld [ %i5 + 0x18 ], %g1 200b390: c2 00 60 0c ld [ %g1 + 0xc ], %g1 200b394: 9f c0 40 00 call %g1 200b398: d0 07 bf fc ld [ %fp + -4 ], %o0 200b39c: 81 c7 e0 08 ret 200b3a0: 81 e8 00 00 restore =============================================================================== 0200af40 <_Scheduler_CBS_Create_server>: int _Scheduler_CBS_Create_server ( Scheduler_CBS_Parameters *params, Scheduler_CBS_Budget_overrun budget_overrun_callback, rtems_id *server_id ) { 200af40: 9d e3 bf a0 save %sp, -96, %sp unsigned int i; Scheduler_CBS_Server *the_server; if ( params->budget <= 0 || 200af44: c2 06 20 04 ld [ %i0 + 4 ], %g1 200af48: 80 a0 60 00 cmp %g1, 0 200af4c: 04 80 00 1d ble 200afc0 <_Scheduler_CBS_Create_server+0x80> 200af50: 01 00 00 00 nop 200af54: c2 06 00 00 ld [ %i0 ], %g1 200af58: 80 a0 60 00 cmp %g1, 0 200af5c: 04 80 00 19 ble 200afc0 <_Scheduler_CBS_Create_server+0x80> 200af60: 03 00 80 80 sethi %hi(0x2020000), %g1 params->deadline <= 0 || params->budget >= SCHEDULER_EDF_PRIO_MSB || params->deadline >= SCHEDULER_EDF_PRIO_MSB ) return SCHEDULER_CBS_ERROR_INVALID_PARAMETER; for ( i = 0; i<_Scheduler_CBS_Maximum_servers; i++ ) { 200af64: c4 00 60 80 ld [ %g1 + 0x80 ], %g2 ! 2020080 <_Scheduler_CBS_Maximum_servers> if ( !_Scheduler_CBS_Server_list[i] ) 200af68: 03 00 80 84 sethi %hi(0x2021000), %g1 200af6c: c6 00 62 68 ld [ %g1 + 0x268 ], %g3 ! 2021268 <_Scheduler_CBS_Server_list> 200af70: 10 80 00 07 b 200af8c <_Scheduler_CBS_Create_server+0x4c> 200af74: 82 10 20 00 clr %g1 200af78: c8 00 c0 1c ld [ %g3 + %i4 ], %g4 200af7c: 80 a1 20 00 cmp %g4, 0 200af80: 02 80 00 14 be 200afd0 <_Scheduler_CBS_Create_server+0x90> 200af84: 3b 00 80 84 sethi %hi(0x2021000), %i5 params->deadline <= 0 || params->budget >= SCHEDULER_EDF_PRIO_MSB || params->deadline >= SCHEDULER_EDF_PRIO_MSB ) return SCHEDULER_CBS_ERROR_INVALID_PARAMETER; for ( i = 0; i<_Scheduler_CBS_Maximum_servers; i++ ) { 200af88: 82 00 60 01 inc %g1 200af8c: 80 a0 40 02 cmp %g1, %g2 200af90: 12 bf ff fa bne 200af78 <_Scheduler_CBS_Create_server+0x38> 200af94: b9 28 60 02 sll %g1, 2, %i4 if ( !_Scheduler_CBS_Server_list[i] ) break; } if ( i == _Scheduler_CBS_Maximum_servers ) return SCHEDULER_CBS_ERROR_FULL; 200af98: 81 c7 e0 08 ret 200af9c: 91 e8 3f e6 restore %g0, -26, %o0 _Workspace_Allocate( sizeof(Scheduler_CBS_Server) ); the_server = _Scheduler_CBS_Server_list[*server_id]; if ( !the_server ) return SCHEDULER_CBS_ERROR_NO_MEMORY; the_server->parameters = *params; 200afa0: c4 20 60 04 st %g2, [ %g1 + 4 ] 200afa4: c4 06 20 04 ld [ %i0 + 4 ], %g2 the_server->task_id = -1; the_server->cbs_budget_overrun = budget_overrun_callback; 200afa8: f2 20 60 0c st %i1, [ %g1 + 0xc ] _Workspace_Allocate( sizeof(Scheduler_CBS_Server) ); the_server = _Scheduler_CBS_Server_list[*server_id]; if ( !the_server ) return SCHEDULER_CBS_ERROR_NO_MEMORY; the_server->parameters = *params; 200afac: c4 20 60 08 st %g2, [ %g1 + 8 ] the_server->task_id = -1; 200afb0: 84 10 3f ff mov -1, %g2 200afb4: c4 20 40 00 st %g2, [ %g1 ] the_server->cbs_budget_overrun = budget_overrun_callback; return SCHEDULER_CBS_OK; 200afb8: 81 c7 e0 08 ret 200afbc: 91 e8 20 00 restore %g0, 0, %o0 if ( params->budget <= 0 || params->deadline <= 0 || params->budget >= SCHEDULER_EDF_PRIO_MSB || params->deadline >= SCHEDULER_EDF_PRIO_MSB ) return SCHEDULER_CBS_ERROR_INVALID_PARAMETER; 200afc0: 81 c7 e0 08 ret 200afc4: 91 e8 3f ee restore %g0, -18, %o0 *server_id = i; _Scheduler_CBS_Server_list[*server_id] = (Scheduler_CBS_Server *) _Workspace_Allocate( sizeof(Scheduler_CBS_Server) ); the_server = _Scheduler_CBS_Server_list[*server_id]; if ( !the_server ) return SCHEDULER_CBS_ERROR_NO_MEMORY; 200afc8: 81 c7 e0 08 ret <== NOT EXECUTED 200afcc: 91 e8 3f ef restore %g0, -17, %o0 <== NOT EXECUTED if ( i == _Scheduler_CBS_Maximum_servers ) return SCHEDULER_CBS_ERROR_FULL; *server_id = i; _Scheduler_CBS_Server_list[*server_id] = (Scheduler_CBS_Server *) 200afd0: f6 07 62 68 ld [ %i5 + 0x268 ], %i3 } if ( i == _Scheduler_CBS_Maximum_servers ) return SCHEDULER_CBS_ERROR_FULL; *server_id = i; 200afd4: c2 26 80 00 st %g1, [ %i2 ] _Scheduler_CBS_Server_list[*server_id] = (Scheduler_CBS_Server *) _Workspace_Allocate( sizeof(Scheduler_CBS_Server) ); 200afd8: 40 00 07 ad call 200ce8c <_Workspace_Allocate> 200afdc: 90 10 20 10 mov 0x10, %o0 the_server = _Scheduler_CBS_Server_list[*server_id]; 200afe0: c2 06 80 00 ld [ %i2 ], %g1 if ( i == _Scheduler_CBS_Maximum_servers ) return SCHEDULER_CBS_ERROR_FULL; *server_id = i; _Scheduler_CBS_Server_list[*server_id] = (Scheduler_CBS_Server *) 200afe4: d0 26 c0 1c st %o0, [ %i3 + %i4 ] _Workspace_Allocate( sizeof(Scheduler_CBS_Server) ); the_server = _Scheduler_CBS_Server_list[*server_id]; 200afe8: c4 07 62 68 ld [ %i5 + 0x268 ], %g2 200afec: 83 28 60 02 sll %g1, 2, %g1 200aff0: c2 00 80 01 ld [ %g2 + %g1 ], %g1 if ( !the_server ) 200aff4: 80 a0 60 00 cmp %g1, 0 200aff8: 32 bf ff ea bne,a 200afa0 <_Scheduler_CBS_Create_server+0x60><== ALWAYS TAKEN 200affc: c4 06 00 00 ld [ %i0 ], %g2 200b000: 30 bf ff f2 b,a 200afc8 <_Scheduler_CBS_Create_server+0x88><== NOT EXECUTED =============================================================================== 0200b078 <_Scheduler_CBS_Detach_thread>: int _Scheduler_CBS_Detach_thread ( Scheduler_CBS_Server_id server_id, rtems_id task_id ) { 200b078: 9d e3 bf 98 save %sp, -104, %sp Objects_Locations location; Thread_Control *the_thread; Scheduler_CBS_Per_thread *sched_info; the_thread = _Thread_Get(task_id, &location); 200b07c: 90 10 00 19 mov %i1, %o0 200b080: 40 00 03 79 call 200be64 <_Thread_Get> 200b084: 92 07 bf fc add %fp, -4, %o1 /* The routine _Thread_Get may disable dispatch and not enable again. */ if ( the_thread ) { 200b088: ba 92 20 00 orcc %o0, 0, %i5 200b08c: 02 80 00 05 be 200b0a0 <_Scheduler_CBS_Detach_thread+0x28> 200b090: 03 00 80 80 sethi %hi(0x2020000), %g1 _Thread_Enable_dispatch(); 200b094: 40 00 03 68 call 200be34 <_Thread_Enable_dispatch> 200b098: 01 00 00 00 nop } if ( server_id >= _Scheduler_CBS_Maximum_servers ) 200b09c: 03 00 80 80 sethi %hi(0x2020000), %g1 200b0a0: c2 00 60 80 ld [ %g1 + 0x80 ], %g1 ! 2020080 <_Scheduler_CBS_Maximum_servers> 200b0a4: 80 a6 00 01 cmp %i0, %g1 200b0a8: 1a 80 00 1b bcc 200b114 <_Scheduler_CBS_Detach_thread+0x9c> 200b0ac: 80 a7 60 00 cmp %i5, 0 return SCHEDULER_CBS_ERROR_INVALID_PARAMETER; if ( !the_thread ) 200b0b0: 02 80 00 19 be 200b114 <_Scheduler_CBS_Detach_thread+0x9c> 200b0b4: 03 00 80 84 sethi %hi(0x2021000), %g1 return SCHEDULER_CBS_ERROR_INVALID_PARAMETER; /* Server is not valid. */ if ( !_Scheduler_CBS_Server_list[server_id] ) 200b0b8: c2 00 62 68 ld [ %g1 + 0x268 ], %g1 ! 2021268 <_Scheduler_CBS_Server_list> 200b0bc: b1 2e 20 02 sll %i0, 2, %i0 200b0c0: c2 00 40 18 ld [ %g1 + %i0 ], %g1 200b0c4: 80 a0 60 00 cmp %g1, 0 200b0c8: 02 80 00 11 be 200b10c <_Scheduler_CBS_Detach_thread+0x94> 200b0cc: 01 00 00 00 nop return SCHEDULER_CBS_ERROR_NOSERVER; /* Thread and server are not attached. */ if ( _Scheduler_CBS_Server_list[server_id]->task_id != task_id ) 200b0d0: c4 00 40 00 ld [ %g1 ], %g2 200b0d4: 80 a0 80 19 cmp %g2, %i1 200b0d8: 12 80 00 0f bne 200b114 <_Scheduler_CBS_Detach_thread+0x9c><== NEVER TAKEN 200b0dc: 84 10 3f ff mov -1, %g2 return SCHEDULER_CBS_ERROR_INVALID_PARAMETER; _Scheduler_CBS_Server_list[server_id]->task_id = -1; 200b0e0: c4 20 40 00 st %g2, [ %g1 ] sched_info = (Scheduler_CBS_Per_thread *) the_thread->scheduler_info; sched_info->cbs_server = NULL; 200b0e4: c2 07 60 88 ld [ %i5 + 0x88 ], %g1 200b0e8: c0 20 60 18 clr [ %g1 + 0x18 ] the_thread->budget_algorithm = the_thread->Start.budget_algorithm; 200b0ec: c2 07 60 a0 ld [ %i5 + 0xa0 ], %g1 200b0f0: c2 27 60 78 st %g1, [ %i5 + 0x78 ] the_thread->budget_callout = the_thread->Start.budget_callout; 200b0f4: c2 07 60 a4 ld [ %i5 + 0xa4 ], %g1 200b0f8: c2 27 60 7c st %g1, [ %i5 + 0x7c ] the_thread->is_preemptible = the_thread->Start.is_preemptible; 200b0fc: c2 0f 60 9c ldub [ %i5 + 0x9c ], %g1 200b100: c2 2f 60 70 stb %g1, [ %i5 + 0x70 ] return SCHEDULER_CBS_OK; 200b104: 81 c7 e0 08 ret 200b108: 91 e8 20 00 restore %g0, 0, %o0 return SCHEDULER_CBS_ERROR_INVALID_PARAMETER; if ( !the_thread ) return SCHEDULER_CBS_ERROR_INVALID_PARAMETER; /* Server is not valid. */ if ( !_Scheduler_CBS_Server_list[server_id] ) return SCHEDULER_CBS_ERROR_NOSERVER; 200b10c: 81 c7 e0 08 ret 200b110: 91 e8 3f e7 restore %g0, -25, %o0 the_thread->budget_algorithm = the_thread->Start.budget_algorithm; the_thread->budget_callout = the_thread->Start.budget_callout; the_thread->is_preemptible = the_thread->Start.is_preemptible; return SCHEDULER_CBS_OK; } 200b114: 81 c7 e0 08 ret 200b118: 91 e8 3f ee restore %g0, -18, %o0 =============================================================================== 0200b3a4 <_Scheduler_CBS_Initialize>: } } int _Scheduler_CBS_Initialize(void) { 200b3a4: 9d e3 bf a0 save %sp, -96, %sp unsigned int i; _Scheduler_CBS_Server_list = (Scheduler_CBS_Server **) _Workspace_Allocate( _Scheduler_CBS_Maximum_servers * sizeof(Scheduler_CBS_Server*) ); 200b3a8: 3b 00 80 80 sethi %hi(0x2020000), %i5 200b3ac: d0 07 60 80 ld [ %i5 + 0x80 ], %o0 ! 2020080 <_Scheduler_CBS_Maximum_servers> } int _Scheduler_CBS_Initialize(void) { unsigned int i; _Scheduler_CBS_Server_list = (Scheduler_CBS_Server **) _Workspace_Allocate( 200b3b0: 40 00 06 b7 call 200ce8c <_Workspace_Allocate> 200b3b4: 91 2a 20 02 sll %o0, 2, %o0 200b3b8: 05 00 80 84 sethi %hi(0x2021000), %g2 _Scheduler_CBS_Maximum_servers * sizeof(Scheduler_CBS_Server*) ); if ( !_Scheduler_CBS_Server_list ) 200b3bc: 80 a2 20 00 cmp %o0, 0 200b3c0: 02 80 00 0d be 200b3f4 <_Scheduler_CBS_Initialize+0x50> <== NEVER TAKEN 200b3c4: d0 20 a2 68 st %o0, [ %g2 + 0x268 ] return SCHEDULER_CBS_ERROR_NO_MEMORY; for (i = 0; i<_Scheduler_CBS_Maximum_servers; i++) { 200b3c8: c6 07 60 80 ld [ %i5 + 0x80 ], %g3 200b3cc: 10 80 00 05 b 200b3e0 <_Scheduler_CBS_Initialize+0x3c> 200b3d0: 82 10 20 00 clr %g1 _Scheduler_CBS_Server_list[i] = NULL; 200b3d4: 89 28 60 02 sll %g1, 2, %g4 unsigned int i; _Scheduler_CBS_Server_list = (Scheduler_CBS_Server **) _Workspace_Allocate( _Scheduler_CBS_Maximum_servers * sizeof(Scheduler_CBS_Server*) ); if ( !_Scheduler_CBS_Server_list ) return SCHEDULER_CBS_ERROR_NO_MEMORY; for (i = 0; i<_Scheduler_CBS_Maximum_servers; i++) { 200b3d8: 82 00 60 01 inc %g1 _Scheduler_CBS_Server_list[i] = NULL; 200b3dc: c0 27 40 04 clr [ %i5 + %g4 ] unsigned int i; _Scheduler_CBS_Server_list = (Scheduler_CBS_Server **) _Workspace_Allocate( _Scheduler_CBS_Maximum_servers * sizeof(Scheduler_CBS_Server*) ); if ( !_Scheduler_CBS_Server_list ) return SCHEDULER_CBS_ERROR_NO_MEMORY; for (i = 0; i<_Scheduler_CBS_Maximum_servers; i++) { 200b3e0: 80 a0 40 03 cmp %g1, %g3 200b3e4: 12 bf ff fc bne 200b3d4 <_Scheduler_CBS_Initialize+0x30> 200b3e8: fa 00 a2 68 ld [ %g2 + 0x268 ], %i5 _Scheduler_CBS_Server_list[i] = NULL; } return SCHEDULER_CBS_OK; 200b3ec: 81 c7 e0 08 ret 200b3f0: 91 e8 20 00 restore %g0, 0, %o0 } 200b3f4: 81 c7 e0 08 ret <== NOT EXECUTED 200b3f8: 91 e8 3f ef restore %g0, -17, %o0 <== NOT EXECUTED =============================================================================== 0200a028 <_Scheduler_CBS_Release_job>: { Priority_Control new_priority; Scheduler_CBS_Per_thread *sched_info = (Scheduler_CBS_Per_thread *) the_thread->scheduler_info; Scheduler_CBS_Server *serv_info = (Scheduler_CBS_Server *) sched_info->cbs_server; 200a028: c2 02 20 88 ld [ %o0 + 0x88 ], %g1 if (deadline) { 200a02c: 80 a2 60 00 cmp %o1, 0 200a030: 02 80 00 10 be 200a070 <_Scheduler_CBS_Release_job+0x48> 200a034: c2 00 60 18 ld [ %g1 + 0x18 ], %g1 /* Initializing or shifting deadline. */ if (serv_info) 200a038: 80 a0 60 00 cmp %g1, 0 200a03c: 02 80 00 08 be 200a05c <_Scheduler_CBS_Release_job+0x34> 200a040: 05 00 80 7c sethi %hi(0x201f000), %g2 new_priority = (_Watchdog_Ticks_since_boot + serv_info->parameters.deadline) 200a044: d2 00 a2 bc ld [ %g2 + 0x2bc ], %o1 ! 201f2bc <_Watchdog_Ticks_since_boot> 200a048: c4 00 60 04 ld [ %g1 + 4 ], %g2 200a04c: 92 02 40 02 add %o1, %g2, %o1 200a050: 05 20 00 00 sethi %hi(0x80000000), %g2 200a054: 10 80 00 0a b 200a07c <_Scheduler_CBS_Release_job+0x54> 200a058: 92 2a 40 02 andn %o1, %g2, %o1 & ~SCHEDULER_EDF_PRIO_MSB; else new_priority = (_Watchdog_Ticks_since_boot + deadline) 200a05c: c2 00 a2 bc ld [ %g2 + 0x2bc ], %g1 200a060: 92 02 40 01 add %o1, %g1, %o1 200a064: 03 20 00 00 sethi %hi(0x80000000), %g1 200a068: 10 80 00 07 b 200a084 <_Scheduler_CBS_Release_job+0x5c> 200a06c: 92 2a 40 01 andn %o1, %g1, %o1 /* Switch back to background priority. */ new_priority = the_thread->Start.initial_priority; } /* Budget replenishment for the next job. */ if (serv_info) 200a070: 80 a0 60 00 cmp %g1, 0 200a074: 02 80 00 04 be 200a084 <_Scheduler_CBS_Release_job+0x5c> <== NEVER TAKEN 200a078: d2 02 20 ac ld [ %o0 + 0xac ], %o1 the_thread->cpu_time_budget = serv_info->parameters.budget; 200a07c: c2 00 60 08 ld [ %g1 + 8 ], %g1 200a080: c2 22 20 74 st %g1, [ %o0 + 0x74 ] the_thread->real_priority = new_priority; 200a084: d2 22 20 18 st %o1, [ %o0 + 0x18 ] _Thread_Change_priority(the_thread, new_priority, true); 200a088: 94 10 20 01 mov 1, %o2 200a08c: 82 13 c0 00 mov %o7, %g1 200a090: 40 00 01 26 call 200a528 <_Thread_Change_priority> 200a094: 9e 10 40 00 mov %g1, %o7 =============================================================================== 0200a098 <_Scheduler_CBS_Unblock>: #include void _Scheduler_CBS_Unblock( Thread_Control *the_thread ) { 200a098: 9d e3 bf a0 save %sp, -96, %sp Scheduler_CBS_Per_thread *sched_info; Scheduler_CBS_Server *serv_info; Priority_Control new_priority; _Scheduler_EDF_Enqueue(the_thread); 200a09c: 40 00 00 4c call 200a1cc <_Scheduler_EDF_Enqueue> 200a0a0: 90 10 00 18 mov %i0, %o0 /* TODO: flash critical section? */ sched_info = (Scheduler_CBS_Per_thread *) the_thread->scheduler_info; serv_info = (Scheduler_CBS_Server *) sched_info->cbs_server; 200a0a4: c2 06 20 88 ld [ %i0 + 0x88 ], %g1 200a0a8: fa 00 60 18 ld [ %g1 + 0x18 ], %i5 * Late unblock rule for deadline-driven tasks. The remaining time to * deadline must be sufficient to serve the remaining computation time * without increased utilization of this task. It might cause a deadline * miss of another task. */ if (serv_info) { 200a0ac: 80 a7 60 00 cmp %i5, 0 200a0b0: 02 80 00 18 be 200a110 <_Scheduler_CBS_Unblock+0x78> 200a0b4: 03 00 80 7c sethi %hi(0x201f000), %g1 time_t budget = serv_info->parameters.budget; time_t deadline_left = the_thread->cpu_time_budget; time_t budget_left = the_thread->real_priority - _Watchdog_Ticks_since_boot; if ( deadline*budget_left > budget*deadline_left ) { 200a0b8: 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 - 200a0bc: d0 00 62 bc ld [ %g1 + 0x2bc ], %o0 200a0c0: f8 06 20 18 ld [ %i0 + 0x18 ], %i4 _Watchdog_Ticks_since_boot; if ( deadline*budget_left > budget*deadline_left ) { 200a0c4: 40 00 3f 36 call 2019d9c <.umul> 200a0c8: 90 27 00 08 sub %i4, %o0, %o0 200a0cc: d2 06 20 74 ld [ %i0 + 0x74 ], %o1 200a0d0: b6 10 00 08 mov %o0, %i3 200a0d4: 40 00 3f 32 call 2019d9c <.umul> 200a0d8: d0 07 60 08 ld [ %i5 + 8 ], %o0 200a0dc: 80 a6 c0 08 cmp %i3, %o0 200a0e0: 24 80 00 0d ble,a 200a114 <_Scheduler_CBS_Unblock+0x7c> 200a0e4: 3b 00 80 7d sethi %hi(0x201f400), %i5 /* Put late unblocked task to background until the end of period. */ new_priority = the_thread->Start.initial_priority; 200a0e8: d2 06 20 ac ld [ %i0 + 0xac ], %o1 if ( the_thread->real_priority != new_priority ) 200a0ec: 80 a7 00 09 cmp %i4, %o1 200a0f0: 32 80 00 02 bne,a 200a0f8 <_Scheduler_CBS_Unblock+0x60> 200a0f4: d2 26 20 18 st %o1, [ %i0 + 0x18 ] the_thread->real_priority = new_priority; if ( the_thread->current_priority != new_priority ) 200a0f8: c2 06 20 14 ld [ %i0 + 0x14 ], %g1 200a0fc: 80 a0 40 09 cmp %g1, %o1 200a100: 02 80 00 04 be 200a110 <_Scheduler_CBS_Unblock+0x78> 200a104: 90 10 00 18 mov %i0, %o0 _Thread_Change_priority(the_thread, new_priority, true); 200a108: 40 00 01 08 call 200a528 <_Thread_Change_priority> 200a10c: 94 10 20 01 mov 1, %o2 * a context switch. * Pseudo-ISR case: * Even if the thread isn't preemptible, if the new heir is * a pseudo-ISR system task, we need to do a context switch. */ if ( _Scheduler_Is_priority_higher_than( the_thread->current_priority, 200a110: 3b 00 80 7d sethi %hi(0x201f400), %i5 200a114: ba 17 62 f0 or %i5, 0x2f0, %i5 ! 201f6f0 <_Per_CPU_Information> 200a118: c4 07 60 14 ld [ %i5 + 0x14 ], %g2 200a11c: 03 00 80 79 sethi %hi(0x201e400), %g1 200a120: d0 06 20 14 ld [ %i0 + 0x14 ], %o0 200a124: c2 00 61 64 ld [ %g1 + 0x164 ], %g1 200a128: 9f c0 40 00 call %g1 200a12c: d2 00 a0 14 ld [ %g2 + 0x14 ], %o1 200a130: 80 a2 20 00 cmp %o0, 0 200a134: 04 80 00 0f ble 200a170 <_Scheduler_CBS_Unblock+0xd8> 200a138: 01 00 00 00 nop _Thread_Heir->current_priority)) { _Thread_Heir = the_thread; if ( _Thread_Executing->is_preemptible || 200a13c: c2 07 60 10 ld [ %i5 + 0x10 ], %g1 * Even if the thread isn't preemptible, if the new heir is * a pseudo-ISR system task, we need to do a context switch. */ if ( _Scheduler_Is_priority_higher_than( the_thread->current_priority, _Thread_Heir->current_priority)) { _Thread_Heir = the_thread; 200a140: f0 27 60 14 st %i0, [ %i5 + 0x14 ] if ( _Thread_Executing->is_preemptible || 200a144: c2 08 60 70 ldub [ %g1 + 0x70 ], %g1 200a148: 80 a0 60 00 cmp %g1, 0 200a14c: 12 80 00 06 bne 200a164 <_Scheduler_CBS_Unblock+0xcc> 200a150: 84 10 20 01 mov 1, %g2 200a154: c2 06 20 14 ld [ %i0 + 0x14 ], %g1 200a158: 80 a0 60 00 cmp %g1, 0 200a15c: 12 80 00 05 bne 200a170 <_Scheduler_CBS_Unblock+0xd8> <== ALWAYS TAKEN 200a160: 01 00 00 00 nop the_thread->current_priority == 0 ) _Thread_Dispatch_necessary = true; 200a164: 03 00 80 7d sethi %hi(0x201f400), %g1 200a168: 82 10 62 f0 or %g1, 0x2f0, %g1 ! 201f6f0 <_Per_CPU_Information> 200a16c: c4 28 60 0c stb %g2, [ %g1 + 0xc ] 200a170: 81 c7 e0 08 ret 200a174: 81 e8 00 00 restore =============================================================================== 02009ff8 <_Scheduler_EDF_Allocate>: #include void *_Scheduler_EDF_Allocate( Thread_Control *the_thread ) { 2009ff8: 9d e3 bf a0 save %sp, -96, %sp void *sched; Scheduler_EDF_Per_thread *schinfo; sched = _Workspace_Allocate( sizeof(Scheduler_EDF_Per_thread) ); 2009ffc: 40 00 06 90 call 200ba3c <_Workspace_Allocate> 200a000: 90 10 20 18 mov 0x18, %o0 if ( sched ) { 200a004: 80 a2 20 00 cmp %o0, 0 200a008: 02 80 00 05 be 200a01c <_Scheduler_EDF_Allocate+0x24> <== NEVER TAKEN 200a00c: 82 10 20 02 mov 2, %g1 the_thread->scheduler_info = sched; 200a010: d0 26 20 88 st %o0, [ %i0 + 0x88 ] schinfo = (Scheduler_EDF_Per_thread *)(the_thread->scheduler_info); schinfo->thread = the_thread; 200a014: f0 22 00 00 st %i0, [ %o0 ] schinfo->queue_state = SCHEDULER_EDF_QUEUE_STATE_NEVER_HAS_BEEN; 200a018: c2 22 20 14 st %g1, [ %o0 + 0x14 ] } return sched; } 200a01c: 81 c7 e0 08 ret 200a020: 91 e8 00 08 restore %g0, %o0, %o0 =============================================================================== 0200a1c0 <_Scheduler_EDF_Unblock>: #include void _Scheduler_EDF_Unblock( Thread_Control *the_thread ) { 200a1c0: 9d e3 bf a0 save %sp, -96, %sp _Scheduler_EDF_Enqueue(the_thread); 200a1c4: 7f ff ff ad call 200a078 <_Scheduler_EDF_Enqueue> 200a1c8: 90 10 00 18 mov %i0, %o0 * a context switch. * Pseudo-ISR case: * Even if the thread isn't preemptible, if the new heir is * a pseudo-ISR system task, we need to do a context switch. */ if ( _Scheduler_Is_priority_lower_than( 200a1cc: 3b 00 80 7d sethi %hi(0x201f400), %i5 200a1d0: ba 17 62 30 or %i5, 0x230, %i5 ! 201f630 <_Per_CPU_Information> 200a1d4: c4 07 60 14 ld [ %i5 + 0x14 ], %g2 200a1d8: 03 00 80 79 sethi %hi(0x201e400), %g1 200a1dc: d0 00 a0 14 ld [ %g2 + 0x14 ], %o0 200a1e0: c2 00 60 b4 ld [ %g1 + 0xb4 ], %g1 200a1e4: 9f c0 40 00 call %g1 200a1e8: d2 06 20 14 ld [ %i0 + 0x14 ], %o1 200a1ec: 80 a2 20 00 cmp %o0, 0 200a1f0: 16 80 00 0f bge 200a22c <_Scheduler_EDF_Unblock+0x6c> 200a1f4: 01 00 00 00 nop _Thread_Heir->current_priority, the_thread->current_priority )) { _Thread_Heir = the_thread; if ( _Thread_Executing->is_preemptible || 200a1f8: c2 07 60 10 ld [ %i5 + 0x10 ], %g1 * a pseudo-ISR system task, we need to do a context switch. */ if ( _Scheduler_Is_priority_lower_than( _Thread_Heir->current_priority, the_thread->current_priority )) { _Thread_Heir = the_thread; 200a1fc: f0 27 60 14 st %i0, [ %i5 + 0x14 ] if ( _Thread_Executing->is_preemptible || 200a200: c2 08 60 70 ldub [ %g1 + 0x70 ], %g1 200a204: 80 a0 60 00 cmp %g1, 0 200a208: 12 80 00 06 bne 200a220 <_Scheduler_EDF_Unblock+0x60> 200a20c: 84 10 20 01 mov 1, %g2 200a210: c2 06 20 14 ld [ %i0 + 0x14 ], %g1 200a214: 80 a0 60 00 cmp %g1, 0 200a218: 12 80 00 05 bne 200a22c <_Scheduler_EDF_Unblock+0x6c> <== ALWAYS TAKEN 200a21c: 01 00 00 00 nop the_thread->current_priority == 0 ) _Thread_Dispatch_necessary = true; 200a220: 03 00 80 7d sethi %hi(0x201f400), %g1 200a224: 82 10 62 30 or %g1, 0x230, %g1 ! 201f630 <_Per_CPU_Information> 200a228: c4 28 60 0c stb %g2, [ %g1 + 0xc ] 200a22c: 81 c7 e0 08 ret 200a230: 81 e8 00 00 restore =============================================================================== 020098cc <_Scheduler_priority_Tick>: #include #include void _Scheduler_priority_Tick( void ) { 20098cc: 9d e3 bf a0 save %sp, -96, %sp Thread_Control *executing; executing = _Thread_Executing; 20098d0: 03 00 80 76 sethi %hi(0x201d800), %g1 20098d4: fa 00 63 00 ld [ %g1 + 0x300 ], %i5 ! 201db00 <_Per_CPU_Information+0x10> /* * If the thread is not preemptible or is not ready, then * just return. */ if ( !executing->is_preemptible ) 20098d8: c2 0f 60 70 ldub [ %i5 + 0x70 ], %g1 20098dc: 80 a0 60 00 cmp %g1, 0 20098e0: 02 80 00 25 be 2009974 <_Scheduler_priority_Tick+0xa8> 20098e4: 01 00 00 00 nop return; if ( !_States_Is_ready( executing->current_state ) ) 20098e8: c2 07 60 10 ld [ %i5 + 0x10 ], %g1 20098ec: 80 a0 60 00 cmp %g1, 0 20098f0: 12 80 00 21 bne 2009974 <_Scheduler_priority_Tick+0xa8> 20098f4: 01 00 00 00 nop /* * The cpu budget algorithm determines what happens next. */ switch ( executing->budget_algorithm ) { 20098f8: c2 07 60 78 ld [ %i5 + 0x78 ], %g1 20098fc: 80 a0 60 01 cmp %g1, 1 2009900: 0a 80 00 14 bcs 2009950 <_Scheduler_priority_Tick+0x84> 2009904: 80 a0 60 02 cmp %g1, 2 2009908: 28 80 00 07 bleu,a 2009924 <_Scheduler_priority_Tick+0x58> 200990c: c2 07 60 74 ld [ %i5 + 0x74 ], %g1 2009910: 80 a0 60 03 cmp %g1, 3 2009914: 12 80 00 18 bne 2009974 <_Scheduler_priority_Tick+0xa8> <== NEVER TAKEN 2009918: 01 00 00 00 nop } break; #if defined(RTEMS_SCORE_THREAD_ENABLE_SCHEDULER_CALLOUT) case THREAD_CPU_BUDGET_ALGORITHM_CALLOUT: if ( --executing->cpu_time_budget == 0 ) 200991c: 10 80 00 0f b 2009958 <_Scheduler_priority_Tick+0x8c> 2009920: c2 07 60 74 ld [ %i5 + 0x74 ], %g1 case THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE: #if defined(RTEMS_SCORE_THREAD_ENABLE_EXHAUST_TIMESLICE) case THREAD_CPU_BUDGET_ALGORITHM_EXHAUST_TIMESLICE: #endif if ( (int)(--executing->cpu_time_budget) <= 0 ) { 2009924: 82 00 7f ff add %g1, -1, %g1 2009928: 80 a0 60 00 cmp %g1, 0 200992c: 14 80 00 09 bg 2009950 <_Scheduler_priority_Tick+0x84> 2009930: c2 27 60 74 st %g1, [ %i5 + 0x74 ] * always operates on the scheduler that 'owns' the currently executing * thread. */ RTEMS_INLINE_ROUTINE void _Scheduler_Yield( void ) { _Scheduler.Operations.yield(); 2009934: 03 00 80 72 sethi %hi(0x201c800), %g1 2009938: c2 00 61 c0 ld [ %g1 + 0x1c0 ], %g1 ! 201c9c0 <_Scheduler+0xc> 200993c: 9f c0 40 00 call %g1 2009940: 01 00 00 00 nop * executing thread's timeslice is reset. Otherwise, the * currently executing thread is placed at the rear of the * FIFO for this priority and a new heir is selected. */ _Scheduler_Yield(); executing->cpu_time_budget = _Thread_Ticks_per_timeslice; 2009944: 03 00 80 75 sethi %hi(0x201d400), %g1 2009948: c2 00 61 30 ld [ %g1 + 0x130 ], %g1 ! 201d530 <_Thread_Ticks_per_timeslice> 200994c: c2 27 60 74 st %g1, [ %i5 + 0x74 ] 2009950: 81 c7 e0 08 ret 2009954: 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 ) 2009958: 82 00 7f ff add %g1, -1, %g1 200995c: 80 a0 60 00 cmp %g1, 0 2009960: 12 bf ff fc bne 2009950 <_Scheduler_priority_Tick+0x84> 2009964: c2 27 60 74 st %g1, [ %i5 + 0x74 ] (*executing->budget_callout)( executing ); 2009968: c2 07 60 7c ld [ %i5 + 0x7c ], %g1 200996c: 9f c0 40 00 call %g1 2009970: 90 10 00 1d mov %i5, %o0 2009974: 81 c7 e0 08 ret 2009978: 81 e8 00 00 restore =============================================================================== 02008490 <_TOD_Validate>: }; bool _TOD_Validate( const rtems_time_of_day *the_tod ) { 2008490: 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 / 2008494: 03 00 80 72 sethi %hi(0x201c800), %g1 2008498: d2 00 61 fc ld [ %g1 + 0x1fc ], %o1 ! 201c9fc 200849c: 11 00 03 d0 sethi %hi(0xf4000), %o0 20084a0: 40 00 48 86 call 201a6b8 <.udiv> 20084a4: 90 12 22 40 or %o0, 0x240, %o0 ! f4240 rtems_configuration_get_microseconds_per_tick(); if ((!the_tod) || 20084a8: 80 a6 20 00 cmp %i0, 0 20084ac: 02 80 00 28 be 200854c <_TOD_Validate+0xbc> <== NEVER TAKEN 20084b0: 84 10 20 00 clr %g2 20084b4: c2 06 20 18 ld [ %i0 + 0x18 ], %g1 20084b8: 80 a0 40 08 cmp %g1, %o0 20084bc: 3a 80 00 25 bcc,a 2008550 <_TOD_Validate+0xc0> 20084c0: b0 08 a0 01 and %g2, 1, %i0 (the_tod->ticks >= ticks_per_second) || 20084c4: c2 06 20 14 ld [ %i0 + 0x14 ], %g1 20084c8: 80 a0 60 3b cmp %g1, 0x3b 20084cc: 38 80 00 21 bgu,a 2008550 <_TOD_Validate+0xc0> 20084d0: b0 08 a0 01 and %g2, 1, %i0 (the_tod->second >= TOD_SECONDS_PER_MINUTE) || 20084d4: c2 06 20 10 ld [ %i0 + 0x10 ], %g1 20084d8: 80 a0 60 3b cmp %g1, 0x3b 20084dc: 38 80 00 1d bgu,a 2008550 <_TOD_Validate+0xc0> 20084e0: b0 08 a0 01 and %g2, 1, %i0 (the_tod->minute >= TOD_MINUTES_PER_HOUR) || 20084e4: c2 06 20 0c ld [ %i0 + 0xc ], %g1 20084e8: 80 a0 60 17 cmp %g1, 0x17 20084ec: 38 80 00 19 bgu,a 2008550 <_TOD_Validate+0xc0> 20084f0: b0 08 a0 01 and %g2, 1, %i0 (the_tod->hour >= TOD_HOURS_PER_DAY) || (the_tod->month == 0) || 20084f4: c2 06 20 04 ld [ %i0 + 4 ], %g1 rtems_configuration_get_microseconds_per_tick(); if ((!the_tod) || (the_tod->ticks >= ticks_per_second) || (the_tod->second >= TOD_SECONDS_PER_MINUTE) || (the_tod->minute >= TOD_MINUTES_PER_HOUR) || (the_tod->hour >= TOD_HOURS_PER_DAY) || 20084f8: 80 a0 60 00 cmp %g1, 0 20084fc: 02 80 00 14 be 200854c <_TOD_Validate+0xbc> <== NEVER TAKEN 2008500: 80 a0 60 0c cmp %g1, 0xc (the_tod->month == 0) || 2008504: 38 80 00 13 bgu,a 2008550 <_TOD_Validate+0xc0> 2008508: b0 08 a0 01 and %g2, 1, %i0 (the_tod->month > TOD_MONTHS_PER_YEAR) || (the_tod->year < TOD_BASE_YEAR) || 200850c: c8 06 00 00 ld [ %i0 ], %g4 (the_tod->ticks >= ticks_per_second) || (the_tod->second >= TOD_SECONDS_PER_MINUTE) || (the_tod->minute >= TOD_MINUTES_PER_HOUR) || (the_tod->hour >= TOD_HOURS_PER_DAY) || (the_tod->month == 0) || (the_tod->month > TOD_MONTHS_PER_YEAR) || 2008510: 80 a1 27 c3 cmp %g4, 0x7c3 2008514: 28 80 00 0f bleu,a 2008550 <_TOD_Validate+0xc0> 2008518: b0 08 a0 01 and %g2, 1, %i0 (the_tod->year < TOD_BASE_YEAR) || (the_tod->day == 0) ) 200851c: c6 06 20 08 ld [ %i0 + 8 ], %g3 (the_tod->second >= TOD_SECONDS_PER_MINUTE) || (the_tod->minute >= TOD_MINUTES_PER_HOUR) || (the_tod->hour >= TOD_HOURS_PER_DAY) || (the_tod->month == 0) || (the_tod->month > TOD_MONTHS_PER_YEAR) || (the_tod->year < TOD_BASE_YEAR) || 2008520: 80 a0 e0 00 cmp %g3, 0 2008524: 02 80 00 0a be 200854c <_TOD_Validate+0xbc> <== NEVER TAKEN 2008528: 80 89 20 03 btst 3, %g4 200852c: 05 00 80 76 sethi %hi(0x201d800), %g2 (the_tod->day == 0) ) return false; if ( (the_tod->year % 4) == 0 ) 2008530: 12 80 00 03 bne 200853c <_TOD_Validate+0xac> 2008534: 84 10 a3 f0 or %g2, 0x3f0, %g2 ! 201dbf0 <_TOD_Days_per_month> days_in_month = _TOD_Days_per_month[ 1 ][ the_tod->month ]; 2008538: 82 00 60 0d add %g1, 0xd, %g1 else days_in_month = _TOD_Days_per_month[ 0 ][ the_tod->month ]; 200853c: 83 28 60 02 sll %g1, 2, %g1 2008540: c2 00 80 01 ld [ %g2 + %g1 ], %g1 if ( the_tod->day > days_in_month ) 2008544: 80 a0 40 03 cmp %g1, %g3 2008548: 84 60 3f ff subx %g0, -1, %g2 return false; return true; } 200854c: b0 08 a0 01 and %g2, 1, %i0 2008550: 81 c7 e0 08 ret 2008554: 81 e8 00 00 restore =============================================================================== 02009b88 <_Thread_Change_priority>: void _Thread_Change_priority( Thread_Control *the_thread, Priority_Control new_priority, bool prepend_it ) { 2009b88: 9d e3 bf a0 save %sp, -96, %sp 2009b8c: ba 10 00 18 mov %i0, %i5 States_Control state, original_state; /* * Save original state */ original_state = the_thread->current_state; 2009b90: f0 06 20 10 ld [ %i0 + 0x10 ], %i0 /* * Set a transient state for the thread so it is pulled off the Ready chains. * This will prevent it from being scheduled no matter what happens in an * ISR. */ _Thread_Set_transient( the_thread ); 2009b94: 40 00 03 78 call 200a974 <_Thread_Set_transient> 2009b98: 90 10 00 1d mov %i5, %o0 /* * Do not bother recomputing all the priority related information if * we are not REALLY changing priority. */ if ( the_thread->current_priority != new_priority ) 2009b9c: c2 07 60 14 ld [ %i5 + 0x14 ], %g1 2009ba0: 80 a0 40 19 cmp %g1, %i1 2009ba4: 02 80 00 04 be 2009bb4 <_Thread_Change_priority+0x2c> 2009ba8: 90 10 00 1d mov %i5, %o0 _Thread_Set_priority( the_thread, new_priority ); 2009bac: 40 00 03 59 call 200a910 <_Thread_Set_priority> 2009bb0: 92 10 00 19 mov %i1, %o1 _ISR_Disable( level ); 2009bb4: 7f ff e2 84 call 20025c4 2009bb8: 01 00 00 00 nop 2009bbc: b6 10 00 08 mov %o0, %i3 /* * If the thread has more than STATES_TRANSIENT set, then it is blocked, * If it is blocked on a thread queue, then we need to requeue it. */ state = the_thread->current_state; 2009bc0: f8 07 60 10 ld [ %i5 + 0x10 ], %i4 if ( state != STATES_TRANSIENT ) { 2009bc4: 80 a7 20 04 cmp %i4, 4 2009bc8: 02 80 00 10 be 2009c08 <_Thread_Change_priority+0x80> 2009bcc: 82 0e 20 04 and %i0, 4, %g1 /* Only clear the transient state if it wasn't set already */ if ( ! _States_Is_transient( original_state ) ) 2009bd0: 80 a0 60 00 cmp %g1, 0 2009bd4: 12 80 00 03 bne 2009be0 <_Thread_Change_priority+0x58> <== NEVER TAKEN 2009bd8: 82 0f 3f fb and %i4, -5, %g1 the_thread->current_state = _States_Clear( STATES_TRANSIENT, state ); 2009bdc: c2 27 60 10 st %g1, [ %i5 + 0x10 ] _ISR_Enable( level ); 2009be0: 7f ff e2 7d call 20025d4 2009be4: 90 10 00 1b mov %i3, %o0 if ( _States_Is_waiting_on_thread_queue( state ) ) { 2009be8: 03 00 00 ef sethi %hi(0x3bc00), %g1 2009bec: 82 10 62 e0 or %g1, 0x2e0, %g1 ! 3bee0 2009bf0: 80 8f 00 01 btst %i4, %g1 2009bf4: 02 80 00 27 be 2009c90 <_Thread_Change_priority+0x108> 2009bf8: 01 00 00 00 nop _Thread_queue_Requeue( the_thread->Wait.queue, the_thread ); 2009bfc: f0 07 60 44 ld [ %i5 + 0x44 ], %i0 2009c00: 40 00 03 17 call 200a85c <_Thread_queue_Requeue> 2009c04: 93 e8 00 1d restore %g0, %i5, %o1 } return; } /* Only clear the transient state if it wasn't set already */ if ( ! _States_Is_transient( original_state ) ) { 2009c08: 80 a0 60 00 cmp %g1, 0 2009c0c: 12 80 00 0b bne 2009c38 <_Thread_Change_priority+0xb0> <== NEVER TAKEN 2009c10: 03 00 80 72 sethi %hi(0x201c800), %g1 * Interrupts are STILL disabled. * We now know the thread will be in the READY state when we remove * the TRANSIENT state. So we have to place it on the appropriate * Ready Queue with interrupts off. */ the_thread->current_state = _States_Clear( STATES_TRANSIENT, state ); 2009c14: c0 27 60 10 clr [ %i5 + 0x10 ] if ( prepend_it ) 2009c18: 80 a6 a0 00 cmp %i2, 0 2009c1c: 02 80 00 04 be 2009c2c <_Thread_Change_priority+0xa4> 2009c20: 82 10 61 b4 or %g1, 0x1b4, %g1 */ RTEMS_INLINE_ROUTINE void _Scheduler_Enqueue_first( Thread_Control *the_thread ) { _Scheduler.Operations.enqueue_first( the_thread ); 2009c24: 10 80 00 03 b 2009c30 <_Thread_Change_priority+0xa8> 2009c28: c2 00 60 28 ld [ %g1 + 0x28 ], %g1 */ RTEMS_INLINE_ROUTINE void _Scheduler_Enqueue( Thread_Control *the_thread ) { _Scheduler.Operations.enqueue( the_thread ); 2009c2c: c2 00 60 24 ld [ %g1 + 0x24 ], %g1 2009c30: 9f c0 40 00 call %g1 2009c34: 90 10 00 1d mov %i5, %o0 _Scheduler_Enqueue_first( the_thread ); else _Scheduler_Enqueue( the_thread ); } _ISR_Flash( level ); 2009c38: 7f ff e2 67 call 20025d4 2009c3c: 90 10 00 1b mov %i3, %o0 2009c40: 7f ff e2 61 call 20025c4 2009c44: 01 00 00 00 nop 2009c48: b0 10 00 08 mov %o0, %i0 * This kernel routine implements the scheduling decision logic for * the scheduler. It does NOT dispatch. */ RTEMS_INLINE_ROUTINE void _Scheduler_Schedule( void ) { _Scheduler.Operations.schedule(); 2009c4c: 03 00 80 72 sethi %hi(0x201c800), %g1 2009c50: c2 00 61 bc ld [ %g1 + 0x1bc ], %g1 ! 201c9bc <_Scheduler+0x8> 2009c54: 9f c0 40 00 call %g1 2009c58: 01 00 00 00 nop * is also the heir thread, and false otherwise. */ RTEMS_INLINE_ROUTINE bool _Thread_Is_executing_also_the_heir( void ) { return ( _Thread_Executing == _Thread_Heir ); 2009c5c: 03 00 80 76 sethi %hi(0x201d800), %g1 2009c60: 82 10 62 f0 or %g1, 0x2f0, %g1 ! 201daf0 <_Per_CPU_Information> * We altered the set of thread priorities. So let's figure out * who is the heir and if we need to switch to them. */ _Scheduler_Schedule(); if ( !_Thread_Is_executing_also_the_heir() && 2009c64: c4 18 60 10 ldd [ %g1 + 0x10 ], %g2 2009c68: 80 a0 80 03 cmp %g2, %g3 2009c6c: 02 80 00 07 be 2009c88 <_Thread_Change_priority+0x100> 2009c70: 01 00 00 00 nop 2009c74: c4 08 a0 70 ldub [ %g2 + 0x70 ], %g2 2009c78: 80 a0 a0 00 cmp %g2, 0 2009c7c: 02 80 00 03 be 2009c88 <_Thread_Change_priority+0x100> 2009c80: 84 10 20 01 mov 1, %g2 _Thread_Executing->is_preemptible ) _Thread_Dispatch_necessary = true; 2009c84: c4 28 60 0c stb %g2, [ %g1 + 0xc ] _ISR_Enable( level ); 2009c88: 7f ff e2 53 call 20025d4 2009c8c: 81 e8 00 00 restore 2009c90: 81 c7 e0 08 ret 2009c94: 81 e8 00 00 restore =============================================================================== 02009e78 <_Thread_Delay_ended>: void _Thread_Delay_ended( Objects_Id id, void *ignored __attribute__((unused)) ) { 2009e78: 9d e3 bf 98 save %sp, -104, %sp Thread_Control *the_thread; Objects_Locations location; the_thread = _Thread_Get( id, &location ); 2009e7c: 90 10 00 18 mov %i0, %o0 2009e80: 40 00 00 80 call 200a080 <_Thread_Get> 2009e84: 92 07 bf fc add %fp, -4, %o1 switch ( location ) { 2009e88: c2 07 bf fc ld [ %fp + -4 ], %g1 2009e8c: 80 a0 60 00 cmp %g1, 0 2009e90: 12 80 00 08 bne 2009eb0 <_Thread_Delay_ended+0x38> <== NEVER TAKEN 2009e94: 13 04 00 00 sethi %hi(0x10000000), %o1 #if defined(RTEMS_MULTIPROCESSING) case OBJECTS_REMOTE: /* impossible */ #endif break; case OBJECTS_LOCAL: _Thread_Clear_state( 2009e98: 7f ff ff 80 call 2009c98 <_Thread_Clear_state> 2009e9c: 92 12 60 18 or %o1, 0x18, %o1 ! 10000018 * * This routine decrements the thread dispatch level. */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_decrement_disable_level(void) { uint32_t level = _Thread_Dispatch_disable_level; 2009ea0: 03 00 80 75 sethi %hi(0x201d400), %g1 2009ea4: c4 00 61 d0 ld [ %g1 + 0x1d0 ], %g2 ! 201d5d0 <_Thread_Dispatch_disable_level> --level; 2009ea8: 84 00 bf ff add %g2, -1, %g2 _Thread_Dispatch_disable_level = level; 2009eac: c4 20 61 d0 st %g2, [ %g1 + 0x1d0 ] 2009eb0: 81 c7 e0 08 ret 2009eb4: 81 e8 00 00 restore =============================================================================== 02009eb8 <_Thread_Dispatch>: #if defined(RTEMS_SMP) #include #endif void _Thread_Dispatch( void ) { 2009eb8: 9d e3 bf 98 save %sp, -104, %sp #endif /* * Now determine if we need to perform a dispatch on the current CPU. */ executing = _Thread_Executing; 2009ebc: 35 00 80 76 sethi %hi(0x201d800), %i2 2009ec0: 82 16 a2 f0 or %i2, 0x2f0, %g1 ! 201daf0 <_Per_CPU_Information> _ISR_Disable( level ); 2009ec4: 7f ff e1 c0 call 20025c4 2009ec8: f6 00 60 10 ld [ %g1 + 0x10 ], %i3 */ static inline void _TOD_Get_uptime( Timestamp_Control *time ) { _TOD_Get_with_nanoseconds( time, &_TOD.uptime ); 2009ecc: 21 00 80 75 sethi %hi(0x201d400), %l0 { const Chain_Control *chain = &_User_extensions_Switches_list; const Chain_Node *tail = _Chain_Immutable_tail( chain ); const Chain_Node *node = _Chain_Immutable_first( chain ); while ( node != tail ) { 2009ed0: 27 00 80 72 sethi %hi(0x201c800), %l3 * This routine sets thread dispatch level to the * value passed in. */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_set_disable_level(uint32_t value) { _Thread_Dispatch_disable_level = value; 2009ed4: 33 00 80 75 sethi %hi(0x201d400), %i1 #if __RTEMS_ADA__ executing->rtems_ada_self = rtems_ada_self; rtems_ada_self = heir->rtems_ada_self; #endif if ( heir->budget_algorithm == THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE ) heir->cpu_time_budget = _Thread_Ticks_per_timeslice; 2009ed8: 31 00 80 75 sethi %hi(0x201d400), %i0 2009edc: a0 14 21 20 or %l0, 0x120, %l0 #endif /* * Switch libc's task specific data. */ if ( _Thread_libc_reent ) { 2009ee0: 23 00 80 75 sethi %hi(0x201d400), %l1 */ RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_first( const Chain_Control *the_chain ) { return _Chain_Immutable_head( the_chain )->next; 2009ee4: 25 00 80 72 sethi %hi(0x201c800), %l2 /* * Now determine if we need to perform a dispatch on the current CPU. */ executing = _Thread_Executing; _ISR_Disable( level ); while ( _Thread_Dispatch_necessary == true ) { 2009ee8: 10 80 00 4b b 200a014 <_Thread_Dispatch+0x15c> 2009eec: a6 14 e3 8c or %l3, 0x38c, %l3 2009ef0: 84 10 20 01 mov 1, %g2 2009ef4: c4 26 61 d0 st %g2, [ %i1 + 0x1d0 ] heir = _Thread_Heir; #ifndef RTEMS_SMP _Thread_Dispatch_set_disable_level( 1 ); #endif _Thread_Dispatch_necessary = false; 2009ef8: c0 28 60 0c clrb [ %g1 + 0xc ] /* * When the heir and executing are the same, then we are being * requested to do the post switch dispatching. This is normally * done to dispatch signals. */ if ( heir == executing ) 2009efc: 80 a5 00 1b cmp %l4, %i3 2009f00: 12 80 00 0a bne 2009f28 <_Thread_Dispatch+0x70> 2009f04: e8 20 60 10 st %l4, [ %g1 + 0x10 ] 2009f08: 03 00 80 75 sethi %hi(0x201d400), %g1 2009f0c: c0 20 61 d0 clr [ %g1 + 0x1d0 ] ! 201d5d0 <_Thread_Dispatch_disable_level> post_switch: #ifndef RTEMS_SMP _Thread_Dispatch_set_disable_level( 0 ); #endif _ISR_Enable( level ); 2009f10: 7f ff e1 b1 call 20025d4 2009f14: 39 00 80 75 sethi %hi(0x201d400), %i4 2009f18: 03 00 80 75 sethi %hi(0x201d400), %g1 2009f1c: fa 00 62 44 ld [ %g1 + 0x244 ], %i5 ! 201d644 <_API_extensions_Post_switch_list> { const Chain_Control *chain = &_API_extensions_Post_switch_list; const Chain_Node *tail = _Chain_Immutable_tail( chain ); const Chain_Node *node = _Chain_Immutable_first( chain ); while ( node != tail ) { 2009f20: 10 80 00 47 b 200a03c <_Thread_Dispatch+0x184> 2009f24: b8 17 22 48 or %i4, 0x248, %i4 */ #if __RTEMS_ADA__ executing->rtems_ada_self = rtems_ada_self; rtems_ada_self = heir->rtems_ada_self; #endif if ( heir->budget_algorithm == THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE ) 2009f28: c2 05 20 78 ld [ %l4 + 0x78 ], %g1 2009f2c: 80 a0 60 01 cmp %g1, 1 2009f30: 12 80 00 03 bne 2009f3c <_Thread_Dispatch+0x84> 2009f34: c2 06 21 30 ld [ %i0 + 0x130 ], %g1 heir->cpu_time_budget = _Thread_Ticks_per_timeslice; 2009f38: c2 25 20 74 st %g1, [ %l4 + 0x74 ] _ISR_Enable( level ); 2009f3c: 7f ff e1 a6 call 20025d4 2009f40: 01 00 00 00 nop 2009f44: 90 07 bf f8 add %fp, -8, %o0 2009f48: 7f ff f9 b9 call 200862c <_TOD_Get_with_nanoseconds> 2009f4c: 92 10 00 10 mov %l0, %o1 #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ { Timestamp_Control uptime, ran; _TOD_Get_uptime( &uptime ); _Timestamp_Subtract( 2009f50: c4 1f bf f8 ldd [ %fp + -8 ], %g2 2009f54: 82 16 a2 f0 or %i2, 0x2f0, %g1 const Timestamp64_Control *_start, const Timestamp64_Control *_end, Timestamp64_Control *_result ) { *_result = *_end - *_start; 2009f58: f8 18 60 20 ldd [ %g1 + 0x20 ], %i4 2009f5c: 96 a0 c0 1d subcc %g3, %i5, %o3 2009f60: 94 60 80 1c subx %g2, %i4, %o2 static inline void _Timestamp64_implementation_Add_to( Timestamp64_Control *_time, const Timestamp64_Control *_add ) { *_time += *_add; 2009f64: f8 1e e0 80 ldd [ %i3 + 0x80 ], %i4 2009f68: 9a 87 40 0b addcc %i5, %o3, %o5 2009f6c: 98 47 00 0a addx %i4, %o2, %o4 2009f70: d8 3e e0 80 std %o4, [ %i3 + 0x80 ] &_Thread_Time_of_last_context_switch, &uptime, &ran ); _Timestamp_Add_to( &executing->cpu_time_used, &ran ); _Thread_Time_of_last_context_switch = uptime; 2009f74: c4 38 60 20 std %g2, [ %g1 + 0x20 ] #endif /* * Switch libc's task specific data. */ if ( _Thread_libc_reent ) { 2009f78: c2 04 62 40 ld [ %l1 + 0x240 ], %g1 2009f7c: 80 a0 60 00 cmp %g1, 0 2009f80: 22 80 00 0c be,a 2009fb0 <_Thread_Dispatch+0xf8> <== NEVER TAKEN 2009f84: fa 04 a3 88 ld [ %l2 + 0x388 ], %i5 <== NOT EXECUTED executing->libc_reent = *_Thread_libc_reent; 2009f88: c4 00 40 00 ld [ %g1 ], %g2 2009f8c: c4 26 e1 54 st %g2, [ %i3 + 0x154 ] *_Thread_libc_reent = heir->libc_reent; 2009f90: c4 05 21 54 ld [ %l4 + 0x154 ], %g2 2009f94: c4 20 40 00 st %g2, [ %g1 ] 2009f98: 10 80 00 06 b 2009fb0 <_Thread_Dispatch+0xf8> 2009f9c: fa 04 a3 88 ld [ %l2 + 0x388 ], %i5 const User_extensions_Switch_control *extension = (const User_extensions_Switch_control *) node; (*extension->thread_switch)( executing, heir ); 2009fa0: 90 10 00 1b mov %i3, %o0 2009fa4: 9f c0 40 00 call %g1 2009fa8: 92 10 00 14 mov %l4, %o1 */ RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_next( const Chain_Node *the_node ) { return the_node->next; 2009fac: fa 07 40 00 ld [ %i5 ], %i5 { const Chain_Control *chain = &_User_extensions_Switches_list; const Chain_Node *tail = _Chain_Immutable_tail( chain ); const Chain_Node *node = _Chain_Immutable_first( chain ); while ( node != tail ) { 2009fb0: 80 a7 40 13 cmp %i5, %l3 2009fb4: 32 bf ff fb bne,a 2009fa0 <_Thread_Dispatch+0xe8> 2009fb8: c2 07 60 08 ld [ %i5 + 8 ], %g1 if ( executing->fp_context != NULL ) _Context_Save_fp( &executing->fp_context ); #endif #endif _Context_Switch( &executing->Registers, &heir->Registers ); 2009fbc: 90 06 e0 c8 add %i3, 0xc8, %o0 2009fc0: 40 00 04 90 call 200b200 <_CPU_Context_switch> 2009fc4: 92 05 20 c8 add %l4, 0xc8, %o1 #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) #if ( CPU_USE_DEFERRED_FP_SWITCH == TRUE ) if ( (executing->fp_context != NULL) && 2009fc8: c2 06 e1 50 ld [ %i3 + 0x150 ], %g1 2009fcc: 80 a0 60 00 cmp %g1, 0 2009fd0: 02 80 00 0e be 200a008 <_Thread_Dispatch+0x150> 2009fd4: 03 00 80 75 sethi %hi(0x201d400), %g1 #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) RTEMS_INLINE_ROUTINE bool _Thread_Is_allocated_fp ( const Thread_Control *the_thread ) { return ( the_thread == _Thread_Allocated_fp ); 2009fd8: d0 00 62 3c ld [ %g1 + 0x23c ], %o0 ! 201d63c <_Thread_Allocated_fp> 2009fdc: 80 a6 c0 08 cmp %i3, %o0 2009fe0: 02 80 00 0a be 200a008 <_Thread_Dispatch+0x150> 2009fe4: 80 a2 20 00 cmp %o0, 0 !_Thread_Is_allocated_fp( executing ) ) { if ( _Thread_Allocated_fp != NULL ) 2009fe8: 02 80 00 04 be 2009ff8 <_Thread_Dispatch+0x140> 2009fec: 01 00 00 00 nop _Context_Save_fp( &_Thread_Allocated_fp->fp_context ); 2009ff0: 40 00 04 4a call 200b118 <_CPU_Context_save_fp> 2009ff4: 90 02 21 50 add %o0, 0x150, %o0 _Context_Restore_fp( &executing->fp_context ); 2009ff8: 40 00 04 65 call 200b18c <_CPU_Context_restore_fp> 2009ffc: 90 06 e1 50 add %i3, 0x150, %o0 _Thread_Allocated_fp = executing; 200a000: 03 00 80 75 sethi %hi(0x201d400), %g1 200a004: f6 20 62 3c st %i3, [ %g1 + 0x23c ] ! 201d63c <_Thread_Allocated_fp> if ( executing->fp_context != NULL ) _Context_Restore_fp( &executing->fp_context ); #endif #endif executing = _Thread_Executing; 200a008: 82 16 a2 f0 or %i2, 0x2f0, %g1 _ISR_Disable( level ); 200a00c: 7f ff e1 6e call 20025c4 200a010: f6 00 60 10 ld [ %g1 + 0x10 ], %i3 /* * Now determine if we need to perform a dispatch on the current CPU. */ executing = _Thread_Executing; _ISR_Disable( level ); while ( _Thread_Dispatch_necessary == true ) { 200a014: 82 16 a2 f0 or %i2, 0x2f0, %g1 200a018: c4 08 60 0c ldub [ %g1 + 0xc ], %g2 200a01c: 80 a0 a0 00 cmp %g2, 0 200a020: 32 bf ff b4 bne,a 2009ef0 <_Thread_Dispatch+0x38> 200a024: e8 00 60 14 ld [ %g1 + 0x14 ], %l4 * This routine sets thread dispatch level to the * value passed in. */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_set_disable_level(uint32_t value) { _Thread_Dispatch_disable_level = value; 200a028: 10 bf ff b9 b 2009f0c <_Thread_Dispatch+0x54> 200a02c: 03 00 80 75 sethi %hi(0x201d400), %g1 const API_extensions_Post_switch_control *post_switch = (const API_extensions_Post_switch_control *) node; (*post_switch->hook)( executing ); 200a030: 9f c0 40 00 call %g1 200a034: 90 10 00 1b mov %i3, %o0 200a038: fa 07 40 00 ld [ %i5 ], %i5 { const Chain_Control *chain = &_API_extensions_Post_switch_list; const Chain_Node *tail = _Chain_Immutable_tail( chain ); const Chain_Node *node = _Chain_Immutable_first( chain ); while ( node != tail ) { 200a03c: 80 a7 40 1c cmp %i5, %i4 200a040: 32 bf ff fc bne,a 200a030 <_Thread_Dispatch+0x178> 200a044: c2 07 60 08 ld [ %i5 + 8 ], %g1 #ifdef RTEMS_SMP _Thread_Unnest_dispatch(); #endif _API_extensions_Run_post_switch( executing ); } 200a048: 81 c7 e0 08 ret 200a04c: 81 e8 00 00 restore =============================================================================== 0200f410 <_Thread_Handler>: #define INIT_NAME __main #define EXECUTE_GLOBAL_CONSTRUCTORS #endif void _Thread_Handler( void ) { 200f410: 9d e3 bf a0 save %sp, -96, %sp #if defined(EXECUTE_GLOBAL_CONSTRUCTORS) static bool doneConstructors; bool doCons; #endif executing = _Thread_Executing; 200f414: 03 00 80 76 sethi %hi(0x201d800), %g1 200f418: fa 00 63 00 ld [ %g1 + 0x300 ], %i5 ! 201db00 <_Per_CPU_Information+0x10> /* * Some CPUs need to tinker with the call frame or registers when the * thread actually begins to execute for the first time. This is a * hook point where the port gets a shot at doing whatever it requires. */ _Context_Initialization_at_thread_begin(); 200f41c: 3f 00 80 3d sethi %hi(0x200f400), %i7 200f420: be 17 e0 10 or %i7, 0x10, %i7 ! 200f410 <_Thread_Handler> /* * have to put level into a register for those cpu's that use * inline asm here */ level = executing->Start.isr_level; 200f424: d0 07 60 a8 ld [ %i5 + 0xa8 ], %o0 _ISR_Set_level(level); 200f428: 7f ff cc 6b call 20025d4 200f42c: 91 2a 20 08 sll %o0, 8, %o0 doCons = !doneConstructors && _Objects_Get_API( executing->Object.id ) != OBJECTS_INTERNAL_API; if (doCons) doneConstructors = true; #else doCons = !doneConstructors; 200f430: 03 00 80 74 sethi %hi(0x201d000), %g1 doneConstructors = true; 200f434: 84 10 20 01 mov 1, %g2 doCons = !doneConstructors && _Objects_Get_API( executing->Object.id ) != OBJECTS_INTERNAL_API; if (doCons) doneConstructors = true; #else doCons = !doneConstructors; 200f438: f8 08 62 d0 ldub [ %g1 + 0x2d0 ], %i4 doneConstructors = true; 200f43c: c4 28 62 d0 stb %g2, [ %g1 + 0x2d0 ] #endif #endif #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) #if ( CPU_USE_DEFERRED_FP_SWITCH == TRUE ) if ( (executing->fp_context != NULL) && 200f440: c2 07 61 50 ld [ %i5 + 0x150 ], %g1 200f444: 80 a0 60 00 cmp %g1, 0 200f448: 02 80 00 0c be 200f478 <_Thread_Handler+0x68> 200f44c: 03 00 80 75 sethi %hi(0x201d400), %g1 #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) RTEMS_INLINE_ROUTINE bool _Thread_Is_allocated_fp ( const Thread_Control *the_thread ) { return ( the_thread == _Thread_Allocated_fp ); 200f450: d0 00 62 3c ld [ %g1 + 0x23c ], %o0 ! 201d63c <_Thread_Allocated_fp> 200f454: 80 a7 40 08 cmp %i5, %o0 200f458: 02 80 00 08 be 200f478 <_Thread_Handler+0x68> 200f45c: 80 a2 20 00 cmp %o0, 0 !_Thread_Is_allocated_fp( executing ) ) { if ( _Thread_Allocated_fp != NULL ) 200f460: 22 80 00 06 be,a 200f478 <_Thread_Handler+0x68> 200f464: fa 20 62 3c st %i5, [ %g1 + 0x23c ] _Context_Save_fp( &_Thread_Allocated_fp->fp_context ); 200f468: 7f ff ef 2c call 200b118 <_CPU_Context_save_fp> 200f46c: 90 02 21 50 add %o0, 0x150, %o0 _Thread_Allocated_fp = executing; 200f470: 03 00 80 75 sethi %hi(0x201d400), %g1 200f474: fa 20 62 3c st %i5, [ %g1 + 0x23c ] ! 201d63c <_Thread_Allocated_fp> ); } static inline void _User_extensions_Thread_begin( Thread_Control *executing ) { _User_extensions_Iterate( 200f478: 90 10 00 1d mov %i5, %o0 200f47c: 13 00 80 2a sethi %hi(0x200a800), %o1 200f480: 7f ff ed d9 call 200abe4 <_User_extensions_Iterate> 200f484: 92 12 63 70 or %o1, 0x370, %o1 ! 200ab70 <_User_extensions_Thread_begin_visitor> _User_extensions_Thread_begin( executing ); /* * At this point, the dispatch disable level BETTER be 1. */ _Thread_Enable_dispatch(); 200f488: 7f ff ea f2 call 200a050 <_Thread_Enable_dispatch> 200f48c: 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) */ { 200f490: 80 8f 20 ff btst 0xff, %i4 200f494: 32 80 00 05 bne,a 200f4a8 <_Thread_Handler+0x98> 200f498: c2 07 60 90 ld [ %i5 + 0x90 ], %g1 INIT_NAME (); 200f49c: 40 00 35 11 call 201c8e0 <_init> 200f4a0: 01 00 00 00 nop _Thread_Enable_dispatch(); #endif } #endif if ( executing->Start.prototype == THREAD_START_NUMERIC ) { 200f4a4: c2 07 60 90 ld [ %i5 + 0x90 ], %g1 200f4a8: 80 a0 60 00 cmp %g1, 0 200f4ac: 12 80 00 05 bne 200f4c0 <_Thread_Handler+0xb0> 200f4b0: 80 a0 60 01 cmp %g1, 1 executing->Wait.return_argument = (*(Thread_Entry_numeric) executing->Start.entry_point)( 200f4b4: c2 07 60 8c ld [ %i5 + 0x8c ], %g1 200f4b8: 10 80 00 06 b 200f4d0 <_Thread_Handler+0xc0> 200f4bc: 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 ) { 200f4c0: 12 80 00 08 bne 200f4e0 <_Thread_Handler+0xd0> <== NEVER TAKEN 200f4c4: 90 10 00 1d mov %i5, %o0 executing->Wait.return_argument = (*(Thread_Entry_pointer) executing->Start.entry_point)( 200f4c8: c2 07 60 8c ld [ %i5 + 0x8c ], %g1 200f4cc: d0 07 60 94 ld [ %i5 + 0x94 ], %o0 200f4d0: 9f c0 40 00 call %g1 200f4d4: 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 = 200f4d8: d0 27 60 28 st %o0, [ %i5 + 0x28 ] } } static inline void _User_extensions_Thread_exitted( Thread_Control *executing ) { _User_extensions_Iterate( 200f4dc: 90 10 00 1d mov %i5, %o0 200f4e0: 13 00 80 2a sethi %hi(0x200a800), %o1 200f4e4: 7f ff ed c0 call 200abe4 <_User_extensions_Iterate> 200f4e8: 92 12 63 94 or %o1, 0x394, %o1 ! 200ab94 <_User_extensions_Thread_exitted_visitor> * able to fit in a (void *). */ _User_extensions_Thread_exitted( executing ); _Internal_error_Occurred( 200f4ec: 90 10 20 00 clr %o0 200f4f0: 92 10 20 01 mov 1, %o1 200f4f4: 7f ff e5 82 call 2008afc <_Internal_error_Occurred> 200f4f8: 94 10 20 05 mov 5, %o2 =============================================================================== 0200a33c <_Thread_Handler_initialization>: #if defined(RTEMS_SMP) #include #endif void _Thread_Handler_initialization(void) { 200a33c: 9d e3 bf 98 save %sp, -104, %sp uint32_t ticks_per_timeslice = 200a340: 03 00 80 69 sethi %hi(0x201a400), %g1 200a344: 82 10 63 78 or %g1, 0x378, %g1 ! 201a778 #if defined(RTEMS_MULTIPROCESSING) uint32_t maximum_proxies = _Configuration_MP_table->maximum_proxies; #endif if ( rtems_configuration_get_stack_allocate_hook() == NULL || 200a348: c6 00 60 28 ld [ %g1 + 0x28 ], %g3 #include #endif void _Thread_Handler_initialization(void) { uint32_t ticks_per_timeslice = 200a34c: fa 00 60 14 ld [ %g1 + 0x14 ], %i5 rtems_configuration_get_ticks_per_timeslice(); uint32_t maximum_extensions = 200a350: f8 00 60 08 ld [ %g1 + 8 ], %i4 #if defined(RTEMS_MULTIPROCESSING) uint32_t maximum_proxies = _Configuration_MP_table->maximum_proxies; #endif if ( rtems_configuration_get_stack_allocate_hook() == NULL || 200a354: 80 a0 e0 00 cmp %g3, 0 200a358: 02 80 00 06 be 200a370 <_Thread_Handler_initialization+0x34><== NEVER TAKEN 200a35c: c4 00 60 24 ld [ %g1 + 0x24 ], %g2 200a360: c6 00 60 2c ld [ %g1 + 0x2c ], %g3 200a364: 80 a0 e0 00 cmp %g3, 0 200a368: 12 80 00 06 bne 200a380 <_Thread_Handler_initialization+0x44> 200a36c: 80 a0 a0 00 cmp %g2, 0 rtems_configuration_get_stack_free_hook() == NULL) _Internal_error_Occurred( 200a370: 90 10 20 00 clr %o0 200a374: 92 10 20 01 mov 1, %o1 200a378: 7f ff f9 e1 call 2008afc <_Internal_error_Occurred> 200a37c: 94 10 20 0e mov 0xe, %o2 INTERNAL_ERROR_CORE, true, INTERNAL_ERROR_BAD_STACK_HOOK ); if ( stack_allocate_init_hook != NULL ) 200a380: 22 80 00 05 be,a 200a394 <_Thread_Handler_initialization+0x58> 200a384: 03 00 80 76 sethi %hi(0x201d800), %g1 (*stack_allocate_init_hook)( rtems_configuration_get_stack_space_size() ); 200a388: 9f c0 80 00 call %g2 200a38c: d0 00 60 04 ld [ %g1 + 4 ], %o0 ! 201d804 <_POSIX_Threads_Information+0x20> _Thread_Dispatch_necessary = false; 200a390: 03 00 80 76 sethi %hi(0x201d800), %g1 200a394: 82 10 62 f0 or %g1, 0x2f0, %g1 ! 201daf0 <_Per_CPU_Information> 200a398: c0 28 60 0c clrb [ %g1 + 0xc ] _Thread_Executing = NULL; 200a39c: c0 20 60 10 clr [ %g1 + 0x10 ] _Thread_Heir = NULL; 200a3a0: c0 20 60 14 clr [ %g1 + 0x14 ] #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) _Thread_Allocated_fp = NULL; 200a3a4: 03 00 80 75 sethi %hi(0x201d400), %g1 200a3a8: c0 20 62 3c clr [ %g1 + 0x23c ] ! 201d63c <_Thread_Allocated_fp> #endif _Thread_Maximum_extensions = maximum_extensions; 200a3ac: 03 00 80 75 sethi %hi(0x201d400), %g1 200a3b0: f8 20 62 50 st %i4, [ %g1 + 0x250 ] ! 201d650 <_Thread_Maximum_extensions> _Thread_Ticks_per_timeslice = ticks_per_timeslice; 200a3b4: 03 00 80 75 sethi %hi(0x201d400), %g1 200a3b8: fa 20 61 30 st %i5, [ %g1 + 0x130 ] ! 201d530 <_Thread_Ticks_per_timeslice> #if defined(RTEMS_MULTIPROCESSING) if ( _System_state_Is_multiprocessing ) maximum_internal_threads += 1; #endif _Objects_Initialize_information( 200a3bc: 82 10 20 08 mov 8, %g1 200a3c0: 11 00 80 75 sethi %hi(0x201d400), %o0 200a3c4: c2 23 a0 5c st %g1, [ %sp + 0x5c ] 200a3c8: 90 12 22 c4 or %o0, 0x2c4, %o0 200a3cc: 92 10 20 01 mov 1, %o1 200a3d0: 94 10 20 01 mov 1, %o2 200a3d4: 96 10 20 01 mov 1, %o3 200a3d8: 98 10 21 68 mov 0x168, %o4 200a3dc: 7f ff fb 58 call 200913c <_Objects_Initialize_information> 200a3e0: 9a 10 20 00 clr %o5 200a3e4: 81 c7 e0 08 ret 200a3e8: 81 e8 00 00 restore =============================================================================== 0200a130 <_Thread_Initialize>: Thread_CPU_budget_algorithms budget_algorithm, Thread_CPU_budget_algorithm_callout budget_callout, uint32_t isr_level, Objects_Name name ) { 200a130: 9d e3 bf 98 save %sp, -104, %sp 200a134: c2 07 a0 6c ld [ %fp + 0x6c ], %g1 /* * Zero out all the allocated memory fields */ for ( i=0 ; i <= THREAD_API_LAST ; i++ ) the_thread->API_Extensions[i] = NULL; 200a138: c0 26 61 58 clr [ %i1 + 0x158 ] 200a13c: c0 26 61 5c clr [ %i1 + 0x15c ] extensions_area = NULL; the_thread->libc_reent = NULL; 200a140: c0 26 61 54 clr [ %i1 + 0x154 ] Thread_CPU_budget_algorithms budget_algorithm, Thread_CPU_budget_algorithm_callout budget_callout, uint32_t isr_level, Objects_Name name ) { 200a144: e0 07 a0 60 ld [ %fp + 0x60 ], %l0 200a148: e2 00 40 00 ld [ %g1 ], %l1 if ( !actual_stack_size || actual_stack_size < stack_size ) return false; /* stack allocation failed */ stack = the_thread->Start.stack; #else if ( !stack_area ) { 200a14c: 80 a6 a0 00 cmp %i2, 0 200a150: 12 80 00 0d bne 200a184 <_Thread_Initialize+0x54> 200a154: e4 0f a0 5f ldub [ %fp + 0x5f ], %l2 actual_stack_size = _Thread_Stack_Allocate( the_thread, stack_size ); 200a158: 90 10 00 19 mov %i1, %o0 200a15c: 40 00 02 15 call 200a9b0 <_Thread_Stack_Allocate> 200a160: 92 10 00 1b mov %i3, %o1 if ( !actual_stack_size || actual_stack_size < stack_size ) 200a164: 80 a2 00 1b cmp %o0, %i3 200a168: 0a 80 00 71 bcs 200a32c <_Thread_Initialize+0x1fc> 200a16c: 80 a2 20 00 cmp %o0, 0 200a170: 02 80 00 6f be 200a32c <_Thread_Initialize+0x1fc> <== NEVER TAKEN 200a174: 82 10 20 01 mov 1, %g1 return false; /* stack allocation failed */ stack = the_thread->Start.stack; 200a178: f4 06 60 c0 ld [ %i1 + 0xc0 ], %i2 the_thread->Start.core_allocated_stack = true; 200a17c: 10 80 00 04 b 200a18c <_Thread_Initialize+0x5c> 200a180: c2 2e 60 b0 stb %g1, [ %i1 + 0xb0 ] } else { stack = stack_area; actual_stack_size = stack_size; the_thread->Start.core_allocated_stack = false; 200a184: c0 2e 60 b0 clrb [ %i1 + 0xb0 ] 200a188: 90 10 00 1b mov %i3, %o0 Stack_Control *the_stack, void *starting_address, size_t size ) { the_stack->area = starting_address; 200a18c: f4 26 60 b8 st %i2, [ %i1 + 0xb8 ] the_stack->size = size; 200a190: d0 26 60 b4 st %o0, [ %i1 + 0xb4 ] /* * Allocate the floating point area for this thread */ #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) if ( is_fp ) { 200a194: 80 a7 20 00 cmp %i4, 0 200a198: 02 80 00 07 be 200a1b4 <_Thread_Initialize+0x84> 200a19c: b6 10 20 00 clr %i3 fp_area = _Workspace_Allocate( CONTEXT_FP_SIZE ); 200a1a0: 40 00 03 c2 call 200b0a8 <_Workspace_Allocate> 200a1a4: 90 10 20 88 mov 0x88, %o0 if ( !fp_area ) 200a1a8: b6 92 20 00 orcc %o0, 0, %i3 200a1ac: 22 80 00 51 be,a 200a2f0 <_Thread_Initialize+0x1c0> 200a1b0: b8 10 20 00 clr %i4 #endif /* * Allocate the extensions area for this thread */ if ( _Thread_Maximum_extensions ) { 200a1b4: 03 00 80 75 sethi %hi(0x201d400), %g1 200a1b8: d0 00 62 50 ld [ %g1 + 0x250 ], %o0 ! 201d650 <_Thread_Maximum_extensions> fp_area = _Workspace_Allocate( CONTEXT_FP_SIZE ); if ( !fp_area ) goto failed; fp_area = _Context_Fp_start( fp_area, 0 ); } the_thread->fp_context = fp_area; 200a1bc: f6 26 61 50 st %i3, [ %i1 + 0x150 ] the_thread->Start.fp_context = fp_area; 200a1c0: f6 26 60 bc st %i3, [ %i1 + 0xbc ] Watchdog_Service_routine_entry routine, Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; 200a1c4: c0 26 60 50 clr [ %i1 + 0x50 ] the_watchdog->routine = routine; 200a1c8: c0 26 60 64 clr [ %i1 + 0x64 ] the_watchdog->id = id; 200a1cc: c0 26 60 68 clr [ %i1 + 0x68 ] the_watchdog->user_data = user_data; 200a1d0: c0 26 60 6c clr [ %i1 + 0x6c ] #endif /* * Allocate the extensions area for this thread */ if ( _Thread_Maximum_extensions ) { 200a1d4: 80 a2 20 00 cmp %o0, 0 200a1d8: 02 80 00 08 be 200a1f8 <_Thread_Initialize+0xc8> 200a1dc: b8 10 20 00 clr %i4 extensions_area = _Workspace_Allocate( 200a1e0: 90 02 20 01 inc %o0 200a1e4: 40 00 03 b1 call 200b0a8 <_Workspace_Allocate> 200a1e8: 91 2a 20 02 sll %o0, 2, %o0 (_Thread_Maximum_extensions + 1) * sizeof( void * ) ); if ( !extensions_area ) 200a1ec: b8 92 20 00 orcc %o0, 0, %i4 200a1f0: 02 80 00 41 be 200a2f4 <_Thread_Initialize+0x1c4> 200a1f4: b4 10 20 00 clr %i2 * if they are linked to the thread. An extension user may * create the extension long after tasks have been created * so they cannot rely on the thread create user extension * call. */ if ( the_thread->extensions ) { 200a1f8: 80 a7 20 00 cmp %i4, 0 200a1fc: 12 80 00 0a bne 200a224 <_Thread_Initialize+0xf4> 200a200: f8 26 61 60 st %i4, [ %i1 + 0x160 ] * General initialization */ the_thread->Start.is_preemptible = is_preemptible; the_thread->Start.budget_algorithm = budget_algorithm; the_thread->Start.budget_callout = budget_callout; 200a204: c2 07 a0 64 ld [ %fp + 0x64 ], %g1 /* * General initialization */ the_thread->Start.is_preemptible = is_preemptible; 200a208: e4 2e 60 9c stb %l2, [ %i1 + 0x9c ] the_thread->Start.budget_algorithm = budget_algorithm; 200a20c: e0 26 60 a0 st %l0, [ %i1 + 0xa0 ] the_thread->Start.budget_callout = budget_callout; switch ( budget_algorithm ) { 200a210: 80 a4 20 02 cmp %l0, 2 200a214: 12 80 00 12 bne 200a25c <_Thread_Initialize+0x12c> 200a218: c2 26 60 a4 st %g1, [ %i1 + 0xa4 ] case THREAD_CPU_BUDGET_ALGORITHM_NONE: case THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE: break; #if defined(RTEMS_SCORE_THREAD_ENABLE_EXHAUST_TIMESLICE) case THREAD_CPU_BUDGET_ALGORITHM_EXHAUST_TIMESLICE: the_thread->cpu_time_budget = _Thread_Ticks_per_timeslice; 200a21c: 10 80 00 0e b 200a254 <_Thread_Initialize+0x124> 200a220: 03 00 80 75 sethi %hi(0x201d400), %g1 * create the extension long after tasks have been created * so they cannot rely on the thread create user extension * call. */ if ( the_thread->extensions ) { for ( i = 0; i <= _Thread_Maximum_extensions ; i++ ) 200a224: 03 00 80 75 sethi %hi(0x201d400), %g1 200a228: c4 00 62 50 ld [ %g1 + 0x250 ], %g2 ! 201d650 <_Thread_Maximum_extensions> 200a22c: 10 80 00 05 b 200a240 <_Thread_Initialize+0x110> 200a230: 82 10 20 00 clr %g1 the_thread->extensions[i] = NULL; 200a234: 87 28 60 02 sll %g1, 2, %g3 * create the extension long after tasks have been created * so they cannot rely on the thread create user extension * call. */ if ( the_thread->extensions ) { for ( i = 0; i <= _Thread_Maximum_extensions ; i++ ) 200a238: 82 00 60 01 inc %g1 the_thread->extensions[i] = NULL; 200a23c: c0 21 00 03 clr [ %g4 + %g3 ] * create the extension long after tasks have been created * so they cannot rely on the thread create user extension * call. */ if ( the_thread->extensions ) { for ( i = 0; i <= _Thread_Maximum_extensions ; i++ ) 200a240: 80 a0 40 02 cmp %g1, %g2 200a244: 28 bf ff fc bleu,a 200a234 <_Thread_Initialize+0x104> 200a248: c8 06 61 60 ld [ %i1 + 0x160 ], %g4 * General initialization */ the_thread->Start.is_preemptible = is_preemptible; the_thread->Start.budget_algorithm = budget_algorithm; the_thread->Start.budget_callout = budget_callout; 200a24c: 10 bf ff ef b 200a208 <_Thread_Initialize+0xd8> 200a250: c2 07 a0 64 ld [ %fp + 0x64 ], %g1 case THREAD_CPU_BUDGET_ALGORITHM_NONE: case THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE: break; #if defined(RTEMS_SCORE_THREAD_ENABLE_EXHAUST_TIMESLICE) case THREAD_CPU_BUDGET_ALGORITHM_EXHAUST_TIMESLICE: the_thread->cpu_time_budget = _Thread_Ticks_per_timeslice; 200a254: c2 00 61 30 ld [ %g1 + 0x130 ], %g1 200a258: c2 26 60 74 st %g1, [ %i1 + 0x74 ] case THREAD_CPU_BUDGET_ALGORITHM_CALLOUT: break; #endif } the_thread->Start.isr_level = isr_level; 200a25c: c2 07 a0 68 ld [ %fp + 0x68 ], %g1 the_thread->current_state = STATES_DORMANT; 200a260: a0 10 20 01 mov 1, %l0 case THREAD_CPU_BUDGET_ALGORITHM_CALLOUT: break; #endif } the_thread->Start.isr_level = isr_level; 200a264: c2 26 60 a8 st %g1, [ %i1 + 0xa8 ] */ RTEMS_INLINE_ROUTINE void* _Scheduler_Allocate( Thread_Control *the_thread ) { return _Scheduler.Operations.allocate( the_thread ); 200a268: 03 00 80 72 sethi %hi(0x201c800), %g1 200a26c: c2 00 61 cc ld [ %g1 + 0x1cc ], %g1 ! 201c9cc <_Scheduler+0x18> the_thread->current_state = STATES_DORMANT; 200a270: e0 26 60 10 st %l0, [ %i1 + 0x10 ] the_thread->Wait.queue = NULL; 200a274: c0 26 60 44 clr [ %i1 + 0x44 ] the_thread->resource_count = 0; 200a278: c0 26 60 1c clr [ %i1 + 0x1c ] the_thread->real_priority = priority; 200a27c: fa 26 60 18 st %i5, [ %i1 + 0x18 ] the_thread->Start.initial_priority = priority; 200a280: fa 26 60 ac st %i5, [ %i1 + 0xac ] 200a284: 9f c0 40 00 call %g1 200a288: 90 10 00 19 mov %i1, %o0 sched =_Scheduler_Allocate( the_thread ); if ( !sched ) 200a28c: b4 92 20 00 orcc %o0, 0, %i2 200a290: 02 80 00 19 be 200a2f4 <_Thread_Initialize+0x1c4> 200a294: 90 10 00 19 mov %i1, %o0 goto failed; _Thread_Set_priority( the_thread, priority ); 200a298: 40 00 01 9e call 200a910 <_Thread_Set_priority> 200a29c: 92 10 00 1d mov %i5, %o1 #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 200a2a0: c4 06 20 1c ld [ %i0 + 0x1c ], %g2 Objects_Information *information, Objects_Control *the_object, Objects_Name name ) { _Objects_Set_local_object( 200a2a4: c2 16 60 0a lduh [ %i1 + 0xa ], %g1 static inline void _Timestamp64_implementation_Set_to_zero( Timestamp64_Control *_time ) { *_time = 0; 200a2a8: c0 26 60 80 clr [ %i1 + 0x80 ] 200a2ac: c0 26 60 84 clr [ %i1 + 0x84 ] #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 200a2b0: 83 28 60 02 sll %g1, 2, %g1 200a2b4: f2 20 80 01 st %i1, [ %g2 + %g1 ] information, _Objects_Get_index( the_object->id ), the_object ); the_object->name = name; 200a2b8: e2 26 60 0c st %l1, [ %i1 + 0xc ] * @{ */ static inline bool _User_extensions_Thread_create( Thread_Control *created ) { User_extensions_Thread_create_context ctx = { created, true }; 200a2bc: f2 27 bf f8 st %i1, [ %fp + -8 ] 200a2c0: e0 2f bf fc stb %l0, [ %fp + -4 ] _User_extensions_Iterate( &ctx, _User_extensions_Thread_create_visitor ); 200a2c4: 90 07 bf f8 add %fp, -8, %o0 200a2c8: 13 00 80 2a sethi %hi(0x200a800), %o1 200a2cc: 40 00 02 46 call 200abe4 <_User_extensions_Iterate> 200a2d0: 92 12 62 c0 or %o1, 0x2c0, %o1 ! 200aac0 <_User_extensions_Thread_create_visitor> * user extensions with dispatching enabled. The Allocator * Mutex provides sufficient protection to let the user extensions * run safely. */ extension_status = _User_extensions_Thread_create( the_thread ); if ( extension_status ) 200a2d4: c2 0f bf fc ldub [ %fp + -4 ], %g1 200a2d8: 80 a0 60 00 cmp %g1, 0 200a2dc: 02 80 00 06 be 200a2f4 <_Thread_Initialize+0x1c4> 200a2e0: b0 10 20 01 mov 1, %i0 200a2e4: b0 0e 20 01 and %i0, 1, %i0 200a2e8: 81 c7 e0 08 ret 200a2ec: 81 e8 00 00 restore size_t actual_stack_size = 0; void *stack = NULL; #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) void *fp_area; #endif void *sched = NULL; 200a2f0: b4 10 20 00 clr %i2 extension_status = _User_extensions_Thread_create( the_thread ); if ( extension_status ) return true; failed: _Workspace_Free( the_thread->libc_reent ); 200a2f4: 40 00 03 75 call 200b0c8 <_Workspace_Free> 200a2f8: d0 06 61 54 ld [ %i1 + 0x154 ], %o0 for ( i=0 ; i <= THREAD_API_LAST ; i++ ) _Workspace_Free( the_thread->API_Extensions[i] ); 200a2fc: 40 00 03 73 call 200b0c8 <_Workspace_Free> 200a300: d0 06 61 58 ld [ %i1 + 0x158 ], %o0 200a304: 40 00 03 71 call 200b0c8 <_Workspace_Free> 200a308: d0 06 61 5c ld [ %i1 + 0x15c ], %o0 _Workspace_Free( extensions_area ); 200a30c: 40 00 03 6f call 200b0c8 <_Workspace_Free> 200a310: 90 10 00 1c mov %i4, %o0 #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) _Workspace_Free( fp_area ); 200a314: 40 00 03 6d call 200b0c8 <_Workspace_Free> 200a318: 90 10 00 1b mov %i3, %o0 #endif _Workspace_Free( sched ); 200a31c: 40 00 03 6b call 200b0c8 <_Workspace_Free> 200a320: 90 10 00 1a mov %i2, %o0 _Thread_Stack_Free( the_thread ); 200a324: 40 00 01 b3 call 200a9f0 <_Thread_Stack_Free> 200a328: 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 */ 200a32c: b0 10 20 00 clr %i0 _Workspace_Free( sched ); _Thread_Stack_Free( the_thread ); return false; } 200a330: b0 0e 20 01 and %i0, 1, %i0 200a334: 81 c7 e0 08 ret 200a338: 81 e8 00 00 restore =============================================================================== 0200a9f0 <_Thread_Stack_Free>: #include void _Thread_Stack_Free( Thread_Control *the_thread ) { 200a9f0: 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 ) 200a9f4: c4 0e 20 b0 ldub [ %i0 + 0xb0 ], %g2 void _Thread_Stack_Free( Thread_Control *the_thread ) { rtems_stack_free_hook stack_free_hook = 200a9f8: 03 00 80 69 sethi %hi(0x201a400), %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 ) 200a9fc: 80 a0 a0 00 cmp %g2, 0 200aa00: 02 80 00 04 be 200aa10 <_Thread_Stack_Free+0x20> <== NEVER TAKEN 200aa04: c2 00 63 a4 ld [ %g1 + 0x3a4 ], %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 ); 200aa08: 9f c0 40 00 call %g1 200aa0c: d0 06 20 b8 ld [ %i0 + 0xb8 ], %o0 200aa10: 81 c7 e0 08 ret 200aa14: 81 e8 00 00 restore =============================================================================== 0200a85c <_Thread_queue_Requeue>: void _Thread_queue_Requeue( Thread_queue_Control *the_thread_queue, Thread_Control *the_thread ) { 200a85c: 9d e3 bf 98 save %sp, -104, %sp /* * Just in case the thread really wasn't blocked on a thread queue * when we get here. */ if ( !the_thread_queue ) 200a860: 80 a6 20 00 cmp %i0, 0 200a864: 02 80 00 19 be 200a8c8 <_Thread_queue_Requeue+0x6c> <== NEVER TAKEN 200a868: 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 ) { 200a86c: fa 06 20 34 ld [ %i0 + 0x34 ], %i5 200a870: 80 a7 60 01 cmp %i5, 1 200a874: 12 80 00 15 bne 200a8c8 <_Thread_queue_Requeue+0x6c> <== NEVER TAKEN 200a878: 01 00 00 00 nop Thread_queue_Control *tq = the_thread_queue; ISR_Level level; ISR_Level level_ignored; _ISR_Disable( level ); 200a87c: 7f ff df 52 call 20025c4 200a880: 01 00 00 00 nop 200a884: b8 10 00 08 mov %o0, %i4 200a888: c4 06 60 10 ld [ %i1 + 0x10 ], %g2 if ( _States_Is_waiting_on_thread_queue( the_thread->current_state ) ) { 200a88c: 03 00 00 ef sethi %hi(0x3bc00), %g1 200a890: 82 10 62 e0 or %g1, 0x2e0, %g1 ! 3bee0 200a894: 80 88 80 01 btst %g2, %g1 200a898: 02 80 00 0a be 200a8c0 <_Thread_queue_Requeue+0x64> <== NEVER TAKEN 200a89c: 90 10 00 18 mov %i0, %o0 _Thread_queue_Enter_critical_section( tq ); _Thread_queue_Extract_priority_helper( tq, the_thread, true ); 200a8a0: 92 10 00 19 mov %i1, %o1 200a8a4: 94 10 20 01 mov 1, %o2 200a8a8: 40 00 0c 81 call 200daac <_Thread_queue_Extract_priority_helper> 200a8ac: fa 26 20 30 st %i5, [ %i0 + 0x30 ] (void) _Thread_queue_Enqueue_priority( tq, the_thread, &level_ignored ); 200a8b0: 90 10 00 18 mov %i0, %o0 200a8b4: 92 10 00 19 mov %i1, %o1 200a8b8: 7f ff ff 50 call 200a5f8 <_Thread_queue_Enqueue_priority> 200a8bc: 94 07 bf fc add %fp, -4, %o2 } _ISR_Enable( level ); 200a8c0: 7f ff df 45 call 20025d4 200a8c4: 90 10 00 1c mov %i4, %o0 200a8c8: 81 c7 e0 08 ret 200a8cc: 81 e8 00 00 restore =============================================================================== 0200a8d0 <_Thread_queue_Timeout>: void _Thread_queue_Timeout( Objects_Id id, void *ignored __attribute__((unused)) ) { 200a8d0: 9d e3 bf 98 save %sp, -104, %sp Thread_Control *the_thread; Objects_Locations location; the_thread = _Thread_Get( id, &location ); 200a8d4: 90 10 00 18 mov %i0, %o0 200a8d8: 7f ff fd ea call 200a080 <_Thread_Get> 200a8dc: 92 07 bf fc add %fp, -4, %o1 switch ( location ) { 200a8e0: c2 07 bf fc ld [ %fp + -4 ], %g1 200a8e4: 80 a0 60 00 cmp %g1, 0 200a8e8: 12 80 00 08 bne 200a908 <_Thread_queue_Timeout+0x38> <== NEVER TAKEN 200a8ec: 01 00 00 00 nop #if defined(RTEMS_MULTIPROCESSING) case OBJECTS_REMOTE: /* impossible */ #endif break; case OBJECTS_LOCAL: _Thread_queue_Process_timeout( the_thread ); 200a8f0: 40 00 0c a6 call 200db88 <_Thread_queue_Process_timeout> 200a8f4: 01 00 00 00 nop * * This routine decrements the thread dispatch level. */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_decrement_disable_level(void) { uint32_t level = _Thread_Dispatch_disable_level; 200a8f8: 03 00 80 75 sethi %hi(0x201d400), %g1 200a8fc: c4 00 61 d0 ld [ %g1 + 0x1d0 ], %g2 ! 201d5d0 <_Thread_Dispatch_disable_level> --level; 200a900: 84 00 bf ff add %g2, -1, %g2 _Thread_Dispatch_disable_level = level; 200a904: c4 20 61 d0 st %g2, [ %g1 + 0x1d0 ] 200a908: 81 c7 e0 08 ret 200a90c: 81 e8 00 00 restore =============================================================================== 020189dc <_Timer_server_Body>: * @a arg points to the corresponding timer server control block. */ static rtems_task _Timer_server_Body( rtems_task_argument arg ) { 20189dc: 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; 20189e0: 27 00 80 f2 sethi %hi(0x203c800), %l3 ) { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); head->next = tail; 20189e4: a4 07 bf e8 add %fp, -24, %l2 20189e8: aa 07 bf ec add %fp, -20, %l5 20189ec: b8 07 bf f4 add %fp, -12, %i4 20189f0: b2 07 bf f8 add %fp, -8, %i1 20189f4: ea 27 bf e8 st %l5, [ %fp + -24 ] head->previous = NULL; 20189f8: c0 27 bf ec clr [ %fp + -20 ] tail->previous = head; 20189fc: e4 27 bf f0 st %l2, [ %fp + -16 ] ) { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); head->next = tail; 2018a00: f2 27 bf f4 st %i1, [ %fp + -12 ] head->previous = NULL; 2018a04: c0 27 bf f8 clr [ %fp + -8 ] tail->previous = head; 2018a08: 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 ); 2018a0c: b4 06 20 30 add %i0, 0x30, %i2 static void _Timer_server_Process_tod_watchdogs( Timer_server_Watchdogs *watchdogs, Chain_Control *fire_chain ) { Watchdog_Interval snapshot = (Watchdog_Interval) _TOD_Seconds_since_epoch(); 2018a10: 29 00 80 f2 sethi %hi(0x203c800), %l4 /* * The current TOD is before the last TOD which indicates that * TOD has been set backwards. */ delta = last_snapshot - snapshot; _Watchdog_Adjust( &watchdogs->Chain, WATCHDOG_BACKWARD, delta ); 2018a14: b6 06 20 68 add %i0, 0x68, %i3 static void _Timer_server_Stop_interval_system_watchdog( Timer_server_Control *ts ) { _Watchdog_Remove( &ts->Interval_watchdogs.System_watchdog ); 2018a18: a2 06 20 08 add %i0, 8, %l1 static void _Timer_server_Stop_tod_system_watchdog( Timer_server_Control *ts ) { _Watchdog_Remove( &ts->TOD_watchdogs.System_watchdog ); 2018a1c: a0 06 20 40 add %i0, 0x40, %l0 { /* * Afterwards all timer inserts are directed to this chain and the interval * and TOD chains will be no more modified by other parties. */ ts->insert_chain = insert_chain; 2018a20: e4 26 20 78 st %l2, [ %i0 + 0x78 ] static void _Timer_server_Process_interval_watchdogs( Timer_server_Watchdogs *watchdogs, Chain_Control *fire_chain ) { Watchdog_Interval snapshot = _Watchdog_Ticks_since_boot; 2018a24: c2 04 e2 9c ld [ %l3 + 0x29c ], %g1 /* * We assume adequate unsigned arithmetic here. */ Watchdog_Interval delta = snapshot - watchdogs->last_snapshot; 2018a28: d2 06 20 3c ld [ %i0 + 0x3c ], %o1 watchdogs->last_snapshot = snapshot; _Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain ); 2018a2c: 90 10 00 1a mov %i2, %o0 2018a30: 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; 2018a34: c2 26 20 3c st %g1, [ %i0 + 0x3c ] _Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain ); 2018a38: 40 00 11 ce call 201d170 <_Watchdog_Adjust_to_chain> 2018a3c: 94 10 00 1c mov %i4, %o2 2018a40: d0 1d 20 f8 ldd [ %l4 + 0xf8 ], %o0 2018a44: 94 10 20 00 clr %o2 2018a48: 17 0e e6 b2 sethi %hi(0x3b9ac800), %o3 2018a4c: 40 00 4f 4b call 202c778 <__divdi3> 2018a50: 96 12 e2 00 or %o3, 0x200, %o3 ! 3b9aca00 Timer_server_Watchdogs *watchdogs, Chain_Control *fire_chain ) { Watchdog_Interval snapshot = (Watchdog_Interval) _TOD_Seconds_since_epoch(); Watchdog_Interval last_snapshot = watchdogs->last_snapshot; 2018a54: 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 ) { 2018a58: 80 a2 40 0a cmp %o1, %o2 2018a5c: 08 80 00 07 bleu 2018a78 <_Timer_server_Body+0x9c> 2018a60: ba 10 00 09 mov %o1, %i5 /* * This path is for normal forward movement and cases where the * TOD has been set forward. */ delta = snapshot - last_snapshot; _Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain ); 2018a64: 92 22 40 0a sub %o1, %o2, %o1 2018a68: 90 10 00 1b mov %i3, %o0 2018a6c: 40 00 11 c1 call 201d170 <_Watchdog_Adjust_to_chain> 2018a70: 94 10 00 1c mov %i4, %o2 2018a74: 30 80 00 06 b,a 2018a8c <_Timer_server_Body+0xb0> } else if ( snapshot < last_snapshot ) { 2018a78: 1a 80 00 05 bcc 2018a8c <_Timer_server_Body+0xb0> 2018a7c: 90 10 00 1b mov %i3, %o0 /* * The current TOD is before the last TOD which indicates that * TOD has been set backwards. */ delta = last_snapshot - snapshot; _Watchdog_Adjust( &watchdogs->Chain, WATCHDOG_BACKWARD, delta ); 2018a80: 92 10 20 01 mov 1, %o1 2018a84: 40 00 11 93 call 201d0d0 <_Watchdog_Adjust> 2018a88: 94 22 80 1d sub %o2, %i5, %o2 } watchdogs->last_snapshot = snapshot; 2018a8c: 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 ); 2018a90: d0 06 20 78 ld [ %i0 + 0x78 ], %o0 2018a94: 40 00 02 f4 call 2019664 <_Chain_Get> 2018a98: 01 00 00 00 nop if ( timer == NULL ) { 2018a9c: 92 92 20 00 orcc %o0, 0, %o1 2018aa0: 02 80 00 0c be 2018ad0 <_Timer_server_Body+0xf4> 2018aa4: 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 ) { 2018aa8: c2 02 60 38 ld [ %o1 + 0x38 ], %g1 2018aac: 80 a0 60 01 cmp %g1, 1 2018ab0: 02 80 00 05 be 2018ac4 <_Timer_server_Body+0xe8> 2018ab4: 90 10 00 1a mov %i2, %o0 _Watchdog_Insert( &ts->Interval_watchdogs.Chain, &timer->Ticker ); } else if ( timer->the_class == TIMER_TIME_OF_DAY_ON_TASK ) { 2018ab8: 80 a0 60 03 cmp %g1, 3 2018abc: 12 bf ff f5 bne 2018a90 <_Timer_server_Body+0xb4> <== NEVER TAKEN 2018ac0: 90 10 00 1b mov %i3, %o0 _Watchdog_Insert( &ts->TOD_watchdogs.Chain, &timer->Ticker ); 2018ac4: 40 00 11 d5 call 201d218 <_Watchdog_Insert> 2018ac8: 92 02 60 10 add %o1, 0x10, %o1 2018acc: 30 bf ff f1 b,a 2018a90 <_Timer_server_Body+0xb4> * of zero it will be processed in the next iteration of the timer server * body loop. */ _Timer_server_Process_insertions( ts ); _ISR_Disable( level ); 2018ad0: 7f ff df 18 call 2010730 2018ad4: 01 00 00 00 nop if ( _Chain_Is_empty( insert_chain ) ) { 2018ad8: c2 07 bf e8 ld [ %fp + -24 ], %g1 2018adc: 80 a0 40 15 cmp %g1, %l5 2018ae0: 12 80 00 0a bne 2018b08 <_Timer_server_Body+0x12c> <== NEVER TAKEN 2018ae4: 01 00 00 00 nop ts->insert_chain = NULL; 2018ae8: c0 26 20 78 clr [ %i0 + 0x78 ] _ISR_Enable( level ); 2018aec: 7f ff df 15 call 2010740 2018af0: 01 00 00 00 nop _Chain_Initialize_empty( &fire_chain ); while ( true ) { _Timer_server_Get_watchdogs_that_fire_now( ts, &insert_chain, &fire_chain ); if ( !_Chain_Is_empty( &fire_chain ) ) { 2018af4: c2 07 bf f4 ld [ %fp + -12 ], %g1 2018af8: 80 a0 40 19 cmp %g1, %i1 2018afc: 12 80 00 06 bne 2018b14 <_Timer_server_Body+0x138> 2018b00: 01 00 00 00 nop 2018b04: 30 80 00 18 b,a 2018b64 <_Timer_server_Body+0x188> ts->insert_chain = NULL; _ISR_Enable( level ); break; } else { _ISR_Enable( level ); 2018b08: 7f ff df 0e call 2010740 <== NOT EXECUTED 2018b0c: 01 00 00 00 nop <== NOT EXECUTED 2018b10: 30 bf ff c5 b,a 2018a24 <_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 ); 2018b14: 7f ff df 07 call 2010730 2018b18: 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; 2018b1c: 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)) 2018b20: 80 a7 40 19 cmp %i5, %i1 2018b24: 02 80 00 0d be 2018b58 <_Timer_server_Body+0x17c> 2018b28: 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; 2018b2c: c2 07 40 00 ld [ %i5 ], %g1 head->next = new_first; new_first->previous = head; 2018b30: 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; 2018b34: c2 27 bf f4 st %g1, [ %fp + -12 ] watchdog = (Watchdog_Control *) _Chain_Get_unprotected( &fire_chain ); if ( watchdog != NULL ) { watchdog->state = WATCHDOG_INACTIVE; 2018b38: c0 27 60 08 clr [ %i5 + 8 ] _ISR_Enable( level ); 2018b3c: 7f ff df 01 call 2010740 2018b40: 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 ); 2018b44: c2 07 60 1c ld [ %i5 + 0x1c ], %g1 2018b48: d0 07 60 20 ld [ %i5 + 0x20 ], %o0 2018b4c: 9f c0 40 00 call %g1 2018b50: d2 07 60 24 ld [ %i5 + 0x24 ], %o1 } 2018b54: 30 bf ff f0 b,a 2018b14 <_Timer_server_Body+0x138> watchdog = (Watchdog_Control *) _Chain_Get_unprotected( &fire_chain ); if ( watchdog != NULL ) { watchdog->state = WATCHDOG_INACTIVE; _ISR_Enable( level ); } else { _ISR_Enable( level ); 2018b58: 7f ff de fa call 2010740 2018b5c: 01 00 00 00 nop 2018b60: 30 bf ff b0 b,a 2018a20 <_Timer_server_Body+0x44> * the active flag of the timer server is true. */ (*watchdog->routine)( watchdog->id, watchdog->user_data ); } } else { ts->active = false; 2018b64: c0 2e 20 7c clrb [ %i0 + 0x7c ] * * This rountine increments the thread dispatch level */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_increment_disable_level(void) { uint32_t level = _Thread_Dispatch_disable_level; 2018b68: 03 00 80 f2 sethi %hi(0x203c800), %g1 2018b6c: c4 00 61 b0 ld [ %g1 + 0x1b0 ], %g2 ! 203c9b0 <_Thread_Dispatch_disable_level> ++level; 2018b70: 84 00 a0 01 inc %g2 _Thread_Dispatch_disable_level = level; 2018b74: c4 20 61 b0 st %g2, [ %g1 + 0x1b0 ] /* * Block until there is something to do. */ _Thread_Disable_dispatch(); _Thread_Set_state( ts->thread, STATES_DELAYING ); 2018b78: d0 06 00 00 ld [ %i0 ], %o0 2018b7c: 40 00 10 68 call 201cd1c <_Thread_Set_state> 2018b80: 92 10 20 08 mov 8, %o1 _Timer_server_Reset_interval_system_watchdog( ts ); 2018b84: 7f ff ff 6e call 201893c <_Timer_server_Reset_interval_system_watchdog> 2018b88: 90 10 00 18 mov %i0, %o0 _Timer_server_Reset_tod_system_watchdog( ts ); 2018b8c: 7f ff ff 80 call 201898c <_Timer_server_Reset_tod_system_watchdog> 2018b90: 90 10 00 18 mov %i0, %o0 _Thread_Enable_dispatch(); 2018b94: 40 00 0e 05 call 201c3a8 <_Thread_Enable_dispatch> 2018b98: 01 00 00 00 nop ts->active = true; 2018b9c: 82 10 20 01 mov 1, %g1 ! 1 static void _Timer_server_Stop_interval_system_watchdog( Timer_server_Control *ts ) { _Watchdog_Remove( &ts->Interval_watchdogs.System_watchdog ); 2018ba0: 90 10 00 11 mov %l1, %o0 _Thread_Set_state( ts->thread, STATES_DELAYING ); _Timer_server_Reset_interval_system_watchdog( ts ); _Timer_server_Reset_tod_system_watchdog( ts ); _Thread_Enable_dispatch(); ts->active = true; 2018ba4: c2 2e 20 7c stb %g1, [ %i0 + 0x7c ] static void _Timer_server_Stop_interval_system_watchdog( Timer_server_Control *ts ) { _Watchdog_Remove( &ts->Interval_watchdogs.System_watchdog ); 2018ba8: 40 00 11 f4 call 201d378 <_Watchdog_Remove> 2018bac: 01 00 00 00 nop static void _Timer_server_Stop_tod_system_watchdog( Timer_server_Control *ts ) { _Watchdog_Remove( &ts->TOD_watchdogs.System_watchdog ); 2018bb0: 40 00 11 f2 call 201d378 <_Watchdog_Remove> 2018bb4: 90 10 00 10 mov %l0, %o0 2018bb8: 30 bf ff 9a b,a 2018a20 <_Timer_server_Body+0x44> =============================================================================== 02018bbc <_Timer_server_Schedule_operation_method>: static void _Timer_server_Schedule_operation_method( Timer_server_Control *ts, Timer_Control *timer ) { 2018bbc: 9d e3 bf a0 save %sp, -96, %sp if ( ts->insert_chain == NULL ) { 2018bc0: c2 06 20 78 ld [ %i0 + 0x78 ], %g1 2018bc4: 80 a0 60 00 cmp %g1, 0 2018bc8: 12 80 00 51 bne 2018d0c <_Timer_server_Schedule_operation_method+0x150> 2018bcc: ba 10 00 19 mov %i1, %i5 * * This rountine increments the thread dispatch level */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_increment_disable_level(void) { uint32_t level = _Thread_Dispatch_disable_level; 2018bd0: 03 00 80 f2 sethi %hi(0x203c800), %g1 2018bd4: c4 00 61 b0 ld [ %g1 + 0x1b0 ], %g2 ! 203c9b0 <_Thread_Dispatch_disable_level> ++level; 2018bd8: 84 00 a0 01 inc %g2 _Thread_Dispatch_disable_level = level; 2018bdc: c4 20 61 b0 st %g2, [ %g1 + 0x1b0 ] * being inserted. This could result in an integer overflow. */ _Thread_Disable_dispatch(); if ( timer->the_class == TIMER_INTERVAL_ON_TASK ) { 2018be0: c2 06 60 38 ld [ %i1 + 0x38 ], %g1 2018be4: 80 a0 60 01 cmp %g1, 1 2018be8: 12 80 00 1f bne 2018c64 <_Timer_server_Schedule_operation_method+0xa8> 2018bec: 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 ); 2018bf0: 7f ff de d0 call 2010730 2018bf4: 01 00 00 00 nop snapshot = _Watchdog_Ticks_since_boot; 2018bf8: 03 00 80 f2 sethi %hi(0x203c800), %g1 2018bfc: c4 00 62 9c ld [ %g1 + 0x29c ], %g2 ! 203ca9c <_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; 2018c00: c2 06 20 30 ld [ %i0 + 0x30 ], %g1 last_snapshot = ts->Interval_watchdogs.last_snapshot; 2018c04: 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 ); 2018c08: 86 06 20 34 add %i0, 0x34, %g3 if ( !_Chain_Is_empty( &ts->Interval_watchdogs.Chain ) ) { 2018c0c: 80 a0 40 03 cmp %g1, %g3 2018c10: 02 80 00 08 be 2018c30 <_Timer_server_Schedule_operation_method+0x74> 2018c14: 88 20 80 04 sub %g2, %g4, %g4 /* * We assume adequate unsigned arithmetic here. */ delta = snapshot - last_snapshot; delta_interval = first_watchdog->delta_interval; 2018c18: f8 00 60 10 ld [ %g1 + 0x10 ], %i4 if (delta_interval > delta) { 2018c1c: 80 a7 00 04 cmp %i4, %g4 2018c20: 08 80 00 03 bleu 2018c2c <_Timer_server_Schedule_operation_method+0x70> 2018c24: 86 10 20 00 clr %g3 delta_interval -= delta; 2018c28: 86 27 00 04 sub %i4, %g4, %g3 } else { delta_interval = 0; } first_watchdog->delta_interval = delta_interval; 2018c2c: c6 20 60 10 st %g3, [ %g1 + 0x10 ] } ts->Interval_watchdogs.last_snapshot = snapshot; 2018c30: c4 26 20 3c st %g2, [ %i0 + 0x3c ] _ISR_Enable( level ); 2018c34: 7f ff de c3 call 2010740 2018c38: 01 00 00 00 nop _Watchdog_Insert( &ts->Interval_watchdogs.Chain, &timer->Ticker ); 2018c3c: 90 06 20 30 add %i0, 0x30, %o0 2018c40: 40 00 11 76 call 201d218 <_Watchdog_Insert> 2018c44: 92 07 60 10 add %i5, 0x10, %o1 if ( !ts->active ) { 2018c48: c2 0e 20 7c ldub [ %i0 + 0x7c ], %g1 2018c4c: 80 a0 60 00 cmp %g1, 0 2018c50: 12 80 00 2d bne 2018d04 <_Timer_server_Schedule_operation_method+0x148> 2018c54: 01 00 00 00 nop _Timer_server_Reset_interval_system_watchdog( ts ); 2018c58: 7f ff ff 39 call 201893c <_Timer_server_Reset_interval_system_watchdog> 2018c5c: 90 10 00 18 mov %i0, %o0 2018c60: 30 80 00 29 b,a 2018d04 <_Timer_server_Schedule_operation_method+0x148> } } else if ( timer->the_class == TIMER_TIME_OF_DAY_ON_TASK ) { 2018c64: 12 80 00 28 bne 2018d04 <_Timer_server_Schedule_operation_method+0x148> 2018c68: 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 ); 2018c6c: 7f ff de b1 call 2010730 2018c70: 01 00 00 00 nop 2018c74: b8 10 00 08 mov %o0, %i4 2018c78: 03 00 80 f2 sethi %hi(0x203c800), %g1 2018c7c: d0 18 60 f8 ldd [ %g1 + 0xf8 ], %o0 ! 203c8f8 <_TOD> 2018c80: 94 10 20 00 clr %o2 2018c84: 17 0e e6 b2 sethi %hi(0x3b9ac800), %o3 2018c88: 40 00 4e bc call 202c778 <__divdi3> 2018c8c: 96 12 e2 00 or %o3, 0x200, %o3 ! 3b9aca00 */ RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_first( const Chain_Control *the_chain ) { return _Chain_Immutable_head( the_chain )->next; 2018c90: c2 06 20 68 ld [ %i0 + 0x68 ], %g1 snapshot = (Watchdog_Interval) _TOD_Seconds_since_epoch(); last_snapshot = ts->TOD_watchdogs.last_snapshot; 2018c94: c4 06 20 74 ld [ %i0 + 0x74 ], %g2 RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( const Chain_Control *the_chain ) { return _Chain_Immutable_first( the_chain ) == _Chain_Immutable_tail( the_chain ); 2018c98: 86 06 20 6c add %i0, 0x6c, %g3 if ( !_Chain_Is_empty( &ts->TOD_watchdogs.Chain ) ) { 2018c9c: 80 a0 40 03 cmp %g1, %g3 2018ca0: 02 80 00 0d be 2018cd4 <_Timer_server_Schedule_operation_method+0x118> 2018ca4: 80 a2 40 02 cmp %o1, %g2 first_watchdog = _Watchdog_First( &ts->TOD_watchdogs.Chain ); delta_interval = first_watchdog->delta_interval; if ( snapshot > last_snapshot ) { 2018ca8: 08 80 00 08 bleu 2018cc8 <_Timer_server_Schedule_operation_method+0x10c> 2018cac: c6 00 60 10 ld [ %g1 + 0x10 ], %g3 /* * We advanced in time. */ delta = snapshot - last_snapshot; 2018cb0: 88 22 40 02 sub %o1, %g2, %g4 if (delta_interval > delta) { 2018cb4: 80 a0 c0 04 cmp %g3, %g4 2018cb8: 08 80 00 06 bleu 2018cd0 <_Timer_server_Schedule_operation_method+0x114><== NEVER TAKEN 2018cbc: 84 10 20 00 clr %g2 delta_interval -= delta; 2018cc0: 10 80 00 04 b 2018cd0 <_Timer_server_Schedule_operation_method+0x114> 2018cc4: 84 20 c0 04 sub %g3, %g4, %g2 } } else { /* * Someone put us in the past. */ delta = last_snapshot - snapshot; 2018cc8: 84 00 c0 02 add %g3, %g2, %g2 delta_interval += delta; 2018ccc: 84 20 80 09 sub %g2, %o1, %g2 } first_watchdog->delta_interval = delta_interval; 2018cd0: c4 20 60 10 st %g2, [ %g1 + 0x10 ] } ts->TOD_watchdogs.last_snapshot = snapshot; 2018cd4: d2 26 20 74 st %o1, [ %i0 + 0x74 ] _ISR_Enable( level ); 2018cd8: 7f ff de 9a call 2010740 2018cdc: 90 10 00 1c mov %i4, %o0 _Watchdog_Insert( &ts->TOD_watchdogs.Chain, &timer->Ticker ); 2018ce0: 90 06 20 68 add %i0, 0x68, %o0 2018ce4: 40 00 11 4d call 201d218 <_Watchdog_Insert> 2018ce8: 92 07 60 10 add %i5, 0x10, %o1 if ( !ts->active ) { 2018cec: c2 0e 20 7c ldub [ %i0 + 0x7c ], %g1 2018cf0: 80 a0 60 00 cmp %g1, 0 2018cf4: 12 80 00 04 bne 2018d04 <_Timer_server_Schedule_operation_method+0x148> 2018cf8: 01 00 00 00 nop _Timer_server_Reset_tod_system_watchdog( ts ); 2018cfc: 7f ff ff 24 call 201898c <_Timer_server_Reset_tod_system_watchdog> 2018d00: 90 10 00 18 mov %i0, %o0 } } _Thread_Enable_dispatch(); 2018d04: 40 00 0d a9 call 201c3a8 <_Thread_Enable_dispatch> 2018d08: 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 ); 2018d0c: f0 06 20 78 ld [ %i0 + 0x78 ], %i0 2018d10: 40 00 02 49 call 2019634 <_Chain_Append> 2018d14: 81 e8 00 00 restore =============================================================================== 0200c3b4 <_Timestamp64_Divide>: const Timestamp64_Control *_lhs, const Timestamp64_Control *_rhs, uint32_t *_ival_percentage, uint32_t *_fval_percentage ) { 200c3b4: 9d e3 bf a0 save %sp, -96, %sp Timestamp64_Control answer; if ( *_rhs == 0 ) { 200c3b8: d4 1e 40 00 ldd [ %i1 ], %o2 200c3bc: 80 92 80 0b orcc %o2, %o3, %g0 200c3c0: 32 80 00 06 bne,a 200c3d8 <_Timestamp64_Divide+0x24> <== ALWAYS TAKEN 200c3c4: d8 1e 00 00 ldd [ %i0 ], %o4 *_ival_percentage = 0; 200c3c8: c0 26 80 00 clr [ %i2 ] <== NOT EXECUTED *_fval_percentage = 0; 200c3cc: c0 26 c0 00 clr [ %i3 ] <== NOT EXECUTED return; 200c3d0: 81 c7 e0 08 ret <== NOT EXECUTED 200c3d4: 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; 200c3d8: 83 2b 20 02 sll %o4, 2, %g1 200c3dc: 87 2b 60 02 sll %o5, 2, %g3 200c3e0: 89 33 60 1e srl %o5, 0x1e, %g4 200c3e4: bb 28 e0 05 sll %g3, 5, %i5 200c3e8: 84 11 00 01 or %g4, %g1, %g2 200c3ec: 83 30 e0 1b srl %g3, 0x1b, %g1 200c3f0: b9 28 a0 05 sll %g2, 5, %i4 200c3f4: 86 a7 40 03 subcc %i5, %g3, %g3 200c3f8: b8 10 40 1c or %g1, %i4, %i4 200c3fc: 84 67 00 02 subx %i4, %g2, %g2 200c400: b2 80 c0 0d addcc %g3, %o5, %i1 200c404: b0 40 80 0c addx %g2, %o4, %i0 200c408: 83 36 60 1e srl %i1, 0x1e, %g1 200c40c: 87 2e 60 02 sll %i1, 2, %g3 200c410: 85 2e 20 02 sll %i0, 2, %g2 200c414: 84 10 40 02 or %g1, %g2, %g2 200c418: ba 86 40 03 addcc %i1, %g3, %i5 200c41c: b8 46 00 02 addx %i0, %g2, %i4 200c420: 83 37 60 1e srl %i5, 0x1e, %g1 200c424: 87 2f 60 02 sll %i5, 2, %g3 200c428: 85 2f 20 02 sll %i4, 2, %g2 200c42c: 84 10 40 02 or %g1, %g2, %g2 200c430: 92 87 40 03 addcc %i5, %g3, %o1 200c434: 90 47 00 02 addx %i4, %g2, %o0 200c438: 87 32 60 1b srl %o1, 0x1b, %g3 200c43c: 85 2a 20 05 sll %o0, 5, %g2 200c440: 83 2a 60 05 sll %o1, 5, %g1 200c444: 90 10 c0 02 or %g3, %g2, %o0 200c448: 40 00 39 f4 call 201ac18 <__divdi3> 200c44c: 92 10 00 01 mov %g1, %o1 *_ival_percentage = answer / 1000; 200c450: 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; 200c454: b8 10 00 08 mov %o0, %i4 200c458: ba 10 00 09 mov %o1, %i5 *_ival_percentage = answer / 1000; 200c45c: 40 00 39 ef call 201ac18 <__divdi3> 200c460: 96 10 23 e8 mov 0x3e8, %o3 *_fval_percentage = answer % 1000; 200c464: 90 10 00 1c mov %i4, %o0 * TODO: Rounding on the last digit of the fval. */ answer = (*_lhs * 100000) / *_rhs; *_ival_percentage = answer / 1000; 200c468: d2 26 80 00 st %o1, [ %i2 ] *_fval_percentage = answer % 1000; 200c46c: 94 10 20 00 clr %o2 200c470: 92 10 00 1d mov %i5, %o1 200c474: 40 00 3a d4 call 201afc4 <__moddi3> 200c478: 96 10 23 e8 mov 0x3e8, %o3 200c47c: d2 26 c0 00 st %o1, [ %i3 ] 200c480: 81 c7 e0 08 ret 200c484: 81 e8 00 00 restore =============================================================================== 0200aca4 <_User_extensions_Handler_initialization>: } } void _User_extensions_Handler_initialization(void) { 200aca4: 9d e3 bf 98 save %sp, -104, %sp uint32_t number_of_initial_extensions = 200aca8: 03 00 80 69 sethi %hi(0x201a400), %g1 200acac: c2 00 63 b8 ld [ %g1 + 0x3b8 ], %g1 ! 201a7b8 rtems_configuration_get_number_of_initial_extensions(); if ( number_of_initial_extensions > 0 ) { 200acb0: 80 a0 60 00 cmp %g1, 0 200acb4: 02 80 00 0a be 200acdc <_User_extensions_Handler_initialization+0x38><== NEVER TAKEN 200acb8: 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 ) 200acbc: 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 = 200acc0: 40 00 01 08 call 200b0e0 <_Workspace_Allocate_or_fatal_error> 200acc4: 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 ); 200acc8: 13 00 80 2b sethi %hi(0x200ac00), %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 }; 200accc: d0 27 bf fc st %o0, [ %fp + -4 ] _User_extensions_Iterate( &ctx, _User_extensions_Switch_visitor ); 200acd0: 92 12 60 60 or %o1, 0x60, %o1 200acd4: 7f ff ff c4 call 200abe4 <_User_extensions_Iterate> 200acd8: 90 07 bf fc add %fp, -4, %o0 200acdc: 81 c7 e0 08 ret 200ace0: 81 e8 00 00 restore =============================================================================== 0200c6ec <_Watchdog_Adjust>: void _Watchdog_Adjust( Chain_Control *header, Watchdog_Adjust_directions direction, Watchdog_Interval units ) { 200c6ec: 9d e3 bf a0 save %sp, -96, %sp ISR_Level level; _ISR_Disable( level ); 200c6f0: 7f ff db 47 call 200340c 200c6f4: 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; 200c6f8: 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 ); 200c6fc: 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 ) ) { 200c700: 80 a0 40 1c cmp %g1, %i4 200c704: 02 80 00 20 be 200c784 <_Watchdog_Adjust+0x98> 200c708: 80 a6 60 00 cmp %i1, 0 switch ( direction ) { 200c70c: 02 80 00 1b be 200c778 <_Watchdog_Adjust+0x8c> 200c710: b6 10 20 01 mov 1, %i3 200c714: 80 a6 60 01 cmp %i1, 1 200c718: 12 80 00 1b bne 200c784 <_Watchdog_Adjust+0x98> <== NEVER TAKEN 200c71c: 01 00 00 00 nop case WATCHDOG_BACKWARD: _Watchdog_First( header )->delta_interval += units; 200c720: c4 00 60 10 ld [ %g1 + 0x10 ], %g2 200c724: 10 80 00 07 b 200c740 <_Watchdog_Adjust+0x54> 200c728: b4 00 80 1a add %g2, %i2, %i2 break; case WATCHDOG_FORWARD: while ( units ) { if ( units < _Watchdog_First( header )->delta_interval ) { 200c72c: c4 00 60 10 ld [ %g1 + 0x10 ], %g2 200c730: 80 a6 80 02 cmp %i2, %g2 200c734: 3a 80 00 05 bcc,a 200c748 <_Watchdog_Adjust+0x5c> 200c738: f6 20 60 10 st %i3, [ %g1 + 0x10 ] _Watchdog_First( header )->delta_interval -= units; 200c73c: b4 20 80 1a sub %g2, %i2, %i2 break; 200c740: 10 80 00 11 b 200c784 <_Watchdog_Adjust+0x98> 200c744: f4 20 60 10 st %i2, [ %g1 + 0x10 ] } else { units -= _Watchdog_First( header )->delta_interval; 200c748: b4 26 80 02 sub %i2, %g2, %i2 _Watchdog_First( header )->delta_interval = 1; _ISR_Enable( level ); 200c74c: 7f ff db 34 call 200341c 200c750: 01 00 00 00 nop _Watchdog_Tickle( header ); 200c754: 40 00 00 90 call 200c994 <_Watchdog_Tickle> 200c758: 90 10 00 18 mov %i0, %o0 _ISR_Disable( level ); 200c75c: 7f ff db 2c call 200340c 200c760: 01 00 00 00 nop if ( _Chain_Is_empty( header ) ) 200c764: c2 06 00 00 ld [ %i0 ], %g1 200c768: 80 a0 40 1c cmp %g1, %i4 200c76c: 12 80 00 04 bne 200c77c <_Watchdog_Adjust+0x90> 200c770: 80 a6 a0 00 cmp %i2, 0 200c774: 30 80 00 04 b,a 200c784 <_Watchdog_Adjust+0x98> switch ( direction ) { case WATCHDOG_BACKWARD: _Watchdog_First( header )->delta_interval += units; break; case WATCHDOG_FORWARD: while ( units ) { 200c778: 80 a6 a0 00 cmp %i2, 0 200c77c: 32 bf ff ec bne,a 200c72c <_Watchdog_Adjust+0x40> <== ALWAYS TAKEN 200c780: c2 06 00 00 ld [ %i0 ], %g1 } break; } } _ISR_Enable( level ); 200c784: 7f ff db 26 call 200341c 200c788: 91 e8 00 08 restore %g0, %o0, %o0 =============================================================================== 0200ae44 <_Watchdog_Remove>: #include Watchdog_States _Watchdog_Remove( Watchdog_Control *the_watchdog ) { 200ae44: 9d e3 bf a0 save %sp, -96, %sp ISR_Level level; Watchdog_States previous_state; Watchdog_Control *next_watchdog; _ISR_Disable( level ); 200ae48: 7f ff dd df call 20025c4 200ae4c: ba 10 00 18 mov %i0, %i5 previous_state = the_watchdog->state; 200ae50: f0 06 20 08 ld [ %i0 + 8 ], %i0 switch ( previous_state ) { 200ae54: 80 a6 20 01 cmp %i0, 1 200ae58: 22 80 00 1e be,a 200aed0 <_Watchdog_Remove+0x8c> 200ae5c: c0 27 60 08 clr [ %i5 + 8 ] 200ae60: 0a 80 00 1d bcs 200aed4 <_Watchdog_Remove+0x90> 200ae64: 03 00 80 75 sethi %hi(0x201d400), %g1 200ae68: 80 a6 20 03 cmp %i0, 3 200ae6c: 18 80 00 1a bgu 200aed4 <_Watchdog_Remove+0x90> <== NEVER TAKEN 200ae70: 01 00 00 00 nop RTEMS_INLINE_ROUTINE Watchdog_Control *_Watchdog_Next( Watchdog_Control *the_watchdog ) { return ( (Watchdog_Control *) the_watchdog->Node.next ); 200ae74: 10 80 00 02 b 200ae7c <_Watchdog_Remove+0x38> 200ae78: c2 07 40 00 ld [ %i5 ], %g1 break; case WATCHDOG_ACTIVE: case WATCHDOG_REMOVE_IT: the_watchdog->state = WATCHDOG_INACTIVE; 200ae7c: c0 27 60 08 clr [ %i5 + 8 ] next_watchdog = _Watchdog_Next( the_watchdog ); if ( _Watchdog_Next(next_watchdog) ) 200ae80: c4 00 40 00 ld [ %g1 ], %g2 200ae84: 80 a0 a0 00 cmp %g2, 0 200ae88: 02 80 00 07 be 200aea4 <_Watchdog_Remove+0x60> 200ae8c: 05 00 80 75 sethi %hi(0x201d400), %g2 next_watchdog->delta_interval += the_watchdog->delta_interval; 200ae90: c6 00 60 10 ld [ %g1 + 0x10 ], %g3 200ae94: c4 07 60 10 ld [ %i5 + 0x10 ], %g2 200ae98: 84 00 c0 02 add %g3, %g2, %g2 200ae9c: c4 20 60 10 st %g2, [ %g1 + 0x10 ] if ( _Watchdog_Sync_count ) 200aea0: 05 00 80 75 sethi %hi(0x201d400), %g2 200aea4: c4 00 a2 b8 ld [ %g2 + 0x2b8 ], %g2 ! 201d6b8 <_Watchdog_Sync_count> 200aea8: 80 a0 a0 00 cmp %g2, 0 200aeac: 22 80 00 07 be,a 200aec8 <_Watchdog_Remove+0x84> 200aeb0: c4 07 60 04 ld [ %i5 + 4 ], %g2 _Watchdog_Sync_level = _ISR_Nest_level; 200aeb4: 05 00 80 76 sethi %hi(0x201d800), %g2 200aeb8: c6 00 a2 f8 ld [ %g2 + 0x2f8 ], %g3 ! 201daf8 <_Per_CPU_Information+0x8> 200aebc: 05 00 80 75 sethi %hi(0x201d400), %g2 200aec0: c6 20 a2 58 st %g3, [ %g2 + 0x258 ] ! 201d658 <_Watchdog_Sync_level> { Chain_Node *next; Chain_Node *previous; next = the_node->next; previous = the_node->previous; 200aec4: c4 07 60 04 ld [ %i5 + 4 ], %g2 next->previous = previous; 200aec8: c4 20 60 04 st %g2, [ %g1 + 4 ] previous->next = next; 200aecc: c2 20 80 00 st %g1, [ %g2 ] _Chain_Extract_unprotected( &the_watchdog->Node ); break; } the_watchdog->stop_time = _Watchdog_Ticks_since_boot; 200aed0: 03 00 80 75 sethi %hi(0x201d400), %g1 200aed4: c2 00 62 bc ld [ %g1 + 0x2bc ], %g1 ! 201d6bc <_Watchdog_Ticks_since_boot> 200aed8: c2 27 60 18 st %g1, [ %i5 + 0x18 ] _ISR_Enable( level ); 200aedc: 7f ff dd be call 20025d4 200aee0: 01 00 00 00 nop return( previous_state ); } 200aee4: 81 c7 e0 08 ret 200aee8: 81 e8 00 00 restore =============================================================================== 0200c098 <_Watchdog_Report_chain>: void _Watchdog_Report_chain( const char *name, Chain_Control *header ) { 200c098: 9d e3 bf a0 save %sp, -96, %sp ISR_Level level; Chain_Node *node; _ISR_Disable( level ); 200c09c: 7f ff db b9 call 2002f80 200c0a0: b8 10 00 18 mov %i0, %i4 200c0a4: b0 10 00 08 mov %o0, %i0 printk( "Watchdog Chain: %s %p\n", name, header ); 200c0a8: 11 00 80 75 sethi %hi(0x201d400), %o0 200c0ac: 94 10 00 19 mov %i1, %o2 200c0b0: 90 12 20 68 or %o0, 0x68, %o0 200c0b4: 7f ff e3 3c call 2004da4 200c0b8: 92 10 00 1c mov %i4, %o1 */ RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_first( const Chain_Control *the_chain ) { return _Chain_Immutable_head( the_chain )->next; 200c0bc: fa 06 40 00 ld [ %i1 ], %i5 RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( const Chain_Control *the_chain ) { return _Chain_Immutable_first( the_chain ) == _Chain_Immutable_tail( the_chain ); 200c0c0: b2 06 60 04 add %i1, 4, %i1 if ( !_Chain_Is_empty( header ) ) { 200c0c4: 80 a7 40 19 cmp %i5, %i1 200c0c8: 12 80 00 04 bne 200c0d8 <_Watchdog_Report_chain+0x40> 200c0cc: 92 10 00 1d mov %i5, %o1 _Watchdog_Report( NULL, watch ); } printk( "== end of %s \n", name ); } else { printk( "Chain is empty\n" ); 200c0d0: 10 80 00 0d b 200c104 <_Watchdog_Report_chain+0x6c> 200c0d4: 11 00 80 75 sethi %hi(0x201d400), %o0 node != _Chain_Tail(header) ; node = node->next ) { Watchdog_Control *watch = (Watchdog_Control *) node; _Watchdog_Report( NULL, watch ); 200c0d8: 40 00 00 0f call 200c114 <_Watchdog_Report> 200c0dc: 90 10 20 00 clr %o0 _ISR_Disable( level ); printk( "Watchdog Chain: %s %p\n", name, header ); if ( !_Chain_Is_empty( header ) ) { for ( node = _Chain_First( header ) ; node != _Chain_Tail(header) ; node = node->next ) 200c0e0: fa 07 40 00 ld [ %i5 ], %i5 Chain_Node *node; _ISR_Disable( level ); printk( "Watchdog Chain: %s %p\n", name, header ); if ( !_Chain_Is_empty( header ) ) { for ( node = _Chain_First( header ) ; 200c0e4: 80 a7 40 19 cmp %i5, %i1 200c0e8: 12 bf ff fc bne 200c0d8 <_Watchdog_Report_chain+0x40> <== NEVER TAKEN 200c0ec: 92 10 00 1d mov %i5, %o1 { Watchdog_Control *watch = (Watchdog_Control *) node; _Watchdog_Report( NULL, watch ); } printk( "== end of %s \n", name ); 200c0f0: 11 00 80 75 sethi %hi(0x201d400), %o0 200c0f4: 92 10 00 1c mov %i4, %o1 200c0f8: 7f ff e3 2b call 2004da4 200c0fc: 90 12 20 80 or %o0, 0x80, %o0 200c100: 30 80 00 03 b,a 200c10c <_Watchdog_Report_chain+0x74> } else { printk( "Chain is empty\n" ); 200c104: 7f ff e3 28 call 2004da4 200c108: 90 12 20 90 or %o0, 0x90, %o0 } _ISR_Enable( level ); 200c10c: 7f ff db a1 call 2002f90 200c110: 81 e8 00 00 restore =============================================================================== 0200aeec <_Watchdog_Tickle>: #include void _Watchdog_Tickle( Chain_Control *header ) { 200aeec: 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 ); 200aef0: 7f ff dd b5 call 20025c4 200aef4: b8 10 00 18 mov %i0, %i4 200aef8: 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; 200aefc: 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 ); 200af00: b6 07 20 04 add %i4, 4, %i3 if ( _Chain_Is_empty( header ) ) 200af04: 80 a7 40 1b cmp %i5, %i3 200af08: 02 80 00 1f be 200af84 <_Watchdog_Tickle+0x98> 200af0c: 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) { 200af10: c2 07 60 10 ld [ %i5 + 0x10 ], %g1 200af14: 80 a0 60 00 cmp %g1, 0 200af18: 02 80 00 06 be 200af30 <_Watchdog_Tickle+0x44> <== NEVER TAKEN 200af1c: 82 00 7f ff add %g1, -1, %g1 the_watchdog->delta_interval--; 200af20: c2 27 60 10 st %g1, [ %i5 + 0x10 ] if ( the_watchdog->delta_interval != 0 ) 200af24: 80 a0 60 00 cmp %g1, 0 200af28: 12 80 00 17 bne 200af84 <_Watchdog_Tickle+0x98> 200af2c: 01 00 00 00 nop goto leave; } do { watchdog_state = _Watchdog_Remove( the_watchdog ); 200af30: 7f ff ff c5 call 200ae44 <_Watchdog_Remove> 200af34: 90 10 00 1d mov %i5, %o0 200af38: b4 10 00 08 mov %o0, %i2 _ISR_Enable( level ); 200af3c: 7f ff dd a6 call 20025d4 200af40: 90 10 00 18 mov %i0, %o0 switch( watchdog_state ) { 200af44: 80 a6 a0 02 cmp %i2, 2 200af48: 12 80 00 06 bne 200af60 <_Watchdog_Tickle+0x74> 200af4c: 01 00 00 00 nop case WATCHDOG_ACTIVE: (*the_watchdog->routine)( 200af50: c2 07 60 1c ld [ %i5 + 0x1c ], %g1 200af54: d0 07 60 20 ld [ %i5 + 0x20 ], %o0 200af58: 9f c0 40 00 call %g1 200af5c: d2 07 60 24 ld [ %i5 + 0x24 ], %o1 case WATCHDOG_REMOVE_IT: break; } _ISR_Disable( level ); 200af60: 7f ff dd 99 call 20025c4 200af64: 01 00 00 00 nop 200af68: b0 10 00 08 mov %o0, %i0 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_First( Chain_Control *the_chain ) { return _Chain_Head( the_chain )->next; 200af6c: fa 07 00 00 ld [ %i4 ], %i5 the_watchdog = _Watchdog_First( header ); } while ( !_Chain_Is_empty( header ) && (the_watchdog->delta_interval == 0) ); 200af70: 80 a7 40 1b cmp %i5, %i3 200af74: 02 80 00 04 be 200af84 <_Watchdog_Tickle+0x98> 200af78: 01 00 00 00 nop } _ISR_Disable( level ); the_watchdog = _Watchdog_First( header ); } while ( !_Chain_Is_empty( header ) && 200af7c: 10 bf ff ea b 200af24 <_Watchdog_Tickle+0x38> 200af80: c2 07 60 10 ld [ %i5 + 0x10 ], %g1 (the_watchdog->delta_interval == 0) ); leave: _ISR_Enable(level); 200af84: 7f ff dd 94 call 20025d4 200af88: 81 e8 00 00 restore =============================================================================== 0200af8c <_Workspace_Handler_initialization>: void _Workspace_Handler_initialization( Heap_Area *areas, size_t area_count, Heap_Initialization_or_extend_handler extend ) { 200af8c: 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(); 200af90: 05 00 80 69 sethi %hi(0x201a400), %g2 200af94: 82 10 a3 78 or %g2, 0x378, %g1 ! 201a778 200af98: c6 08 60 32 ldub [ %g1 + 0x32 ], %g3 200af9c: fa 00 a3 78 ld [ %g2 + 0x378 ], %i5 200afa0: 80 a0 e0 00 cmp %g3, 0 200afa4: 12 80 00 03 bne 200afb0 <_Workspace_Handler_initialization+0x24> 200afa8: 84 10 20 00 clr %g2 200afac: c4 00 60 04 ld [ %g1 + 4 ], %g2 Heap_Area *areas, size_t area_count, Heap_Initialization_or_extend_handler extend ) { Heap_Initialization_or_extend_handler init_or_extend = _Heap_Initialize; 200afb0: 21 00 80 22 sethi %hi(0x2008800), %l0 } else { size = 0; } } space_available = (*init_or_extend)( 200afb4: 27 00 80 75 sethi %hi(0x201d400), %l3 size_t area_count, Heap_Initialization_or_extend_handler extend ) { Heap_Initialization_or_extend_handler init_or_extend = _Heap_Initialize; uintptr_t remaining = rtems_configuration_get_work_space_size(); 200afb8: ba 00 80 1d add %g2, %i5, %i5 bool unified = rtems_configuration_get_unified_work_area(); uintptr_t page_size = CPU_HEAP_ALIGNMENT; uintptr_t overhead = _Heap_Area_overhead( page_size ); size_t i; for (i = 0; i < area_count; ++i) { 200afbc: b6 10 20 00 clr %i3 Heap_Area *areas, size_t area_count, Heap_Initialization_or_extend_handler extend ) { Heap_Initialization_or_extend_handler init_or_extend = _Heap_Initialize; 200afc0: a0 14 20 b0 or %l0, 0xb0, %l0 size_t i; for (i = 0; i < area_count; ++i) { Heap_Area *area = &areas [i]; if ( do_zero ) { 200afc4: e2 08 60 30 ldub [ %g1 + 0x30 ], %l1 if ( area->size > overhead ) { uintptr_t space_available; uintptr_t size; if ( unified ) { 200afc8: e4 08 60 31 ldub [ %g1 + 0x31 ], %l2 bool unified = rtems_configuration_get_unified_work_area(); uintptr_t page_size = CPU_HEAP_ALIGNMENT; uintptr_t overhead = _Heap_Area_overhead( page_size ); size_t i; for (i = 0; i < area_count; ++i) { 200afcc: 10 80 00 2c b 200b07c <_Workspace_Handler_initialization+0xf0> 200afd0: a6 14 e1 e0 or %l3, 0x1e0, %l3 Heap_Area *area = &areas [i]; if ( do_zero ) { 200afd4: 22 80 00 07 be,a 200aff0 <_Workspace_Handler_initialization+0x64> 200afd8: f8 06 20 04 ld [ %i0 + 4 ], %i4 memset( area->begin, 0, area->size ); 200afdc: d0 06 00 00 ld [ %i0 ], %o0 200afe0: d4 06 20 04 ld [ %i0 + 4 ], %o2 200afe4: 40 00 14 30 call 20100a4 200afe8: 92 10 20 00 clr %o1 } if ( area->size > overhead ) { 200afec: f8 06 20 04 ld [ %i0 + 4 ], %i4 200aff0: 80 a7 20 16 cmp %i4, 0x16 200aff4: 28 80 00 21 bleu,a 200b078 <_Workspace_Handler_initialization+0xec> 200aff8: b6 06 e0 01 inc %i3 uintptr_t space_available; uintptr_t size; if ( unified ) { 200affc: 80 a4 a0 00 cmp %l2, 0 200b000: 32 80 00 0c bne,a 200b030 <_Workspace_Handler_initialization+0xa4> 200b004: d2 06 00 00 ld [ %i0 ], %o1 size = area->size; } else { if ( remaining > 0 ) { 200b008: 80 a7 60 00 cmp %i5, 0 200b00c: 22 80 00 08 be,a 200b02c <_Workspace_Handler_initialization+0xa0><== NEVER TAKEN 200b010: b8 10 20 00 clr %i4 <== NOT EXECUTED size = remaining < area->size - overhead ? 200b014: 82 07 3f ea add %i4, -22, %g1 remaining + overhead : area->size; 200b018: 80 a7 40 01 cmp %i5, %g1 200b01c: 2a 80 00 04 bcs,a 200b02c <_Workspace_Handler_initialization+0xa0><== ALWAYS TAKEN 200b020: b8 07 60 16 add %i5, 0x16, %i4 } else { size = 0; } } space_available = (*init_or_extend)( 200b024: 10 80 00 03 b 200b030 <_Workspace_Handler_initialization+0xa4><== NOT EXECUTED 200b028: d2 06 00 00 ld [ %i0 ], %o1 <== NOT EXECUTED 200b02c: d2 06 00 00 ld [ %i0 ], %o1 200b030: 94 10 00 1c mov %i4, %o2 200b034: 90 10 00 13 mov %l3, %o0 200b038: 9f c4 00 00 call %l0 200b03c: 96 10 20 08 mov 8, %o3 area->begin, size, page_size ); area->begin = (char *) area->begin + size; 200b040: c2 06 00 00 ld [ %i0 ], %g1 area->size -= size; if ( space_available < remaining ) { 200b044: 80 a2 00 1d cmp %o0, %i5 area->begin, size, page_size ); area->begin = (char *) area->begin + size; 200b048: 82 00 40 1c add %g1, %i4, %g1 200b04c: c2 26 00 00 st %g1, [ %i0 ] area->size -= size; 200b050: c2 06 20 04 ld [ %i0 + 4 ], %g1 200b054: b8 20 40 1c sub %g1, %i4, %i4 if ( space_available < remaining ) { 200b058: 1a 80 00 05 bcc 200b06c <_Workspace_Handler_initialization+0xe0><== ALWAYS TAKEN 200b05c: f8 26 20 04 st %i4, [ %i0 + 4 ] remaining -= space_available; 200b060: ba 27 40 08 sub %i5, %o0, %i5 <== NOT EXECUTED } else { remaining = 0; } init_or_extend = extend; 200b064: 10 80 00 04 b 200b074 <_Workspace_Handler_initialization+0xe8><== NOT EXECUTED 200b068: a0 10 00 1a mov %i2, %l0 <== NOT EXECUTED 200b06c: a0 10 00 1a mov %i2, %l0 area->size -= size; if ( space_available < remaining ) { remaining -= space_available; } else { remaining = 0; 200b070: ba 10 20 00 clr %i5 bool unified = rtems_configuration_get_unified_work_area(); uintptr_t page_size = CPU_HEAP_ALIGNMENT; uintptr_t overhead = _Heap_Area_overhead( page_size ); size_t i; for (i = 0; i < area_count; ++i) { 200b074: b6 06 e0 01 inc %i3 200b078: b0 06 20 08 add %i0, 8, %i0 200b07c: 80 a6 c0 19 cmp %i3, %i1 200b080: 12 bf ff d5 bne 200afd4 <_Workspace_Handler_initialization+0x48> 200b084: 80 a4 60 00 cmp %l1, 0 init_or_extend = extend; } } if ( remaining > 0 ) { 200b088: 80 a7 60 00 cmp %i5, 0 200b08c: 02 80 00 05 be 200b0a0 <_Workspace_Handler_initialization+0x114> 200b090: 90 10 20 00 clr %o0 _Internal_error_Occurred( 200b094: 92 10 20 01 mov 1, %o1 200b098: 7f ff f6 99 call 2008afc <_Internal_error_Occurred> 200b09c: 94 10 20 02 mov 2, %o2 200b0a0: 81 c7 e0 08 ret 200b0a4: 81 e8 00 00 restore =============================================================================== 02013000 <_fat_block_read>: uint32_t start, uint32_t offset, uint32_t count, void *buff ) { 2013000: 9d e3 bf 98 save %sp, -104, %sp uint32_t sec_num = start; uint32_t ofs = offset; uint8_t *sec_buf; uint32_t c = 0; while (count > 0) 2013004: 10 80 00 17 b 2013060 <_fat_block_read+0x60> 2013008: ba 10 20 00 clr %i5 { rc = fat_buf_access(fs_info, sec_num, FAT_OP_TYPE_READ, &sec_buf); 201300c: 92 10 00 19 mov %i1, %o1 2013010: 94 10 20 01 mov 1, %o2 2013014: 7f ff ff cc call 2012f44 2013018: 96 07 bf fc add %fp, -4, %o3 if (rc != RC_OK) 201301c: 80 a2 20 00 cmp %o0, 0 2013020: 32 80 00 15 bne,a 2013074 <_fat_block_read+0x74> <== NEVER TAKEN 2013024: ba 10 3f ff mov -1, %i5 <== NOT EXECUTED return -1; c = MIN(count, (fs_info->vol.bps - ofs)); 2013028: e0 16 00 00 lduh [ %i0 ], %l0 201302c: a0 24 00 1a sub %l0, %i2, %l0 2013030: 80 a4 00 1b cmp %l0, %i3 2013034: 38 80 00 02 bgu,a 201303c <_fat_block_read+0x3c> 2013038: a0 10 00 1b mov %i3, %l0 memcpy((buff + cmpltd), (sec_buf + ofs), c); 201303c: d2 07 bf fc ld [ %fp + -4 ], %o1 2013040: 90 07 00 1d add %i4, %i5, %o0 2013044: 92 02 40 1a add %o1, %i2, %o1 2013048: 94 10 00 10 mov %l0, %o2 201304c: 40 00 24 17 call 201c0a8 2013050: b6 26 c0 10 sub %i3, %l0, %i3 count -= c; cmpltd += c; 2013054: ba 04 00 1d add %l0, %i5, %i5 sec_num++; 2013058: b2 06 60 01 inc %i1 ofs = 0; 201305c: b4 10 20 00 clr %i2 uint32_t sec_num = start; uint32_t ofs = offset; uint8_t *sec_buf; uint32_t c = 0; while (count > 0) 2013060: 80 a6 e0 00 cmp %i3, 0 2013064: 12 bf ff ea bne 201300c <_fat_block_read+0xc> 2013068: 90 10 00 18 mov %i0, %o0 cmpltd += c; sec_num++; ofs = 0; } return cmpltd; } 201306c: 81 c7 e0 08 ret 2013070: 91 e8 00 1d restore %g0, %i5, %o0 2013074: b0 10 00 1d mov %i5, %i0 <== NOT EXECUTED 2013078: 81 c7 e0 08 ret <== NOT EXECUTED 201307c: 81 e8 00 00 restore <== NOT EXECUTED =============================================================================== 02003d60 <_lstat_r>: struct _reent *ptr __attribute__((unused)), const char *path, struct stat *buf ) { return _STAT_NAME( path, buf ); 2003d60: 90 10 00 09 mov %o1, %o0 <== NOT EXECUTED 2003d64: 92 10 00 0a mov %o2, %o1 <== NOT EXECUTED 2003d68: 82 13 c0 00 mov %o7, %g1 <== NOT EXECUTED 2003d6c: 7f ff ff e9 call 2003d10 <== NOT EXECUTED 2003d70: 9e 10 40 00 mov %g1, %o7 <== NOT EXECUTED =============================================================================== 020045a4 <_stat_r>: struct _reent *ptr __attribute__((unused)), const char *path, struct stat *buf ) { return _STAT_NAME( path, buf ); 20045a4: 90 10 00 09 mov %o1, %o0 <== NOT EXECUTED 20045a8: 92 10 00 0a mov %o2, %o1 <== NOT EXECUTED 20045ac: 82 13 c0 00 mov %o7, %g1 <== NOT EXECUTED 20045b0: 7f ff ff e9 call 2004554 <== NOT EXECUTED 20045b4: 9e 10 40 00 mov %g1, %o7 <== NOT EXECUTED =============================================================================== 02007750 : #include #include #include int aio_cancel(int fildes, struct aiocb *aiocbp) { 2007750: 9d e3 bf a0 save %sp, -96, %sp rtems_aio_request_chain *r_chain; int result; pthread_mutex_lock (&aio_request_queue.mutex); 2007754: 3b 00 80 7e sethi %hi(0x201f800), %i5 2007758: 40 00 04 68 call 20088f8 200775c: 90 17 61 bc or %i5, 0x1bc, %o0 ! 201f9bc if (fcntl (fildes, F_GETFD) < 0) { 2007760: 90 10 00 18 mov %i0, %o0 2007764: 40 00 1a d6 call 200e2bc 2007768: 92 10 20 01 mov 1, %o1 200776c: 80 a2 20 00 cmp %o0, 0 2007770: 16 80 00 08 bge 2007790 2007774: 80 a6 60 00 cmp %i1, 0 pthread_mutex_unlock(&aio_request_queue.mutex); 2007778: 40 00 04 81 call 200897c 200777c: 90 17 61 bc or %i5, 0x1bc, %o0 rtems_set_errno_and_return_minus_one (EBADF); 2007780: 40 00 28 84 call 2011990 <__errno> 2007784: 01 00 00 00 nop 2007788: 10 80 00 54 b 20078d8 200778c: 82 10 20 09 mov 9, %g1 ! 9 } /* if aiocbp is NULL remove all request for given file descriptor */ if (aiocbp == NULL) { 2007790: 32 80 00 35 bne,a 2007864 2007794: f8 06 40 00 ld [ %i1 ], %i4 AIO_printf ("Cancel all requests\n"); r_chain = rtems_aio_search_fd (&aio_request_queue.work_req, fildes, 0); 2007798: 11 00 80 7e sethi %hi(0x201f800), %o0 200779c: 92 10 00 18 mov %i0, %o1 20077a0: 90 12 22 04 or %o0, 0x204, %o0 20077a4: 40 00 01 71 call 2007d68 20077a8: 94 10 20 00 clr %o2 if (r_chain == NULL) { 20077ac: b8 92 20 00 orcc %o0, 0, %i4 20077b0: 12 80 00 20 bne 2007830 20077b4: 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; 20077b8: ba 17 61 bc or %i5, 0x1bc, %i5 AIO_printf ("Request chain not on [WQ]\n"); if (!rtems_chain_is_empty (&aio_request_queue.idle_req)) { 20077bc: c4 07 60 54 ld [ %i5 + 0x54 ], %g2 20077c0: 82 07 60 58 add %i5, 0x58, %g1 20077c4: 80 a0 80 01 cmp %g2, %g1 20077c8: 02 80 00 08 be 20077e8 <== NEVER TAKEN 20077cc: 92 10 00 18 mov %i0, %o1 r_chain = rtems_aio_search_fd (&aio_request_queue.idle_req, fildes, 0); 20077d0: 90 07 60 54 add %i5, 0x54, %o0 20077d4: 40 00 01 65 call 2007d68 20077d8: 94 10 20 00 clr %o2 if (r_chain == NULL) { 20077dc: b8 92 20 00 orcc %o0, 0, %i4 20077e0: 12 80 00 08 bne 2007800 20077e4: 01 00 00 00 nop pthread_mutex_unlock(&aio_request_queue.mutex); 20077e8: 11 00 80 7e sethi %hi(0x201f800), %o0 return AIO_ALLDONE; 20077ec: b0 10 20 02 mov 2, %i0 AIO_printf ("Request chain not on [WQ]\n"); if (!rtems_chain_is_empty (&aio_request_queue.idle_req)) { r_chain = rtems_aio_search_fd (&aio_request_queue.idle_req, fildes, 0); if (r_chain == NULL) { pthread_mutex_unlock(&aio_request_queue.mutex); 20077f0: 40 00 04 63 call 200897c 20077f4: 90 12 21 bc or %o0, 0x1bc, %o0 return AIO_ALLDONE; 20077f8: 81 c7 e0 08 ret 20077fc: 81 e8 00 00 restore */ RTEMS_INLINE_ROUTINE void rtems_chain_extract( rtems_chain_node *the_node ) { _Chain_Extract( the_node ); 2007800: 40 00 0a e1 call 200a384 <_Chain_Extract> 2007804: 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); 2007808: 40 00 01 80 call 2007e08 200780c: 90 10 00 1c mov %i4, %o0 pthread_mutex_destroy (&r_chain->mutex); 2007810: 40 00 03 8d call 2008644 2007814: 90 10 00 1b mov %i3, %o0 pthread_cond_destroy (&r_chain->mutex); 2007818: 40 00 02 ae call 20082d0 200781c: 90 10 00 1b mov %i3, %o0 free (r_chain); 2007820: 7f ff f0 c5 call 2003b34 2007824: 90 10 00 1c mov %i4, %o0 pthread_mutex_unlock (&aio_request_queue.mutex); 2007828: 10 80 00 0b b 2007854 200782c: 90 10 00 1d mov %i5, %o0 return AIO_ALLDONE; } AIO_printf ("Request chain on [WQ]\n"); pthread_mutex_lock (&r_chain->mutex); 2007830: 40 00 04 32 call 20088f8 2007834: 90 10 00 1b mov %i3, %o0 2007838: 40 00 0a d3 call 200a384 <_Chain_Extract> 200783c: 90 10 00 1c mov %i4, %o0 rtems_chain_extract (&r_chain->next_fd); rtems_aio_remove_fd (r_chain); 2007840: 40 00 01 72 call 2007e08 2007844: 90 10 00 1c mov %i4, %o0 pthread_mutex_unlock (&r_chain->mutex); 2007848: 40 00 04 4d call 200897c 200784c: 90 10 00 1b mov %i3, %o0 pthread_mutex_unlock (&aio_request_queue.mutex); 2007850: 90 17 61 bc or %i5, 0x1bc, %o0 2007854: 40 00 04 4a call 200897c 2007858: b0 10 20 00 clr %i0 return AIO_CANCELED; 200785c: 81 c7 e0 08 ret 2007860: 81 e8 00 00 restore } else { AIO_printf ("Cancel request\n"); if (aiocbp->aio_fildes != fildes) { 2007864: 80 a7 00 18 cmp %i4, %i0 2007868: 12 80 00 17 bne 20078c4 200786c: 90 17 61 bc or %i5, 0x1bc, %o0 pthread_mutex_unlock (&aio_request_queue.mutex); rtems_set_errno_and_return_minus_one (EINVAL); } r_chain = rtems_aio_search_fd (&aio_request_queue.work_req, fildes, 0); 2007870: 11 00 80 7e sethi %hi(0x201f800), %o0 2007874: 92 10 00 1c mov %i4, %o1 2007878: 90 12 22 04 or %o0, 0x204, %o0 200787c: 40 00 01 3b call 2007d68 2007880: 94 10 20 00 clr %o2 if (r_chain == NULL) { 2007884: b6 92 20 00 orcc %o0, 0, %i3 2007888: 32 80 00 1c bne,a 20078f8 200788c: b8 06 e0 1c add %i3, 0x1c, %i4 2007890: ba 17 61 bc or %i5, 0x1bc, %i5 if (!rtems_chain_is_empty (&aio_request_queue.idle_req)) { 2007894: c4 07 60 54 ld [ %i5 + 0x54 ], %g2 2007898: 82 07 60 58 add %i5, 0x58, %g1 200789c: 80 a0 80 01 cmp %g2, %g1 20078a0: 02 bf ff d2 be 20077e8 <== NEVER TAKEN 20078a4: 92 10 00 1c mov %i4, %o1 r_chain = rtems_aio_search_fd (&aio_request_queue.idle_req, fildes, 0); 20078a8: 90 07 60 54 add %i5, 0x54, %o0 20078ac: 40 00 01 2f call 2007d68 20078b0: 94 10 20 00 clr %o2 if (r_chain == NULL) { 20078b4: 80 a2 20 00 cmp %o0, 0 20078b8: 12 80 00 0b bne 20078e4 20078bc: 90 02 20 08 add %o0, 8, %o0 pthread_mutex_unlock (&aio_request_queue.mutex); 20078c0: 90 10 00 1d mov %i5, %o0 20078c4: 40 00 04 2e call 200897c 20078c8: 01 00 00 00 nop rtems_set_errno_and_return_minus_one (EINVAL); 20078cc: 40 00 28 31 call 2011990 <__errno> 20078d0: 01 00 00 00 nop 20078d4: 82 10 20 16 mov 0x16, %g1 ! 16 20078d8: c2 22 00 00 st %g1, [ %o0 ] 20078dc: 81 c7 e0 08 ret 20078e0: 91 e8 3f ff restore %g0, -1, %o0 } AIO_printf ("Request on [IQ]\n"); result = rtems_aio_remove_req (&r_chain->perfd, aiocbp); 20078e4: 40 00 01 5d call 2007e58 20078e8: 92 10 00 19 mov %i1, %o1 20078ec: b0 10 00 08 mov %o0, %i0 pthread_mutex_unlock (&aio_request_queue.mutex); 20078f0: 10 80 00 0b b 200791c 20078f4: 90 10 00 1d mov %i5, %o0 return AIO_ALLDONE; } } AIO_printf ("Request on [WQ]\n"); pthread_mutex_lock (&r_chain->mutex); 20078f8: 40 00 04 00 call 20088f8 20078fc: 90 10 00 1c mov %i4, %o0 result = rtems_aio_remove_req (&r_chain->perfd, aiocbp); 2007900: 92 10 00 19 mov %i1, %o1 2007904: 40 00 01 55 call 2007e58 2007908: 90 06 e0 08 add %i3, 8, %o0 200790c: b0 10 00 08 mov %o0, %i0 pthread_mutex_unlock (&r_chain->mutex); 2007910: 40 00 04 1b call 200897c 2007914: 90 10 00 1c mov %i4, %o0 pthread_mutex_unlock (&aio_request_queue.mutex); 2007918: 90 17 61 bc or %i5, 0x1bc, %o0 200791c: 40 00 04 18 call 200897c 2007920: 01 00 00 00 nop return result; } return AIO_ALLDONE; } 2007924: 81 c7 e0 08 ret 2007928: 81 e8 00 00 restore =============================================================================== 02007934 : int aio_fsync( int op, struct aiocb *aiocbp ) { 2007934: 9d e3 bf a0 save %sp, -96, %sp rtems_aio_request *req; int mode; if (op != O_SYNC) 2007938: 03 00 00 08 sethi %hi(0x2000), %g1 200793c: 80 a6 00 01 cmp %i0, %g1 2007940: 12 80 00 10 bne 2007980 2007944: ba 10 20 16 mov 0x16, %i5 rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp); mode = fcntl (aiocbp->aio_fildes, F_GETFL); 2007948: d0 06 40 00 ld [ %i1 ], %o0 200794c: 40 00 1a 5c call 200e2bc 2007950: 92 10 20 03 mov 3, %o1 if (!(((mode & O_ACCMODE) == O_WRONLY) || ((mode & O_ACCMODE) == O_RDWR))) 2007954: 90 0a 20 03 and %o0, 3, %o0 2007958: 90 02 3f ff add %o0, -1, %o0 200795c: 80 a2 20 01 cmp %o0, 1 2007960: 18 80 00 08 bgu 2007980 2007964: ba 10 20 09 mov 9, %i5 rtems_aio_set_errno_return_minus_one (EBADF, aiocbp); req = malloc (sizeof (rtems_aio_request)); 2007968: 7f ff f1 93 call 2003fb4 200796c: 90 10 20 18 mov 0x18, %o0 if (req == NULL) 2007970: b0 92 20 00 orcc %o0, 0, %i0 2007974: 32 80 00 09 bne,a 2007998 <== ALWAYS TAKEN 2007978: f2 26 20 14 st %i1, [ %i0 + 0x14 ] rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp); 200797c: ba 10 20 0b mov 0xb, %i5 <== NOT EXECUTED 2007980: 82 10 3f ff mov -1, %g1 2007984: fa 26 60 34 st %i5, [ %i1 + 0x34 ] 2007988: 40 00 28 02 call 2011990 <__errno> 200798c: c2 26 60 38 st %g1, [ %i1 + 0x38 ] 2007990: 10 80 00 06 b 20079a8 2007994: fa 22 00 00 st %i5, [ %o0 ] req->aiocbp = aiocbp; req->aiocbp->aio_lio_opcode = LIO_SYNC; 2007998: 82 10 20 03 mov 3, %g1 200799c: c2 26 60 30 st %g1, [ %i1 + 0x30 ] return rtems_aio_enqueue (req); 20079a0: 40 00 01 4e call 2007ed8 20079a4: 81 e8 00 00 restore } 20079a8: 81 c7 e0 08 ret 20079ac: 91 e8 3f ff restore %g0, -1, %o0 =============================================================================== 020080f0 : * 0 - otherwise */ int aio_read (struct aiocb *aiocbp) { 20080f0: 9d e3 bf a0 save %sp, -96, %sp rtems_aio_request *req; int mode; mode = fcntl (aiocbp->aio_fildes, F_GETFL); 20080f4: d0 06 00 00 ld [ %i0 ], %o0 20080f8: 92 10 20 03 mov 3, %o1 20080fc: 40 00 18 70 call 200e2bc 2008100: ba 10 00 18 mov %i0, %i5 if (!(((mode & O_ACCMODE) == O_RDONLY) || ((mode & O_ACCMODE) == O_RDWR))) 2008104: 80 8a 20 01 btst 1, %o0 2008108: 12 80 00 11 bne 200814c 200810c: 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) 2008110: c2 06 20 18 ld [ %i0 + 0x18 ], %g1 2008114: 80 a0 60 00 cmp %g1, 0 2008118: 22 80 00 04 be,a 2008128 200811c: c2 06 20 08 ld [ %i0 + 8 ], %g1 rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp); if (aiocbp->aio_offset < 0) rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp); 2008120: 10 80 00 0b b 200814c 2008124: b8 10 20 16 mov 0x16, %i4 rtems_aio_set_errno_return_minus_one (EBADF, aiocbp); if (aiocbp->aio_reqprio < 0 || aiocbp->aio_reqprio > AIO_PRIO_DELTA_MAX) rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp); if (aiocbp->aio_offset < 0) 2008128: 80 a0 60 00 cmp %g1, 0 200812c: 06 80 00 08 bl 200814c 2008130: b8 10 20 16 mov 0x16, %i4 rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp); req = malloc (sizeof (rtems_aio_request)); 2008134: 7f ff ef a0 call 2003fb4 2008138: 90 10 20 18 mov 0x18, %o0 if (req == NULL) 200813c: b0 92 20 00 orcc %o0, 0, %i0 2008140: 32 80 00 09 bne,a 2008164 <== ALWAYS TAKEN 2008144: fa 26 20 14 st %i5, [ %i0 + 0x14 ] rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp); 2008148: b8 10 20 0b mov 0xb, %i4 <== NOT EXECUTED 200814c: 82 10 3f ff mov -1, %g1 2008150: f8 27 60 34 st %i4, [ %i5 + 0x34 ] 2008154: 40 00 26 0f call 2011990 <__errno> 2008158: c2 27 60 38 st %g1, [ %i5 + 0x38 ] 200815c: 10 80 00 06 b 2008174 2008160: f8 22 00 00 st %i4, [ %o0 ] req->aiocbp = aiocbp; req->aiocbp->aio_lio_opcode = LIO_READ; 2008164: 82 10 20 01 mov 1, %g1 2008168: c2 27 60 30 st %g1, [ %i5 + 0x30 ] return rtems_aio_enqueue (req); 200816c: 7f ff ff 5b call 2007ed8 2008170: 81 e8 00 00 restore } 2008174: 81 c7 e0 08 ret 2008178: 91 e8 3f ff restore %g0, -1, %o0 =============================================================================== 02008184 : * 0 - otherwise */ int aio_write (struct aiocb *aiocbp) { 2008184: 9d e3 bf a0 save %sp, -96, %sp rtems_aio_request *req; int mode; mode = fcntl (aiocbp->aio_fildes, F_GETFL); 2008188: d0 06 00 00 ld [ %i0 ], %o0 200818c: 40 00 18 4c call 200e2bc 2008190: 92 10 20 03 mov 3, %o1 * 0 - otherwise */ int aio_write (struct aiocb *aiocbp) { 2008194: 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))) 2008198: 90 0a 20 03 and %o0, 3, %o0 200819c: 90 02 3f ff add %o0, -1, %o0 20081a0: 80 a2 20 01 cmp %o0, 1 20081a4: 18 80 00 11 bgu 20081e8 20081a8: 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) 20081ac: c2 06 20 18 ld [ %i0 + 0x18 ], %g1 20081b0: 80 a0 60 00 cmp %g1, 0 20081b4: 22 80 00 04 be,a 20081c4 20081b8: c2 06 20 08 ld [ %i0 + 8 ], %g1 rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp); if (aiocbp->aio_offset < 0) rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp); 20081bc: 10 80 00 0b b 20081e8 20081c0: b8 10 20 16 mov 0x16, %i4 rtems_aio_set_errno_return_minus_one (EBADF, aiocbp); if (aiocbp->aio_reqprio < 0 || aiocbp->aio_reqprio > AIO_PRIO_DELTA_MAX) rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp); if (aiocbp->aio_offset < 0) 20081c4: 80 a0 60 00 cmp %g1, 0 20081c8: 06 80 00 08 bl 20081e8 20081cc: b8 10 20 16 mov 0x16, %i4 rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp); req = malloc (sizeof (rtems_aio_request)); 20081d0: 7f ff ef 79 call 2003fb4 20081d4: 90 10 20 18 mov 0x18, %o0 if (req == NULL) 20081d8: b0 92 20 00 orcc %o0, 0, %i0 20081dc: 32 80 00 09 bne,a 2008200 <== ALWAYS TAKEN 20081e0: fa 26 20 14 st %i5, [ %i0 + 0x14 ] rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp); 20081e4: b8 10 20 0b mov 0xb, %i4 <== NOT EXECUTED 20081e8: 82 10 3f ff mov -1, %g1 20081ec: f8 27 60 34 st %i4, [ %i5 + 0x34 ] 20081f0: 40 00 25 e8 call 2011990 <__errno> 20081f4: c2 27 60 38 st %g1, [ %i5 + 0x38 ] 20081f8: 10 80 00 06 b 2008210 20081fc: f8 22 00 00 st %i4, [ %o0 ] req->aiocbp = aiocbp; req->aiocbp->aio_lio_opcode = LIO_WRITE; 2008200: 82 10 20 02 mov 2, %g1 2008204: c2 27 60 30 st %g1, [ %i5 + 0x30 ] return rtems_aio_enqueue (req); 2008208: 7f ff ff 34 call 2007ed8 200820c: 81 e8 00 00 restore } 2008210: 81 c7 e0 08 ret 2008214: 91 e8 3f ff restore %g0, -1, %o0 =============================================================================== 02003990 : #include #include int chroot( const char *path ) { 2003990: 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( 2003994: 94 10 20 19 mov 0x19, %o2 2003998: 92 10 00 18 mov %i0, %o1 200399c: 90 07 bf c8 add %fp, -56, %o0 20039a0: 17 00 80 48 sethi %hi(0x2012000), %o3 20039a4: 96 12 e1 e4 or %o3, 0x1e4, %o3 ! 20121e4 20039a8: 40 00 04 c3 call 2004cb4 20039ac: 98 02 ff fc add %o3, -4, %o4 20039b0: 90 07 bf b0 add %fp, -80, %o0 20039b4: 40 00 05 da call 200511c 20039b8: 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 ); 20039bc: 40 00 06 50 call 20052fc 20039c0: 90 07 bf b0 add %fp, -80, %o0 if ( !rtems_filesystem_global_location_is_null( new_current_loc ) ) { 20039c4: c2 02 20 10 ld [ %o0 + 0x10 ], %g1 20039c8: 39 00 80 46 sethi %hi(0x2011800), %i4 20039cc: b8 17 22 b4 or %i4, 0x2b4, %i4 ! 2011ab4 20039d0: 80 a0 40 1c cmp %g1, %i4 20039d4: 02 80 00 29 be 2003a78 20039d8: d0 27 bf ac st %o0, [ %fp + -84 ] rtems_filesystem_global_location_t *new_root_loc = 20039dc: 40 00 06 16 call 2005234 20039e0: 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)( 20039e4: c2 02 20 14 ld [ %o0 + 0x14 ], %g1 20039e8: 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 = 20039ec: c2 00 60 14 ld [ %g1 + 0x14 ], %g1 20039f0: 9f c0 40 00 call %g1 20039f4: 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 ) { 20039f8: 80 a2 20 00 cmp %o0, 0 20039fc: 32 80 00 17 bne,a 2003a58 2003a00: c2 07 60 10 ld [ %i5 + 0x10 ], %g1 sc = rtems_libio_set_private_env(); 2003a04: 40 00 03 1d call 2004678 2003a08: 01 00 00 00 nop if (sc == RTEMS_SUCCESSFUL) { 2003a0c: 80 a2 20 00 cmp %o0, 0 2003a10: 12 80 00 0c bne 2003a40 2003a14: 80 a2 20 0d cmp %o0, 0xd rtems_filesystem_global_location_assign( 2003a18: 39 00 80 48 sethi %hi(0x2012000), %i4 2003a1c: d0 07 21 dc ld [ %i4 + 0x1dc ], %o0 ! 20121dc 2003a20: 92 10 00 1d mov %i5, %o1 2003a24: 40 00 05 fb call 2005210 2003a28: 90 02 20 04 add %o0, 4, %o0 &rtems_filesystem_root, new_root_loc ); rtems_filesystem_global_location_assign( 2003a2c: d0 07 21 dc ld [ %i4 + 0x1dc ], %o0 2003a30: d2 07 bf ac ld [ %fp + -84 ], %o1 2003a34: 40 00 05 f7 call 2005210 2003a38: b0 10 20 00 clr %i0 2003a3c: 30 80 00 10 b,a 2003a7c &rtems_filesystem_current, new_current_loc ); } else { if (sc != RTEMS_UNSATISFIED) { 2003a40: 02 80 00 18 be 2003aa0 <== NEVER TAKEN 2003a44: 01 00 00 00 nop errno = ENOMEM; 2003a48: 40 00 1f f5 call 200ba1c <__errno> 2003a4c: 01 00 00 00 nop 2003a50: 10 80 00 08 b 2003a70 2003a54: 82 10 20 0c mov 0xc, %g1 ! c static inline void rtems_filesystem_location_error( const rtems_filesystem_location_info_t *loc, int eno ) { if ( !rtems_filesystem_location_is_null( loc ) ) { 2003a58: 80 a0 40 1c cmp %g1, %i4 2003a5c: 02 80 00 11 be 2003aa0 <== NEVER TAKEN 2003a60: 01 00 00 00 nop errno = eno; 2003a64: 40 00 1f ee call 200ba1c <__errno> 2003a68: 01 00 00 00 nop 2003a6c: 82 10 20 14 mov 0x14, %g1 ! 14 2003a70: 10 80 00 0c b 2003aa0 2003a74: c2 22 00 00 st %g1, [ %o0 ] if ( rv != 0 ) { rtems_filesystem_global_location_release( new_root_loc ); } } else { rv = -1; 2003a78: b0 10 3f ff mov -1, %i0 } rtems_filesystem_eval_path_cleanup( &ctx ); 2003a7c: 40 00 04 d4 call 2004dcc 2003a80: 90 07 bf c8 add %fp, -56, %o0 if ( rv != 0 ) { 2003a84: 80 a6 20 00 cmp %i0, 0 2003a88: 02 80 00 0a be 2003ab0 2003a8c: 01 00 00 00 nop rtems_filesystem_global_location_release( new_current_loc ); 2003a90: 40 00 05 c8 call 20051b0 2003a94: d0 07 bf ac ld [ %fp + -84 ], %o0 2003a98: 81 c7 e0 08 ret 2003a9c: 81 e8 00 00 restore rtems_filesystem_location_error( &new_root_loc->location, ENOTDIR ); rv = -1; } if ( rv != 0 ) { rtems_filesystem_global_location_release( new_root_loc ); 2003aa0: 40 00 05 c4 call 20051b0 2003aa4: 90 10 00 1d mov %i5, %o0 } } else { rv = -1; 2003aa8: 10 bf ff f5 b 2003a7c 2003aac: b0 10 3f ff mov -1, %i0 if ( rv != 0 ) { rtems_filesystem_global_location_release( new_current_loc ); } return rv; } 2003ab0: 81 c7 e0 08 ret 2003ab4: 81 e8 00 00 restore =============================================================================== 0200736c : int clock_gettime( clockid_t clock_id, struct timespec *tp ) { 200736c: 9d e3 bf 98 save %sp, -104, %sp if ( !tp ) 2007370: 80 a6 60 00 cmp %i1, 0 2007374: 02 80 00 26 be 200740c 2007378: 80 a6 20 01 cmp %i0, 1 rtems_set_errno_and_return_minus_one( EINVAL ); if ( clock_id == CLOCK_REALTIME ) { 200737c: 12 80 00 16 bne 20073d4 2007380: 80 a6 20 04 cmp %i0, 4 ) { Timestamp_Control tod_as_timestamp; Timestamp_Control *tod_as_timestamp_ptr; tod_as_timestamp_ptr = 2007384: 90 07 bf f8 add %fp, -8, %o0 2007388: 13 00 80 82 sethi %hi(0x2020800), %o1 200738c: 40 00 08 2f call 2009448 <_TOD_Get_with_nanoseconds> 2007390: 92 12 62 88 or %o1, 0x288, %o1 ! 2020a88 <_TOD> #endif rtems_set_errno_and_return_minus_one( EINVAL ); return 0; } 2007394: 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); 2007398: 94 10 20 00 clr %o2 200739c: 90 10 00 1c mov %i4, %o0 20073a0: 92 10 00 1d mov %i5, %o1 20073a4: 17 0e e6 b2 sethi %hi(0x3b9ac800), %o3 20073a8: 40 00 53 1c call 201c018 <__divdi3> 20073ac: 96 12 e2 00 or %o3, 0x200, %o3 ! 3b9aca00 _timespec->tv_nsec = (long) (*_timestamp % 1000000000L); 20073b0: 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); 20073b4: d2 26 40 00 st %o1, [ %i1 ] _timespec->tv_nsec = (long) (*_timestamp % 1000000000L); 20073b8: 94 10 20 00 clr %o2 20073bc: 92 10 00 1d mov %i5, %o1 20073c0: 17 0e e6 b2 sethi %hi(0x3b9ac800), %o3 20073c4: 40 00 54 00 call 201c3c4 <__moddi3> 20073c8: 96 12 e2 00 or %o3, 0x200, %o3 ! 3b9aca00 20073cc: 10 80 00 06 b 20073e4 20073d0: d2 26 60 04 st %o1, [ %i1 + 4 ] if ( clock_id == CLOCK_REALTIME ) { _TOD_Get(tp); return 0; } #ifdef CLOCK_MONOTONIC if ( clock_id == CLOCK_MONOTONIC ) { 20073d4: 12 80 00 06 bne 20073ec <== ALWAYS TAKEN 20073d8: 80 a6 20 02 cmp %i0, 2 _TOD_Get_uptime_as_timespec( tp ); 20073dc: 40 00 08 2c call 200948c <_TOD_Get_uptime_as_timespec> 20073e0: 90 10 00 19 mov %i1, %o0 return 0; 20073e4: 81 c7 e0 08 ret 20073e8: 91 e8 20 00 restore %g0, 0, %o0 } #endif #ifdef _POSIX_CPUTIME if ( clock_id == CLOCK_PROCESS_CPUTIME_ID ) { 20073ec: 02 bf ff fc be 20073dc 20073f0: 80 a6 20 03 cmp %i0, 3 return 0; } #endif #ifdef _POSIX_THREAD_CPUTIME if ( clock_id == CLOCK_THREAD_CPUTIME_ID ) 20073f4: 12 80 00 06 bne 200740c 20073f8: 01 00 00 00 nop rtems_set_errno_and_return_minus_one( ENOSYS ); 20073fc: 40 00 24 d8 call 201075c <__errno> 2007400: 01 00 00 00 nop 2007404: 10 80 00 05 b 2007418 2007408: 82 10 20 58 mov 0x58, %g1 ! 58 #endif rtems_set_errno_and_return_minus_one( EINVAL ); 200740c: 40 00 24 d4 call 201075c <__errno> 2007410: 01 00 00 00 nop 2007414: 82 10 20 16 mov 0x16, %g1 ! 16 2007418: c2 22 00 00 st %g1, [ %o0 ] return 0; } 200741c: 81 c7 e0 08 ret 2007420: 91 e8 3f ff restore %g0, -1, %o0 =============================================================================== 02025890 : int clock_settime( clockid_t clock_id, const struct timespec *tp ) { 2025890: 9d e3 bf 98 save %sp, -104, %sp if ( !tp ) 2025894: 82 96 60 00 orcc %i1, 0, %g1 2025898: 02 80 00 4b be 20259c4 <== NEVER TAKEN 202589c: 80 a6 20 01 cmp %i0, 1 rtems_set_errno_and_return_minus_one( EINVAL ); if ( clock_id == CLOCK_REALTIME ) { 20258a0: 12 80 00 41 bne 20259a4 20258a4: 80 a6 20 02 cmp %i0, 2 if ( tp->tv_sec < TOD_SECONDS_1970_THROUGH_1988 ) 20258a8: c6 00 40 00 ld [ %g1 ], %g3 20258ac: 05 08 76 b9 sethi %hi(0x21dae400), %g2 20258b0: 84 10 a0 ff or %g2, 0xff, %g2 ! 21dae4ff 20258b4: 80 a0 c0 02 cmp %g3, %g2 20258b8: 08 80 00 43 bleu 20259c4 20258bc: 05 00 81 88 sethi %hi(0x2062000), %g2 * * This rountine increments the thread dispatch level */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_increment_disable_level(void) { uint32_t level = _Thread_Dispatch_disable_level; 20258c0: c6 00 a0 40 ld [ %g2 + 0x40 ], %g3 ! 2062040 <_Thread_Dispatch_disable_level> ++level; 20258c4: 86 00 e0 01 inc %g3 _Thread_Dispatch_disable_level = level; 20258c8: c6 20 a0 40 st %g3, [ %g2 + 0x40 ] const struct timespec *tod_as_timespec ) { Timestamp_Control tod_as_timestamp; _Timestamp_Set( 20258cc: c6 00 40 00 ld [ %g1 ], %g3 &tod_as_timestamp, tod_as_timespec->tv_sec, tod_as_timespec->tv_nsec ); _TOD_Set_with_timestamp( &tod_as_timestamp ); 20258d0: 90 07 bf f8 add %fp, -8, %o0 const struct timespec *tod_as_timespec ) { Timestamp_Control tod_as_timestamp; _Timestamp_Set( 20258d4: 85 38 e0 1f sra %g3, 0x1f, %g2 Timestamp64_Control *_time, Timestamp64_Control _seconds, Timestamp64_Control _nanoseconds ) { *_time = _seconds * 1000000000L + _nanoseconds; 20258d8: 89 28 a0 03 sll %g2, 3, %g4 20258dc: bb 28 e0 03 sll %g3, 3, %i5 20258e0: b7 30 e0 1d srl %g3, 0x1d, %i3 20258e4: b8 16 c0 04 or %i3, %g4, %i4 20258e8: 89 37 60 1b srl %i5, 0x1b, %g4 20258ec: b5 2f 20 05 sll %i4, 5, %i2 20258f0: b7 2f 60 05 sll %i5, 5, %i3 20258f4: b4 11 00 1a or %g4, %i2, %i2 20258f8: ba a6 c0 1d subcc %i3, %i5, %i5 20258fc: 89 37 60 1a srl %i5, 0x1a, %g4 2025900: b8 66 80 1c subx %i2, %i4, %i4 2025904: b7 2f 60 06 sll %i5, 6, %i3 2025908: b5 2f 20 06 sll %i4, 6, %i2 202590c: b6 a6 c0 1d subcc %i3, %i5, %i3 2025910: b4 11 00 1a or %g4, %i2, %i2 2025914: b4 66 80 1c subx %i2, %i4, %i2 2025918: b2 86 c0 03 addcc %i3, %g3, %i1 202591c: b0 46 80 02 addx %i2, %g2, %i0 2025920: 89 36 60 1e srl %i1, 0x1e, %g4 2025924: 85 2e 20 02 sll %i0, 2, %g2 2025928: 84 11 00 02 or %g4, %g2, %g2 202592c: 87 2e 60 02 sll %i1, 2, %g3 2025930: ba 86 40 03 addcc %i1, %g3, %i5 2025934: b8 46 00 02 addx %i0, %g2, %i4 2025938: 89 37 60 1e srl %i5, 0x1e, %g4 202593c: 85 2f 20 02 sll %i4, 2, %g2 2025940: 84 11 00 02 or %g4, %g2, %g2 2025944: 87 2f 60 02 sll %i5, 2, %g3 2025948: b6 87 40 03 addcc %i5, %g3, %i3 202594c: b4 47 00 02 addx %i4, %g2, %i2 2025950: bb 2e e0 02 sll %i3, 2, %i5 2025954: 85 36 e0 1e srl %i3, 0x1e, %g2 2025958: 86 86 c0 1d addcc %i3, %i5, %g3 202595c: b9 2e a0 02 sll %i2, 2, %i4 2025960: b8 10 80 1c or %g2, %i4, %i4 2025964: 84 46 80 1c addx %i2, %i4, %g2 2025968: bb 28 a0 09 sll %g2, 9, %i5 202596c: b9 30 e0 17 srl %g3, 0x17, %i4 2025970: 84 17 00 1d or %i4, %i5, %g2 2025974: fa 00 60 04 ld [ %g1 + 4 ], %i5 2025978: 89 28 e0 09 sll %g3, 9, %g4 202597c: b6 81 00 1d addcc %g4, %i5, %i3 2025980: b9 3f 60 1f sra %i5, 0x1f, %i4 rtems_set_errno_and_return_minus_one( ENOSYS ); #endif else rtems_set_errno_and_return_minus_one( EINVAL ); return 0; 2025984: b0 10 20 00 clr %i0 2025988: 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 ); 202598c: 40 00 04 3b call 2026a78 <_TOD_Set_with_timestamp> 2025990: 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(); 2025994: 7f ff 90 d0 call 2009cd4 <_Thread_Enable_dispatch> 2025998: 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; 202599c: 81 c7 e0 08 ret 20259a0: 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 ) 20259a4: 02 80 00 04 be 20259b4 20259a8: 80 a6 20 03 cmp %i0, 3 rtems_set_errno_and_return_minus_one( ENOSYS ); #endif #ifdef _POSIX_THREAD_CPUTIME else if ( clock_id == CLOCK_THREAD_CPUTIME_ID ) 20259ac: 12 80 00 06 bne 20259c4 20259b0: 01 00 00 00 nop rtems_set_errno_and_return_minus_one( ENOSYS ); 20259b4: 40 00 44 28 call 2036a54 <__errno> 20259b8: 01 00 00 00 nop 20259bc: 10 80 00 05 b 20259d0 20259c0: 82 10 20 58 mov 0x58, %g1 ! 58 #endif else rtems_set_errno_and_return_minus_one( EINVAL ); 20259c4: 40 00 44 24 call 2036a54 <__errno> 20259c8: 01 00 00 00 nop 20259cc: 82 10 20 16 mov 0x16, %g1 ! 16 20259d0: c2 22 00 00 st %g1, [ %o0 ] return 0; } 20259d4: 81 c7 e0 08 ret 20259d8: 91 e8 3f ff restore %g0, -1, %o0 =============================================================================== 02003624 : dev_t dev, const char *name, rtems_disk_device **dd_ptr, char **alloc_name_ptr ) { 2003624: 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) { 2003628: 03 00 80 85 sethi %hi(0x2021400), %g1 200362c: e0 00 61 30 ld [ %g1 + 0x130 ], %l0 ! 2021530 2003630: 80 a6 00 10 cmp %i0, %l0 2003634: 0a 80 00 16 bcs 200368c 2003638: 03 00 80 85 sethi %hi(0x2021400), %g1 rtems_disk_device_table *table = disktab; rtems_device_major_number old_size = disktab_size; rtems_device_major_number new_size = 2 * old_size; 200363c: bb 2c 20 01 sll %l0, 1, %i5 if (major >= new_size) { 2003640: 80 a6 00 1d cmp %i0, %i5 2003644: 0a 80 00 03 bcs 2003650 <== NEVER TAKEN 2003648: d0 00 61 34 ld [ %g1 + 0x134 ], %o0 new_size = major + 1; 200364c: ba 06 20 01 add %i0, 1, %i5 } table = realloc(table, new_size * sizeof(*table)); 2003650: 40 00 08 7a call 2005838 2003654: 93 2f 60 03 sll %i5, 3, %o1 if (table == NULL) { 2003658: a2 92 20 00 orcc %o0, 0, %l1 200365c: 02 80 00 58 be 20037bc <== ALWAYS TAKEN 2003660: 94 27 40 10 sub %i5, %l0, %o2 return NULL; } memset(table + old_size, 0, (new_size - old_size) * sizeof(*table)); 2003664: 91 2c 20 03 sll %l0, 3, %o0 <== NOT EXECUTED 2003668: 92 10 20 00 clr %o1 <== NOT EXECUTED 200366c: 90 04 40 08 add %l1, %o0, %o0 <== NOT EXECUTED 2003670: 40 00 43 6e call 2014428 <== NOT EXECUTED 2003674: 95 2a a0 03 sll %o2, 3, %o2 <== NOT EXECUTED disktab = table; 2003678: 03 00 80 85 sethi %hi(0x2021400), %g1 <== NOT EXECUTED 200367c: e2 20 61 34 st %l1, [ %g1 + 0x134 ] ! 2021534 <== NOT EXECUTED disktab_size = new_size; 2003680: 03 00 80 85 sethi %hi(0x2021400), %g1 <== NOT EXECUTED 2003684: fa 20 61 30 st %i5, [ %g1 + 0x130 ] ! 2021530 <== NOT EXECUTED } if (disktab [major].minor == NULL || minor >= disktab[major].size) { 2003688: 03 00 80 85 sethi %hi(0x2021400), %g1 <== NOT EXECUTED 200368c: e4 00 61 34 ld [ %g1 + 0x134 ], %l2 ! 2021534 2003690: a3 2e 20 03 sll %i0, 3, %l1 2003694: d0 04 80 11 ld [ %l2 + %l1 ], %o0 2003698: a8 04 80 11 add %l2, %l1, %l4 200369c: 80 a2 20 00 cmp %o0, 0 20036a0: 02 80 00 05 be 20036b4 20036a4: e0 05 20 04 ld [ %l4 + 4 ], %l0 20036a8: 80 a6 40 10 cmp %i1, %l0 20036ac: 2a 80 00 16 bcs,a 2003704 20036b0: 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) { 20036b4: 80 a4 20 00 cmp %l0, 0 20036b8: 02 80 00 03 be 20036c4 20036bc: ba 10 20 08 mov 8, %i5 new_size = DISKTAB_INITIAL_SIZE; } else { new_size = 2 * old_size; 20036c0: bb 2c 20 01 sll %l0, 1, %i5 } if (minor >= new_size) { 20036c4: 80 a6 40 1d cmp %i1, %i5 20036c8: 3a 80 00 02 bcc,a 20036d0 20036cc: ba 06 60 01 add %i1, 1, %i5 new_size = minor + 1; } table = realloc(table, new_size * sizeof(*table)); 20036d0: 40 00 08 5a call 2005838 20036d4: 93 2f 60 02 sll %i5, 2, %o1 if (table == NULL) { 20036d8: a6 92 20 00 orcc %o0, 0, %l3 20036dc: 02 80 00 38 be 20037bc 20036e0: 94 27 40 10 sub %i5, %l0, %o2 return NULL; } memset(table + old_size, 0, (new_size - old_size) * sizeof(*table)); 20036e4: 91 2c 20 02 sll %l0, 2, %o0 20036e8: 92 10 20 00 clr %o1 20036ec: 90 04 c0 08 add %l3, %o0, %o0 20036f0: 40 00 43 4e call 2014428 20036f4: 95 2a a0 02 sll %o2, 2, %o2 disktab [major].minor = table; 20036f8: e6 24 80 11 st %l3, [ %l2 + %l1 ] disktab [major].size = new_size; 20036fc: fa 25 20 04 st %i5, [ %l4 + 4 ] } return disktab [major].minor + minor; 2003700: e2 04 80 11 ld [ %l2 + %l1 ], %l1 2003704: a1 2e 60 02 sll %i1, 2, %l0 2003708: 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) { 200370c: 80 a0 60 00 cmp %g1, 0 2003710: 32 80 00 04 bne,a 2003720 <== ALWAYS TAKEN 2003714: c4 04 40 10 ld [ %l1 + %l0 ], %g2 return RTEMS_NO_MEMORY; 2003718: 10 80 00 2a b 20037c0 <== NOT EXECUTED 200371c: 82 10 20 1a mov 0x1a, %g1 <== NOT EXECUTED } if (*dd_entry != NULL) { 2003720: 80 a0 a0 00 cmp %g2, 0 2003724: 12 80 00 27 bne 20037c0 2003728: 82 10 20 0c mov 0xc, %g1 return RTEMS_RESOURCE_IN_USE; } dd = malloc(sizeof(*dd)); 200372c: 40 00 05 7d call 2004d20 2003730: 90 10 20 78 mov 0x78, %o0 if (dd == NULL) { 2003734: ba 92 20 00 orcc %o0, 0, %i5 2003738: 02 80 00 21 be 20037bc <== NEVER TAKEN 200373c: 80 a6 a0 00 cmp %i2, 0 return RTEMS_NO_MEMORY; } if (name != NULL) { 2003740: 02 80 00 11 be 2003784 2003744: a4 10 20 00 clr %l2 alloc_name = strdup(name); 2003748: 40 00 44 91 call 201498c 200374c: 90 10 00 1a mov %i2, %o0 if (alloc_name == NULL) { 2003750: a4 92 20 00 orcc %o0, 0, %l2 2003754: 12 80 00 11 bne 2003798 <== ALWAYS TAKEN 2003758: b4 10 00 08 mov %o0, %i2 free(dd); 200375c: 40 00 04 30 call 200481c <== NOT EXECUTED 2003760: 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; 2003764: 10 80 00 17 b 20037c0 <== NOT EXECUTED 2003768: 82 10 20 1a mov 0x1a, %g1 <== NOT EXECUTED } } if (name != NULL) { if (mknod(alloc_name, 0777 | S_IFBLK, dev) < 0) { free(alloc_name); 200376c: 40 00 04 2c call 200481c <== NOT EXECUTED 2003770: 90 10 00 1a mov %i2, %o0 <== NOT EXECUTED free(dd); 2003774: 40 00 04 2a call 200481c <== NOT EXECUTED 2003778: 90 10 00 1d mov %i5, %o0 <== NOT EXECUTED return RTEMS_UNSATISFIED; 200377c: 10 80 00 11 b 20037c0 <== NOT EXECUTED 2003780: 82 10 20 0d mov 0xd, %g1 <== NOT EXECUTED } } *dd_entry = dd; 2003784: fa 24 40 10 st %i5, [ %l1 + %l0 ] *dd_ptr = dd; 2003788: fa 26 c0 00 st %i5, [ %i3 ] *alloc_name_ptr = alloc_name; 200378c: e4 27 00 00 st %l2, [ %i4 ] return RTEMS_SUCCESSFUL; 2003790: 10 80 00 0c b 20037c0 2003794: 82 10 20 00 clr %g1 return RTEMS_NO_MEMORY; } } if (name != NULL) { if (mknod(alloc_name, 0777 | S_IFBLK, dev) < 0) { 2003798: 13 00 00 18 sethi %hi(0x6000), %o1 200379c: 94 10 00 18 mov %i0, %o2 20037a0: 92 12 61 ff or %o1, 0x1ff, %o1 20037a4: 40 00 05 cf call 2004ee0 20037a8: 96 10 00 19 mov %i1, %o3 20037ac: 80 a2 20 00 cmp %o0, 0 20037b0: 36 bf ff f6 bge,a 2003788 <== ALWAYS TAKEN 20037b4: fa 24 40 10 st %i5, [ %l1 + %l0 ] 20037b8: 30 bf ff ed b,a 200376c <== 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; 20037bc: 82 10 20 1a mov 0x1a, %g1 *dd_entry = dd; *dd_ptr = dd; *alloc_name_ptr = alloc_name; return RTEMS_SUCCESSFUL; } 20037c0: 81 c7 e0 08 ret 20037c4: 91 e8 00 01 restore %g0, %g1, %o0 =============================================================================== 0200490c : * 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) 200490c: 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) 2004910: 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) 2004914: b8 10 00 18 mov %i0, %i4 if (new_part_desc == NULL) { return RTEMS_INTERNAL_ERROR; } *new_part_desc = NULL; 2004918: c0 26 40 00 clr [ %i1 ] if ((part_desc = calloc(1, sizeof(rtems_part_desc_t))) == NULL) 200491c: 92 10 20 28 mov 0x28, %o1 2004920: 40 00 03 06 call 2005538 2004924: b0 10 20 1a mov 0x1a, %i0 2004928: 80 a2 20 00 cmp %o0, 0 200492c: 02 80 00 27 be 20049c8 <== NEVER TAKEN 2004930: ba 10 00 08 mov %o0, %i5 { return RTEMS_NO_MEMORY; } part_desc->bootable = *(data + RTEMS_IDE_PARTITION_BOOTABLE_OFFSET); 2004934: 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)); 2004938: 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); 200493c: c2 2a 00 00 stb %g1, [ %o0 ] part_desc->sys_type = *(data + RTEMS_IDE_PARTITION_SYS_TYPE_OFFSET); 2004940: 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)); 2004944: 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); 2004948: 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)); 200494c: 40 00 43 49 call 2015670 2004950: 90 07 bf fc add %fp, -4, %o0 part_desc->start = LE_TO_CPU_U32(temp); 2004954: 7f ff ff ac call 2004804 2004958: d0 07 bf fc ld [ %fp + -4 ], %o0 memcpy(&temp, data + RTEMS_IDE_PARTITION_SIZE_OFFSET, sizeof(uint32_t)); 200495c: 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); 2004960: d0 27 60 04 st %o0, [ %i5 + 4 ] memcpy(&temp, data + RTEMS_IDE_PARTITION_SIZE_OFFSET, sizeof(uint32_t)); 2004964: 94 10 20 04 mov 4, %o2 2004968: 40 00 43 42 call 2015670 200496c: 90 07 bf fc add %fp, -4, %o0 part_desc->size = LE_TO_CPU_U32(temp); 2004970: 7f ff ff a5 call 2004804 2004974: d0 07 bf fc ld [ %fp + -4 ], %o0 2004978: 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) || 200497c: 82 0e e0 7f and %i3, 0x7f, %g1 2004980: 80 a0 60 05 cmp %g1, 5 2004984: 02 80 00 0c be 20049b4 2004988: 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))); 200498c: 11 00 80 90 sethi %hi(0x2024000), %o0 2004990: 92 0e e0 ff and %i3, 0xff, %o1 2004994: 90 12 23 38 or %o0, 0x338, %o0 2004998: 40 00 42 c8 call 20154b8 200499c: 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) || 20049a0: 80 a2 20 00 cmp %o0, 0 20049a4: 02 80 00 06 be 20049bc 20049a8: 80 a7 20 00 cmp %i4, 0 ((is_fat_partition(part_desc->sys_type)) && (part_desc->size != 0))) { 20049ac: 02 80 00 04 be 20049bc <== NEVER TAKEN 20049b0: 01 00 00 00 nop *new_part_desc = part_desc; 20049b4: 10 80 00 04 b 20049c4 20049b8: fa 26 40 00 st %i5, [ %i1 ] } else { /* empty partition */ free(part_desc); 20049bc: 40 00 03 b3 call 2005888 20049c0: 90 10 00 1d mov %i5, %o0 } return RTEMS_SUCCESSFUL; 20049c4: b0 10 20 00 clr %i0 } 20049c8: 81 c7 e0 08 ret 20049cc: 81 e8 00 00 restore =============================================================================== 02002a3c : #endif #include "devfs.h" void devFS_Show(void) { 2002a3c: 9d e3 bf a0 save %sp, -96, %sp rtems_filesystem_location_info_t *rootloc = &rtems_filesystem_root->location; 2002a40: 03 00 80 68 sethi %hi(0x201a000), %g1 2002a44: c2 00 60 84 ld [ %g1 + 0x84 ], %g1 ! 201a084 if (rootloc->mt_entry->ops == &devFS_ops) { 2002a48: 05 00 80 61 sethi %hi(0x2018400), %g2 2002a4c: c2 00 60 04 ld [ %g1 + 4 ], %g1 2002a50: 84 10 a0 ec or %g2, 0xec, %g2 2002a54: c2 00 60 14 ld [ %g1 + 0x14 ], %g1 2002a58: c6 00 60 0c ld [ %g1 + 0xc ], %g3 2002a5c: 80 a0 c0 02 cmp %g3, %g2 2002a60: 12 80 00 25 bne 2002af4 <== NEVER TAKEN 2002a64: 33 00 80 61 sethi %hi(0x2018400), %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; 2002a68: c2 00 60 10 ld [ %g1 + 0x10 ], %g1 size_t j = 0; size_t m = current->namelen; printk("/"); for (j = 0; j < m; ++j) { printk("%c", current->name [j]); 2002a6c: 31 00 80 61 sethi %hi(0x2018400), %i0 } printk( 2002a70: 21 00 80 61 sethi %hi(0x2018400), %l0 rtems_filesystem_location_info_t *rootloc = &rtems_filesystem_root->location; if (rootloc->mt_entry->ops == &devFS_ops) { const devFS_data *data = devFS_get_data(rootloc); size_t i = 0; size_t n = data->count; 2002a74: f4 00 60 04 ld [ %g1 + 4 ], %i2 2002a78: fa 00 40 00 ld [ %g1 ], %i5 devFS_node *nodes = data->nodes; for (i = 0; i < n; ++i) { 2002a7c: b6 10 20 00 clr %i3 if (current->name != NULL) { size_t j = 0; size_t m = current->namelen; printk("/"); 2002a80: b2 16 61 40 or %i1, 0x140, %i1 for (j = 0; j < m; ++j) { printk("%c", current->name [j]); 2002a84: b0 16 21 48 or %i0, 0x148, %i0 const devFS_data *data = devFS_get_data(rootloc); size_t i = 0; size_t n = data->count; devFS_node *nodes = data->nodes; for (i = 0; i < n; ++i) { 2002a88: 10 80 00 18 b 2002ae8 2002a8c: a0 14 21 50 or %l0, 0x150, %l0 devFS_node *current = nodes + i; if (current->name != NULL) { 2002a90: 80 a0 60 00 cmp %g1, 0 2002a94: 22 80 00 14 be,a 2002ae4 2002a98: b6 06 e0 01 inc %i3 size_t j = 0; size_t m = current->namelen; 2002a9c: e2 07 60 04 ld [ %i5 + 4 ], %l1 printk("/"); 2002aa0: 90 10 00 19 mov %i1, %o0 2002aa4: 40 00 04 94 call 2003cf4 2002aa8: b8 10 20 00 clr %i4 for (j = 0; j < m; ++j) { 2002aac: 10 80 00 07 b 2002ac8 2002ab0: 80 a7 00 11 cmp %i4, %l1 printk("%c", current->name [j]); 2002ab4: 90 10 00 18 mov %i0, %o0 2002ab8: d2 48 40 1c ldsb [ %g1 + %i4 ], %o1 2002abc: 40 00 04 8e call 2003cf4 2002ac0: 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) { 2002ac4: 80 a7 00 11 cmp %i4, %l1 2002ac8: 32 bf ff fb bne,a 2002ab4 2002acc: c2 07 40 00 ld [ %i5 ], %g1 printk("%c", current->name [j]); } printk( 2002ad0: d2 07 60 08 ld [ %i5 + 8 ], %o1 2002ad4: d4 07 60 0c ld [ %i5 + 0xc ], %o2 2002ad8: 40 00 04 87 call 2003cf4 2002adc: 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) { 2002ae0: b6 06 e0 01 inc %i3 2002ae4: ba 07 60 14 add %i5, 0x14, %i5 2002ae8: 80 a6 c0 1a cmp %i3, %i2 2002aec: 32 bf ff e9 bne,a 2002a90 2002af0: c2 07 40 00 ld [ %i5 ], %g1 2002af4: 81 c7 e0 08 ret 2002af8: 81 e8 00 00 restore =============================================================================== 0200bbec : } void devFS_eval_path( rtems_filesystem_eval_path_context_t *ctx ) { 200bbec: 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; 200bbf0: c2 06 20 2c ld [ %i0 + 0x2c ], %g1 static inline const char *rtems_filesystem_eval_path_get_path( rtems_filesystem_eval_path_context_t *ctx ) { return ctx->path; 200bbf4: f2 06 00 00 ld [ %i0 ], %i1 200bbf8: c2 00 60 10 ld [ %g1 + 0x10 ], %g1 static inline size_t rtems_filesystem_eval_path_get_pathlen( rtems_filesystem_eval_path_context_t *ctx ) { return ctx->pathlen; 200bbfc: f6 06 20 04 ld [ %i0 + 4 ], %i3 size_t pathlen, devFS_node **free_node_ptr ) { size_t i = 0; size_t n = data->count; 200bc00: e2 00 60 04 ld [ %g1 + 4 ], %l1 200bc04: fa 00 40 00 ld [ %g1 ], %i5 devFS_node *nodes = data->nodes; devFS_node *node = NULL; 200bc08: b8 10 20 00 clr %i4 devFS_node *free_node = NULL; 200bc0c: 82 10 20 00 clr %g1 for (i = 0; (free_node == NULL || node == NULL) && i < n; ++i) { 200bc10: 10 80 00 12 b 200bc58 200bc14: b4 10 20 00 clr %i2 devFS_node *current = nodes + i; if (current->name != NULL) { 200bc18: 80 a2 20 00 cmp %o0, 0 200bc1c: 02 80 00 0c be 200bc4c 200bc20: a0 10 00 1d mov %i5, %l0 if ( 200bc24: c4 07 60 04 ld [ %i5 + 4 ], %g2 200bc28: 80 a0 80 1b cmp %g2, %i3 200bc2c: 12 80 00 08 bne 200bc4c 200bc30: a0 10 00 01 mov %g1, %l0 current->namelen == pathlen && memcmp(current->name, path, pathlen) == 0 200bc34: 92 10 00 19 mov %i1, %o1 200bc38: 40 00 0d 82 call 200f240 200bc3c: 94 10 00 1b mov %i3, %o2 200bc40: 80 a2 20 00 cmp %o0, 0 200bc44: 22 80 00 02 be,a 200bc4c 200bc48: b8 10 00 1d mov %i5, %i4 size_t n = data->count; devFS_node *nodes = data->nodes; devFS_node *node = NULL; devFS_node *free_node = NULL; for (i = 0; (free_node == NULL || node == NULL) && i < n; ++i) { 200bc4c: b4 06 a0 01 inc %i2 200bc50: ba 07 60 14 add %i5, 0x14, %i5 200bc54: 82 10 00 10 mov %l0, %g1 200bc58: 80 a7 20 00 cmp %i4, 0 200bc5c: 02 80 00 0a be 200bc84 200bc60: 80 a6 80 11 cmp %i2, %l1 200bc64: 80 a0 60 00 cmp %g1, 0 200bc68: 02 80 00 07 be 200bc84 200bc6c: 80 a6 80 11 cmp %i2, %l1 rtems_filesystem_eval_path_get_pathlen(ctx), &free_node ); int eval_flags = rtems_filesystem_eval_path_get_flags(ctx); if (node != NULL) { 200bc70: 80 a7 20 00 cmp %i4, 0 200bc74: 12 80 00 08 bne 200bc94 200bc78: c4 06 20 10 ld [ %i0 + 0x10 ], %g2 rtems_filesystem_eval_path_clear_path(ctx); } else { rtems_filesystem_eval_path_error(ctx, EEXIST); } } else { if ((eval_flags & RTEMS_FS_MAKE) != 0) { 200bc7c: 10 80 00 0b b 200bca8 200bc80: 80 88 a0 20 btst 0x20, %g2 size_t n = data->count; devFS_node *nodes = data->nodes; devFS_node *node = NULL; devFS_node *free_node = NULL; for (i = 0; (free_node == NULL || node == NULL) && i < n; ++i) { 200bc84: 32 bf ff e5 bne,a 200bc18 200bc88: d0 07 40 00 ld [ %i5 ], %o0 rtems_filesystem_eval_path_get_pathlen(ctx), &free_node ); int eval_flags = rtems_filesystem_eval_path_get_flags(ctx); if (node != NULL) { 200bc8c: 10 bf ff fa b 200bc74 200bc90: 80 a7 20 00 cmp %i4, 0 if ((eval_flags & RTEMS_FS_EXCLUSIVE) == 0) { 200bc94: 80 88 a0 40 btst 0x40, %g2 200bc98: 12 80 00 12 bne 200bce0 200bc9c: b2 10 20 11 mov 0x11, %i1 currentloc->node_access = node; 200bca0: 10 80 00 0a b 200bcc8 200bca4: f8 26 20 20 st %i4, [ %i0 + 0x20 ] rtems_filesystem_eval_path_clear_path(ctx); } else { rtems_filesystem_eval_path_error(ctx, EEXIST); } } else { if ((eval_flags & RTEMS_FS_MAKE) != 0) { 200bca8: 02 80 00 0d be 200bcdc <== NEVER TAKEN 200bcac: 80 a0 60 00 cmp %g1, 0 if (free_node != NULL) { 200bcb0: 02 80 00 09 be 200bcd4 200bcb4: 84 10 21 ff mov 0x1ff, %g2 free_node->mode = S_IRWXU | S_IRWXG | S_IRWXO; 200bcb8: c4 20 60 10 st %g2, [ %g1 + 0x10 ] currentloc->node_access = free_node; 200bcbc: c2 26 20 20 st %g1, [ %i0 + 0x20 ] rtems_filesystem_eval_path_context_t *ctx, const char *token, size_t tokenlen ) { ctx->token = token; 200bcc0: f2 26 20 08 st %i1, [ %i0 + 8 ] ctx->tokenlen = tokenlen; 200bcc4: f6 26 20 0c st %i3, [ %i0 + 0xc ] static inline void rtems_filesystem_eval_path_clear_path( rtems_filesystem_eval_path_context_t *ctx ) { ctx->pathlen = 0; 200bcc8: c0 26 20 04 clr [ %i0 + 4 ] 200bccc: 81 c7 e0 08 ret 200bcd0: 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); 200bcd4: 10 80 00 03 b 200bce0 200bcd8: b2 10 20 1c mov 0x1c, %i1 } } else { rtems_filesystem_eval_path_error(ctx, ENOENT); 200bcdc: b2 10 20 02 mov 2, %i1 <== NOT EXECUTED 200bce0: 7f ff e3 de call 2004c58 200bce4: 81 e8 00 00 restore =============================================================================== 020035fc : const char *name, size_t namelen, mode_t mode, dev_t dev ) { 20035fc: 9d e3 bf a0 save %sp, -96, %sp int rv = 0; if (namelen != 3 || name [0] != 'd' || name [1] != 'e' || name [2] != 'v') { 2003600: 80 a6 a0 03 cmp %i2, 3 2003604: 12 80 00 0e bne 200363c 2003608: 05 00 00 2c sethi %hi(0xb000), %g2 200360c: c2 4e 40 00 ldsb [ %i1 ], %g1 2003610: 80 a0 60 64 cmp %g1, 0x64 2003614: 12 80 00 0b bne 2003640 <== NEVER TAKEN 2003618: 03 00 00 08 sethi %hi(0x2000), %g1 200361c: c2 4e 60 01 ldsb [ %i1 + 1 ], %g1 2003620: 80 a0 60 65 cmp %g1, 0x65 2003624: 12 80 00 07 bne 2003640 <== NEVER TAKEN 2003628: 03 00 00 08 sethi %hi(0x2000), %g1 200362c: c2 4e 60 02 ldsb [ %i1 + 2 ], %g1 2003630: 80 a0 60 76 cmp %g1, 0x76 2003634: 02 80 00 1b be 20036a0 <== ALWAYS TAKEN 2003638: 03 00 00 3c sethi %hi(0xf000), %g1 if (S_ISBLK(mode) || S_ISCHR(mode)) { 200363c: 03 00 00 08 sethi %hi(0x2000), %g1 2003640: 84 0e c0 02 and %i3, %g2, %g2 2003644: 80 a0 80 01 cmp %g2, %g1 2003648: 12 80 00 1b bne 20036b4 200364c: 01 00 00 00 nop char *dupname = malloc(namelen); 2003650: 40 00 01 e6 call 2003de8 2003654: 90 10 00 1a mov %i2, %o0 if (dupname != NULL) { 2003658: 84 92 20 00 orcc %o0, 0, %g2 200365c: 02 80 00 0d be 2003690 2003660: 92 10 00 19 mov %i1, %o1 devFS_node *node = parentloc->node_access; 2003664: c2 06 20 08 ld [ %i0 + 8 ], %g1 node->name = dupname; 2003668: c4 20 40 00 st %g2, [ %g1 ] node->namelen = namelen; 200366c: f4 20 60 04 st %i2, [ %g1 + 4 ] node->major = rtems_filesystem_dev_major_t(dev); 2003670: f8 20 60 08 st %i4, [ %g1 + 8 ] node->minor = rtems_filesystem_dev_minor_t(dev); 2003674: fa 20 60 0c st %i5, [ %g1 + 0xc ] node->mode = mode; 2003678: f6 20 60 10 st %i3, [ %g1 + 0x10 ] memcpy(dupname, name, namelen); 200367c: 94 10 00 1a mov %i2, %o2 2003680: 40 00 2f 1a call 200f2e8 2003684: b0 10 20 00 clr %i0 2003688: 81 c7 e0 08 ret 200368c: 81 e8 00 00 restore } else { errno = ENOMEM; 2003690: 40 00 2b 11 call 200e2d4 <__errno> 2003694: 01 00 00 00 nop 2003698: 10 80 00 0a b 20036c0 200369c: 82 10 20 0c mov 0xc, %g1 ! c } else { errno = ENOTSUP; rv = -1; } } else { if (!S_ISDIR(mode)) { 20036a0: b6 0e c0 01 and %i3, %g1, %i3 20036a4: 03 00 00 10 sethi %hi(0x4000), %g1 20036a8: 80 a6 c0 01 cmp %i3, %g1 20036ac: 02 bf ff f7 be 2003688 <== ALWAYS TAKEN 20036b0: b0 10 20 00 clr %i0 errno = ENOTSUP; 20036b4: 40 00 2b 08 call 200e2d4 <__errno> 20036b8: 01 00 00 00 nop 20036bc: 82 10 20 86 mov 0x86, %g1 ! 86 20036c0: c2 22 00 00 st %g1, [ %o0 ] rv = -1; 20036c4: b0 10 3f ff mov -1, %i0 } } return rv; } 20036c8: 81 c7 e0 08 ret 20036cc: 81 e8 00 00 restore =============================================================================== 020035b4 : */ static volatile bool diskdevs_protected; static rtems_status_code disk_lock(void) { 20035b4: 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); 20035b8: 03 00 80 85 sethi %hi(0x2021400), %g1 20035bc: d0 00 61 2c ld [ %g1 + 0x12c ], %o0 ! 202152c 20035c0: 92 10 20 00 clr %o1 20035c4: 94 10 20 00 clr %o2 20035c8: 40 00 15 4c call 2008af8 20035cc: b0 10 20 16 mov 0x16, %i0 if (sc == RTEMS_SUCCESSFUL) { 20035d0: 80 a2 20 00 cmp %o0, 0 20035d4: 12 80 00 05 bne 20035e8 <== NEVER TAKEN 20035d8: 84 10 20 01 mov 1, %g2 diskdevs_protected = true; 20035dc: 03 00 80 85 sethi %hi(0x2021400), %g1 return RTEMS_SUCCESSFUL; 20035e0: 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; 20035e4: c4 28 61 28 stb %g2, [ %g1 + 0x128 ] return RTEMS_SUCCESSFUL; } else { return RTEMS_NOT_CONFIGURED; } } 20035e8: 81 c7 e0 08 ret 20035ec: 81 e8 00 00 restore =============================================================================== 020035f0 : static void disk_unlock(void) { 20035f0: 9d e3 bf a0 save %sp, -96, %sp rtems_status_code sc = RTEMS_SUCCESSFUL; diskdevs_protected = false; 20035f4: 03 00 80 85 sethi %hi(0x2021400), %g1 20035f8: c0 28 61 28 clrb [ %g1 + 0x128 ] ! 2021528 sc = rtems_semaphore_release(diskdevs_mutex); 20035fc: 03 00 80 85 sethi %hi(0x2021400), %g1 2003600: 40 00 15 87 call 2008c1c 2003604: d0 00 61 2c ld [ %g1 + 0x12c ], %o0 ! 202152c if (sc != RTEMS_SUCCESSFUL) { 2003608: 80 a2 20 00 cmp %o0, 0 200360c: 02 80 00 04 be 200361c <== ALWAYS TAKEN 2003610: 11 37 ab 6f sethi %hi(0xdeadbc00), %o0 /* FIXME: Error number */ rtems_fatal_error_occurred(0xdeadbeef); 2003614: 40 00 16 fe call 200920c <== NOT EXECUTED 2003618: 90 12 22 ef or %o0, 0x2ef, %o0 ! deadbeef <== NOT EXECUTED 200361c: 81 c7 e0 08 ret 2003620: 81 e8 00 00 restore =============================================================================== 02005124 : /* * Drain output queue */ static void drainOutput (struct rtems_termios_tty *tty) 2005124: 9d e3 bf a0 save %sp, -96, %sp { rtems_interrupt_level level; rtems_status_code sc; if (tty->device.outputUsesInterrupts != TERMIOS_POLLED) { rtems_interrupt_disable (level); 2005128: 7f ff f5 27 call 20025c4 200512c: 01 00 00 00 nop while (tty->rawOutBuf.Tail != tty->rawOutBuf.Head) { tty->rawOutBufState = rob_wait; 2005130: 10 80 00 0f b 200516c 2005134: b8 10 20 02 mov 2, %i4 ! 2 rtems_interrupt_enable (level); 2005138: 7f ff f5 27 call 20025d4 <== NOT EXECUTED 200513c: 01 00 00 00 nop <== NOT EXECUTED sc = rtems_semaphore_obtain( 2005140: d0 06 20 8c ld [ %i0 + 0x8c ], %o0 <== NOT EXECUTED 2005144: 92 10 20 00 clr %o1 <== NOT EXECUTED 2005148: 40 00 09 5f call 20076c4 <== NOT EXECUTED 200514c: 94 10 20 00 clr %o2 <== NOT EXECUTED tty->rawOutBuf.Semaphore, RTEMS_WAIT, RTEMS_NO_TIMEOUT); if (sc != RTEMS_SUCCESSFUL) 2005150: 80 a2 20 00 cmp %o0, 0 <== NOT EXECUTED 2005154: 02 80 00 04 be 2005164 <== NOT EXECUTED 2005158: 01 00 00 00 nop <== NOT EXECUTED rtems_fatal_error_occurred (sc); 200515c: 40 00 0b 37 call 2007e38 <== NOT EXECUTED 2005160: 01 00 00 00 nop <== NOT EXECUTED rtems_interrupt_disable (level); 2005164: 7f ff f5 18 call 20025c4 <== NOT EXECUTED 2005168: 01 00 00 00 nop <== NOT EXECUTED rtems_interrupt_level level; rtems_status_code sc; if (tty->device.outputUsesInterrupts != TERMIOS_POLLED) { rtems_interrupt_disable (level); while (tty->rawOutBuf.Tail != tty->rawOutBuf.Head) { 200516c: c4 06 20 84 ld [ %i0 + 0x84 ], %g2 2005170: c2 06 20 80 ld [ %i0 + 0x80 ], %g1 2005174: 80 a0 80 01 cmp %g2, %g1 2005178: 32 bf ff f0 bne,a 2005138 <== NEVER TAKEN 200517c: f8 26 20 94 st %i4, [ %i0 + 0x94 ] <== NOT EXECUTED tty->rawOutBuf.Semaphore, RTEMS_WAIT, RTEMS_NO_TIMEOUT); if (sc != RTEMS_SUCCESSFUL) rtems_fatal_error_occurred (sc); rtems_interrupt_disable (level); } rtems_interrupt_enable (level); 2005180: 7f ff f5 15 call 20025d4 2005184: 91 e8 00 08 restore %g0, %o0, %o0 =============================================================================== 02003a40 : */ int dup2( int fildes, int fildes2 ) { 2003a40: 9d e3 bf 58 save %sp, -168, %sp /* * If fildes is not valid, then fildes2 should not be closed. */ status = fstat( fildes, &buf ); 2003a44: 90 10 00 18 mov %i0, %o0 2003a48: 40 00 01 e2 call 20041d0 2003a4c: 92 07 bf b8 add %fp, -72, %o1 if ( status == -1 ) 2003a50: 80 a2 3f ff cmp %o0, -1 2003a54: 12 80 00 04 bne 2003a64 2003a58: 90 10 00 19 mov %i1, %o0 return -1; 2003a5c: 81 c7 e0 08 ret 2003a60: 91 e8 3f ff restore %g0, -1, %o0 /* * If fildes2 is not valid, then we should not do anything either. */ status = fstat( fildes2, &buf ); 2003a64: 40 00 01 db call 20041d0 2003a68: 92 07 bf b8 add %fp, -72, %o1 if ( status == -1 ) 2003a6c: 80 a2 3f ff cmp %o0, -1 2003a70: 02 bf ff fb be 2003a5c <== NEVER TAKEN 2003a74: 90 10 00 18 mov %i0, %o0 /* * This fcntl handles everything else. */ return fcntl( fildes, F_DUPFD, fildes2 ); 2003a78: 92 10 20 00 clr %o1 2003a7c: 40 00 00 af call 2003d38 2003a80: 94 10 00 19 mov %i1, %o2 } 2003a84: 81 c7 e0 08 ret 2003a88: 91 e8 00 08 restore %g0, %o0, %o0 =============================================================================== 02005f10 : /* * Echo a typed character */ static void echo (unsigned char c, struct rtems_termios_tty *tty) { 2005f10: 9d e3 bf 98 save %sp, -104, %sp if ((tty->termios.c_lflag & ECHOCTL) && 2005f14: c2 06 60 3c ld [ %i1 + 0x3c ], %g1 2005f18: 80 88 62 00 btst 0x200, %g1 2005f1c: 02 80 00 19 be 2005f80 <== NEVER TAKEN 2005f20: 03 00 80 73 sethi %hi(0x201cc00), %g1 iscntrl(c) && (c != '\t') && (c != '\n')) { 2005f24: c2 00 60 58 ld [ %g1 + 0x58 ], %g1 ! 201cc58 <__ctype_ptr__> 2005f28: 82 00 40 18 add %g1, %i0, %g1 2005f2c: 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) && 2005f30: 80 88 60 20 btst 0x20, %g1 2005f34: 02 80 00 14 be 2005f84 2005f38: 90 10 00 18 mov %i0, %o0 iscntrl(c) && (c != '\t') && (c != '\n')) { 2005f3c: 82 06 3f f7 add %i0, -9, %g1 2005f40: 82 08 60 ff and %g1, 0xff, %g1 2005f44: 80 a0 60 01 cmp %g1, 1 2005f48: 08 80 00 0f bleu 2005f84 2005f4c: 82 10 20 5e mov 0x5e, %g1 char echobuf[2]; echobuf[0] = '^'; echobuf[1] = c ^ 0x40; 2005f50: 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] = '^'; 2005f54: c2 2f bf f8 stb %g1, [ %fp + -8 ] echobuf[1] = c ^ 0x40; 2005f58: f0 2f bf f9 stb %i0, [ %fp + -7 ] rtems_termios_puts (echobuf, 2, tty); 2005f5c: 90 07 bf f8 add %fp, -8, %o0 2005f60: 92 10 20 02 mov 2, %o1 2005f64: 7f ff ff 43 call 2005c70 2005f68: 94 10 00 19 mov %i1, %o2 tty->column += 2; 2005f6c: c2 06 60 28 ld [ %i1 + 0x28 ], %g1 2005f70: 82 00 60 02 add %g1, 2, %g1 2005f74: c2 26 60 28 st %g1, [ %i1 + 0x28 ] 2005f78: 81 c7 e0 08 ret 2005f7c: 81 e8 00 00 restore } else { oproc (c, tty); 2005f80: 90 10 00 18 mov %i0, %o0 <== NOT EXECUTED 2005f84: 7f ff ff 84 call 2005d94 2005f88: 92 10 00 19 mov %i1, %o1 2005f8c: 81 c7 e0 08 ret 2005f90: 81 e8 00 00 restore =============================================================================== 02024824 : } void endgrent(void) { if (group_fp != NULL) 2024824: 03 00 81 86 sethi %hi(0x2061800), %g1 2024828: d0 00 62 88 ld [ %g1 + 0x288 ], %o0 ! 2061a88 202482c: 80 a2 20 00 cmp %o0, 0 2024830: 02 80 00 05 be 2024844 <== NEVER TAKEN 2024834: 01 00 00 00 nop fclose(group_fp); 2024838: 82 13 c0 00 mov %o7, %g1 202483c: 40 00 48 d8 call 2036b9c 2024840: 9e 10 40 00 mov %g1, %o7 2024844: 81 c3 e0 08 retl <== NOT EXECUTED =============================================================================== 02024680 : } void endpwent(void) { if (passwd_fp != NULL) 2024680: 03 00 81 86 sethi %hi(0x2061800), %g1 2024684: d0 00 61 a8 ld [ %g1 + 0x1a8 ], %o0 ! 20619a8 2024688: 80 a2 20 00 cmp %o0, 0 202468c: 02 80 00 05 be 20246a0 <== NEVER TAKEN 2024690: 01 00 00 00 nop fclose(passwd_fp); 2024694: 82 13 c0 00 mov %o7, %g1 2024698: 40 00 49 41 call 2036b9c 202469c: 9e 10 40 00 mov %g1, %o7 20246a0: 81 c3 e0 08 retl <== NOT EXECUTED =============================================================================== 02005f94 : * Erase a character or line * FIXME: Needs support for WERASE and ECHOPRT. * FIXME: Some of the tests should check for IEXTEN, too. */ static void erase (struct rtems_termios_tty *tty, int lineFlag) 2005f94: 9d e3 bf a0 save %sp, -96, %sp rtems_termios_puts ("\b \b", 3, tty); if (tty->column) tty->column--; } if (!iscntrl (c) || (tty->termios.c_lflag & ECHOCTL)) { rtems_termios_puts ("\b \b", 3, tty); 2005f98: 35 00 80 6c sethi %hi(0x201b000), %i2 * Erase a character or line * FIXME: Needs support for WERASE and ECHOPRT. * FIXME: Some of the tests should check for IEXTEN, too. */ static void erase (struct rtems_termios_tty *tty, int lineFlag) 2005f9c: ba 10 00 18 mov %i0, %i5 2005fa0: 37 00 80 73 sethi %hi(0x201cc00), %i3 /* * Back up over the tab */ while (tty->column > col) { rtems_termios_puts ("\b", 1, tty); 2005fa4: 31 00 80 6c sethi %hi(0x201b000), %i0 rtems_termios_puts ("\b \b", 3, tty); if (tty->column) tty->column--; } if (!iscntrl (c) || (tty->termios.c_lflag & ECHOCTL)) { rtems_termios_puts ("\b \b", 3, tty); 2005fa8: b4 16 a3 b8 or %i2, 0x3b8, %i2 /* * Back up over the tab */ while (tty->column > col) { rtems_termios_puts ("\b", 1, tty); 2005fac: 10 80 00 62 b 2006134 2005fb0: b0 16 23 b0 or %i0, 0x3b0, %i0 } while (tty->ccount) { unsigned char c = tty->cbuf[--tty->ccount]; if (tty->termios.c_lflag & ECHO) { 2005fb4: c2 07 60 3c ld [ %i5 + 0x3c ], %g1 return; } } while (tty->ccount) { unsigned char c = tty->cbuf[--tty->ccount]; 2005fb8: 86 00 ff ff add %g3, -1, %g3 2005fbc: c6 27 60 20 st %g3, [ %i5 + 0x20 ] if (tty->termios.c_lflag & ECHO) { 2005fc0: 80 88 60 08 btst 8, %g1 2005fc4: 02 80 00 59 be 2006128 <== NEVER TAKEN 2005fc8: f8 09 00 03 ldub [ %g4 + %g3 ], %i4 if (!lineFlag && !(tty->termios.c_lflag & ECHOE)) { 2005fcc: 80 a6 60 00 cmp %i1, 0 2005fd0: 32 80 00 08 bne,a 2005ff0 2005fd4: b8 0f 20 ff and %i4, 0xff, %i4 2005fd8: 80 88 60 10 btst 0x10, %g1 2005fdc: 32 80 00 05 bne,a 2005ff0 <== ALWAYS TAKEN 2005fe0: b8 0f 20 ff and %i4, 0xff, %i4 echo (tty->termios.c_cc[VERASE], tty); 2005fe4: f0 0f 60 43 ldub [ %i5 + 0x43 ], %i0 <== NOT EXECUTED 2005fe8: 7f ff ff ca call 2005f10 <== NOT EXECUTED 2005fec: 93 e8 00 1d restore %g0, %i5, %o1 <== NOT EXECUTED } else if (c == '\t') { 2005ff0: 80 a7 20 09 cmp %i4, 9 2005ff4: 32 80 00 28 bne,a 2006094 2005ff8: c4 06 e0 58 ld [ %i3 + 0x58 ], %g2 int col = tty->read_start_column; 2005ffc: 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)) { 2006000: da 06 e0 58 ld [ %i3 + 0x58 ], %o5 if (tty->termios.c_lflag & ECHO) { if (!lineFlag && !(tty->termios.c_lflag & ECHOE)) { echo (tty->termios.c_cc[VERASE], tty); } else if (c == '\t') { int col = tty->read_start_column; int i = 0; 2006004: 84 10 20 00 clr %g2 while (i != tty->ccount) { c = tty->cbuf[i++]; if (c == '\t') { col = (col | 7) + 1; } else if (iscntrl (c)) { if (tty->termios.c_lflag & ECHOCTL) 2006008: 10 80 00 12 b 2006050 200600c: 82 08 62 00 and %g1, 0x200, %g1 /* * Find the character before the tab */ while (i != tty->ccount) { c = tty->cbuf[i++]; if (c == '\t') { 2006010: 80 a3 e0 09 cmp %o7, 9 2006014: 12 80 00 04 bne 2006024 2006018: 84 00 a0 01 inc %g2 col = (col | 7) + 1; 200601c: 10 80 00 0c b 200604c 2006020: b8 17 20 07 or %i4, 7, %i4 } else if (iscntrl (c)) { 2006024: 9e 03 40 0f add %o5, %o7, %o7 2006028: de 0b e0 01 ldub [ %o7 + 1 ], %o7 200602c: 80 8b e0 20 btst 0x20, %o7 2006030: 22 80 00 08 be,a 2006050 <== ALWAYS TAKEN 2006034: b8 07 20 01 inc %i4 if (tty->termios.c_lflag & ECHOCTL) 2006038: 80 a0 60 00 cmp %g1, 0 <== NOT EXECUTED 200603c: 32 80 00 05 bne,a 2006050 <== NOT EXECUTED 2006040: b8 07 20 02 add %i4, 2, %i4 <== NOT EXECUTED int i = 0; /* * Find the character before the tab */ while (i != tty->ccount) { 2006044: 10 80 00 04 b 2006054 <== NOT EXECUTED 2006048: 80 a0 80 03 cmp %g2, %g3 <== NOT EXECUTED col = (col | 7) + 1; } else if (iscntrl (c)) { if (tty->termios.c_lflag & ECHOCTL) col += 2; } else { col++; 200604c: b8 07 20 01 inc %i4 int i = 0; /* * Find the character before the tab */ while (i != tty->ccount) { 2006050: 80 a0 80 03 cmp %g2, %g3 2006054: 32 bf ff ef bne,a 2006010 2006058: de 09 00 02 ldub [ %g4 + %g2 ], %o7 } /* * Back up over the tab */ while (tty->column > col) { 200605c: 10 80 00 09 b 2006080 2006060: c2 07 60 28 ld [ %i5 + 0x28 ], %g1 rtems_termios_puts ("\b", 1, tty); 2006064: 92 10 20 01 mov 1, %o1 2006068: 7f ff ff 02 call 2005c70 200606c: 94 10 00 1d mov %i5, %o2 tty->column--; 2006070: c2 07 60 28 ld [ %i5 + 0x28 ], %g1 2006074: 82 00 7f ff add %g1, -1, %g1 2006078: c2 27 60 28 st %g1, [ %i5 + 0x28 ] } /* * Back up over the tab */ while (tty->column > col) { 200607c: c2 07 60 28 ld [ %i5 + 0x28 ], %g1 2006080: 80 a0 40 1c cmp %g1, %i4 2006084: 14 bf ff f8 bg 2006064 2006088: 90 10 00 18 mov %i0, %o0 if (tty->column) tty->column--; } } } if (!lineFlag) 200608c: 10 80 00 28 b 200612c 2006090: 80 a6 60 00 cmp %i1, 0 rtems_termios_puts ("\b", 1, tty); tty->column--; } } else { if (iscntrl (c) && (tty->termios.c_lflag & ECHOCTL)) { 2006094: b8 07 20 01 inc %i4 2006098: c4 08 80 1c ldub [ %g2 + %i4 ], %g2 200609c: 80 88 a0 20 btst 0x20, %g2 20060a0: 22 80 00 10 be,a 20060e0 <== ALWAYS TAKEN 20060a4: c2 06 e0 58 ld [ %i3 + 0x58 ], %g1 20060a8: 80 88 62 00 btst 0x200, %g1 <== NOT EXECUTED 20060ac: 02 80 00 0d be 20060e0 <== NOT EXECUTED 20060b0: c2 06 e0 58 ld [ %i3 + 0x58 ], %g1 <== NOT EXECUTED rtems_termios_puts ("\b \b", 3, tty); 20060b4: 90 10 00 1a mov %i2, %o0 <== NOT EXECUTED 20060b8: 92 10 20 03 mov 3, %o1 <== NOT EXECUTED 20060bc: 7f ff fe ed call 2005c70 <== NOT EXECUTED 20060c0: 94 10 00 1d mov %i5, %o2 <== NOT EXECUTED if (tty->column) 20060c4: c2 07 60 28 ld [ %i5 + 0x28 ], %g1 <== NOT EXECUTED 20060c8: 80 a0 60 00 cmp %g1, 0 <== NOT EXECUTED 20060cc: 22 80 00 05 be,a 20060e0 <== NOT EXECUTED 20060d0: c2 06 e0 58 ld [ %i3 + 0x58 ], %g1 <== NOT EXECUTED tty->column--; 20060d4: 82 00 7f ff add %g1, -1, %g1 <== NOT EXECUTED 20060d8: c2 27 60 28 st %g1, [ %i5 + 0x28 ] <== NOT EXECUTED } if (!iscntrl (c) || (tty->termios.c_lflag & ECHOCTL)) { 20060dc: c2 06 e0 58 ld [ %i3 + 0x58 ], %g1 <== NOT EXECUTED 20060e0: c2 08 40 1c ldub [ %g1 + %i4 ], %g1 20060e4: 80 88 60 20 btst 0x20, %g1 20060e8: 02 80 00 07 be 2006104 <== ALWAYS TAKEN 20060ec: 90 10 00 1a mov %i2, %o0 20060f0: c2 07 60 3c ld [ %i5 + 0x3c ], %g1 <== NOT EXECUTED 20060f4: 80 88 62 00 btst 0x200, %g1 <== NOT EXECUTED 20060f8: 02 80 00 0d be 200612c <== NOT EXECUTED 20060fc: 80 a6 60 00 cmp %i1, 0 <== NOT EXECUTED rtems_termios_puts ("\b \b", 3, tty); 2006100: 90 10 00 1a mov %i2, %o0 <== NOT EXECUTED 2006104: 92 10 20 03 mov 3, %o1 2006108: 7f ff fe da call 2005c70 200610c: 94 10 00 1d mov %i5, %o2 if (tty->column) 2006110: c2 07 60 28 ld [ %i5 + 0x28 ], %g1 2006114: 80 a0 60 00 cmp %g1, 0 2006118: 02 80 00 05 be 200612c <== NEVER TAKEN 200611c: 80 a6 60 00 cmp %i1, 0 tty->column--; 2006120: 82 00 7f ff add %g1, -1, %g1 2006124: c2 27 60 28 st %g1, [ %i5 + 0x28 ] } } } if (!lineFlag) 2006128: 80 a6 60 00 cmp %i1, 0 200612c: 02 80 00 06 be 2006144 2006130: 01 00 00 00 nop echo ('\n', tty); return; } } while (tty->ccount) { 2006134: c6 07 60 20 ld [ %i5 + 0x20 ], %g3 2006138: 80 a0 e0 00 cmp %g3, 0 200613c: 32 bf ff 9e bne,a 2005fb4 2006140: c8 07 60 1c ld [ %i5 + 0x1c ], %g4 2006144: 81 c7 e0 08 ret 2006148: 81 e8 00 00 restore =============================================================================== 02004740 : size_t pathlen, int eval_flags, rtems_filesystem_global_location_t *const *global_root_ptr, rtems_filesystem_global_location_t *const *global_current_ptr ) { 2004740: 9d e3 bf 98 save %sp, -104, %sp memset(ctx, 0, sizeof(*ctx)); 2004744: 92 10 20 00 clr %o1 2004748: 90 10 00 18 mov %i0, %o0 200474c: 40 00 2e 56 call 20100a4 2004750: 94 10 20 38 mov 0x38, %o2 ctx->path = path; 2004754: f2 26 00 00 st %i1, [ %i0 ] ctx->pathlen = pathlen; 2004758: f4 26 20 04 st %i2, [ %i0 + 4 ] rtems_filesystem_eval_path_context_t *ctx, rtems_filesystem_global_location_t *const *global_root_ptr, rtems_filesystem_global_location_t *const *global_current_ptr ) { if (ctx->pathlen > 0) { 200475c: 80 a6 a0 00 cmp %i2, 0 2004760: 02 80 00 19 be 20047c4 2004764: f6 26 20 10 st %i3, [ %i0 + 0x10 ] char c = ctx->path [0]; 2004768: f6 0e 40 00 ldub [ %i1 ], %i3 ctx->rootloc = rtems_filesystem_global_location_obtain(global_root_ptr); 200476c: 40 00 01 79 call 2004d50 2004770: 90 10 00 1c mov %i4, %o0 gid_t node_gid ); static inline bool rtems_filesystem_is_delimiter(char c) { return c == '/' || c == '\\'; 2004774: 83 2e e0 18 sll %i3, 0x18, %g1 2004778: 83 38 60 18 sra %g1, 0x18, %g1 if (rtems_filesystem_is_delimiter(c)) { 200477c: 80 a0 60 5c cmp %g1, 0x5c 2004780: 02 80 00 05 be 2004794 <== NEVER TAKEN 2004784: d0 26 20 30 st %o0, [ %i0 + 0x30 ] 2004788: 80 a0 60 2f cmp %g1, 0x2f 200478c: 12 80 00 0a bne 20047b4 2004790: 90 10 00 1d mov %i5, %o0 ++ctx->path; 2004794: c2 06 00 00 ld [ %i0 ], %g1 --ctx->pathlen; ctx->startloc = rtems_filesystem_global_location_obtain( 2004798: 90 06 20 30 add %i0, 0x30, %o0 char c = ctx->path [0]; ctx->rootloc = rtems_filesystem_global_location_obtain(global_root_ptr); if (rtems_filesystem_is_delimiter(c)) { ++ctx->path; 200479c: 82 00 60 01 inc %g1 20047a0: c2 26 00 00 st %g1, [ %i0 ] --ctx->pathlen; 20047a4: c2 06 20 04 ld [ %i0 + 4 ], %g1 20047a8: 82 00 7f ff add %g1, -1, %g1 20047ac: 10 80 00 02 b 20047b4 20047b0: c2 26 20 04 st %g1, [ %i0 + 4 ] ctx->startloc = rtems_filesystem_global_location_obtain( &ctx->rootloc ); } else { ctx->startloc = rtems_filesystem_global_location_obtain( 20047b4: 40 00 01 67 call 2004d50 20047b8: 01 00 00 00 nop 20047bc: 10 80 00 0d b 20047f0 20047c0: d0 26 20 34 st %o0, [ %i0 + 0x34 ] ); static inline rtems_filesystem_global_location_t * rtems_filesystem_global_location_obtain_null(void) { rtems_filesystem_global_location_t *global_loc = NULL; 20047c4: c0 27 bf fc clr [ %fp + -4 ] return rtems_filesystem_global_location_obtain( &global_loc ); 20047c8: 40 00 01 62 call 2004d50 20047cc: 90 07 bf fc add %fp, -4, %o0 ); static inline rtems_filesystem_global_location_t * rtems_filesystem_global_location_obtain_null(void) { rtems_filesystem_global_location_t *global_loc = NULL; 20047d0: c0 27 bf fc clr [ %fp + -4 ] global_current_ptr ); } } else { ctx->rootloc = rtems_filesystem_global_location_obtain_null(); 20047d4: d0 26 20 30 st %o0, [ %i0 + 0x30 ] return rtems_filesystem_global_location_obtain( &global_loc ); 20047d8: 40 00 01 5e call 2004d50 20047dc: 90 07 bf fc add %fp, -4, %o0 ctx->startloc = rtems_filesystem_global_location_obtain_null(); errno = ENOENT; 20047e0: 40 00 2b a3 call 200f66c <__errno> 20047e4: d0 26 20 34 st %o0, [ %i0 + 0x34 ] 20047e8: 82 10 20 02 mov 2, %g1 20047ec: c2 22 00 00 st %g1, [ %o0 ] static inline void rtems_filesystem_instance_lock( const rtems_filesystem_location_info_t *loc ) { const rtems_filesystem_mount_table_entry_t *mt_entry = loc->mt_entry; 20047f0: c2 06 20 34 ld [ %i0 + 0x34 ], %g1 20047f4: d0 00 60 14 ld [ %g1 + 0x14 ], %o0 (*mt_entry->ops->lock_h)( mt_entry ); 20047f8: c2 02 20 0c ld [ %o0 + 0xc ], %g1 20047fc: c2 00 40 00 ld [ %g1 ], %g1 2004800: 9f c0 40 00 call %g1 2004804: ba 06 20 18 add %i0, 0x18, %i5 set_startloc(ctx, global_root_ptr, global_current_ptr); rtems_filesystem_instance_lock(&ctx->startloc->location); rtems_filesystem_location_clone( 2004808: d2 06 20 34 ld [ %i0 + 0x34 ], %o1 200480c: 40 00 1d 77 call 200bde8 2004810: 90 10 00 1d mov %i5, %o0 &ctx->currentloc, &ctx->startloc->location ); rtems_filesystem_eval_path_continue(ctx); 2004814: 90 10 00 18 mov %i0, %o0 2004818: 7f ff ff b0 call 20046d8 200481c: b0 10 00 1d mov %i5, %i0 return &ctx->currentloc; } 2004820: 81 c7 e0 08 ret 2004824: 81 e8 00 00 restore =============================================================================== 02012f44 : int fat_buf_access(fat_fs_info_t *fs_info, const uint32_t sec_num, const int op_type, uint8_t **sec_buf) { 2012f44: 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); 2012f48: c2 0e 20 02 ldub [ %i0 + 2 ], %g1 2012f4c: c4 0e 20 0c ldub [ %i0 + 0xc ], %g2 2012f50: 84 20 80 01 sub %g2, %g1, %g2 2012f54: 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); 2012f58: 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 - 2012f5c: 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); 2012f60: 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) 2012f64: c2 0e 20 89 ldub [ %i0 + 0x89 ], %g1 2012f68: 80 a0 60 00 cmp %g1, 0 2012f6c: 02 80 00 06 be 2012f84 2012f70: 01 00 00 00 nop 2012f74: c2 06 20 84 ld [ %i0 + 0x84 ], %g1 2012f78: 80 a0 40 19 cmp %g1, %i1 2012f7c: 22 80 00 1c be,a 2012fec 2012f80: c2 06 20 8c ld [ %i0 + 0x8c ], %g1 { fat_buf_release(fs_info); 2012f84: 7f ff ff 7c call 2012d74 2012f88: 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); 2012f8c: 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) 2012f90: 80 a6 a0 01 cmp %i2, 1 2012f94: d0 06 20 64 ld [ %i0 + 0x64 ], %o0 2012f98: 12 80 00 06 bne 2012fb0 2012f9c: 94 06 20 8c add %i0, 0x8c, %o2 sc = rtems_bdbuf_read(fs_info->vol.dd, blk, &fs_info->c.buf); 2012fa0: 7f ff f7 ae call 2010e58 2012fa4: 01 00 00 00 nop else sc = rtems_bdbuf_get(fs_info->vol.dd, blk, &fs_info->c.buf); if (sc != RTEMS_SUCCESSFUL) 2012fa8: 10 80 00 05 b 2012fbc 2012fac: 80 a2 20 00 cmp %o0, 0 fat_buf_release(fs_info); if (op_type == FAT_OP_TYPE_READ) sc = rtems_bdbuf_read(fs_info->vol.dd, blk, &fs_info->c.buf); else sc = rtems_bdbuf_get(fs_info->vol.dd, blk, &fs_info->c.buf); 2012fb0: 7f ff f7 79 call 2010d94 2012fb4: 01 00 00 00 nop if (sc != RTEMS_SUCCESSFUL) 2012fb8: 80 a2 20 00 cmp %o0, 0 2012fbc: 02 80 00 08 be 2012fdc <== ALWAYS TAKEN 2012fc0: 82 10 20 01 mov 1, %g1 rtems_set_errno_and_return_minus_one(EIO); 2012fc4: 40 00 21 7a call 201b5ac <__errno> <== NOT EXECUTED 2012fc8: b0 10 3f ff mov -1, %i0 <== NOT EXECUTED 2012fcc: 82 10 20 05 mov 5, %g1 <== NOT EXECUTED 2012fd0: c2 22 00 00 st %g1, [ %o0 ] <== NOT EXECUTED 2012fd4: 81 c7 e0 08 ret <== NOT EXECUTED 2012fd8: 81 e8 00 00 restore <== NOT EXECUTED fs_info->c.blk_num = sec_num; 2012fdc: f2 26 20 84 st %i1, [ %i0 + 0x84 ] fs_info->c.modified = 0; 2012fe0: c0 2e 20 88 clrb [ %i0 + 0x88 ] fs_info->c.state = FAT_CACHE_ACTUAL; 2012fe4: c2 2e 20 89 stb %g1, [ %i0 + 0x89 ] } *sec_buf = &fs_info->c.buf->buffer[blk_ofs]; 2012fe8: c2 06 20 8c ld [ %i0 + 0x8c ], %g1 2012fec: c2 00 60 1c ld [ %g1 + 0x1c ], %g1 2012ff0: b8 00 40 1c add %g1, %i4, %i4 2012ff4: f8 26 c0 00 st %i4, [ %i3 ] return RC_OK; } 2012ff8: 81 c7 e0 08 ret 2012ffc: 91 e8 20 00 restore %g0, 0, %o0 =============================================================================== 02012d74 : return RC_OK; } int fat_buf_release(fat_fs_info_t *fs_info) { 2012d74: 9d e3 bf 98 save %sp, -104, %sp rtems_status_code sc = RTEMS_SUCCESSFUL; if (fs_info->c.state == FAT_CACHE_EMPTY) 2012d78: c2 0e 20 89 ldub [ %i0 + 0x89 ], %g1 return RC_OK; } int fat_buf_release(fat_fs_info_t *fs_info) { 2012d7c: ba 10 00 18 mov %i0, %i5 rtems_status_code sc = RTEMS_SUCCESSFUL; if (fs_info->c.state == FAT_CACHE_EMPTY) 2012d80: 80 a0 60 00 cmp %g1, 0 2012d84: 02 80 00 6e be 2012f3c 2012d88: b0 10 20 00 clr %i0 return RC_OK; if (fs_info->c.modified) 2012d8c: c2 0f 60 88 ldub [ %i5 + 0x88 ], %g1 2012d90: 80 a0 60 00 cmp %g1, 0 2012d94: 02 80 00 5d be 2012f08 2012d98: 01 00 00 00 nop { uint32_t sec_num = fs_info->c.blk_num; 2012d9c: c2 07 60 84 ld [ %i5 + 0x84 ], %g1 bool sec_of_fat = ((sec_num >= fs_info->vol.fat_loc) && 2012da0: c4 17 60 18 lduh [ %i5 + 0x18 ], %g2 2012da4: 80 a0 40 02 cmp %g1, %g2 2012da8: 0a 80 00 05 bcs 2012dbc 2012dac: b8 10 20 00 clr %i4 2012db0: c4 07 60 20 ld [ %i5 + 0x20 ], %g2 2012db4: 80 a0 40 02 cmp %g1, %g2 2012db8: b8 40 20 00 addx %g0, 0, %i4 uint32_t ino ) { return (ino >= fs_info->uino_base); } 2012dbc: 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) 2012dc0: 80 8f 20 ff btst 0xff, %i4 2012dc4: 02 80 00 12 be 2012e0c 2012dc8: c6 0f 60 0c ldub [ %i5 + 0xc ], %g3 2012dcc: c8 0f 60 54 ldub [ %i5 + 0x54 ], %g4 2012dd0: 80 a1 20 00 cmp %g4, 0 2012dd4: 12 80 00 0e bne 2012e0c <== NEVER TAKEN 2012dd8: 84 08 a0 ff and %g2, 0xff, %g2 memcpy(fs_info->sec_buf, fs_info->c.buf->buffer + blk_ofs, 2012ddc: c8 07 60 8c ld [ %i5 + 0x8c ], %g4 uint32_t blk_ofs = fat_sector_offset_to_block_offset(fs_info, sec_num, 0); if (sec_of_fat && !fs_info->vol.mirror) memcpy(fs_info->sec_buf, 2012de0: d0 07 60 90 ld [ %i5 + 0x90 ], %o0 2012de4: d2 01 20 1c ld [ %g4 + 0x1c ], %o1 2012de8: d4 17 40 00 lduh [ %i5 ], %o2 2012dec: 86 08 e0 ff and %g3, 0xff, %g3 2012df0: 86 20 c0 02 sub %g3, %g2, %g3 2012df4: b7 30 40 03 srl %g1, %g3, %i3 static inline uint32_t fat_block_num_to_sector_num (const fat_fs_info_t *fs_info, const uint32_t block_number) { return block_number << (fs_info->vol.bytes_per_block_log2 - fs_info->vol.sec_log2); 2012df8: 87 2e c0 03 sll %i3, %g3, %g3 fat_sector_offset_to_block_offset (const fat_fs_info_t *fs_info, const uint32_t sector, const uint32_t sector_offset) { return sector_offset + ((sector - 2012dfc: 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); 2012e00: 85 28 40 02 sll %g1, %g2, %g2 2012e04: 40 00 24 a9 call 201c0a8 2012e08: 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); 2012e0c: 7f ff f8 c4 call 201111c 2012e10: d0 07 60 8c ld [ %i5 + 0x8c ], %o0 if (sc != RTEMS_SUCCESSFUL) 2012e14: 80 a2 20 00 cmp %o0, 0 2012e18: 12 80 00 41 bne 2012f1c <== NEVER TAKEN 2012e1c: 80 8f 20 ff btst 0xff, %i4 rtems_set_errno_and_return_minus_one(EIO); fs_info->c.modified = 0; if (sec_of_fat && !fs_info->vol.mirror) 2012e20: 02 80 00 45 be 2012f34 2012e24: c0 2f 60 88 clrb [ %i5 + 0x88 ] 2012e28: c2 0f 60 54 ldub [ %i5 + 0x54 ], %g1 2012e2c: 80 a0 60 00 cmp %g1, 0 2012e30: 22 80 00 2f be,a 2012eec <== ALWAYS TAKEN 2012e34: b8 10 20 01 mov 1, %i4 { sc = rtems_bdbuf_release(fs_info->c.buf); if (sc != RTEMS_SUCCESSFUL) rtems_set_errno_and_return_minus_one(EIO); } fs_info->c.state = FAT_CACHE_EMPTY; 2012e38: 10 80 00 40 b 2012f38 <== NOT EXECUTED 2012e3c: c0 2f 60 89 clrb [ %i5 + 0x89 ] <== NOT EXECUTED for (i = 1; i < fs_info->vol.fats; i++) { rtems_bdbuf_buffer *bd; sec_num = fs_info->c.blk_num + fs_info->vol.fat_length * i, 2012e40: 7f ff be 04 call 2002650 <.umul> 2012e44: d2 07 60 1c ld [ %i5 + 0x1c ], %o1 2012e48: 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); 2012e4c: c2 0f 60 02 ldub [ %i5 + 2 ], %g1 2012e50: 90 02 00 1b add %o0, %i3, %o0 2012e54: f6 0f 60 0c ldub [ %i5 + 0xc ], %i3 2012e58: b6 26 c0 01 sub %i3, %g1, %i3 2012e5c: 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); 2012e60: 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 - 2012e64: 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); 2012e68: 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 2012e6c: 80 a6 e0 00 cmp %i3, 0 2012e70: 12 80 00 0b bne 2012e9c 2012e74: d0 07 60 64 ld [ %i5 + 0x64 ], %o0 && fs_info->vol.bps == fs_info->vol.bytes_per_block) 2012e78: c4 17 40 00 lduh [ %i5 ], %g2 2012e7c: c2 17 60 0a lduh [ %i5 + 0xa ], %g1 2012e80: 80 a0 80 01 cmp %g2, %g1 2012e84: 12 80 00 06 bne 2012e9c 2012e88: 01 00 00 00 nop { sc = rtems_bdbuf_get(fs_info->vol.dd, blk, &bd); 2012e8c: 7f ff f7 c2 call 2010d94 2012e90: 94 07 bf fc add %fp, -4, %o2 } else { sc = rtems_bdbuf_read(fs_info->vol.dd, blk, &bd); } if ( sc != RTEMS_SUCCESSFUL) 2012e94: 10 80 00 05 b 2012ea8 2012e98: 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); 2012e9c: 7f ff f7 ef call 2010e58 2012ea0: 94 07 bf fc add %fp, -4, %o2 } if ( sc != RTEMS_SUCCESSFUL) 2012ea4: 80 a2 20 00 cmp %o0, 0 2012ea8: 22 80 00 03 be,a 2012eb4 <== ALWAYS TAKEN 2012eac: c2 07 bf fc ld [ %fp + -4 ], %g1 2012eb0: 30 80 00 0b b,a 2012edc <== NOT EXECUTED rtems_set_errno_and_return_minus_one(ENOMEM); memcpy(bd->buffer + blk_ofs, fs_info->sec_buf, fs_info->vol.bps); 2012eb4: d2 07 60 90 ld [ %i5 + 0x90 ], %o1 2012eb8: d0 00 60 1c ld [ %g1 + 0x1c ], %o0 2012ebc: d4 17 40 00 lduh [ %i5 ], %o2 2012ec0: 40 00 24 7a call 201c0a8 2012ec4: 90 02 00 1b add %o0, %i3, %o0 sc = rtems_bdbuf_release_modified(bd); 2012ec8: 7f ff f8 95 call 201111c 2012ecc: d0 07 bf fc ld [ %fp + -4 ], %o0 if ( sc != RTEMS_SUCCESSFUL) 2012ed0: 80 a2 20 00 cmp %o0, 0 2012ed4: 22 80 00 06 be,a 2012eec <== ALWAYS TAKEN 2012ed8: b8 07 20 01 inc %i4 rtems_set_errno_and_return_minus_one(ENOMEM); 2012edc: 40 00 21 b4 call 201b5ac <__errno> <== NOT EXECUTED 2012ee0: 01 00 00 00 nop <== NOT EXECUTED 2012ee4: 10 80 00 11 b 2012f28 <== NOT EXECUTED 2012ee8: 82 10 20 0c mov 0xc, %g1 ! c <== NOT EXECUTED if (sec_of_fat && !fs_info->vol.mirror) { uint8_t i; for (i = 1; i < fs_info->vol.fats; i++) 2012eec: c2 0f 60 0d ldub [ %i5 + 0xd ], %g1 2012ef0: 90 0f 20 ff and %i4, 0xff, %o0 2012ef4: 80 a2 00 01 cmp %o0, %g1 2012ef8: 0a bf ff d2 bcs 2012e40 2012efc: 01 00 00 00 nop { sc = rtems_bdbuf_release(fs_info->c.buf); if (sc != RTEMS_SUCCESSFUL) rtems_set_errno_and_return_minus_one(EIO); } fs_info->c.state = FAT_CACHE_EMPTY; 2012f00: 10 80 00 0e b 2012f38 2012f04: c0 2f 60 89 clrb [ %i5 + 0x89 ] } } } else { sc = rtems_bdbuf_release(fs_info->c.buf); 2012f08: 7f ff f8 50 call 2011048 2012f0c: d0 07 60 8c ld [ %i5 + 0x8c ], %o0 if (sc != RTEMS_SUCCESSFUL) 2012f10: 80 a2 20 00 cmp %o0, 0 2012f14: 22 80 00 09 be,a 2012f38 <== ALWAYS TAKEN 2012f18: c0 2f 60 89 clrb [ %i5 + 0x89 ] rtems_set_errno_and_return_minus_one(EIO); 2012f1c: 40 00 21 a4 call 201b5ac <__errno> <== NOT EXECUTED 2012f20: 01 00 00 00 nop <== NOT EXECUTED 2012f24: 82 10 20 05 mov 5, %g1 ! 5 <== NOT EXECUTED 2012f28: c2 22 00 00 st %g1, [ %o0 ] <== NOT EXECUTED 2012f2c: 81 c7 e0 08 ret <== NOT EXECUTED 2012f30: 91 e8 3f ff restore %g0, -1, %o0 <== NOT EXECUTED } fs_info->c.state = FAT_CACHE_EMPTY; 2012f34: c0 2f 60 89 clrb [ %i5 + 0x89 ] return RC_OK; 2012f38: b0 10 20 00 clr %i0 } 2012f3c: 81 c7 e0 08 ret 2012f40: 81 e8 00 00 restore =============================================================================== 02012d18 : 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)) ) 2012d18: 80 a2 60 00 cmp %o1, 0 2012d1c: 32 80 00 0c bne,a 2012d4c 2012d20: c2 0a 20 0c ldub [ %o0 + 0xc ], %g1 2012d24: c2 0a 20 0e ldub [ %o0 + 0xe ], %g1 2012d28: 80 88 60 03 btst 3, %g1 2012d2c: 22 80 00 08 be,a 2012d4c <== NEVER TAKEN 2012d30: c2 0a 20 0c ldub [ %o0 + 0xc ], %g1 <== NOT EXECUTED static inline uint32_t fat_sector_num_to_block_num (const fat_fs_info_t *fs_info, const uint32_t sector_number) { return sector_number >> (fs_info->vol.bytes_per_block_log2 - fs_info->vol.sec_log2); 2012d34: c4 0a 20 0c ldub [ %o0 + 0xc ], %g2 2012d38: c2 0a 20 02 ldub [ %o0 + 2 ], %g1 2012d3c: d0 02 20 20 ld [ %o0 + 0x20 ], %o0 2012d40: 82 20 80 01 sub %g2, %g1, %g1 2012d44: 81 c3 e0 08 retl 2012d48: 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); 2012d4c: c4 0a 20 08 ldub [ %o0 + 8 ], %g2 if ( (cln == 0) && (fs_info->vol.type & (FAT_FAT12 | FAT_FAT16)) ) blk = fat_sector_num_to_block_num(fs_info, fs_info->vol.rdir_loc); else { cln -= FAT_RSRVD_CLN; 2012d50: 92 02 7f fe add %o1, -2, %o1 blk = cln << (fs_info->vol.bpc_log2 - fs_info->vol.bytes_per_block_log2); 2012d54: 84 20 80 01 sub %g2, %g1, %g2 2012d58: 93 2a 40 02 sll %o1, %g2, %o1 2012d5c: c4 0a 20 02 ldub [ %o0 + 2 ], %g2 2012d60: d0 02 20 34 ld [ %o0 + 0x34 ], %o0 2012d64: 82 20 40 02 sub %g1, %g2, %g1 2012d68: 91 32 00 01 srl %o0, %g1, %o0 blk += fat_sector_num_to_block_num(fs_info, fs_info->vol.data_fsec); } return blk; } 2012d6c: 81 c3 e0 08 retl 2012d70: 90 02 00 09 add %o0, %o1, %o0 =============================================================================== 02012074 : 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)) ) 2012074: 80 a2 60 00 cmp %o1, 0 2012078: 32 80 00 08 bne,a 2012098 201207c: c2 0a 20 05 ldub [ %o0 + 5 ], %g1 2012080: c2 0a 20 0e ldub [ %o0 + 0xe ], %g1 2012084: 80 88 60 03 btst 3, %g1 2012088: 22 80 00 04 be,a 2012098 <== NEVER TAKEN 201208c: c2 0a 20 05 ldub [ %o0 + 5 ], %g1 <== NOT EXECUTED return fs_info->vol.rdir_loc; 2012090: 81 c3 e0 08 retl 2012094: d0 02 20 20 ld [ %o0 + 0x20 ], %o0 return (((cln - FAT_RSRVD_CLN) << fs_info->vol.spc_log2) + 2012098: 92 02 7f fe add %o1, -2, %o1 201209c: 93 2a 40 01 sll %o1, %g1, %o1 20120a0: c2 02 20 34 ld [ %o0 + 0x34 ], %g1 fs_info->vol.data_fsec); } 20120a4: 81 c3 e0 08 retl 20120a8: 90 02 40 01 add %o1, %g1, %o0 =============================================================================== 02013118 : fat_fs_info_t *fs_info, const uint32_t start_cln, const uint32_t offset, const uint32_t count, const uint8_t pattern) { 2013118: 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)); 201311c: c2 16 20 06 lduh [ %i0 + 6 ], %g1 2013120: 82 20 40 1a sub %g1, %i2, %g1 2013124: 80 a6 c0 01 cmp %i3, %g1 2013128: 38 80 00 02 bgu,a 2013130 <== NEVER TAKEN 201312c: b6 10 00 01 mov %g1, %i3 <== NOT EXECUTED uint32_t cur_blk = fat_cluster_num_to_block_num(fs_info, start_cln); 2013130: 90 10 00 18 mov %i0, %o0 2013134: 7f ff fe f9 call 2012d18 2013138: 92 10 00 19 mov %i1, %o1 uint32_t blocks_in_offset = offset >> fs_info->vol.bytes_per_block_log2; 201313c: 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; 2013140: 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; 2013144: a3 36 80 01 srl %i2, %g1, %l1 uint32_t ofs_blk = offset - (blocks_in_offset << fs_info->vol.bytes_per_block_log2); 2013148: 83 2c 40 01 sll %l1, %g1, %g1 201314c: a4 10 20 01 mov 1, %l2 2013150: b4 26 80 01 sub %i2, %g1, %i2 ssize_t bytes_written = 0; ssize_t ret; cur_blk += blocks_in_offset; 2013154: a2 02 00 11 add %o0, %l1, %l1 while ( (RC_OK == rc) 2013158: 10 80 00 2a b 2013200 201315c: 82 10 20 00 clr %g1 && (0 < bytes_to_write)) { uint32_t c = MIN(bytes_to_write, (fs_info->vol.bytes_per_block - ofs_blk)); 2013160: 82 20 80 1a sub %g2, %i2, %g1 2013164: 80 a0 40 1b cmp %g1, %i3 2013168: 08 80 00 03 bleu 2013174 <== ALWAYS TAKEN 201316c: ba 10 00 01 mov %g1, %i5 2013170: ba 10 00 1b mov %i3, %i5 <== NOT EXECUTED const uint32_t offset, const uint32_t count, const uint8_t pattern) { int rc = RC_OK; uint32_t bytes_to_write = MIN(count, (fs_info->vol.bytes_per_block - offset)); 2013174: 80 a7 40 01 cmp %i5, %g1 2013178: 08 80 00 03 bleu 2013184 <== ALWAYS TAKEN 201317c: b2 10 00 1d mov %i5, %i1 2013180: b2 10 00 01 mov %g1, %i1 <== NOT EXECUTED uint32_t ino ) { return (ino >= fs_info->uino_base); } 2013184: 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) 2013188: 80 a6 60 00 cmp %i1, 0 201318c: 02 80 00 27 be 2013228 <== NEVER TAKEN 2013190: 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); 2013194: 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); 2013198: 90 10 00 18 mov %i0, %o0 201319c: 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) 20131a0: 80 a6 40 02 cmp %i1, %g2 20131a4: 02 80 00 03 be 20131b0 20131a8: 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); 20131ac: 94 10 20 01 mov 1, %o2 20131b0: 7f ff ff 65 call 2012f44 20131b4: 96 07 bf fc add %fp, -4, %o3 if (RC_OK == rc) 20131b8: 80 a2 20 00 cmp %o0, 0 20131bc: 12 80 00 0a bne 20131e4 <== NEVER TAKEN 20131c0: 80 a7 40 08 cmp %i5, %o0 { memset(blk_buf + offset, pattern, bytes_to_write); 20131c4: d0 07 bf fc ld [ %fp + -4 ], %o0 20131c8: 92 10 00 1c mov %i4, %o1 20131cc: 90 02 00 1a add %o0, %i2, %o0 20131d0: 40 00 23 f3 call 201c19c 20131d4: 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; 20131d8: 10 80 00 14 b 2013228 20131dc: e4 2e 20 88 stb %l2, [ %i0 + 0x88 ] fs_info, cur_blk, ofs_blk, c, pattern); if (c != ret) 20131e0: 80 a7 40 08 cmp %i5, %o0 20131e4: 12 80 00 06 bne 20131fc <== NEVER TAKEN 20131e8: 82 10 3f ff mov -1, %g1 rc = -1; else { bytes_to_write -= ret; 20131ec: b6 26 c0 1d sub %i3, %i5, %i3 bytes_written += ret; 20131f0: a0 04 00 1d add %l0, %i5, %l0 ++cur_blk; 20131f4: a2 04 60 01 inc %l1 20131f8: 82 10 20 00 clr %g1 20131fc: b4 10 20 00 clr %i2 ssize_t bytes_written = 0; ssize_t ret; cur_blk += blocks_in_offset; while ( (RC_OK == rc) 2013200: 80 a6 e0 00 cmp %i3, 0 2013204: 02 80 00 04 be 2013214 2013208: 80 a0 60 00 cmp %g1, 0 201320c: 22 bf ff d5 be,a 2013160 <== ALWAYS TAKEN 2013210: c4 16 20 0a lduh [ %i0 + 0xa ], %g2 bytes_written += ret; ++cur_blk; } ofs_blk = 0; } if (RC_OK != rc) 2013214: 80 a0 60 00 cmp %g1, 0 2013218: 12 80 00 06 bne 2013230 <== NEVER TAKEN 201321c: b0 10 3f ff mov -1, %i0 2013220: 81 c7 e0 08 ret 2013224: 91 e8 00 10 restore %g0, %l0, %o0 } } if (RC_OK != rc) return rc; else return bytes_to_write; 2013228: 10 bf ff ee b 20131e0 201322c: 90 10 00 19 mov %i1, %o0 } if (RC_OK != rc) return rc; else return bytes_written; } 2013230: 81 c7 e0 08 ret <== NOT EXECUTED 2013234: 81 e8 00 00 restore <== NOT EXECUTED =============================================================================== 02013238 : const uint32_t start_cln, const uint32_t offset, const uint32_t count, const void *buff, const bool overwrite_cluster) { 2013238: 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)); 201323c: c2 16 20 06 lduh [ %i0 + 6 ], %g1 2013240: 82 20 40 1a sub %g1, %i2, %g1 2013244: 80 a6 c0 01 cmp %i3, %g1 2013248: 38 80 00 02 bgu,a 2013250 <== NEVER TAKEN 201324c: b6 10 00 01 mov %g1, %i3 <== NOT EXECUTED uint32_t cur_blk = fat_cluster_num_to_block_num(fs_info, start_cln); 2013250: 90 10 00 18 mov %i0, %o0 2013254: 7f ff fe b1 call 2012d18 2013258: 92 10 00 19 mov %i1, %o1 uint32_t blocks_in_offset = (offset >> fs_info->vol.bytes_per_block_log2); 201325c: 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; 2013260: 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); 2013264: a5 36 80 01 srl %i2, %g1, %l2 uint32_t ofs_blk = offset - (blocks_in_offset << fs_info->vol.bytes_per_block_log2); 2013268: 83 2c 80 01 sll %l2, %g1, %g1 201326c: a6 10 20 01 mov 1, %l3 2013270: 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; 2013274: a4 02 00 12 add %o0, %l2, %l2 while ( (RC_OK == rc) 2013278: 10 80 00 2d b 201332c 201327c: 82 10 20 00 clr %g1 && (0 < bytes_to_write)) { c = MIN(bytes_to_write, (fs_info->vol.bytes_per_block - ofs_blk)); 2013280: 82 20 80 1a sub %g2, %i2, %g1 2013284: 80 a0 40 1b cmp %g1, %i3 2013288: 08 80 00 03 bleu 2013294 201328c: b2 10 00 01 mov %g1, %i1 2013290: b2 10 00 1b mov %i3, %i1 const uint32_t count, const void *buf, const bool overwrite_block) { int rc = RC_OK; uint32_t bytes_to_write = MIN(count, (fs_info->vol.bytes_per_block - offset)); 2013294: 80 a6 40 01 cmp %i1, %g1 2013298: 08 80 00 03 bleu 20132a4 <== ALWAYS TAKEN 201329c: a0 10 00 19 mov %i1, %l0 20132a0: a0 10 00 01 mov %g1, %l0 <== NOT EXECUTED uint32_t ino ) { return (ino >= fs_info->uino_base); } 20132a4: 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) 20132a8: 80 a4 20 00 cmp %l0, 0 20132ac: 02 80 00 2a be 2013354 <== NEVER TAKEN 20132b0: 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); 20132b4: 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); 20132b8: 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 20132bc: 80 a7 60 00 cmp %i5, 0 20132c0: 12 80 00 05 bne 20132d4 20132c4: 93 2c 80 09 sll %l2, %o1, %o1 || (bytes_to_write == fs_info->vol.bytes_per_block)) 20132c8: 80 a4 00 02 cmp %l0, %g2 20132cc: 12 80 00 04 bne 20132dc 20132d0: 94 10 20 01 mov 1, %o2 { rc = fat_buf_access(fs_info, sec_num, FAT_OP_TYPE_GET, &blk_buf); 20132d4: 10 80 00 02 b 20132dc 20132d8: 94 10 20 02 mov 2, %o2 } else rc = fat_buf_access(fs_info, sec_num, FAT_OP_TYPE_READ, &blk_buf); 20132dc: 7f ff ff 1a call 2012f44 20132e0: 96 07 bf fc add %fp, -4, %o3 if (RC_OK == rc) 20132e4: 80 a2 20 00 cmp %o0, 0 20132e8: 12 80 00 0a bne 2013310 <== NEVER TAKEN 20132ec: 80 a6 40 08 cmp %i1, %o0 { memcpy(blk_buf + offset, buf, bytes_to_write); 20132f0: d0 07 bf fc ld [ %fp + -4 ], %o0 20132f4: 92 07 00 11 add %i4, %l1, %o1 20132f8: 90 02 00 1a add %o0, %i2, %o0 20132fc: 40 00 23 6b call 201c0a8 2013300: 94 10 00 10 mov %l0, %o2 } static inline void fat_buf_mark_modified(fat_fs_info_t *fs_info) { fs_info->c.modified = true; 2013304: 10 80 00 14 b 2013354 2013308: e6 2e 20 88 stb %l3, [ %i0 + 0x88 ] cur_blk, ofs_blk, c, &buffer[bytes_written], overwrite_cluster); if (c != ret) 201330c: 80 a6 40 08 cmp %i1, %o0 2013310: 12 80 00 06 bne 2013328 <== NEVER TAKEN 2013314: 82 10 3f ff mov -1, %g1 rc = -1; else { bytes_to_write -= ret; 2013318: b6 26 c0 19 sub %i3, %i1, %i3 bytes_written += ret; 201331c: a2 04 40 19 add %l1, %i1, %l1 ++cur_blk; 2013320: a4 04 a0 01 inc %l2 2013324: 82 10 20 00 clr %g1 2013328: b4 10 20 00 clr %i2 ssize_t ret; uint32_t c; cur_blk += blocks_in_offset; while ( (RC_OK == rc) 201332c: 80 a6 e0 00 cmp %i3, 0 2013330: 02 80 00 04 be 2013340 2013334: 80 a0 60 00 cmp %g1, 0 2013338: 22 bf ff d2 be,a 2013280 <== ALWAYS TAKEN 201333c: c4 16 20 0a lduh [ %i0 + 0xa ], %g2 bytes_written += ret; ++cur_blk; } ofs_blk = 0; } if (RC_OK != rc) 2013340: 80 a0 60 00 cmp %g1, 0 2013344: 12 80 00 06 bne 201335c <== NEVER TAKEN 2013348: b0 10 3f ff mov -1, %i0 201334c: 81 c7 e0 08 ret 2013350: 91 e8 00 11 restore %g0, %l1, %o0 } } if (RC_OK != rc) return rc; else return bytes_to_write; 2013354: 10 bf ff ee b 201330c 2013358: 90 10 00 10 mov %l0, %o0 } if (RC_OK != rc) return rc; else return bytes_written; } 201335c: 81 c7 e0 08 ret <== NOT EXECUTED 2013360: 81 e8 00 00 restore <== NOT EXECUTED =============================================================================== 020125e0 : int fat_file_close( fat_fs_info_t *fs_info, fat_file_fd_t *fat_fd ) { 20125e0: 9d e3 bf a0 save %sp, -96, %sp /* * if links_num field of fat-file descriptor is greater than 1 * decrement the count of links and return */ if (fat_fd->links_num > 1) 20125e4: c2 06 60 08 ld [ %i1 + 8 ], %g1 20125e8: 80 a0 60 01 cmp %g1, 1 20125ec: 08 80 00 05 bleu 2012600 20125f0: 82 00 7f ff add %g1, -1, %g1 { fat_fd->links_num--; return rc; 20125f4: 90 10 20 00 clr %o0 20125f8: 10 80 00 25 b 201268c 20125fc: c2 26 60 08 st %g1, [ %i1 + 8 ] } key = fat_construct_key(fs_info, &fat_fd->dir_pos.sname); if (fat_fd->flags & FAT_FILE_REMOVED) 2012600: c2 0e 60 30 ldub [ %i1 + 0x30 ], %g1 2012604: 80 88 60 01 btst 1, %g1 2012608: 02 80 00 14 be 2012658 201260c: 90 10 00 18 mov %i0, %o0 { rc = fat_file_truncate(fs_info, fat_fd, 0); 2012610: 92 10 00 19 mov %i1, %o1 2012614: 7f ff ff ae call 20124cc 2012618: 94 10 20 00 clr %o2 if ( rc != RC_OK ) 201261c: 80 a2 20 00 cmp %o0, 0 2012620: 12 80 00 1b bne 201268c <== NEVER TAKEN 2012624: 01 00 00 00 nop */ RTEMS_INLINE_ROUTINE void rtems_chain_extract( rtems_chain_node *the_node ) { _Chain_Extract( the_node ); 2012628: 40 00 0e ac call 20160d8 <_Chain_Extract> 201262c: 90 10 00 19 mov %i1, %o0 return rc; _hash_delete(fs_info->rhash, key, fat_fd->ino, fat_fd); if ( fat_ino_is_unique(fs_info, fat_fd->ino) ) 2012630: d2 06 60 0c ld [ %i1 + 0xc ], %o1 2012634: 40 00 06 01 call 2013e38 2012638: 90 10 00 18 mov %i0, %o0 201263c: 80 8a 20 ff btst 0xff, %o0 2012640: 02 80 00 0f be 201267c <== ALWAYS TAKEN 2012644: 01 00 00 00 nop fat_free_unique_ino(fs_info, fat_fd->ino); 2012648: d2 06 60 0c ld [ %i1 + 0xc ], %o1 <== NOT EXECUTED 201264c: 40 00 05 f0 call 2013e0c <== NOT EXECUTED 2012650: 90 10 00 18 mov %i0, %o0 <== NOT EXECUTED 2012654: 30 80 00 0a b,a 201267c <== NOT EXECUTED free(fat_fd); } else { if (fat_ino_is_unique(fs_info, fat_fd->ino)) 2012658: 40 00 05 f8 call 2013e38 201265c: d2 06 60 0c ld [ %i1 + 0xc ], %o1 2012660: 80 8a 20 ff btst 0xff, %o0 2012664: 02 80 00 04 be 2012674 <== ALWAYS TAKEN 2012668: 01 00 00 00 nop { fat_fd->links_num = 0; 201266c: 10 80 00 06 b 2012684 <== NOT EXECUTED 2012670: c0 26 60 08 clr [ %i1 + 8 ] <== NOT EXECUTED 2012674: 40 00 0e 99 call 20160d8 <_Chain_Extract> 2012678: 90 10 00 19 mov %i1, %o0 } else { _hash_delete(fs_info->vhash, key, fat_fd->ino, fat_fd); free(fat_fd); 201267c: 7f ff cb 36 call 2005354 2012680: 90 10 00 19 mov %i1, %o0 } } /* * flush any modified "cached" buffer back to disk */ rc = fat_buf_release(fs_info); 2012684: 40 00 01 bc call 2012d74 2012688: 81 e8 00 00 restore return rc; } 201268c: 81 c7 e0 08 ret 2012690: 91 e8 00 08 restore %g0, %o0, %o0 =============================================================================== 02012764 : fat_file_fd_t *fat_fd, bool zero_fill, uint32_t new_length, uint32_t *a_length ) { 2012764: 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; 2012768: f6 27 00 00 st %i3, [ %i4 ] if (new_length <= fat_fd->fat_file_size) 201276c: c2 06 60 18 ld [ %i1 + 0x18 ], %g1 uint32_t new_length, uint32_t *a_length ) { int rc = RC_OK; uint32_t chain = 0; 2012770: 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; 2012774: 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) 2012778: 80 a6 c0 01 cmp %i3, %g1 201277c: 18 80 00 04 bgu 201278c 2012780: ba 10 00 18 mov %i0, %i5 return RC_OK; 2012784: 81 c7 e0 08 ret 2012788: 91 e8 20 00 restore %g0, 0, %o0 if ((FAT_FD_OF_ROOT_DIR(fat_fd)) && 201278c: c4 06 60 20 ld [ %i1 + 0x20 ], %g2 2012790: 80 a0 a0 01 cmp %g2, 1 2012794: 32 80 00 0b bne,a 20127c0 2012798: e0 17 60 06 lduh [ %i5 + 6 ], %l0 201279c: c4 06 60 24 ld [ %i1 + 0x24 ], %g2 20127a0: 80 a0 a0 00 cmp %g2, 0 20127a4: 32 80 00 07 bne,a 20127c0 <== NEVER TAKEN 20127a8: e0 17 60 06 lduh [ %i5 + 6 ], %l0 <== NOT EXECUTED (fs_info->vol.type & (FAT_FAT12 | FAT_FAT16))) 20127ac: 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)) && 20127b0: 80 88 a0 03 btst 3, %g2 20127b4: 22 80 00 03 be,a 20127c0 <== NEVER TAKEN 20127b8: e0 17 60 06 lduh [ %i5 + 6 ], %l0 <== NOT EXECUTED 20127bc: 30 80 00 34 b,a 201288c (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))) & 20127c0: 84 04 3f ff add %l0, -1, %g2 20127c4: 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 - 20127c8: a0 24 00 12 sub %l0, %l2, %l0 20127cc: 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; 20127d0: 84 26 c0 01 sub %i3, %g1, %g2 if (bytes2add > bytes_remain) 20127d4: 80 a0 80 10 cmp %g2, %l0 20127d8: 08 80 00 03 bleu 20127e4 20127dc: a2 10 20 00 clr %l1 bytes2add -= bytes_remain; 20127e0: a2 20 80 10 sub %g2, %l0, %l1 else bytes2add = 0; if (zero_fill && bytes_remain > 0) { 20127e4: 80 a4 20 00 cmp %l0, 0 20127e8: 02 80 00 17 be 2012844 20127ec: 80 a4 60 00 cmp %l1, 0 20127f0: 80 a6 a0 00 cmp %i2, 0 20127f4: 02 80 00 14 be 2012844 20127f8: 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; 20127fc: 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); 2012800: 90 10 00 1d mov %i5, %o0 2012804: 92 10 00 19 mov %i1, %o1 2012808: 95 30 40 0a srl %g1, %o2, %o2 201280c: 7f ff fe 39 call 20120f0 2012810: 96 07 bf fc add %fp, -4, %o3 if (rc != RC_OK) 2012814: b0 92 60 00 orcc %o1, 0, %i0 2012818: 12 80 00 21 bne 201289c <== NEVER TAKEN 201281c: d2 07 bf fc ld [ %fp + -4 ], %o1 return rc; bytes_written = fat_cluster_set (fs_info, cur_cln, ofs, bytes_remain, 0); 2012820: 90 10 00 1d mov %i5, %o0 2012824: 94 10 00 12 mov %l2, %o2 2012828: 96 10 00 10 mov %l0, %o3 201282c: 98 10 20 00 clr %o4 2012830: 40 00 02 3a call 2013118 2012834: b0 10 3f ff mov -1, %i0 if (bytes_remain != bytes_written) 2012838: 80 a4 00 08 cmp %l0, %o0 201283c: 12 80 00 18 bne 201289c <== NEVER TAKEN 2012840: 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) 2012844: 02 bf ff d0 be 2012784 2012848: a4 04 7f ff add %l1, -1, %l2 return RC_OK; cls2add = ((bytes2add - 1) >> fs_info->vol.bpc_log2) + 1; 201284c: c2 0f 60 08 ldub [ %i5 + 8 ], %g1 rc = fat_scan_fat_for_free_clusters(fs_info, &chain, cls2add, 2012850: 90 10 00 1d mov %i5, %o0 * file ) - return */ if (bytes2add == 0) return RC_OK; cls2add = ((bytes2add - 1) >> fs_info->vol.bpc_log2) + 1; 2012854: a5 34 80 01 srl %l2, %g1, %l2 rc = fat_scan_fat_for_free_clusters(fs_info, &chain, cls2add, 2012858: 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; 201285c: a4 04 a0 01 inc %l2 rc = fat_scan_fat_for_free_clusters(fs_info, &chain, cls2add, 2012860: 96 07 bf fc add %fp, -4, %o3 2012864: 94 10 00 12 mov %l2, %o2 2012868: 98 07 bf f8 add %fp, -8, %o4 201286c: 40 00 1c 82 call 2019a74 2012870: 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) 2012874: b0 92 20 00 orcc %o0, 0, %i0 2012878: 12 80 00 09 bne 201289c <== NEVER TAKEN 201287c: 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)) 2012880: 80 94 00 01 orcc %l0, %g1, %g0 2012884: 12 80 00 08 bne 20128a4 <== ALWAYS TAKEN 2012888: 80 a4 80 01 cmp %l2, %g1 rtems_set_errno_and_return_minus_one(ENOSPC); 201288c: 40 00 23 48 call 201b5ac <__errno> 2012890: b0 10 3f ff mov -1, %i0 2012894: 82 10 20 1c mov 0x1c, %g1 2012898: c2 22 00 00 st %g1, [ %o0 ] 201289c: 81 c7 e0 08 ret 20128a0: 81 e8 00 00 restore /* check wether we satisfied request for 'cls2add' clusters */ if (cls2add != cls_added) 20128a4: 02 80 00 09 be 20128c8 <== ALWAYS TAKEN 20128a8: 82 24 80 01 sub %l2, %g1, %g1 { new_length -= bytes2add & (fs_info->vol.bpc - 1); 20128ac: c4 17 60 06 lduh [ %i5 + 6 ], %g2 <== NOT EXECUTED 20128b0: 84 00 bf ff add %g2, -1, %g2 <== NOT EXECUTED 20128b4: a2 0c 40 02 and %l1, %g2, %l1 <== NOT EXECUTED new_length -= (cls2add - cls_added) << fs_info->vol.bpc_log2; 20128b8: c4 0f 60 08 ldub [ %i5 + 8 ], %g2 <== NOT EXECUTED rtems_set_errno_and_return_minus_one(ENOSPC); /* check wether we satisfied request for 'cls2add' clusters */ if (cls2add != cls_added) { new_length -= bytes2add & (fs_info->vol.bpc - 1); 20128bc: b6 26 c0 11 sub %i3, %l1, %i3 <== NOT EXECUTED new_length -= (cls2add - cls_added) << fs_info->vol.bpc_log2; 20128c0: 83 28 40 02 sll %g1, %g2, %g1 <== NOT EXECUTED 20128c4: b6 26 c0 01 sub %i3, %g1, %i3 <== NOT EXECUTED } /* add new chain to the end of existed */ if ( fat_fd->fat_file_size == 0 ) 20128c8: d6 06 60 18 ld [ %i1 + 0x18 ], %o3 20128cc: 80 a2 e0 00 cmp %o3, 0 20128d0: 32 80 00 07 bne,a 20128ec 20128d4: c2 06 60 3c ld [ %i1 + 0x3c ], %g1 { fat_fd->map.disk_cln = fat_fd->cln = chain; 20128d8: c2 07 bf f0 ld [ %fp + -16 ], %g1 fat_fd->map.file_cln = 0; 20128dc: c0 26 60 34 clr [ %i1 + 0x34 ] } /* add new chain to the end of existed */ if ( fat_fd->fat_file_size == 0 ) { fat_fd->map.disk_cln = fat_fd->cln = chain; 20128e0: c2 26 60 1c st %g1, [ %i1 + 0x1c ] 20128e4: 10 80 00 1d b 2012958 20128e8: c2 26 60 38 st %g1, [ %i1 + 0x38 ] fat_fd->map.file_cln = 0; } else { if (fat_fd->map.last_cln != FAT_UNDEFINED_VALUE) 20128ec: 80 a0 7f ff cmp %g1, -1 20128f0: 22 80 00 04 be,a 2012900 <== NEVER TAKEN 20128f4: 90 10 00 1d mov %i5, %o0 <== NOT EXECUTED { old_last_cl = fat_fd->map.last_cln; 20128f8: 10 80 00 0c b 2012928 20128fc: c2 27 bf f4 st %g1, [ %fp + -12 ] } else { rc = fat_file_ioctl(fs_info, fat_fd, F_CLU_NUM, 2012900: 92 10 00 19 mov %i1, %o1 <== NOT EXECUTED 2012904: 94 10 20 01 mov 1, %o2 <== NOT EXECUTED 2012908: 96 02 ff ff add %o3, -1, %o3 <== NOT EXECUTED 201290c: 7f ff ff 62 call 2012694 <== NOT EXECUTED 2012910: 98 07 bf f4 add %fp, -12, %o4 <== NOT EXECUTED (fat_fd->fat_file_size - 1), &old_last_cl); if ( rc != RC_OK ) 2012914: b4 92 20 00 orcc %o0, 0, %i2 <== NOT EXECUTED 2012918: 02 80 00 05 be 201292c <== NOT EXECUTED 201291c: d2 07 bf f4 ld [ %fp + -12 ], %o1 <== NOT EXECUTED if (fat_fd->fat_file_type == FAT_DIRECTORY) { rc = fat_init_clusters_chain(fs_info, chain); if ( rc != RC_OK ) { fat_free_fat_clusters_chain(fs_info, chain); 2012920: 10 80 00 1f b 201299c <== NOT EXECUTED 2012924: 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); 2012928: d2 07 bf f4 ld [ %fp + -12 ], %o1 201292c: d4 07 bf f0 ld [ %fp + -16 ], %o2 2012930: 40 00 1b 81 call 2019734 2012934: 90 10 00 1d mov %i5, %o0 2012938: b4 10 00 08 mov %o0, %i2 if ( rc != RC_OK ) 201293c: 80 a6 a0 00 cmp %i2, 0 2012940: 02 80 00 04 be 2012950 <== ALWAYS TAKEN 2012944: 90 10 00 1d mov %i5, %o0 if (fat_fd->fat_file_type == FAT_DIRECTORY) { rc = fat_init_clusters_chain(fs_info, chain); if ( rc != RC_OK ) { fat_free_fat_clusters_chain(fs_info, chain); 2012948: 10 80 00 16 b 20129a0 <== NOT EXECUTED 201294c: d2 07 bf f0 ld [ %fp + -16 ], %o1 <== NOT EXECUTED if ( rc != RC_OK ) { fat_free_fat_clusters_chain(fs_info, chain); return rc; } fat_buf_release(fs_info); 2012950: 40 00 01 09 call 2012d74 2012954: 01 00 00 00 nop } /* update number of the last cluster of the file if it changed */ if (cls_added != 0) 2012958: c2 07 bf fc ld [ %fp + -4 ], %g1 201295c: 80 a0 60 00 cmp %g1, 0 2012960: 22 80 00 14 be,a 20129b0 <== NEVER TAKEN 2012964: f6 27 00 00 st %i3, [ %i4 ] <== NOT EXECUTED { fat_fd->map.last_cln = last_cl; 2012968: c2 07 bf f8 ld [ %fp + -8 ], %g1 201296c: c2 26 60 3c st %g1, [ %i1 + 0x3c ] if (fat_fd->fat_file_type == FAT_DIRECTORY) 2012970: c2 06 60 10 ld [ %i1 + 0x10 ], %g1 2012974: 80 a0 60 00 cmp %g1, 0 2012978: 32 80 00 0e bne,a 20129b0 201297c: f6 27 00 00 st %i3, [ %i4 ] { rc = fat_init_clusters_chain(fs_info, chain); 2012980: d2 07 bf f0 ld [ %fp + -16 ], %o1 2012984: 40 00 04 d4 call 2013cd4 2012988: 90 10 00 1d mov %i5, %o0 if ( rc != RC_OK ) 201298c: b4 92 20 00 orcc %o0, 0, %i2 2012990: 22 80 00 08 be,a 20129b0 <== ALWAYS TAKEN 2012994: f6 27 00 00 st %i3, [ %i4 ] { fat_free_fat_clusters_chain(fs_info, chain); 2012998: 90 10 00 1d mov %i5, %o0 <== NOT EXECUTED 201299c: d2 07 bf f0 ld [ %fp + -16 ], %o1 <== NOT EXECUTED 20129a0: 40 00 1c 06 call 20199b8 <== NOT EXECUTED 20129a4: b0 10 00 1a mov %i2, %i0 <== NOT EXECUTED 20129a8: 81 c7 e0 08 ret <== NOT EXECUTED 20129ac: 81 e8 00 00 restore <== NOT EXECUTED } } } *a_length = new_length; fat_fd->fat_file_size = new_length; 20129b0: f6 26 60 18 st %i3, [ %i1 + 0x18 ] return RC_OK; } 20129b4: 81 c7 e0 08 ret 20129b8: 81 e8 00 00 restore =============================================================================== 02012694 : fat_file_ioctl( fat_fs_info_t *fs_info, fat_file_fd_t *fat_fd, int cmd, ...) { 2012694: 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); 2012698: 82 07 a0 50 add %fp, 0x50, %g1 201269c: f6 27 a0 50 st %i3, [ %fp + 0x50 ] 20126a0: f8 27 a0 54 st %i4, [ %fp + 0x54 ] 20126a4: 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; 20126a8: c0 27 bf f8 clr [ %fp + -8 ] uint32_t *ret; va_list ap; va_start(ap, cmd); switch (cmd) 20126ac: 80 a6 a0 01 cmp %i2, 1 20126b0: 12 80 00 26 bne 2012748 <== NEVER TAKEN 20126b4: c2 27 bf fc st %g1, [ %fp + -4 ] { case F_CLU_NUM: pos = va_arg(ap, uint32_t); ret = va_arg(ap, uint32_t *); 20126b8: 82 07 a0 58 add %fp, 0x58, %g1 20126bc: c2 27 bf fc st %g1, [ %fp + -4 ] /* sanity check */ if ( pos >= fat_fd->fat_file_size ) { 20126c0: c2 06 60 18 ld [ %i1 + 0x18 ], %g1 20126c4: 80 a6 c0 01 cmp %i3, %g1 20126c8: 0a 80 00 06 bcs 20126e0 <== ALWAYS TAKEN 20126cc: ba 10 00 1c mov %i4, %i5 va_end(ap); rtems_set_errno_and_return_minus_one( EIO ); 20126d0: 40 00 23 b7 call 201b5ac <__errno> <== NOT EXECUTED 20126d4: 01 00 00 00 nop <== NOT EXECUTED 20126d8: 10 80 00 1f b 2012754 <== NOT EXECUTED 20126dc: 82 10 20 05 mov 5, %g1 ! 5 <== NOT EXECUTED } if ((FAT_FD_OF_ROOT_DIR(fat_fd)) && 20126e0: c2 06 60 20 ld [ %i1 + 0x20 ], %g1 20126e4: 80 a0 60 01 cmp %g1, 1 20126e8: 32 80 00 0d bne,a 201271c 20126ec: d4 0e 20 08 ldub [ %i0 + 8 ], %o2 20126f0: c2 06 60 24 ld [ %i1 + 0x24 ], %g1 20126f4: 80 a0 60 00 cmp %g1, 0 20126f8: 32 80 00 09 bne,a 201271c <== NEVER TAKEN 20126fc: d4 0e 20 08 ldub [ %i0 + 8 ], %o2 <== NOT EXECUTED (fs_info->vol.type & (FAT_FAT12 | FAT_FAT16))) 2012700: 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)) && 2012704: 80 88 60 03 btst 3, %g1 2012708: 22 80 00 05 be,a 201271c 201270c: 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; 2012710: c0 27 00 00 clr [ %i4 ] rc = RC_OK; break; 2012714: 81 c7 e0 08 ret 2012718: 91 e8 20 00 restore %g0, 0, %o0 } cl_start = pos >> fs_info->vol.bpc_log2; rc = fat_file_lseek(fs_info, fat_fd, cl_start, &cur_cln); 201271c: 90 10 00 18 mov %i0, %o0 2012720: 92 10 00 19 mov %i1, %o1 2012724: 95 36 c0 0a srl %i3, %o2, %o2 2012728: 7f ff fe 72 call 20120f0 201272c: 96 07 bf f8 add %fp, -8, %o3 if ( rc != RC_OK ) 2012730: b0 92 60 00 orcc %o1, 0, %i0 2012734: 12 80 00 03 bne 2012740 <== NEVER TAKEN 2012738: c2 07 bf f8 ld [ %fp + -8 ], %g1 break; *ret = cur_cln; 201273c: c2 27 40 00 st %g1, [ %i5 ] break; 2012740: 81 c7 e0 08 ret 2012744: 81 e8 00 00 restore default: errno = EINVAL; 2012748: 40 00 23 99 call 201b5ac <__errno> <== NOT EXECUTED 201274c: 01 00 00 00 nop <== NOT EXECUTED 2012750: 82 10 20 16 mov 0x16, %g1 ! 16 <== NOT EXECUTED 2012754: c2 22 00 00 st %g1, [ %o0 ] <== NOT EXECUTED rc = -1; 2012758: b0 10 3f ff mov -1, %i0 <== NOT EXECUTED break; } va_end(ap); return rc; } 201275c: 81 c7 e0 08 ret <== NOT EXECUTED 2012760: 81 e8 00 00 restore <== NOT EXECUTED =============================================================================== 020120f0 : fat_fs_info_t *fs_info, fat_file_fd_t *fat_fd, uint32_t file_cln, uint32_t *disk_cln ) { 20120f0: 9d e3 bf 98 save %sp, -104, %sp int rc = RC_OK; if (file_cln == fat_fd->map.file_cln) 20120f4: c2 06 60 34 ld [ %i1 + 0x34 ], %g1 20120f8: 80 a6 80 01 cmp %i2, %g1 20120fc: 12 80 00 05 bne 2012110 2012100: 01 00 00 00 nop *disk_cln = fat_fd->map.disk_cln; 2012104: c2 06 60 38 ld [ %i1 + 0x38 ], %g1 2012108: 10 80 00 1b b 2012174 201210c: 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) 2012110: 28 80 00 06 bleu,a 2012128 2012114: c2 06 60 1c ld [ %i1 + 0x1c ], %g1 { cur_cln = fat_fd->map.disk_cln; 2012118: c4 06 60 38 ld [ %i1 + 0x38 ], %g2 count = file_cln - fat_fd->map.file_cln; 201211c: b8 26 80 01 sub %i2, %g1, %i4 uint32_t count; uint32_t i; if (file_cln > fat_fd->map.file_cln) { cur_cln = fat_fd->map.disk_cln; 2012120: 10 80 00 04 b 2012130 2012124: c4 27 bf fc st %g2, [ %fp + -4 ] count = file_cln - fat_fd->map.file_cln; } else { cur_cln = fat_fd->cln; 2012128: b8 10 00 1a mov %i2, %i4 201212c: c2 27 bf fc st %g1, [ %fp + -4 ] count = file_cln; } /* skip over the clusters */ for (i = 0; i < count; i++) 2012130: 10 80 00 0b b 201215c 2012134: ba 10 20 00 clr %i5 { rc = fat_get_fat_cluster(fs_info, cur_cln, &cur_cln); 2012138: 90 10 00 18 mov %i0, %o0 201213c: 40 00 1d 0c call 201956c 2012140: 94 07 bf fc add %fp, -4, %o2 if ( rc != RC_OK ) 2012144: 80 a2 20 00 cmp %o0, 0 2012148: 22 80 00 05 be,a 201215c <== ALWAYS TAKEN 201214c: ba 07 60 01 inc %i5 return rc; 2012150: 86 10 00 08 mov %o0, %g3 <== NOT EXECUTED 2012154: 10 80 00 0a b 201217c <== NOT EXECUTED 2012158: 85 3a 20 1f sra %o0, 0x1f, %g2 <== NOT EXECUTED cur_cln = fat_fd->cln; count = file_cln; } /* skip over the clusters */ for (i = 0; i < count; i++) 201215c: 80 a7 40 1c cmp %i5, %i4 2012160: 12 bf ff f6 bne 2012138 2012164: d2 07 bf fc ld [ %fp + -4 ], %o1 if ( rc != RC_OK ) return rc; } /* update cache */ fat_fd->map.file_cln = file_cln; 2012168: f4 26 60 34 st %i2, [ %i1 + 0x34 ] fat_fd->map.disk_cln = cur_cln; 201216c: d2 26 60 38 st %o1, [ %i1 + 0x38 ] *disk_cln = cur_cln; 2012170: d2 26 c0 00 st %o1, [ %i3 ] } return RC_OK; 2012174: 84 10 20 00 clr %g2 2012178: 86 10 20 00 clr %g3 } 201217c: b0 10 00 02 mov %g2, %i0 2012180: 81 c7 e0 08 ret 2012184: 93 e8 00 03 restore %g0, %g3, %o1 =============================================================================== 02012188 : fat_file_open( fat_fs_info_t *fs_info, fat_dir_pos_t *dir_pos, fat_file_fd_t **fat_fd ) { 2012188: 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); 201218c: 90 10 00 18 mov %i0, %o0 2012190: 7f ff ff c7 call 20120ac 2012194: 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; 2012198: 82 0a 20 01 and %o0, 1, %g1 rtems_chain_node *the_node = rtems_chain_first(hash + mod); 201219c: 85 28 60 02 sll %g1, 2, %g2 20121a0: b7 28 60 04 sll %g1, 4, %i3 20121a4: c2 06 20 6c ld [ %i0 + 0x6c ], %g1 20121a8: b6 26 c0 02 sub %i3, %g2, %i3 int rc = RC_OK; fat_file_fd_t *lfat_fd = NULL; uint32_t key = 0; /* construct key */ key = fat_construct_key(fs_info, &dir_pos->sname); 20121ac: b8 10 00 08 mov %o0, %i4 uint32_t key2, fat_file_fd_t **ret ) { uint32_t mod = (key1) % FAT_HASH_MODULE; rtems_chain_node *the_node = rtems_chain_first(hash + mod); 20121b0: a0 00 40 1b add %g1, %i3, %l0 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_First( Chain_Control *the_chain ) { return _Chain_Head( the_chain )->next; 20121b4: fa 00 40 1b ld [ %g1 + %i3 ], %i5 RTEMS_INLINE_ROUTINE bool _Chain_Is_tail( const Chain_Control *the_chain, const Chain_Node *the_node ) { return (the_node == _Chain_Immutable_tail( the_chain )); 20121b8: 10 80 00 0c b 20121e8 20121bc: a0 04 20 04 add %l0, 4, %l0 for ( ; !rtems_chain_is_tail((hash) + mod, the_node) ; ) { fat_file_fd_t *ffd = (fat_file_fd_t *)the_node; uint32_t ck = fat_construct_key(fs_info, &ffd->dir_pos.sname); 20121c0: 7f ff ff bb call 20120ac 20121c4: 92 07 60 20 add %i5, 0x20, %o1 if ( (key1) == ck) 20121c8: 80 a7 00 08 cmp %i4, %o0 20121cc: 32 80 00 07 bne,a 20121e8 20121d0: fa 07 40 00 ld [ %i5 ], %i5 rc = _hash_search(fs_info, fs_info->vhash, key, 0, &lfat_fd); if ( rc == RC_OK ) { /* return pointer to fat_file_descriptor allocated before */ (*fat_fd) = lfat_fd; lfat_fd->links_num++; 20121d4: c2 07 60 08 ld [ %i5 + 8 ], %g1 /* access "valid" hash table */ rc = _hash_search(fs_info, fs_info->vhash, key, 0, &lfat_fd); if ( rc == RC_OK ) { /* return pointer to fat_file_descriptor allocated before */ (*fat_fd) = lfat_fd; 20121d8: fa 26 80 00 st %i5, [ %i2 ] lfat_fd->links_num++; 20121dc: 82 00 60 01 inc %g1 20121e0: 10 80 00 42 b 20122e8 20121e4: c2 27 60 08 st %g1, [ %i5 + 8 ] ) { uint32_t mod = (key1) % FAT_HASH_MODULE; rtems_chain_node *the_node = rtems_chain_first(hash + mod); for ( ; !rtems_chain_is_tail((hash) + mod, the_node) ; ) 20121e8: 80 a7 40 10 cmp %i5, %l0 20121ec: 12 bf ff f5 bne 20121c0 20121f0: 90 10 00 18 mov %i0, %o0 uint32_t key2, fat_file_fd_t **ret ) { uint32_t mod = (key1) % FAT_HASH_MODULE; rtems_chain_node *the_node = rtems_chain_first(hash + mod); 20121f4: 10 80 00 3f b 20122f0 20121f8: c2 06 20 70 ld [ %i0 + 0x70 ], %g1 for ( ; !rtems_chain_is_tail((hash) + mod, the_node) ; ) { fat_file_fd_t *ffd = (fat_file_fd_t *)the_node; uint32_t ck = fat_construct_key(fs_info, &ffd->dir_pos.sname); 20121fc: 7f ff ff ac call 20120ac <== NOT EXECUTED 2012200: 92 07 60 20 add %i5, 0x20, %o1 <== NOT EXECUTED if ( (key1) == ck) 2012204: 80 a7 00 08 cmp %i4, %o0 <== NOT EXECUTED 2012208: 32 80 00 0a bne,a 2012230 <== NOT EXECUTED 201220c: fa 07 40 00 ld [ %i5 ], %i5 <== NOT EXECUTED { if ( ((key2) == 0) || ((key2) == ffd->ino) ) 2012210: 80 a7 20 00 cmp %i4, 0 <== NOT EXECUTED 2012214: 22 80 00 0b be,a 2012240 <== NOT EXECUTED 2012218: a0 10 20 00 clr %l0 <== NOT EXECUTED 201221c: c2 07 60 0c ld [ %i5 + 0xc ], %g1 <== NOT EXECUTED 2012220: 80 a7 00 01 cmp %i4, %g1 <== NOT EXECUTED 2012224: 22 80 00 07 be,a 2012240 <== NOT EXECUTED 2012228: a0 10 20 00 clr %l0 <== NOT EXECUTED { *ret = (void *)the_node; return 0; } } the_node = the_node->next; 201222c: fa 07 40 00 ld [ %i5 ], %i5 <== NOT EXECUTED ) { uint32_t mod = (key1) % FAT_HASH_MODULE; rtems_chain_node *the_node = rtems_chain_first(hash + mod); for ( ; !rtems_chain_is_tail((hash) + mod, the_node) ; ) 2012230: 80 a7 40 10 cmp %i5, %l0 2012234: 12 bf ff f2 bne 20121fc <== NEVER TAKEN 2012238: 90 10 00 18 mov %i0, %o0 201223c: 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)); 2012240: 7f ff cd 8f call 200587c 2012244: 90 10 20 44 mov 0x44, %o0 2012248: d0 26 80 00 st %o0, [ %i2 ] if ( lfat_fd == NULL ) 201224c: 80 a2 20 00 cmp %o0, 0 2012250: 02 80 00 1c be 20122c0 <== NEVER TAKEN 2012254: ba 10 00 08 mov %o0, %i5 rtems_set_errno_and_return_minus_one( ENOMEM ); memset(lfat_fd, 0, sizeof(fat_file_fd_t)); 2012258: 92 10 20 00 clr %o1 201225c: 40 00 27 d0 call 201c19c 2012260: 94 10 20 44 mov 0x44, %o2 lfat_fd->links_num = 1; 2012264: 82 10 20 01 mov 1, %g1 2012268: c2 27 60 08 st %g1, [ %i5 + 8 ] lfat_fd->flags &= ~FAT_FILE_REMOVED; 201226c: c2 0f 60 30 ldub [ %i5 + 0x30 ], %g1 lfat_fd->map.last_cln = FAT_UNDEFINED_VALUE; lfat_fd->dir_pos = *dir_pos; 2012270: 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; 2012274: 82 08 7f fe and %g1, -2, %g1 2012278: c2 2f 60 30 stb %g1, [ %i5 + 0x30 ] lfat_fd->map.last_cln = FAT_UNDEFINED_VALUE; 201227c: 82 10 3f ff mov -1, %g1 lfat_fd->dir_pos = *dir_pos; 2012280: 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; 2012284: c2 27 60 3c st %g1, [ %i5 + 0x3c ] lfat_fd->dir_pos = *dir_pos; 2012288: 40 00 27 88 call 201c0a8 201228c: 94 10 20 10 mov 0x10, %o2 if ( rc != RC_OK ) 2012290: 80 a4 20 00 cmp %l0, 0 2012294: 02 80 00 04 be 20122a4 <== NEVER TAKEN 2012298: 01 00 00 00 nop lfat_fd->ino = key; 201229c: 10 80 00 0f b 20122d8 20122a0: f8 27 60 0c st %i4, [ %i5 + 0xc ] else { lfat_fd->ino = fat_get_unique_ino(fs_info); 20122a4: 40 00 06 aa call 2013d4c <== NOT EXECUTED 20122a8: 90 10 00 18 mov %i0, %o0 <== NOT EXECUTED if ( lfat_fd->ino == 0 ) 20122ac: 80 a2 20 00 cmp %o0, 0 <== NOT EXECUTED 20122b0: 12 80 00 0a bne 20122d8 <== NOT EXECUTED 20122b4: d0 27 60 0c st %o0, [ %i5 + 0xc ] <== NOT EXECUTED { free((*fat_fd)); 20122b8: 7f ff cc 27 call 2005354 <== NOT EXECUTED 20122bc: 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 ); 20122c0: 40 00 24 bb call 201b5ac <__errno> <== NOT EXECUTED 20122c4: b0 10 3f ff mov -1, %i0 <== NOT EXECUTED 20122c8: 82 10 20 0c mov 0xc, %g1 <== NOT EXECUTED 20122cc: c2 22 00 00 st %g1, [ %o0 ] <== NOT EXECUTED 20122d0: 81 c7 e0 08 ret <== NOT EXECUTED 20122d4: 81 e8 00 00 restore <== NOT EXECUTED */ static inline void _hash_insert(rtems_chain_control *hash, uint32_t key1, uint32_t key2, fat_file_fd_t *el) { rtems_chain_append((hash) + ((key1) % FAT_HASH_MODULE), &(el)->link); 20122d8: d0 06 20 6c ld [ %i0 + 0x6c ], %o0 RTEMS_INLINE_ROUTINE void rtems_chain_append( rtems_chain_control *the_chain, rtems_chain_node *the_node ) { _Chain_Append( the_chain, the_node ); 20122dc: 92 10 00 1d mov %i5, %o1 20122e0: 7f ff e0 33 call 200a3ac <_Chain_Append> 20122e4: 90 02 00 1b add %o0, %i3, %o0 /* * other fields of fat-file descriptor will be initialized on upper * level */ return RC_OK; 20122e8: 81 c7 e0 08 ret 20122ec: 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); 20122f0: a0 00 40 1b add %g1, %i3, %l0 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_First( Chain_Control *the_chain ) { return _Chain_Head( the_chain )->next; 20122f4: fa 00 40 1b ld [ %g1 + %i3 ], %i5 RTEMS_INLINE_ROUTINE bool _Chain_Is_tail( const Chain_Control *the_chain, const Chain_Node *the_node ) { return (the_node == _Chain_Immutable_tail( the_chain )); 20122f8: 10 bf ff ce b 2012230 20122fc: a0 04 20 04 add %l0, 4, %l0 =============================================================================== 02012314 : fat_file_fd_t *fat_fd, uint32_t start, uint32_t count, uint8_t *buf ) { 2012314: 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; 2012318: c0 27 bf fc clr [ %fp + -4 ] fat_file_fd_t *fat_fd, uint32_t start, uint32_t count, uint8_t *buf ) { 201231c: 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) 2012320: 80 a6 e0 00 cmp %i3, 0 2012324: 02 80 00 68 be 20124c4 <== NEVER TAKEN 2012328: 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 ) 201232c: c2 06 60 18 ld [ %i1 + 0x18 ], %g1 2012330: 80 a6 80 01 cmp %i2, %g1 2012334: 1a 80 00 64 bcc 20124c4 2012338: 80 a6 c0 01 cmp %i3, %g1 return FAT_EOF; if ((count > fat_fd->fat_file_size) || 201233c: 38 80 00 07 bgu,a 2012358 <== NEVER TAKEN 2012340: b6 20 40 1a sub %g1, %i2, %i3 <== NOT EXECUTED (start > fat_fd->fat_file_size - count)) 2012344: 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) || 2012348: 80 a6 80 02 cmp %i2, %g2 201234c: 28 80 00 04 bleu,a 201235c 2012350: c2 06 60 20 ld [ %i1 + 0x20 ], %g1 (start > fat_fd->fat_file_size - count)) count = fat_fd->fat_file_size - start; 2012354: b6 20 40 1a sub %g1, %i2, %i3 if ((FAT_FD_OF_ROOT_DIR(fat_fd)) && 2012358: c2 06 60 20 ld [ %i1 + 0x20 ], %g1 201235c: 80 a0 60 01 cmp %g1, 1 2012360: 32 80 00 1c bne,a 20123d0 2012364: e4 0f 60 08 ldub [ %i5 + 8 ], %l2 2012368: c2 06 60 24 ld [ %i1 + 0x24 ], %g1 201236c: 80 a0 60 00 cmp %g1, 0 2012370: 32 80 00 18 bne,a 20123d0 <== NEVER TAKEN 2012374: e4 0f 60 08 ldub [ %i5 + 8 ], %l2 <== NOT EXECUTED (fs_info->vol.type & (FAT_FAT12 | FAT_FAT16))) 2012378: 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)) && 201237c: 80 88 60 03 btst 3, %g1 2012380: 22 80 00 14 be,a 20123d0 2012384: 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); 2012388: d2 06 60 1c ld [ %i1 + 0x1c ], %o1 201238c: 7f ff ff 3a call 2012074 2012390: 90 10 00 1d mov %i5, %o0 sec += (start >> fs_info->vol.sec_log2); 2012394: d2 0f 60 02 ldub [ %i5 + 2 ], %o1 byte = start & (fs_info->vol.bps - 1); 2012398: 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); 201239c: 93 36 80 09 srl %i2, %o1, %o1 byte = start & (fs_info->vol.bps - 1); 20123a0: 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); 20123a4: 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); 20123a8: 94 0e 80 0a and %i2, %o2, %o2 20123ac: 90 10 00 1d mov %i5, %o0 20123b0: 96 10 00 1b mov %i3, %o3 20123b4: 40 00 03 13 call 2013000 <_fat_block_read> 20123b8: 98 10 00 1c mov %i4, %o4 if ( ret < 0 ) 20123bc: 80 a2 20 00 cmp %o0, 0 20123c0: 16 80 00 41 bge 20124c4 <== ALWAYS TAKEN 20123c4: 01 00 00 00 nop sec += (ofs >> fs_info->vol.sec_log2); byte = ofs & (fs_info->vol.bps - 1); ret = _fat_block_read(fs_info, sec, byte, c, buf + cmpltd); if ( ret < 0 ) return -1; 20123c8: 10 80 00 3f b 20124c4 <== NOT EXECUTED 20123cc: 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); 20123d0: f0 17 60 06 lduh [ %i5 + 6 ], %i0 return -1; return ret; } cl_start = start >> fs_info->vol.bpc_log2; 20123d4: 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); 20123d8: a6 07 bf fc add %fp, -4, %l3 20123dc: 90 10 00 1d mov %i5, %o0 20123e0: 92 10 00 19 mov %i1, %o1 20123e4: 94 10 00 12 mov %l2, %o2 20123e8: 7f ff ff 42 call 20120f0 20123ec: 96 10 00 13 mov %l3, %o3 if (rc != RC_OK) 20123f0: 90 92 60 00 orcc %o1, 0, %o0 20123f4: 12 80 00 34 bne 20124c4 <== NEVER TAKEN 20123f8: 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); 20123fc: b1 2e 20 10 sll %i0, 0x10, %i0 2012400: b1 36 20 10 srl %i0, 0x10, %i0 2012404: b0 06 3f ff add %i0, -1, %i0 2012408: b4 0e 80 18 and %i2, %i0, %i2 201240c: b0 10 20 00 clr %i0 2012410: 10 80 00 20 b 2012490 2012414: a2 10 00 1a mov %i2, %l1 if (rc != RC_OK) return rc; while (count > 0) { c = MIN(count, (fs_info->vol.bpc - ofs)); 2012418: a0 24 00 11 sub %l0, %l1, %l0 201241c: 80 a4 00 1b cmp %l0, %i3 2012420: 38 80 00 02 bgu,a 2012428 2012424: a0 10 00 1b mov %i3, %l0 sec = fat_cluster_num_to_sector_num(fs_info, cur_cln); 2012428: d2 07 bf fc ld [ %fp + -4 ], %o1 201242c: 7f ff ff 12 call 2012074 2012430: 90 10 00 1d mov %i5, %o0 sec += (ofs >> fs_info->vol.sec_log2); 2012434: d2 0f 60 02 ldub [ %i5 + 2 ], %o1 byte = ofs & (fs_info->vol.bps - 1); 2012438: 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); 201243c: 93 34 40 09 srl %l1, %o1, %o1 byte = ofs & (fs_info->vol.bps - 1); 2012440: 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); 2012444: 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); 2012448: 94 0c 40 0a and %l1, %o2, %o2 201244c: 90 10 00 1d mov %i5, %o0 2012450: 96 10 00 10 mov %l0, %o3 2012454: 40 00 02 eb call 2013000 <_fat_block_read> 2012458: 98 07 00 18 add %i4, %i0, %o4 if ( ret < 0 ) 201245c: 80 a2 20 00 cmp %o0, 0 2012460: 06 80 00 18 bl 20124c0 <== NEVER TAKEN 2012464: b6 26 c0 10 sub %i3, %l0, %i3 return -1; count -= c; cmpltd += c; 2012468: b0 06 00 10 add %i0, %l0, %i0 save_cln = cur_cln; 201246c: e0 07 bf fc ld [ %fp + -4 ], %l0 rc = fat_get_fat_cluster(fs_info, cur_cln, &cur_cln); 2012470: 90 10 00 1d mov %i5, %o0 2012474: 92 10 00 10 mov %l0, %o1 2012478: 94 10 00 13 mov %l3, %o2 201247c: 40 00 1c 3c call 201956c 2012480: a2 10 20 00 clr %l1 if ( rc != RC_OK ) 2012484: 80 a2 20 00 cmp %o0, 0 2012488: 12 80 00 0f bne 20124c4 <== NEVER TAKEN 201248c: 01 00 00 00 nop rc = fat_file_lseek(fs_info, fat_fd, cl_start, &cur_cln); if (rc != RC_OK) return rc; while (count > 0) 2012490: 80 a6 e0 00 cmp %i3, 0 2012494: 32 bf ff e1 bne,a 2012418 2012498: e0 17 60 06 lduh [ %i5 + 6 ], %l0 } /* update cache */ /* XXX: check this - I'm not sure :( */ fat_fd->map.file_cln = cl_start + ((save_ofs + cmpltd - 1) >> fs_info->vol.bpc_log2); 201249c: c2 0f 60 08 ldub [ %i5 + 8 ], %g1 20124a0: b4 06 bf ff add %i2, -1, %i2 fat_fd->map.disk_cln = save_cln; 20124a4: 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); 20124a8: b4 06 80 18 add %i2, %i0, %i2 fat_fd->map.disk_cln = save_cln; return cmpltd; 20124ac: 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); 20124b0: 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 + 20124b4: a4 06 80 12 add %i2, %l2, %l2 20124b8: 10 80 00 03 b 20124c4 20124bc: 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; 20124c0: 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; } 20124c4: 81 c7 e0 08 ret 20124c8: 91 e8 00 08 restore %g0, %o0, %o0 =============================================================================== 02012c3c : int fat_file_size( fat_fs_info_t *fs_info, fat_file_fd_t *fat_fd ) { 2012c3c: 9d e3 bf 98 save %sp, -104, %sp int rc = RC_OK; uint32_t cur_cln = fat_fd->cln; 2012c40: c2 06 60 1c ld [ %i1 + 0x1c ], %g1 2012c44: 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)) && 2012c48: c2 06 60 20 ld [ %i1 + 0x20 ], %g1 2012c4c: 80 a0 60 01 cmp %g1, 1 2012c50: 12 80 00 0d bne 2012c84 2012c54: ba 10 00 18 mov %i0, %i5 2012c58: c2 06 60 24 ld [ %i1 + 0x24 ], %g1 2012c5c: 80 a0 60 00 cmp %g1, 0 2012c60: 32 80 00 0a bne,a 2012c88 <== NEVER TAKEN 2012c64: c0 26 60 18 clr [ %i1 + 0x18 ] <== NOT EXECUTED (fs_info->vol.type & (FAT_FAT12 | FAT_FAT16))) 2012c68: 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)) && 2012c6c: 80 88 60 03 btst 3, %g1 2012c70: 22 80 00 06 be,a 2012c88 <== ALWAYS TAKEN 2012c74: 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; 2012c78: c2 06 20 2c ld [ %i0 + 0x2c ], %g1 <== NOT EXECUTED 2012c7c: 10 80 00 18 b 2012cdc <== NOT EXECUTED 2012c80: c2 26 60 18 st %g1, [ %i1 + 0x18 ] <== NOT EXECUTED return rc; } fat_fd->fat_file_size = 0; 2012c84: c0 26 60 18 clr [ %i1 + 0x18 ] while ((cur_cln & fs_info->vol.mask) < fs_info->vol.eoc_val) 2012c88: 10 80 00 0d b 2012cbc 2012c8c: 82 10 20 00 clr %g1 { save_cln = cur_cln; rc = fat_get_fat_cluster(fs_info, cur_cln, &cur_cln); 2012c90: 92 10 00 1c mov %i4, %o1 2012c94: 40 00 1a 36 call 201956c 2012c98: 94 07 bf fc add %fp, -4, %o2 if ( rc != RC_OK ) 2012c9c: b0 92 20 00 orcc %o0, 0, %i0 2012ca0: 12 80 00 10 bne 2012ce0 <== NEVER TAKEN 2012ca4: 01 00 00 00 nop return rc; fat_fd->fat_file_size += fs_info->vol.bpc; 2012ca8: c2 17 60 06 lduh [ %i5 + 6 ], %g1 2012cac: c4 06 60 18 ld [ %i1 + 0x18 ], %g2 2012cb0: 82 00 80 01 add %g2, %g1, %g1 2012cb4: 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; 2012cb8: 82 10 00 1c mov %i4, %g1 return rc; } fat_fd->fat_file_size = 0; while ((cur_cln & fs_info->vol.mask) < fs_info->vol.eoc_val) 2012cbc: f8 07 bf fc ld [ %fp + -4 ], %i4 2012cc0: c6 07 60 10 ld [ %i5 + 0x10 ], %g3 2012cc4: c4 07 60 14 ld [ %i5 + 0x14 ], %g2 2012cc8: 86 0f 00 03 and %i4, %g3, %g3 2012ccc: 80 a0 c0 02 cmp %g3, %g2 2012cd0: 0a bf ff f0 bcs 2012c90 2012cd4: 90 10 00 1d mov %i5, %o0 if ( rc != RC_OK ) return rc; fat_fd->fat_file_size += fs_info->vol.bpc; } fat_fd->map.last_cln = save_cln; 2012cd8: c2 26 60 3c st %g1, [ %i1 + 0x3c ] 2012cdc: b0 10 20 00 clr %i0 return rc; } 2012ce0: 81 c7 e0 08 ret 2012ce4: 81 e8 00 00 restore =============================================================================== 020124cc : fat_file_truncate( fat_fs_info_t *fs_info, fat_file_fd_t *fat_fd, uint32_t new_length ) { 20124cc: 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; 20124d0: 82 10 3f ff mov -1, %g1 20124d4: c2 27 bf fc st %g1, [ %fp + -4 ] if ( new_length >= fat_fd->fat_file_size ) 20124d8: c2 06 60 18 ld [ %i1 + 0x18 ], %g1 20124dc: 80 a6 80 01 cmp %i2, %g1 20124e0: 0a 80 00 04 bcs 20124f0 20124e4: c0 27 bf f8 clr [ %fp + -8 ] return rc; 20124e8: 10 80 00 3b b 20125d4 20124ec: 92 10 20 00 clr %o1 assert(fat_fd->fat_file_size); 20124f0: 80 a0 60 00 cmp %g1, 0 20124f4: 32 80 00 0a bne,a 201251c <== ALWAYS TAKEN 20124f8: c4 0e 20 08 ldub [ %i0 + 8 ], %g2 20124fc: 11 00 80 ad sethi %hi(0x202b400), %o0 <== NOT EXECUTED 2012500: 15 00 80 ae sethi %hi(0x202b800), %o2 <== NOT EXECUTED 2012504: 17 00 80 ad sethi %hi(0x202b400), %o3 <== NOT EXECUTED 2012508: 90 12 23 a8 or %o0, 0x3a8, %o0 <== NOT EXECUTED 201250c: 92 10 22 d1 mov 0x2d1, %o1 <== NOT EXECUTED 2012510: 94 12 a0 08 or %o2, 8, %o2 <== NOT EXECUTED 2012514: 40 00 08 82 call 201471c <__assert_func> <== NOT EXECUTED 2012518: 96 12 e3 f0 or %o3, 0x3f0, %o3 <== NOT EXECUTED cl_start = (new_length + fs_info->vol.bpc - 1) >> fs_info->vol.bpc_log2; 201251c: c6 16 20 06 lduh [ %i0 + 6 ], %g3 2012520: 86 00 ff ff add %g3, -1, %g3 2012524: b4 00 c0 1a add %g3, %i2, %i2 2012528: b5 36 80 02 srl %i2, %g2, %i2 if ((cl_start << fs_info->vol.bpc_log2) >= fat_fd->fat_file_size) 201252c: 85 2e 80 02 sll %i2, %g2, %g2 2012530: 80 a0 80 01 cmp %g2, %g1 2012534: 1a bf ff ed bcc 20124e8 2012538: 80 a6 a0 00 cmp %i2, 0 return RC_OK; if (cl_start != 0) 201253c: 12 80 00 0b bne 2012568 2012540: 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); 2012544: 92 10 00 19 mov %i1, %o1 2012548: 94 10 00 1a mov %i2, %o2 201254c: 7f ff fe e9 call 20120f0 2012550: 96 07 bf f8 add %fp, -8, %o3 if (rc != RC_OK) 2012554: 80 a2 60 00 cmp %o1, 0 2012558: 32 80 00 20 bne,a 20125d8 <== NEVER TAKEN 201255c: b0 10 00 09 mov %o1, %i0 <== NOT EXECUTED return rc; rc = fat_free_fat_clusters_chain(fs_info, cur_cln); 2012560: 10 80 00 0b b 201258c 2012564: 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); 2012568: 92 10 00 19 mov %i1, %o1 201256c: 94 06 bf ff add %i2, -1, %o2 2012570: 7f ff fe e0 call 20120f0 2012574: 96 07 bf fc add %fp, -4, %o3 if (rc != RC_OK) 2012578: 80 a2 60 00 cmp %o1, 0 201257c: 02 bf ff f2 be 2012544 <== ALWAYS TAKEN 2012580: 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; } 2012584: 81 c7 e0 08 ret <== NOT EXECUTED 2012588: 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); 201258c: 40 00 1d 0b call 20199b8 2012590: 90 10 00 18 mov %i0, %o0 if (rc != RC_OK) 2012594: 92 92 20 00 orcc %o0, 0, %o1 2012598: 12 80 00 0f bne 20125d4 <== NEVER TAKEN 201259c: 80 a6 a0 00 cmp %i2, 0 return rc; if (cl_start != 0) 20125a0: 02 80 00 0d be 20125d4 20125a4: 92 10 20 00 clr %o1 { rc = fat_set_fat_cluster(fs_info, new_last_cln, FAT_GENFAT_EOC); 20125a8: d2 07 bf fc ld [ %fp + -4 ], %o1 20125ac: 90 10 00 18 mov %i0, %o0 20125b0: 40 00 1c 61 call 2019734 20125b4: 94 10 3f ff mov -1, %o2 if ( rc != RC_OK ) 20125b8: 92 92 20 00 orcc %o0, 0, %o1 20125bc: 12 80 00 06 bne 20125d4 <== NEVER TAKEN 20125c0: c2 07 bf fc ld [ %fp + -4 ], %g1 return rc; fat_fd->map.file_cln = cl_start - 1; 20125c4: b4 06 bf ff add %i2, -1, %i2 fat_fd->map.disk_cln = new_last_cln; 20125c8: 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; 20125cc: f4 26 60 34 st %i2, [ %i1 + 0x34 ] fat_fd->map.disk_cln = new_last_cln; fat_fd->map.last_cln = new_last_cln; 20125d0: c2 26 60 3c st %g1, [ %i1 + 0x3c ] } return RC_OK; } 20125d4: b0 10 00 09 mov %o1, %i0 20125d8: 81 c7 e0 08 ret 20125dc: 81 e8 00 00 restore =============================================================================== 020129bc : fat_file_fd_t *fat_fd, uint32_t start, uint32_t count, const uint8_t *buf ) { 20129bc: 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; 20129c0: c0 27 bf f8 clr [ %fp + -8 ] fat_file_fd_t *fat_fd, uint32_t start, uint32_t count, const uint8_t *buf ) { 20129c4: 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; 20129c8: c2 06 60 18 ld [ %i1 + 0x18 ], %g1 uint32_t file_cln_initial = fat_fd->map.file_cln; 20129cc: e6 06 60 34 ld [ %i1 + 0x34 ], %l3 uint32_t cln; if ( count == 0 ) 20129d0: 80 a6 e0 00 cmp %i3, 0 20129d4: 02 80 00 84 be 2012be4 <== NEVER TAKEN 20129d8: 90 10 20 00 clr %o0 return cmpltd; if (start >= fat_fd->size_limit) 20129dc: fa 06 60 14 ld [ %i1 + 0x14 ], %i5 20129e0: 80 a6 80 1d cmp %i2, %i5 20129e4: 2a 80 00 07 bcs,a 2012a00 <== ALWAYS TAKEN 20129e8: ba 27 40 1a sub %i5, %i2, %i5 rtems_set_errno_and_return_minus_one(EFBIG); 20129ec: 40 00 22 f0 call 201b5ac <__errno> <== NOT EXECUTED 20129f0: 01 00 00 00 nop <== NOT EXECUTED 20129f4: 82 10 20 1b mov 0x1b, %g1 ! 1b <== NOT EXECUTED 20129f8: 10 80 00 30 b 2012ab8 <== NOT EXECUTED 20129fc: c2 22 00 00 st %g1, [ %o0 ] <== NOT EXECUTED 2012a00: 80 a7 40 1b cmp %i5, %i3 2012a04: 38 80 00 02 bgu,a 2012a0c <== ALWAYS TAKEN 2012a08: 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; 2012a0c: 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); 2012a10: b6 07 40 1a add %i5, %i2, %i3 2012a14: 94 40 20 00 addx %g0, 0, %o2 2012a18: 90 10 00 10 mov %l0, %o0 2012a1c: 92 10 00 19 mov %i1, %o1 2012a20: 96 10 00 1b mov %i3, %o3 2012a24: 7f ff ff 50 call 2012764 2012a28: 98 07 bf f8 add %fp, -8, %o4 if (RC_OK == rc) 2012a2c: 80 a2 20 00 cmp %o0, 0 2012a30: 12 80 00 6d bne 2012be4 2012a34: c2 07 bf f8 ld [ %fp + -8 ], %g1 { /* * check whether there was enough room on device to locate * file of 'start + count' bytes */ if (c != (start + count)) 2012a38: 80 a0 40 1b cmp %g1, %i3 2012a3c: 32 80 00 02 bne,a 2012a44 <== NEVER TAKEN 2012a40: ba 20 40 1a sub %g1, %i2, %i5 <== NOT EXECUTED */ static bool fat_is_fat12_or_fat16_root_dir (const fat_file_fd_t *fat_fd, const uint8_t volume_type) { return (FAT_FD_OF_ROOT_DIR(fat_fd)) && (volume_type & (FAT_FAT12 | FAT_FAT16)); 2012a44: 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)) 2012a48: 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)); 2012a4c: 80 a0 e0 01 cmp %g3, 1 2012a50: 12 80 00 09 bne 2012a74 2012a54: 82 10 20 00 clr %g1 2012a58: c6 06 60 24 ld [ %i1 + 0x24 ], %g3 2012a5c: 80 a0 e0 00 cmp %g3, 0 2012a60: 12 80 00 06 bne 2012a78 <== NEVER TAKEN 2012a64: 80 a0 60 00 cmp %g1, 0 2012a68: 82 08 a0 03 and %g2, 3, %g1 2012a6c: 80 a0 00 01 cmp %g0, %g1 2012a70: 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)) 2012a74: 80 a0 60 00 cmp %g1, 0 2012a78: 02 80 00 12 be 2012ac0 2012a7c: f6 0c 20 08 ldub [ %l0 + 8 ], %i3 { cln = fat_fd->cln; 2012a80: d2 06 60 1c ld [ %i1 + 0x1c ], %o1 cln += (start >> fs_info->vol.bpc_log2); byte = start & (fs_info->vol.bpc -1); 2012a84: 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); 2012a88: b7 36 80 1b srl %i2, %i3, %i3 byte = start & (fs_info->vol.bpc -1); 2012a8c: 94 02 bf ff add %o2, -1, %o2 ret = fat_cluster_write(fs_info, 2012a90: 90 10 00 10 mov %l0, %o0 2012a94: 92 06 c0 09 add %i3, %o1, %o1 2012a98: 94 0e 80 0a and %i2, %o2, %o2 2012a9c: 96 10 00 1d mov %i5, %o3 2012aa0: 98 10 00 1c mov %i4, %o4 2012aa4: 40 00 01 e5 call 2013238 2012aa8: 9a 10 20 00 clr %o5 cln, byte, count, buf, false); if (0 > ret) 2012aac: 80 a2 20 00 cmp %o0, 0 2012ab0: 16 80 00 4d bge 2012be4 <== ALWAYS TAKEN 2012ab4: 01 00 00 00 nop rc = -1; 2012ab8: 10 80 00 4b b 2012be4 <== NOT EXECUTED 2012abc: 90 10 3f ff mov -1, %o0 ! ffffffff <== NOT EXECUTED const uint8_t *buf, const uint32_t file_cln_initial) { int rc = RC_OK; uint32_t cmpltd = 0; uint32_t cur_cln = 0; 2012ac0: 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; 2012ac4: 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); 2012ac8: aa 07 bf fc add %fp, -4, %l5 { int rc = RC_OK; uint32_t cmpltd = 0; uint32_t cur_cln = 0; uint32_t save_cln = 0; /* FIXME: This might be incorrect, cf. below */ uint32_t start_cln = start >> fs_info->vol.bpc_log2; 2012acc: 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); 2012ad0: 90 10 00 10 mov %l0, %o0 2012ad4: 92 10 00 19 mov %i1, %o1 2012ad8: 94 10 00 11 mov %l1, %o2 2012adc: 7f ff fd 85 call 20120f0 2012ae0: 96 10 00 15 mov %l5, %o3 if (RC_OK == rc) 2012ae4: 80 a2 60 00 cmp %o1, 0 2012ae8: 12 80 00 34 bne 2012bb8 <== NEVER TAKEN 2012aec: b7 2c 40 1b sll %l1, %i3, %i3 { file_cln_cnt = cur_cln - fat_fd->cln; 2012af0: c2 06 60 1c ld [ %i1 + 0x1c ], %g1 2012af4: e4 07 bf fc ld [ %fp + -4 ], %l2 2012af8: 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); 2012afc: 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; 2012b00: 90 10 20 00 clr %o0 int rc = RC_OK; uint32_t cmpltd = 0; uint32_t cur_cln = 0; uint32_t save_cln = 0; /* FIXME: This might be incorrect, cf. below */ uint32_t start_cln = start >> fs_info->vol.bpc_log2; uint32_t ofs_cln = start - (start_cln << fs_info->vol.bpc_log2); 2012b04: 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; 2012b08: a8 10 20 00 clr %l4 const uint32_t file_cln_initial) { int rc = RC_OK; uint32_t cmpltd = 0; uint32_t cur_cln = 0; uint32_t save_cln = 0; /* FIXME: This might be incorrect, cf. below */ 2012b0c: ac 10 20 00 clr %l6 const uint32_t count, const uint8_t *buf, const uint32_t file_cln_initial) { int rc = RC_OK; uint32_t cmpltd = 0; 2012b10: 10 80 00 1a b 2012b78 2012b14: b6 10 20 00 clr %i3 { file_cln_cnt = cur_cln - fat_fd->cln; while ( (RC_OK == rc) && (bytes_to_write > 0)) { c = MIN(bytes_to_write, (fs_info->vol.bpc - ofs_cln)); 2012b18: 96 22 c0 18 sub %o3, %i0, %o3 2012b1c: 80 a2 c0 1d cmp %o3, %i5 2012b20: 38 80 00 02 bgu,a 2012b28 2012b24: 96 10 00 1d mov %i5, %o3 if (file_cln_initial < file_cln_cnt) 2012b28: 80 a4 c0 12 cmp %l3, %l2 2012b2c: 2a 80 00 02 bcs,a 2012b34 2012b30: a8 10 20 01 mov 1, %l4 overwrite_cluster = true; ret = fat_cluster_write(fs_info, 2012b34: d2 07 bf fc ld [ %fp + -4 ], %o1 2012b38: 90 10 00 10 mov %l0, %o0 2012b3c: 94 10 00 18 mov %i0, %o2 2012b40: 98 07 00 1b add %i4, %i3, %o4 2012b44: 40 00 01 bd call 2013238 2012b48: 9a 0d 20 01 and %l4, 1, %o5 2012b4c: 82 10 00 08 mov %o0, %g1 cur_cln, ofs_cln, c, &buf[cmpltd], overwrite_cluster); if (0 > ret) 2012b50: 80 a0 60 00 cmp %g1, 0 2012b54: 16 80 00 1d bge 2012bc8 <== ALWAYS TAKEN 2012b58: 90 10 3f ff mov -1, %o0 rc = fat_file_lseek(fs_info, fat_fd, start_cln, &cur_cln); if (RC_OK == rc) { file_cln_cnt = cur_cln - fat_fd->cln; while ( (RC_OK == rc) 2012b5c: 10 80 00 08 b 2012b7c <== NOT EXECUTED 2012b60: 80 a7 60 00 cmp %i5, 0 <== NOT EXECUTED ++file_cln_cnt; bytes_to_write -= ret; cmpltd += ret; save_cln = cur_cln; if (0 < bytes_to_write) rc = fat_get_fat_cluster(fs_info, cur_cln, &cur_cln); 2012b64: 90 10 00 10 mov %l0, %o0 2012b68: 92 10 00 16 mov %l6, %o1 2012b6c: 40 00 1a 80 call 201956c 2012b70: 94 10 00 15 mov %l5, %o2 ofs_cln = 0; 2012b74: b0 10 20 00 clr %i0 rc = fat_file_lseek(fs_info, fat_fd, start_cln, &cur_cln); if (RC_OK == rc) { file_cln_cnt = cur_cln - fat_fd->cln; while ( (RC_OK == rc) 2012b78: 80 a7 60 00 cmp %i5, 0 2012b7c: 02 80 00 04 be 2012b8c 2012b80: 80 a2 20 00 cmp %o0, 0 2012b84: 22 bf ff e5 be,a 2012b18 <== ALWAYS TAKEN 2012b88: d6 14 20 06 lduh [ %l0 + 6 ], %o3 } /* update cache */ /* XXX: check this - I'm not sure :( */ fat_fd->map.file_cln = start_cln + ((ofs_cln_save + cmpltd - 1) >> fs_info->vol.bpc_log2); 2012b8c: c2 0c 20 08 ldub [ %l0 + 8 ], %g1 2012b90: b4 06 bf ff add %i2, -1, %i2 fat_fd->map.disk_cln = save_cln; 2012b94: ec 26 60 38 st %l6, [ %i1 + 0x38 ] } /* update cache */ /* XXX: check this - I'm not sure :( */ fat_fd->map.file_cln = start_cln + ((ofs_cln_save + cmpltd - 1) >> fs_info->vol.bpc_log2); 2012b98: b4 06 80 1b add %i2, %i3, %i2 2012b9c: b5 36 80 01 srl %i2, %g1, %i2 } } /* update cache */ /* XXX: check this - I'm not sure :( */ fat_fd->map.file_cln = start_cln + 2012ba0: 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) 2012ba4: 92 92 20 00 orcc %o0, 0, %o1 2012ba8: 12 80 00 03 bne 2012bb4 <== NEVER TAKEN 2012bac: e2 26 60 34 st %l1, [ %i1 + 0x34 ] return rc; else return cmpltd; 2012bb0: 92 10 00 1b mov %i3, %o1 fat_fd, start, count, buf, file_cln_initial); if (0 > ret) 2012bb4: 80 a2 60 00 cmp %o1, 0 2012bb8: 16 80 00 0b bge 2012be4 <== ALWAYS TAKEN 2012bbc: 90 10 00 09 mov %o1, %o0 2012bc0: 10 80 00 09 b 2012be4 <== NOT EXECUTED 2012bc4: 90 10 3f ff mov -1, %o0 <== NOT EXECUTED if (0 > ret) rc = -1; if (RC_OK == rc) { ++file_cln_cnt; 2012bc8: a4 04 a0 01 inc %l2 bytes_to_write -= ret; cmpltd += ret; 2012bcc: b6 06 c0 01 add %i3, %g1, %i3 save_cln = cur_cln; if (0 < bytes_to_write) 2012bd0: ba a7 40 01 subcc %i5, %g1, %i5 2012bd4: 12 bf ff e4 bne 2012b64 2012bd8: ec 07 bf fc ld [ %fp + -4 ], %l6 2012bdc: 10 bf ff e6 b 2012b74 2012be0: 90 10 20 00 clr %o0 } if (RC_OK != rc) return rc; else return cmpltd; } 2012be4: 81 c7 e0 08 ret 2012be8: 91 e8 00 08 restore %g0, %o0, %o0 =============================================================================== 020199b8 : int fat_free_fat_clusters_chain( fat_fs_info_t *fs_info, uint32_t chain ) { 20199b8: 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; 20199bc: b8 10 20 00 clr %i4 int fat_free_fat_clusters_chain( fat_fs_info_t *fs_info, uint32_t chain ) { 20199c0: ba 10 00 18 mov %i0, %i5 int rc = RC_OK, rc1 = RC_OK; uint32_t cur_cln = chain; uint32_t next_cln = 0; 20199c4: 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; 20199c8: b6 10 00 19 mov %i1, %i3 uint32_t next_cln = 0; uint32_t freed_cls_cnt = 0; while ((cur_cln & fs_info->vol.mask) < fs_info->vol.eoc_val) 20199cc: 10 80 00 19 b 2019a30 20199d0: b4 10 20 00 clr %i2 { rc = fat_get_fat_cluster(fs_info, cur_cln, &next_cln); 20199d4: 92 10 00 1b mov %i3, %o1 20199d8: 7f ff fe e5 call 201956c 20199dc: 94 07 bf fc add %fp, -4, %o2 if ( rc != RC_OK ) 20199e0: b0 92 20 00 orcc %o0, 0, %i0 20199e4: 02 80 00 0b be 2019a10 <== ALWAYS TAKEN 20199e8: 90 10 00 1d mov %i5, %o0 { if(fs_info->vol.free_cls != FAT_UNDEFINED_VALUE) 20199ec: c2 07 60 44 ld [ %i5 + 0x44 ], %g1 <== NOT EXECUTED 20199f0: 80 a0 7f ff cmp %g1, -1 <== NOT EXECUTED 20199f4: 02 80 00 03 be 2019a00 <== NOT EXECUTED 20199f8: b8 07 00 01 add %i4, %g1, %i4 <== NOT EXECUTED fs_info->vol.free_cls += freed_cls_cnt; 20199fc: f8 27 60 44 st %i4, [ %i5 + 0x44 ] <== NOT EXECUTED fat_buf_release(fs_info); 2019a00: 7f ff e4 dd call 2012d74 <== NOT EXECUTED 2019a04: 90 10 00 1d mov %i5, %o0 <== NOT EXECUTED 2019a08: 81 c7 e0 08 ret <== NOT EXECUTED 2019a0c: 81 e8 00 00 restore <== NOT EXECUTED return rc; } rc = fat_set_fat_cluster(fs_info, cur_cln, FAT_GENFAT_FREE); 2019a10: 92 10 00 1b mov %i3, %o1 2019a14: 7f ff ff 48 call 2019734 2019a18: 94 10 20 00 clr %o2 if ( rc != RC_OK ) 2019a1c: 80 a2 20 00 cmp %o0, 0 2019a20: 32 80 00 02 bne,a 2019a28 <== NEVER TAKEN 2019a24: b4 10 00 08 mov %o0, %i2 <== NOT EXECUTED rc1 = rc; freed_cls_cnt++; cur_cln = next_cln; 2019a28: f6 07 bf fc ld [ %fp + -4 ], %i3 rc = fat_set_fat_cluster(fs_info, cur_cln, FAT_GENFAT_FREE); if ( rc != RC_OK ) rc1 = rc; freed_cls_cnt++; 2019a2c: b8 07 20 01 inc %i4 int rc = RC_OK, rc1 = RC_OK; uint32_t cur_cln = chain; uint32_t next_cln = 0; uint32_t freed_cls_cnt = 0; while ((cur_cln & fs_info->vol.mask) < fs_info->vol.eoc_val) 2019a30: c4 07 60 10 ld [ %i5 + 0x10 ], %g2 2019a34: c2 07 60 14 ld [ %i5 + 0x14 ], %g1 2019a38: 84 0e c0 02 and %i3, %g2, %g2 2019a3c: 80 a0 80 01 cmp %g2, %g1 2019a40: 0a bf ff e5 bcs 20199d4 2019a44: 90 10 00 1d mov %i5, %o0 freed_cls_cnt++; cur_cln = next_cln; } fs_info->vol.next_cl = chain; if (fs_info->vol.free_cls != FAT_UNDEFINED_VALUE) 2019a48: c2 07 60 44 ld [ %i5 + 0x44 ], %g1 2019a4c: 80 a0 7f ff cmp %g1, -1 2019a50: 02 80 00 05 be 2019a64 <== ALWAYS TAKEN 2019a54: f2 27 60 4c st %i1, [ %i5 + 0x4c ] fs_info->vol.free_cls += freed_cls_cnt; 2019a58: b8 07 00 01 add %i4, %g1, %i4 <== NOT EXECUTED 2019a5c: f8 27 60 44 st %i4, [ %i5 + 0x44 ] <== NOT EXECUTED fat_buf_release(fs_info); 2019a60: 90 10 00 1d mov %i5, %o0 <== NOT EXECUTED 2019a64: 7f ff e4 c4 call 2012d74 2019a68: b0 10 00 1a mov %i2, %i0 if (rc1 != RC_OK) return rc1; return RC_OK; } 2019a6c: 81 c7 e0 08 ret 2019a70: 81 e8 00 00 restore =============================================================================== 02013e0c : 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); 2013e0c: c2 02 20 80 ld [ %o0 + 0x80 ], %g1 <== NOT EXECUTED 2013e10: c4 02 20 74 ld [ %o0 + 0x74 ], %g2 <== NOT EXECUTED 2013e14: 86 10 20 01 mov 1, %g3 <== NOT EXECUTED 2013e18: 92 22 40 01 sub %o1, %g1, %o1 <== NOT EXECUTED 2013e1c: 83 32 60 03 srl %o1, 3, %g1 <== NOT EXECUTED 2013e20: 92 0a 60 07 and %o1, 7, %o1 <== NOT EXECUTED 2013e24: 93 28 c0 09 sll %g3, %o1, %o1 <== NOT EXECUTED 2013e28: c6 08 80 01 ldub [ %g2 + %g1 ], %g3 <== NOT EXECUTED 2013e2c: 92 28 c0 09 andn %g3, %o1, %o1 <== NOT EXECUTED 2013e30: 81 c3 e0 08 retl <== NOT EXECUTED 2013e34: d2 28 80 01 stb %o1, [ %g2 + %g1 ] <== NOT EXECUTED =============================================================================== 0201956c : fat_get_fat_cluster( fat_fs_info_t *fs_info, uint32_t cln, uint32_t *ret_val ) { 201956c: 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)) ) 2019570: 80 a6 60 01 cmp %i1, 1 2019574: 08 80 00 67 bleu 2019710 <== NEVER TAKEN 2019578: ba 10 00 18 mov %i0, %i5 201957c: c2 06 20 38 ld [ %i0 + 0x38 ], %g1 2019580: 82 00 60 01 inc %g1 2019584: 80 a6 40 01 cmp %i1, %g1 2019588: 28 80 00 03 bleu,a 2019594 <== ALWAYS TAKEN 201958c: c2 0e 20 0e ldub [ %i0 + 0xe ], %g1 2019590: 30 80 00 60 b,a 2019710 <== NOT EXECUTED rtems_set_errno_and_return_minus_one(EIO); sec = (FAT_FAT_OFFSET(fs_info->vol.type, cln) >> fs_info->vol.sec_log2) + 2019594: 86 08 60 01 and %g1, 1, %g3 2019598: 80 88 e0 ff btst 0xff, %g3 201959c: 02 80 00 05 be 20195b0 20195a0: 88 08 60 02 and %g1, 2, %g4 20195a4: 85 36 60 01 srl %i1, 1, %g2 20195a8: 10 80 00 06 b 20195c0 20195ac: 84 00 80 19 add %g2, %i1, %g2 20195b0: 80 89 20 ff btst 0xff, %g4 20195b4: 02 80 00 03 be 20195c0 20195b8: 85 2e 60 02 sll %i1, 2, %g2 20195bc: 85 2e 60 01 sll %i1, 1, %g2 20195c0: f6 0f 60 02 ldub [ %i5 + 2 ], %i3 20195c4: c8 07 60 58 ld [ %i5 + 0x58 ], %g4 20195c8: 85 30 80 1b srl %g2, %i3, %g2 fs_info->vol.afat_loc; ofs = FAT_FAT_OFFSET(fs_info->vol.type, cln) & (fs_info->vol.bps - 1); 20195cc: 80 88 e0 ff btst 0xff, %g3 20195d0: 02 80 00 05 be 20195e4 20195d4: b6 00 80 04 add %g2, %g4, %i3 20195d8: b9 36 60 01 srl %i1, 1, %i4 20195dc: 10 80 00 07 b 20195f8 20195e0: b8 07 00 19 add %i4, %i1, %i4 20195e4: 82 08 60 02 and %g1, 2, %g1 20195e8: 80 88 60 ff btst 0xff, %g1 20195ec: 02 80 00 03 be 20195f8 20195f0: b9 2e 60 02 sll %i1, 2, %i4 20195f4: b9 2e 60 01 sll %i1, 1, %i4 20195f8: e0 17 40 00 lduh [ %i5 ], %l0 rc = fat_buf_access(fs_info, sec, FAT_OP_TYPE_READ, &sec_buf); 20195fc: 90 10 00 1d mov %i5, %o0 2019600: 92 10 00 1b mov %i3, %o1 2019604: 94 10 20 01 mov 1, %o2 2019608: 7f ff e6 4f call 2012f44 201960c: 96 07 bf fc add %fp, -4, %o3 if (rc != RC_OK) 2019610: b0 92 20 00 orcc %o0, 0, %i0 2019614: 12 80 00 37 bne 20196f0 <== NEVER TAKEN 2019618: 83 2c 20 10 sll %l0, 0x10, %g1 return rc; switch ( fs_info->vol.type ) 201961c: c4 0f 60 0e ldub [ %i5 + 0xe ], %g2 2019620: 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); 2019624: 83 30 60 10 srl %g1, 0x10, %g1 2019628: 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 ) 201962c: 02 80 00 27 be 20196c8 2019630: 82 0f 00 01 and %i4, %g1, %g1 2019634: 80 a0 a0 04 cmp %g2, 4 2019638: 02 80 00 30 be 20196f8 201963c: 80 a0 a0 01 cmp %g2, 1 2019640: 12 80 00 34 bne 2019710 <== NEVER TAKEN 2019644: 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) ) 2019648: 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)); 201964c: c4 08 c0 01 ldub [ %g3 + %g1 ], %g2 if ( ofs == (fs_info->vol.bps - 1) ) 2019650: 88 01 3f ff add %g4, -1, %g4 2019654: 80 a0 40 04 cmp %g1, %g4 2019658: 12 80 00 10 bne 2019698 <== ALWAYS TAKEN 201965c: c4 26 80 00 st %g2, [ %i2 ] { rc = fat_buf_access(fs_info, sec + 1, FAT_OP_TYPE_READ, 2019660: 90 10 00 1d mov %i5, %o0 <== NOT EXECUTED 2019664: 92 06 e0 01 add %i3, 1, %o1 <== NOT EXECUTED 2019668: 94 10 20 01 mov 1, %o2 <== NOT EXECUTED 201966c: 7f ff e6 36 call 2012f44 <== NOT EXECUTED 2019670: 96 07 bf fc add %fp, -4, %o3 <== NOT EXECUTED &sec_buf); if (rc != RC_OK) 2019674: 80 a2 20 00 cmp %o0, 0 <== NOT EXECUTED 2019678: 12 80 00 2c bne 2019728 <== NOT EXECUTED 201967c: c2 07 bf fc ld [ %fp + -4 ], %g1 <== NOT EXECUTED return rc; *ret_val |= *sec_buf << 8; 2019680: c4 06 80 00 ld [ %i2 ], %g2 <== NOT EXECUTED 2019684: c2 08 40 00 ldub [ %g1 ], %g1 <== NOT EXECUTED 2019688: 83 28 60 08 sll %g1, 8, %g1 <== NOT EXECUTED 201968c: 82 10 80 01 or %g2, %g1, %g1 <== NOT EXECUTED 2019690: 10 80 00 07 b 20196ac <== NOT EXECUTED 2019694: c2 26 80 00 st %g1, [ %i2 ] <== NOT EXECUTED } else { *ret_val |= *(sec_buf + ofs + 1) << 8; 2019698: 82 00 c0 01 add %g3, %g1, %g1 201969c: c2 08 60 01 ldub [ %g1 + 1 ], %g1 20196a0: 83 28 60 08 sll %g1, 8, %g1 20196a4: 84 10 40 02 or %g1, %g2, %g2 20196a8: c4 26 80 00 st %g2, [ %i2 ] } if ( FAT_CLUSTER_IS_ODD(cln) ) 20196ac: 80 8e 60 01 btst 1, %i1 20196b0: 02 80 00 04 be 20196c0 20196b4: c2 06 80 00 ld [ %i2 ], %g1 *ret_val = (*ret_val) >> FAT12_SHIFT; 20196b8: 10 80 00 0d b 20196ec 20196bc: 83 30 60 04 srl %g1, 4, %g1 else *ret_val = (*ret_val) & FAT_FAT12_MASK; 20196c0: 10 80 00 0b b 20196ec 20196c4: 82 08 6f ff and %g1, 0xfff, %g1 break; case FAT_FAT16: *ret_val = *((uint16_t *)(sec_buf + ofs)); 20196c8: c4 07 bf fc ld [ %fp + -4 ], %g2 *ret_val = CF_LE_W(*ret_val); 20196cc: 07 00 00 3f sethi %hi(0xfc00), %g3 else *ret_val = (*ret_val) & FAT_FAT12_MASK; break; case FAT_FAT16: *ret_val = *((uint16_t *)(sec_buf + ofs)); 20196d0: c2 10 80 01 lduh [ %g2 + %g1 ], %g1 *ret_val = CF_LE_W(*ret_val); 20196d4: 86 10 e3 ff or %g3, 0x3ff, %g3 20196d8: 83 28 60 10 sll %g1, 0x10, %g1 20196dc: 85 30 60 18 srl %g1, 0x18, %g2 20196e0: 83 30 60 08 srl %g1, 8, %g1 20196e4: 82 08 40 03 and %g1, %g3, %g1 20196e8: 82 10 80 01 or %g2, %g1, %g1 20196ec: c2 26 80 00 st %g1, [ %i2 ] break; 20196f0: 81 c7 e0 08 ret 20196f4: 81 e8 00 00 restore case FAT_FAT32: *ret_val = *((uint32_t *)(sec_buf + ofs)); *ret_val = CF_LE_L(*ret_val); 20196f8: c4 07 bf fc ld [ %fp + -4 ], %g2 20196fc: 7f ff ff 90 call 201953c 2019700: d0 00 80 01 ld [ %g2 + %g1 ], %o0 2019704: d0 26 80 00 st %o0, [ %i2 ] break; 2019708: 81 c7 e0 08 ret 201970c: 81 e8 00 00 restore default: rtems_set_errno_and_return_minus_one(EIO); 2019710: 40 00 07 a7 call 201b5ac <__errno> <== NOT EXECUTED 2019714: b0 10 3f ff mov -1, %i0 <== NOT EXECUTED 2019718: 82 10 20 05 mov 5, %g1 <== NOT EXECUTED 201971c: c2 22 00 00 st %g1, [ %o0 ] <== NOT EXECUTED 2019720: 81 c7 e0 08 ret <== NOT EXECUTED 2019724: 81 e8 00 00 restore <== NOT EXECUTED *ret_val = (*(sec_buf + ofs)); if ( ofs == (fs_info->vol.bps - 1) ) { rc = fat_buf_access(fs_info, sec + 1, FAT_OP_TYPE_READ, &sec_buf); if (rc != RC_OK) 2019728: b0 10 00 08 mov %o0, %i0 <== NOT EXECUTED rtems_set_errno_and_return_minus_one(EIO); break; } return RC_OK; } 201972c: 81 c7 e0 08 ret <== NOT EXECUTED 2019730: 81 e8 00 00 restore <== NOT EXECUTED =============================================================================== 02013d4c : * 0 means FAILED !!! * */ uint32_t fat_get_unique_ino(fat_fs_info_t *fs_info) { 2013d4c: 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)) 2013d50: 39 03 ff ff sethi %hi(0xffffc00), %i4 <== NOT EXECUTED fat_get_unique_ino(fat_fs_info_t *fs_info) { uint32_t j = 0; bool resrc_unsuff = false; while (!resrc_unsuff) 2013d54: 10 80 00 2b b 2013e00 <== NOT EXECUTED 2013d58: b8 17 23 ff or %i4, 0x3ff, %i4 ! fffffff <== NOT EXECUTED { for (j = 0; j < fs_info->uino_pool_size; j++) { if (!FAT_UNIQ_INO_IS_BUSY(fs_info->index, fs_info->uino)) 2013d5c: c2 06 20 78 ld [ %i0 + 0x78 ], %g1 <== NOT EXECUTED 2013d60: 85 30 60 03 srl %g1, 3, %g2 <== NOT EXECUTED 2013d64: b6 00 c0 02 add %g3, %g2, %i3 <== NOT EXECUTED 2013d68: f4 08 c0 02 ldub [ %g3 + %g2 ], %i2 <== NOT EXECUTED 2013d6c: c4 48 c0 02 ldsb [ %g3 + %g2 ], %g2 <== NOT EXECUTED 2013d70: ba 08 60 07 and %g1, 7, %i5 <== NOT EXECUTED 2013d74: 85 38 80 1d sra %g2, %i5, %g2 <== NOT EXECUTED 2013d78: 80 88 a0 01 btst 1, %g2 <== NOT EXECUTED 2013d7c: 12 80 00 0a bne 2013da4 <== NOT EXECUTED 2013d80: 82 00 60 01 inc %g1 <== NOT EXECUTED { FAT_SET_UNIQ_INO_BUSY(fs_info->index, fs_info->uino); 2013d84: 82 10 20 01 mov 1, %g1 <== NOT EXECUTED 2013d88: bb 28 40 1d sll %g1, %i5, %i5 <== NOT EXECUTED 2013d8c: ba 17 40 1a or %i5, %i2, %i5 <== NOT EXECUTED 2013d90: fa 2e c0 00 stb %i5, [ %i3 ] <== NOT EXECUTED return (fs_info->uino_base + fs_info->index); 2013d94: c4 06 20 78 ld [ %i0 + 0x78 ], %g2 <== NOT EXECUTED 2013d98: c2 06 20 80 ld [ %i0 + 0x80 ], %g1 <== NOT EXECUTED 2013d9c: 81 c7 e0 08 ret <== NOT EXECUTED 2013da0: 91 e8 80 01 restore %g2, %g1, %o0 <== NOT EXECUTED } fs_info->index++; if (fs_info->index >= fs_info->uino_pool_size) 2013da4: 80 a0 40 04 cmp %g1, %g4 <== NOT EXECUTED 2013da8: 3a 80 00 03 bcc,a 2013db4 <== NOT EXECUTED 2013dac: c0 26 20 78 clr [ %i0 + 0x78 ] <== NOT EXECUTED 2013db0: 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++) 2013db4: 92 02 60 01 inc %o1 <== NOT EXECUTED 2013db8: 80 a2 40 04 cmp %o1, %g4 <== NOT EXECUTED 2013dbc: 32 bf ff e8 bne,a 2013d5c <== NOT EXECUTED 2013dc0: c6 06 20 74 ld [ %i0 + 0x74 ], %g3 <== NOT EXECUTED fs_info->index++; if (fs_info->index >= fs_info->uino_pool_size) fs_info->index = 0; } if ((fs_info->uino_pool_size << 1) < (0x0FFFFFFF - fs_info->uino_base)) 2013dc4: c2 06 20 80 ld [ %i0 + 0x80 ], %g1 <== NOT EXECUTED 2013dc8: 93 2a 60 01 sll %o1, 1, %o1 <== NOT EXECUTED 2013dcc: 82 27 00 01 sub %i4, %g1, %g1 <== NOT EXECUTED 2013dd0: 80 a2 40 01 cmp %o1, %g1 <== NOT EXECUTED 2013dd4: 2a 80 00 04 bcs,a 2013de4 <== NOT EXECUTED 2013dd8: d0 06 20 74 ld [ %i0 + 0x74 ], %o0 <== NOT EXECUTED resrc_unsuff = true; } else resrc_unsuff = true; } return 0; 2013ddc: 81 c7 e0 08 ret <== NOT EXECUTED 2013de0: 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); 2013de4: 7f ff c9 6c call 2006394 <== NOT EXECUTED 2013de8: d2 26 20 7c st %o1, [ %i0 + 0x7c ] <== NOT EXECUTED if (fs_info->uino != NULL) 2013dec: 80 a2 20 00 cmp %o0, 0 <== NOT EXECUTED 2013df0: 02 bf ff fb be 2013ddc <== NOT EXECUTED 2013df4: d0 26 20 74 st %o0, [ %i0 + 0x74 ] <== NOT EXECUTED fs_info->index = fs_info->uino_pool_size; 2013df8: c2 06 20 7c ld [ %i0 + 0x7c ], %g1 <== NOT EXECUTED 2013dfc: 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++) 2013e00: c8 06 20 7c ld [ %i0 + 0x7c ], %g4 <== NOT EXECUTED 2013e04: 10 bf ff ed b 2013db8 <== NOT EXECUTED 2013e08: 92 10 20 00 clr %o1 <== NOT EXECUTED =============================================================================== 02013cd4 : int fat_init_clusters_chain( fat_fs_info_t *fs_info, uint32_t start_cln ) { 2013cd4: 9d e3 bf 98 save %sp, -104, %sp 2013cd8: ba 10 00 18 mov %i0, %i5 int rc = RC_OK; ssize_t ret = 0; uint32_t cur_cln = start_cln; while ((cur_cln & fs_info->vol.mask) < fs_info->vol.eoc_val) 2013cdc: 10 80 00 10 b 2013d1c 2013ce0: f2 27 bf fc st %i1, [ %fp + -4 ] { ret = fat_cluster_set(fs_info, cur_cln, 0, fs_info->vol.bpc, 0); 2013ce4: 90 10 00 1d mov %i5, %o0 2013ce8: 94 10 20 00 clr %o2 2013cec: 7f ff fd 0b call 2013118 2013cf0: 98 10 20 00 clr %o4 if ( ret != fs_info->vol.bpc ) 2013cf4: c2 17 60 06 lduh [ %i5 + 6 ], %g1 2013cf8: 80 a2 00 01 cmp %o0, %g1 2013cfc: 12 80 00 11 bne 2013d40 <== NEVER TAKEN 2013d00: d2 07 bf fc ld [ %fp + -4 ], %o1 { return -1; } rc = fat_get_fat_cluster(fs_info, cur_cln, &cur_cln); 2013d04: 90 10 00 1d mov %i5, %o0 2013d08: 40 00 16 19 call 201956c 2013d0c: 94 07 bf fc add %fp, -4, %o2 if ( rc != RC_OK ) 2013d10: b0 92 20 00 orcc %o0, 0, %i0 2013d14: 12 80 00 0c bne 2013d44 <== NEVER TAKEN 2013d18: 01 00 00 00 nop { int rc = RC_OK; ssize_t ret = 0; uint32_t cur_cln = start_cln; while ((cur_cln & fs_info->vol.mask) < fs_info->vol.eoc_val) 2013d1c: d2 07 bf fc ld [ %fp + -4 ], %o1 2013d20: c4 07 60 10 ld [ %i5 + 0x10 ], %g2 2013d24: c2 07 60 14 ld [ %i5 + 0x14 ], %g1 2013d28: 84 0a 40 02 and %o1, %g2, %g2 2013d2c: 80 a0 80 01 cmp %g2, %g1 2013d30: 2a bf ff ed bcs,a 2013ce4 2013d34: d6 17 60 06 lduh [ %i5 + 6 ], %o3 return rc; } } return rc; 2013d38: 81 c7 e0 08 ret 2013d3c: 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; 2013d40: b0 10 3f ff mov -1, %i0 <== NOT EXECUTED } } return rc; } 2013d44: 81 c7 e0 08 ret <== NOT EXECUTED 2013d48: 81 e8 00 00 restore <== NOT EXECUTED =============================================================================== 02013364 : * 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) { 2013364: 9d e3 bf 08 save %sp, -248, %sp ssize_t ret = 0; struct stat stat_buf; int i = 0; rtems_bdbuf_buffer *block = NULL; vol->fd = open(device, O_RDWR); 2013368: 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) { 201336c: b6 10 00 18 mov %i0, %i3 char boot_rec[FAT_MAX_BPB_SIZE]; char fs_info_sector[FAT_USEFUL_INFO_SIZE]; ssize_t ret = 0; struct stat stat_buf; int i = 0; rtems_bdbuf_buffer *block = NULL; 2013370: c0 27 bf a4 clr [ %fp + -92 ] vol->fd = open(device, O_RDWR); 2013374: 7f ff cb 6d call 2006128 2013378: 90 10 00 19 mov %i1, %o0 if (vol->fd < 0) 201337c: 80 a2 20 00 cmp %o0, 0 2013380: 06 80 00 17 bl 20133dc <== NEVER TAKEN 2013384: d0 26 e0 60 st %o0, [ %i3 + 0x60 ] { rtems_set_errno_and_return_minus_one(ENXIO); } rc = fstat(vol->fd, &stat_buf); 2013388: 7f ff c8 1d call 20053fc 201338c: 92 07 bf b8 add %fp, -72, %o1 if (rc != 0) 2013390: 80 a2 20 00 cmp %o0, 0 2013394: 12 80 00 10 bne 20133d4 <== NEVER TAKEN 2013398: d0 06 20 60 ld [ %i0 + 0x60 ], %o0 close(vol->fd); rtems_set_errno_and_return_minus_one(ENXIO); } /* Must be a block device. */ if (!S_ISBLK(stat_buf.st_mode)) 201339c: c6 07 bf c4 ld [ %fp + -60 ], %g3 20133a0: 05 00 00 3c sethi %hi(0xf000), %g2 20133a4: 86 08 c0 02 and %g3, %g2, %g3 20133a8: 05 00 00 18 sethi %hi(0x6000), %g2 20133ac: 80 a0 c0 02 cmp %g3, %g2 20133b0: 12 80 00 09 bne 20133d4 <== NEVER TAKEN 20133b4: 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); 20133b8: 94 06 20 64 add %i0, 0x64, %o2 20133bc: 40 00 05 97 call 2014a18 20133c0: 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) { 20133c4: 80 a2 20 00 cmp %o0, 0 20133c8: 22 80 00 09 be,a 20133ec <== ALWAYS TAKEN 20133cc: d0 06 20 64 ld [ %i0 + 0x64 ], %o0 close(vol->fd); 20133d0: d0 06 20 60 ld [ %i0 + 0x60 ], %o0 <== NOT EXECUTED 20133d4: 7f ff c7 23 call 2005060 <== NOT EXECUTED 20133d8: 01 00 00 00 nop <== NOT EXECUTED rtems_set_errno_and_return_minus_one(ENXIO); 20133dc: 40 00 20 74 call 201b5ac <__errno> <== NOT EXECUTED 20133e0: 01 00 00 00 nop <== NOT EXECUTED 20133e4: 10 80 01 af b 2013aa0 <== NOT EXECUTED 20133e8: 82 10 20 06 mov 6, %g1 ! 6 <== NOT EXECUTED } /* Read boot record */ /* FIXME: Asserts FAT_MAX_BPB_SIZE < bdbuf block size */ sc = rtems_bdbuf_read( vol->dd, 0, &block); 20133ec: 92 10 20 00 clr %o1 20133f0: 7f ff f6 9a call 2010e58 20133f4: 94 07 bf a4 add %fp, -92, %o2 if (sc != RTEMS_SUCCESSFUL) 20133f8: 80 a2 20 00 cmp %o0, 0 20133fc: 22 80 00 03 be,a 2013408 <== ALWAYS TAKEN 2013400: d0 07 bf a4 ld [ %fp + -92 ], %o0 2013404: 30 80 00 32 b,a 20134cc <== NOT EXECUTED { close(vol->fd); rtems_set_errno_and_return_minus_one( EIO); } memcpy( boot_rec, block->buffer, FAT_MAX_BPB_SIZE); 2013408: c6 02 20 1c ld [ %o0 + 0x1c ], %g3 201340c: c2 08 e0 20 ldub [ %g3 + 0x20 ], %g1 2013410: c4 08 e0 0b ldub [ %g3 + 0xb ], %g2 2013414: c2 2f bf 9a stb %g1, [ %fp + -102 ] 2013418: c2 08 e0 23 ldub [ %g3 + 0x23 ], %g1 201341c: d2 08 e0 0c ldub [ %g3 + 0xc ], %o1 2013420: c2 2f bf 8f stb %g1, [ %fp + -113 ] 2013424: c2 08 e0 2c ldub [ %g3 + 0x2c ], %g1 2013428: d8 08 e0 0e ldub [ %g3 + 0xe ], %o4 201342c: c2 2f bf 9d stb %g1, [ %fp + -99 ] 2013430: c2 08 e0 2d ldub [ %g3 + 0x2d ], %g1 2013434: d6 08 e0 0f ldub [ %g3 + 0xf ], %o3 2013438: c2 2f bf 9c stb %g1, [ %fp + -100 ] 201343c: c2 08 e0 2e ldub [ %g3 + 0x2e ], %g1 2013440: c8 08 e0 11 ldub [ %g3 + 0x11 ], %g4 2013444: c2 2f bf 9b stb %g1, [ %fp + -101 ] 2013448: c2 08 e0 2f ldub [ %g3 + 0x2f ], %g1 201344c: da 08 e0 12 ldub [ %g3 + 0x12 ], %o5 2013450: c2 2f bf 97 stb %g1, [ %fp + -105 ] 2013454: c2 08 e0 30 ldub [ %g3 + 0x30 ], %g1 2013458: fa 08 e0 0d ldub [ %g3 + 0xd ], %i5 201345c: f4 08 e0 10 ldub [ %g3 + 0x10 ], %i2 2013460: e2 08 e0 13 ldub [ %g3 + 0x13 ], %l1 2013464: e4 08 e0 14 ldub [ %g3 + 0x14 ], %l2 2013468: ee 08 e0 16 ldub [ %g3 + 0x16 ], %l7 201346c: f0 08 e0 17 ldub [ %g3 + 0x17 ], %i0 2013470: e0 08 e0 21 ldub [ %g3 + 0x21 ], %l0 2013474: f2 08 e0 22 ldub [ %g3 + 0x22 ], %i1 2013478: e8 08 e0 24 ldub [ %g3 + 0x24 ], %l4 201347c: ec 08 e0 25 ldub [ %g3 + 0x25 ], %l6 2013480: ea 08 e0 26 ldub [ %g3 + 0x26 ], %l5 2013484: e6 08 e0 27 ldub [ %g3 + 0x27 ], %l3 2013488: f8 08 e0 28 ldub [ %g3 + 0x28 ], %i4 201348c: c2 2f bf 9f stb %g1, [ %fp + -97 ] 2013490: c6 08 e0 31 ldub [ %g3 + 0x31 ], %g3 sc = rtems_bdbuf_release( block); 2013494: c4 27 bf 80 st %g2, [ %fp + -128 ] 2013498: c8 27 bf 7c st %g4, [ %fp + -132 ] 201349c: d2 27 bf 78 st %o1, [ %fp + -136 ] 20134a0: d6 27 bf 74 st %o3, [ %fp + -140 ] 20134a4: d8 3f bf 68 std %o4, [ %fp + -152 ] 20134a8: 7f ff f6 e8 call 2011048 20134ac: c6 2f bf 9e stb %g3, [ %fp + -98 ] if (sc != RTEMS_SUCCESSFUL) 20134b0: c4 07 bf 80 ld [ %fp + -128 ], %g2 20134b4: 80 a2 20 00 cmp %o0, 0 20134b8: c8 07 bf 7c ld [ %fp + -132 ], %g4 20134bc: d2 07 bf 78 ld [ %fp + -136 ], %o1 20134c0: d6 07 bf 74 ld [ %fp + -140 ], %o3 20134c4: 02 80 00 08 be 20134e4 <== ALWAYS TAKEN 20134c8: d8 1f bf 68 ldd [ %fp + -152 ], %o4 { close(vol->fd); 20134cc: 7f ff c6 e5 call 2005060 <== NOT EXECUTED 20134d0: d0 06 e0 60 ld [ %i3 + 0x60 ], %o0 <== NOT EXECUTED rtems_set_errno_and_return_minus_one( EIO ); 20134d4: 40 00 20 36 call 201b5ac <__errno> <== NOT EXECUTED 20134d8: 01 00 00 00 nop <== NOT EXECUTED 20134dc: 10 80 01 71 b 2013aa0 <== NOT EXECUTED 20134e0: 82 10 20 05 mov 5, %g1 ! 5 <== NOT EXECUTED } /* Evaluate boot record */ vol->bps = FAT_GET_BR_BYTES_PER_SECTOR(boot_rec); 20134e4: 84 08 a0 ff and %g2, 0xff, %g2 20134e8: 92 0a 60 ff and %o1, 0xff, %o1 20134ec: 93 2a 60 08 sll %o1, 8, %o1 20134f0: 92 12 40 02 or %o1, %g2, %o1 20134f4: d2 36 c0 00 sth %o1, [ %i3 ] if ( (vol->bps != 512) && 20134f8: 85 2a 60 10 sll %o1, 0x10, %g2 20134fc: 85 30 a0 10 srl %g2, 0x10, %g2 2013500: 80 a0 a4 00 cmp %g2, 0x400 2013504: 02 80 00 0c be 2013534 <== NEVER TAKEN 2013508: 86 10 00 09 mov %o1, %g3 201350c: 80 a0 a2 00 cmp %g2, 0x200 2013510: 22 80 00 0a be,a 2013538 <== ALWAYS TAKEN 2013514: 85 2a 60 10 sll %o1, 0x10, %g2 (vol->bps != 1024) && 2013518: 80 a0 a8 00 cmp %g2, 0x800 <== NOT EXECUTED 201351c: 02 80 00 06 be 2013534 <== NOT EXECUTED 2013520: 1f 00 00 04 sethi %hi(0x1000), %o7 <== NOT EXECUTED (vol->bps != 2048) && 2013524: 80 a0 80 0f cmp %g2, %o7 <== NOT EXECUTED 2013528: 02 80 00 04 be 2013538 <== NOT EXECUTED 201352c: 85 2a 60 10 sll %o1, 0x10, %g2 <== NOT EXECUTED 2013530: 30 80 00 d6 b,a 2013888 <== 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; 2013534: 85 2a 60 10 sll %o1, 0x10, %g2 <== NOT EXECUTED 2013538: c0 2e e0 03 clrb [ %i3 + 3 ] 201353c: 10 80 00 05 b 2013550 2013540: 85 30 a0 19 srl %g2, 0x19, %g2 i >>= 1, vol->sec_mul++); 2013544: 85 38 a0 01 sra %g2, 1, %g2 <== NOT EXECUTED 2013548: 9e 03 e0 01 inc %o7 <== NOT EXECUTED 201354c: de 2e e0 03 stb %o7, [ %i3 + 3 ] <== NOT EXECUTED (vol->bps != 4096)) { close(vol->fd); rtems_set_errno_and_return_minus_one( EINVAL ); } for (vol->sec_mul = 0, i = (vol->bps >> FAT_SECTOR512_BITS); (i & 1) == 0; 2013550: 80 88 a0 01 btst 1, %g2 2013554: 22 bf ff fc be,a 2013544 <== NEVER TAKEN 2013558: de 0e e0 03 ldub [ %i3 + 3 ], %o7 <== NOT EXECUTED i >>= 1, vol->sec_mul++); for (vol->sec_log2 = 0, i = vol->bps; (i & 1) == 0; 201355c: 93 2a 60 10 sll %o1, 0x10, %o1 2013560: c0 2e e0 02 clrb [ %i3 + 2 ] 2013564: 93 32 60 10 srl %o1, 0x10, %o1 2013568: 10 80 00 05 b 201357c 201356c: 9e 10 00 09 mov %o1, %o7 i >>= 1, vol->sec_log2++); 2013570: 84 00 a0 01 inc %g2 2013574: 9f 3b e0 01 sra %o7, 1, %o7 2013578: c4 2e e0 02 stb %g2, [ %i3 + 2 ] close(vol->fd); rtems_set_errno_and_return_minus_one( EINVAL ); } for (vol->sec_mul = 0, i = (vol->bps >> FAT_SECTOR512_BITS); (i & 1) == 0; i >>= 1, vol->sec_mul++); for (vol->sec_log2 = 0, i = vol->bps; (i & 1) == 0; 201357c: 80 8b e0 01 btst 1, %o7 2013580: 02 bf ff fc be 2013570 2013584: c4 0e e0 02 ldub [ %i3 + 2 ], %g2 i >>= 1, vol->sec_log2++); vol->bytes_per_block = vol->bps; 2013588: c6 36 e0 0a sth %g3, [ %i3 + 0xa ] vol->bytes_per_block_log2 = vol->sec_log2; 201358c: c4 2e e0 0c stb %g2, [ %i3 + 0xc ] vol->sectors_per_block = 1; 2013590: 86 10 20 01 mov 1, %g3 vol->spc = FAT_GET_BR_SECTORS_PER_CLUSTER(boot_rec); 2013594: fa 2e e0 04 stb %i5, [ %i3 + 4 ] /* * "sectors per cluster" of zero is invalid * (and would hang the following loop) */ if (vol->spc == 0) 2013598: 9e 8f 60 ff andcc %i5, 0xff, %o7 201359c: 02 80 00 bb be 2013888 <== NEVER TAKEN 20135a0: c6 2e e0 09 stb %g3, [ %i3 + 9 ] { close(vol->fd); rtems_set_errno_and_return_minus_one(EINVAL); } for (vol->spc_log2 = 0, i = vol->spc; (i & 1) == 0; 20135a4: 10 80 00 05 b 20135b8 20135a8: c0 2e e0 05 clrb [ %i3 + 5 ] i >>= 1, vol->spc_log2++); 20135ac: 86 00 e0 01 inc %g3 20135b0: 9f 3b e0 01 sra %o7, 1, %o7 20135b4: c6 2e e0 05 stb %g3, [ %i3 + 5 ] { close(vol->fd); rtems_set_errno_and_return_minus_one(EINVAL); } for (vol->spc_log2 = 0, i = vol->spc; (i & 1) == 0; 20135b8: 80 8b e0 01 btst 1, %o7 20135bc: 02 bf ff fc be 20135ac 20135c0: c6 0e e0 05 ldub [ %i3 + 5 ], %g3 i >>= 1, vol->spc_log2++); /* * "bytes per cluster" value greater than 32K is invalid */ if ((vol->bpc = vol->bps << vol->spc_log2) > MS_BYTES_PER_CLUSTER_LIMIT) 20135c4: 87 2a 40 03 sll %o1, %g3, %g3 20135c8: 95 28 e0 10 sll %g3, 0x10, %o2 20135cc: 1f 20 00 00 sethi %hi(0x80000000), %o7 20135d0: 80 a2 80 0f cmp %o2, %o7 20135d4: 18 80 00 ad bgu 2013888 <== NEVER TAKEN 20135d8: c6 36 e0 06 sth %g3, [ %i3 + 6 ] { close(vol->fd); rtems_set_errno_and_return_minus_one(EINVAL); } for (vol->bpc_log2 = 0, i = vol->bpc; (i & 1) == 0; 20135dc: 1f 00 00 3f sethi %hi(0xfc00), %o7 20135e0: c0 2e e0 08 clrb [ %i3 + 8 ] 20135e4: 9e 13 e3 ff or %o7, 0x3ff, %o7 20135e8: 10 80 00 05 b 20135fc 20135ec: 86 08 c0 0f and %g3, %o7, %g3 i >>= 1, vol->bpc_log2++); 20135f0: 87 38 e0 01 sra %g3, 1, %g3 20135f4: 9e 03 e0 01 inc %o7 20135f8: de 2e e0 08 stb %o7, [ %i3 + 8 ] { close(vol->fd); rtems_set_errno_and_return_minus_one(EINVAL); } for (vol->bpc_log2 = 0, i = vol->bpc; (i & 1) == 0; 20135fc: 80 88 e0 01 btst 1, %g3 2013600: 22 bf ff fc be,a 20135f0 2013604: de 0e e0 08 ldub [ %i3 + 8 ], %o7 i >>= 1, vol->bpc_log2++); vol->fats = FAT_GET_BR_FAT_NUM(boot_rec); 2013608: f4 2e e0 0d stb %i2, [ %i3 + 0xd ] vol->fat_loc = FAT_GET_BR_RESERVED_SECTORS_NUM(boot_rec); vol->rdir_entrs = FAT_GET_BR_FILES_PER_ROOT_DIR(boot_rec); /* calculate the count of sectors occupied by the root directory */ vol->rdir_secs = ((vol->rdir_entrs * FAT_DIRENTRY_SIZE) + (vol->bps - 1)) / 201360c: 86 02 7f ff add %o1, -1, %g3 for (vol->bpc_log2 = 0, i = vol->bpc; (i & 1) == 0; i >>= 1, vol->bpc_log2++); vol->fats = FAT_GET_BR_FAT_NUM(boot_rec); vol->fat_loc = FAT_GET_BR_RESERVED_SECTORS_NUM(boot_rec); 2013610: 96 0a e0 ff and %o3, 0xff, %o3 2013614: 98 0b 20 ff and %o4, 0xff, %o4 2013618: 97 2a e0 08 sll %o3, 8, %o3 vol->rdir_entrs = FAT_GET_BR_FILES_PER_ROOT_DIR(boot_rec); 201361c: 9a 0b 60 ff and %o5, 0xff, %o5 for (vol->bpc_log2 = 0, i = vol->bpc; (i & 1) == 0; i >>= 1, vol->bpc_log2++); vol->fats = FAT_GET_BR_FAT_NUM(boot_rec); vol->fat_loc = FAT_GET_BR_RESERVED_SECTORS_NUM(boot_rec); 2013620: 98 12 c0 0c or %o3, %o4, %o4 vol->rdir_entrs = FAT_GET_BR_FILES_PER_ROOT_DIR(boot_rec); 2013624: 9b 2b 60 08 sll %o5, 8, %o5 for (vol->bpc_log2 = 0, i = vol->bpc; (i & 1) == 0; i >>= 1, vol->bpc_log2++); vol->fats = FAT_GET_BR_FAT_NUM(boot_rec); vol->fat_loc = FAT_GET_BR_RESERVED_SECTORS_NUM(boot_rec); 2013628: d8 36 e0 18 sth %o4, [ %i3 + 0x18 ] vol->rdir_entrs = FAT_GET_BR_FILES_PER_ROOT_DIR(boot_rec); 201362c: 88 09 20 ff and %g4, 0xff, %g4 2013630: 88 13 40 04 or %o5, %g4, %g4 2013634: c8 36 e0 24 sth %g4, [ %i3 + 0x24 ] /* calculate the count of sectors occupied by the root directory */ vol->rdir_secs = ((vol->rdir_entrs * FAT_DIRENTRY_SIZE) + (vol->bps - 1)) / 2013638: 89 29 20 10 sll %g4, 0x10, %g4 201363c: c4 27 bf 80 st %g2, [ %fp + -128 ] 2013640: 91 31 20 0b srl %g4, 0xb, %o0 2013644: d8 27 bf 68 st %o4, [ %fp + -152 ] 2013648: 7f ff bc 3e call 2002740 <.div> 201364c: 90 02 00 03 add %o0, %g3, %o0 vol->bps; vol->rdir_size = vol->rdir_secs << vol->sec_log2; 2013650: c4 07 bf 80 ld [ %fp + -128 ], %g2 vol->fat_loc = FAT_GET_BR_RESERVED_SECTORS_NUM(boot_rec); vol->rdir_entrs = FAT_GET_BR_FILES_PER_ROOT_DIR(boot_rec); /* calculate the count of sectors occupied by the root directory */ vol->rdir_secs = ((vol->rdir_entrs * FAT_DIRENTRY_SIZE) + (vol->bps - 1)) / 2013654: d0 26 e0 28 st %o0, [ %i3 + 0x28 ] vol->bps; vol->rdir_size = vol->rdir_secs << vol->sec_log2; 2013658: 85 2a 00 02 sll %o0, %g2, %g2 201365c: c4 26 e0 2c st %g2, [ %i3 + 0x2c ] if ( (FAT_GET_BR_SECTORS_PER_FAT(boot_rec)) != 0) 2013660: b0 0e 20 ff and %i0, 0xff, %i0 2013664: ae 0d e0 ff and %l7, 0xff, %l7 2013668: b1 2e 20 08 sll %i0, 8, %i0 vol->fat_loc = FAT_GET_BR_RESERVED_SECTORS_NUM(boot_rec); vol->rdir_entrs = FAT_GET_BR_FILES_PER_ROOT_DIR(boot_rec); /* calculate the count of sectors occupied by the root directory */ vol->rdir_secs = ((vol->rdir_entrs * FAT_DIRENTRY_SIZE) + (vol->bps - 1)) / 201366c: 86 10 00 08 mov %o0, %g3 vol->bps; vol->rdir_size = vol->rdir_secs << vol->sec_log2; if ( (FAT_GET_BR_SECTORS_PER_FAT(boot_rec)) != 0) 2013670: ae 16 00 17 or %i0, %l7, %l7 2013674: af 2d e0 10 sll %l7, 0x10, %l7 2013678: 80 a5 e0 00 cmp %l7, 0 201367c: 02 80 00 05 be 2013690 2013680: d8 07 bf 68 ld [ %fp + -152 ], %o4 vol->fat_length = FAT_GET_BR_SECTORS_PER_FAT(boot_rec); 2013684: af 35 e0 10 srl %l7, 0x10, %l7 2013688: 10 80 00 0c b 20136b8 201368c: ee 26 e0 1c st %l7, [ %i3 + 0x1c ] else vol->fat_length = FAT_GET_BR_SECTORS_PER_FAT32(boot_rec); 2013690: ac 0d a0 ff and %l6, 0xff, %l6 2013694: aa 0d 60 ff and %l5, 0xff, %l5 2013698: ad 2d a0 08 sll %l6, 8, %l6 201369c: ab 2d 60 10 sll %l5, 0x10, %l5 20136a0: a8 0d 20 ff and %l4, 0xff, %l4 20136a4: aa 15 80 15 or %l6, %l5, %l5 20136a8: a7 2c e0 18 sll %l3, 0x18, %l3 20136ac: a8 15 40 14 or %l5, %l4, %l4 20136b0: a6 15 00 13 or %l4, %l3, %l3 20136b4: e6 26 e0 1c st %l3, [ %i3 + 0x1c ] vol->data_fsec = vol->fat_loc + vol->fats * vol->fat_length + 20136b8: d2 06 e0 1c ld [ %i3 + 0x1c ], %o1 20136bc: 99 2b 20 10 sll %o4, 0x10, %o4 20136c0: c6 27 bf 84 st %g3, [ %fp + -124 ] 20136c4: b1 33 20 10 srl %o4, 0x10, %i0 20136c8: 7f ff bb e2 call 2002650 <.umul> 20136cc: 90 0e a0 ff and %i2, 0xff, %o0 20136d0: c6 07 bf 84 ld [ %fp + -124 ], %g3 20136d4: 90 06 00 08 add %i0, %o0, %o0 20136d8: 86 00 c0 08 add %g3, %o0, %g3 vol->rdir_secs; /* for FAT12/16 root dir starts at(sector) */ vol->rdir_loc = vol->fat_loc + vol->fats * vol->fat_length; 20136dc: d0 26 e0 20 st %o0, [ %i3 + 0x20 ] if ( (FAT_GET_BR_TOTAL_SECTORS_NUM16(boot_rec)) != 0) 20136e0: a4 0c a0 ff and %l2, 0xff, %l2 20136e4: a2 0c 60 ff and %l1, 0xff, %l1 20136e8: a5 2c a0 08 sll %l2, 8, %l2 20136ec: a2 14 80 11 or %l2, %l1, %l1 20136f0: a3 2c 60 10 sll %l1, 0x10, %l1 20136f4: 80 a4 60 00 cmp %l1, 0 20136f8: 02 80 00 05 be 201370c 20136fc: c6 26 e0 34 st %g3, [ %i3 + 0x34 ] vol->tot_secs = FAT_GET_BR_TOTAL_SECTORS_NUM16(boot_rec); 2013700: a3 34 60 10 srl %l1, 0x10, %l1 2013704: 10 80 00 0d b 2013738 2013708: e2 26 e0 30 st %l1, [ %i3 + 0x30 ] else vol->tot_secs = FAT_GET_BR_TOTAL_SECTORS_NUM32(boot_rec); 201370c: f4 0f bf 9a ldub [ %fp + -102 ], %i2 2013710: c2 0f bf 8f ldub [ %fp + -113 ], %g1 2013714: a0 0c 20 ff and %l0, 0xff, %l0 2013718: b2 0e 60 ff and %i1, 0xff, %i1 201371c: a1 2c 20 08 sll %l0, 8, %l0 2013720: b3 2e 60 10 sll %i1, 0x10, %i1 2013724: 85 28 60 18 sll %g1, 0x18, %g2 2013728: b2 14 00 19 or %l0, %i1, %i1 201372c: b4 16 40 1a or %i1, %i2, %i2 2013730: b4 16 80 02 or %i2, %g2, %i2 2013734: f4 26 e0 30 st %i2, [ %i3 + 0x30 ] data_secs = vol->tot_secs - vol->data_fsec; 2013738: d0 06 e0 30 ld [ %i3 + 0x30 ], %o0 vol->data_cls = data_secs / vol->spc; 201373c: 92 0f 60 ff and %i5, 0xff, %o1 2013740: 7f ff bb fe call 2002738 <.udiv> 2013744: 90 22 00 03 sub %o0, %g3, %o0 /* determine FAT type at least */ if ( vol->data_cls < FAT_FAT12_MAX_CLN) 2013748: 80 a2 2f f4 cmp %o0, 0xff4 201374c: 18 80 00 08 bgu 201376c 2013750: d0 26 e0 38 st %o0, [ %i3 + 0x38 ] { vol->type = FAT_FAT12; 2013754: 84 10 20 01 mov 1, %g2 2013758: c4 2e e0 0e stb %g2, [ %i3 + 0xe ] vol->mask = FAT_FAT12_MASK; 201375c: 84 10 2f ff mov 0xfff, %g2 2013760: c4 26 e0 10 st %g2, [ %i3 + 0x10 ] vol->eoc_val = FAT_FAT12_EOC; 2013764: 10 80 00 0f b 20137a0 2013768: 84 10 2f f8 mov 0xff8, %g2 } else { if ( vol->data_cls < FAT_FAT16_MAX_CLN) 201376c: 05 00 00 3f sethi %hi(0xfc00), %g2 2013770: 86 10 a3 f4 or %g2, 0x3f4, %g3 ! fff4 2013774: 80 a2 00 03 cmp %o0, %g3 2013778: 38 80 00 05 bgu,a 201378c 201377c: 84 10 20 04 mov 4, %g2 { vol->type = FAT_FAT16; 2013780: 86 10 20 02 mov 2, %g3 2013784: 10 80 00 04 b 2013794 2013788: c6 2e e0 0e stb %g3, [ %i3 + 0xe ] vol->mask = FAT_FAT16_MASK; vol->eoc_val = FAT_FAT16_EOC; } else { vol->type = FAT_FAT32; 201378c: c4 2e e0 0e stb %g2, [ %i3 + 0xe ] vol->mask = FAT_FAT32_MASK; 2013790: 05 03 ff ff sethi %hi(0xffffc00), %g2 2013794: 86 10 a3 ff or %g2, 0x3ff, %g3 ! fffffff vol->eoc_val = FAT_FAT32_EOC; 2013798: 84 10 a3 f8 or %g2, 0x3f8, %g2 vol->eoc_val = FAT_FAT16_EOC; } else { vol->type = FAT_FAT32; vol->mask = FAT_FAT32_MASK; 201379c: c6 26 e0 10 st %g3, [ %i3 + 0x10 ] vol->eoc_val = FAT_FAT32_EOC; 20137a0: c4 26 e0 14 st %g2, [ %i3 + 0x14 ] } } if (vol->type == FAT_FAT32) 20137a4: c4 0e e0 0e ldub [ %i3 + 0xe ], %g2 20137a8: 80 a0 a0 04 cmp %g2, 4 20137ac: 12 80 00 63 bne 2013938 20137b0: 82 10 3f ff mov -1, %g1 { vol->rdir_cl = FAT_GET_BR_FAT32_ROOT_CLUSTER(boot_rec); 20137b4: c6 0f bf 9c ldub [ %fp + -100 ], %g3 20137b8: c4 0f bf 9b ldub [ %fp + -101 ], %g2 20137bc: 87 28 e0 08 sll %g3, 8, %g3 20137c0: 85 28 a0 10 sll %g2, 0x10, %g2 20137c4: c2 0f bf 97 ldub [ %fp + -105 ], %g1 20137c8: 84 10 c0 02 or %g3, %g2, %g2 20137cc: c6 0f bf 9d ldub [ %fp + -99 ], %g3 20137d0: 84 10 80 03 or %g2, %g3, %g2 20137d4: 87 28 60 18 sll %g1, 0x18, %g3 20137d8: 84 10 80 03 or %g2, %g3, %g2 20137dc: c4 26 e0 3c st %g2, [ %i3 + 0x3c ] vol->mirror = FAT_GET_BR_EXT_FLAGS(boot_rec) & FAT_BR_EXT_FLAGS_MIRROR; 20137e0: 84 0f 3f 80 and %i4, -128, %g2 if (vol->mirror) 20137e4: 80 88 a0 80 btst 0x80, %g2 20137e8: 02 80 00 05 be 20137fc <== ALWAYS TAKEN 20137ec: c4 2e e0 54 stb %g2, [ %i3 + 0x54 ] vol->afat = FAT_GET_BR_EXT_FLAGS(boot_rec) & FAT_BR_EXT_FLAGS_FAT_NUM; 20137f0: b8 0f 20 0f and %i4, 0xf, %i4 <== NOT EXECUTED 20137f4: 10 80 00 03 b 2013800 <== NOT EXECUTED 20137f8: f8 2e e0 5c stb %i4, [ %i3 + 0x5c ] <== NOT EXECUTED else vol->afat = 0; 20137fc: c0 2e e0 5c clrb [ %i3 + 0x5c ] vol->info_sec = FAT_GET_BR_FAT32_FS_INFO_SECTOR(boot_rec); 2013800: d2 0f bf 9e ldub [ %fp + -98 ], %o1 2013804: c4 0f bf 9f ldub [ %fp + -97 ], %g2 2013808: 93 2a 60 08 sll %o1, 8, %o1 201380c: 92 12 40 02 or %o1, %g2, %o1 2013810: d2 36 e0 40 sth %o1, [ %i3 + 0x40 ] if( vol->info_sec == 0 ) 2013814: 93 2a 60 10 sll %o1, 0x10, %o1 2013818: 93 32 60 10 srl %o1, 0x10, %o1 201381c: 80 a2 60 00 cmp %o1, 0 2013820: 32 80 00 03 bne,a 201382c <== ALWAYS TAKEN 2013824: 90 10 00 1b mov %i3, %o0 2013828: 30 80 00 18 b,a 2013888 <== NOT EXECUTED close(vol->fd); rtems_set_errno_and_return_minus_one( EINVAL ); } else { ret = _fat_block_read(fs_info, vol->info_sec , 0, 201382c: 94 10 20 00 clr %o2 2013830: 96 10 20 04 mov 4, %o3 2013834: 7f ff fd f3 call 2013000 <_fat_block_read> 2013838: 98 07 bf a8 add %fp, -88, %o4 FAT_FSI_LEADSIG_SIZE, fs_info_sector); if ( ret < 0 ) 201383c: 80 a2 20 00 cmp %o0, 0 2013840: 06 80 00 22 bl 20138c8 <== NEVER TAKEN 2013844: c4 0f bf aa ldub [ %fp + -86 ], %g2 { close(vol->fd); return -1; } if (FAT_GET_FSINFO_LEAD_SIGNATURE(fs_info_sector) != 2013848: c6 0f bf a9 ldub [ %fp + -87 ], %g3 201384c: 85 28 a0 10 sll %g2, 0x10, %g2 2013850: 87 28 e0 08 sll %g3, 8, %g3 2013854: 86 10 c0 02 or %g3, %g2, %g3 2013858: c4 0f bf a8 ldub [ %fp + -88 ], %g2 201385c: 86 10 c0 02 or %g3, %g2, %g3 2013860: c4 0f bf ab ldub [ %fp + -85 ], %g2 2013864: 85 28 a0 18 sll %g2, 0x18, %g2 2013868: 86 10 c0 02 or %g3, %g2, %g3 201386c: 05 10 58 54 sethi %hi(0x41615000), %g2 2013870: 84 10 a2 52 or %g2, 0x252, %g2 ! 41615252 2013874: 80 a0 c0 02 cmp %g3, %g2 2013878: 02 80 00 0a be 20138a0 <== ALWAYS TAKEN 201387c: 90 10 00 1b mov %i3, %o0 * 0 on success, or -1 if error occured and errno set appropriately */ int _fat_block_release(fat_fs_info_t *fs_info) { return fat_buf_release(fs_info); 2013880: 7f ff fd 3d call 2012d74 <== NOT EXECUTED 2013884: 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); 2013888: 7f ff c5 f6 call 2005060 <== NOT EXECUTED 201388c: d0 06 e0 60 ld [ %i3 + 0x60 ], %o0 <== NOT EXECUTED rtems_set_errno_and_return_minus_one( EINVAL ); 2013890: 40 00 1f 47 call 201b5ac <__errno> <== NOT EXECUTED 2013894: 01 00 00 00 nop <== NOT EXECUTED 2013898: 10 80 00 82 b 2013aa0 <== NOT EXECUTED 201389c: 82 10 20 16 mov 0x16, %g1 ! 16 <== NOT EXECUTED } else { ret = _fat_block_read(fs_info, vol->info_sec , FAT_FSI_INFO, 20138a0: d2 16 e0 40 lduh [ %i3 + 0x40 ], %o1 20138a4: 94 10 21 e4 mov 0x1e4, %o2 20138a8: 96 10 20 0c mov 0xc, %o3 20138ac: 7f ff fd d5 call 2013000 <_fat_block_read> 20138b0: 98 07 bf a8 add %fp, -88, %o4 FAT_USEFUL_INFO_SIZE, fs_info_sector); if ( ret < 0 ) 20138b4: 80 a2 20 00 cmp %o0, 0 20138b8: 16 80 00 08 bge 20138d8 <== ALWAYS TAKEN 20138bc: 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); 20138c0: 7f ff fd 2d call 2012d74 <== NOT EXECUTED 20138c4: 90 10 00 1b mov %i3, %o0 <== NOT EXECUTED ret = _fat_block_read(fs_info, vol->info_sec , FAT_FSI_INFO, FAT_USEFUL_INFO_SIZE, fs_info_sector); if ( ret < 0 ) { _fat_block_release(fs_info); close(vol->fd); 20138c8: 7f ff c5 e6 call 2005060 <== NOT EXECUTED 20138cc: d0 06 e0 60 ld [ %i3 + 0x60 ], %o0 <== NOT EXECUTED { close(vol->fd); free(fs_info->vhash); free(fs_info->rhash); free(fs_info->uino); rtems_set_errno_and_return_minus_one( ENOMEM ); 20138d0: 81 c7 e0 08 ret <== NOT EXECUTED 20138d4: 91 e8 3f ff restore %g0, -1, %o0 <== NOT EXECUTED close(vol->fd); return -1; } vol->free_cls_in_fs_info = FAT_GET_FSINFO_FREE_CLUSTER_COUNT(fs_info_sector); 20138d8: c4 0f bf ae ldub [ %fp + -82 ], %g2 20138dc: 87 28 e0 08 sll %g3, 8, %g3 20138e0: 85 28 a0 10 sll %g2, 0x10, %g2 20138e4: 84 10 c0 02 or %g3, %g2, %g2 20138e8: c6 0f bf ac ldub [ %fp + -84 ], %g3 20138ec: 84 10 80 03 or %g2, %g3, %g2 20138f0: c6 0f bf af ldub [ %fp + -81 ], %g3 20138f4: 87 28 e0 18 sll %g3, 0x18, %g3 20138f8: 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); 20138fc: c6 0f bf b1 ldub [ %fp + -79 ], %g3 _fat_block_release(fs_info); close(vol->fd); return -1; } vol->free_cls_in_fs_info = 2013900: c4 26 e0 48 st %g2, [ %i3 + 0x48 ] FAT_GET_FSINFO_FREE_CLUSTER_COUNT(fs_info_sector); vol->free_cls = vol->free_cls_in_fs_info; 2013904: c4 26 e0 44 st %g2, [ %i3 + 0x44 ] vol->next_cl_in_fs_info = FAT_GET_FSINFO_NEXT_FREE_CLUSTER(fs_info_sector); 2013908: c4 0f bf b2 ldub [ %fp + -78 ], %g2 201390c: 87 28 e0 08 sll %g3, 8, %g3 2013910: 85 28 a0 10 sll %g2, 0x10, %g2 2013914: 84 10 c0 02 or %g3, %g2, %g2 2013918: c6 0f bf b0 ldub [ %fp + -80 ], %g3 201391c: 84 10 80 03 or %g2, %g3, %g2 2013920: c6 0f bf b3 ldub [ %fp + -77 ], %g3 2013924: 87 28 e0 18 sll %g3, 0x18, %g3 2013928: 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 = 201392c: c4 26 e0 50 st %g2, [ %i3 + 0x50 ] FAT_GET_FSINFO_NEXT_FREE_CLUSTER(fs_info_sector); vol->next_cl = vol->next_cl_in_fs_info; 2013930: 10 80 00 07 b 201394c 2013934: c4 26 e0 4c st %g2, [ %i3 + 0x4c ] } } } else { vol->rdir_cl = 0; 2013938: c0 26 e0 3c clr [ %i3 + 0x3c ] vol->mirror = 0; 201393c: c0 2e e0 54 clrb [ %i3 + 0x54 ] vol->afat = 0; 2013940: c0 2e e0 5c clrb [ %i3 + 0x5c ] vol->free_cls = FAT_UNDEFINED_VALUE; 2013944: c2 26 e0 44 st %g1, [ %i3 + 0x44 ] vol->next_cl = FAT_UNDEFINED_VALUE; 2013948: c2 26 e0 4c st %g1, [ %i3 + 0x4c ] * 0 on success, or -1 if error occured and errno set appropriately */ int _fat_block_release(fat_fs_info_t *fs_info) { return fat_buf_release(fs_info); 201394c: 7f ff fd 0a call 2012d74 2013950: 90 10 00 1b mov %i3, %o0 vol->next_cl = FAT_UNDEFINED_VALUE; } _fat_block_release(fs_info); vol->afat_loc = vol->fat_loc + vol->fat_length * vol->afat; 2013954: d2 06 e0 1c ld [ %i3 + 0x1c ], %o1 2013958: 7f ff bb 3e call 2002650 <.umul> 201395c: d0 0e e0 5c ldub [ %i3 + 0x5c ], %o0 2013960: c4 16 e0 18 lduh [ %i3 + 0x18 ], %g2 /* set up collection of fat-files fd */ fs_info->vhash = calloc(FAT_HASH_SIZE, sizeof(rtems_chain_control)); 2013964: 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; 2013968: 90 02 00 02 add %o0, %g2, %o0 201396c: d0 26 e0 58 st %o0, [ %i3 + 0x58 ] /* set up collection of fat-files fd */ fs_info->vhash = calloc(FAT_HASH_SIZE, sizeof(rtems_chain_control)); 2013970: 7f ff c5 a5 call 2005004 2013974: 90 10 20 02 mov 2, %o0 if ( fs_info->vhash == NULL ) 2013978: 80 a2 20 00 cmp %o0, 0 201397c: 02 80 00 12 be 20139c4 <== NEVER TAKEN 2013980: d0 26 e0 6c st %o0, [ %i3 + 0x6c ] RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); 2013984: 84 02 20 04 add %o0, 4, %g2 2013988: 86 02 20 10 add %o0, 0x10, %g3 head->next = tail; 201398c: 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 ); 2013990: 84 02 20 0c add %o0, 0xc, %g2 head->next = tail; head->previous = NULL; 2013994: c0 22 20 04 clr [ %o0 + 4 ] tail->previous = head; 2013998: 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; 201399c: c6 22 20 0c st %g3, [ %o0 + 0xc ] head->previous = NULL; 20139a0: c0 22 20 10 clr [ %o0 + 0x10 ] tail->previous = head; 20139a4: 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)); 20139a8: 92 10 20 0c mov 0xc, %o1 20139ac: 7f ff c5 96 call 2005004 20139b0: 90 10 20 02 mov 2, %o0 if ( fs_info->rhash == NULL ) 20139b4: 80 a2 20 00 cmp %o0, 0 20139b8: 12 80 00 06 bne 20139d0 <== ALWAYS TAKEN 20139bc: d0 26 e0 70 st %o0, [ %i3 + 0x70 ] 20139c0: 30 80 00 1c b,a 2013a30 <== 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); 20139c4: 7f ff c5 a7 call 2005060 <== NOT EXECUTED 20139c8: d0 06 e0 60 ld [ %i3 + 0x60 ], %o0 <== NOT EXECUTED 20139cc: 30 80 00 32 b,a 2013a94 <== 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 ); 20139d0: 84 02 20 04 add %o0, 4, %g2 head->next = tail; 20139d4: 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 ); 20139d8: 84 02 20 0c add %o0, 0xc, %g2 head->next = tail; head->previous = NULL; 20139dc: c0 22 20 04 clr [ %o0 + 4 ] tail->previous = head; 20139e0: c4 22 20 14 st %g2, [ %o0 + 0x14 ] 20139e4: 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; 20139e8: 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 ); 20139ec: 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; 20139f0: 84 10 21 00 mov 0x100, %g2 head->next = tail; 20139f4: c6 22 20 0c st %g3, [ %o0 + 0xc ] 20139f8: c4 26 e0 7c st %g2, [ %i3 + 0x7c ] fs_info->uino_base = (vol->tot_secs << vol->sec_mul) << 4; 20139fc: c6 06 e0 30 ld [ %i3 + 0x30 ], %g3 2013a00: c4 0e e0 03 ldub [ %i3 + 3 ], %g2 fs_info->index = 0; 2013a04: c0 26 e0 78 clr [ %i3 + 0x78 ] } for (i = 0; i < FAT_HASH_SIZE; i++) rtems_chain_initialize_empty(fs_info->rhash + i); fs_info->uino_pool_size = FAT_UINO_POOL_INIT_SIZE; fs_info->uino_base = (vol->tot_secs << vol->sec_mul) << 4; 2013a08: 85 28 c0 02 sll %g3, %g2, %g2 2013a0c: 85 28 a0 04 sll %g2, 4, %g2 fs_info->index = 0; fs_info->uino = (char *)calloc(fs_info->uino_pool_size, sizeof(char)); 2013a10: 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; 2013a14: c4 26 e0 80 st %g2, [ %i3 + 0x80 ] fs_info->index = 0; fs_info->uino = (char *)calloc(fs_info->uino_pool_size, sizeof(char)); 2013a18: 7f ff c5 7b call 2005004 2013a1c: 92 10 20 01 mov 1, %o1 if ( fs_info->uino == NULL ) 2013a20: 80 a2 20 00 cmp %o0, 0 2013a24: 12 80 00 0d bne 2013a58 <== ALWAYS TAKEN 2013a28: d0 26 e0 74 st %o0, [ %i3 + 0x74 ] 2013a2c: 30 80 00 05 b,a 2013a40 <== 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); 2013a30: 7f ff c5 8c call 2005060 <== NOT EXECUTED 2013a34: d0 06 e0 60 ld [ %i3 + 0x60 ], %o0 <== NOT EXECUTED free(fs_info->vhash); 2013a38: 10 80 00 15 b 2013a8c <== NOT EXECUTED 2013a3c: d0 06 e0 6c ld [ %i3 + 0x6c ], %o0 <== NOT EXECUTED fs_info->uino_base = (vol->tot_secs << vol->sec_mul) << 4; fs_info->index = 0; fs_info->uino = (char *)calloc(fs_info->uino_pool_size, sizeof(char)); if ( fs_info->uino == NULL ) { close(vol->fd); 2013a40: 7f ff c5 88 call 2005060 <== NOT EXECUTED 2013a44: d0 06 e0 60 ld [ %i3 + 0x60 ], %o0 <== NOT EXECUTED free(fs_info->vhash); 2013a48: 7f ff c6 43 call 2005354 <== NOT EXECUTED 2013a4c: d0 06 e0 6c ld [ %i3 + 0x6c ], %o0 <== NOT EXECUTED free(fs_info->rhash); 2013a50: 10 80 00 0f b 2013a8c <== NOT EXECUTED 2013a54: d0 06 e0 70 ld [ %i3 + 0x70 ], %o0 <== NOT EXECUTED rtems_set_errno_and_return_minus_one( ENOMEM ); } fs_info->sec_buf = (uint8_t *)calloc(vol->bps, sizeof(uint8_t)); 2013a58: d0 16 c0 00 lduh [ %i3 ], %o0 2013a5c: 7f ff c5 6a call 2005004 2013a60: 92 10 20 01 mov 1, %o1 if (fs_info->sec_buf == NULL) 2013a64: 80 a2 20 00 cmp %o0, 0 2013a68: 12 80 00 11 bne 2013aac <== ALWAYS TAKEN 2013a6c: d0 26 e0 90 st %o0, [ %i3 + 0x90 ] { close(vol->fd); 2013a70: 7f ff c5 7c call 2005060 <== NOT EXECUTED 2013a74: d0 06 e0 60 ld [ %i3 + 0x60 ], %o0 <== NOT EXECUTED free(fs_info->vhash); 2013a78: 7f ff c6 37 call 2005354 <== NOT EXECUTED 2013a7c: d0 06 e0 6c ld [ %i3 + 0x6c ], %o0 <== NOT EXECUTED free(fs_info->rhash); 2013a80: 7f ff c6 35 call 2005354 <== NOT EXECUTED 2013a84: d0 06 e0 70 ld [ %i3 + 0x70 ], %o0 <== NOT EXECUTED free(fs_info->uino); 2013a88: d0 06 e0 74 ld [ %i3 + 0x74 ], %o0 <== NOT EXECUTED 2013a8c: 7f ff c6 32 call 2005354 <== NOT EXECUTED 2013a90: 01 00 00 00 nop <== NOT EXECUTED rtems_set_errno_and_return_minus_one( ENOMEM ); 2013a94: 40 00 1e c6 call 201b5ac <__errno> <== NOT EXECUTED 2013a98: 01 00 00 00 nop <== NOT EXECUTED 2013a9c: 82 10 20 0c mov 0xc, %g1 ! c <== NOT EXECUTED 2013aa0: c2 22 00 00 st %g1, [ %o0 ] <== NOT EXECUTED 2013aa4: 81 c7 e0 08 ret <== NOT EXECUTED 2013aa8: 91 e8 3f ff restore %g0, -1, %o0 <== NOT EXECUTED return bytes_written; } static bool is_cluster_aligned(const fat_vol_t *vol, uint32_t sec_num) { return (sec_num & (vol->spc - 1)) == 0; 2013aac: c4 0e e0 04 ldub [ %i3 + 4 ], %g2 2013ab0: c6 06 e0 34 ld [ %i3 + 0x34 ], %g3 2013ab4: 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) 2013ab8: 80 88 80 03 btst %g2, %g3 2013abc: 22 80 00 04 be,a 2013acc <== ALWAYS TAKEN 2013ac0: c6 0e e0 0e ldub [ %i3 + 0xe ], %g3 vol->bytes_per_block_log2 = vol->bpc_log2; vol->sectors_per_block = vol->spc; } } return RC_OK; 2013ac4: 81 c7 e0 08 ret <== NOT EXECUTED 2013ac8: 91 e8 20 00 restore %g0, 0, %o0 <== NOT EXECUTED * If possible we will use the cluster size as bdbuf block size for faster * file access. This requires that certain sectors are aligned to cluster * borders. */ if (is_cluster_aligned(vol, vol->data_fsec) && (FAT_FAT32 == vol->type || is_cluster_aligned(vol, vol->rdir_loc))) 2013acc: 80 a0 e0 04 cmp %g3, 4 2013ad0: 22 80 00 07 be,a 2013aec 2013ad4: d0 06 e0 64 ld [ %i3 + 0x64 ], %o0 return bytes_written; } static bool is_cluster_aligned(const fat_vol_t *vol, uint32_t sec_num) { return (sec_num & (vol->spc - 1)) == 0; 2013ad8: c6 06 e0 20 ld [ %i3 + 0x20 ], %g3 * If possible we will use the cluster size as bdbuf block size for faster * file access. This requires that certain sectors are aligned to cluster * borders. */ if (is_cluster_aligned(vol, vol->data_fsec) && (FAT_FAT32 == vol->type || is_cluster_aligned(vol, vol->rdir_loc))) 2013adc: 80 88 80 03 btst %g2, %g3 2013ae0: 12 80 00 0f bne 2013b1c <== NEVER TAKEN 2013ae4: b0 10 20 00 clr %i0 { sc = rtems_bdbuf_set_block_size (vol->dd, vol->bpc, true); 2013ae8: d0 06 e0 64 ld [ %i3 + 0x64 ], %o0 2013aec: d2 16 e0 06 lduh [ %i3 + 6 ], %o1 2013af0: 7f ff f6 78 call 20114d0 2013af4: 94 10 20 01 mov 1, %o2 if (sc == RTEMS_SUCCESSFUL) 2013af8: 80 a2 20 00 cmp %o0, 0 2013afc: 12 80 00 08 bne 2013b1c <== NEVER TAKEN 2013b00: b0 10 20 00 clr %i0 { vol->bytes_per_block = vol->bpc; 2013b04: c4 16 e0 06 lduh [ %i3 + 6 ], %g2 2013b08: c4 36 e0 0a sth %g2, [ %i3 + 0xa ] vol->bytes_per_block_log2 = vol->bpc_log2; 2013b0c: c4 0e e0 08 ldub [ %i3 + 8 ], %g2 2013b10: c4 2e e0 0c stb %g2, [ %i3 + 0xc ] vol->sectors_per_block = vol->spc; 2013b14: c4 0e e0 04 ldub [ %i3 + 4 ], %g2 2013b18: c4 2e e0 09 stb %g2, [ %i3 + 9 ] } } return RC_OK; } 2013b1c: 81 c7 e0 08 ret 2013b20: 81 e8 00 00 restore =============================================================================== 02019a74 : uint32_t count, uint32_t *cls_added, uint32_t *last_cl, bool zero_fill ) { 2019a74: 9d e3 bf 98 save %sp, -104, %sp int rc = RC_OK; uint32_t cl4find = 2; uint32_t next_cln = 0; uint32_t save_cln = 0; uint32_t data_cls_val = fs_info->vol.data_cls + 2; 2019a78: e8 06 20 38 ld [ %i0 + 0x38 ], %l4 bool zero_fill ) { int rc = RC_OK; uint32_t cl4find = 2; uint32_t next_cln = 0; 2019a7c: c0 27 bf fc clr [ %fp + -4 ] uint32_t save_cln = 0; uint32_t data_cls_val = fs_info->vol.data_cls + 2; uint32_t i = 2; ssize_t bytes_written; *cls_added = 0; 2019a80: c0 26 c0 00 clr [ %i3 ] if (count == 0) 2019a84: 80 a6 a0 00 cmp %i2, 0 2019a88: 02 80 00 7e be 2019c80 <== NEVER TAKEN 2019a8c: a2 10 20 00 clr %l1 return rc; if (fs_info->vol.next_cl != FAT_UNDEFINED_VALUE) 2019a90: e0 06 20 4c ld [ %i0 + 0x4c ], %l0 2019a94: 80 a4 3f ff cmp %l0, -1 2019a98: 22 80 00 02 be,a 2019aa0 2019a9c: a0 10 20 02 mov 2, %l0 { int rc = RC_OK; uint32_t cl4find = 2; uint32_t next_cln = 0; uint32_t save_cln = 0; uint32_t data_cls_val = fs_info->vol.data_cls + 2; 2019aa0: a8 05 20 02 add %l4, 2, %l4 2019aa4: a6 10 20 02 mov 2, %l3 2019aa8: 10 80 00 5a b 2019c10 2019aac: a4 10 20 00 clr %l2 * starting at cluster 2, so the maximum valid cluster number is * (fs_info->vol.data_cls + 1) */ while (i < data_cls_val) { rc = fat_get_fat_cluster(fs_info, cl4find, &next_cln); 2019ab0: 92 10 00 10 mov %l0, %o1 2019ab4: 7f ff fe ae call 201956c 2019ab8: 94 07 bf fc add %fp, -4, %o2 if ( rc != RC_OK ) 2019abc: a2 92 20 00 orcc %o0, 0, %l1 2019ac0: 02 80 00 0b be 2019aec <== ALWAYS TAKEN 2019ac4: c2 07 bf fc ld [ %fp + -4 ], %g1 { if (*cls_added != 0) 2019ac8: c2 06 c0 00 ld [ %i3 ], %g1 <== NOT EXECUTED 2019acc: 80 a0 60 00 cmp %g1, 0 <== NOT EXECUTED 2019ad0: 22 80 00 6d be,a 2019c84 <== NOT EXECUTED 2019ad4: b0 10 00 11 mov %l1, %i0 <== NOT EXECUTED fat_free_fat_clusters_chain(fs_info, (*chain)); 2019ad8: d2 06 40 00 ld [ %i1 ], %o1 <== NOT EXECUTED 2019adc: 7f ff ff b7 call 20199b8 <== NOT EXECUTED 2019ae0: 90 10 00 18 mov %i0, %o0 <== NOT EXECUTED fat_free_fat_clusters_chain(fs_info, (*chain)); /* trying to save last allocated cluster for future use */ fat_set_fat_cluster(fs_info, cl4find, FAT_GENFAT_FREE); fat_buf_release(fs_info); return rc; } 2019ae4: 81 c7 e0 08 ret <== NOT EXECUTED 2019ae8: 91 e8 00 11 restore %g0, %l1, %o0 <== NOT EXECUTED if (*cls_added != 0) fat_free_fat_clusters_chain(fs_info, (*chain)); return rc; } if (next_cln == FAT_GENFAT_FREE) 2019aec: 80 a0 60 00 cmp %g1, 0 2019af0: 32 80 00 44 bne,a 2019c00 2019af4: a0 04 20 01 inc %l0 /* * We are enforced to process allocation of the first free cluster * by separate 'if' statement because otherwise undo function * wouldn't work properly */ if (*cls_added == 0) 2019af8: c2 06 c0 00 ld [ %i3 ], %g1 2019afc: 80 a0 60 00 cmp %g1, 0 2019b00: 12 80 00 0e bne 2019b38 2019b04: 90 10 00 18 mov %i0, %o0 { *chain = cl4find; 2019b08: e0 26 40 00 st %l0, [ %i1 ] rc = fat_set_fat_cluster(fs_info, cl4find, FAT_GENFAT_EOC); 2019b0c: 92 10 00 10 mov %l0, %o1 2019b10: 7f ff ff 09 call 2019734 2019b14: 94 10 3f ff mov -1, %o2 if ( rc != RC_OK ) 2019b18: 80 a2 20 00 cmp %o0, 0 2019b1c: 32 80 00 59 bne,a 2019c80 <== NEVER TAKEN 2019b20: a2 10 00 08 mov %o0, %l1 <== NOT EXECUTED rc = fat_set_fat_cluster(fs_info, save_cln, cl4find); if ( rc != RC_OK ) goto cleanup; } if (zero_fill) 2019b24: 80 a7 60 00 cmp %i5, 0 2019b28: 22 80 00 18 be,a 2019b88 2019b2c: c2 06 c0 00 ld [ %i3 ], %g1 { bytes_written = fat_cluster_set (fs_info, cl4find, 0, fs_info->vol.bpc, 0); 2019b30: 10 80 00 1c b 2019ba0 2019b34: d6 16 20 06 lduh [ %i0 + 6 ], %o3 } } else { /* set EOC value to new allocated cluster */ rc = fat_set_fat_cluster(fs_info, cl4find, FAT_GENFAT_EOC); 2019b38: 92 10 00 10 mov %l0, %o1 2019b3c: 7f ff fe fe call 2019734 2019b40: 94 10 3f ff mov -1, %o2 2019b44: aa 10 00 08 mov %o0, %l5 if ( rc != RC_OK ) 2019b48: 80 a5 60 00 cmp %l5, 0 2019b4c: 02 80 00 07 be 2019b68 <== ALWAYS TAKEN 2019b50: 90 10 00 18 mov %i0, %o0 { /* cleanup activity */ fat_free_fat_clusters_chain(fs_info, (*chain)); 2019b54: d2 06 40 00 ld [ %i1 ], %o1 <== NOT EXECUTED 2019b58: 7f ff ff 98 call 20199b8 <== NOT EXECUTED 2019b5c: a2 10 00 15 mov %l5, %l1 <== NOT EXECUTED fat_free_fat_clusters_chain(fs_info, (*chain)); /* trying to save last allocated cluster for future use */ fat_set_fat_cluster(fs_info, cl4find, FAT_GENFAT_FREE); fat_buf_release(fs_info); return rc; } 2019b60: 81 c7 e0 08 ret <== NOT EXECUTED 2019b64: 91 e8 00 11 restore %g0, %l1, %o0 <== NOT EXECUTED /* cleanup activity */ fat_free_fat_clusters_chain(fs_info, (*chain)); return rc; } rc = fat_set_fat_cluster(fs_info, save_cln, cl4find); 2019b68: 92 10 00 12 mov %l2, %o1 2019b6c: 7f ff fe f2 call 2019734 2019b70: 94 10 00 10 mov %l0, %o2 if ( rc != RC_OK ) 2019b74: a4 92 20 00 orcc %o0, 0, %l2 2019b78: 02 bf ff ec be 2019b28 <== ALWAYS TAKEN 2019b7c: 80 a7 60 00 cmp %i5, 0 return RC_OK; cleanup: /* cleanup activity */ fat_free_fat_clusters_chain(fs_info, (*chain)); 2019b80: 10 80 00 35 b 2019c54 <== NOT EXECUTED 2019b84: d2 06 40 00 ld [ %i1 ], %o1 <== NOT EXECUTED goto cleanup; } } save_cln = cl4find; (*cls_added)++; 2019b88: 82 00 60 01 inc %g1 /* have we satisfied request ? */ if (*cls_added == count) 2019b8c: 80 a0 40 1a cmp %g1, %i2 2019b90: 02 80 00 0f be 2019bcc 2019b94: c2 26 c0 00 st %g1, [ %i3 ] 2019b98: 10 80 00 19 b 2019bfc 2019b9c: a4 10 00 10 mov %l0, %l2 goto cleanup; } if (zero_fill) { bytes_written = fat_cluster_set (fs_info, cl4find, 0, fs_info->vol.bpc, 0); 2019ba0: 90 10 00 18 mov %i0, %o0 2019ba4: 92 10 00 10 mov %l0, %o1 2019ba8: 94 10 20 00 clr %o2 2019bac: 7f ff e5 5b call 2013118 2019bb0: 98 10 20 00 clr %o4 if (fs_info->vol.bpc != bytes_written) 2019bb4: c2 16 20 06 lduh [ %i0 + 6 ], %g1 2019bb8: 80 a0 40 08 cmp %g1, %o0 2019bbc: 22 bf ff f3 be,a 2019b88 <== ALWAYS TAKEN 2019bc0: c2 06 c0 00 ld [ %i3 ], %g1 { rc = -1; 2019bc4: 10 80 00 23 b 2019c50 <== NOT EXECUTED 2019bc8: a4 10 3f ff mov -1, %l2 <== NOT EXECUTED /* have we satisfied request ? */ if (*cls_added == count) { fs_info->vol.next_cl = save_cln; if (fs_info->vol.free_cls != FAT_UNDEFINED_VALUE) 2019bcc: c2 06 20 44 ld [ %i0 + 0x44 ], %g1 2019bd0: 80 a0 7f ff cmp %g1, -1 2019bd4: 02 80 00 05 be 2019be8 <== ALWAYS TAKEN 2019bd8: e0 26 20 4c st %l0, [ %i0 + 0x4c ] fs_info->vol.free_cls -= (*cls_added); 2019bdc: c4 06 c0 00 ld [ %i3 ], %g2 <== NOT EXECUTED 2019be0: 82 20 40 02 sub %g1, %g2, %g1 <== NOT EXECUTED 2019be4: c2 26 20 44 st %g1, [ %i0 + 0x44 ] <== NOT EXECUTED *last_cl = save_cln; 2019be8: e0 27 00 00 st %l0, [ %i4 ] fat_buf_release(fs_info); 2019bec: 7f ff e4 62 call 2012d74 2019bf0: 90 10 00 18 mov %i0, %o0 fat_free_fat_clusters_chain(fs_info, (*chain)); /* trying to save last allocated cluster for future use */ fat_set_fat_cluster(fs_info, cl4find, FAT_GENFAT_FREE); fat_buf_release(fs_info); return rc; } 2019bf4: 81 c7 e0 08 ret 2019bf8: 91 e8 00 11 restore %g0, %l1, %o0 fat_buf_release(fs_info); return rc; } } i++; cl4find++; 2019bfc: a0 04 20 01 inc %l0 if (cl4find >= data_cls_val) 2019c00: 80 a4 00 14 cmp %l0, %l4 2019c04: 0a 80 00 03 bcs 2019c10 <== ALWAYS TAKEN 2019c08: a6 04 e0 01 inc %l3 cl4find = 2; 2019c0c: a0 10 20 02 mov 2, %l0 <== NOT EXECUTED /* * fs_info->vol.data_cls is exactly the count of data clusters * starting at cluster 2, so the maximum valid cluster number is * (fs_info->vol.data_cls + 1) */ while (i < data_cls_val) 2019c10: 80 a4 c0 14 cmp %l3, %l4 2019c14: 0a bf ff a7 bcs 2019ab0 <== ALWAYS TAKEN 2019c18: 90 10 00 18 mov %i0, %o0 if (cl4find >= data_cls_val) cl4find = 2; } fs_info->vol.next_cl = save_cln; if (fs_info->vol.free_cls != FAT_UNDEFINED_VALUE) 2019c1c: c2 06 20 44 ld [ %i0 + 0x44 ], %g1 <== NOT EXECUTED 2019c20: 80 a0 7f ff cmp %g1, -1 <== NOT EXECUTED 2019c24: 02 80 00 05 be 2019c38 <== NOT EXECUTED 2019c28: e4 26 20 4c st %l2, [ %i0 + 0x4c ] <== NOT EXECUTED fs_info->vol.free_cls -= (*cls_added); 2019c2c: c4 06 c0 00 ld [ %i3 ], %g2 <== NOT EXECUTED 2019c30: 82 20 40 02 sub %g1, %g2, %g1 <== NOT EXECUTED 2019c34: c2 26 20 44 st %g1, [ %i0 + 0x44 ] <== NOT EXECUTED *last_cl = save_cln; 2019c38: e4 27 00 00 st %l2, [ %i4 ] <== NOT EXECUTED fat_buf_release(fs_info); 2019c3c: 90 10 00 18 mov %i0, %o0 <== NOT EXECUTED 2019c40: 7f ff e4 4d call 2012d74 <== NOT EXECUTED 2019c44: a2 10 20 00 clr %l1 <== NOT EXECUTED fat_free_fat_clusters_chain(fs_info, (*chain)); /* trying to save last allocated cluster for future use */ fat_set_fat_cluster(fs_info, cl4find, FAT_GENFAT_FREE); fat_buf_release(fs_info); return rc; } 2019c48: 81 c7 e0 08 ret <== NOT EXECUTED 2019c4c: 91 e8 00 11 restore %g0, %l1, %o0 <== NOT EXECUTED return RC_OK; cleanup: /* cleanup activity */ fat_free_fat_clusters_chain(fs_info, (*chain)); 2019c50: d2 06 40 00 ld [ %i1 ], %o1 <== NOT EXECUTED 2019c54: 7f ff ff 59 call 20199b8 <== NOT EXECUTED 2019c58: 90 10 00 18 mov %i0, %o0 <== NOT EXECUTED /* trying to save last allocated cluster for future use */ fat_set_fat_cluster(fs_info, cl4find, FAT_GENFAT_FREE); 2019c5c: 92 10 00 10 mov %l0, %o1 <== NOT EXECUTED 2019c60: 94 10 20 00 clr %o2 <== NOT EXECUTED 2019c64: 7f ff fe b4 call 2019734 <== NOT EXECUTED 2019c68: 90 10 00 18 mov %i0, %o0 <== NOT EXECUTED fat_buf_release(fs_info); 2019c6c: 90 10 00 18 mov %i0, %o0 <== NOT EXECUTED 2019c70: 7f ff e4 41 call 2012d74 <== NOT EXECUTED 2019c74: a2 10 00 12 mov %l2, %l1 <== NOT EXECUTED return rc; } 2019c78: 81 c7 e0 08 ret <== NOT EXECUTED 2019c7c: 91 e8 00 11 restore %g0, %l1, %o0 <== NOT EXECUTED 2019c80: b0 10 00 11 mov %l1, %i0 <== NOT EXECUTED 2019c84: 81 c7 e0 08 ret <== NOT EXECUTED 2019c88: 81 e8 00 00 restore <== NOT EXECUTED =============================================================================== 02013080 : fat_fs_info_t *fs_info, uint32_t start, uint32_t offset, uint32_t count, const void *buff) { 2013080: 9d e3 bf 98 save %sp, -104, %sp int rc = RC_OK; ssize_t cmpltd = 0; 2013084: 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) 2013088: 10 80 00 1b b 20130f4 201308c: a2 10 20 01 mov 1, %l1 { c = MIN(count, (fs_info->vol.bps - ofs)); 2013090: ba 27 40 1a sub %i5, %i2, %i5 2013094: 80 a7 40 1b cmp %i5, %i3 2013098: 38 80 00 02 bgu,a 20130a0 201309c: ba 10 00 1b mov %i3, %i5 if (c == fs_info->vol.bytes_per_block) 20130a0: c2 16 20 0a lduh [ %i0 + 0xa ], %g1 rc = fat_buf_access(fs_info, sec_num, FAT_OP_TYPE_GET, &sec_buf); 20130a4: 90 10 00 18 mov %i0, %o0 20130a8: 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) 20130ac: 80 a7 40 01 cmp %i5, %g1 20130b0: 02 80 00 03 be 20130bc <== NEVER TAKEN 20130b4: 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); 20130b8: 94 10 20 01 mov 1, %o2 20130bc: 7f ff ff a2 call 2012f44 20130c0: 96 07 bf fc add %fp, -4, %o3 if (rc != RC_OK) 20130c4: 80 a2 20 00 cmp %o0, 0 20130c8: 12 80 00 10 bne 2013108 <== NEVER TAKEN 20130cc: d0 07 bf fc ld [ %fp + -4 ], %o0 return -1; memcpy((sec_buf + ofs), (buff + cmpltd), c); 20130d0: 92 07 00 10 add %i4, %l0, %o1 20130d4: 90 02 00 1a add %o0, %i2, %o0 20130d8: 94 10 00 1d mov %i5, %o2 20130dc: 40 00 23 f3 call 201c0a8 20130e0: b6 26 c0 1d sub %i3, %i5, %i3 fat_buf_mark_modified(fs_info); count -= c; cmpltd +=c; 20130e4: a0 07 40 10 add %i5, %l0, %l0 } static inline void fat_buf_mark_modified(fat_fs_info_t *fs_info) { fs_info->c.modified = true; 20130e8: e2 2e 20 88 stb %l1, [ %i0 + 0x88 ] sec_num++; 20130ec: b2 06 60 01 inc %i1 ofs = 0; 20130f0: b4 10 20 00 clr %i2 uint32_t sec_num = start; uint32_t ofs = offset; uint8_t *sec_buf; uint32_t c = 0; while(count > 0) 20130f4: 80 a6 e0 00 cmp %i3, 0 20130f8: 32 bf ff e6 bne,a 2013090 20130fc: fa 16 00 00 lduh [ %i0 ], %i5 cmpltd +=c; sec_num++; ofs = 0; } return cmpltd; } 2013100: 81 c7 e0 08 ret 2013104: 91 e8 00 10 restore %g0, %l0, %o0 if (c == fs_info->vol.bytes_per_block) rc = fat_buf_access(fs_info, sec_num, FAT_OP_TYPE_GET, &sec_buf); else rc = fat_buf_access(fs_info, sec_num, FAT_OP_TYPE_READ, &sec_buf); if (rc != RC_OK) return -1; 2013108: a0 10 3f ff mov -1, %l0 <== NOT EXECUTED cmpltd +=c; sec_num++; ofs = 0; } return cmpltd; } 201310c: b0 10 00 10 mov %l0, %i0 <== NOT EXECUTED 2013110: 81 c7 e0 08 ret <== NOT EXECUTED 2013114: 81 e8 00 00 restore <== NOT EXECUTED =============================================================================== 02019734 : fat_set_fat_cluster( fat_fs_info_t *fs_info, uint32_t cln, uint32_t in_val ) { 2019734: 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; 2019738: c0 27 bf fc clr [ %fp + -4 ] /* sanity check */ if ( (cln < 2) || (cln > (fs_info->vol.data_cls + 1)) ) 201973c: 80 a6 60 01 cmp %i1, 1 2019740: 08 80 00 98 bleu 20199a0 <== NEVER TAKEN 2019744: ba 10 00 18 mov %i0, %i5 2019748: c2 06 20 38 ld [ %i0 + 0x38 ], %g1 201974c: 82 00 60 01 inc %g1 2019750: 80 a6 40 01 cmp %i1, %g1 2019754: 28 80 00 03 bleu,a 2019760 <== ALWAYS TAKEN 2019758: c2 0e 20 0e ldub [ %i0 + 0xe ], %g1 201975c: 30 80 00 91 b,a 20199a0 <== NOT EXECUTED rtems_set_errno_and_return_minus_one(EIO); sec = (FAT_FAT_OFFSET(fs_info->vol.type, cln) >> fs_info->vol.sec_log2) + 2019760: 84 08 60 01 and %g1, 1, %g2 2019764: 80 88 a0 ff btst 0xff, %g2 2019768: 02 80 00 05 be 201977c 201976c: 86 08 60 02 and %g1, 2, %g3 2019770: a1 36 60 01 srl %i1, 1, %l0 2019774: 10 80 00 06 b 201978c 2019778: a0 04 00 19 add %l0, %i1, %l0 201977c: 80 88 e0 ff btst 0xff, %g3 2019780: 02 80 00 03 be 201978c 2019784: a1 2e 60 02 sll %i1, 2, %l0 2019788: a1 2e 60 01 sll %i1, 1, %l0 201978c: 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); 2019790: 80 88 a0 ff btst 0xff, %g2 /* sanity check */ if ( (cln < 2) || (cln > (fs_info->vol.data_cls + 1)) ) rtems_set_errno_and_return_minus_one(EIO); sec = (FAT_FAT_OFFSET(fs_info->vol.type, cln) >> fs_info->vol.sec_log2) + 2019794: a1 34 00 03 srl %l0, %g3, %l0 2019798: 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); 201979c: 02 80 00 05 be 20197b0 20197a0: a0 04 00 03 add %l0, %g3, %l0 20197a4: b7 36 60 01 srl %i1, 1, %i3 20197a8: 10 80 00 07 b 20197c4 20197ac: b6 06 c0 19 add %i3, %i1, %i3 20197b0: 82 08 60 02 and %g1, 2, %g1 20197b4: 80 88 60 ff btst 0xff, %g1 20197b8: 02 80 00 03 be 20197c4 20197bc: b7 2e 60 02 sll %i1, 2, %i3 20197c0: b7 2e 60 01 sll %i1, 1, %i3 20197c4: f8 17 40 00 lduh [ %i5 ], %i4 rc = fat_buf_access(fs_info, sec, FAT_OP_TYPE_READ, &sec_buf); 20197c8: 90 10 00 1d mov %i5, %o0 20197cc: 92 10 00 10 mov %l0, %o1 20197d0: 94 10 20 01 mov 1, %o2 20197d4: 7f ff e5 dc call 2012f44 20197d8: 96 07 bf fc add %fp, -4, %o3 if (rc != RC_OK) 20197dc: b0 92 20 00 orcc %o0, 0, %i0 20197e0: 12 80 00 4c bne 2019910 <== NEVER TAKEN 20197e4: 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); 20197e8: b9 37 20 10 srl %i4, 0x10, %i4 20197ec: b8 07 3f ff add %i4, -1, %i4 20197f0: 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 ) 20197f4: f6 0f 60 0e ldub [ %i5 + 0xe ], %i3 20197f8: 80 a6 e0 02 cmp %i3, 2 20197fc: 02 80 00 53 be 2019948 2019800: 80 a6 e0 04 cmp %i3, 4 2019804: 02 80 00 5b be 2019970 2019808: 80 a6 e0 01 cmp %i3, 1 201980c: 12 80 00 65 bne 20199a0 <== NEVER TAKEN 2019810: 80 8e 60 01 btst 1, %i1 { case FAT_FAT12: if ( FAT_CLUSTER_IS_ODD(cln) ) 2019814: 02 80 00 23 be 20198a0 2019818: c2 07 bf fc ld [ %fp + -4 ], %g1 { fat16_clv = ((uint16_t )in_val) << FAT_FAT12_SHIFT; *(sec_buf + ofs) &= 0x0F; 201981c: c4 08 40 1c ldub [ %g1 + %i4 ], %g2 2019820: 84 08 a0 0f and %g2, 0xf, %g2 2019824: c4 28 40 1c stb %g2, [ %g1 + %i4 ] *(sec_buf + ofs) |= (uint8_t)(fat16_clv & 0x00F0); 2019828: c2 07 bf fc ld [ %fp + -4 ], %g1 201982c: 85 2e a0 04 sll %i2, 4, %g2 2019830: c6 08 40 1c ldub [ %g1 + %i4 ], %g3 2019834: 84 10 c0 02 or %g3, %g2, %g2 2019838: c4 28 40 1c stb %g2, [ %g1 + %i4 ] fat_buf_mark_modified(fs_info); if ( ofs == (fs_info->vol.bps - 1) ) 201983c: c2 17 40 00 lduh [ %i5 ], %g1 2019840: 82 00 7f ff add %g1, -1, %g1 2019844: 80 a7 00 01 cmp %i4, %g1 2019848: 12 80 00 0f bne 2019884 <== ALWAYS TAKEN 201984c: f6 2f 60 88 stb %i3, [ %i5 + 0x88 ] { rc = fat_buf_access(fs_info, sec + 1, FAT_OP_TYPE_READ, 2019850: 90 10 00 1d mov %i5, %o0 <== NOT EXECUTED 2019854: 92 04 20 01 add %l0, 1, %o1 <== NOT EXECUTED 2019858: 94 10 20 01 mov 1, %o2 <== NOT EXECUTED 201985c: 7f ff e5 ba call 2012f44 <== NOT EXECUTED 2019860: 96 07 bf fc add %fp, -4, %o3 <== NOT EXECUTED &sec_buf); if (rc != RC_OK) 2019864: b0 92 20 00 orcc %o0, 0, %i0 <== NOT EXECUTED 2019868: 12 80 00 2a bne 2019910 <== NOT EXECUTED 201986c: c2 07 bf fc ld [ %fp + -4 ], %g1 <== NOT EXECUTED return rc; *sec_buf &= 0x00; *sec_buf |= (uint8_t)((fat16_clv & 0xFF00)>>8); 2019870: b5 2e a0 14 sll %i2, 0x14, %i2 <== NOT EXECUTED rc = fat_buf_access(fs_info, sec + 1, FAT_OP_TYPE_READ, &sec_buf); if (rc != RC_OK) return rc; *sec_buf &= 0x00; 2019874: c0 28 40 00 clrb [ %g1 ] <== NOT EXECUTED *sec_buf |= (uint8_t)((fat16_clv & 0xFF00)>>8); 2019878: b5 36 a0 18 srl %i2, 0x18, %i2 <== NOT EXECUTED 201987c: 10 80 00 21 b 2019900 <== NOT EXECUTED 2019880: c2 07 bf fc ld [ %fp + -4 ], %g1 <== NOT EXECUTED fat_buf_mark_modified(fs_info); } else { *(sec_buf + ofs + 1) &= 0x00; 2019884: c2 07 bf fc ld [ %fp + -4 ], %g1 2019888: b8 07 20 01 inc %i4 *(sec_buf + ofs + 1) |= (uint8_t )((fat16_clv & 0xFF00)>>8); 201988c: b5 2e a0 14 sll %i2, 0x14, %i2 fat_buf_mark_modified(fs_info); } else { *(sec_buf + ofs + 1) &= 0x00; 2019890: c0 28 40 1c clrb [ %g1 + %i4 ] *(sec_buf + ofs + 1) |= (uint8_t )((fat16_clv & 0xFF00)>>8); 2019894: b5 36 a0 18 srl %i2, 0x18, %i2 2019898: 10 80 00 27 b 2019934 201989c: c2 07 bf fc ld [ %fp + -4 ], %g1 } } else { fat16_clv = ((uint16_t )in_val) & FAT_FAT12_MASK; *(sec_buf + ofs) &= 0x00; 20198a0: c0 28 40 1c clrb [ %g1 + %i4 ] *(sec_buf + ofs) |= (uint8_t)(fat16_clv & 0x00FF); 20198a4: 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; 20198a8: b4 0e af ff and %i2, 0xfff, %i2 *(sec_buf + ofs) &= 0x00; *(sec_buf + ofs) |= (uint8_t)(fat16_clv & 0x00FF); 20198ac: c4 08 40 1c ldub [ %g1 + %i4 ], %g2 20198b0: 84 10 80 1a or %g2, %i2, %g2 20198b4: c4 28 40 1c stb %g2, [ %g1 + %i4 ] fat_buf_mark_modified(fs_info); if ( ofs == (fs_info->vol.bps - 1) ) 20198b8: c2 17 40 00 lduh [ %i5 ], %g1 20198bc: 82 00 7f ff add %g1, -1, %g1 20198c0: 80 a7 00 01 cmp %i4, %g1 20198c4: 12 80 00 15 bne 2019918 <== ALWAYS TAKEN 20198c8: f6 2f 60 88 stb %i3, [ %i5 + 0x88 ] { rc = fat_buf_access(fs_info, sec + 1, FAT_OP_TYPE_READ, 20198cc: 90 10 00 1d mov %i5, %o0 <== NOT EXECUTED 20198d0: 92 04 20 01 add %l0, 1, %o1 <== NOT EXECUTED 20198d4: 94 10 20 01 mov 1, %o2 <== NOT EXECUTED 20198d8: 7f ff e5 9b call 2012f44 <== NOT EXECUTED 20198dc: 96 07 bf fc add %fp, -4, %o3 <== NOT EXECUTED &sec_buf); if (rc != RC_OK) 20198e0: b0 92 20 00 orcc %o0, 0, %i0 <== NOT EXECUTED 20198e4: 12 80 00 0b bne 2019910 <== NOT EXECUTED 20198e8: c2 07 bf fc ld [ %fp + -4 ], %g1 <== NOT EXECUTED return rc; *sec_buf &= 0xF0; *sec_buf |= (uint8_t)((fat16_clv & 0xFF00)>>8); 20198ec: 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; 20198f0: c4 08 40 00 ldub [ %g1 ], %g2 <== NOT EXECUTED 20198f4: 84 08 bf f0 and %g2, -16, %g2 <== NOT EXECUTED 20198f8: c4 28 40 00 stb %g2, [ %g1 ] <== NOT EXECUTED *sec_buf |= (uint8_t)((fat16_clv & 0xFF00)>>8); 20198fc: c2 07 bf fc ld [ %fp + -4 ], %g1 <== NOT EXECUTED 2019900: c4 08 40 00 ldub [ %g1 ], %g2 <== NOT EXECUTED 2019904: b4 16 80 02 or %i2, %g2, %i2 <== NOT EXECUTED 2019908: f4 28 40 00 stb %i2, [ %g1 ] <== NOT EXECUTED } static inline void fat_buf_mark_modified(fat_fs_info_t *fs_info) { fs_info->c.modified = true; 201990c: f6 2f 60 88 stb %i3, [ %i5 + 0x88 ] <== NOT EXECUTED 2019910: 81 c7 e0 08 ret <== NOT EXECUTED 2019914: 81 e8 00 00 restore <== NOT EXECUTED fat_buf_mark_modified(fs_info); } else { *(sec_buf + ofs + 1) &= 0xF0; 2019918: c2 07 bf fc ld [ %fp + -4 ], %g1 201991c: b8 07 20 01 inc %i4 2019920: c4 08 40 1c ldub [ %g1 + %i4 ], %g2 *(sec_buf + ofs+1) |= (uint8_t)((fat16_clv & 0xFF00)>>8); 2019924: b5 36 a0 08 srl %i2, 8, %i2 fat_buf_mark_modified(fs_info); } else { *(sec_buf + ofs + 1) &= 0xF0; 2019928: 84 08 bf f0 and %g2, -16, %g2 201992c: c4 28 40 1c stb %g2, [ %g1 + %i4 ] *(sec_buf + ofs+1) |= (uint8_t)((fat16_clv & 0xFF00)>>8); 2019930: c2 07 bf fc ld [ %fp + -4 ], %g1 2019934: c4 08 40 1c ldub [ %g1 + %i4 ], %g2 2019938: b4 10 80 1a or %g2, %i2, %i2 201993c: f4 28 40 1c stb %i2, [ %g1 + %i4 ] 2019940: 81 c7 e0 08 ret 2019944: 81 e8 00 00 restore break; } return RC_OK; } 2019948: 03 00 00 3f sethi %hi(0xfc00), %g1 201994c: 82 10 63 ff or %g1, 0x3ff, %g1 ! ffff 2019950: 82 0e 80 01 and %i2, %g1, %g1 } break; case FAT_FAT16: *((uint16_t *)(sec_buf + ofs)) = (uint16_t )(CT_LE_W(in_val)); 2019954: 83 28 60 08 sll %g1, 8, %g1 2019958: b5 2e a0 10 sll %i2, 0x10, %i2 201995c: b5 36 a0 18 srl %i2, 0x18, %i2 2019960: b4 10 40 1a or %g1, %i2, %i2 } } break; case FAT_FAT16: *((uint16_t *)(sec_buf + ofs)) = 2019964: c2 07 bf fc ld [ %fp + -4 ], %g1 2019968: 10 80 00 0a b 2019990 201996c: 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)); 2019970: 11 3c 00 00 sethi %hi(0xf0000000), %o0 2019974: 7f ff fe f2 call 201953c 2019978: 90 2e 80 08 andn %i2, %o0, %o0 *((uint32_t *)(sec_buf + ofs)) &= CT_LE_L(0xF0000000); 201997c: c2 07 bf fc ld [ %fp + -4 ], %g1 2019980: c4 00 40 1c ld [ %g1 + %i4 ], %g2 2019984: 84 08 a0 f0 and %g2, 0xf0, %g2 *((uint32_t *)(sec_buf + ofs)) |= fat32_clv; 2019988: 90 12 00 02 or %o0, %g2, %o0 201998c: d0 20 40 1c st %o0, [ %g1 + %i4 ] 2019990: 82 10 20 01 mov 1, %g1 2019994: c2 2f 60 88 stb %g1, [ %i5 + 0x88 ] 2019998: 81 c7 e0 08 ret 201999c: 81 e8 00 00 restore fat_buf_mark_modified(fs_info); break; default: rtems_set_errno_and_return_minus_one(EIO); 20199a0: 40 00 07 03 call 201b5ac <__errno> <== NOT EXECUTED 20199a4: b0 10 3f ff mov -1, %i0 <== NOT EXECUTED 20199a8: 82 10 20 05 mov 5, %g1 <== NOT EXECUTED 20199ac: c2 22 00 00 st %g1, [ %o0 ] <== NOT EXECUTED break; } return RC_OK; } 20199b0: 81 c7 e0 08 ret <== NOT EXECUTED 20199b4: 81 e8 00 00 restore <== NOT EXECUTED =============================================================================== 02013bf4 : * RC_OK on success, or -1 if error occured * and errno set appropriately */ int fat_shutdown_drive(fat_fs_info_t *fs_info) { 2013bf4: 9d e3 bf a0 save %sp, -96, %sp int rc = RC_OK; int i = 0; rc = fat_sync(fs_info); 2013bf8: 90 10 00 18 mov %i0, %o0 2013bfc: 7f ff ff ca call 2013b24 2013c00: ba 10 00 18 mov %i0, %i5 if ( rc != RC_OK ) 2013c04: b0 92 20 00 orcc %o0, 0, %i0 2013c08: 32 80 00 02 bne,a 2013c10 <== NEVER TAKEN 2013c0c: b0 10 3f ff mov -1, %i0 <== NOT EXECUTED rc = -1; 2013c10: b8 10 20 00 clr %i4 for (i = 0; i < FAT_HASH_SIZE; i++) { rtems_chain_node *node = NULL; rtems_chain_control *the_chain = fs_info->vhash + i; 2013c14: f6 07 60 6c ld [ %i5 + 0x6c ], %i3 while ( (node = rtems_chain_get(the_chain)) != NULL ) 2013c18: 10 80 00 04 b 2013c28 2013c1c: b6 06 c0 1c add %i3, %i4, %i3 free(node); 2013c20: 7f ff c5 cd call 2005354 <== NOT EXECUTED 2013c24: 01 00 00 00 nop <== NOT EXECUTED */ RTEMS_INLINE_ROUTINE rtems_chain_node *rtems_chain_get( rtems_chain_control *the_chain ) { return _Chain_Get( the_chain ); 2013c28: 7f ff d9 ed call 200a3dc <_Chain_Get> 2013c2c: 90 10 00 1b mov %i3, %o0 for (i = 0; i < FAT_HASH_SIZE; i++) { rtems_chain_node *node = NULL; rtems_chain_control *the_chain = fs_info->vhash + i; while ( (node = rtems_chain_get(the_chain)) != NULL ) 2013c30: 80 a2 20 00 cmp %o0, 0 2013c34: 12 bf ff fb bne 2013c20 <== NEVER TAKEN 2013c38: 01 00 00 00 nop 2013c3c: b8 07 20 0c add %i4, 0xc, %i4 rc = fat_sync(fs_info); if ( rc != RC_OK ) rc = -1; for (i = 0; i < FAT_HASH_SIZE; i++) 2013c40: 80 a7 20 18 cmp %i4, 0x18 2013c44: 32 bf ff f5 bne,a 2013c18 2013c48: f6 07 60 6c ld [ %i5 + 0x6c ], %i3 2013c4c: b8 10 20 00 clr %i4 } for (i = 0; i < FAT_HASH_SIZE; i++) { rtems_chain_node *node = NULL; rtems_chain_control *the_chain = fs_info->rhash + i; 2013c50: f6 07 60 70 ld [ %i5 + 0x70 ], %i3 while ( (node = rtems_chain_get(the_chain)) != NULL ) 2013c54: 10 80 00 04 b 2013c64 2013c58: b6 06 c0 1c add %i3, %i4, %i3 free(node); 2013c5c: 7f ff c5 be call 2005354 <== NOT EXECUTED 2013c60: 01 00 00 00 nop <== NOT EXECUTED 2013c64: 7f ff d9 de call 200a3dc <_Chain_Get> 2013c68: 90 10 00 1b mov %i3, %o0 for (i = 0; i < FAT_HASH_SIZE; i++) { rtems_chain_node *node = NULL; rtems_chain_control *the_chain = fs_info->rhash + i; while ( (node = rtems_chain_get(the_chain)) != NULL ) 2013c6c: 80 a2 20 00 cmp %o0, 0 2013c70: 12 bf ff fb bne 2013c5c <== NEVER TAKEN 2013c74: 01 00 00 00 nop 2013c78: b8 07 20 0c add %i4, 0xc, %i4 while ( (node = rtems_chain_get(the_chain)) != NULL ) free(node); } for (i = 0; i < FAT_HASH_SIZE; i++) 2013c7c: 80 a7 20 18 cmp %i4, 0x18 2013c80: 32 bf ff f5 bne,a 2013c54 2013c84: f6 07 60 70 ld [ %i5 + 0x70 ], %i3 while ( (node = rtems_chain_get(the_chain)) != NULL ) free(node); } free(fs_info->vhash); 2013c88: 7f ff c5 b3 call 2005354 2013c8c: d0 07 60 6c ld [ %i5 + 0x6c ], %o0 free(fs_info->rhash); 2013c90: 7f ff c5 b1 call 2005354 2013c94: d0 07 60 70 ld [ %i5 + 0x70 ], %o0 free(fs_info->uino); 2013c98: 7f ff c5 af call 2005354 2013c9c: d0 07 60 74 ld [ %i5 + 0x74 ], %o0 free(fs_info->sec_buf); 2013ca0: 7f ff c5 ad call 2005354 2013ca4: d0 07 60 90 ld [ %i5 + 0x90 ], %o0 close(fs_info->vol.fd); 2013ca8: 7f ff c4 ee call 2005060 2013cac: d0 07 60 60 ld [ %i5 + 0x60 ], %o0 if (rc) 2013cb0: 80 a6 20 00 cmp %i0, 0 2013cb4: 02 80 00 06 be 2013ccc <== ALWAYS TAKEN 2013cb8: 01 00 00 00 nop errno = EIO; 2013cbc: 40 00 1e 3c call 201b5ac <__errno> <== NOT EXECUTED 2013cc0: 01 00 00 00 nop <== NOT EXECUTED 2013cc4: 82 10 20 05 mov 5, %g1 ! 5 <== NOT EXECUTED 2013cc8: c2 22 00 00 st %g1, [ %o0 ] <== NOT EXECUTED return rc; } 2013ccc: 81 c7 e0 08 ret 2013cd0: 81 e8 00 00 restore =============================================================================== 02013b24 : return RC_OK; } int fat_sync(fat_fs_info_t *fs_info) { 2013b24: 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) 2013b28: c4 0e 20 0e ldub [ %i0 + 0xe ], %g2 return RC_OK; } int fat_sync(fat_fs_info_t *fs_info) { 2013b2c: 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; 2013b30: 90 10 20 00 clr %o0 if (fs_info->vol.type == FAT_FAT32) 2013b34: 80 a0 a0 04 cmp %g2, 4 2013b38: 12 80 00 20 bne 2013bb8 2013b3c: b4 10 20 00 clr %i2 { uint32_t free_count = fs_info->vol.free_cls; 2013b40: f6 06 20 44 ld [ %i0 + 0x44 ], %i3 uint32_t next_free = fs_info->vol.next_cl; if (free_count != fs_info->vol.free_cls_in_fs_info) 2013b44: c2 06 20 48 ld [ %i0 + 0x48 ], %g1 2013b48: 80 a6 c0 01 cmp %i3, %g1 2013b4c: 02 80 00 0d be 2013b80 <== ALWAYS TAKEN 2013b50: f8 06 20 4c ld [ %i0 + 0x4c ], %i4 { uint32_t le_free_count = CT_LE_L(free_count); 2013b54: 7f ff fc 65 call 2012ce8 <== NOT EXECUTED 2013b58: 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, 2013b5c: d2 16 20 40 lduh [ %i0 + 0x40 ], %o1 <== NOT EXECUTED uint32_t free_count = fs_info->vol.free_cls; uint32_t next_free = fs_info->vol.next_cl; if (free_count != fs_info->vol.free_cls_in_fs_info) { uint32_t le_free_count = CT_LE_L(free_count); 2013b60: d0 27 bf fc st %o0, [ %fp + -4 ] <== NOT EXECUTED fs_info->vol.free_cls_in_fs_info = free_count; 2013b64: f6 26 20 48 st %i3, [ %i0 + 0x48 ] <== NOT EXECUTED ret1 = fat_sector_write(fs_info, 2013b68: 90 10 00 18 mov %i0, %o0 <== NOT EXECUTED 2013b6c: 94 10 21 e8 mov 0x1e8, %o2 <== NOT EXECUTED 2013b70: 96 10 20 04 mov 4, %o3 <== NOT EXECUTED 2013b74: 7f ff fd 43 call 2013080 <== NOT EXECUTED 2013b78: 98 07 bf fc add %fp, -4, %o4 <== NOT EXECUTED 2013b7c: b4 10 00 08 mov %o0, %i2 <== NOT EXECUTED FAT_FSINFO_FREE_CLUSTER_COUNT_OFFSET, sizeof(le_free_count), &le_free_count); } if (next_free != fs_info->vol.next_cl_in_fs_info) 2013b80: c4 07 60 50 ld [ %i5 + 0x50 ], %g2 2013b84: 80 a7 00 02 cmp %i4, %g2 2013b88: 02 80 00 0c be 2013bb8 <== NEVER TAKEN 2013b8c: 90 10 20 00 clr %o0 { uint32_t le_next_free = CT_LE_L(next_free); 2013b90: 7f ff fc 56 call 2012ce8 2013b94: 90 10 00 1c mov %i4, %o0 fs_info->vol.next_cl_in_fs_info = next_free; ret2 = fat_sector_write(fs_info, 2013b98: 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); 2013b9c: d0 27 bf fc st %o0, [ %fp + -4 ] fs_info->vol.next_cl_in_fs_info = next_free; 2013ba0: f8 27 60 50 st %i4, [ %i5 + 0x50 ] ret2 = fat_sector_write(fs_info, 2013ba4: 90 10 00 1d mov %i5, %o0 2013ba8: 94 10 21 ec mov 0x1ec, %o2 2013bac: 96 10 20 04 mov 4, %o3 2013bb0: 7f ff fd 34 call 2013080 2013bb4: 98 07 bf fc add %fp, -4, %o4 sizeof(le_next_free), &le_next_free); } } if ( (ret1 < 0) || (ret2 < 0) ) 2013bb8: 80 a2 20 00 cmp %o0, 0 2013bbc: 06 80 00 04 bl 2013bcc <== NEVER TAKEN 2013bc0: 80 a6 a0 00 cmp %i2, 0 2013bc4: 16 80 00 03 bge 2013bd0 <== ALWAYS TAKEN 2013bc8: b0 10 20 00 clr %i0 { int rc = RC_OK; rc = fat_fat32_update_fsinfo_sector(fs_info); if ( rc != RC_OK ) rc = -1; 2013bcc: b0 10 3f ff mov -1, %i0 <== NOT EXECUTED fat_buf_release(fs_info); 2013bd0: 7f ff fc 69 call 2012d74 2013bd4: 90 10 00 1d mov %i5, %o0 if (rtems_bdbuf_syncdev(fs_info->vol.dd) != RTEMS_SUCCESSFUL) 2013bd8: 7f ff f5 bb call 20112c4 2013bdc: d0 07 60 64 ld [ %i5 + 0x64 ], %o0 2013be0: 80 a2 20 00 cmp %o0, 0 2013be4: 32 80 00 02 bne,a 2013bec <== NEVER TAKEN 2013be8: b0 10 3f ff mov -1, %i0 <== NOT EXECUTED rc = -1; return rc; } 2013bec: 81 c7 e0 08 ret 2013bf0: 81 e8 00 00 restore =============================================================================== 02032668 : /** * compatible with SVr4, 4.4BSD and X/OPEN - Change Directory */ int fchdir( int fd ) { 2032668: 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 ); 203266c: 03 00 81 77 sethi %hi(0x205dc00), %g1 2032670: c2 00 61 10 ld [ %g1 + 0x110 ], %g1 ! 205dd10 int rv = 0; rtems_libio_t *iop; struct stat st; rtems_filesystem_location_info_t loc; st.st_mode = 0; 2032674: c0 27 bf c4 clr [ %fp + -60 ] st.st_uid = 0; 2032678: c0 37 bf ca clrh [ %fp + -54 ] st.st_gid = 0; rtems_libio_check_fd( fd ); 203267c: 80 a6 00 01 cmp %i0, %g1 2032680: 1a 80 00 0c bcc 20326b0 2032684: c0 37 bf cc clrh [ %fp + -52 ] iop = rtems_libio_iop( fd ); 2032688: 83 2e 20 03 sll %i0, 3, %g1 203268c: b1 2e 20 06 sll %i0, 6, %i0 2032690: b0 26 00 01 sub %i0, %g1, %i0 2032694: 03 00 81 87 sethi %hi(0x2061c00), %g1 2032698: fa 00 62 b4 ld [ %g1 + 0x2b4 ], %i5 ! 2061eb4 203269c: ba 07 40 18 add %i5, %i0, %i5 rtems_libio_check_is_open( iop ); 20326a0: c2 07 60 10 ld [ %i5 + 0x10 ], %g1 20326a4: 80 88 61 00 btst 0x100, %g1 20326a8: 32 80 00 08 bne,a 20326c8 20326ac: d0 07 60 28 ld [ %i5 + 0x28 ], %o0 20326b0: 40 00 10 e9 call 2036a54 <__errno> 20326b4: b0 10 3f ff mov -1, %i0 20326b8: 82 10 20 09 mov 9, %g1 20326bc: c2 22 00 00 st %g1, [ %o0 ] 20326c0: 81 c7 e0 08 ret 20326c4: 81 e8 00 00 restore 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 ); 20326c8: c2 02 20 0c ld [ %o0 + 0xc ], %g1 20326cc: c2 00 40 00 ld [ %g1 ], %g1 20326d0: 9f c0 40 00 call %g1 20326d4: b8 07 60 14 add %i5, 0x14, %i4 rtems_filesystem_instance_lock( &iop->pathinfo ); rv = (*iop->pathinfo.handlers->fstat_h)( &iop->pathinfo, &st ); 20326d8: c2 07 60 24 ld [ %i5 + 0x24 ], %g1 20326dc: 90 10 00 1c mov %i4, %o0 20326e0: c2 00 60 18 ld [ %g1 + 0x18 ], %g1 20326e4: 9f c0 40 00 call %g1 20326e8: 92 07 bf b8 add %fp, -72, %o1 if ( rv == 0 ) { 20326ec: b0 92 20 00 orcc %o0, 0, %i0 20326f0: 32 80 00 13 bne,a 203273c <== NEVER TAKEN 20326f4: d0 07 60 28 ld [ %i5 + 0x28 ], %o0 <== NOT EXECUTED bool access_ok = rtems_filesystem_check_access( 20326f8: d2 07 bf c4 ld [ %fp + -60 ], %o1 20326fc: d4 17 bf ca lduh [ %fp + -54 ], %o2 2032700: d6 17 bf cc lduh [ %fp + -52 ], %o3 2032704: 7f ff 6e da call 200e26c 2032708: 90 10 20 01 mov 1, %o0 st.st_mode, st.st_uid, st.st_gid ); if ( access_ok ) { 203270c: 80 8a 20 ff btst 0xff, %o0 2032710: 02 80 00 06 be 2032728 2032714: 90 07 bf a0 add %fp, -96, %o0 rtems_filesystem_location_clone( &loc, &iop->pathinfo ); 2032718: 7f ff 6d 8e call 200dd50 203271c: 92 10 00 1c mov %i4, %o1 static inline void rtems_filesystem_instance_unlock( const rtems_filesystem_location_info_t *loc ) { const rtems_filesystem_mount_table_entry_t *mt_entry = loc->mt_entry; 2032720: 10 80 00 07 b 203273c 2032724: d0 07 60 28 ld [ %i5 + 0x28 ], %o0 } else { errno = EACCES; 2032728: 40 00 10 cb call 2036a54 <__errno> 203272c: b0 10 3f ff mov -1, %i0 2032730: 82 10 20 0d mov 0xd, %g1 2032734: c2 22 00 00 st %g1, [ %o0 ] 2032738: d0 07 60 28 ld [ %i5 + 0x28 ], %o0 (*mt_entry->ops->unlock_h)( mt_entry ); 203273c: c2 02 20 0c ld [ %o0 + 0xc ], %g1 2032740: c2 00 60 04 ld [ %g1 + 4 ], %g1 2032744: 9f c0 40 00 call %g1 2032748: 01 00 00 00 nop rv = -1; } } rtems_filesystem_instance_unlock( &iop->pathinfo ); if ( rv == 0 ) { 203274c: 80 a6 20 00 cmp %i0, 0 2032750: 12 80 00 05 bne 2032764 2032754: 01 00 00 00 nop rv = rtems_filesystem_chdir( &loc ); 2032758: 7f ff c4 69 call 20238fc 203275c: 90 07 bf a0 add %fp, -96, %o0 2032760: b0 10 00 08 mov %o0, %i0 } return rv; } 2032764: 81 c7 e0 08 ret 2032768: 81 e8 00 00 restore =============================================================================== 02023be4 : /** * POSIX 1003.1b 5.6.4 - Change File Modes */ int fchmod( int fd, mode_t mode ) { 2023be4: 9d e3 bf a0 save %sp, -96, %sp int rv; rtems_libio_t *iop; rtems_libio_check_fd( fd ); 2023be8: 03 00 81 77 sethi %hi(0x205dc00), %g1 2023bec: c2 00 61 10 ld [ %g1 + 0x110 ], %g1 ! 205dd10 2023bf0: 80 a6 00 01 cmp %i0, %g1 2023bf4: 2a 80 00 03 bcs,a 2023c00 2023bf8: 83 2e 20 03 sll %i0, 3, %g1 2023bfc: 30 80 00 0a b,a 2023c24 iop = rtems_libio_iop( fd ); 2023c00: b1 2e 20 06 sll %i0, 6, %i0 2023c04: b0 26 00 01 sub %i0, %g1, %i0 2023c08: 03 00 81 87 sethi %hi(0x2061c00), %g1 2023c0c: fa 00 62 b4 ld [ %g1 + 0x2b4 ], %i5 ! 2061eb4 2023c10: ba 07 40 18 add %i5, %i0, %i5 rtems_libio_check_is_open(iop); 2023c14: c2 07 60 10 ld [ %i5 + 0x10 ], %g1 2023c18: 80 88 61 00 btst 0x100, %g1 2023c1c: 32 80 00 06 bne,a 2023c34 2023c20: d0 07 60 28 ld [ %i5 + 0x28 ], %o0 2023c24: 40 00 4b 8c call 2036a54 <__errno> 2023c28: 01 00 00 00 nop 2023c2c: 10 80 00 1b b 2023c98 2023c30: 82 10 20 09 mov 9, %g1 ! 9 if (iop->pathinfo.mt_entry->writeable) { 2023c34: c2 0a 20 29 ldub [ %o0 + 0x29 ], %g1 2023c38: 80 a0 60 00 cmp %g1, 0 2023c3c: 02 80 00 14 be 2023c8c <== NEVER TAKEN 2023c40: 01 00 00 00 nop const rtems_filesystem_location_info_t *loc ) { const rtems_filesystem_mount_table_entry_t *mt_entry = loc->mt_entry; (*mt_entry->ops->lock_h)( mt_entry ); 2023c44: c2 02 20 0c ld [ %o0 + 0xc ], %g1 2023c48: c2 00 40 00 ld [ %g1 ], %g1 2023c4c: 9f c0 40 00 call %g1 2023c50: 01 00 00 00 nop rtems_filesystem_instance_lock( &iop->pathinfo ); rv = (*iop->pathinfo.mt_entry->ops->fchmod_h)( &iop->pathinfo, mode ); 2023c54: c2 07 60 28 ld [ %i5 + 0x28 ], %g1 2023c58: 90 07 60 14 add %i5, 0x14, %o0 2023c5c: c2 00 60 0c ld [ %g1 + 0xc ], %g1 2023c60: c2 00 60 20 ld [ %g1 + 0x20 ], %g1 2023c64: 9f c0 40 00 call %g1 2023c68: 92 10 00 19 mov %i1, %o1 2023c6c: b0 10 00 08 mov %o0, %i0 static inline void rtems_filesystem_instance_unlock( const rtems_filesystem_location_info_t *loc ) { const rtems_filesystem_mount_table_entry_t *mt_entry = loc->mt_entry; 2023c70: d0 07 60 28 ld [ %i5 + 0x28 ], %o0 (*mt_entry->ops->unlock_h)( mt_entry ); 2023c74: c2 02 20 0c ld [ %o0 + 0xc ], %g1 2023c78: c2 00 60 04 ld [ %g1 + 4 ], %g1 2023c7c: 9f c0 40 00 call %g1 2023c80: 01 00 00 00 nop 2023c84: 81 c7 e0 08 ret 2023c88: 81 e8 00 00 restore rtems_filesystem_instance_unlock( &iop->pathinfo ); } else { errno = EROFS; 2023c8c: 40 00 4b 72 call 2036a54 <__errno> <== NOT EXECUTED 2023c90: 01 00 00 00 nop <== NOT EXECUTED 2023c94: 82 10 20 1e mov 0x1e, %g1 ! 1e <== NOT EXECUTED 2023c98: c2 22 00 00 st %g1, [ %o0 ] rv = -1; } return rv; } 2023c9c: 81 c7 e0 08 ret 2023ca0: 91 e8 3f ff restore %g0, -1, %o0 =============================================================================== 02023ca4 : /** * POSIX 1003.1b 5.6.5 - Change Owner and Group of a File */ int fchown( int fd, uid_t owner, gid_t group ) { 2023ca4: 9d e3 bf a0 save %sp, -96, %sp int rv = 0; rtems_libio_t *iop; rtems_libio_check_fd( fd ); 2023ca8: 03 00 81 77 sethi %hi(0x205dc00), %g1 2023cac: c2 00 61 10 ld [ %g1 + 0x110 ], %g1 ! 205dd10 2023cb0: 80 a6 00 01 cmp %i0, %g1 2023cb4: 2a 80 00 03 bcs,a 2023cc0 2023cb8: 83 2e 20 03 sll %i0, 3, %g1 2023cbc: 30 80 00 0a b,a 2023ce4 iop = rtems_libio_iop( fd ); 2023cc0: b1 2e 20 06 sll %i0, 6, %i0 2023cc4: b0 26 00 01 sub %i0, %g1, %i0 2023cc8: 03 00 81 87 sethi %hi(0x2061c00), %g1 2023ccc: fa 00 62 b4 ld [ %g1 + 0x2b4 ], %i5 ! 2061eb4 2023cd0: ba 07 40 18 add %i5, %i0, %i5 rtems_libio_check_is_open(iop); 2023cd4: c2 07 60 10 ld [ %i5 + 0x10 ], %g1 2023cd8: 80 88 61 00 btst 0x100, %g1 2023cdc: 32 80 00 06 bne,a 2023cf4 2023ce0: d0 07 60 28 ld [ %i5 + 0x28 ], %o0 2023ce4: 40 00 4b 5c call 2036a54 <__errno> 2023ce8: 01 00 00 00 nop 2023cec: 10 80 00 1c b 2023d5c 2023cf0: 82 10 20 09 mov 9, %g1 ! 9 if (iop->pathinfo.mt_entry->writeable) { 2023cf4: c2 0a 20 29 ldub [ %o0 + 0x29 ], %g1 2023cf8: 80 a0 60 00 cmp %g1, 0 2023cfc: 02 80 00 15 be 2023d50 <== NEVER TAKEN 2023d00: 01 00 00 00 nop const rtems_filesystem_location_info_t *loc ) { const rtems_filesystem_mount_table_entry_t *mt_entry = loc->mt_entry; (*mt_entry->ops->lock_h)( mt_entry ); 2023d04: c2 02 20 0c ld [ %o0 + 0xc ], %g1 2023d08: c2 00 40 00 ld [ %g1 ], %g1 2023d0c: 9f c0 40 00 call %g1 2023d10: 01 00 00 00 nop rtems_filesystem_instance_lock( &iop->pathinfo ); rv = (*iop->pathinfo.mt_entry->ops->chown_h)( 2023d14: c2 07 60 28 ld [ %i5 + 0x28 ], %g1 2023d18: 90 07 60 14 add %i5, 0x14, %o0 2023d1c: c2 00 60 0c ld [ %g1 + 0xc ], %g1 2023d20: 92 10 00 19 mov %i1, %o1 2023d24: c2 00 60 24 ld [ %g1 + 0x24 ], %g1 2023d28: 9f c0 40 00 call %g1 2023d2c: 94 10 00 1a mov %i2, %o2 2023d30: b0 10 00 08 mov %o0, %i0 static inline void rtems_filesystem_instance_unlock( const rtems_filesystem_location_info_t *loc ) { const rtems_filesystem_mount_table_entry_t *mt_entry = loc->mt_entry; 2023d34: d0 07 60 28 ld [ %i5 + 0x28 ], %o0 (*mt_entry->ops->unlock_h)( mt_entry ); 2023d38: c2 02 20 0c ld [ %o0 + 0xc ], %g1 2023d3c: c2 00 60 04 ld [ %g1 + 4 ], %g1 2023d40: 9f c0 40 00 call %g1 2023d44: 01 00 00 00 nop 2023d48: 81 c7 e0 08 ret 2023d4c: 81 e8 00 00 restore owner, group ); rtems_filesystem_instance_unlock( &iop->pathinfo ); } else { errno = EROFS; 2023d50: 40 00 4b 41 call 2036a54 <__errno> <== NOT EXECUTED 2023d54: 01 00 00 00 nop <== NOT EXECUTED 2023d58: 82 10 20 1e mov 0x1e, %g1 ! 1e <== NOT EXECUTED 2023d5c: c2 22 00 00 st %g1, [ %o0 ] rv = -1; } return rv; } 2023d60: 81 c7 e0 08 ret 2023d64: 91 e8 3f ff restore %g0, -1, %o0 =============================================================================== 0202f720 : int fcntl( int fd, int cmd, ... ) { 202f720: 9d e3 bf 98 save %sp, -104, %sp int fd2; int flags; int mask; int ret = 0; rtems_libio_check_fd( fd ); 202f724: 05 00 80 d7 sethi %hi(0x2035c00), %g2 202f728: c4 00 a0 8c ld [ %g2 + 0x8c ], %g2 ! 2035c8c ... ) { int ret; va_list ap; va_start( ap, cmd ); 202f72c: 82 07 a0 4c add %fp, 0x4c, %g1 202f730: f4 27 a0 4c st %i2, [ %fp + 0x4c ] 202f734: f6 27 a0 50 st %i3, [ %fp + 0x50 ] 202f738: f8 27 a0 54 st %i4, [ %fp + 0x54 ] 202f73c: fa 27 a0 58 st %i5, [ %fp + 0x58 ] int fd2; int flags; int mask; int ret = 0; rtems_libio_check_fd( fd ); 202f740: 80 a6 00 02 cmp %i0, %g2 202f744: 1a 80 00 0c bcc 202f774 202f748: c2 27 bf fc st %g1, [ %fp + -4 ] iop = rtems_libio_iop( fd ); 202f74c: 85 2e 20 03 sll %i0, 3, %g2 202f750: b1 2e 20 06 sll %i0, 6, %i0 202f754: b0 26 00 02 sub %i0, %g2, %i0 202f758: 05 00 81 1a sethi %hi(0x2046800), %g2 202f75c: fa 00 a0 38 ld [ %g2 + 0x38 ], %i5 ! 2046838 202f760: ba 07 40 18 add %i5, %i0, %i5 rtems_libio_check_is_open(iop); 202f764: d0 07 60 10 ld [ %i5 + 0x10 ], %o0 202f768: 80 8a 21 00 btst 0x100, %o0 202f76c: 12 80 00 06 bne 202f784 202f770: 80 a6 60 09 cmp %i1, 9 202f774: 7f ff c4 ab call 2020a20 <__errno> 202f778: 01 00 00 00 nop 202f77c: 10 80 00 5d b 202f8f0 202f780: 82 10 20 09 mov 9, %g1 ! 9 /* * This switch should contain all the cases from POSIX. */ switch ( cmd ) { 202f784: 18 80 00 58 bgu 202f8e4 202f788: 85 2e 60 02 sll %i1, 2, %g2 202f78c: 07 00 80 bd sethi %hi(0x202f400), %g3 202f790: 86 10 e2 f8 or %g3, 0x2f8, %g3 ! 202f6f8 <_calloc_r+0x14> 202f794: c4 00 c0 02 ld [ %g3 + %g2 ], %g2 202f798: 81 c0 80 00 jmp %g2 202f79c: 01 00 00 00 nop /* * FIXME: We ignore the start value fd2 for the file descriptor search. This * is not POSIX conform. */ rtems_libio_t *diop = rtems_libio_allocate(); 202f7a0: 7f ff 63 05 call 20083b4 202f7a4: 01 00 00 00 nop if (diop != NULL) { 202f7a8: b8 92 20 00 orcc %o0, 0, %i4 202f7ac: 02 80 00 62 be 202f934 202f7b0: b0 10 3f ff mov -1, %i0 int oflag = rtems_libio_to_fcntl_flags( iop->flags ); 202f7b4: 7f ff 62 ea call 200835c 202f7b8: d0 07 60 10 ld [ %i5 + 0x10 ], %o0 oflag &= ~O_CREAT; diop->flags |= rtems_libio_fcntl_flags( oflag ); 202f7bc: f4 07 20 10 ld [ %i4 + 0x10 ], %i2 rtems_libio_t *diop = rtems_libio_allocate(); if (diop != NULL) { int oflag = rtems_libio_to_fcntl_flags( iop->flags ); oflag &= ~O_CREAT; 202f7c0: b6 0a 3d ff and %o0, -513, %i3 diop->flags |= rtems_libio_fcntl_flags( oflag ); 202f7c4: 7f ff 62 d9 call 2008328 202f7c8: 90 10 00 1b mov %i3, %o0 202f7cc: 90 12 00 1a or %o0, %i2, %o0 202f7d0: d0 27 20 10 st %o0, [ %i4 + 0x10 ] static inline void rtems_filesystem_instance_lock( const rtems_filesystem_location_info_t *loc ) { const rtems_filesystem_mount_table_entry_t *mt_entry = loc->mt_entry; 202f7d4: d0 07 60 28 ld [ %i5 + 0x28 ], %o0 (*mt_entry->ops->lock_h)( mt_entry ); 202f7d8: c2 02 20 0c ld [ %o0 + 0xc ], %g1 202f7dc: c2 00 40 00 ld [ %g1 ], %g1 202f7e0: 9f c0 40 00 call %g1 202f7e4: 01 00 00 00 nop rtems_filesystem_instance_lock( &iop->pathinfo ); rtems_filesystem_location_clone( &diop->pathinfo, &iop->pathinfo ); 202f7e8: 92 07 60 14 add %i5, 0x14, %o1 202f7ec: 7f ff 9d 20 call 2016c6c 202f7f0: 90 07 20 14 add %i4, 0x14, %o0 static inline void rtems_filesystem_instance_unlock( const rtems_filesystem_location_info_t *loc ) { const rtems_filesystem_mount_table_entry_t *mt_entry = loc->mt_entry; 202f7f4: d0 07 60 28 ld [ %i5 + 0x28 ], %o0 (*mt_entry->ops->unlock_h)( mt_entry ); 202f7f8: c2 02 20 0c ld [ %o0 + 0xc ], %g1 202f7fc: c2 00 60 04 ld [ %g1 + 4 ], %g1 202f800: 9f c0 40 00 call %g1 202f804: 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 ); 202f808: c2 07 20 24 ld [ %i4 + 0x24 ], %g1 202f80c: 90 10 00 1c mov %i4, %o0 202f810: c2 00 40 00 ld [ %g1 ], %g1 202f814: 92 10 20 00 clr %o1 202f818: 94 10 00 1b mov %i3, %o2 202f81c: 9f c0 40 00 call %g1 202f820: 96 10 20 00 clr %o3 if ( rv == 0 ) { 202f824: b0 92 20 00 orcc %o0, 0, %i0 202f828: 12 80 00 11 bne 202f86c <== NEVER TAKEN 202f82c: 03 00 81 1a sethi %hi(0x2046800), %g1 rv = diop - rtems_libio_iops; 202f830: f0 00 60 38 ld [ %g1 + 0x38 ], %i0 ! 2046838 202f834: b8 27 00 18 sub %i4, %i0, %i4 202f838: b9 3f 20 03 sra %i4, 3, %i4 202f83c: 85 2f 20 03 sll %i4, 3, %g2 202f840: 83 2f 20 06 sll %i4, 6, %g1 202f844: 82 00 80 01 add %g2, %g1, %g1 202f848: 85 28 60 06 sll %g1, 6, %g2 202f84c: 82 00 40 02 add %g1, %g2, %g1 202f850: 82 00 40 1c add %g1, %i4, %g1 202f854: b1 28 60 0f sll %g1, 0xf, %i0 202f858: 82 00 40 18 add %g1, %i0, %g1 202f85c: 83 28 60 03 sll %g1, 3, %g1 202f860: b8 00 40 1c add %g1, %i4, %i4 202f864: 10 80 00 25 b 202f8f8 202f868: b0 20 00 1c neg %i4, %i0 } else { rtems_libio_free( diop ); 202f86c: 7f ff 62 e9 call 2008410 <== NOT EXECUTED 202f870: 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) { 202f874: 10 80 00 22 b 202f8fc <== NOT EXECUTED 202f878: 80 a6 20 00 cmp %i0, 0 <== NOT EXECUTED fd2 = va_arg( ap, int ); ret = duplicate_iop( iop, fd2 ); break; case F_GETFD: /* get f_flags */ ret = ((iop->flags & LIBIO_FLAGS_CLOSE_ON_EXEC) != 0); 202f87c: b1 32 20 0b srl %o0, 0xb, %i0 202f880: 10 80 00 21 b 202f904 202f884: 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 ) ) 202f888: c2 00 40 00 ld [ %g1 ], %g1 202f88c: 80 a0 60 00 cmp %g1, 0 202f890: 22 80 00 0e be,a 202f8c8 202f894: 90 0a 37 ff and %o0, -2049, %o0 iop->flags |= LIBIO_FLAGS_CLOSE_ON_EXEC; 202f898: 10 80 00 0c b 202f8c8 202f89c: 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 ); 202f8a0: 7f ff 62 af call 200835c 202f8a4: 01 00 00 00 nop 202f8a8: 10 80 00 14 b 202f8f8 202f8ac: b0 10 00 08 mov %o0, %i0 break; case F_SETFL: flags = rtems_libio_fcntl_flags( va_arg( ap, int ) ); 202f8b0: 7f ff 62 9e call 2008328 202f8b4: 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); 202f8b8: c2 07 60 10 ld [ %i5 + 0x10 ], %g1 202f8bc: 90 0a 22 01 and %o0, 0x201, %o0 202f8c0: 82 08 7d fe and %g1, -514, %g1 202f8c4: 90 12 00 01 or %o0, %g1, %o0 202f8c8: d0 27 60 10 st %o0, [ %i5 + 0x10 ] { rtems_libio_t *iop; int fd2; int flags; int mask; int ret = 0; 202f8cc: 10 80 00 0e b 202f904 202f8d0: b0 10 20 00 clr %i0 errno = ENOTSUP; ret = -1; break; case F_GETOWN: /* for sockets. */ errno = ENOTSUP; 202f8d4: 7f ff c4 53 call 2020a20 <__errno> 202f8d8: 01 00 00 00 nop 202f8dc: 10 80 00 05 b 202f8f0 202f8e0: 82 10 20 86 mov 0x86, %g1 ! 86 ret = -1; break; default: errno = EINVAL; 202f8e4: 7f ff c4 4f call 2020a20 <__errno> 202f8e8: 01 00 00 00 nop 202f8ec: 82 10 20 16 mov 0x16, %g1 ! 16 202f8f0: 10 80 00 10 b 202f930 202f8f4: 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) { 202f8f8: 80 a6 20 00 cmp %i0, 0 202f8fc: 06 80 00 0e bl 202f934 <== NEVER TAKEN 202f900: 01 00 00 00 nop int err = (*iop->pathinfo.handlers->fcntl_h)( iop, cmd ); 202f904: c2 07 60 24 ld [ %i5 + 0x24 ], %g1 202f908: 90 10 00 1d mov %i5, %o0 202f90c: c2 00 60 28 ld [ %g1 + 0x28 ], %g1 202f910: 9f c0 40 00 call %g1 202f914: 92 10 00 19 mov %i1, %o1 if (err) { 202f918: ba 92 20 00 orcc %o0, 0, %i5 202f91c: 02 80 00 06 be 202f934 <== ALWAYS TAKEN 202f920: 01 00 00 00 nop errno = err; 202f924: 7f ff c4 3f call 2020a20 <__errno> <== NOT EXECUTED 202f928: 01 00 00 00 nop <== NOT EXECUTED 202f92c: fa 22 00 00 st %i5, [ %o0 ] <== NOT EXECUTED int mask; int ret = 0; rtems_libio_check_fd( fd ); iop = rtems_libio_iop( fd ); rtems_libio_check_is_open(iop); 202f930: b0 10 3f ff mov -1, %i0 va_list ap; va_start( ap, cmd ); ret = vfcntl(fd,cmd,ap); va_end(ap); return ret; } 202f934: 81 c7 e0 08 ret 202f938: 81 e8 00 00 restore =============================================================================== 0200dd0c : int fifo_open( pipe_control_t **pipep, rtems_libio_t *iop ) { 200dd0c: 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) { 200dd10: 3b 00 80 8c sethi %hi(0x2023000), %i5 200dd14: c2 07 61 80 ld [ %i5 + 0x180 ], %g1 ! 2023180 int fifo_open( pipe_control_t **pipep, rtems_libio_t *iop ) { 200dd18: b6 10 00 18 mov %i0, %i3 static int pipe_lock(void) { rtems_status_code sc = RTEMS_SUCCESSFUL; if (pipe_semaphore == RTEMS_ID_NONE) { 200dd1c: 80 a0 60 00 cmp %g1, 0 200dd20: 02 80 00 0c be 200dd50 200dd24: b8 17 61 80 or %i5, 0x180, %i4 rtems_libio_unlock(); } if (sc == RTEMS_SUCCESSFUL) { sc = rtems_semaphore_obtain(pipe_semaphore, RTEMS_WAIT, RTEMS_NO_TIMEOUT); 200dd28: 03 00 80 8c sethi %hi(0x2023000), %g1 200dd2c: d0 00 61 80 ld [ %g1 + 0x180 ], %o0 ! 2023180 200dd30: 92 10 20 00 clr %o1 200dd34: 7f ff ec 88 call 2008f54 200dd38: 94 10 20 00 clr %o2 } if (sc == RTEMS_SUCCESSFUL) { 200dd3c: 80 a2 20 00 cmp %o0, 0 200dd40: 22 80 01 00 be,a 200e140 <== ALWAYS TAKEN 200dd44: fa 06 c0 00 ld [ %i3 ], %i5 return 0; } else { return -ENOMEM; 200dd48: 81 c7 e0 08 ret <== NOT EXECUTED 200dd4c: 91 e8 3f f4 restore %g0, -12, %o0 <== NOT EXECUTED */ #include static inline void rtems_libio_lock( void ) { rtems_semaphore_obtain( rtems_libio_semaphore, RTEMS_WAIT, RTEMS_NO_TIMEOUT ); 200dd50: 03 00 80 8c sethi %hi(0x2023000), %g1 200dd54: d0 00 63 00 ld [ %g1 + 0x300 ], %o0 ! 2023300 200dd58: 92 10 20 00 clr %o1 200dd5c: 7f ff ec 7e call 2008f54 200dd60: 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) { 200dd64: c2 07 61 80 ld [ %i5 + 0x180 ], %g1 200dd68: 80 a0 60 00 cmp %g1, 0 200dd6c: 12 80 00 0a bne 200dd94 <== NEVER TAKEN 200dd70: ba 10 20 00 clr %i5 sc = rtems_semaphore_create( 200dd74: 11 14 12 54 sethi %hi(0x50495000), %o0 200dd78: 92 10 20 01 mov 1, %o1 200dd7c: 90 12 20 45 or %o0, 0x45, %o0 200dd80: 94 10 20 54 mov 0x54, %o2 200dd84: 96 10 20 00 clr %o3 200dd88: 7f ff eb d6 call 2008ce0 200dd8c: 98 10 00 1c mov %i4, %o4 200dd90: ba 10 00 08 mov %o0, %i5 } static inline void rtems_libio_unlock( void ) { rtems_semaphore_release( rtems_libio_semaphore ); 200dd94: 03 00 80 8c sethi %hi(0x2023000), %g1 200dd98: 7f ff ec b8 call 2009078 200dd9c: d0 00 63 00 ld [ %g1 + 0x300 ], %o0 ! 2023300 } rtems_libio_unlock(); } if (sc == RTEMS_SUCCESSFUL) { 200dda0: 80 a7 60 00 cmp %i5, 0 200dda4: 02 bf ff e1 be 200dd28 200dda8: b0 10 3f f4 mov -12, %i0 200ddac: 81 c7 e0 08 ret 200ddb0: 81 e8 00 00 restore { static char c = 'a'; pipe_control_t *pipe; int err = -ENOMEM; pipe = malloc(sizeof(pipe_control_t)); 200ddb4: 7f ff db b5 call 2004c88 200ddb8: 90 10 20 34 mov 0x34, %o0 if (pipe == NULL) 200ddbc: ba 92 20 00 orcc %o0, 0, %i5 200ddc0: 02 80 00 e4 be 200e150 <== NEVER TAKEN 200ddc4: 92 10 20 00 clr %o1 return err; memset(pipe, 0, sizeof(pipe_control_t)); 200ddc8: 40 00 12 ce call 2012900 200ddcc: 94 10 20 34 mov 0x34, %o2 pipe->Size = PIPE_BUF; 200ddd0: 82 10 22 00 mov 0x200, %g1 pipe->Buffer = malloc(pipe->Size); 200ddd4: 90 10 22 00 mov 0x200, %o0 200ddd8: 7f ff db ac call 2004c88 200dddc: c2 27 60 04 st %g1, [ %i5 + 4 ] if (! pipe->Buffer) 200dde0: 80 a2 20 00 cmp %o0, 0 200dde4: 02 80 00 40 be 200dee4 <== NEVER TAKEN 200dde8: d0 27 40 00 st %o0, [ %i5 ] goto err_buf; err = -ENOMEM; if (rtems_barrier_create( rtems_build_name ('P', 'I', 'r', c), 200ddec: 39 00 80 8a sethi %hi(0x2022800), %i4 200ddf0: d0 4f 22 38 ldsb [ %i4 + 0x238 ], %o0 ! 2022a38 if (! pipe->Buffer) goto err_buf; err = -ENOMEM; if (rtems_barrier_create( 200ddf4: 35 14 12 5c sethi %hi(0x50497000), %i2 200ddf8: 82 16 a2 00 or %i2, 0x200, %g1 ! 50497200 200ddfc: 92 10 20 00 clr %o1 200de00: 90 12 00 01 or %o0, %g1, %o0 200de04: 94 10 20 00 clr %o2 200de08: 40 00 05 f1 call 200f5cc 200de0c: 96 07 60 2c add %i5, 0x2c, %o3 200de10: 80 a2 20 00 cmp %o0, 0 200de14: 12 80 00 32 bne 200dedc 200de18: d0 4f 22 38 ldsb [ %i4 + 0x238 ], %o0 rtems_build_name ('P', 'I', 'r', c), RTEMS_BARRIER_MANUAL_RELEASE, 0, &pipe->readBarrier) != RTEMS_SUCCESSFUL) goto err_rbar; if (rtems_barrier_create( 200de1c: 03 14 12 5d sethi %hi(0x50497400), %g1 200de20: 82 10 63 00 or %g1, 0x300, %g1 ! 50497700 200de24: 92 10 20 00 clr %o1 200de28: 90 12 00 01 or %o0, %g1, %o0 200de2c: 94 10 20 00 clr %o2 200de30: 40 00 05 e7 call 200f5cc 200de34: 96 07 60 30 add %i5, 0x30, %o3 200de38: 80 a2 20 00 cmp %o0, 0 200de3c: 12 80 00 26 bne 200ded4 200de40: d0 4f 22 38 ldsb [ %i4 + 0x238 ], %o0 rtems_build_name ('P', 'I', 'w', c), RTEMS_BARRIER_MANUAL_RELEASE, 0, &pipe->writeBarrier) != RTEMS_SUCCESSFUL) goto err_wbar; if (rtems_semaphore_create( 200de44: b4 16 a3 00 or %i2, 0x300, %i2 200de48: 92 10 20 01 mov 1, %o1 200de4c: 90 12 00 1a or %o0, %i2, %o0 200de50: 94 10 20 10 mov 0x10, %o2 200de54: 96 10 20 00 clr %o3 200de58: 7f ff eb a2 call 2008ce0 200de5c: 98 07 60 28 add %i5, 0x28, %o4 200de60: 80 a2 20 00 cmp %o0, 0 200de64: 12 80 00 1a bne 200decc 200de68: 94 07 bf fc add %fp, -4, %o2 RTEMS_INLINE_ROUTINE Barrier_Control *_Barrier_Get ( Objects_Id id, Objects_Locations *location ) { return (Barrier_Control *) 200de6c: d2 07 60 2c ld [ %i5 + 0x2c ], %o1 200de70: 31 00 80 8f sethi %hi(0x2023c00), %i0 200de74: 7f ff f2 dd call 200a9e8 <_Objects_Get> 200de78: 90 16 21 b0 or %i0, 0x1b0, %o0 ! 2023db0 <_Barrier_Information> static void pipe_interruptible(pipe_control_t *pipe) { Objects_Locations location; _Barrier_Get(pipe->readBarrier, &location)->Barrier.Wait_queue.state |= STATES_INTERRUPTIBLE_BY_SIGNAL; 200de7c: c2 02 20 4c ld [ %o0 + 0x4c ], %g1 200de80: 35 04 00 00 sethi %hi(0x10000000), %i2 200de84: 82 10 40 1a or %g1, %i2, %g1 _Thread_Enable_dispatch(); 200de88: 7f ff f6 90 call 200b8c8 <_Thread_Enable_dispatch> 200de8c: c2 22 20 4c st %g1, [ %o0 + 0x4c ] 200de90: d2 07 60 30 ld [ %i5 + 0x30 ], %o1 200de94: 94 07 bf fc add %fp, -4, %o2 200de98: 7f ff f2 d4 call 200a9e8 <_Objects_Get> 200de9c: 90 16 21 b0 or %i0, 0x1b0, %o0 _Barrier_Get(pipe->writeBarrier, &location)->Barrier.Wait_queue.state |= STATES_INTERRUPTIBLE_BY_SIGNAL; 200dea0: c2 02 20 4c ld [ %o0 + 0x4c ], %g1 200dea4: b4 10 40 1a or %g1, %i2, %i2 _Thread_Enable_dispatch(); 200dea8: 7f ff f6 88 call 200b8c8 <_Thread_Enable_dispatch> 200deac: f4 22 20 4c st %i2, [ %o0 + 0x4c ] #ifdef RTEMS_POSIX_API pipe_interruptible(pipe); #endif *pipep = pipe; if (c ++ == 'z') 200deb0: c2 0f 22 38 ldub [ %i4 + 0x238 ], %g1 200deb4: c4 4f 22 38 ldsb [ %i4 + 0x238 ], %g2 200deb8: 80 a0 a0 7a cmp %g2, 0x7a 200debc: 12 80 00 a7 bne 200e158 200dec0: 82 00 60 01 inc %g1 c = 'a'; 200dec4: 10 80 00 a5 b 200e158 200dec8: 82 10 20 61 mov 0x61, %g1 return 0; err_sem: rtems_barrier_delete(pipe->writeBarrier); 200decc: 40 00 05 ef call 200f688 200ded0: d0 07 60 30 ld [ %i5 + 0x30 ], %o0 err_wbar: rtems_barrier_delete(pipe->readBarrier); 200ded4: 40 00 05 ed call 200f688 200ded8: d0 07 60 2c ld [ %i5 + 0x2c ], %o0 err_rbar: free(pipe->Buffer); 200dedc: 7f ff da 57 call 2004838 200dee0: d0 07 40 00 ld [ %i5 ], %o0 err_buf: free(pipe); 200dee4: 7f ff da 55 call 2004838 200dee8: 90 10 00 1d mov %i5, %o0 if (err) goto out; } if (! PIPE_LOCK(pipe)) err = -EINTR; 200deec: 10 80 00 13 b 200df38 200def0: b0 10 3f f4 mov -12, %i0 err = pipe_alloc(&pipe); if (err) goto out; } if (! PIPE_LOCK(pipe)) 200def4: d0 07 60 28 ld [ %i5 + 0x28 ], %o0 200def8: 92 10 20 00 clr %o1 200defc: 7f ff ec 16 call 2008f54 200df00: 94 10 20 00 clr %o2 err = -EINTR; if (*pipep == NULL) { 200df04: c2 06 c0 00 ld [ %i3 ], %g1 err = pipe_alloc(&pipe); if (err) goto out; } if (! PIPE_LOCK(pipe)) 200df08: 80 a0 00 08 cmp %g0, %o0 200df0c: b0 60 20 00 subx %g0, 0, %i0 err = -EINTR; if (*pipep == NULL) { 200df10: 80 a0 60 00 cmp %g1, 0 200df14: 12 80 00 09 bne 200df38 200df18: b0 0e 3f fc and %i0, -4, %i0 if (err) 200df1c: 80 a6 20 00 cmp %i0, 0 200df20: 22 80 00 06 be,a 200df38 <== ALWAYS TAKEN 200df24: fa 26 c0 00 st %i5, [ %i3 ] pipe_free(pipe); 200df28: 7f ff ff 41 call 200dc2c <== NOT EXECUTED 200df2c: 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); 200df30: 10 80 00 03 b 200df3c <== NOT EXECUTED 200df34: 03 00 80 8c sethi %hi(0x2023000), %g1 <== NOT EXECUTED 200df38: 03 00 80 8c sethi %hi(0x2023000), %g1 200df3c: 7f ff ec 4f call 2009078 200df40: d0 00 61 80 ld [ %g1 + 0x180 ], %o0 ! 2023180 pipe_control_t *pipe; unsigned int prevCounter; int err; err = pipe_new(pipep); if (err) 200df44: 80 a6 20 00 cmp %i0, 0 200df48: 12 80 00 86 bne 200e160 200df4c: 01 00 00 00 nop return err; pipe = *pipep; switch (LIBIO_ACCMODE(iop)) { 200df50: c2 06 60 10 ld [ %i1 + 0x10 ], %g1 200df54: 82 08 60 06 and %g1, 6, %g1 200df58: 80 a0 60 04 cmp %g1, 4 200df5c: 02 80 00 2e be 200e014 200df60: fa 06 c0 00 ld [ %i3 ], %i5 200df64: 80 a0 60 06 cmp %g1, 6 200df68: 02 80 00 56 be 200e0c0 200df6c: 80 a0 60 02 cmp %g1, 2 200df70: 12 80 00 6a bne 200e118 <== NEVER TAKEN 200df74: 01 00 00 00 nop case LIBIO_FLAGS_READ: pipe->readerCounter ++; 200df78: c2 07 60 20 ld [ %i5 + 0x20 ], %g1 200df7c: 82 00 60 01 inc %g1 200df80: c2 27 60 20 st %g1, [ %i5 + 0x20 ] if (pipe->Readers ++ == 0) 200df84: c2 07 60 10 ld [ %i5 + 0x10 ], %g1 200df88: 84 00 60 01 add %g1, 1, %g2 200df8c: 80 a0 60 00 cmp %g1, 0 200df90: 12 80 00 05 bne 200dfa4 <== NEVER TAKEN 200df94: c4 27 60 10 st %g2, [ %i5 + 0x10 ] PIPE_WAKEUPWRITERS(pipe); 200df98: d0 07 60 30 ld [ %i5 + 0x30 ], %o0 200df9c: 40 00 05 e4 call 200f72c 200dfa0: 92 07 bf f8 add %fp, -8, %o1 if (pipe->Writers == 0) { 200dfa4: c2 07 60 14 ld [ %i5 + 0x14 ], %g1 200dfa8: 80 a0 60 00 cmp %g1, 0 200dfac: 12 80 00 5b bne 200e118 200dfb0: 01 00 00 00 nop /* Not an error */ if (LIBIO_NODELAY(iop)) 200dfb4: c2 06 60 10 ld [ %i1 + 0x10 ], %g1 200dfb8: 80 88 60 01 btst 1, %g1 200dfbc: 12 80 00 57 bne 200e118 200dfc0: 01 00 00 00 nop break; prevCounter = pipe->writerCounter; 200dfc4: f8 07 60 24 ld [ %i5 + 0x24 ], %i4 err = -EINTR; /* Wait until a writer opens the pipe */ do { PIPE_UNLOCK(pipe); 200dfc8: 7f ff ec 2c call 2009078 200dfcc: d0 07 60 28 ld [ %i5 + 0x28 ], %o0 if (! PIPE_READWAIT(pipe)) 200dfd0: d0 07 60 2c ld [ %i5 + 0x2c ], %o0 200dfd4: 40 00 05 ec call 200f784 200dfd8: 92 10 20 00 clr %o1 200dfdc: 80 a2 20 00 cmp %o0, 0 200dfe0: 12 80 00 52 bne 200e128 <== NEVER TAKEN 200dfe4: 92 10 20 00 clr %o1 goto out_error; if (! PIPE_LOCK(pipe)) 200dfe8: d0 07 60 28 ld [ %i5 + 0x28 ], %o0 200dfec: 7f ff eb da call 2008f54 200dff0: 94 10 20 00 clr %o2 200dff4: 80 a2 20 00 cmp %o0, 0 200dff8: 32 80 00 4d bne,a 200e12c <== NEVER TAKEN 200dffc: b0 10 3f fc mov -4, %i0 <== NOT EXECUTED goto out_error; } while (prevCounter == pipe->writerCounter); 200e000: c2 07 60 24 ld [ %i5 + 0x24 ], %g1 200e004: 80 a7 00 01 cmp %i4, %g1 200e008: 02 bf ff f0 be 200dfc8 <== NEVER TAKEN 200e00c: 01 00 00 00 nop 200e010: 30 80 00 42 b,a 200e118 } break; case LIBIO_FLAGS_WRITE: pipe->writerCounter ++; 200e014: c2 07 60 24 ld [ %i5 + 0x24 ], %g1 200e018: 82 00 60 01 inc %g1 200e01c: c2 27 60 24 st %g1, [ %i5 + 0x24 ] if (pipe->Writers ++ == 0) 200e020: c2 07 60 14 ld [ %i5 + 0x14 ], %g1 200e024: 84 00 60 01 add %g1, 1, %g2 200e028: 80 a0 60 00 cmp %g1, 0 200e02c: 12 80 00 05 bne 200e040 <== NEVER TAKEN 200e030: c4 27 60 14 st %g2, [ %i5 + 0x14 ] PIPE_WAKEUPREADERS(pipe); 200e034: d0 07 60 2c ld [ %i5 + 0x2c ], %o0 200e038: 40 00 05 bd call 200f72c 200e03c: 92 07 bf f8 add %fp, -8, %o1 if (pipe->Readers == 0 && LIBIO_NODELAY(iop)) { 200e040: c2 07 60 10 ld [ %i5 + 0x10 ], %g1 200e044: 80 a0 60 00 cmp %g1, 0 200e048: 12 80 00 34 bne 200e118 200e04c: 01 00 00 00 nop 200e050: c2 06 60 10 ld [ %i1 + 0x10 ], %g1 200e054: 80 88 60 01 btst 1, %g1 200e058: 22 80 00 07 be,a 200e074 200e05c: f8 07 60 20 ld [ %i5 + 0x20 ], %i4 PIPE_UNLOCK(pipe); 200e060: d0 07 60 28 ld [ %i5 + 0x28 ], %o0 200e064: 7f ff ec 05 call 2009078 200e068: b0 10 3f fa mov -6, %i0 err = -ENXIO; goto out_error; 200e06c: 10 80 00 31 b 200e130 200e070: 90 10 00 1b mov %i3, %o0 if (pipe->Readers == 0) { prevCounter = pipe->readerCounter; err = -EINTR; do { PIPE_UNLOCK(pipe); 200e074: 7f ff ec 01 call 2009078 200e078: d0 07 60 28 ld [ %i5 + 0x28 ], %o0 if (! PIPE_WRITEWAIT(pipe)) 200e07c: d0 07 60 30 ld [ %i5 + 0x30 ], %o0 200e080: 40 00 05 c1 call 200f784 200e084: 92 10 20 00 clr %o1 200e088: 80 a2 20 00 cmp %o0, 0 200e08c: 12 80 00 27 bne 200e128 <== NEVER TAKEN 200e090: 92 10 20 00 clr %o1 goto out_error; if (! PIPE_LOCK(pipe)) 200e094: d0 07 60 28 ld [ %i5 + 0x28 ], %o0 200e098: 7f ff eb af call 2008f54 200e09c: 94 10 20 00 clr %o2 200e0a0: 80 a2 20 00 cmp %o0, 0 200e0a4: 32 80 00 22 bne,a 200e12c <== NEVER TAKEN 200e0a8: b0 10 3f fc mov -4, %i0 <== NOT EXECUTED goto out_error; } while (prevCounter == pipe->readerCounter); 200e0ac: c2 07 60 20 ld [ %i5 + 0x20 ], %g1 200e0b0: 80 a7 00 01 cmp %i4, %g1 200e0b4: 02 bf ff f0 be 200e074 <== NEVER TAKEN 200e0b8: 01 00 00 00 nop 200e0bc: 30 80 00 17 b,a 200e118 } break; case LIBIO_FLAGS_READ_WRITE: pipe->readerCounter ++; 200e0c0: c2 07 60 20 ld [ %i5 + 0x20 ], %g1 200e0c4: 82 00 60 01 inc %g1 200e0c8: c2 27 60 20 st %g1, [ %i5 + 0x20 ] if (pipe->Readers ++ == 0) 200e0cc: c2 07 60 10 ld [ %i5 + 0x10 ], %g1 200e0d0: 84 00 60 01 add %g1, 1, %g2 200e0d4: 80 a0 60 00 cmp %g1, 0 200e0d8: 12 80 00 05 bne 200e0ec <== NEVER TAKEN 200e0dc: c4 27 60 10 st %g2, [ %i5 + 0x10 ] PIPE_WAKEUPWRITERS(pipe); 200e0e0: d0 07 60 30 ld [ %i5 + 0x30 ], %o0 200e0e4: 40 00 05 92 call 200f72c 200e0e8: 92 07 bf f8 add %fp, -8, %o1 pipe->writerCounter ++; 200e0ec: c2 07 60 24 ld [ %i5 + 0x24 ], %g1 200e0f0: 82 00 60 01 inc %g1 200e0f4: c2 27 60 24 st %g1, [ %i5 + 0x24 ] if (pipe->Writers ++ == 0) 200e0f8: c2 07 60 14 ld [ %i5 + 0x14 ], %g1 200e0fc: 84 00 60 01 add %g1, 1, %g2 200e100: 80 a0 60 00 cmp %g1, 0 200e104: 12 80 00 05 bne 200e118 <== NEVER TAKEN 200e108: c4 27 60 14 st %g2, [ %i5 + 0x14 ] PIPE_WAKEUPREADERS(pipe); 200e10c: d0 07 60 2c ld [ %i5 + 0x2c ], %o0 200e110: 40 00 05 87 call 200f72c 200e114: 92 07 bf f8 add %fp, -8, %o1 break; } PIPE_UNLOCK(pipe); 200e118: 7f ff eb d8 call 2009078 200e11c: d0 07 60 28 ld [ %i5 + 0x28 ], %o0 return 0; 200e120: 81 c7 e0 08 ret 200e124: 81 e8 00 00 restore /* Not an error */ if (LIBIO_NODELAY(iop)) break; prevCounter = pipe->writerCounter; err = -EINTR; 200e128: b0 10 3f fc mov -4, %i0 <== NOT EXECUTED PIPE_UNLOCK(pipe); return 0; out_error: pipe_release(pipep, iop); 200e12c: 90 10 00 1b mov %i3, %o0 <== NOT EXECUTED 200e130: 7f ff fe ca call 200dc58 200e134: 92 10 00 19 mov %i1, %o1 return err; 200e138: 81 c7 e0 08 ret 200e13c: 81 e8 00 00 restore err = pipe_lock(); if (err) return err; pipe = *pipep; if (pipe == NULL) { 200e140: 80 a7 60 00 cmp %i5, 0 200e144: 32 bf ff 6d bne,a 200def8 200e148: d0 07 60 28 ld [ %i5 + 0x28 ], %o0 200e14c: 30 bf ff 1a b,a 200ddb4 if (err) goto out; } if (! PIPE_LOCK(pipe)) err = -EINTR; 200e150: 10 bf ff 7a b 200df38 <== NOT EXECUTED 200e154: b0 10 3f f4 mov -12, %i0 <== NOT EXECUTED #ifdef RTEMS_POSIX_API pipe_interruptible(pipe); #endif *pipep = pipe; if (c ++ == 'z') 200e158: 10 bf ff 67 b 200def4 200e15c: c2 2f 22 38 stb %g1, [ %i4 + 0x238 ] return 0; out_error: pipe_release(pipep, iop); return err; } 200e160: 81 c7 e0 08 ret 200e164: 81 e8 00 00 restore =============================================================================== 02009608 : */ long fpathconf( int fd, int name ) { 2009608: 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); 200960c: 03 00 80 48 sethi %hi(0x2012000), %g1 2009610: c2 00 61 c8 ld [ %g1 + 0x1c8 ], %g1 ! 20121c8 2009614: 80 a6 00 01 cmp %i0, %g1 2009618: 2a 80 00 03 bcs,a 2009624 200961c: 83 2e 20 03 sll %i0, 3, %g1 2009620: 30 80 00 0a b,a 2009648 iop = rtems_libio_iop(fd); 2009624: b1 2e 20 06 sll %i0, 6, %i0 2009628: b0 26 00 01 sub %i0, %g1, %i0 200962c: 03 00 80 4a sethi %hi(0x2012800), %g1 2009630: c2 00 61 f0 ld [ %g1 + 0x1f0 ], %g1 ! 20129f0 2009634: b0 00 40 18 add %g1, %i0, %i0 rtems_libio_check_is_open(iop); 2009638: c2 06 20 10 ld [ %i0 + 0x10 ], %g1 200963c: 80 88 61 00 btst 0x100, %g1 2009640: 32 80 00 06 bne,a 2009658 <== ALWAYS TAKEN 2009644: c2 06 20 28 ld [ %i0 + 0x28 ], %g1 2009648: 40 00 08 f5 call 200ba1c <__errno> 200964c: 01 00 00 00 nop 2009650: 10 80 00 32 b 2009718 2009654: 82 10 20 09 mov 9, %g1 ! 9 * Now process the information request. */ the_limits = iop->pathinfo.mt_entry->pathconf_limits_and_options; switch ( name ) { 2009658: 80 a6 60 0b cmp %i1, 0xb 200965c: 18 80 00 2c bgu 200970c 2009660: c2 00 60 2c ld [ %g1 + 0x2c ], %g1 2009664: b3 2e 60 02 sll %i1, 2, %i1 2009668: 05 00 80 25 sethi %hi(0x2009400), %g2 200966c: 84 10 a1 d8 or %g2, 0x1d8, %g2 ! 20095d8 <_close_r+0x10> 2009670: c4 00 80 19 ld [ %g2 + %i1 ], %g2 2009674: 81 c0 80 00 jmp %g2 2009678: 01 00 00 00 nop case _PC_LINK_MAX: return_value = the_limits->link_max; 200967c: f0 00 40 00 ld [ %g1 ], %i0 break; 2009680: 81 c7 e0 08 ret 2009684: 81 e8 00 00 restore case _PC_MAX_CANON: return_value = the_limits->max_canon; 2009688: f0 00 60 04 ld [ %g1 + 4 ], %i0 break; 200968c: 81 c7 e0 08 ret 2009690: 81 e8 00 00 restore case _PC_MAX_INPUT: return_value = the_limits->max_input; 2009694: f0 00 60 08 ld [ %g1 + 8 ], %i0 break; 2009698: 81 c7 e0 08 ret 200969c: 81 e8 00 00 restore case _PC_NAME_MAX: return_value = the_limits->name_max; 20096a0: f0 00 60 0c ld [ %g1 + 0xc ], %i0 break; 20096a4: 81 c7 e0 08 ret 20096a8: 81 e8 00 00 restore case _PC_PATH_MAX: return_value = the_limits->path_max; 20096ac: f0 00 60 10 ld [ %g1 + 0x10 ], %i0 break; 20096b0: 81 c7 e0 08 ret 20096b4: 81 e8 00 00 restore case _PC_PIPE_BUF: return_value = the_limits->pipe_buf; 20096b8: f0 00 60 14 ld [ %g1 + 0x14 ], %i0 break; 20096bc: 81 c7 e0 08 ret 20096c0: 81 e8 00 00 restore case _PC_CHOWN_RESTRICTED: return_value = the_limits->posix_chown_restrictions; 20096c4: f0 00 60 1c ld [ %g1 + 0x1c ], %i0 break; 20096c8: 81 c7 e0 08 ret 20096cc: 81 e8 00 00 restore case _PC_NO_TRUNC: return_value = the_limits->posix_no_trunc; 20096d0: f0 00 60 20 ld [ %g1 + 0x20 ], %i0 break; 20096d4: 81 c7 e0 08 ret 20096d8: 81 e8 00 00 restore case _PC_VDISABLE: return_value = the_limits->posix_vdisable; 20096dc: f0 00 60 2c ld [ %g1 + 0x2c ], %i0 break; 20096e0: 81 c7 e0 08 ret 20096e4: 81 e8 00 00 restore case _PC_ASYNC_IO: return_value = the_limits->posix_async_io; 20096e8: f0 00 60 18 ld [ %g1 + 0x18 ], %i0 break; 20096ec: 81 c7 e0 08 ret 20096f0: 81 e8 00 00 restore case _PC_PRIO_IO: return_value = the_limits->posix_prio_io; 20096f4: f0 00 60 24 ld [ %g1 + 0x24 ], %i0 break; 20096f8: 81 c7 e0 08 ret 20096fc: 81 e8 00 00 restore case _PC_SYNC_IO: return_value = the_limits->posix_sync_io; 2009700: f0 00 60 28 ld [ %g1 + 0x28 ], %i0 break; 2009704: 81 c7 e0 08 ret 2009708: 81 e8 00 00 restore default: rtems_set_errno_and_return_minus_one( EINVAL ); 200970c: 40 00 08 c4 call 200ba1c <__errno> 2009710: 01 00 00 00 nop 2009714: 82 10 20 16 mov 0x16, %g1 ! 16 2009718: c2 22 00 00 st %g1, [ %o0 ] break; } return return_value; } 200971c: 81 c7 e0 08 ret 2009720: 91 e8 3f ff restore %g0, -1, %o0 =============================================================================== 020035b0 : #include void free( void *ptr ) { 20035b0: 9d e3 bf a0 save %sp, -96, %sp MSBUMP(free_calls, 1); 20035b4: 03 00 80 75 sethi %hi(0x201d400), %g1 20035b8: 82 10 60 50 or %g1, 0x50, %g1 ! 201d450 20035bc: c4 00 60 0c ld [ %g1 + 0xc ], %g2 #include void free( void *ptr ) { 20035c0: b2 10 00 18 mov %i0, %i1 MSBUMP(free_calls, 1); 20035c4: 84 00 a0 01 inc %g2 if ( !ptr ) 20035c8: 80 a6 20 00 cmp %i0, 0 20035cc: 02 80 00 21 be 2003650 20035d0: c4 20 60 0c st %g2, [ %g1 + 0xc ] return; /* * Do not attempt to free memory if in a critical section or ISR. */ if ( _System_state_Is_up(_System_state_Get()) && 20035d4: 03 00 80 76 sethi %hi(0x201d800), %g1 20035d8: c2 00 62 e8 ld [ %g1 + 0x2e8 ], %g1 ! 201dae8 <_System_state_Current> 20035dc: 80 a0 60 03 cmp %g1, 3 20035e0: 12 80 00 09 bne 2003604 <== NEVER TAKEN 20035e4: 03 00 80 74 sethi %hi(0x201d000), %g1 !malloc_is_system_state_OK() ) { 20035e8: 40 00 00 78 call 20037c8 20035ec: 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()) && 20035f0: 80 8a 20 ff btst 0xff, %o0 20035f4: 12 80 00 04 bne 2003604 20035f8: 03 00 80 74 sethi %hi(0x201d000), %g1 !malloc_is_system_state_OK() ) { malloc_deferred_free(ptr); 20035fc: 40 00 00 8c call 200382c 2003600: 81 e8 00 00 restore } /* * If configured, update the statistics */ if ( rtems_malloc_statistics_helpers ) 2003604: c2 00 61 90 ld [ %g1 + 0x190 ], %g1 2003608: 80 a0 60 00 cmp %g1, 0 200360c: 02 80 00 06 be 2003624 2003610: 3b 00 80 72 sethi %hi(0x201c800), %i5 (*rtems_malloc_statistics_helpers->at_free)(ptr); 2003614: c2 00 60 08 ld [ %g1 + 8 ], %g1 2003618: 9f c0 40 00 call %g1 200361c: 90 10 00 19 mov %i1, %o0 if ( !_Protected_heap_Free( RTEMS_Malloc_Heap, ptr ) ) { 2003620: 3b 00 80 72 sethi %hi(0x201c800), %i5 2003624: d0 07 61 b0 ld [ %i5 + 0x1b0 ], %o0 ! 201c9b0 2003628: 40 00 17 72 call 20093f0 <_Protected_heap_Free> 200362c: 92 10 00 19 mov %i1, %o1 2003630: 80 8a 20 ff btst 0xff, %o0 2003634: 12 80 00 07 bne 2003650 2003638: c2 07 61 b0 ld [ %i5 + 0x1b0 ], %g1 printk( "Program heap: free of bad pointer %p -- range %p - %p \n", 200363c: 31 00 80 6c sethi %hi(0x201b000), %i0 2003640: f4 00 60 18 ld [ %g1 + 0x18 ], %i2 2003644: f6 00 60 1c ld [ %g1 + 0x1c ], %i3 2003648: 40 00 03 68 call 20043e8 200364c: 91 ee 23 08 restore %i0, 0x308, %o0 2003650: 81 c7 e0 08 ret 2003654: 81 e8 00 00 restore =============================================================================== 02019c8c : int fstat( int fd, struct stat *sbuf ) { 2019c8c: 9d e3 bf a0 save %sp, -96, %sp rtems_libio_t *iop; /* * Check to see if we were passed a valid pointer. */ if ( !sbuf ) 2019c90: 80 a6 60 00 cmp %i1, 0 2019c94: 32 80 00 06 bne,a 2019cac <== ALWAYS TAKEN 2019c98: 03 00 80 72 sethi %hi(0x201c800), %g1 rtems_set_errno_and_return_minus_one( EFAULT ); 2019c9c: 7f ff d6 74 call 200f66c <__errno> <== NOT EXECUTED 2019ca0: 01 00 00 00 nop <== NOT EXECUTED 2019ca4: 10 80 00 12 b 2019cec <== NOT EXECUTED 2019ca8: 82 10 20 0e mov 0xe, %g1 ! e <== NOT EXECUTED /* * Now process the stat() request. */ iop = rtems_libio_iop( fd ); 2019cac: c2 00 61 f4 ld [ %g1 + 0x1f4 ], %g1 2019cb0: 80 a6 00 01 cmp %i0, %g1 2019cb4: 1a 80 00 0b bcc 2019ce0 2019cb8: 83 2e 20 03 sll %i0, 3, %g1 2019cbc: b1 2e 20 06 sll %i0, 6, %i0 2019cc0: b0 26 00 01 sub %i0, %g1, %i0 2019cc4: 03 00 80 75 sethi %hi(0x201d400), %g1 2019cc8: c2 00 60 44 ld [ %g1 + 0x44 ], %g1 ! 201d444 2019ccc: b0 00 40 18 add %g1, %i0, %i0 rtems_libio_check_fd( fd ); rtems_libio_check_is_open(iop); 2019cd0: c2 06 20 10 ld [ %i0 + 0x10 ], %g1 2019cd4: 80 88 61 00 btst 0x100, %g1 2019cd8: 12 80 00 08 bne 2019cf8 2019cdc: 94 10 20 48 mov 0x48, %o2 /* * Now process the stat() request. */ iop = rtems_libio_iop( fd ); rtems_libio_check_fd( fd ); 2019ce0: 7f ff d6 63 call 200f66c <__errno> 2019ce4: 01 00 00 00 nop 2019ce8: 82 10 20 09 mov 9, %g1 ! 9 2019cec: c2 22 00 00 st %g1, [ %o0 ] 2019cf0: 81 c7 e0 08 ret 2019cf4: 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) ); 2019cf8: 90 10 00 19 mov %i1, %o0 2019cfc: 7f ff d8 ea call 20100a4 2019d00: 92 10 20 00 clr %o1 return (*iop->pathinfo.handlers->fstat_h)( &iop->pathinfo, sbuf ); 2019d04: c2 06 20 24 ld [ %i0 + 0x24 ], %g1 2019d08: 90 06 20 14 add %i0, 0x14, %o0 2019d0c: c2 00 60 18 ld [ %g1 + 0x18 ], %g1 2019d10: 9f c0 40 00 call %g1 2019d14: 92 10 00 19 mov %i1, %o1 } 2019d18: 81 c7 e0 08 ret 2019d1c: 91 e8 00 08 restore %g0, %o0, %o0 =============================================================================== 020034c8 : 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) { 20034c8: 03 00 80 85 sethi %hi(0x2021400), %g1 20034cc: c2 00 61 30 ld [ %g1 + 0x130 ], %g1 ! 2021530 20034d0: 80 a2 00 01 cmp %o0, %g1 20034d4: 1a 80 00 1e bcc 200354c <== NEVER TAKEN 20034d8: 03 00 80 85 sethi %hi(0x2021400), %g1 20034dc: c2 00 61 34 ld [ %g1 + 0x134 ], %g1 ! 2021534 20034e0: 80 a0 60 00 cmp %g1, 0 20034e4: 22 80 00 1b be,a 2003550 <== NEVER TAKEN 20034e8: 90 10 20 00 clr %o0 <== NOT EXECUTED rtems_disk_device_table *dtab = disktab + major; 20034ec: 91 2a 20 03 sll %o0, 3, %o0 20034f0: 84 00 40 08 add %g1, %o0, %g2 if (minor < dtab->size && dtab->minor != NULL) { 20034f4: c4 00 a0 04 ld [ %g2 + 4 ], %g2 20034f8: 80 a2 40 02 cmp %o1, %g2 20034fc: 3a 80 00 15 bcc,a 2003550 <== NEVER TAKEN 2003500: 90 10 20 00 clr %o0 <== NOT EXECUTED 2003504: c2 00 40 08 ld [ %g1 + %o0 ], %g1 2003508: 80 a0 60 00 cmp %g1, 0 200350c: 02 80 00 10 be 200354c <== NEVER TAKEN 2003510: 93 2a 60 02 sll %o1, 2, %o1 rtems_disk_device *dd = dtab->minor [minor]; if (dd != NULL && !lookup_only) { 2003514: 80 a2 a0 01 cmp %o2, 1 2003518: 02 80 00 0e be 2003550 200351c: d0 00 40 09 ld [ %g1 + %o1 ], %o0 2003520: 80 a2 20 00 cmp %o0, 0 2003524: 02 80 00 0b be 2003550 <== NEVER TAKEN 2003528: 01 00 00 00 nop if (!dd->deleted) { 200352c: c2 0a 20 40 ldub [ %o0 + 0x40 ], %g1 2003530: 80 a0 60 00 cmp %g1, 0 2003534: 32 80 00 07 bne,a 2003550 2003538: 90 10 20 00 clr %o0 ++dd->uses; 200353c: c2 02 20 14 ld [ %o0 + 0x14 ], %g1 2003540: 82 00 60 01 inc %g1 2003544: 81 c3 e0 08 retl 2003548: c2 22 20 14 st %g1, [ %o0 + 0x14 ] return dd; } } return NULL; 200354c: 90 10 20 00 clr %o0 <== NOT EXECUTED } 2003550: 81 c3 e0 08 retl =============================================================================== 020048b4 : * 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, 20048b4: 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); 20048b8: 40 00 05 85 call 2005ecc 20048bc: 90 10 22 04 mov 0x204, %o0 if (s == NULL) { return RTEMS_NO_MEMORY; 20048c0: 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) 20048c4: 80 a2 20 00 cmp %o0, 0 20048c8: 02 80 00 0f be 2004904 <== NEVER TAKEN 20048cc: ba 10 00 08 mov %o0, %i5 { return RTEMS_NO_MEMORY; } n = read(fd, s->data, RTEMS_IDE_SECTOR_SIZE); 20048d0: 90 10 00 18 mov %i0, %o0 20048d4: 92 07 60 04 add %i5, 4, %o1 20048d8: 40 00 08 43 call 20069e4 20048dc: 94 10 22 00 mov 0x200, %o2 if (n != RTEMS_IDE_SECTOR_SIZE) 20048e0: 80 a2 22 00 cmp %o0, 0x200 20048e4: 22 80 00 06 be,a 20048fc <== ALWAYS TAKEN 20048e8: f2 27 40 00 st %i1, [ %i5 ] { free(s); 20048ec: 40 00 03 e7 call 2005888 <== NOT EXECUTED 20048f0: 90 10 00 1d mov %i5, %o0 <== NOT EXECUTED return RTEMS_IO_ERROR; 20048f4: 10 80 00 04 b 2004904 <== NOT EXECUTED 20048f8: 82 10 20 1b mov 0x1b, %g1 <== NOT EXECUTED } s->sector_num = sector_num; *sector = s; 20048fc: fa 26 80 00 st %i5, [ %i2 ] return RTEMS_SUCCESSFUL; 2004900: 82 10 20 00 clr %g1 } 2004904: 81 c7 e0 08 ret 2004908: 91 e8 00 01 restore %g0, %g1, %o0 =============================================================================== 0202f964 : int getdents( int dd_fd, char *dd_buf, int dd_len ) { 202f964: 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 ); 202f968: 03 00 80 d7 sethi %hi(0x2035c00), %g1 202f96c: c2 00 60 8c ld [ %g1 + 0x8c ], %g1 ! 2035c8c 202f970: 80 a6 00 01 cmp %i0, %g1 202f974: 1a 80 00 08 bcc 202f994 <== NEVER TAKEN 202f978: ba 10 20 00 clr %i5 202f97c: 83 2e 20 03 sll %i0, 3, %g1 202f980: b1 2e 20 06 sll %i0, 6, %i0 202f984: b0 26 00 01 sub %i0, %g1, %i0 202f988: 03 00 81 1a sethi %hi(0x2046800), %g1 202f98c: fa 00 60 38 ld [ %g1 + 0x38 ], %i5 ! 2046838 202f990: ba 07 40 18 add %i5, %i0, %i5 /* * Make sure we are working on a directory */ type = rtems_filesystem_node_type( &iop->pathinfo ); 202f994: 7f ff 69 64 call 2009f24 202f998: 90 07 60 14 add %i5, 0x14, %o0 if ( type != RTEMS_FILESYSTEM_DIRECTORY ) 202f99c: 80 a2 20 00 cmp %o0, 0 202f9a0: 22 80 00 08 be,a 202f9c0 202f9a4: c2 07 60 24 ld [ %i5 + 0x24 ], %g1 rtems_set_errno_and_return_minus_one( ENOTDIR ); 202f9a8: 7f ff c4 1e call 2020a20 <__errno> 202f9ac: b0 10 3f ff mov -1, %i0 202f9b0: 82 10 20 14 mov 0x14, %g1 202f9b4: c2 22 00 00 st %g1, [ %o0 ] 202f9b8: 81 c7 e0 08 ret 202f9bc: 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 ); 202f9c0: 90 10 00 1d mov %i5, %o0 202f9c4: c2 00 60 08 ld [ %g1 + 8 ], %g1 202f9c8: 92 10 00 19 mov %i1, %o1 202f9cc: 9f c0 40 00 call %g1 202f9d0: 94 10 00 1a mov %i2, %o2 } 202f9d4: 81 c7 e0 08 ret 202f9d8: 91 e8 00 08 restore %g0, %o0, %o0 =============================================================================== 020242d0 : /** * Initialize useable but dummy databases */ void init_etc_passwd_group(void) { 20242d0: 9d e3 bf a0 save %sp, -96, %sp FILE *fp; static char etc_passwd_initted = 0; if (etc_passwd_initted) 20242d4: 03 00 81 86 sethi %hi(0x2061800), %g1 20242d8: c4 48 60 c0 ldsb [ %g1 + 0xc0 ], %g2 ! 20618c0 20242dc: 80 a0 a0 00 cmp %g2, 0 20242e0: 12 80 00 2f bne 202439c 20242e4: 84 10 20 01 mov 1, %g2 return; etc_passwd_initted = 1; mkdir("/etc", 0777); 20242e8: 92 10 21 ff mov 0x1ff, %o1 FILE *fp; static char etc_passwd_initted = 0; if (etc_passwd_initted) return; etc_passwd_initted = 1; 20242ec: c4 28 60 c0 stb %g2, [ %g1 + 0xc0 ] mkdir("/etc", 0777); 20242f0: 11 00 81 63 sethi %hi(0x2058c00), %o0 20242f4: 7f ff 7d 25 call 2003788 20242f8: 90 12 20 28 or %o0, 0x28, %o0 ! 2058c28 /* * Initialize /etc/passwd */ if ((fp = fopen("/etc/passwd", "r")) != NULL) { 20242fc: 3b 00 81 63 sethi %hi(0x2058c00), %i5 2024300: 13 00 81 75 sethi %hi(0x205d400), %o1 2024304: 90 17 60 30 or %i5, 0x30, %o0 2024308: 40 00 4c 83 call 2037514 202430c: 92 12 61 38 or %o1, 0x138, %o1 2024310: 80 a2 20 00 cmp %o0, 0 2024314: 22 80 00 03 be,a 2024320 2024318: 90 17 60 30 or %i5, 0x30, %o0 202431c: 30 80 00 0b b,a 2024348 fclose(fp); } else if ((fp = fopen("/etc/passwd", "w")) != NULL) { 2024320: 13 00 81 5a sethi %hi(0x2056800), %o1 2024324: 40 00 4c 7c call 2037514 2024328: 92 12 63 e0 or %o1, 0x3e0, %o1 ! 2056be0 202432c: ba 92 20 00 orcc %o0, 0, %i5 2024330: 02 80 00 08 be 2024350 <== NEVER TAKEN 2024334: 11 00 81 63 sethi %hi(0x2058c00), %o0 fprintf(fp, "root:*:0:0:root::/:/bin/sh\n" 2024338: 92 10 00 1d mov %i5, %o1 202433c: 40 00 4c d9 call 20376a0 2024340: 90 12 20 40 or %o0, 0x40, %o0 "rtems:*:1:1:RTEMS Application::/:/bin/sh\n" "tty:!:2:2:tty owner::/:/bin/false\n" ); fclose(fp); 2024344: 90 10 00 1d mov %i5, %o0 2024348: 40 00 4a 15 call 2036b9c 202434c: 01 00 00 00 nop } /* * Initialize /etc/group */ if ((fp = fopen("/etc/group", "r")) != NULL) { 2024350: 3b 00 81 63 sethi %hi(0x2058c00), %i5 2024354: 13 00 81 75 sethi %hi(0x205d400), %o1 2024358: 90 17 60 a8 or %i5, 0xa8, %o0 202435c: 40 00 4c 6e call 2037514 2024360: 92 12 61 38 or %o1, 0x138, %o1 2024364: b0 92 20 00 orcc %o0, 0, %i0 2024368: 12 80 00 0b bne 2024394 202436c: 90 17 60 a8 or %i5, 0xa8, %o0 fclose(fp); } else if ((fp = fopen("/etc/group", "w")) != NULL) { 2024370: 13 00 81 5a sethi %hi(0x2056800), %o1 2024374: 40 00 4c 68 call 2037514 2024378: 92 12 63 e0 or %o1, 0x3e0, %o1 ! 2056be0 202437c: b0 92 20 00 orcc %o0, 0, %i0 2024380: 02 80 00 07 be 202439c <== NEVER TAKEN 2024384: 11 00 81 63 sethi %hi(0x2058c00), %o0 fprintf( fp, "root:x:0:root\n" 2024388: 92 10 00 18 mov %i0, %o1 202438c: 40 00 4c c5 call 20376a0 2024390: 90 12 20 b8 or %o0, 0xb8, %o0 "rtems:x:1:rtems\n" "tty:x:2:tty\n" ); fclose(fp); 2024394: 40 00 4a 02 call 2036b9c 2024398: 81 e8 00 00 restore 202439c: 81 c7 e0 08 ret 20243a0: 81 e8 00 00 restore =============================================================================== 0200614c : /* * Process a single input character */ static int iproc (unsigned char c, struct rtems_termios_tty *tty) { 200614c: 9d e3 bf a0 save %sp, -96, %sp if (tty->termios.c_iflag & ISTRIP) 2006150: c2 06 60 30 ld [ %i1 + 0x30 ], %g1 2006154: 80 88 60 20 btst 0x20, %g1 2006158: 32 80 00 02 bne,a 2006160 <== NEVER TAKEN 200615c: b0 0e 20 7f and %i0, 0x7f, %i0 <== NOT EXECUTED c &= 0x7f; if (tty->termios.c_iflag & IUCLC) 2006160: 80 88 62 00 btst 0x200, %g1 2006164: 02 80 00 0c be 2006194 2006168: 80 a6 20 0d cmp %i0, 0xd c = tolower (c); 200616c: 05 00 80 73 sethi %hi(0x201cc00), %g2 2006170: c4 00 a0 58 ld [ %g2 + 0x58 ], %g2 ! 201cc58 <__ctype_ptr__> 2006174: 84 00 80 18 add %g2, %i0, %g2 2006178: c4 08 a0 01 ldub [ %g2 + 1 ], %g2 200617c: 84 08 a0 03 and %g2, 3, %g2 2006180: 80 a0 a0 01 cmp %g2, 1 2006184: 22 80 00 02 be,a 200618c 2006188: b0 06 20 20 add %i0, 0x20, %i0 200618c: b0 0e 20 ff and %i0, 0xff, %i0 if (c == '\r') { 2006190: 80 a6 20 0d cmp %i0, 0xd 2006194: 12 80 00 0b bne 20061c0 2006198: 80 a6 20 0a cmp %i0, 0xa if (tty->termios.c_iflag & IGNCR) 200619c: 80 88 60 80 btst 0x80, %g1 20061a0: 02 80 00 04 be 20061b0 <== ALWAYS TAKEN 20061a4: 80 88 61 00 btst 0x100, %g1 if (tty->ccount < (CBUFSIZE-1)) { if (tty->termios.c_lflag & ECHO) echo (c, tty); tty->cbuf[tty->ccount++] = c; } return 0; 20061a8: 81 c7 e0 08 ret <== NOT EXECUTED 20061ac: 91 e8 20 00 restore %g0, 0, %o0 <== NOT EXECUTED c = tolower (c); if (c == '\r') { if (tty->termios.c_iflag & IGNCR) return 0; if (tty->termios.c_iflag & ICRNL) 20061b0: 32 80 00 0d bne,a 20061e4 <== ALWAYS TAKEN 20061b4: 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)) { 20061b8: 10 80 00 0c b 20061e8 <== NOT EXECUTED 20061bc: 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)) { 20061c0: 12 80 00 07 bne 20061dc 20061c4: 80 a6 20 00 cmp %i0, 0 20061c8: 80 88 60 40 btst 0x40, %g1 20061cc: 32 80 00 06 bne,a 20061e4 <== NEVER TAKEN 20061d0: b0 10 20 0d mov 0xd, %i0 <== NOT EXECUTED c = '\r'; } if ((c != '\0') && (tty->termios.c_lflag & ICANON)) { 20061d4: 10 80 00 05 b 20061e8 20061d8: c2 06 60 3c ld [ %i1 + 0x3c ], %g1 20061dc: 02 80 00 51 be 2006320 <== NEVER TAKEN 20061e0: 03 00 80 72 sethi %hi(0x201c800), %g1 20061e4: c2 06 60 3c ld [ %i1 + 0x3c ], %g1 20061e8: 80 88 60 02 btst 2, %g1 20061ec: 22 80 00 4d be,a 2006320 20061f0: 03 00 80 72 sethi %hi(0x201c800), %g1 if (c == tty->termios.c_cc[VERASE]) { 20061f4: c4 0e 60 43 ldub [ %i1 + 0x43 ], %g2 20061f8: 80 a0 80 18 cmp %g2, %i0 20061fc: 32 80 00 08 bne,a 200621c 2006200: c4 0e 60 44 ldub [ %i1 + 0x44 ], %g2 * FIXME: Some of the tests should check for IEXTEN, too. */ static void erase (struct rtems_termios_tty *tty, int lineFlag) { if (tty->ccount == 0) 2006204: c2 06 60 20 ld [ %i1 + 0x20 ], %g1 2006208: 80 a0 60 00 cmp %g1, 0 200620c: 02 80 00 57 be 2006368 2006210: 90 10 00 19 mov %i1, %o0 2006214: 10 80 00 1d b 2006288 2006218: 92 10 20 00 clr %o1 if ((c != '\0') && (tty->termios.c_lflag & ICANON)) { if (c == tty->termios.c_cc[VERASE]) { erase (tty, 0); return 0; } else if (c == tty->termios.c_cc[VKILL]) { 200621c: 80 a0 80 18 cmp %g2, %i0 2006220: 32 80 00 1d bne,a 2006294 2006224: c4 0e 60 45 ldub [ %i1 + 0x45 ], %g2 * FIXME: Some of the tests should check for IEXTEN, too. */ static void erase (struct rtems_termios_tty *tty, int lineFlag) { if (tty->ccount == 0) 2006228: c4 06 60 20 ld [ %i1 + 0x20 ], %g2 200622c: 80 a0 a0 00 cmp %g2, 0 2006230: 02 80 00 4e be 2006368 <== NEVER TAKEN 2006234: 80 88 60 08 btst 8, %g1 return; if (lineFlag) { if (!(tty->termios.c_lflag & ECHO)) { 2006238: 12 80 00 04 bne 2006248 <== ALWAYS TAKEN 200623c: 90 10 00 19 mov %i1, %o0 tty->ccount = 0; 2006240: 10 80 00 4a b 2006368 <== NOT EXECUTED 2006244: c0 26 60 20 clr [ %i1 + 0x20 ] <== NOT EXECUTED return; } if (!(tty->termios.c_lflag & ECHOE)) { 2006248: 80 88 60 10 btst 0x10, %g1 200624c: 12 80 00 0f bne 2006288 <== ALWAYS TAKEN 2006250: 92 10 20 01 mov 1, %o1 tty->ccount = 0; 2006254: c0 26 60 20 clr [ %i1 + 0x20 ] <== NOT EXECUTED echo (tty->termios.c_cc[VKILL], tty); 2006258: 90 10 00 18 mov %i0, %o0 <== NOT EXECUTED 200625c: 7f ff ff 2d call 2005f10 <== NOT EXECUTED 2006260: 92 10 00 19 mov %i1, %o1 <== NOT EXECUTED if (tty->termios.c_lflag & ECHOK) 2006264: c2 06 60 3c ld [ %i1 + 0x3c ], %g1 <== NOT EXECUTED 2006268: 80 88 60 20 btst 0x20, %g1 <== NOT EXECUTED 200626c: 22 80 00 42 be,a 2006374 <== NOT EXECUTED 2006270: b0 10 20 00 clr %i0 <== NOT EXECUTED echo ('\n', tty); 2006274: 90 10 20 0a mov 0xa, %o0 <== NOT EXECUTED 2006278: 7f ff ff 26 call 2005f10 <== NOT EXECUTED 200627c: 92 10 00 19 mov %i1, %o1 <== NOT EXECUTED if (tty->ccount < (CBUFSIZE-1)) { if (tty->termios.c_lflag & ECHO) echo (c, tty); tty->cbuf[tty->ccount++] = c; } return 0; 2006280: 81 c7 e0 08 ret <== NOT EXECUTED 2006284: 91 e8 20 00 restore %g0, 0, %o0 <== NOT EXECUTED 2006288: 7f ff ff 43 call 2005f94 200628c: b0 10 20 00 clr %i0 2006290: 30 80 00 39 b,a 2006374 } else if (c == tty->termios.c_cc[VKILL]) { erase (tty, 1); return 0; } else if (c == tty->termios.c_cc[VEOF]) { 2006294: 80 a0 80 18 cmp %g2, %i0 2006298: 02 80 00 36 be 2006370 <== NEVER TAKEN 200629c: 80 a6 20 0a cmp %i0, 0xa return 1; } else if (c == '\n') { 20062a0: 32 80 00 0d bne,a 20062d4 20062a4: c4 0e 60 4c ldub [ %i1 + 0x4c ], %g2 if (tty->termios.c_lflag & (ECHO | ECHONL)) 20062a8: 80 88 60 48 btst 0x48, %g1 20062ac: 22 80 00 06 be,a 20062c4 <== NEVER TAKEN 20062b0: c2 06 60 20 ld [ %i1 + 0x20 ], %g1 <== NOT EXECUTED echo (c, tty); 20062b4: 90 10 20 0a mov 0xa, %o0 20062b8: 7f ff ff 16 call 2005f10 20062bc: 92 10 00 19 mov %i1, %o1 tty->cbuf[tty->ccount++] = c; 20062c0: c2 06 60 20 ld [ %i1 + 0x20 ], %g1 20062c4: c4 06 60 1c ld [ %i1 + 0x1c ], %g2 20062c8: 86 10 20 0a mov 0xa, %g3 20062cc: 10 80 00 12 b 2006314 20062d0: c6 28 80 01 stb %g3, [ %g2 + %g1 ] return 1; } else if ((c == tty->termios.c_cc[VEOL]) || 20062d4: 80 a0 80 18 cmp %g2, %i0 20062d8: 02 80 00 07 be 20062f4 <== NEVER TAKEN 20062dc: 80 88 60 08 btst 8, %g1 20062e0: c4 0e 60 51 ldub [ %i1 + 0x51 ], %g2 20062e4: 80 a0 80 18 cmp %g2, %i0 20062e8: 32 80 00 0e bne,a 2006320 <== ALWAYS TAKEN 20062ec: 03 00 80 72 sethi %hi(0x201c800), %g1 (c == tty->termios.c_cc[VEOL2])) { if (tty->termios.c_lflag & ECHO) 20062f0: 80 88 60 08 btst 8, %g1 <== NOT EXECUTED 20062f4: 22 80 00 06 be,a 200630c <== NOT EXECUTED 20062f8: c2 06 60 20 ld [ %i1 + 0x20 ], %g1 <== NOT EXECUTED echo (c, tty); 20062fc: 90 10 00 18 mov %i0, %o0 <== NOT EXECUTED 2006300: 7f ff ff 04 call 2005f10 <== NOT EXECUTED 2006304: 92 10 00 19 mov %i1, %o1 <== NOT EXECUTED tty->cbuf[tty->ccount++] = c; 2006308: c2 06 60 20 ld [ %i1 + 0x20 ], %g1 <== NOT EXECUTED 200630c: c4 06 60 1c ld [ %i1 + 0x1c ], %g2 <== NOT EXECUTED 2006310: f0 28 80 01 stb %i0, [ %g2 + %g1 ] <== NOT EXECUTED 2006314: 82 00 60 01 inc %g1 2006318: 10 80 00 16 b 2006370 200631c: c2 26 60 20 st %g1, [ %i1 + 0x20 ] } /* * FIXME: Should do IMAXBEL handling somehow */ if (tty->ccount < (CBUFSIZE-1)) { 2006320: c4 06 60 20 ld [ %i1 + 0x20 ], %g2 2006324: c2 00 62 e0 ld [ %g1 + 0x2e0 ], %g1 2006328: 82 00 7f ff add %g1, -1, %g1 200632c: 80 a0 80 01 cmp %g2, %g1 2006330: 3a 80 00 11 bcc,a 2006374 <== NEVER TAKEN 2006334: b0 10 20 00 clr %i0 <== NOT EXECUTED if (tty->termios.c_lflag & ECHO) 2006338: c2 06 60 3c ld [ %i1 + 0x3c ], %g1 200633c: 80 88 60 08 btst 8, %g1 2006340: 22 80 00 06 be,a 2006358 <== NEVER TAKEN 2006344: c2 06 60 20 ld [ %i1 + 0x20 ], %g1 <== NOT EXECUTED echo (c, tty); 2006348: 90 10 00 18 mov %i0, %o0 200634c: 7f ff fe f1 call 2005f10 2006350: 92 10 00 19 mov %i1, %o1 tty->cbuf[tty->ccount++] = c; 2006354: c2 06 60 20 ld [ %i1 + 0x20 ], %g1 2006358: c4 06 60 1c ld [ %i1 + 0x1c ], %g2 200635c: f0 28 80 01 stb %i0, [ %g2 + %g1 ] 2006360: 82 00 60 01 inc %g1 2006364: c2 26 60 20 st %g1, [ %i1 + 0x20 ] } return 0; 2006368: 81 c7 e0 08 ret 200636c: 91 e8 20 00 restore %g0, 0, %o0 else if (c == tty->termios.c_cc[VKILL]) { erase (tty, 1); return 0; } else if (c == tty->termios.c_cc[VEOF]) { return 1; 2006370: b0 10 20 01 mov 1, %i0 if (tty->termios.c_lflag & ECHO) echo (c, tty); tty->cbuf[tty->ccount++] = c; } return 0; } 2006374: 81 c7 e0 08 ret 2006378: 81 e8 00 00 restore =============================================================================== 02019f90 : int killinfo( pid_t pid, int sig, const union sigval *value ) { 2019f90: 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() ) 2019f94: 7f ff ff 68 call 2019d34 2019f98: 01 00 00 00 nop 2019f9c: 80 a6 00 08 cmp %i0, %o0 2019fa0: 02 80 00 06 be 2019fb8 2019fa4: 80 a6 60 00 cmp %i1, 0 rtems_set_errno_and_return_minus_one( ESRCH ); 2019fa8: 7f ff d5 b1 call 200f66c <__errno> 2019fac: 01 00 00 00 nop 2019fb0: 10 80 00 a6 b 201a248 2019fb4: 82 10 20 03 mov 3, %g1 ! 3 /* * Validate the signal passed. */ if ( !sig ) 2019fb8: 32 80 00 03 bne,a 2019fc4 2019fbc: ba 06 7f ff add %i1, -1, %i5 2019fc0: 30 80 00 04 b,a 2019fd0 rtems_set_errno_and_return_minus_one( EINVAL ); if ( !is_valid_signo(sig) ) 2019fc4: 80 a7 60 1f cmp %i5, 0x1f 2019fc8: 28 80 00 06 bleu,a 2019fe0 2019fcc: 83 2e 60 02 sll %i1, 2, %g1 rtems_set_errno_and_return_minus_one( EINVAL ); 2019fd0: 7f ff d5 a7 call 200f66c <__errno> 2019fd4: 01 00 00 00 nop 2019fd8: 10 80 00 9c b 201a248 2019fdc: 82 10 20 16 mov 0x16, %g1 ! 16 /* * If the signal is being ignored, then we are out of here. */ if ( _POSIX_signals_Vectors[ sig ].sa_handler == SIG_IGN ) 2019fe0: 85 2e 60 04 sll %i1, 4, %g2 2019fe4: 84 20 80 01 sub %g2, %g1, %g2 2019fe8: 03 00 80 76 sethi %hi(0x201d800), %g1 2019fec: 82 10 63 50 or %g1, 0x350, %g1 ! 201db50 <_POSIX_signals_Vectors> 2019ff0: 82 00 40 02 add %g1, %g2, %g1 2019ff4: c2 00 60 08 ld [ %g1 + 8 ], %g1 2019ff8: 80 a0 60 01 cmp %g1, 1 2019ffc: 02 80 00 9f be 201a278 201a000: 80 a6 60 04 cmp %i1, 4 /* * P1003.1c/Draft 10, p. 33 says that certain signals should always * be directed to the executing thread such as those caused by hardware * faults. */ if ( (sig == SIGFPE) || (sig == SIGILL) || (sig == SIGSEGV ) ) 201a004: 02 80 00 06 be 201a01c 201a008: 80 a6 60 08 cmp %i1, 8 201a00c: 02 80 00 04 be 201a01c 201a010: 80 a6 60 0b cmp %i1, 0xb 201a014: 12 80 00 08 bne 201a034 201a018: 82 10 20 01 mov 1, %g1 return pthread_kill( pthread_self(), sig ); 201a01c: 40 00 01 33 call 201a4e8 201a020: 01 00 00 00 nop 201a024: 40 00 00 f4 call 201a3f4 201a028: 92 10 00 19 mov %i1, %o1 201a02c: 81 c7 e0 08 ret 201a030: 91 e8 00 08 restore %g0, %o0, %o0 /* * Build up a siginfo structure */ siginfo = &siginfo_struct; siginfo->si_signo = sig; 201a034: f2 27 bf f4 st %i1, [ %fp + -12 ] siginfo->si_code = SI_USER; 201a038: c2 27 bf f8 st %g1, [ %fp + -8 ] if ( !value ) { 201a03c: 80 a6 a0 00 cmp %i2, 0 201a040: 12 80 00 04 bne 201a050 201a044: bb 28 40 1d sll %g1, %i5, %i5 siginfo->si_value.sival_int = 0; 201a048: 10 80 00 04 b 201a058 201a04c: c0 27 bf fc clr [ %fp + -4 ] } else { siginfo->si_value = *value; 201a050: c2 06 80 00 ld [ %i2 ], %g1 201a054: c2 27 bf fc st %g1, [ %fp + -4 ] * * This rountine increments the thread dispatch level */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_increment_disable_level(void) { uint32_t level = _Thread_Dispatch_disable_level; 201a058: 03 00 80 75 sethi %hi(0x201d400), %g1 201a05c: c4 00 61 d0 ld [ %g1 + 0x1d0 ], %g2 ! 201d5d0 <_Thread_Dispatch_disable_level> ++level; 201a060: 84 00 a0 01 inc %g2 _Thread_Dispatch_disable_level = level; 201a064: c4 20 61 d0 st %g2, [ %g1 + 0x1d0 ] */ void _POSIX_signals_Manager_Initialization(void); static inline void _POSIX_signals_Add_post_switch_extension(void) { _API_extensions_Add_post_switch( &_POSIX_signals_Post_switch ); 201a068: 11 00 80 72 sethi %hi(0x201c800), %o0 201a06c: 7f ff b7 f9 call 2008050 <_API_extensions_Add_post_switch> 201a070: 90 12 23 a4 or %o0, 0x3a4, %o0 ! 201cba4 <_POSIX_signals_Post_switch> /* * Is the currently executing thread interested? If so then it will * get it an execute it as soon as the dispatcher executes. */ the_thread = _Thread_Executing; 201a074: 03 00 80 76 sethi %hi(0x201d800), %g1 201a078: d0 00 63 00 ld [ %g1 + 0x300 ], %o0 ! 201db00 <_Per_CPU_Information+0x10> api = the_thread->API_Extensions[ THREAD_API_POSIX ]; if ( _POSIX_signals_Is_interested( api, mask ) ) { 201a07c: c4 02 21 5c ld [ %o0 + 0x15c ], %g2 201a080: c4 00 a0 d0 ld [ %g2 + 0xd0 ], %g2 201a084: 80 af 40 02 andncc %i5, %g2, %g0 201a088: 12 80 00 52 bne 201a1d0 201a08c: 03 00 80 77 sethi %hi(0x201dc00), %g1 /* XXX violation of visibility -- need to define thread queue support */ the_chain = &_POSIX_signals_Wait_queue.Queues.Fifo; for ( the_node = _Chain_First( the_chain ); 201a090: 05 00 80 77 sethi %hi(0x201dc00), %g2 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_First( Chain_Control *the_chain ) { return _Chain_Head( the_chain )->next; 201a094: c2 00 60 dc ld [ %g1 + 0xdc ], %g1 201a098: 10 80 00 0a b 201a0c0 201a09c: 84 10 a0 e0 or %g2, 0xe0, %g2 #endif /* * Is this thread is actually blocked waiting for the signal? */ if (the_thread->Wait.option & mask) 201a0a0: 80 8f 40 04 btst %i5, %g4 201a0a4: 12 80 00 4a bne 201a1cc 201a0a8: c6 00 61 5c ld [ %g1 + 0x15c ], %g3 /* * Is this thread is blocked waiting for another signal but has * not blocked this one? */ if (~api->signals_blocked & mask) 201a0ac: c6 00 e0 d0 ld [ %g3 + 0xd0 ], %g3 201a0b0: 80 af 40 03 andncc %i5, %g3, %g0 201a0b4: 12 80 00 47 bne 201a1d0 201a0b8: 90 10 00 01 mov %g1, %o0 the_chain = &_POSIX_signals_Wait_queue.Queues.Fifo; for ( the_node = _Chain_First( the_chain ); !_Chain_Is_tail( the_chain, the_node ) ; the_node = the_node->next ) { 201a0bc: c2 00 40 00 ld [ %g1 ], %g1 /* XXX violation of visibility -- need to define thread queue support */ the_chain = &_POSIX_signals_Wait_queue.Queues.Fifo; for ( the_node = _Chain_First( the_chain ); 201a0c0: 80 a0 40 02 cmp %g1, %g2 201a0c4: 32 bf ff f7 bne,a 201a0a0 201a0c8: c8 00 60 30 ld [ %g1 + 0x30 ], %g4 * NOTES: * * + rtems internal threads do not receive signals. */ interested = NULL; interested_priority = PRIORITY_MAXIMUM + 1; 201a0cc: 03 00 80 72 sethi %hi(0x201c800), %g1 201a0d0: c6 08 61 2c ldub [ %g1 + 0x12c ], %g3 ! 201c92c for (the_api = OBJECTS_CLASSIC_API; the_api <= OBJECTS_APIS_LAST; the_api++) { 201a0d4: b8 10 20 02 mov 2, %i4 * NOTES: * * + rtems internal threads do not receive signals. */ interested = NULL; interested_priority = PRIORITY_MAXIMUM + 1; 201a0d8: 86 00 e0 01 inc %g3 * * NOTES: * * + rtems internal threads do not receive signals. */ interested = NULL; 201a0dc: 82 10 20 00 clr %g1 for (the_api = OBJECTS_CLASSIC_API; the_api <= OBJECTS_APIS_LAST; the_api++) { /* * This can occur when no one is interested and an API is not configured. */ if ( !_Objects_Information_table[ the_api ] ) 201a0e0: 1b 00 80 75 sethi %hi(0x201d400), %o5 */ RTEMS_INLINE_ROUTINE bool _States_Is_interruptible_by_signal ( States_Control the_states ) { return (the_states & STATES_INTERRUPTIBLE_BY_SIGNAL); 201a0e4: 35 04 00 00 sethi %hi(0x10000000), %i2 */ #define _POSIX_signals_Is_interested( _api, _mask ) \ ( ~(_api)->signals_blocked & (_mask) ) int killinfo( 201a0e8: 85 2f 20 02 sll %i4, 2, %g2 for (the_api = OBJECTS_CLASSIC_API; the_api <= OBJECTS_APIS_LAST; the_api++) { /* * This can occur when no one is interested and an API is not configured. */ if ( !_Objects_Information_table[ the_api ] ) 201a0ec: 88 13 61 34 or %o5, 0x134, %g4 201a0f0: c4 01 00 02 ld [ %g4 + %g2 ], %g2 201a0f4: 80 a0 a0 00 cmp %g2, 0 201a0f8: 22 80 00 2f be,a 201a1b4 <== NEVER TAKEN 201a0fc: b8 07 20 01 inc %i4 <== NOT EXECUTED continue; the_info = _Objects_Information_table[ the_api ][ 1 ]; 201a100: c4 00 a0 04 ld [ %g2 + 4 ], %g2 #endif maximum = the_info->maximum; object_table = the_info->local_table; for ( index = 1 ; index <= maximum ; index++ ) { 201a104: b6 10 20 01 mov 1, %i3 */ if ( !the_info ) continue; #endif maximum = the_info->maximum; 201a108: d8 10 a0 10 lduh [ %g2 + 0x10 ], %o4 object_table = the_info->local_table; for ( index = 1 ; index <= maximum ; index++ ) { 201a10c: 10 80 00 26 b 201a1a4 201a110: d6 00 a0 1c ld [ %g2 + 0x1c ], %o3 the_thread = (Thread_Control *) object_table[ index ]; 201a114: c4 02 c0 02 ld [ %o3 + %g2 ], %g2 if ( !the_thread ) 201a118: 80 a0 a0 00 cmp %g2, 0 201a11c: 22 80 00 22 be,a 201a1a4 201a120: 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 ) 201a124: c8 00 a0 14 ld [ %g2 + 0x14 ], %g4 201a128: 80 a1 00 03 cmp %g4, %g3 201a12c: 38 80 00 1e bgu,a 201a1a4 201a130: b6 06 e0 01 inc %i3 #if defined(RTEMS_DEBUG) if ( !api ) continue; #endif if ( !_POSIX_signals_Is_interested( api, mask ) ) 201a134: f0 00 a1 5c ld [ %g2 + 0x15c ], %i0 201a138: f0 06 20 d0 ld [ %i0 + 0xd0 ], %i0 201a13c: 80 af 40 18 andncc %i5, %i0, %g0 201a140: 22 80 00 19 be,a 201a1a4 201a144: 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 ) { 201a148: 80 a1 00 03 cmp %g4, %g3 201a14c: 2a 80 00 14 bcs,a 201a19c 201a150: 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 ) ) { 201a154: 80 a0 60 00 cmp %g1, 0 201a158: 22 80 00 13 be,a 201a1a4 <== NEVER TAKEN 201a15c: b6 06 e0 01 inc %i3 <== NOT EXECUTED 201a160: de 00 60 10 ld [ %g1 + 0x10 ], %o7 201a164: 80 a3 e0 00 cmp %o7, 0 201a168: 22 80 00 0f be,a 201a1a4 <== NEVER TAKEN 201a16c: b6 06 e0 01 inc %i3 <== NOT EXECUTED /* preferred ready over blocked */ DEBUG_STEP("5"); if ( _States_Is_ready( the_thread->current_state ) ) { 201a170: f0 00 a0 10 ld [ %g2 + 0x10 ], %i0 201a174: 80 a6 20 00 cmp %i0, 0 201a178: 22 80 00 09 be,a 201a19c 201a17c: 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) ) { 201a180: 80 8b c0 1a btst %o7, %i2 201a184: 32 80 00 08 bne,a 201a1a4 201a188: b6 06 e0 01 inc %i3 DEBUG_STEP("7"); if ( _States_Is_interruptible_by_signal(the_thread->current_state) ) { 201a18c: 80 8e 00 1a btst %i0, %i2 201a190: 22 80 00 05 be,a 201a1a4 201a194: b6 06 e0 01 inc %i3 */ if ( interested && !_States_Is_ready( interested->current_state ) ) { /* preferred ready over blocked */ DEBUG_STEP("5"); if ( _States_Is_ready( the_thread->current_state ) ) { 201a198: 86 10 00 04 mov %g4, %g3 201a19c: 82 10 00 02 mov %g2, %g1 #endif maximum = the_info->maximum; object_table = the_info->local_table; for ( index = 1 ; index <= maximum ; index++ ) { 201a1a0: b6 06 e0 01 inc %i3 201a1a4: 80 a6 c0 0c cmp %i3, %o4 201a1a8: 08 bf ff db bleu 201a114 201a1ac: 85 2e e0 02 sll %i3, 2, %g2 * + rtems internal threads do not receive signals. */ interested = NULL; interested_priority = PRIORITY_MAXIMUM + 1; for (the_api = OBJECTS_CLASSIC_API; the_api <= OBJECTS_APIS_LAST; the_api++) { 201a1b0: b8 07 20 01 inc %i4 201a1b4: 80 a7 20 04 cmp %i4, 4 201a1b8: 12 bf ff cd bne 201a0ec 201a1bc: 85 2f 20 02 sll %i4, 2, %g2 } } } } if ( interested ) { 201a1c0: 80 a0 60 00 cmp %g1, 0 201a1c4: 02 80 00 0c be 201a1f4 201a1c8: 01 00 00 00 nop /* * Is this thread is blocked waiting for another signal but has * not blocked this one? */ if (~api->signals_blocked & mask) 201a1cc: 90 10 00 01 mov %g1, %o0 /* * Returns true if the signal was synchronously given to a thread * blocked waiting for the signal. */ if ( _POSIX_signals_Unblock_thread( the_thread, sig, siginfo ) ) { 201a1d0: 92 10 00 19 mov %i1, %o1 201a1d4: 40 00 00 36 call 201a2ac <_POSIX_signals_Unblock_thread> 201a1d8: 94 07 bf f4 add %fp, -12, %o2 201a1dc: 80 8a 20 ff btst 0xff, %o0 201a1e0: 02 80 00 05 be 201a1f4 201a1e4: 01 00 00 00 nop _Thread_Enable_dispatch(); 201a1e8: 7f ff bf 9a call 200a050 <_Thread_Enable_dispatch> 201a1ec: b0 10 20 00 clr %i0 ! 0 201a1f0: 30 80 00 23 b,a 201a27c /* * 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 ); 201a1f4: 40 00 00 24 call 201a284 <_POSIX_signals_Set_process_signals> 201a1f8: 90 10 00 1d mov %i5, %o0 if ( _POSIX_signals_Vectors[ sig ].sa_flags == SA_SIGINFO ) { 201a1fc: 83 2e 60 02 sll %i1, 2, %g1 201a200: b3 2e 60 04 sll %i1, 4, %i1 201a204: b2 26 40 01 sub %i1, %g1, %i1 201a208: 03 00 80 76 sethi %hi(0x201d800), %g1 201a20c: 82 10 63 50 or %g1, 0x350, %g1 ! 201db50 <_POSIX_signals_Vectors> 201a210: c2 00 40 19 ld [ %g1 + %i1 ], %g1 201a214: 80 a0 60 02 cmp %g1, 2 201a218: 12 bf ff f4 bne 201a1e8 201a21c: 11 00 80 77 sethi %hi(0x201dc00), %o0 psiginfo = (POSIX_signals_Siginfo_node *) 201a220: 7f ff b7 f1 call 20081e4 <_Chain_Get> 201a224: 90 12 20 d0 or %o0, 0xd0, %o0 ! 201dcd0 <_POSIX_signals_Inactive_siginfo> _Chain_Get( &_POSIX_signals_Inactive_siginfo ); if ( !psiginfo ) { 201a228: ba 92 20 00 orcc %o0, 0, %i5 201a22c: 12 80 00 0a bne 201a254 201a230: 92 07 bf f4 add %fp, -12, %o1 _Thread_Enable_dispatch(); 201a234: 7f ff bf 87 call 200a050 <_Thread_Enable_dispatch> 201a238: 01 00 00 00 nop rtems_set_errno_and_return_minus_one( EAGAIN ); 201a23c: 7f ff d5 0c call 200f66c <__errno> 201a240: 01 00 00 00 nop 201a244: 82 10 20 0b mov 0xb, %g1 ! b 201a248: c2 22 00 00 st %g1, [ %o0 ] 201a24c: 81 c7 e0 08 ret 201a250: 91 e8 3f ff restore %g0, -1, %o0 } psiginfo->Info = *siginfo; 201a254: 90 07 60 08 add %i5, 8, %o0 201a258: 7f ff d7 56 call 200ffb0 201a25c: 94 10 20 0c mov 0xc, %o2 _Chain_Append( &_POSIX_signals_Siginfo[ sig ], &psiginfo->Node ); 201a260: 11 00 80 77 sethi %hi(0x201dc00), %o0 201a264: 92 10 00 1d mov %i5, %o1 201a268: 90 12 21 48 or %o0, 0x148, %o0 201a26c: 7f ff b7 d2 call 20081b4 <_Chain_Append> 201a270: 90 02 00 19 add %o0, %i1, %o0 201a274: 30 bf ff dd b,a 201a1e8 /* * If the signal is being ignored, then we are out of here. */ if ( _POSIX_signals_Vectors[ sig ].sa_handler == SIG_IGN ) return 0; 201a278: b0 10 20 00 clr %i0 } DEBUG_STEP("\n"); _Thread_Enable_dispatch(); return 0; } 201a27c: 81 c7 e0 08 ret 201a280: 81 e8 00 00 restore =============================================================================== 02003e30 : extern void _wrapup_reent(struct _reent *); extern void _reclaim_reent(struct _reent *); void libc_wrapup(void) { 2003e30: 9d e3 bf a0 save %sp, -96, %sp /* * In case RTEMS is already down, don't do this. It could be * dangerous. */ if (!_System_state_Is_up(_System_state_Get())) 2003e34: 03 00 80 76 sethi %hi(0x201d800), %g1 2003e38: c2 00 62 e8 ld [ %g1 + 0x2e8 ], %g1 ! 201dae8 <_System_state_Current> 2003e3c: 80 a0 60 03 cmp %g1, 3 2003e40: 12 80 00 16 bne 2003e98 <== NEVER TAKEN 2003e44: 03 00 80 6f sethi %hi(0x201bc00), %g1 /* * This was already done if the user called exit() directly . _wrapup_reent(0); */ if (_REENT != _global_impure_ptr) { 2003e48: 39 00 80 73 sethi %hi(0x201cc00), %i4 2003e4c: fa 00 62 a0 ld [ %g1 + 0x2a0 ], %i5 2003e50: c2 07 20 60 ld [ %i4 + 0x60 ], %g1 2003e54: 80 a0 40 1d cmp %g1, %i5 2003e58: 22 80 00 06 be,a 2003e70 2003e5c: 3b 00 80 73 sethi %hi(0x201cc00), %i5 _wrapup_reent(_global_impure_ptr); 2003e60: 40 00 31 32 call 2010328 <_wrapup_reent> 2003e64: 90 10 00 1d mov %i5, %o0 /* Don't reclaim this one, just in case we do printfs * on the way out to ROM. */ _reclaim_reent(&libc_global_reent); #endif _REENT = _global_impure_ptr; 2003e68: fa 27 20 60 st %i5, [ %i4 + 0x60 ] * * Should this be changed to do *all* file streams? * _fwalk (_REENT, fclose); */ fclose (stdin); 2003e6c: 3b 00 80 73 sethi %hi(0x201cc00), %i5 2003e70: c2 07 60 60 ld [ %i5 + 0x60 ], %g1 ! 201cc60 <_impure_ptr> 2003e74: 40 00 2e 50 call 200f7b4 2003e78: d0 00 60 04 ld [ %g1 + 4 ], %o0 fclose (stdout); 2003e7c: c2 07 60 60 ld [ %i5 + 0x60 ], %g1 2003e80: 40 00 2e 4d call 200f7b4 2003e84: d0 00 60 08 ld [ %g1 + 8 ], %o0 fclose (stderr); 2003e88: c2 07 60 60 ld [ %i5 + 0x60 ], %g1 2003e8c: f0 00 60 0c ld [ %g1 + 0xc ], %i0 2003e90: 40 00 2e 49 call 200f7b4 2003e94: 81 e8 00 00 restore 2003e98: 81 c7 e0 08 ret <== NOT EXECUTED 2003e9c: 81 e8 00 00 restore <== NOT EXECUTED =============================================================================== 02003900 : #include "malloc_p.h" void *malloc( size_t size ) { 2003900: 9d e3 bf a0 save %sp, -96, %sp void *return_this; MSBUMP(malloc_calls, 1); 2003904: 03 00 80 75 sethi %hi(0x201d400), %g1 2003908: 82 10 60 50 or %g1, 0x50, %g1 ! 201d450 200390c: c4 00 60 04 ld [ %g1 + 4 ], %g2 2003910: 84 00 a0 01 inc %g2 /* * If some free's have been deferred, then do them now. */ malloc_deferred_frees_process(); 2003914: 7f ff ff b9 call 20037f8 2003918: c4 20 60 04 st %g2, [ %g1 + 4 ] /* * Validate the parameters */ if ( !size ) 200391c: 80 a6 20 00 cmp %i0, 0 2003920: 12 80 00 04 bne 2003930 2003924: 03 00 80 76 sethi %hi(0x201d800), %g1 return (void *) 0; 2003928: 10 80 00 32 b 20039f0 200392c: ba 10 20 00 clr %i5 /* * Do not attempt to allocate memory if not in correct system state. */ if ( _System_state_Is_up(_System_state_Get()) && 2003930: c2 00 62 e8 ld [ %g1 + 0x2e8 ], %g1 2003934: 80 a0 60 03 cmp %g1, 3 2003938: 02 80 00 0c be 2003968 200393c: 39 00 80 72 sethi %hi(0x201c800), %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 ); 2003940: d0 07 21 b0 ld [ %i4 + 0x1b0 ], %o0 ! 201c9b0 2003944: 92 10 00 18 mov %i0, %o1 2003948: 94 10 20 00 clr %o2 200394c: 40 00 16 9b call 20093b8 <_Protected_heap_Allocate_aligned_with_boundary> 2003950: 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 ) { 2003954: ba 92 20 00 orcc %o0, 0, %i5 2003958: 12 80 00 18 bne 20039b8 200395c: 03 00 80 74 sethi %hi(0x201d000), %g1 return_this = (*rtems_malloc_extend_handler)( RTEMS_Malloc_Heap, size ); 2003960: 10 80 00 09 b 2003984 2003964: d0 07 21 b0 ld [ %i4 + 0x1b0 ], %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() ) 2003968: 7f ff ff 98 call 20037c8 200396c: 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()) && 2003970: 80 8a 20 ff btst 0xff, %o0 2003974: 12 bf ff f3 bne 2003940 <== ALWAYS TAKEN 2003978: 01 00 00 00 nop 200397c: 10 80 00 1d b 20039f0 <== NOT EXECUTED 2003980: ba 10 20 00 clr %i5 ! 0 <== NOT EXECUTED */ return_this = _Protected_heap_Allocate( RTEMS_Malloc_Heap, size ); if ( !return_this ) { return_this = (*rtems_malloc_extend_handler)( RTEMS_Malloc_Heap, size ); 2003984: 03 00 80 69 sethi %hi(0x201a400), %g1 2003988: c2 00 63 c0 ld [ %g1 + 0x3c0 ], %g1 ! 201a7c0 200398c: 9f c0 40 00 call %g1 2003990: 92 10 00 18 mov %i0, %o1 if ( !return_this ) { 2003994: ba 92 20 00 orcc %o0, 0, %i5 2003998: 12 80 00 08 bne 20039b8 <== NEVER TAKEN 200399c: 03 00 80 74 sethi %hi(0x201d000), %g1 errno = ENOMEM; 20039a0: 40 00 2f 33 call 200f66c <__errno> 20039a4: b0 10 00 1d mov %i5, %i0 20039a8: 82 10 20 0c mov 0xc, %g1 20039ac: c2 22 00 00 st %g1, [ %o0 ] 20039b0: 81 c7 e0 08 ret 20039b4: 81 e8 00 00 restore } /* * If the user wants us to dirty the allocated memory, then do it. */ if ( rtems_malloc_dirty_helper ) 20039b8: c2 00 61 8c ld [ %g1 + 0x18c ], %g1 20039bc: 80 a0 60 00 cmp %g1, 0 20039c0: 02 80 00 04 be 20039d0 20039c4: 90 10 00 1d mov %i5, %o0 (*rtems_malloc_dirty_helper)( return_this, size ); 20039c8: 9f c0 40 00 call %g1 20039cc: 92 10 00 18 mov %i0, %o1 /* * If configured, update the statistics */ if ( rtems_malloc_statistics_helpers ) 20039d0: 03 00 80 74 sethi %hi(0x201d000), %g1 20039d4: c2 00 61 90 ld [ %g1 + 0x190 ], %g1 ! 201d190 20039d8: 80 a0 60 00 cmp %g1, 0 20039dc: 22 80 00 06 be,a 20039f4 20039e0: b0 10 00 1d mov %i5, %i0 (*rtems_malloc_statistics_helpers->at_malloc)(return_this); 20039e4: c2 00 60 04 ld [ %g1 + 4 ], %g1 20039e8: 9f c0 40 00 call %g1 20039ec: 90 10 00 1d mov %i5, %o0 return return_this; } 20039f0: b0 10 00 1d mov %i5, %i0 20039f4: 81 c7 e0 08 ret 20039f8: 81 e8 00 00 restore =============================================================================== 0200dcc8 : * Allocate a block for an in-memory file. */ int memfile_blocks_allocated = 0; void *memfile_alloc_block(void) { 200dcc8: 9d e3 bf a0 save %sp, -96, %sp void *memory; memory = (void *)calloc(1, IMFS_MEMFILE_BYTES_PER_BLOCK); 200dccc: 03 00 80 74 sethi %hi(0x201d000), %g1 200dcd0: d2 00 61 b8 ld [ %g1 + 0x1b8 ], %o1 ! 201d1b8 200dcd4: 7f ff d5 84 call 20032e4 200dcd8: 90 10 20 01 mov 1, %o0 if ( memory ) 200dcdc: b0 92 20 00 orcc %o0, 0, %i0 200dce0: 02 80 00 05 be 200dcf4 <== NEVER TAKEN 200dce4: 03 00 80 74 sethi %hi(0x201d000), %g1 memfile_blocks_allocated++; 200dce8: c4 00 62 cc ld [ %g1 + 0x2cc ], %g2 ! 201d2cc 200dcec: 84 00 a0 01 inc %g2 200dcf0: c4 20 62 cc st %g2, [ %g1 + 0x2cc ] return memory; } 200dcf4: 81 c7 e0 08 ret 200dcf8: 81 e8 00 00 restore =============================================================================== 0200e7f0 : int memfile_ftruncate( rtems_libio_t *iop, off_t length ) { 200e7f0: 9d e3 bf 98 save %sp, -104, %sp IMFS_jnode_t *the_jnode; the_jnode = iop->pathinfo.node_access; 200e7f4: 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 ) 200e7f8: c2 07 60 50 ld [ %i5 + 0x50 ], %g1 200e7fc: 80 a0 40 19 cmp %g1, %i1 200e800: 06 80 00 09 bl 200e824 <== NEVER TAKEN 200e804: 90 10 00 1d mov %i5, %o0 200e808: 32 80 00 0d bne,a 200e83c <== NEVER TAKEN 200e80c: f2 27 60 50 st %i1, [ %i5 + 0x50 ] <== NOT EXECUTED 200e810: c2 07 60 54 ld [ %i5 + 0x54 ], %g1 200e814: 80 a0 40 1a cmp %g1, %i2 200e818: 3a 80 00 09 bcc,a 200e83c 200e81c: f2 27 60 50 st %i1, [ %i5 + 0x50 ] return IMFS_memfile_extend( the_jnode, true, length ); 200e820: 90 10 00 1d mov %i5, %o0 200e824: 92 10 20 01 mov 1, %o1 200e828: 94 10 00 19 mov %i1, %o2 200e82c: 7f ff fe df call 200e3a8 200e830: 96 10 00 1a mov %i2, %o3 200e834: 81 c7 e0 08 ret 200e838: 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; 200e83c: f4 27 60 54 st %i2, [ %i5 + 0x54 ] IMFS_update_atime( the_jnode ); 200e840: 90 07 bf f8 add %fp, -8, %o0 200e844: 7f ff d3 85 call 2003658 200e848: 92 10 20 00 clr %o1 200e84c: c2 07 bf f8 ld [ %fp + -8 ], %g1 200e850: c2 27 60 40 st %g1, [ %i5 + 0x40 ] return 0; } 200e854: 81 c7 e0 08 ret 200e858: 91 e8 20 00 restore %g0, 0, %o0 =============================================================================== 0200e774 : rtems_libio_t *iop, const char *pathname, int oflag, mode_t mode ) { 200e774: 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) 200e778: c2 06 20 10 ld [ %i0 + 0x10 ], %g1 200e77c: 80 88 60 04 btst 4, %g1 200e780: 12 80 00 04 bne 200e790 200e784: d0 06 20 1c ld [ %i0 + 0x1c ], %o0 if ((count != 0) && (IMFS_memfile_write(the_jnode, 0, buffer, count) == -1)) return -1; } return 0; 200e788: 81 c7 e0 08 ret 200e78c: 91 e8 20 00 restore %g0, 0, %o0 200e790: 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)) { 200e794: c2 00 40 00 ld [ %g1 ], %g1 200e798: 80 a0 60 05 cmp %g1, 5 200e79c: 12 bf ff fb bne 200e788 <== ALWAYS TAKEN 200e7a0: 03 00 80 6d sethi %hi(0x201b400), %g1 uint32_t count = the_jnode->info.linearfile.size; 200e7a4: d8 02 20 54 ld [ %o0 + 0x54 ], %o4 <== NOT EXECUTED const unsigned char *buffer = the_jnode->info.linearfile.direct; 200e7a8: d6 02 20 58 ld [ %o0 + 0x58 ], %o3 <== NOT EXECUTED the_jnode->control = &IMFS_node_control_memfile; the_jnode->info.file.size = 0; 200e7ac: 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; 200e7b0: 82 10 63 34 or %g1, 0x334, %g1 <== NOT EXECUTED the_jnode->info.file.size = 0; 200e7b4: 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; 200e7b8: c2 22 20 4c st %g1, [ %o0 + 0x4c ] <== NOT EXECUTED the_jnode->info.file.size = 0; the_jnode->info.file.indirect = 0; 200e7bc: c0 22 20 58 clr [ %o0 + 0x58 ] <== NOT EXECUTED the_jnode->info.file.doubly_indirect = 0; 200e7c0: c0 22 20 5c clr [ %o0 + 0x5c ] <== NOT EXECUTED the_jnode->info.file.triply_indirect = 0; if ((count != 0) 200e7c4: 80 a3 20 00 cmp %o4, 0 <== NOT EXECUTED 200e7c8: 02 bf ff f0 be 200e788 <== NOT EXECUTED 200e7cc: c0 22 20 60 clr [ %o0 + 0x60 ] <== NOT EXECUTED && (IMFS_memfile_write(the_jnode, 0, buffer, count) == -1)) 200e7d0: 92 10 20 00 clr %o1 <== NOT EXECUTED 200e7d4: 7f ff ff 5d call 200e548 <== NOT EXECUTED 200e7d8: 94 10 20 00 clr %o2 <== NOT EXECUTED return -1; 200e7dc: 90 38 00 08 xnor %g0, %o0, %o0 <== NOT EXECUTED 200e7e0: 80 a0 00 08 cmp %g0, %o0 <== NOT EXECUTED 200e7e4: b0 40 3f ff addx %g0, -1, %i0 <== NOT EXECUTED } return 0; } 200e7e8: 81 c7 e0 08 ret <== NOT EXECUTED 200e7ec: 81 e8 00 00 restore <== NOT EXECUTED =============================================================================== 02003b1c : const char *target, const char *filesystemtype, rtems_filesystem_options_t options, const void *data ) { 2003b1c: 9d e3 bf 50 save %sp, -176, %sp int rv = 0; if ( 2003b20: 80 a6 e0 01 cmp %i3, 1 2003b24: 18 80 00 b4 bgu 2003df4 2003b28: 01 00 00 00 nop options == RTEMS_FILESYSTEM_READ_ONLY || options == RTEMS_FILESYSTEM_READ_WRITE ) { rtems_filesystem_fsmount_me_t fsmount_me_h = 2003b2c: 40 00 21 90 call 200c16c 2003b30: 90 10 00 1a mov %i2, %o0 rtems_filesystem_get_mount_handler( filesystemtype ); if ( fsmount_me_h != NULL ) { 2003b34: a6 92 20 00 orcc %o0, 0, %l3 2003b38: 02 80 00 af be 2003df4 2003b3c: 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 : "/"; 2003b40: 12 80 00 04 bne 2003b50 2003b44: 01 00 00 00 nop 2003b48: 23 00 80 6c sethi %hi(0x201b000), %l1 2003b4c: a2 14 63 40 or %l1, 0x340, %l1 ! 201b340 size_t filesystemtype_size = strlen( filesystemtype ) + 1; 2003b50: 40 00 34 4e call 2010c88 2003b54: 90 10 00 1a mov %i2, %o0 size_t source_size = source_or_null != NULL ? strlen( source_or_null ) + 1 : 0; 2003b58: 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; 2003b5c: ba 10 00 08 mov %o0, %i5 size_t source_size = source_or_null != NULL ? strlen( source_or_null ) + 1 : 0; 2003b60: 02 80 00 06 be 2003b78 2003b64: ac 02 20 01 add %o0, 1, %l6 2003b68: 40 00 34 48 call 2010c88 2003b6c: 90 10 00 18 mov %i0, %o0 2003b70: 10 80 00 03 b 2003b7c 2003b74: a0 02 20 01 add %o0, 1, %l0 2003b78: 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 2003b7c: 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; 2003b80: 40 00 34 42 call 2010c88 2003b84: 90 10 00 11 mov %l1, %o0 size_t size = sizeof( rtems_filesystem_mount_table_entry_t ) + filesystemtype_size + source_size + target_size 2003b88: 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; 2003b8c: aa 02 20 01 add %o0, 1, %l5 size_t size = sizeof( rtems_filesystem_mount_table_entry_t ) + filesystemtype_size + source_size + target_size + sizeof( rtems_filesystem_global_location_t ); rtems_filesystem_mount_table_entry_t *mt_entry = calloc( 1, size ); 2003b90: 90 10 20 01 mov 1, %o0 2003b94: 7f ff fd d4 call 20032e4 2003b98: 92 02 40 15 add %o1, %l5, %o1 if ( mt_entry != NULL ) { 2003b9c: ba 92 20 00 orcc %o0, 0, %i5 2003ba0: 02 80 00 9d be 2003e14 <== NEVER TAKEN 2003ba4: a4 07 60 64 add %i5, 0x64, %l2 rtems_filesystem_global_location_t *mt_fs_root = (rtems_filesystem_global_location_t *) ((char *) mt_entry + sizeof( *mt_entry )); char *str = (char *) mt_fs_root + sizeof( *mt_fs_root ); memcpy( str, filesystemtype, filesystemtype_size ); 2003ba8: 92 10 00 1a mov %i2, %o1 2003bac: 90 10 00 12 mov %l2, %o0 2003bb0: 40 00 31 00 call 200ffb0 2003bb4: 94 10 00 16 mov %l6, %o2 mt_entry->type = str; 2003bb8: e4 27 60 34 st %l2, [ %i5 + 0x34 ] + filesystemtype_size + source_size + target_size + sizeof( rtems_filesystem_global_location_t ); rtems_filesystem_mount_table_entry_t *mt_entry = calloc( 1, size ); if ( mt_entry != NULL ) { rtems_filesystem_global_location_t *mt_fs_root = 2003bbc: a8 07 60 40 add %i5, 0x40, %l4 memcpy( str, filesystemtype, filesystemtype_size ); mt_entry->type = str; str += filesystemtype_size; if ( source_or_null != NULL ) { 2003bc0: 80 a6 20 00 cmp %i0, 0 2003bc4: 02 80 00 08 be 2003be4 2003bc8: b4 04 80 16 add %l2, %l6, %i2 memcpy( str, source_or_null, source_size ); 2003bcc: 90 10 00 1a mov %i2, %o0 2003bd0: 92 10 00 18 mov %i0, %o1 2003bd4: 40 00 30 f7 call 200ffb0 2003bd8: 94 10 00 10 mov %l0, %o2 mt_entry->dev = str; 2003bdc: f4 27 60 38 st %i2, [ %i5 + 0x38 ] str += source_size; 2003be0: b4 06 80 10 add %i2, %l0, %i2 } memcpy( str, target, target_size ); 2003be4: 92 10 00 11 mov %l1, %o1 2003be8: 94 10 00 15 mov %l5, %o2 2003bec: 40 00 30 f1 call 200ffb0 2003bf0: 90 10 00 1a mov %i2, %o0 mt_entry->target = str; str += target_size; mt_entry->mounted = true; 2003bf4: 82 10 20 01 mov 1, %g1 2003bf8: 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; 2003bfc: 03 00 80 6c sethi %hi(0x201b000), %g1 2003c00: 82 10 63 44 or %g1, 0x344, %g1 ! 201b344 2003c04: c2 27 60 2c st %g1, [ %i5 + 0x2c ] mt_fs_root->location.mt_entry = mt_entry; mt_fs_root->reference_count = 1; 2003c08: 82 10 20 01 mov 1, %g1 void *starting_address, size_t number_nodes, size_t node_size ) { _Chain_Initialize( the_chain, starting_address, number_nodes, node_size ); 2003c0c: 90 07 60 14 add %i5, 0x14, %o0 2003c10: c2 27 60 58 st %g1, [ %i5 + 0x58 ] 2003c14: 92 10 00 14 mov %l4, %o1 2003c18: 94 10 20 01 mov 1, %o2 2003c1c: 96 10 20 24 mov 0x24, %o3 mt_entry->dev = str; str += source_size; } memcpy( str, target, target_size ); mt_entry->target = str; 2003c20: f4 27 60 30 st %i2, [ %i5 + 0x30 ] str += target_size; mt_entry->mounted = true; mt_entry->mt_fs_root = mt_fs_root; 2003c24: e8 27 60 24 st %l4, [ %i5 + 0x24 ] 2003c28: 40 00 11 7e call 2008220 <_Chain_Initialize> 2003c2c: fa 27 60 54 st %i5, [ %i5 + 0x54 ] filesystemtype, &target_length ); if ( mt_entry != NULL ) { mt_entry->writeable = options == RTEMS_FILESYSTEM_READ_WRITE; 2003c30: b6 0e e0 01 and %i3, 1, %i3 rv = (*fsmount_me_h)( mt_entry, data ); 2003c34: 90 10 00 1d mov %i5, %o0 filesystemtype, &target_length ); if ( mt_entry != NULL ) { mt_entry->writeable = options == RTEMS_FILESYSTEM_READ_WRITE; 2003c38: f6 2f 60 29 stb %i3, [ %i5 + 0x29 ] rv = (*fsmount_me_h)( mt_entry, data ); 2003c3c: 9f c4 c0 00 call %l3 2003c40: 92 10 00 1c mov %i4, %o1 if ( rv == 0 ) { 2003c44: b0 92 20 00 orcc %o0, 0, %i0 2003c48: 12 80 00 6f bne 2003e04 2003c4c: 80 a6 60 00 cmp %i1, 0 if ( target != NULL ) { 2003c50: 02 80 00 38 be 2003d30 2003c54: 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 = 2003c58: 94 10 20 1f mov 0x1f, %o2 2003c5c: 40 00 02 fd call 2004850 2003c60: 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; 2003c64: c2 02 20 14 ld [ %o0 + 0x14 ], %g1 return (*mt_entry->ops->are_nodes_equal_h)( 2003c68: c4 00 60 0c ld [ %g1 + 0xc ], %g2 2003c6c: c4 00 a0 10 ld [ %g2 + 0x10 ], %g2 2003c70: 9f c0 80 00 call %g2 2003c74: 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 ) ) { 2003c78: 80 8a 20 ff btst 0xff, %o0 2003c7c: 12 80 00 22 bne 2003d04 2003c80: 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( 2003c84: 40 00 03 ed call 2004c38 2003c88: 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 ); 2003c8c: 40 00 04 63 call 2004e18 2003c90: 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 ); 2003c94: 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; 2003c98: d0 27 60 20 st %o0, [ %i5 + 0x20 ] rv = (*mt_point_node->location.mt_entry->ops->mount_h)( mt_entry ); 2003c9c: 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 ); 2003ca0: 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 ); 2003ca4: c2 00 60 30 ld [ %g1 + 0x30 ], %g1 2003ca8: 9f c0 40 00 call %g1 2003cac: 90 10 00 1d mov %i5, %o0 if ( rv == 0 ) { 2003cb0: b0 92 20 00 orcc %o0, 0, %i0 2003cb4: 12 80 00 11 bne 2003cf8 2003cb8: 92 10 20 00 clr %o1 */ #include static inline void rtems_libio_lock( void ) { rtems_semaphore_obtain( rtems_libio_semaphore, RTEMS_WAIT, RTEMS_NO_TIMEOUT ); 2003cbc: 39 00 80 75 sethi %hi(0x201d400), %i4 2003cc0: d0 07 20 4c ld [ %i4 + 0x4c ], %o0 ! 201d44c 2003cc4: 40 00 0e 80 call 20076c4 2003cc8: 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; 2003ccc: 03 00 80 72 sethi %hi(0x201c800), %g1 } static inline void rtems_libio_unlock( void ) { rtems_semaphore_release( rtems_libio_semaphore ); 2003cd0: d0 07 20 4c ld [ %i4 + 0x4c ], %o0 2003cd4: 82 10 62 c8 or %g1, 0x2c8, %g1 2003cd8: c4 00 60 08 ld [ %g1 + 8 ], %g2 the_node->next = tail; 2003cdc: 86 00 60 04 add %g1, 4, %g3 2003ce0: c6 27 40 00 st %g3, [ %i5 ] tail->previous = the_node; 2003ce4: fa 20 60 08 st %i5, [ %g1 + 8 ] old_last->next = the_node; 2003ce8: fa 20 80 00 st %i5, [ %g2 ] 2003cec: 40 00 0e bf call 20077e8 2003cf0: c4 27 60 04 st %g2, [ %i5 + 4 ] 2003cf4: 30 80 00 08 b,a 2003d14 &rtems_filesystem_mount_table, &mt_entry->mt_node ); rtems_filesystem_mt_unlock(); } else { rtems_filesystem_global_location_release( mt_point_node ); 2003cf8: 40 00 03 f5 call 2004ccc 2003cfc: 90 10 00 1c mov %i4, %o0 2003d00: 30 80 00 05 b,a 2003d14 } } else { rtems_filesystem_eval_path_error( &ctx, EBUSY ); 2003d04: 90 07 bf c8 add %fp, -56, %o0 2003d08: 92 10 20 10 mov 0x10, %o1 2003d0c: 40 00 02 3b call 20045f8 2003d10: b0 10 3f ff mov -1, %i0 rv = -1; } rtems_filesystem_eval_path_cleanup( &ctx ); 2003d14: 40 00 03 0b call 2004940 2003d18: 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 ) { 2003d1c: 80 a6 20 00 cmp %i0, 0 2003d20: 02 80 00 42 be 2003e28 2003d24: 01 00 00 00 nop (*mt_entry->ops->fsunmount_me_h)( mt_entry ); 2003d28: 10 80 00 2f b 2003de4 2003d2c: c2 07 60 0c ld [ %i5 + 0xc ], %g1 */ #include static inline void rtems_libio_lock( void ) { rtems_semaphore_obtain( rtems_libio_semaphore, RTEMS_WAIT, RTEMS_NO_TIMEOUT ); 2003d30: 03 00 80 75 sethi %hi(0x201d400), %g1 2003d34: d0 00 60 4c ld [ %g1 + 0x4c ], %o0 ! 201d44c 2003d38: 92 10 20 00 clr %o1 2003d3c: 40 00 0e 62 call 20076c4 2003d40: 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; 2003d44: 05 00 80 72 sethi %hi(0x201c800), %g2 ) { int rv = 0; rtems_filesystem_mt_lock(); if ( rtems_chain_is_empty( &rtems_filesystem_mount_table ) ) { 2003d48: c6 00 a2 c8 ld [ %g2 + 0x2c8 ], %g3 ! 201cac8 2003d4c: 82 10 a2 c8 or %g2, 0x2c8, %g1 2003d50: 84 00 60 04 add %g1, 4, %g2 2003d54: 80 a0 c0 02 cmp %g3, %g2 2003d58: 12 80 00 08 bne 2003d78 <== NEVER TAKEN 2003d5c: 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; 2003d60: c4 00 60 08 ld [ %g1 + 8 ], %g2 the_node->next = tail; 2003d64: c6 27 40 00 st %g3, [ %i5 ] tail->previous = the_node; 2003d68: fa 20 60 08 st %i5, [ %g1 + 8 ] old_last->next = the_node; 2003d6c: fa 20 80 00 st %i5, [ %g2 ] the_node->previous = old_last; 2003d70: 10 80 00 06 b 2003d88 2003d74: c4 27 60 04 st %g2, [ %i5 + 4 ] rtems_chain_append_unprotected( &rtems_filesystem_mount_table, &mt_entry->mt_node ); } else { errno = EINVAL; 2003d78: 40 00 2e 3d call 200f66c <__errno> <== NOT EXECUTED 2003d7c: b0 10 3f ff mov -1, %i0 <== NOT EXECUTED 2003d80: 82 10 20 16 mov 0x16, %g1 <== NOT EXECUTED 2003d84: c2 22 00 00 st %g1, [ %o0 ] <== NOT EXECUTED } static inline void rtems_libio_unlock( void ) { rtems_semaphore_release( rtems_libio_semaphore ); 2003d88: 03 00 80 75 sethi %hi(0x201d400), %g1 2003d8c: 40 00 0e 97 call 20077e8 2003d90: d0 00 60 4c ld [ %g1 + 0x4c ], %o0 ! 201d44c rv = -1; } rtems_filesystem_mt_unlock(); if ( rv == 0 ) { 2003d94: 80 a6 20 00 cmp %i0, 0 2003d98: 32 80 00 13 bne,a 2003de4 <== NEVER TAKEN 2003d9c: 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 ); 2003da0: 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 = 2003da4: 40 00 03 eb call 2004d50 2003da8: 90 10 00 1d mov %i5, %o0 2003dac: b6 10 00 08 mov %o0, %i3 rtems_filesystem_global_location_obtain( &mt_entry->mt_fs_root ); rtems_filesystem_global_location_t *new_fs_current = 2003db0: 40 00 03 e8 call 2004d50 2003db4: 90 10 00 1d mov %i5, %o0 rtems_filesystem_global_location_obtain( &mt_entry->mt_fs_root ); rtems_filesystem_global_location_assign( 2003db8: 3b 00 80 72 sethi %hi(0x201c800), %i5 rtems_filesystem_mt_unlock(); if ( rv == 0 ) { rtems_filesystem_global_location_t *new_fs_root = rtems_filesystem_global_location_obtain( &mt_entry->mt_fs_root ); rtems_filesystem_global_location_t *new_fs_current = 2003dbc: b8 10 00 08 mov %o0, %i4 rtems_filesystem_global_location_obtain( &mt_entry->mt_fs_root ); rtems_filesystem_global_location_assign( 2003dc0: d0 07 62 e8 ld [ %i5 + 0x2e8 ], %o0 2003dc4: 92 10 00 1b mov %i3, %o1 2003dc8: 40 00 03 d9 call 2004d2c 2003dcc: 90 02 20 04 add %o0, 4, %o0 &rtems_filesystem_root, new_fs_root ); rtems_filesystem_global_location_assign( 2003dd0: d0 07 62 e8 ld [ %i5 + 0x2e8 ], %o0 2003dd4: 40 00 03 d6 call 2004d2c 2003dd8: 92 10 00 1c mov %i4, %o1 2003ddc: 81 c7 e0 08 ret 2003de0: 81 e8 00 00 restore } else { rv = register_root_file_system( mt_entry ); } if ( rv != 0 ) { (*mt_entry->ops->fsunmount_me_h)( mt_entry ); 2003de4: c2 00 60 3c ld [ %g1 + 0x3c ], %g1 2003de8: 9f c0 40 00 call %g1 2003dec: 90 10 00 1d mov %i5, %o0 2003df0: 30 80 00 05 b,a 2003e04 } else { errno = EINVAL; rv = -1; } } else { errno = EINVAL; 2003df4: 40 00 2e 1e call 200f66c <__errno> 2003df8: 01 00 00 00 nop 2003dfc: 10 80 00 09 b 2003e20 2003e00: 82 10 20 16 mov 0x16, %g1 ! 16 (*mt_entry->ops->fsunmount_me_h)( mt_entry ); } } if ( rv != 0 ) { free( mt_entry ); 2003e04: 7f ff fd eb call 20035b0 2003e08: 90 10 00 1d mov %i5, %o0 2003e0c: 81 c7 e0 08 ret 2003e10: 81 e8 00 00 restore } } else { errno = ENOMEM; 2003e14: 40 00 2e 16 call 200f66c <__errno> <== NOT EXECUTED 2003e18: 01 00 00 00 nop <== NOT EXECUTED 2003e1c: 82 10 20 0c mov 0xc, %g1 ! c <== NOT EXECUTED 2003e20: c2 22 00 00 st %g1, [ %o0 ] rv = -1; 2003e24: b0 10 3f ff mov -1, %i0 errno = EINVAL; rv = -1; } return rv; } 2003e28: 81 c7 e0 08 ret 2003e2c: 81 e8 00 00 restore =============================================================================== 02008844 : const char *target, const char *filesystemtype, rtems_filesystem_options_t options, const void *data ) { 2008844: 9d e3 bf a0 save %sp, -96, %sp int rv = -1; if (target != NULL) { 2008848: 90 96 60 00 orcc %i1, 0, %o0 200884c: 02 80 00 09 be 2008870 2008850: 01 00 00 00 nop rv = rtems_mkdir(target, S_IRWXU | S_IRWXG | S_IRWXO); 2008854: 40 00 02 f1 call 2009418 2008858: 92 10 21 ff mov 0x1ff, %o1 ! 1ff if (rv == 0) { 200885c: 80 a2 20 00 cmp %o0, 0 2008860: 12 80 00 09 bne 2008884 <== NEVER TAKEN 2008864: 01 00 00 00 nop rv = mount( 2008868: 40 00 00 09 call 200888c 200886c: 81 e8 00 00 restore options, data ); } } else { errno = EINVAL; 2008870: 40 00 60 6c call 2020a20 <__errno> 2008874: 01 00 00 00 nop 2008878: 82 10 20 16 mov 0x16, %g1 ! 16 200887c: c2 22 00 00 st %g1, [ %o0 ] const char *filesystemtype, rtems_filesystem_options_t options, const void *data ) { int rv = -1; 2008880: 90 10 3f ff mov -1, %o0 } else { errno = EINVAL; } return rv; } 2008884: 81 c7 e0 08 ret 2008888: 91 e8 00 08 restore %g0, %o0, %o0 =============================================================================== 020176f0 : msdos_node_type_t type, const char *name, int name_len, mode_t mode, const fat_file_fd_t *link_fd) { 20176f0: 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; 20176f4: 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); 20176f8: 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; 20176fc: 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; 2017700: 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); 2017704: 94 10 20 20 mov 0x20, %o2 2017708: c2 27 bf 78 st %g1, [ %fp + -136 ] dir_pos->lname.ofs = FAT_FILE_SHORT_NAME; 201770c: 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; 2017710: e0 06 20 08 ld [ %i0 + 8 ], %l0 fat_file_fd_t *fat_fd = NULL; 2017714: c0 27 bf 6c clr [ %fp + -148 ] time_t time_ret = 0; uint16_t time_val = 0; 2017718: c0 37 bf 68 clrh [ %fp + -152 ] uint16_t date = 0; 201771c: 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; 2017720: c0 27 bf 70 clr [ %fp + -144 ] dir_pos->sname.ofs = 0; 2017724: 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); 2017728: 40 00 12 9d call 201c19c 201772c: 90 07 bf 80 add %fp, -128, %o0 memset(dot_dotdot, 0, MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE * 2); 2017730: 90 07 bf c0 add %fp, -64, %o0 2017734: 92 10 20 00 clr %o1 2017738: 40 00 12 99 call 201c19c 201773c: 94 10 20 40 mov 0x40, %o2 if (name_len > MSDOS_NAME_MAX_LFN_WITH_DOT) { 2017740: 80 a6 e1 04 cmp %i3, 0x104 2017744: 24 80 00 06 ble,a 201775c <== ALWAYS TAKEN 2017748: 90 10 00 1a mov %i2, %o0 rtems_set_errno_and_return_minus_one(ENAMETOOLONG); 201774c: 40 00 0f 98 call 201b5ac <__errno> <== NOT EXECUTED 2017750: 01 00 00 00 nop <== NOT EXECUTED 2017754: 10 80 00 0c b 2017784 <== NOT EXECUTED 2017758: 82 10 20 5b mov 0x5b, %g1 ! 5b <== NOT EXECUTED } name_type = msdos_long_to_short (name, name_len, 201775c: 92 10 00 1b mov %i3, %o1 2017760: 94 07 bf 80 add %fp, -128, %o2 2017764: 40 00 01 45 call 2017c78 2017768: 96 10 20 0b mov 0xb, %o3 MSDOS_DIR_NAME(short_node), MSDOS_NAME_MAX); if (name_type == MSDOS_NAME_INVALID) { 201776c: a4 92 20 00 orcc %o0, 0, %l2 2017770: 32 80 00 08 bne,a 2017790 <== ALWAYS TAKEN 2017774: c0 2f bf 8c clrb [ %fp + -116 ] rtems_set_errno_and_return_minus_one(EINVAL); 2017778: 40 00 0f 8d call 201b5ac <__errno> <== NOT EXECUTED 201777c: 01 00 00 00 nop <== NOT EXECUTED 2017780: 82 10 20 16 mov 0x16, %g1 ! 16 <== NOT EXECUTED 2017784: c2 22 00 00 st %g1, [ %o0 ] <== NOT EXECUTED 2017788: 10 80 00 ce b 2017ac0 <== NOT EXECUTED 201778c: ba 10 3f ff mov -1, %i5 <== NOT EXECUTED /* fill reserved field */ *MSDOS_DIR_NT_RES(short_node) = MSDOS_RES_NT_VALUE; /* set up last write date and time */ time_ret = time(NULL); 2017790: 40 00 23 07 call 20203ac