=============================================================================== 4000bc00 : int IMFS_chown( const rtems_filesystem_location_info_t *loc, uid_t owner, gid_t group ) { 4000bc00: 9d e3 bf 98 save %sp, -104, %sp IMFS_jnode_t *jnode; #if defined(RTEMS_POSIX_API) uid_t st_uid; #endif jnode = (IMFS_jnode_t *) loc->node_access; 4000bc04: fa 06 20 08 ld [ %i0 + 8 ], %i5 #endif jnode->st_uid = owner; jnode->st_gid = group; IMFS_update_ctime( jnode ); 4000bc08: 90 07 bf f8 add %fp, -8, %o0 if ( ( st_uid != jnode->st_uid ) && ( st_uid != 0 ) ) rtems_set_errno_and_return_minus_one( EPERM ); #endif jnode->st_uid = owner; 4000bc0c: f2 37 60 3c sth %i1, [ %i5 + 0x3c ] jnode->st_gid = group; 4000bc10: f4 37 60 3e sth %i2, [ %i5 + 0x3e ] IMFS_update_ctime( jnode ); 4000bc14: 7f ff e1 2e call 400040cc 4000bc18: 92 10 20 00 clr %o1 4000bc1c: c2 07 bf f8 ld [ %fp + -8 ], %g1 4000bc20: c2 27 60 48 st %g1, [ %i5 + 0x48 ] return 0; } 4000bc24: 81 c7 e0 08 ret 4000bc28: 91 e8 20 00 restore %g0, 0, %o0 =============================================================================== 400060b4 : */ static void IMFS_dump_directory( IMFS_jnode_t *the_directory, int level ) { 400060b4: 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, "...." ); 400060b8: 35 10 00 8a sethi %hi(0x40022800), %i2 400060bc: 39 10 00 92 sethi %hi(0x40024800), %i4 case IMFS_FIFO: fprintf(stdout, " FIFO not printed\n" ); return; default: fprintf(stdout, " bad type %d\n", IMFS_type( the_jnode ) ); 400060c0: 21 10 00 8a sethi %hi(0x40022800), %l0 return; } puts(""); 400060c4: 23 10 00 8c sethi %hi(0x40023000), %l1 case IMFS_SYM_LINK: fprintf(stdout, " links not printed\n" ); return; case IMFS_FIFO: fprintf(stdout, " FIFO not printed\n" ); 400060c8: 25 10 00 8a sethi %hi(0x40022800), %l2 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_First( Chain_Control *the_chain ) { return _Chain_Head( the_chain )->next; 400060cc: 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, "...." ); 400060d0: b4 16 a1 88 or %i2, 0x188, %i2 400060d4: b8 17 20 00 mov %i4, %i4 case IMFS_FIFO: fprintf(stdout, " FIFO not printed\n" ); return; default: fprintf(stdout, " bad type %d\n", IMFS_type( the_jnode ) ); 400060d8: a0 14 21 f8 or %l0, 0x1f8, %l0 return; } puts(""); 400060dc: a2 14 62 f8 or %l1, 0x2f8, %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 ); 400060e0: 10 80 00 4d b 40006214 400060e4: a4 14 a1 e0 or %l2, 0x1e0, %l2 the_node = the_node->next ) { the_jnode = (IMFS_jnode_t *) the_node; for ( i=0 ; i<=level ; i++ ) fprintf(stdout, "...." ); 400060e8: 90 10 00 1a mov %i2, %o0 400060ec: 40 00 34 1d call 40013160 400060f0: b6 06 e0 01 inc %i3 400060f4: 10 80 00 03 b 40006100 400060f8: c2 07 00 00 ld [ %i4 ], %g1 400060fc: 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++ ) 40006100: 80 a6 c0 19 cmp %i3, %i1 40006104: 04 bf ff f9 ble 400060e8 40006108: d2 00 60 08 ld [ %g1 + 8 ], %o1 IMFS_jnode_t *the_jnode ) { IMFS_assert( the_jnode ); fprintf(stdout, "%s", the_jnode->name ); 4000610c: 40 00 34 15 call 40013160 40006110: 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; 40006114: c2 07 60 4c ld [ %i5 + 0x4c ], %g1 40006118: d4 00 40 00 ld [ %g1 ], %o2 switch( IMFS_type( the_jnode ) ) { 4000611c: 80 a2 a0 06 cmp %o2, 6 40006120: 38 80 00 2d bgu,a 400061d4 <== NEVER TAKEN 40006124: c2 07 00 00 ld [ %i4 ], %g1 <== NOT EXECUTED 40006128: 95 2a a0 02 sll %o2, 2, %o2 4000612c: 03 10 00 18 sethi %hi(0x40006000), %g1 40006130: 82 10 60 98 or %g1, 0x98, %g1 ! 40006098 40006134: c2 00 40 0a ld [ %g1 + %o2 ], %g1 40006138: 81 c0 40 00 jmp %g1 4000613c: 01 00 00 00 nop case IMFS_DIRECTORY: fprintf(stdout, "/" ); 40006140: c2 07 00 00 ld [ %i4 ], %g1 40006144: 90 10 20 2f mov 0x2f, %o0 40006148: 40 00 33 d2 call 40013090 4000614c: d2 00 60 08 ld [ %g1 + 8 ], %o1 40006150: 30 80 00 26 b,a 400061e8 break; case IMFS_DEVICE: fprintf(stdout, " (device %" PRId32 ", %" PRId32 ")", 40006154: c2 07 00 00 ld [ %i4 ], %g1 40006158: 13 10 00 8a sethi %hi(0x40022800), %o1 4000615c: d0 00 60 08 ld [ %g1 + 8 ], %o0 40006160: 92 12 61 90 or %o1, 0x190, %o1 40006164: 10 80 00 08 b 40006184 40006168: 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)", 4000616c: c2 07 00 00 ld [ %i4 ], %g1 40006170: d4 07 60 54 ld [ %i5 + 0x54 ], %o2 40006174: d0 00 60 08 ld [ %g1 + 8 ], %o0 40006178: d6 07 60 58 ld [ %i5 + 0x58 ], %o3 4000617c: 13 10 00 8a sethi %hi(0x40022800), %o1 40006180: 92 12 61 a8 or %o1, 0x1a8, %o1 ! 400229a8 40006184: 40 00 33 a7 call 40013020 40006188: 01 00 00 00 nop 4000618c: 30 80 00 17 b,a 400061e8 the_jnode->info.file.indirect, the_jnode->info.file.doubly_indirect, the_jnode->info.file.triply_indirect ); #else fprintf(stdout, " (file %" PRId32 ")", 40006190: c2 07 00 00 ld [ %i4 ], %g1 40006194: d4 07 60 54 ld [ %i5 + 0x54 ], %o2 40006198: d0 00 60 08 ld [ %g1 + 8 ], %o0 4000619c: 13 10 00 8a sethi %hi(0x40022800), %o1 400061a0: 40 00 33 a0 call 40013020 400061a4: 92 12 61 b8 or %o1, 0x1b8, %o1 ! 400229b8 400061a8: 30 80 00 10 b,a 400061e8 case IMFS_HARD_LINK: fprintf(stdout, " links not printed\n" ); return; case IMFS_SYM_LINK: fprintf(stdout, " links not printed\n" ); 400061ac: 11 10 00 8a sethi %hi(0x40022800), %o0 400061b0: c2 07 00 00 ld [ %i4 ], %g1 400061b4: 10 80 00 04 b 400061c4 400061b8: 90 12 21 c8 or %o0, 0x1c8, %o0 return; case IMFS_FIFO: fprintf(stdout, " FIFO not printed\n" ); 400061bc: c2 07 00 00 ld [ %i4 ], %g1 400061c0: 90 10 00 12 mov %l2, %o0 400061c4: 40 00 33 e7 call 40013160 400061c8: 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; 400061cc: 10 80 00 0a b 400061f4 400061d0: c2 07 60 4c ld [ %i5 + 0x4c ], %g1 return; default: fprintf(stdout, " bad type %d\n", IMFS_type( the_jnode ) ); 400061d4: 92 10 00 10 mov %l0, %o1 <== NOT EXECUTED 400061d8: 40 00 33 92 call 40013020 <== NOT EXECUTED 400061dc: d0 00 60 08 ld [ %g1 + 8 ], %o0 <== NOT EXECUTED 400061e0: 10 80 00 05 b 400061f4 <== NOT EXECUTED 400061e4: c2 07 60 4c ld [ %i5 + 0x4c ], %g1 <== NOT EXECUTED return; } puts(""); 400061e8: 40 00 3a c5 call 40014cfc 400061ec: 90 10 00 11 mov %l1, %o0 400061f0: 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 ) ) 400061f4: c2 00 40 00 ld [ %g1 ], %g1 400061f8: 80 a0 60 00 cmp %g1, 0 400061fc: 32 80 00 06 bne,a 40006214 40006200: fa 07 40 00 ld [ %i5 ], %i5 IMFS_dump_directory( the_jnode, level + 1 ); 40006204: 90 10 00 1d mov %i5, %o0 40006208: 7f ff ff ab call 400060b4 4000620c: 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 ) { 40006210: 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 )); 40006214: 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 ); 40006218: 80 a7 40 01 cmp %i5, %g1 4000621c: 12 bf ff b8 bne 400060fc 40006220: 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 ); } } 40006224: 81 c7 e0 08 ret 40006228: 81 e8 00 00 restore =============================================================================== 4000bd5c : rtems_filesystem_eval_path_context_t *ctx, void *arg, const char *token, size_t tokenlen ) { 4000bd5c: 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; 4000bd60: f8 06 20 20 ld [ %i0 + 0x20 ], %i4 bool access_ok = rtems_filesystem_eval_path_check_access( 4000bd64: 90 10 00 18 mov %i0, %o0 4000bd68: d4 07 20 30 ld [ %i4 + 0x30 ], %o2 4000bd6c: d6 17 20 3c lduh [ %i4 + 0x3c ], %o3 4000bd70: d8 17 20 3e lduh [ %i4 + 0x3e ], %o4 4000bd74: 40 00 03 01 call 4000c978 4000bd78: 92 10 20 01 mov 1, %o1 dir->st_mode, dir->st_uid, dir->st_gid ); if ( access_ok ) { 4000bd7c: 80 8a 20 ff btst 0xff, %o0 4000bd80: 12 80 00 04 bne 4000bd90 4000bd84: 80 a6 e0 01 cmp %i3, 1 void *arg, const char *token, size_t tokenlen ) { rtems_filesystem_eval_path_generic_status status = 4000bd88: 81 c7 e0 08 ret 4000bd8c: 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] == '.'; 4000bd90: 12 80 00 06 bne 4000bda8 4000bd94: 82 10 20 00 clr %g1 4000bd98: c2 4e 80 00 ldsb [ %i2 ], %g1 4000bd9c: 82 18 60 2e xor %g1, 0x2e, %g1 4000bda0: 80 a0 00 01 cmp %g0, %g1 4000bda4: 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 ) ) { 4000bda8: 80 a0 60 00 cmp %g1, 0 4000bdac: 12 80 00 2b bne 4000be58 4000bdb0: 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] == '.'; 4000bdb4: 12 80 00 0b bne 4000bde0 4000bdb8: 80 a0 60 00 cmp %g1, 0 4000bdbc: c4 4e 80 00 ldsb [ %i2 ], %g2 4000bdc0: 80 a0 a0 2e cmp %g2, 0x2e 4000bdc4: 12 80 00 07 bne 4000bde0 4000bdc8: 80 a0 60 00 cmp %g1, 0 4000bdcc: c2 4e a0 01 ldsb [ %i2 + 1 ], %g1 4000bdd0: 82 18 60 2e xor %g1, 0x2e, %g1 4000bdd4: 80 a0 00 01 cmp %g0, %g1 4000bdd8: 82 60 3f ff subx %g0, -1, %g1 return dir; } else { if ( rtems_filesystem_is_parent_directory( token, tokenlen ) ) { 4000bddc: 80 a0 60 00 cmp %g1, 0 4000bde0: 22 80 00 04 be,a 4000bdf0 4000bde4: fa 07 20 50 ld [ %i4 + 0x50 ], %i5 return dir->Parent; 4000bde8: 10 80 00 17 b 4000be44 4000bdec: 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 ); 4000bdf0: 10 80 00 10 b 4000be30 4000bdf4: 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 4000bdf8: 92 10 00 1a mov %i2, %o1 4000bdfc: 40 00 11 8b call 40010428 4000be00: 94 10 00 1b mov %i3, %o2 && entry->name [tokenlen] == '\0'; 4000be04: 80 a2 20 00 cmp %o0, 0 4000be08: 12 80 00 06 bne 4000be20 4000be0c: 82 10 20 00 clr %g1 4000be10: 82 07 40 1b add %i5, %i3, %g1 4000be14: c2 48 60 0c ldsb [ %g1 + 0xc ], %g1 4000be18: 80 a0 00 01 cmp %g0, %g1 4000be1c: 82 60 3f ff subx %g0, -1, %g1 if ( match ) { 4000be20: 80 a0 60 00 cmp %g1, 0 4000be24: 12 80 00 09 bne 4000be48 4000be28: 80 a7 60 00 cmp %i5, 0 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Next( Chain_Node *the_node ) { return the_node->next; 4000be2c: 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 ) { 4000be30: 80 a7 40 19 cmp %i5, %i1 4000be34: 12 bf ff f1 bne 4000bdf8 4000be38: 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; 4000be3c: 81 c7 e0 08 ret 4000be40: 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 ) { 4000be44: 80 a7 60 00 cmp %i5, 0 4000be48: 32 80 00 06 bne,a 4000be60 4000be4c: 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; 4000be50: 81 c7 e0 08 ret 4000be54: 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 ) ) { 4000be58: 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 ); 4000be5c: 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; 4000be60: c6 06 20 10 ld [ %i0 + 0x10 ], %g3 4000be64: 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; 4000be68: c2 07 60 4c ld [ %i5 + 0x4c ], %g1 4000be6c: 84 60 3f ff subx %g0, -1, %g2 4000be70: 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; 4000be74: 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)) { 4000be78: 80 a0 60 02 cmp %g1, 2 4000be7c: 12 80 00 0a bne 4000bea4 4000be80: 88 10 00 02 mov %g2, %g4 4000be84: 80 a0 a0 00 cmp %g2, 0 4000be88: 22 80 00 2b be,a 4000bf34 4000be8c: fa 07 60 50 ld [ %i5 + 0x50 ], %i5 4000be90: 80 88 e0 08 btst 8, %g3 4000be94: 22 80 00 29 be,a 4000bf38 4000be98: c2 17 20 34 lduh [ %i4 + 0x34 ], %g1 entry = entry->info.hard_link.link_node; 4000be9c: 10 80 00 26 b 4000bf34 4000bea0: fa 07 60 50 ld [ %i5 + 0x50 ], %i5 } if ( type == IMFS_SYM_LINK && (follow_sym_link || !terminal)) { 4000bea4: 80 a0 60 03 cmp %g1, 3 4000bea8: 12 80 00 10 bne 4000bee8 4000beac: 80 a0 60 00 cmp %g1, 0 4000beb0: 80 a0 a0 00 cmp %g2, 0 4000beb4: 02 80 00 04 be 4000bec4 4000beb8: 80 88 e0 10 btst 0x10, %g3 4000bebc: 22 80 00 1f be,a 4000bf38 4000bec0: c2 17 20 34 lduh [ %i4 + 0x34 ], %g1 const char *target = entry->info.sym_link.name; 4000bec4: fa 07 60 50 ld [ %i5 + 0x50 ], %i5 rtems_filesystem_eval_path_recursive( ctx, target, strlen( target ) ); 4000bec8: 40 00 11 26 call 40010360 4000becc: 90 10 00 1d mov %i5, %o0 4000bed0: 92 10 00 1d mov %i5, %o1 4000bed4: 94 10 00 08 mov %o0, %o2 4000bed8: 7f ff e5 16 call 40005330 4000bedc: 90 10 00 18 mov %i0, %o0 void *arg, const char *token, size_t tokenlen ) { rtems_filesystem_eval_path_generic_status status = 4000bee0: 81 c7 e0 08 ret 4000bee4: 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 ) { 4000bee8: 32 80 00 14 bne,a 4000bf38 4000beec: c2 17 20 34 lduh [ %i4 + 0x34 ], %g1 if ( node->info.directory.mt_fs != NULL ) { 4000bef0: d2 07 60 5c ld [ %i5 + 0x5c ], %o1 4000bef4: 80 a2 60 00 cmp %o1, 0 4000bef8: 02 80 00 0f be 4000bf34 4000befc: 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( 4000bf00: d4 07 60 30 ld [ %i5 + 0x30 ], %o2 4000bf04: d6 17 60 3c lduh [ %i5 + 0x3c ], %o3 4000bf08: 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; 4000bf0c: 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( 4000bf10: 40 00 02 9a call 4000c978 4000bf14: 92 10 20 01 mov 1, %o1 RTEMS_FS_PERMS_EXEC, entry->st_mode, entry->st_uid, entry->st_gid ); if ( access_ok ) { 4000bf18: 80 8a 20 ff btst 0xff, %o0 4000bf1c: 02 80 00 04 be 4000bf2c <== NEVER TAKEN 4000bf20: 90 10 00 18 mov %i0, %o0 rtems_filesystem_eval_path_restart( ctx, fs_root_ptr ); 4000bf24: 7f ff e4 ea call 400052cc 4000bf28: 92 10 00 1c mov %i4, %o1 void *arg, const char *token, size_t tokenlen ) { rtems_filesystem_eval_path_generic_status status = 4000bf2c: 81 c7 e0 08 ret 4000bf30: 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; 4000bf34: c2 17 20 34 lduh [ %i4 + 0x34 ], %g1 4000bf38: 82 00 7f ff add %g1, -1, %g1 4000bf3c: c2 37 20 34 sth %g1, [ %i4 + 0x34 ] ++entry->reference_count; 4000bf40: c2 17 60 34 lduh [ %i5 + 0x34 ], %g1 4000bf44: 82 00 60 01 inc %g1 4000bf48: 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; 4000bf4c: c2 07 60 4c ld [ %i5 + 0x4c ], %g1 currentloc->node_access = entry; 4000bf50: fa 26 20 20 st %i5, [ %i0 + 0x20 ] 4000bf54: c2 00 60 04 ld [ %g1 + 4 ], %g1 4000bf58: c2 26 20 28 st %g1, [ %i0 + 0x28 ] void *arg, const char *token, size_t tokenlen ) { rtems_filesystem_eval_path_generic_status status = 4000bf5c: b0 09 20 ff and %g4, 0xff, %i0 status = RTEMS_FILESYSTEM_EVAL_PATH_GENERIC_NO_ENTRY; } } return status; } 4000bf60: 81 c7 e0 08 ret 4000bf64: 81 e8 00 00 restore =============================================================================== 40004170 : static ssize_t IMFS_fifo_write( rtems_libio_t *iop, const void *buffer, size_t count ) { 40004170: 9d e3 bf 98 save %sp, -104, %sp IMFS_jnode_t *jnode = iop->pathinfo.node_access; 40004174: fa 06 20 1c ld [ %i0 + 0x1c ], %i5 int err = pipe_write(JNODE2PIPE(jnode), buffer, count, iop); 40004178: 96 10 00 18 mov %i0, %o3 4000417c: d0 07 60 50 ld [ %i5 + 0x50 ], %o0 40004180: 92 10 00 19 mov %i1, %o1 40004184: 40 00 28 aa call 4000e42c 40004188: 94 10 00 1a mov %i2, %o2 if (err > 0) { 4000418c: b0 92 20 00 orcc %o0, 0, %i0 40004190: 04 80 00 09 ble 400041b4 40004194: 90 07 bf f8 add %fp, -8, %o0 IMFS_mtime_ctime_update(jnode); 40004198: 40 00 03 82 call 40004fa0 4000419c: 92 10 20 00 clr %o1 400041a0: c2 07 bf f8 ld [ %fp + -8 ], %g1 400041a4: c2 27 60 44 st %g1, [ %i5 + 0x44 ] 400041a8: c2 27 60 48 st %g1, [ %i5 + 0x48 ] 400041ac: 81 c7 e0 08 ret 400041b0: 81 e8 00 00 restore } IMFS_FIFO_RETURN(err); 400041b4: 80 a6 20 00 cmp %i0, 0 400041b8: 02 80 00 06 be 400041d0 <== NEVER TAKEN 400041bc: 01 00 00 00 nop 400041c0: 40 00 30 36 call 40010298 <__errno> 400041c4: b0 20 00 18 neg %i0 400041c8: f0 22 00 00 st %i0, [ %o0 ] 400041cc: b0 10 3f ff mov -1, %i0 } 400041d0: 81 c7 e0 08 ret 400041d4: 81 e8 00 00 restore =============================================================================== 4000bfb8 : ((IMFS_jnode_t *)( rtems_chain_head( jnode_get_control( jnode ) )->next)) void IMFS_fsunmount( rtems_filesystem_mount_table_entry_t *temp_mt_entry ) { 4000bfb8: 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; 4000bfbc: f6 06 20 24 ld [ %i0 + 0x24 ], %i3 4000bfc0: b8 07 bf e8 add %fp, -24, %i4 4000bfc4: 92 10 00 1b mov %i3, %o1 4000bfc8: 90 10 00 1c mov %i4, %o0 4000bfcc: 40 00 0d af call 4000f688 4000bfd0: 94 10 20 18 mov 0x18, %o2 jnode = (IMFS_jnode_t *)loc.node_access; 4000bfd4: 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; 4000bfd8: c0 26 e0 08 clr [ %i3 + 8 ] 4000bfdc: b6 10 00 1c mov %i4, %i3 4000bfe0: c2 07 60 4c ld [ %i5 + 0x4c ], %g1 do { next = jnode->Parent; 4000bfe4: f8 07 60 08 ld [ %i5 + 8 ], %i4 4000bfe8: 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 ) ) { 4000bfec: 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; 4000bff0: fa 27 bf f0 st %i5, [ %fp + -16 ] IMFS_Set_handlers( &loc ); if ( !IMFS_is_directory( jnode ) || jnode_has_no_children( jnode ) ) { 4000bff4: 80 a0 60 00 cmp %g1, 0 4000bff8: 12 80 00 07 bne 4000c014 4000bffc: c4 27 bf f8 st %g2, [ %fp + -8 ] 4000c000: 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 ); 4000c004: 82 07 60 54 add %i5, 0x54, %g1 4000c008: 80 a0 80 01 cmp %g2, %g1 4000c00c: 32 80 00 10 bne,a 4000c04c 4000c010: c2 07 60 4c ld [ %i5 + 0x4c ], %g1 result = IMFS_rmnod( NULL, &loc ); 4000c014: 90 10 20 00 clr %o0 4000c018: 7f ff de a3 call 40003aa4 4000c01c: 92 10 00 1b mov %i3, %o1 if ( result != 0 ) 4000c020: 80 a2 20 00 cmp %o0, 0 4000c024: 02 80 00 04 be 4000c034 <== ALWAYS TAKEN 4000c028: 11 37 ab 6f sethi %hi(0xdeadbc00), %o0 rtems_fatal_error_occurred( 0xdeadbeef ); 4000c02c: 7f ff f1 ca call 40008754 <== NOT EXECUTED 4000c030: 90 12 22 ef or %o0, 0x2ef, %o0 ! deadbeef <== NOT EXECUTED IMFS_node_destroy( jnode ); 4000c034: 7f ff dd ca call 4000375c 4000c038: 90 10 00 1d mov %i5, %o0 jnode = next; } if ( jnode != NULL ) { 4000c03c: 80 a7 20 00 cmp %i4, 0 4000c040: 02 80 00 0e be 4000c078 4000c044: 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; 4000c048: c2 07 60 4c ld [ %i5 + 0x4c ], %g1 if ( IMFS_is_directory( jnode ) ) { 4000c04c: c2 00 40 00 ld [ %g1 ], %g1 4000c050: 80 a0 60 00 cmp %g1, 0 4000c054: 32 bf ff e4 bne,a 4000bfe4 <== NEVER TAKEN 4000c058: 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; 4000c05c: 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 ); 4000c060: 84 07 60 54 add %i5, 0x54, %g2 if ( jnode_has_children( jnode ) ) 4000c064: 80 a0 40 02 cmp %g1, %g2 4000c068: 02 bf ff de be 4000bfe0 4000c06c: 80 a0 60 00 cmp %g1, 0 jnode = jnode_get_first_child( jnode ); } } } while (jnode != NULL); 4000c070: 12 bf ff dc bne 4000bfe0 <== ALWAYS TAKEN 4000c074: ba 10 00 01 mov %g1, %i5 4000c078: 81 c7 e0 08 ret 4000c07c: 81 e8 00 00 restore =============================================================================== 40003650 : 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] ) { 40003650: 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 ) ); 40003654: 90 10 20 01 mov 1, %o0 40003658: 40 00 01 c0 call 40003d58 4000365c: 92 10 20 24 mov 0x24, %o1 if ( fs_info != NULL ) { 40003660: ba 92 20 00 orcc %o0, 0, %i5 40003664: 02 80 00 24 be 400036f4 40003668: 03 10 00 76 sethi %hi(0x4001d800), %g1 IMFS_jnode_t *root_node; fs_info->instance = imfs_instance++; 4000366c: c4 00 61 ac ld [ %g1 + 0x1ac ], %g2 ! 4001d9ac memcpy( 40003670: 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++; 40003674: c4 27 40 00 st %g2, [ %i5 ] 40003678: 84 00 a0 01 inc %g2 memcpy( 4000367c: 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++; 40003680: c4 20 61 ac st %g2, [ %g1 + 0x1ac ] memcpy( 40003684: 40 00 30 01 call 4000f688 40003688: 90 07 60 08 add %i5, 8, %o0 fs_info->node_controls, node_controls, sizeof( fs_info->node_controls ) ); root_node = IMFS_allocate_node( 4000368c: d2 07 60 08 ld [ %i5 + 8 ], %o1 40003690: 90 10 00 1d mov %i5, %o0 40003694: 15 10 00 70 sethi %hi(0x4001c000), %o2 40003698: 96 10 20 00 clr %o3 4000369c: 94 12 a0 08 or %o2, 8, %o2 400036a0: 19 00 00 10 sethi %hi(0x4000), %o4 400036a4: 9a 10 20 00 clr %o5 400036a8: 40 00 21 61 call 4000bc2c 400036ac: 98 13 21 ed or %o4, 0x1ed, %o4 "", 0, (S_IFDIR | 0755), NULL ); if ( root_node != NULL ) { 400036b0: 80 a2 20 00 cmp %o0, 0 400036b4: 02 80 00 10 be 400036f4 <== NEVER TAKEN 400036b8: 03 10 00 70 sethi %hi(0x4001c000), %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; 400036bc: 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; 400036c0: 82 10 62 6c or %g1, 0x26c, %g1 400036c4: c4 00 a0 04 ld [ %g2 + 4 ], %g2 400036c8: c2 26 20 2c st %g1, [ %i0 + 0x2c ] mt_entry->mt_fs_root->location.node_access = root_node; 400036cc: c2 06 20 24 ld [ %i0 + 0x24 ], %g1 0, (S_IFDIR | 0755), NULL ); if ( root_node != NULL ) { mt_entry->fs_info = fs_info; 400036d0: fa 26 20 08 st %i5, [ %i0 + 8 ] mt_entry->ops = op_table; 400036d4: f2 26 20 0c st %i1, [ %i0 + 0xc ] 400036d8: 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; 400036dc: d0 20 60 08 st %o0, [ %g1 + 8 ] errno = ENOMEM; rv = -1; } if ( rv == 0 ) { IMFS_determine_bytes_per_block( 400036e0: 86 10 20 06 mov 6, %g3 400036e4: 03 10 00 74 sethi %hi(0x4001d000), %g1 int bit_mask; /* * check, whether requested bytes per block is valid */ for (bit_mask = 16; !is_valid && (bit_mask <= 512); bit_mask <<= 1) { 400036e8: 84 10 20 10 mov 0x10, %g2 errno = ENOMEM; rv = -1; } if ( rv == 0 ) { IMFS_determine_bytes_per_block( 400036ec: 10 80 00 08 b 4000370c 400036f0: c2 00 62 a0 ld [ %g1 + 0x2a0 ], %g1 } else { errno = ENOMEM; rv = -1; } } else { errno = ENOMEM; 400036f4: 40 00 2d 94 call 4000ed44 <__errno> 400036f8: b0 10 3f ff mov -1, %i0 400036fc: 82 10 20 0c mov 0xc, %g1 40003700: c2 22 00 00 st %g1, [ %o0 ] 40003704: 81 c7 e0 08 ret 40003708: 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) { 4000370c: 80 a0 80 01 cmp %g2, %g1 40003710: 22 80 00 09 be,a 40003734 40003714: 05 10 00 76 sethi %hi(0x4001d800), %g2 is_valid = true; break; } if(bit_mask > requested_bytes_per_block) 40003718: 34 80 00 06 bg,a 40003730 4000371c: 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) { 40003720: 86 80 ff ff addcc %g3, -1, %g3 40003724: 12 bf ff fa bne 4000370c <== ALWAYS TAKEN 40003728: 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); 4000372c: 82 10 20 80 mov 0x80, %g1 <== NOT EXECUTED break; } if(bit_mask > requested_bytes_per_block) break; } *dest_bytes_per_block = ((is_valid) 40003730: 05 10 00 76 sethi %hi(0x4001d800), %g2 40003734: c2 20 a1 a8 st %g1, [ %g2 + 0x1a8 ] ! 4001d9a8 40003738: b0 10 20 00 clr %i0 IMFS_MEMFILE_DEFAULT_BYTES_PER_BLOCK ); } return rv; } 4000373c: 81 c7 e0 08 ret 40003740: 81 e8 00 00 restore =============================================================================== 40005420 : const char *path, mode_t mode, const IMFS_node_control *node_control, void *context ) { 40005420: 9d e3 bf 48 save %sp, -184, %sp int rv = 0; mode &= ~rtems_filesystem_umask; 40005424: 03 10 00 68 sethi %hi(0x4001a000), %g1 40005428: c2 00 62 cc ld [ %g1 + 0x2cc ], %g1 ! 4001a2cc switch (mode & S_IFMT) { 4000542c: 05 00 00 08 sethi %hi(0x2000), %g2 void *context ) { int rv = 0; mode &= ~rtems_filesystem_umask; 40005430: c2 00 60 08 ld [ %g1 + 8 ], %g1 40005434: b2 2e 40 01 andn %i1, %g1, %i1 switch (mode & S_IFMT) { 40005438: 03 00 00 3c sethi %hi(0xf000), %g1 4000543c: 82 0e 40 01 and %i1, %g1, %g1 40005440: 80 a0 40 02 cmp %g1, %g2 40005444: 22 80 00 3a be,a 4000552c 40005448: c2 06 80 00 ld [ %i2 ], %g1 4000544c: 38 80 00 04 bgu,a 4000545c <== ALWAYS TAKEN 40005450: 05 00 00 18 sethi %hi(0x6000), %g2 40005454: 10 80 00 05 b 40005468 <== NOT EXECUTED 40005458: 05 00 00 04 sethi %hi(0x1000), %g2 <== NOT EXECUTED 4000545c: 80 a0 40 02 cmp %g1, %g2 40005460: 02 80 00 32 be 40005528 40005464: 05 00 00 20 sethi %hi(0x8000), %g2 40005468: 80 a0 40 02 cmp %g1, %g2 4000546c: 22 80 00 30 be,a 4000552c <== NEVER TAKEN 40005470: c2 06 80 00 ld [ %i2 ], %g1 <== NOT EXECUTED 40005474: 30 80 00 27 b,a 40005510 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 = 40005478: 94 10 20 78 mov 0x78, %o2 4000547c: 40 00 07 4e call 400071b4 40005480: 90 07 bf c8 add %fp, -56, %o0 rtems_filesystem_eval_path_start( &ctx, path, eval_flags ); if ( IMFS_is_imfs_instance( currentloc ) ) { 40005484: 7f ff ff d5 call 400053d8 40005488: ba 10 00 08 mov %o0, %i5 4000548c: 80 8a 20 ff btst 0xff, %o0 40005490: 02 80 00 19 be 400054f4 40005494: 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( 40005498: 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; 4000549c: f6 27 bf b0 st %i3, [ %fp + -80 ] new_node = IMFS_create_node_with_control( 400054a0: 90 10 00 1d mov %i5, %o0 400054a4: 92 10 00 1a mov %i2, %o1 400054a8: 98 10 00 19 mov %i1, %o4 400054ac: 9a 07 bf b0 add %fp, -80, %o5 400054b0: 40 00 2c cc call 400107e0 400054b4: b0 10 3f ff mov -1, %i0 rtems_filesystem_eval_path_get_tokenlen( &ctx ), mode, &info ); if ( new_node != NULL ) { 400054b8: 80 a2 20 00 cmp %o0, 0 400054bc: 02 80 00 11 be 40005500 400054c0: 92 10 20 00 clr %o1 IMFS_jnode_t *parent = currentloc->node_access; 400054c4: fa 07 60 08 ld [ %i5 + 8 ], %i5 IMFS_update_ctime( parent ); 400054c8: 40 00 02 08 call 40005ce8 400054cc: 90 07 bf a8 add %fp, -88, %o0 400054d0: c2 07 bf a8 ld [ %fp + -88 ], %g1 IMFS_update_mtime( parent ); 400054d4: 90 07 bf a8 add %fp, -88, %o0 ); if ( new_node != NULL ) { IMFS_jnode_t *parent = currentloc->node_access; IMFS_update_ctime( parent ); 400054d8: c2 27 60 48 st %g1, [ %i5 + 0x48 ] IMFS_update_mtime( parent ); 400054dc: 40 00 02 03 call 40005ce8 400054e0: 92 10 20 00 clr %o1 400054e4: c2 07 bf a8 ld [ %fp + -88 ], %g1 400054e8: b0 10 20 00 clr %i0 400054ec: 10 80 00 05 b 40005500 400054f0: c2 27 60 44 st %g1, [ %i5 + 0x44 ] } else { rv = -1; } } else { rtems_filesystem_eval_path_error( &ctx, ENOTSUP ); 400054f4: 92 10 20 86 mov 0x86, %o1 400054f8: 40 00 06 99 call 40006f5c 400054fc: b0 10 3f ff mov -1, %i0 rv = -1; } rtems_filesystem_eval_path_cleanup( &ctx ); 40005500: 40 00 07 69 call 400072a4 40005504: 90 07 bf c8 add %fp, -56, %o0 40005508: 81 c7 e0 08 ret 4000550c: 81 e8 00 00 restore } else { errno = EINVAL; 40005510: 40 00 39 1c call 40013980 <__errno> 40005514: b0 10 3f ff mov -1, %i0 40005518: 82 10 20 16 mov 0x16, %g1 4000551c: c2 22 00 00 st %g1, [ %o0 ] 40005520: 81 c7 e0 08 ret 40005524: 81 e8 00 00 restore rv = -1; break; } if ( rv == 0 ) { if ( node_control->imfs_type == IMFS_GENERIC ) { 40005528: c2 06 80 00 ld [ %i2 ], %g1 4000552c: 80 a0 60 07 cmp %g1, 7 40005530: 02 bf ff d2 be 40005478 40005534: 92 10 00 18 mov %i0, %o1 40005538: 30 bf ff f6 b,a 40005510 =============================================================================== 4000ddf4 : */ MEMFILE_STATIC int IMFS_memfile_addblock( IMFS_jnode_t *the_jnode, unsigned int block ) { 4000ddf4: 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 ); 4000ddf8: 94 10 20 01 mov 1, %o2 4000ddfc: 90 10 00 18 mov %i0, %o0 4000de00: 7f ff fe d7 call 4000d95c 4000de04: 92 10 00 19 mov %i1, %o1 if ( *block_entry_ptr ) 4000de08: 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 ); 4000de0c: ba 10 00 08 mov %o0, %i5 if ( *block_entry_ptr ) 4000de10: 80 a0 60 00 cmp %g1, 0 4000de14: 12 80 00 08 bne 4000de34 4000de18: b0 10 20 00 clr %i0 return 0; /* * There is no memory for this block number so allocate it. */ memory = memfile_alloc_block(); 4000de1c: 7f ff fe c3 call 4000d928 4000de20: 01 00 00 00 nop if ( !memory ) 4000de24: 80 a2 20 00 cmp %o0, 0 4000de28: 22 80 00 03 be,a 4000de34 <== NEVER TAKEN 4000de2c: b0 10 20 01 mov 1, %i0 <== NOT EXECUTED return 1; *block_entry_ptr = memory; 4000de30: d0 27 40 00 st %o0, [ %i5 ] return 0; 4000de34: 81 c7 e0 08 ret 4000de38: 81 e8 00 00 restore =============================================================================== 4000e008 : MEMFILE_STATIC int IMFS_memfile_extend( IMFS_jnode_t *the_jnode, bool zero_fill, off_t new_length ) { 4000e008: 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 ) 4000e00c: 03 10 00 76 sethi %hi(0x4001d800), %g1 4000e010: fa 00 61 a8 ld [ %g1 + 0x1a8 ], %i5 ! 4001d9a8 4000e014: b9 37 60 02 srl %i5, 2, %i4 4000e018: 92 10 00 1c mov %i4, %o1 4000e01c: 40 00 27 7f call 40017e18 <.umul> 4000e020: 90 07 20 01 add %i4, 1, %o0 4000e024: 92 10 00 1c mov %i4, %o1 4000e028: 40 00 27 7c call 40017e18 <.umul> 4000e02c: 90 02 20 01 inc %o0 4000e030: 92 10 00 1d mov %i5, %o1 4000e034: 40 00 27 79 call 40017e18 <.umul> 4000e038: 90 02 3f ff add %o0, -1, %o0 4000e03c: 82 10 20 00 clr %g1 4000e040: 80 a0 40 1a cmp %g1, %i2 4000e044: 34 80 00 0b bg,a 4000e070 <== NEVER TAKEN 4000e048: f8 06 20 50 ld [ %i0 + 0x50 ], %i4 <== NOT EXECUTED 4000e04c: 80 a0 40 1a cmp %g1, %i2 4000e050: 12 80 00 04 bne 4000e060 <== NEVER TAKEN 4000e054: 80 a2 00 1b cmp %o0, %i3 4000e058: 38 80 00 06 bgu,a 4000e070 4000e05c: f8 06 20 50 ld [ %i0 + 0x50 ], %i4 rtems_set_errno_and_return_minus_one( EFBIG ); 4000e060: 40 00 03 39 call 4000ed44 <__errno> 4000e064: 01 00 00 00 nop 4000e068: 10 80 00 3c b 4000e158 4000e06c: 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 ) 4000e070: 80 a6 80 1c cmp %i2, %i4 4000e074: 14 80 00 07 bg 4000e090 <== NEVER TAKEN 4000e078: e0 06 20 54 ld [ %i0 + 0x54 ], %l0 4000e07c: 80 a6 80 1c cmp %i2, %i4 4000e080: 12 80 00 48 bne 4000e1a0 <== NEVER TAKEN 4000e084: 80 a6 c0 10 cmp %i3, %l0 4000e088: 08 80 00 46 bleu 4000e1a0 <== NEVER TAKEN 4000e08c: 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; 4000e090: a3 3f 60 1f sra %i5, 0x1f, %l1 4000e094: 96 10 00 1d mov %i5, %o3 4000e098: 94 10 00 11 mov %l1, %o2 4000e09c: 90 10 00 1a mov %i2, %o0 4000e0a0: 40 00 28 f0 call 40018460 <__divdi3> 4000e0a4: 92 10 00 1b mov %i3, %o1 old_blocks = the_jnode->info.file.size / IMFS_MEMFILE_BYTES_PER_BLOCK; 4000e0a8: 94 10 00 11 mov %l1, %o2 4000e0ac: 90 10 00 1c mov %i4, %o0 4000e0b0: 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; 4000e0b4: a4 10 00 09 mov %o1, %l2 old_blocks = the_jnode->info.file.size / IMFS_MEMFILE_BYTES_PER_BLOCK; 4000e0b8: 40 00 28 ea call 40018460 <__divdi3> 4000e0bc: 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++ ) { 4000e0c0: 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; 4000e0c4: 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; 4000e0c8: 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; 4000e0cc: 27 10 00 76 sethi %hi(0x4001d800), %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; 4000e0d0: 40 00 27 52 call 40017e18 <.umul> 4000e0d4: 92 10 00 1d mov %i5, %o1 /* * Now allocate each of those blocks. */ for ( block=old_blocks ; block<=new_blocks ; block++ ) { 4000e0d8: 10 80 00 23 b 4000e164 4000e0dc: a0 24 00 08 sub %l0, %o0, %l0 if ( !IMFS_memfile_addblock( the_jnode, block ) ) { 4000e0e0: 7f ff ff 45 call 4000ddf4 4000e0e4: 92 10 00 1d mov %i5, %o1 4000e0e8: 80 a2 20 00 cmp %o0, 0 4000e0ec: 12 80 00 15 bne 4000e140 <== NEVER TAKEN 4000e0f0: 80 a6 60 00 cmp %i1, 0 if ( zero_fill ) { 4000e0f4: 22 80 00 1c be,a 4000e164 4000e0f8: a2 04 60 01 inc %l1 size_t count = IMFS_MEMFILE_BYTES_PER_BLOCK - offset; 4000e0fc: e8 04 e1 a8 ld [ %l3 + 0x1a8 ], %l4 block_p *block_ptr = 4000e100: 92 10 00 1d mov %i5, %o1 4000e104: 94 10 20 00 clr %o2 4000e108: 7f ff fe 15 call 4000d95c 4000e10c: 90 10 00 18 mov %i0, %o0 IMFS_memfile_get_block_pointer( the_jnode, block, 0 ); memset( &(*block_ptr) [offset], 0, count); 4000e110: 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; 4000e114: 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); 4000e118: 90 02 00 10 add %o0, %l0, %o0 4000e11c: 92 10 20 00 clr %o1 4000e120: 94 10 00 14 mov %l4, %o2 4000e124: 40 00 05 96 call 4000f77c 4000e128: a0 10 20 00 clr %l0 4000e12c: 10 80 00 0e b 4000e164 4000e130: a2 04 60 01 inc %l1 offset = 0; } } else { for ( ; block>=old_blocks ; block-- ) { IMFS_memfile_remove_block( the_jnode, block ); 4000e134: 90 10 00 18 mov %i0, %o0 <== NOT EXECUTED 4000e138: 7f ff ff a8 call 4000dfd8 <== NOT EXECUTED 4000e13c: ba 07 7f ff add %i5, -1, %i5 <== NOT EXECUTED memset( &(*block_ptr) [offset], 0, count); offset = 0; } } else { for ( ; block>=old_blocks ; block-- ) { 4000e140: 80 a7 40 1c cmp %i5, %i4 <== NOT EXECUTED 4000e144: 1a bf ff fc bcc 4000e134 <== NOT EXECUTED 4000e148: 92 10 00 1d mov %i5, %o1 <== NOT EXECUTED IMFS_memfile_remove_block( the_jnode, block ); } rtems_set_errno_and_return_minus_one( ENOSPC ); 4000e14c: 40 00 02 fe call 4000ed44 <__errno> <== NOT EXECUTED 4000e150: 01 00 00 00 nop <== NOT EXECUTED 4000e154: 82 10 20 1c mov 0x1c, %g1 ! 1c <== NOT EXECUTED 4000e158: c2 22 00 00 st %g1, [ %o0 ] 4000e15c: 81 c7 e0 08 ret 4000e160: 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( 4000e164: 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++ ) { 4000e168: 80 a7 40 12 cmp %i5, %l2 4000e16c: 08 bf ff dd bleu 4000e0e0 4000e170: 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); 4000e174: 92 10 20 00 clr %o1 } /* * Set the new length of the file. */ the_jnode->info.file.size = new_length; 4000e178: f4 3e 20 50 std %i2, [ %i0 + 0x50 ] IMFS_update_ctime(the_jnode); 4000e17c: 7f ff d7 d4 call 400040cc 4000e180: 90 07 bf f8 add %fp, -8, %o0 4000e184: c2 07 bf f8 ld [ %fp + -8 ], %g1 IMFS_update_mtime(the_jnode); 4000e188: 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); 4000e18c: c2 26 20 48 st %g1, [ %i0 + 0x48 ] IMFS_update_mtime(the_jnode); 4000e190: 7f ff d7 cf call 400040cc 4000e194: 92 10 20 00 clr %o1 4000e198: c2 07 bf f8 ld [ %fp + -8 ], %g1 4000e19c: c2 26 20 44 st %g1, [ %i0 + 0x44 ] return 0; } 4000e1a0: 81 c7 e0 08 ret 4000e1a4: 91 e8 20 00 restore %g0, 0, %o0 =============================================================================== 4000d95c : #endif IMFS_jnode_t *the_jnode, unsigned int block, int malloc_it ) { 4000d95c: 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 ) { 4000d960: 03 10 00 76 sethi %hi(0x4001d800), %g1 4000d964: fa 00 61 a8 ld [ %g1 + 0x1a8 ], %i5 ! 4001d9a8 4000d968: bb 37 60 02 srl %i5, 2, %i5 4000d96c: 82 07 7f ff add %i5, -1, %g1 4000d970: 80 a6 40 01 cmp %i1, %g1 4000d974: 18 80 00 18 bgu 4000d9d4 4000d978: 90 07 60 01 add %i5, 1, %o0 p = info->indirect; if ( malloc_it ) { 4000d97c: 80 a6 a0 00 cmp %i2, 0 4000d980: 02 80 00 10 be 4000d9c0 4000d984: c2 06 20 58 ld [ %i0 + 0x58 ], %g1 if ( !p ) { 4000d988: 80 a0 60 00 cmp %g1, 0 4000d98c: 32 80 00 0a bne,a 4000d9b4 4000d990: f0 06 20 58 ld [ %i0 + 0x58 ], %i0 p = memfile_alloc_block(); 4000d994: 7f ff ff e5 call 4000d928 4000d998: 01 00 00 00 nop if ( !p ) 4000d99c: 80 a2 20 00 cmp %o0, 0 4000d9a0: 32 80 00 04 bne,a 4000d9b0 <== ALWAYS TAKEN 4000d9a4: d0 26 20 58 st %o0, [ %i0 + 0x58 ] return 0; 4000d9a8: 81 c7 e0 08 ret <== NOT EXECUTED 4000d9ac: 91 e8 20 00 restore %g0, 0, %o0 <== NOT EXECUTED info->indirect = p; } return &info->indirect[ my_block ]; 4000d9b0: f0 06 20 58 ld [ %i0 + 0x58 ], %i0 4000d9b4: b3 2e 60 02 sll %i1, 2, %i1 4000d9b8: 81 c7 e0 08 ret 4000d9bc: 91 ee 00 19 restore %i0, %i1, %o0 } if ( !p ) 4000d9c0: 80 a0 60 00 cmp %g1, 0 4000d9c4: 02 bf ff f9 be 4000d9a8 <== NEVER TAKEN 4000d9c8: b3 2e 60 02 sll %i1, 2, %i1 return 0; return &info->indirect[ my_block ]; 4000d9cc: 81 c7 e0 08 ret 4000d9d0: 91 e8 40 19 restore %g1, %i1, %o0 /* * Is the block number in the doubly indirect portion? */ if ( my_block <= LAST_DOUBLY_INDIRECT ) { 4000d9d4: 40 00 29 11 call 40017e18 <.umul> 4000d9d8: 92 10 00 1d mov %i5, %o1 4000d9dc: 82 02 3f ff add %o0, -1, %g1 4000d9e0: 80 a6 40 01 cmp %i1, %g1 4000d9e4: 18 80 00 2c bgu 4000da94 4000d9e8: b8 10 00 08 mov %o0, %i4 my_block -= FIRST_DOUBLY_INDIRECT; 4000d9ec: b2 26 40 1d sub %i1, %i5, %i1 singly = my_block % IMFS_MEMFILE_BLOCK_SLOTS; 4000d9f0: 92 10 00 1d mov %i5, %o1 4000d9f4: 40 00 29 ef call 400181b0 <.urem> 4000d9f8: 90 10 00 19 mov %i1, %o0 doubly = my_block / IMFS_MEMFILE_BLOCK_SLOTS; 4000d9fc: 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; 4000da00: b8 10 00 08 mov %o0, %i4 doubly = my_block / IMFS_MEMFILE_BLOCK_SLOTS; 4000da04: 40 00 29 3f call 40017f00 <.udiv> 4000da08: 90 10 00 19 mov %i1, %o0 p = info->doubly_indirect; if ( malloc_it ) { 4000da0c: 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; 4000da10: ba 10 00 08 mov %o0, %i5 p = info->doubly_indirect; if ( malloc_it ) { 4000da14: 02 80 00 17 be 4000da70 4000da18: d0 06 20 5c ld [ %i0 + 0x5c ], %o0 if ( !p ) { 4000da1c: 80 a2 20 00 cmp %o0, 0 4000da20: 12 80 00 08 bne 4000da40 4000da24: bb 2f 60 02 sll %i5, 2, %i5 p = memfile_alloc_block(); 4000da28: 7f ff ff c0 call 4000d928 4000da2c: 01 00 00 00 nop if ( !p ) 4000da30: 80 a2 20 00 cmp %o0, 0 4000da34: 02 bf ff dd be 4000d9a8 <== NEVER TAKEN 4000da38: 01 00 00 00 nop return 0; info->doubly_indirect = p; 4000da3c: d0 26 20 5c st %o0, [ %i0 + 0x5c ] } p1 = (block_p *)p[ doubly ]; 4000da40: b6 02 00 1d add %o0, %i5, %i3 4000da44: d0 02 00 1d ld [ %o0 + %i5 ], %o0 if ( !p1 ) { 4000da48: 80 a2 20 00 cmp %o0, 0 4000da4c: 12 80 00 4a bne 4000db74 4000da50: b1 2f 20 02 sll %i4, 2, %i0 p1 = memfile_alloc_block(); 4000da54: 7f ff ff b5 call 4000d928 4000da58: 01 00 00 00 nop if ( !p1 ) 4000da5c: 80 a2 20 00 cmp %o0, 0 4000da60: 02 bf ff d2 be 4000d9a8 <== NEVER TAKEN 4000da64: 01 00 00 00 nop return 0; p[ doubly ] = (block_p) p1; 4000da68: 10 80 00 43 b 4000db74 4000da6c: d0 26 c0 00 st %o0, [ %i3 ] } return (block_p *)&p1[ singly ]; } if ( !p ) 4000da70: 80 a2 20 00 cmp %o0, 0 4000da74: 02 bf ff cd be 4000d9a8 <== NEVER TAKEN 4000da78: bb 2f 60 02 sll %i5, 2, %i5 return 0; p = (block_p *)p[ doubly ]; 4000da7c: c2 02 00 1d ld [ %o0 + %i5 ], %g1 if ( !p ) 4000da80: 80 a0 60 00 cmp %g1, 0 4000da84: 02 bf ff c9 be 4000d9a8 <== NEVER TAKEN 4000da88: 01 00 00 00 nop return 0; return (block_p *)&p[ singly ]; 4000da8c: 10 80 00 48 b 4000dbac 4000da90: b1 2f 20 02 sll %i4, 2, %i0 } /* * Is the block number in the triply indirect portion? */ if ( my_block <= LAST_TRIPLY_INDIRECT ) { 4000da94: 90 02 20 01 inc %o0 4000da98: 40 00 28 e0 call 40017e18 <.umul> 4000da9c: 92 10 00 1d mov %i5, %o1 4000daa0: 90 02 3f ff add %o0, -1, %o0 4000daa4: 80 a6 40 08 cmp %i1, %o0 4000daa8: 18 bf ff c0 bgu 4000d9a8 <== NEVER TAKEN 4000daac: b2 26 40 1c sub %i1, %i4, %i1 my_block -= FIRST_TRIPLY_INDIRECT; singly = my_block % IMFS_MEMFILE_BLOCK_SLOTS; 4000dab0: 92 10 00 1d mov %i5, %o1 4000dab4: 40 00 29 bf call 400181b0 <.urem> 4000dab8: 90 10 00 19 mov %i1, %o0 doubly = my_block / IMFS_MEMFILE_BLOCK_SLOTS; 4000dabc: 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; 4000dac0: b6 10 00 08 mov %o0, %i3 doubly = my_block / IMFS_MEMFILE_BLOCK_SLOTS; 4000dac4: 40 00 29 0f call 40017f00 <.udiv> 4000dac8: 90 10 00 19 mov %i1, %o0 triply = doubly / IMFS_MEMFILE_BLOCK_SLOTS; 4000dacc: 92 10 00 1d mov %i5, %o1 4000dad0: 40 00 29 0c call 40017f00 <.udiv> 4000dad4: b2 10 00 08 mov %o0, %i1 doubly %= IMFS_MEMFILE_BLOCK_SLOTS; 4000dad8: 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; 4000dadc: b8 10 00 08 mov %o0, %i4 doubly %= IMFS_MEMFILE_BLOCK_SLOTS; 4000dae0: 40 00 29 b4 call 400181b0 <.urem> 4000dae4: 90 10 00 19 mov %i1, %o0 p = info->triply_indirect; if ( malloc_it ) { 4000dae8: 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; 4000daec: ba 10 00 08 mov %o0, %i5 p = info->triply_indirect; if ( malloc_it ) { 4000daf0: 02 80 00 23 be 4000db7c 4000daf4: d0 06 20 60 ld [ %i0 + 0x60 ], %o0 if ( !p ) { 4000daf8: 80 a2 20 00 cmp %o0, 0 4000dafc: 12 80 00 08 bne 4000db1c 4000db00: b9 2f 20 02 sll %i4, 2, %i4 p = memfile_alloc_block(); 4000db04: 7f ff ff 89 call 4000d928 4000db08: 01 00 00 00 nop if ( !p ) 4000db0c: 80 a2 20 00 cmp %o0, 0 4000db10: 02 bf ff a6 be 4000d9a8 <== NEVER TAKEN 4000db14: 01 00 00 00 nop return 0; info->triply_indirect = p; 4000db18: d0 26 20 60 st %o0, [ %i0 + 0x60 ] } p1 = (block_p *) p[ triply ]; 4000db1c: b4 02 00 1c add %o0, %i4, %i2 4000db20: d0 02 00 1c ld [ %o0 + %i4 ], %o0 if ( !p1 ) { 4000db24: 80 a2 20 00 cmp %o0, 0 4000db28: 12 80 00 08 bne 4000db48 4000db2c: bb 2f 60 02 sll %i5, 2, %i5 p1 = memfile_alloc_block(); 4000db30: 7f ff ff 7e call 4000d928 4000db34: 01 00 00 00 nop if ( !p1 ) 4000db38: 80 a2 20 00 cmp %o0, 0 4000db3c: 02 bf ff 9b be 4000d9a8 <== NEVER TAKEN 4000db40: 01 00 00 00 nop return 0; p[ triply ] = (block_p) p1; 4000db44: d0 26 80 00 st %o0, [ %i2 ] } p2 = (block_p *)p1[ doubly ]; 4000db48: b8 02 00 1d add %o0, %i5, %i4 4000db4c: d0 02 00 1d ld [ %o0 + %i5 ], %o0 if ( !p2 ) { 4000db50: 80 a2 20 00 cmp %o0, 0 4000db54: 12 80 00 08 bne 4000db74 4000db58: b1 2e e0 02 sll %i3, 2, %i0 p2 = memfile_alloc_block(); 4000db5c: 7f ff ff 73 call 4000d928 4000db60: 01 00 00 00 nop if ( !p2 ) 4000db64: 80 a2 20 00 cmp %o0, 0 4000db68: 02 bf ff 90 be 4000d9a8 <== NEVER TAKEN 4000db6c: 01 00 00 00 nop return 0; p1[ doubly ] = (block_p) p2; 4000db70: d0 27 00 00 st %o0, [ %i4 ] } return (block_p *)&p2[ singly ]; 4000db74: 81 c7 e0 08 ret 4000db78: 91 ea 00 18 restore %o0, %i0, %o0 } if ( !p ) 4000db7c: 80 a2 20 00 cmp %o0, 0 4000db80: 02 bf ff 8a be 4000d9a8 <== NEVER TAKEN 4000db84: b9 2f 20 02 sll %i4, 2, %i4 return 0; p1 = (block_p *) p[ triply ]; 4000db88: c2 02 00 1c ld [ %o0 + %i4 ], %g1 if ( !p1 ) 4000db8c: 80 a0 60 00 cmp %g1, 0 4000db90: 02 bf ff 86 be 4000d9a8 <== NEVER TAKEN 4000db94: bb 2f 60 02 sll %i5, 2, %i5 return 0; p2 = (block_p *)p1[ doubly ]; 4000db98: c2 00 40 1d ld [ %g1 + %i5 ], %g1 if ( !p2 ) 4000db9c: 80 a0 60 00 cmp %g1, 0 4000dba0: 02 bf ff 82 be 4000d9a8 <== NEVER TAKEN 4000dba4: 01 00 00 00 nop return 0; return (block_p *)&p2[ singly ]; 4000dba8: b1 2e e0 02 sll %i3, 2, %i0 /* * This means the requested block number is out of range. */ return 0; } 4000dbac: 81 c7 e0 08 ret 4000dbb0: 91 e8 40 18 restore %g1, %i0, %o0 =============================================================================== 4000dbb4 : IMFS_jnode_t *the_jnode, off_t start, unsigned char *destination, unsigned int length ) { 4000dbb4: 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; 4000dbb8: c2 06 20 4c ld [ %i0 + 0x4c ], %g1 4000dbbc: 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 ) { 4000dbc0: c2 00 40 00 ld [ %g1 ], %g1 IMFS_jnode_t *the_jnode, off_t start, unsigned char *destination, unsigned int length ) { 4000dbc4: a0 10 00 19 mov %i1, %l0 4000dbc8: 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 ) { 4000dbcc: 80 a0 60 05 cmp %g1, 5 4000dbd0: 12 80 00 17 bne 4000dc2c 4000dbd4: 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)) 4000dbd8: f4 1e 20 50 ldd [ %i0 + 0x50 ], %i2 4000dbdc: 82 10 20 00 clr %g1 4000dbe0: 86 a6 c0 11 subcc %i3, %l1, %g3 4000dbe4: 84 66 80 19 subx %i2, %i1, %g2 4000dbe8: 80 a0 40 02 cmp %g1, %g2 4000dbec: 14 80 00 07 bg 4000dc08 <== NEVER TAKEN 4000dbf0: d2 06 20 58 ld [ %i0 + 0x58 ], %o1 4000dbf4: 80 a0 40 02 cmp %g1, %g2 4000dbf8: 12 80 00 06 bne 4000dc10 <== NEVER TAKEN 4000dbfc: 80 a7 00 03 cmp %i4, %g3 4000dc00: 28 80 00 05 bleu,a 4000dc14 <== NEVER TAKEN 4000dc04: b0 10 00 1c mov %i4, %i0 <== NOT EXECUTED my_length = the_jnode->info.linearfile.size - start; 4000dc08: 10 80 00 03 b 4000dc14 4000dc0c: 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; 4000dc10: 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); 4000dc14: 90 10 00 12 mov %l2, %o0 4000dc18: 92 02 40 11 add %o1, %l1, %o1 4000dc1c: 40 00 06 9b call 4000f688 4000dc20: 94 10 00 18 mov %i0, %o2 return copied; memcpy( dest, &(*block_ptr)[ 0 ], my_length ); copied += my_length; } IMFS_update_atime( the_jnode ); 4000dc24: 10 80 00 5d b 4000dd98 4000dc28: 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 ) 4000dc2c: c6 06 20 50 ld [ %i0 + 0x50 ], %g3 4000dc30: 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; 4000dc34: 82 10 00 1a mov %i2, %g1 if ( last_byte > the_jnode->info.file.size ) 4000dc38: c4 06 20 54 ld [ %i0 + 0x54 ], %g2 4000dc3c: 80 a1 00 03 cmp %g4, %g3 4000dc40: 14 80 00 08 bg 4000dc60 <== NEVER TAKEN 4000dc44: b6 07 00 1a add %i4, %i2, %i3 4000dc48: 80 a1 00 03 cmp %g4, %g3 4000dc4c: 32 80 00 07 bne,a 4000dc68 <== NEVER TAKEN 4000dc50: 03 10 00 76 sethi %hi(0x4001d800), %g1 <== NOT EXECUTED 4000dc54: 80 a6 c0 02 cmp %i3, %g2 4000dc58: 28 80 00 04 bleu,a 4000dc68 4000dc5c: 03 10 00 76 sethi %hi(0x4001d800), %g1 my_length = the_jnode->info.file.size - start; 4000dc60: 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; 4000dc64: 03 10 00 76 sethi %hi(0x4001d800), %g1 4000dc68: f6 00 61 a8 ld [ %g1 + 0x1a8 ], %i3 ! 4001d9a8 4000dc6c: 90 10 00 10 mov %l0, %o0 4000dc70: b5 3e e0 1f sra %i3, 0x1f, %i2 4000dc74: 96 10 00 1b mov %i3, %o3 4000dc78: 94 10 00 1a mov %i2, %o2 4000dc7c: 40 00 2a e4 call 4001880c <__moddi3> 4000dc80: 92 10 00 11 mov %l1, %o1 block = start / IMFS_MEMFILE_BYTES_PER_BLOCK; 4000dc84: 94 10 00 1a mov %i2, %o2 */ /* * Phase 1: possibly the last part of one block */ start_offset = start % IMFS_MEMFILE_BYTES_PER_BLOCK; 4000dc88: a6 10 00 09 mov %o1, %l3 block = start / IMFS_MEMFILE_BYTES_PER_BLOCK; 4000dc8c: 90 10 00 10 mov %l0, %o0 4000dc90: 92 10 00 11 mov %l1, %o1 4000dc94: 40 00 29 f3 call 40018460 <__divdi3> 4000dc98: 96 10 00 1b mov %i3, %o3 if ( start_offset ) { 4000dc9c: 80 a4 e0 00 cmp %l3, 0 4000dca0: 02 80 00 18 be 4000dd00 4000dca4: b4 10 00 09 mov %o1, %i2 to_copy = IMFS_MEMFILE_BYTES_PER_BLOCK - start_offset; 4000dca8: b6 26 c0 13 sub %i3, %l3, %i3 4000dcac: 80 a7 00 1b cmp %i4, %i3 4000dcb0: 08 80 00 03 bleu 4000dcbc 4000dcb4: b2 10 00 1c mov %i4, %i1 4000dcb8: 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 ); 4000dcbc: 90 10 00 1d mov %i5, %o0 4000dcc0: 92 10 00 1a mov %i2, %o1 4000dcc4: 94 10 20 00 clr %o2 4000dcc8: 7f ff ff 25 call 4000d95c 4000dccc: b0 10 20 00 clr %i0 if ( !block_ptr ) 4000dcd0: 80 a2 20 00 cmp %o0, 0 4000dcd4: 02 80 00 35 be 4000dda8 <== NEVER TAKEN 4000dcd8: 94 10 00 19 mov %i1, %o2 return copied; memcpy( dest, &(*block_ptr)[ start_offset ], to_copy ); 4000dcdc: d2 02 00 00 ld [ %o0 ], %o1 4000dce0: 90 10 00 12 mov %l2, %o0 4000dce4: 92 02 40 13 add %o1, %l3, %o1 4000dce8: 40 00 06 68 call 4000f688 4000dcec: a4 04 80 19 add %l2, %i1, %l2 dest += to_copy; block++; 4000dcf0: b4 06 a0 01 inc %i2 my_length -= to_copy; 4000dcf4: b8 27 00 19 sub %i4, %i1, %i4 copied += to_copy; 4000dcf8: 10 80 00 03 b 4000dd04 4000dcfc: 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; 4000dd00: b0 10 20 00 clr %i0 } /* * Phase 2: all of zero of more blocks */ to_copy = IMFS_MEMFILE_BYTES_PER_BLOCK; 4000dd04: 03 10 00 76 sethi %hi(0x4001d800), %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( 4000dd08: a4 24 80 18 sub %l2, %i0, %l2 } /* * Phase 2: all of zero of more blocks */ to_copy = IMFS_MEMFILE_BYTES_PER_BLOCK; 4000dd0c: f6 00 61 a8 ld [ %g1 + 0x1a8 ], %i3 while ( my_length >= IMFS_MEMFILE_BYTES_PER_BLOCK ) { 4000dd10: 10 80 00 0f b 4000dd4c 4000dd14: a0 10 00 01 mov %g1, %l0 block_ptr = IMFS_memfile_get_block_pointer( the_jnode, block, 0 ); 4000dd18: 90 10 00 1d mov %i5, %o0 4000dd1c: 92 10 00 1a mov %i2, %o1 4000dd20: 7f ff ff 0f call 4000d95c 4000dd24: 94 10 20 00 clr %o2 if ( !block_ptr ) 4000dd28: 82 92 20 00 orcc %o0, 0, %g1 4000dd2c: 02 80 00 1f be 4000dda8 <== NEVER TAKEN 4000dd30: 90 10 00 19 mov %i1, %o0 return copied; memcpy( dest, &(*block_ptr)[ 0 ], to_copy ); 4000dd34: d2 00 40 00 ld [ %g1 ], %o1 4000dd38: 94 10 00 1b mov %i3, %o2 4000dd3c: 40 00 06 53 call 4000f688 4000dd40: b4 06 a0 01 inc %i2 dest += to_copy; block++; my_length -= to_copy; 4000dd44: b8 27 00 1b sub %i4, %i3, %i4 copied += to_copy; 4000dd48: 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 ) { 4000dd4c: c2 04 21 a8 ld [ %l0 + 0x1a8 ], %g1 4000dd50: 80 a7 00 01 cmp %i4, %g1 4000dd54: 1a bf ff f1 bcc 4000dd18 4000dd58: 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 ) { 4000dd5c: 80 a7 20 00 cmp %i4, 0 4000dd60: 02 80 00 0e be 4000dd98 4000dd64: 90 07 bf f8 add %fp, -8, %o0 block_ptr = IMFS_memfile_get_block_pointer( the_jnode, block, 0 ); 4000dd68: 90 10 00 1d mov %i5, %o0 4000dd6c: 92 10 00 1a mov %i2, %o1 4000dd70: 7f ff fe fb call 4000d95c 4000dd74: 94 10 20 00 clr %o2 if ( !block_ptr ) 4000dd78: 82 92 20 00 orcc %o0, 0, %g1 4000dd7c: 02 80 00 0b be 4000dda8 <== NEVER TAKEN 4000dd80: 90 10 00 19 mov %i1, %o0 return copied; memcpy( dest, &(*block_ptr)[ 0 ], my_length ); 4000dd84: d2 00 40 00 ld [ %g1 ], %o1 4000dd88: 94 10 00 1c mov %i4, %o2 4000dd8c: 40 00 06 3f call 4000f688 4000dd90: b0 07 00 18 add %i4, %i0, %i0 copied += my_length; } IMFS_update_atime( the_jnode ); 4000dd94: 90 07 bf f8 add %fp, -8, %o0 4000dd98: 7f ff d8 cd call 400040cc 4000dd9c: 92 10 20 00 clr %o1 4000dda0: c2 07 bf f8 ld [ %fp + -8 ], %g1 4000dda4: c2 27 60 40 st %g1, [ %i5 + 0x40 ] return copied; } 4000dda8: 81 c7 e0 08 ret 4000ddac: 81 e8 00 00 restore =============================================================================== 4000deac : * is better to stick to simple, easy to understand algorithms. */ IMFS_jnode_t *IMFS_memfile_remove( IMFS_jnode_t *the_jnode ) { 4000deac: 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; 4000deb0: 03 10 00 76 sethi %hi(0x4001d800), %g1 4000deb4: fa 00 61 a8 ld [ %g1 + 0x1a8 ], %i5 ! 4001d9a8 * + doubly indirect * + triply indirect */ info = &the_jnode->info.file; if ( info->indirect ) { 4000deb8: c2 06 20 58 ld [ %i0 + 0x58 ], %g1 4000debc: 80 a0 60 00 cmp %g1, 0 4000dec0: 02 80 00 05 be 4000ded4 4000dec4: bb 37 60 02 srl %i5, 2, %i5 memfile_free_blocks_in_table( &info->indirect, to_free ); 4000dec8: 90 06 20 58 add %i0, 0x58, %o0 4000decc: 7f ff ff e5 call 4000de60 4000ded0: 92 10 00 1d mov %i5, %o1 } if ( info->doubly_indirect ) { 4000ded4: c2 06 20 5c ld [ %i0 + 0x5c ], %g1 4000ded8: b8 10 20 00 clr %i4 4000dedc: 80 a0 60 00 cmp %g1, 0 4000dee0: 12 80 00 0d bne 4000df14 4000dee4: 37 10 00 76 sethi %hi(0x4001d800), %i3 } memfile_free_blocks_in_table( &info->doubly_indirect, to_free ); } if ( info->triply_indirect ) { 4000dee8: 10 80 00 15 b 4000df3c 4000deec: 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( 4000def0: 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] ) { 4000def4: 90 00 80 01 add %g2, %g1, %o0 4000def8: c2 00 80 01 ld [ %g2 + %g1 ], %g1 4000defc: 80 a0 60 00 cmp %g1, 0 4000df00: 22 80 00 05 be,a 4000df14 <== NEVER TAKEN 4000df04: b8 07 20 01 inc %i4 <== NOT EXECUTED memfile_free_blocks_in_table( 4000df08: 7f ff ff d6 call 4000de60 4000df0c: 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 4000df24: 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 ); 4000df28: 90 06 20 5c add %i0, 0x5c, %o0 4000df2c: 7f ff ff cd call 4000de60 4000df30: 92 10 00 1d mov %i5, %o1 } if ( info->triply_indirect ) { 4000df34: c2 06 20 60 ld [ %i0 + 0x60 ], %g1 4000df38: b8 10 20 00 clr %i4 4000df3c: 80 a0 60 00 cmp %g1, 0 4000df40: 12 80 00 1c bne 4000dfb0 4000df44: 33 10 00 76 sethi %hi(0x4001d800), %i1 4000df48: 81 c7 e0 08 ret 4000df4c: 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( 4000df50: a1 2f 20 02 sll %i4, 2, %l0 } if ( info->triply_indirect ) { for ( i=0 ; itriply_indirect[i]; 4000df54: f6 00 40 10 ld [ %g1 + %l0 ], %i3 if ( !p ) /* ensure we have a valid pointer */ 4000df58: 80 a6 e0 00 cmp %i3, 0 4000df5c: 02 80 00 1b be 4000dfc8 <== NEVER TAKEN 4000df60: 90 06 20 60 add %i0, 0x60, %o0 4000df64: 10 80 00 09 b 4000df88 4000df68: b4 10 20 00 clr %i2 break; for ( j=0 ; j <== NEVER TAKEN 4000df74: 90 10 00 1b mov %i3, %o0 memfile_free_blocks_in_table( (block_p **)&p[j], to_free); 4000df78: 7f ff ff ba call 4000de60 4000df7c: 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 4000df98: 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( 4000df9c: d0 06 20 60 ld [ %i0 + 0x60 ], %o0 4000dfa0: 92 10 00 1d mov %i5, %o1 4000dfa4: 90 02 00 10 add %o0, %l0, %o0 4000dfa8: 7f ff ff ae call 4000de60 4000dfac: b8 07 20 01 inc %i4 memfile_free_blocks_in_table( &info->doubly_indirect, to_free ); } if ( info->triply_indirect ) { for ( i=0 ; i 4000dfc0: 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( 4000dfc4: 90 06 20 60 add %i0, 0x60, %o0 4000dfc8: 7f ff ff a6 call 4000de60 4000dfcc: 92 10 00 1d mov %i5, %o1 (block_p **)&info->triply_indirect, to_free ); } return the_jnode; } 4000dfd0: 81 c7 e0 08 ret 4000dfd4: 81 e8 00 00 restore =============================================================================== 4000dfd8 : */ MEMFILE_STATIC int IMFS_memfile_remove_block( IMFS_jnode_t *the_jnode, unsigned int block ) { 4000dfd8: 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 ); 4000dfdc: 94 10 20 00 clr %o2 <== NOT EXECUTED 4000dfe0: 92 10 00 19 mov %i1, %o1 <== NOT EXECUTED 4000dfe4: 7f ff fe 5e call 4000d95c <== NOT EXECUTED 4000dfe8: 90 10 00 18 mov %i0, %o0 <== NOT EXECUTED 4000dfec: 82 10 00 08 mov %o0, %g1 <== NOT EXECUTED IMFS_assert( block_ptr ); ptr = *block_ptr; 4000dff0: d0 02 00 00 ld [ %o0 ], %o0 <== NOT EXECUTED *block_ptr = 0; memfile_free_block( ptr ); return 1; } 4000dff4: 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 ); 4000dff8: 7f ff ff 91 call 4000de3c <== NOT EXECUTED 4000dffc: c0 20 40 00 clr [ %g1 ] <== NOT EXECUTED return 1; } 4000e000: 81 c7 e0 08 ret <== NOT EXECUTED 4000e004: 81 e8 00 00 restore <== NOT EXECUTED =============================================================================== 4000e1a8 : IMFS_jnode_t *the_jnode, off_t start, const unsigned char *source, unsigned int length ) { 4000e1a8: 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 ) { 4000e1ac: c2 06 20 50 ld [ %i0 + 0x50 ], %g1 4000e1b0: 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; 4000e1b4: 96 07 00 1a add %i4, %i2, %o3 if ( last_byte > the_jnode->info.file.size ) { 4000e1b8: 80 a0 c0 01 cmp %g3, %g1 4000e1bc: 14 80 00 1b bg 4000e228 <== NEVER TAKEN 4000e1c0: c4 06 20 54 ld [ %i0 + 0x54 ], %g2 4000e1c4: 80 a0 c0 01 cmp %g3, %g1 4000e1c8: 32 80 00 06 bne,a 4000e1e0 <== NEVER TAKEN 4000e1cc: 03 10 00 76 sethi %hi(0x4001d800), %g1 <== NOT EXECUTED 4000e1d0: 80 a2 c0 02 cmp %o3, %g2 4000e1d4: 18 80 00 16 bgu 4000e22c 4000e1d8: 80 a6 40 01 cmp %i1, %g1 */ /* * Phase 1: possibly the last part of one block */ start_offset = start % IMFS_MEMFILE_BYTES_PER_BLOCK; 4000e1dc: 03 10 00 76 sethi %hi(0x4001d800), %g1 4000e1e0: fa 00 61 a8 ld [ %g1 + 0x1a8 ], %i5 ! 4001d9a8 4000e1e4: 92 10 00 1a mov %i2, %o1 4000e1e8: a3 3f 60 1f sra %i5, 0x1f, %l1 4000e1ec: 96 10 00 1d mov %i5, %o3 4000e1f0: 94 10 00 11 mov %l1, %o2 4000e1f4: 40 00 29 86 call 4001880c <__moddi3> 4000e1f8: 90 10 00 19 mov %i1, %o0 block = start / IMFS_MEMFILE_BYTES_PER_BLOCK; 4000e1fc: 90 10 00 19 mov %i1, %o0 */ /* * Phase 1: possibly the last part of one block */ start_offset = start % IMFS_MEMFILE_BYTES_PER_BLOCK; 4000e200: a0 10 00 09 mov %o1, %l0 block = start / IMFS_MEMFILE_BYTES_PER_BLOCK; 4000e204: 94 10 00 11 mov %l1, %o2 4000e208: 92 10 00 1a mov %i2, %o1 4000e20c: 40 00 28 95 call 40018460 <__divdi3> 4000e210: 96 10 00 1d mov %i5, %o3 if ( start_offset ) { 4000e214: 80 a4 20 00 cmp %l0, 0 4000e218: 12 80 00 17 bne 4000e274 4000e21c: b4 10 00 09 mov %o1, %i2 status = IMFS_memfile_extend( the_jnode, zero_fill, last_byte ); if ( status ) return status; } copied = 0; 4000e220: 10 80 00 28 b 4000e2c0 4000e224: 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; 4000e228: 80 a6 40 01 cmp %i1, %g1 <== NOT EXECUTED 4000e22c: 14 80 00 09 bg 4000e250 <== NEVER TAKEN 4000e230: 92 10 20 01 mov 1, %o1 4000e234: 80 a6 40 01 cmp %i1, %g1 4000e238: 32 80 00 06 bne,a 4000e250 <== NEVER TAKEN 4000e23c: 92 10 20 00 clr %o1 <== NOT EXECUTED 4000e240: 80 a6 80 02 cmp %i2, %g2 4000e244: 18 80 00 04 bgu 4000e254 4000e248: 90 10 00 18 mov %i0, %o0 4000e24c: 92 10 20 00 clr %o1 status = IMFS_memfile_extend( the_jnode, zero_fill, last_byte ); 4000e250: 90 10 00 18 mov %i0, %o0 4000e254: 92 0a 60 01 and %o1, 1, %o1 4000e258: 7f ff ff 6c call 4000e008 4000e25c: 94 10 20 00 clr %o2 if ( status ) 4000e260: 82 92 20 00 orcc %o0, 0, %g1 4000e264: 22 bf ff df be,a 4000e1e0 4000e268: 03 10 00 76 sethi %hi(0x4001d800), %g1 } IMFS_mtime_ctime_update( the_jnode ); return copied; } 4000e26c: 81 c7 e0 08 ret 4000e270: 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; 4000e274: ba 27 40 10 sub %i5, %l0, %i5 4000e278: 80 a7 40 1c cmp %i5, %i4 4000e27c: 38 80 00 02 bgu,a 4000e284 4000e280: 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 ); 4000e284: 90 10 00 18 mov %i0, %o0 4000e288: 92 10 00 1a mov %i2, %o1 4000e28c: 7f ff fd b4 call 4000d95c 4000e290: 94 10 20 00 clr %o2 if ( !block_ptr ) 4000e294: 80 a2 20 00 cmp %o0, 0 4000e298: 02 80 00 36 be 4000e370 <== NEVER TAKEN 4000e29c: 82 10 20 00 clr %g1 block, to_copy, src ); #endif memcpy( &(*block_ptr)[ start_offset ], src, to_copy ); 4000e2a0: d0 02 00 00 ld [ %o0 ], %o0 4000e2a4: 92 10 00 1b mov %i3, %o1 4000e2a8: 90 02 00 10 add %o0, %l0, %o0 4000e2ac: 94 10 00 1d mov %i5, %o2 4000e2b0: 40 00 04 f6 call 4000f688 4000e2b4: b6 06 c0 1d add %i3, %i5, %i3 src += to_copy; block++; 4000e2b8: b4 06 a0 01 inc %i2 my_length -= to_copy; 4000e2bc: b8 27 00 1d sub %i4, %i5, %i4 /* * Phase 2: all of zero of more blocks */ to_copy = IMFS_MEMFILE_BYTES_PER_BLOCK; 4000e2c0: 03 10 00 76 sethi %hi(0x4001d800), %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( 4000e2c4: b6 26 c0 1d sub %i3, %i5, %i3 /* * Phase 2: all of zero of more blocks */ to_copy = IMFS_MEMFILE_BYTES_PER_BLOCK; 4000e2c8: f2 00 61 a8 ld [ %g1 + 0x1a8 ], %i1 while ( my_length >= IMFS_MEMFILE_BYTES_PER_BLOCK ) { 4000e2cc: 10 80 00 0f b 4000e308 4000e2d0: a2 10 00 01 mov %g1, %l1 block_ptr = IMFS_memfile_get_block_pointer( the_jnode, block, 0 ); 4000e2d4: 90 10 00 18 mov %i0, %o0 4000e2d8: 92 10 00 1a mov %i2, %o1 4000e2dc: 7f ff fd a0 call 4000d95c 4000e2e0: 94 10 20 00 clr %o2 if ( !block_ptr ) 4000e2e4: 80 a2 20 00 cmp %o0, 0 4000e2e8: 02 80 00 21 be 4000e36c <== NEVER TAKEN 4000e2ec: 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 ); 4000e2f0: d0 02 00 00 ld [ %o0 ], %o0 4000e2f4: 92 10 00 10 mov %l0, %o1 4000e2f8: 40 00 04 e4 call 4000f688 4000e2fc: b4 06 a0 01 inc %i2 src += to_copy; block++; my_length -= to_copy; 4000e300: 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( 4000e304: 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 ) { 4000e308: c2 04 61 a8 ld [ %l1 + 0x1a8 ], %g1 4000e30c: 80 a7 00 01 cmp %i4, %g1 4000e310: 1a bf ff f1 bcc 4000e2d4 4000e314: 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 ) { 4000e318: 80 a7 20 00 cmp %i4, 0 4000e31c: 02 80 00 0f be 4000e358 4000e320: 90 07 bf f8 add %fp, -8, %o0 block_ptr = IMFS_memfile_get_block_pointer( the_jnode, block, 0 ); 4000e324: 90 10 00 18 mov %i0, %o0 4000e328: 92 10 00 1a mov %i2, %o1 4000e32c: 7f ff fd 8c call 4000d95c 4000e330: 94 10 20 00 clr %o2 if ( !block_ptr ) 4000e334: 80 a2 20 00 cmp %o0, 0 4000e338: 02 80 00 0e be 4000e370 <== NEVER TAKEN 4000e33c: 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 ); 4000e340: d0 02 00 00 ld [ %o0 ], %o0 4000e344: 92 10 00 10 mov %l0, %o1 4000e348: 94 10 00 1c mov %i4, %o2 4000e34c: 40 00 04 cf call 4000f688 4000e350: ba 07 40 1c add %i5, %i4, %i5 my_length = 0; copied += to_copy; } IMFS_mtime_ctime_update( the_jnode ); 4000e354: 90 07 bf f8 add %fp, -8, %o0 4000e358: 7f ff d7 5d call 400040cc 4000e35c: 92 10 20 00 clr %o1 4000e360: c2 07 bf f8 ld [ %fp + -8 ], %g1 4000e364: c2 26 20 44 st %g1, [ %i0 + 0x44 ] 4000e368: 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 ) 4000e36c: 82 10 00 1d mov %i5, %g1 } IMFS_mtime_ctime_update( the_jnode ); return copied; } 4000e370: b0 10 00 01 mov %g1, %i0 4000e374: 81 c7 e0 08 ret 4000e378: 81 e8 00 00 restore =============================================================================== 40003844 : const char *name, size_t namelen, mode_t mode, dev_t dev ) { 40003844: 9d e3 bf 80 save %sp, -128, %sp dev_t dev, IMFS_jnode_types_t *type, IMFS_types_union *info ) { if ( S_ISDIR( mode ) ) { 40003848: 05 00 00 3c sethi %hi(0xf000), %g2 4000384c: 07 00 00 10 sethi %hi(0x4000), %g3 40003850: 84 0e c0 02 and %i3, %g2, %g2 40003854: 80 a0 80 03 cmp %g2, %g3 40003858: 02 80 00 12 be 400038a0 4000385c: 07 00 00 20 sethi %hi(0x8000), %g3 *type = IMFS_DIRECTORY; } else if ( S_ISREG( mode ) ) { 40003860: 80 a0 80 03 cmp %g2, %g3 40003864: 02 80 00 11 be 400038a8 40003868: 09 00 00 2c sethi %hi(0xb000), %g4 *type = IMFS_MEMORY_FILE; } else if ( S_ISBLK( mode ) || S_ISCHR( mode ) ) { 4000386c: 07 00 00 08 sethi %hi(0x2000), %g3 40003870: 88 0e c0 04 and %i3, %g4, %g4 40003874: 80 a1 00 03 cmp %g4, %g3 40003878: 12 80 00 05 bne 4000388c 4000387c: 07 00 00 04 sethi %hi(0x1000), %g3 *type = IMFS_DEVICE; rtems_filesystem_split_dev_t( 40003880: 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; 40003884: 10 80 00 0a b 400038ac 40003888: 82 10 20 01 mov 1, %g1 rtems_filesystem_split_dev_t( dev, info->device.major, info->device.minor ); } else if (S_ISFIFO( mode )) { 4000388c: 80 a0 80 03 cmp %g2, %g3 40003890: 32 80 00 08 bne,a 400038b0 <== NEVER TAKEN 40003894: c4 06 20 14 ld [ %i0 + 0x14 ], %g2 <== NOT EXECUTED *type = IMFS_FIFO; 40003898: 10 80 00 05 b 400038ac 4000389c: 82 10 20 06 mov 6, %g1 IMFS_jnode_types_t *type, IMFS_types_union *info ) { if ( S_ISDIR( mode ) ) { *type = IMFS_DIRECTORY; 400038a0: 10 80 00 03 b 400038ac 400038a4: 82 10 20 00 clr %g1 400038a8: 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 = 400038ac: c4 06 20 14 ld [ %i0 + 0x14 ], %g2 (const IMFS_fs_info_t *) parentloc->mt_entry->fs_info; return IMFS_create_node_with_control( 400038b0: 82 00 60 02 add %g1, 2, %g1 400038b4: c4 00 a0 08 ld [ %g2 + 8 ], %g2 400038b8: 83 28 60 02 sll %g1, 2, %g1 400038bc: d2 00 80 01 ld [ %g2 + %g1 ], %o1 400038c0: 90 10 00 18 mov %i0, %o0 400038c4: 94 10 00 19 mov %i1, %o2 400038c8: 96 10 00 1a mov %i2, %o3 400038cc: 98 10 00 1b mov %i3, %o4 400038d0: 40 00 21 07 call 4000bcec 400038d4: 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 ) { 400038d8: 80 a2 20 00 cmp %o0, 0 400038dc: 02 80 00 0e be 40003914 400038e0: 90 07 bf e0 add %fp, -32, %o0 IMFS_jnode_t *parent = parentloc->node_access; 400038e4: fa 06 20 08 ld [ %i0 + 8 ], %i5 IMFS_update_ctime( parent ); 400038e8: 40 00 01 f9 call 400040cc 400038ec: 92 10 20 00 clr %o1 400038f0: c2 07 bf e0 ld [ %fp + -32 ], %g1 IMFS_update_mtime( parent ); 400038f4: 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 ); 400038f8: c2 27 60 48 st %g1, [ %i5 + 0x48 ] IMFS_update_mtime( parent ); 400038fc: 40 00 01 f4 call 400040cc 40003900: 92 10 20 00 clr %o1 40003904: c2 07 bf e0 ld [ %fp + -32 ], %g1 40003908: c2 27 60 44 st %g1, [ %i5 + 0x44 ] size_t namelen, mode_t mode, dev_t dev ) { int rv = 0; 4000390c: 81 c7 e0 08 ret 40003910: 91 e8 20 00 restore %g0, 0, %o0 } else { rv = -1; } return rv; } 40003914: 81 c7 e0 08 ret 40003918: 91 e8 3f ff restore %g0, -1, %o0 =============================================================================== 4000391c : #endif #include "imfs.h" int IMFS_mount( rtems_filesystem_mount_table_entry_t *mt_entry ) { 4000391c: 9d e3 bf a0 save %sp, -96, %sp int rv = 0; IMFS_jnode_t *node = mt_entry->mt_point_node->location.node_access; 40003920: c2 06 20 20 ld [ %i0 + 0x20 ], %g1 40003924: 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; 40003928: c4 00 60 4c ld [ %g1 + 0x4c ], %g2 if ( IMFS_is_directory( node ) ) { 4000392c: c4 00 80 00 ld [ %g2 ], %g2 40003930: 80 a0 a0 00 cmp %g2, 0 40003934: 12 80 00 0d bne 40003968 40003938: 01 00 00 00 nop if ( node->info.directory.mt_fs == NULL ) { 4000393c: c4 00 60 5c ld [ %g1 + 0x5c ], %g2 40003940: 80 a0 a0 00 cmp %g2, 0 40003944: 12 80 00 05 bne 40003958 <== NEVER TAKEN 40003948: 01 00 00 00 nop node->info.directory.mt_fs = mt_entry; 4000394c: 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; 40003950: 81 c7 e0 08 ret 40003954: 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; 40003958: 40 00 2c fb call 4000ed44 <__errno> <== NOT EXECUTED 4000395c: 01 00 00 00 nop <== NOT EXECUTED 40003960: 10 80 00 05 b 40003974 <== NOT EXECUTED 40003964: 82 10 20 10 mov 0x10, %g1 ! 10 <== NOT EXECUTED rv = -1; } } else { errno = ENOTDIR; 40003968: 40 00 2c f7 call 4000ed44 <__errno> 4000396c: 01 00 00 00 nop 40003970: 82 10 20 14 mov 0x14, %g1 ! 14 40003974: c2 22 00 00 st %g1, [ %o0 ] rv = -1; } return rv; } 40003978: 81 c7 e0 08 ret 4000397c: 91 e8 3f ff restore %g0, -1, %o0 =============================================================================== 4000c100 : } static IMFS_jnode_t *IMFS_node_remove_directory( IMFS_jnode_t *node ) { 4000c100: 9d e3 bf a0 save %sp, -96, %sp if ( !rtems_chain_is_empty( &node->info.directory.Entries ) ) { 4000c104: 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 ); 4000c108: 82 06 20 54 add %i0, 0x54, %g1 4000c10c: 80 a0 80 01 cmp %g2, %g1 4000c110: 22 80 00 06 be,a 4000c128 4000c114: c2 06 20 5c ld [ %i0 + 0x5c ], %g1 errno = ENOTEMPTY; 4000c118: 40 00 0b 0b call 4000ed44 <__errno> 4000c11c: 01 00 00 00 nop 4000c120: 10 80 00 08 b 4000c140 4000c124: 82 10 20 5a mov 0x5a, %g1 ! 5a node = NULL; } else if ( IMFS_is_mount_point( node ) ) { 4000c128: 80 a0 60 00 cmp %g1, 0 4000c12c: 02 80 00 07 be 4000c148 <== ALWAYS TAKEN 4000c130: 01 00 00 00 nop errno = EBUSY; 4000c134: 40 00 0b 04 call 4000ed44 <__errno> <== NOT EXECUTED 4000c138: 01 00 00 00 nop <== NOT EXECUTED 4000c13c: 82 10 20 10 mov 0x10, %g1 ! 10 <== NOT EXECUTED 4000c140: c2 22 00 00 st %g1, [ %o0 ] 4000c144: b0 10 20 00 clr %i0 node = NULL; } return node; } 4000c148: 81 c7 e0 08 ret 4000c14c: 81 e8 00 00 restore =============================================================================== 40003980 : rtems_filesystem_node_types_t IMFS_node_type( const rtems_filesystem_location_info_t *loc ) { const IMFS_jnode_t *node = loc->node_access; 40003980: 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; 40003984: c2 00 a0 4c ld [ %g2 + 0x4c ], %g1 40003988: 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 ) { 4000398c: 80 a0 60 02 cmp %g1, 2 40003990: 02 80 00 06 be 400039a8 40003994: 80 a0 60 05 cmp %g1, 5 40003998: 12 80 00 08 bne 400039b8 <== ALWAYS TAKEN 4000399c: 90 10 20 04 mov 4, %o0 400039a0: 81 c3 e0 08 retl <== NOT EXECUTED 400039a4: 01 00 00 00 nop <== NOT EXECUTED 400039a8: c2 00 a0 50 ld [ %g2 + 0x50 ], %g1 400039ac: c2 00 60 4c ld [ %g1 + 0x4c ], %g1 case IMFS_HARD_LINK: type = IMFS_type( node->info.hard_link.link_node ); break; 400039b0: 81 c3 e0 08 retl 400039b4: d0 00 40 00 ld [ %g1 ], %o0 type = imfs_type; break; } return type; } 400039b8: 81 c3 e0 08 retl 400039bc: 90 10 00 01 mov %g1, %o0 =============================================================================== 400039fc : const rtems_filesystem_location_info_t *oldloc, const rtems_filesystem_location_info_t *newparentloc, const char *name, size_t namelen ) { 400039fc: 9d e3 bf 98 save %sp, -104, %sp int rv = 0; IMFS_jnode_t *node = oldloc->node_access; 40003a00: 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 ) { 40003a04: c2 07 60 08 ld [ %i5 + 8 ], %g1 40003a08: 80 a0 60 00 cmp %g1, 0 40003a0c: 02 80 00 20 be 40003a8c <== NEVER TAKEN 40003a10: f4 06 a0 08 ld [ %i2 + 8 ], %i2 if ( namelen < IMFS_NAME_MAX ) { 40003a14: 80 a7 20 1f cmp %i4, 0x1f 40003a18: 18 80 00 19 bgu 40003a7c <== NEVER TAKEN 40003a1c: 94 10 00 1c mov %i4, %o2 memcpy( node->name, name, namelen ); 40003a20: 92 10 00 1b mov %i3, %o1 40003a24: 40 00 2f 19 call 4000f688 40003a28: 90 07 60 0c add %i5, 0xc, %o0 node->name [namelen] = '\0'; 40003a2c: b8 07 40 1c add %i5, %i4, %i4 40003a30: c0 2f 20 0c clrb [ %i4 + 0xc ] ) { Chain_Node *next; Chain_Node *previous; next = the_node->next; 40003a34: c4 07 40 00 ld [ %i5 ], %g2 previous = the_node->previous; 40003a38: c2 07 60 04 ld [ %i5 + 4 ], %g1 IMFS_remove_from_directory( node ); IMFS_add_to_directory( new_parent, node ); IMFS_update_ctime( node ); 40003a3c: 90 07 bf f8 add %fp, -8, %o0 next->previous = previous; 40003a40: c2 20 a0 04 st %g1, [ %g2 + 4 ] previous->next = next; 40003a44: 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; 40003a48: 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; 40003a4c: 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 ); 40003a50: 84 06 a0 54 add %i2, 0x54, %g2 Chain_Node *old_last = tail->previous; the_node->next = tail; tail->previous = the_node; 40003a54: 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; 40003a58: c4 27 40 00 st %g2, [ %i5 ] tail->previous = the_node; old_last->next = the_node; 40003a5c: fa 20 40 00 st %i5, [ %g1 ] the_node->previous = old_last; 40003a60: c2 27 60 04 st %g1, [ %i5 + 4 ] 40003a64: 40 00 01 9a call 400040cc 40003a68: 92 10 20 00 clr %o1 40003a6c: c2 07 bf f8 ld [ %fp + -8 ], %g1 40003a70: c2 27 60 48 st %g1, [ %i5 + 0x48 ] const rtems_filesystem_location_info_t *newparentloc, const char *name, size_t namelen ) { int rv = 0; 40003a74: 81 c7 e0 08 ret 40003a78: 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; 40003a7c: 40 00 2c b2 call 4000ed44 <__errno> <== NOT EXECUTED 40003a80: 01 00 00 00 nop <== NOT EXECUTED 40003a84: 10 80 00 05 b 40003a98 <== NOT EXECUTED 40003a88: 82 10 20 5b mov 0x5b, %g1 ! 5b <== NOT EXECUTED rv = -1; } } else { errno = EINVAL; 40003a8c: 40 00 2c ae call 4000ed44 <__errno> <== NOT EXECUTED 40003a90: 01 00 00 00 nop <== NOT EXECUTED 40003a94: 82 10 20 16 mov 0x16, %g1 ! 16 <== NOT EXECUTED 40003a98: c2 22 00 00 st %g1, [ %o0 ] <== NOT EXECUTED rv = -1; } return rv; } 40003a9c: 81 c7 e0 08 ret <== NOT EXECUTED 40003aa0: 91 e8 3f ff restore %g0, -1, %o0 <== NOT EXECUTED =============================================================================== 40003b7c : #endif #include "imfs.h" int IMFS_unmount( rtems_filesystem_mount_table_entry_t *mt_entry ) { 40003b7c: 9d e3 bf a0 save %sp, -96, %sp int rv = 0; IMFS_jnode_t *node = mt_entry->mt_point_node->location.node_access; 40003b80: c2 06 20 20 ld [ %i0 + 0x20 ], %g1 40003b84: 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; 40003b88: c4 00 60 4c ld [ %g1 + 0x4c ], %g2 if ( IMFS_is_directory( node ) ) { 40003b8c: c4 00 80 00 ld [ %g2 ], %g2 40003b90: 80 a0 a0 00 cmp %g2, 0 40003b94: 12 80 00 0d bne 40003bc8 <== NEVER TAKEN 40003b98: 01 00 00 00 nop if ( node->info.directory.mt_fs == mt_entry ) { 40003b9c: c4 00 60 5c ld [ %g1 + 0x5c ], %g2 40003ba0: 80 a0 80 18 cmp %g2, %i0 40003ba4: 12 80 00 05 bne 40003bb8 <== NEVER TAKEN 40003ba8: 01 00 00 00 nop node->info.directory.mt_fs = NULL; 40003bac: c0 20 60 5c clr [ %g1 + 0x5c ] #include "imfs.h" int IMFS_unmount( rtems_filesystem_mount_table_entry_t *mt_entry ) { int rv = 0; 40003bb0: 81 c7 e0 08 ret 40003bb4: 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; 40003bb8: 40 00 2c 63 call 4000ed44 <__errno> <== NOT EXECUTED 40003bbc: 01 00 00 00 nop <== NOT EXECUTED 40003bc0: 10 80 00 05 b 40003bd4 <== NOT EXECUTED 40003bc4: 82 10 20 16 mov 0x16, %g1 ! 16 <== NOT EXECUTED rv = -1; } } else { errno = ENOTDIR; 40003bc8: 40 00 2c 5f call 4000ed44 <__errno> <== NOT EXECUTED 40003bcc: 01 00 00 00 nop <== NOT EXECUTED 40003bd0: 82 10 20 14 mov 0x14, %g1 ! 14 <== NOT EXECUTED 40003bd4: c2 22 00 00 st %g1, [ %o0 ] <== NOT EXECUTED rv = -1; } return rv; } 40003bd8: 81 c7 e0 08 ret <== NOT EXECUTED 40003bdc: 91 e8 3f ff restore %g0, -1, %o0 <== NOT EXECUTED =============================================================================== 400042b8 : void RTEMS_Malloc_Initialize( const Heap_Area *areas, size_t area_count, Heap_Initialization_or_extend_handler extend ) { 400042b8: 9d e3 bf a0 save %sp, -96, %sp Heap_Control *heap = RTEMS_Malloc_Heap; 400042bc: 03 10 00 74 sethi %hi(0x4001d000), %g1 400042c0: f6 00 62 60 ld [ %g1 + 0x260 ], %i3 ! 4001d260 if ( !rtems_configuration_get_unified_work_area() ) { 400042c4: 03 10 00 6d sethi %hi(0x4001b400), %g1 400042c8: c2 08 60 f9 ldub [ %g1 + 0xf9 ], %g1 ! 4001b4f9 400042cc: 80 a0 60 00 cmp %g1, 0 400042d0: 12 80 00 1b bne 4000433c 400042d4: 03 10 00 76 sethi %hi(0x4001d800), %g1 400042d8: 3b 10 00 24 sethi %hi(0x40009000), %i5 400042dc: b8 10 20 00 clr %i4 400042e0: 10 80 00 0b b 4000430c 400042e4: ba 17 61 64 or %i5, 0x164, %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)( 400042e8: d4 06 20 04 ld [ %i0 + 4 ], %o2 400042ec: 90 10 00 1b mov %i3, %o0 400042f0: 9f c7 40 00 call %i5 400042f4: 96 10 20 08 mov 8, %o3 area->begin, area->size, page_size ); if ( space_available > 0 ) { 400042f8: 80 a2 20 00 cmp %o0, 0 400042fc: 32 80 00 02 bne,a 40004304 <== ALWAYS TAKEN 40004300: 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) { 40004304: b8 07 20 01 inc %i4 40004308: b0 06 20 08 add %i0, 8, %i0 4000430c: 80 a7 00 19 cmp %i4, %i1 40004310: 32 bf ff f6 bne,a 400042e8 40004314: d2 06 00 00 ld [ %i0 ], %o1 if ( space_available > 0 ) { init_or_extend = extend; } } if ( init_or_extend == _Heap_Initialize ) { 40004318: 03 10 00 24 sethi %hi(0x40009000), %g1 4000431c: 82 10 61 64 or %g1, 0x164, %g1 ! 40009164 <_Heap_Initialize> 40004320: 80 a7 40 01 cmp %i5, %g1 40004324: 12 80 00 06 bne 4000433c 40004328: 03 10 00 76 sethi %hi(0x4001d800), %g1 _Internal_error_Occurred( 4000432c: 90 10 20 00 clr %o0 40004330: 92 10 20 01 mov 1, %o1 40004334: 40 00 14 1f call 400093b0 <_Internal_error_Occurred> 40004338: 94 10 20 17 mov 0x17, %o2 } /* * If configured, initialize the statistics support */ if ( rtems_malloc_statistics_helpers != NULL ) { 4000433c: c2 00 61 14 ld [ %g1 + 0x114 ], %g1 40004340: 80 a0 60 00 cmp %g1, 0 40004344: 02 80 00 05 be 40004358 40004348: 3b 10 00 77 sethi %hi(0x4001dc00), %i5 (*rtems_malloc_statistics_helpers->initialize)(); 4000434c: c2 00 40 00 ld [ %g1 ], %g1 40004350: 9f c0 40 00 call %g1 40004354: 01 00 00 00 nop } MSBUMP( space_available, _Protected_heap_Get_size( heap ) ); 40004358: f8 07 61 b0 ld [ %i5 + 0x1b0 ], %i4 4000435c: 40 00 16 56 call 40009cb4 <_Protected_heap_Get_size> 40004360: 90 10 00 1b mov %i3, %o0 40004364: 90 02 00 1c add %o0, %i4, %o0 40004368: d0 27 61 b0 st %o0, [ %i5 + 0x1b0 ] 4000436c: 81 c7 e0 08 ret 40004370: 81 e8 00 00 restore =============================================================================== 40021fac : static rtems_printk_plugin_t print_handler; static void Stack_check_Dump_threads_usage( Thread_Control *the_thread ) { 40021fac: 9d e3 bf 98 save %sp, -104, %sp <== NOT EXECUTED /* * Obtain interrupt stack information */ #if (CPU_ALLOCATE_INTERRUPT_STACK == TRUE) if (the_thread == (Thread_Control *) -1) { 40021fb0: 80 a6 3f ff cmp %i0, -1 <== NOT EXECUTED 40021fb4: 32 80 00 0a bne,a 40021fdc <== NOT EXECUTED 40021fb8: e0 06 21 38 ld [ %i0 + 0x138 ], %l0 <== NOT EXECUTED if (!Stack_check_Interrupt_stack.area) 40021fbc: 3b 10 01 8c sethi %hi(0x40063000), %i5 <== NOT EXECUTED 40021fc0: ba 17 62 1c or %i5, 0x21c, %i5 ! 4006321c <== NOT EXECUTED 40021fc4: c2 07 60 04 ld [ %i5 + 4 ], %g1 <== NOT EXECUTED 40021fc8: 80 a0 60 00 cmp %g1, 0 <== NOT EXECUTED 40021fcc: 02 80 00 4c be 400220fc <== NOT EXECUTED 40021fd0: a0 10 20 00 clr %l0 <== NOT EXECUTED return; stack = &Stack_check_Interrupt_stack; the_thread = 0; 40021fd4: 10 80 00 04 b 40021fe4 <== NOT EXECUTED 40021fd8: b0 10 20 00 clr %i0 <== NOT EXECUTED current = 0; } else #endif { stack = &the_thread->Start.Initial_stack; 40021fdc: ba 06 20 b0 add %i0, 0xb0, %i5 <== NOT EXECUTED current = (void *)_CPU_Context_Get_SP( &the_thread->Registers ); } low = Stack_check_usable_stack_start(stack); 40021fe0: c2 07 60 04 ld [ %i5 + 4 ], %g1 <== NOT EXECUTED size = Stack_check_usable_stack_size(stack); 40021fe4: f2 07 40 00 ld [ %i5 ], %i1 <== NOT EXECUTED { stack = &the_thread->Start.Initial_stack; current = (void *)_CPU_Context_Get_SP( &the_thread->Registers ); } low = Stack_check_usable_stack_start(stack); 40021fe8: 84 00 60 10 add %g1, 0x10, %g2 <== NOT EXECUTED size = Stack_check_usable_stack_size(stack); 40021fec: b2 06 7f f0 add %i1, -16, %i1 <== NOT EXECUTED /* * start at lower memory and find first word that does not * match pattern */ base += PATTERN_SIZE_WORDS; 40021ff0: 82 00 60 20 add %g1, 0x20, %g1 <== NOT EXECUTED for (ebase = base + length; base < ebase; base++) 40021ff4: 86 0e 7f fc and %i1, -4, %g3 <== NOT EXECUTED if (*base != U32_PATTERN) 40021ff8: 09 29 69 69 sethi %hi(0xa5a5a400), %g4 <== NOT EXECUTED * start at lower memory and find first word that does not * match pattern */ base += PATTERN_SIZE_WORDS; for (ebase = base + length; base < ebase; base++) 40021ffc: 86 00 40 03 add %g1, %g3, %g3 <== NOT EXECUTED if (*base != U32_PATTERN) 40022000: 10 80 00 06 b 40022018 <== NOT EXECUTED 40022004: 88 11 21 a5 or %g4, 0x1a5, %g4 <== NOT EXECUTED 40022008: 80 a7 00 04 cmp %i4, %g4 <== NOT EXECUTED 4002200c: 12 80 00 08 bne 4002202c <== NOT EXECUTED 40022010: 80 a0 60 00 cmp %g1, 0 <== NOT EXECUTED * start at lower memory and find first word that does not * match pattern */ base += PATTERN_SIZE_WORDS; for (ebase = base + length; base < ebase; base++) 40022014: 82 00 60 04 add %g1, 4, %g1 <== NOT EXECUTED 40022018: 80 a0 40 03 cmp %g1, %g3 <== NOT EXECUTED 4002201c: 2a bf ff fb bcs,a 40022008 <== NOT EXECUTED 40022020: f8 00 40 00 ld [ %g1 ], %i4 <== NOT EXECUTED high_water_mark = Stack_check_find_high_water_mark(low, size); if ( high_water_mark ) used = Stack_check_Calculate_used( low, size, high_water_mark ); else used = 0; 40022024: 10 80 00 06 b 4002203c <== NOT EXECUTED 40022028: 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 ) 4002202c: 02 80 00 04 be 4002203c <== NOT EXECUTED 40022030: b8 10 20 00 clr %i4 <== NOT EXECUTED used = Stack_check_Calculate_used( low, size, high_water_mark ); 40022034: b8 00 80 19 add %g2, %i1, %i4 <== NOT EXECUTED 40022038: b8 27 00 01 sub %i4, %g1, %i4 <== NOT EXECUTED else used = 0; #if (CPU_ALLOCATE_INTERRUPT_STACK == TRUE) if ( the_thread ) 4002203c: 80 a6 20 00 cmp %i0, 0 <== NOT EXECUTED 40022040: 02 80 00 12 be 40022088 <== NOT EXECUTED 40022044: 03 10 01 89 sethi %hi(0x40062400), %g1 <== NOT EXECUTED #endif { (*print_handler)( 40022048: f6 06 20 08 ld [ %i0 + 8 ], %i3 <== NOT EXECUTED 4002204c: f4 00 61 78 ld [ %g1 + 0x178 ], %i2 <== NOT EXECUTED 40022050: 03 10 01 89 sethi %hi(0x40062400), %g1 <== NOT EXECUTED 40022054: e2 00 61 74 ld [ %g1 + 0x174 ], %l1 ! 40062574 <== NOT EXECUTED 40022058: 94 07 bf f8 add %fp, -8, %o2 <== NOT EXECUTED 4002205c: 90 10 00 1b mov %i3, %o0 <== NOT EXECUTED 40022060: 7f ff b2 ba call 4000eb48 <== NOT EXECUTED 40022064: 92 10 20 05 mov 5, %o1 <== NOT EXECUTED 40022068: 13 10 01 64 sethi %hi(0x40059000), %o1 <== NOT EXECUTED 4002206c: 96 10 00 08 mov %o0, %o3 <== NOT EXECUTED 40022070: 92 12 62 e0 or %o1, 0x2e0, %o1 <== NOT EXECUTED 40022074: 90 10 00 11 mov %l1, %o0 <== NOT EXECUTED 40022078: 9f c6 80 00 call %i2 <== NOT EXECUTED 4002207c: 94 10 00 1b mov %i3, %o2 <== NOT EXECUTED (*print_handler)( print_context, " %010p - %010p %010p %8" PRId32 " ", stack->area, stack->area + stack->size - 1, 40022080: 10 80 00 0a b 400220a8 <== NOT EXECUTED 40022084: d4 07 60 04 ld [ %i5 + 4 ], %o2 <== NOT EXECUTED rtems_object_get_name( the_thread->Object.id, sizeof(name), name ) ); } #if (CPU_ALLOCATE_INTERRUPT_STACK == TRUE) else { (*print_handler)( print_context, "0x%08" PRIx32 " INTR", ~0 ); 40022088: 05 10 01 89 sethi %hi(0x40062400), %g2 <== NOT EXECUTED 4002208c: c2 00 61 78 ld [ %g1 + 0x178 ], %g1 <== NOT EXECUTED 40022090: d0 00 a1 74 ld [ %g2 + 0x174 ], %o0 <== NOT EXECUTED 40022094: 13 10 01 64 sethi %hi(0x40059000), %o1 <== NOT EXECUTED 40022098: 94 10 3f ff mov -1, %o2 <== NOT EXECUTED 4002209c: 9f c0 40 00 call %g1 <== NOT EXECUTED 400220a0: 92 12 62 f0 or %o1, 0x2f0, %o1 <== NOT EXECUTED (*print_handler)( print_context, " %010p - %010p %010p %8" PRId32 " ", stack->area, stack->area + stack->size - 1, 400220a4: d4 07 60 04 ld [ %i5 + 4 ], %o2 <== NOT EXECUTED else { (*print_handler)( print_context, "0x%08" PRIx32 " INTR", ~0 ); } #endif (*print_handler)( 400220a8: 35 10 01 89 sethi %hi(0x40062400), %i2 <== NOT EXECUTED 400220ac: 37 10 01 89 sethi %hi(0x40062400), %i3 <== NOT EXECUTED print_context, " %010p - %010p %010p %8" PRId32 " ", stack->area, stack->area + stack->size - 1, 400220b0: d6 07 40 00 ld [ %i5 ], %o3 <== NOT EXECUTED else { (*print_handler)( print_context, "0x%08" PRIx32 " INTR", ~0 ); } #endif (*print_handler)( 400220b4: c2 06 a1 78 ld [ %i2 + 0x178 ], %g1 <== NOT EXECUTED 400220b8: d0 06 e1 74 ld [ %i3 + 0x174 ], %o0 <== NOT EXECUTED print_context, " %010p - %010p %010p %8" PRId32 " ", stack->area, stack->area + stack->size - 1, 400220bc: 96 02 ff ff add %o3, -1, %o3 <== NOT EXECUTED else { (*print_handler)( print_context, "0x%08" PRIx32 " INTR", ~0 ); } #endif (*print_handler)( 400220c0: 13 10 01 64 sethi %hi(0x40059000), %o1 <== NOT EXECUTED 400220c4: 96 02 80 0b add %o2, %o3, %o3 <== NOT EXECUTED 400220c8: 92 12 63 00 or %o1, 0x300, %o1 <== NOT EXECUTED 400220cc: 98 10 00 10 mov %l0, %o4 <== NOT EXECUTED 400220d0: 9f c0 40 00 call %g1 <== NOT EXECUTED 400220d4: 9a 10 00 19 mov %i1, %o5 <== NOT EXECUTED stack->area + stack->size - 1, current, size ); if (Stack_check_Initialized == 0) { 400220d8: 03 10 01 89 sethi %hi(0x40062400), %g1 <== NOT EXECUTED 400220dc: c2 00 61 70 ld [ %g1 + 0x170 ], %g1 ! 40062570 <== NOT EXECUTED (*print_handler)( print_context, "Unavailable\n" ); 400220e0: d0 06 e1 74 ld [ %i3 + 0x174 ], %o0 <== NOT EXECUTED stack->area + stack->size - 1, current, size ); if (Stack_check_Initialized == 0) { 400220e4: 80 a0 60 00 cmp %g1, 0 <== NOT EXECUTED 400220e8: 12 80 00 07 bne 40022104 <== NOT EXECUTED 400220ec: c2 06 a1 78 ld [ %i2 + 0x178 ], %g1 <== NOT EXECUTED (*print_handler)( print_context, "Unavailable\n" ); 400220f0: 13 10 01 64 sethi %hi(0x40059000), %o1 <== NOT EXECUTED 400220f4: 9f c0 40 00 call %g1 <== NOT EXECUTED 400220f8: 92 12 63 20 or %o1, 0x320, %o1 ! 40059320 <== NOT EXECUTED 400220fc: 81 c7 e0 08 ret <== NOT EXECUTED 40022100: 81 e8 00 00 restore <== NOT EXECUTED } else { (*print_handler)( print_context, "%8" PRId32 "\n", used ); 40022104: 13 10 01 64 sethi %hi(0x40059000), %o1 <== NOT EXECUTED 40022108: 94 10 00 1c mov %i4, %o2 <== NOT EXECUTED 4002210c: 9f c0 40 00 call %g1 <== NOT EXECUTED 40022110: 92 12 63 30 or %o1, 0x330, %o1 <== NOT EXECUTED 40022114: 81 c7 e0 08 ret <== NOT EXECUTED 40022118: 81 e8 00 00 restore <== NOT EXECUTED =============================================================================== 40022204 : Thread_Control *running, bool pattern_ok ) RTEMS_COMPILER_NO_RETURN_ATTRIBUTE; void Stack_check_report_blown_task(Thread_Control *running, bool pattern_ok) { 40022204: 9d e3 bf 80 save %sp, -128, %sp <== NOT EXECUTED Stack_Control *stack = &running->Start.Initial_stack; void *pattern_area = Stack_check_Get_pattern(stack); char name[32]; printk("BLOWN STACK!!!\n"); 40022208: 11 10 01 64 sethi %hi(0x40059000), %o0 <== NOT EXECUTED ) RTEMS_COMPILER_NO_RETURN_ATTRIBUTE; void Stack_check_report_blown_task(Thread_Control *running, bool pattern_ok) { Stack_Control *stack = &running->Start.Initial_stack; void *pattern_area = Stack_check_Get_pattern(stack); 4002220c: fa 06 20 b4 ld [ %i0 + 0xb4 ], %i5 <== NOT EXECUTED char name[32]; printk("BLOWN STACK!!!\n"); 40022210: 7f ff 89 b6 call 400048e8 <== NOT EXECUTED 40022214: 90 12 23 38 or %o0, 0x338, %o0 <== NOT EXECUTED printk("task control block: 0x%08" PRIxPTR "\n", running); 40022218: 92 10 00 18 mov %i0, %o1 <== NOT EXECUTED 4002221c: 11 10 01 64 sethi %hi(0x40059000), %o0 <== NOT EXECUTED 40022220: 7f ff 89 b2 call 400048e8 <== NOT EXECUTED 40022224: 90 12 23 48 or %o0, 0x348, %o0 ! 40059348 <== NOT EXECUTED printk("task ID: 0x%08lx\n", (unsigned long) running->Object.id); 40022228: d2 06 20 08 ld [ %i0 + 8 ], %o1 <== NOT EXECUTED 4002222c: 11 10 01 64 sethi %hi(0x40059000), %o0 <== NOT EXECUTED 40022230: 7f ff 89 ae call 400048e8 <== NOT EXECUTED 40022234: 90 12 23 68 or %o0, 0x368, %o0 ! 40059368 <== NOT EXECUTED printk( 40022238: d2 06 20 0c ld [ %i0 + 0xc ], %o1 <== NOT EXECUTED 4002223c: 11 10 01 64 sethi %hi(0x40059000), %o0 <== NOT EXECUTED 40022240: 7f ff 89 aa call 400048e8 <== NOT EXECUTED 40022244: 90 12 23 80 or %o0, 0x380, %o0 ! 40059380 <== NOT EXECUTED "task name: 0x%08" PRIx32 "\n", running->Object.name.name_u32 ); printk( 40022248: d0 06 20 08 ld [ %i0 + 8 ], %o0 <== NOT EXECUTED 4002224c: 94 07 bf e0 add %fp, -32, %o2 <== NOT EXECUTED 40022250: 7f ff b2 3e call 4000eb48 <== NOT EXECUTED 40022254: 92 10 20 20 mov 0x20, %o1 <== NOT EXECUTED 40022258: 92 10 00 08 mov %o0, %o1 <== NOT EXECUTED 4002225c: 11 10 01 64 sethi %hi(0x40059000), %o0 <== NOT EXECUTED 40022260: 7f ff 89 a2 call 400048e8 <== NOT EXECUTED 40022264: 90 12 23 98 or %o0, 0x398, %o0 ! 40059398 <== NOT EXECUTED ); printk( "task stack area (%lu Bytes): 0x%08" PRIxPTR " .. 0x%08" PRIxPTR "\n", (unsigned long) stack->size, stack->area, ((char *) stack->area + stack->size) 40022268: d4 06 20 b4 ld [ %i0 + 0xb4 ], %o2 <== NOT EXECUTED 4002226c: d2 06 20 b0 ld [ %i0 + 0xb0 ], %o1 <== NOT EXECUTED ); printk( "task name string: %s\n", rtems_object_get_name(running->Object.id, sizeof(name), name) ); printk( 40022270: 11 10 01 64 sethi %hi(0x40059000), %o0 <== NOT EXECUTED 40022274: 96 02 80 09 add %o2, %o1, %o3 <== NOT EXECUTED 40022278: 7f ff 89 9c call 400048e8 <== NOT EXECUTED 4002227c: 90 12 23 b0 or %o0, 0x3b0, %o0 <== NOT EXECUTED "task stack area (%lu Bytes): 0x%08" PRIxPTR " .. 0x%08" PRIxPTR "\n", (unsigned long) stack->size, stack->area, ((char *) stack->area + stack->size) ); if (!pattern_ok) { 40022280: 80 a6 60 00 cmp %i1, 0 <== NOT EXECUTED 40022284: 32 80 00 09 bne,a 400222a8 <== NOT EXECUTED 40022288: d2 06 20 0c ld [ %i0 + 0xc ], %o1 <== NOT EXECUTED printk( 4002228c: 11 10 01 64 sethi %hi(0x40059000), %o0 <== NOT EXECUTED 40022290: 92 10 20 10 mov 0x10, %o1 <== NOT EXECUTED 40022294: 90 12 23 e0 or %o0, 0x3e0, %o0 <== NOT EXECUTED 40022298: 94 07 60 08 add %i5, 8, %o2 <== NOT EXECUTED 4002229c: 7f ff 89 93 call 400048e8 <== NOT EXECUTED 400222a0: 96 07 60 18 add %i5, 0x18, %o3 <== NOT EXECUTED rtems_configuration_get_user_multiprocessing_table()->node ); } #endif rtems_fatal( 400222a4: d2 06 20 0c ld [ %i0 + 0xc ], %o1 <== NOT EXECUTED 400222a8: 7f ff 97 9e call 40008120 <== NOT EXECUTED 400222ac: 90 10 20 09 mov 9, %o0 <== NOT EXECUTED =============================================================================== 4001165c <_CORE_message_queue_Initialize>: CORE_message_queue_Control *the_message_queue, CORE_message_queue_Attributes *the_message_queue_attributes, uint32_t maximum_pending_messages, size_t maximum_message_size ) { 4001165c: 9d e3 bf a0 save %sp, -96, %sp size_t message_buffering_required = 0; size_t allocated_message_size; the_message_queue->maximum_pending_messages = maximum_pending_messages; 40011660: f4 26 20 44 st %i2, [ %i0 + 0x44 ] the_message_queue->number_of_pending_messages = 0; 40011664: c0 26 20 48 clr [ %i0 + 0x48 ] /* * Check if allocated_message_size is aligned to uintptr-size boundary. * If not, it will increase allocated_message_size to multiplicity of pointer * size. */ if (allocated_message_size & (sizeof(uintptr_t) - 1)) { 40011668: 80 8e e0 03 btst 3, %i3 4001166c: 02 80 00 09 be 40011690 <_CORE_message_queue_Initialize+0x34> 40011670: f6 26 20 4c st %i3, [ %i0 + 0x4c ] allocated_message_size += sizeof(uintptr_t); 40011674: 96 06 e0 04 add %i3, 4, %o3 allocated_message_size &= ~(sizeof(uintptr_t) - 1); 40011678: 96 0a ff fc and %o3, -4, %o3 /* * Check for an overflow. It can occur while increasing allocated_message_size * to multiplicity of uintptr_t above. */ if (allocated_message_size < maximum_message_size) 4001167c: 80 a2 c0 1b cmp %o3, %i3 40011680: 3a 80 00 06 bcc,a 40011698 <_CORE_message_queue_Initialize+0x3c> 40011684: ba 02 e0 10 add %o3, 0x10, %i5 return false; 40011688: 10 80 00 24 b 40011718 <_CORE_message_queue_Initialize+0xbc> 4001168c: b0 10 20 00 clr %i0 /* * Check if allocated_message_size is aligned to uintptr-size boundary. * If not, it will increase allocated_message_size to multiplicity of pointer * size. */ if (allocated_message_size & (sizeof(uintptr_t) - 1)) { 40011690: 96 10 00 1b mov %i3, %o3 /* * Calculate how much total memory is required for message buffering and * check for overflow on the multiplication. */ if ( !size_t_mult32_with_overflow( 40011694: ba 02 e0 10 add %o3, 0x10, %i5 size_t a, size_t b, size_t *c ) { long long x = (long long)a*b; 40011698: 90 10 20 00 clr %o0 4001169c: 92 10 00 1a mov %i2, %o1 400116a0: 94 10 20 00 clr %o2 400116a4: 40 00 3d 92 call 40020cec <__muldi3> 400116a8: 96 10 00 1d mov %i5, %o3 if ( x > SIZE_MAX ) 400116ac: 80 a2 20 00 cmp %o0, 0 400116b0: 34 80 00 1a bg,a 40011718 <_CORE_message_queue_Initialize+0xbc> 400116b4: b0 10 20 00 clr %i0 /* * Attempt to allocate the message memory */ the_message_queue->message_buffers = (CORE_message_queue_Buffer *) _Workspace_Allocate( message_buffering_required ); 400116b8: 40 00 0b bf call 400145b4 <_Workspace_Allocate> 400116bc: 90 10 00 09 mov %o1, %o0 return false; /* * Attempt to allocate the message memory */ the_message_queue->message_buffers = (CORE_message_queue_Buffer *) 400116c0: d0 26 20 5c st %o0, [ %i0 + 0x5c ] _Workspace_Allocate( message_buffering_required ); if (the_message_queue->message_buffers == 0) 400116c4: 80 a2 20 00 cmp %o0, 0 400116c8: 02 bf ff f0 be 40011688 <_CORE_message_queue_Initialize+0x2c><== NEVER TAKEN 400116cc: 92 10 00 08 mov %o0, %o1 /* * Initialize the pool of inactive messages, pending messages, * and set of waiting threads. */ _Chain_Initialize ( 400116d0: 90 06 20 60 add %i0, 0x60, %o0 400116d4: 94 10 00 1a mov %i2, %o2 400116d8: 7f ff ff d3 call 40011624 <_Chain_Initialize> 400116dc: 96 10 00 1d mov %i5, %o3 RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); 400116e0: 82 06 20 50 add %i0, 0x50, %g1 head->next = tail; head->previous = NULL; tail->previous = head; 400116e4: c2 26 20 58 st %g1, [ %i0 + 0x58 ] */ RTEMS_INLINE_ROUTINE bool _CORE_message_queue_Is_priority( CORE_message_queue_Attributes *the_attribute ) { return 400116e8: c2 06 40 00 ld [ %i1 ], %g1 RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); 400116ec: 84 06 20 54 add %i0, 0x54, %g2 400116f0: 82 18 60 01 xor %g1, 1, %g1 allocated_message_size + sizeof( CORE_message_queue_Buffer_control ) ); _Chain_Initialize_empty( &the_message_queue->Pending_messages ); _Thread_queue_Initialize( 400116f4: 80 a0 00 01 cmp %g0, %g1 head->next = tail; 400116f8: c4 26 20 50 st %g2, [ %i0 + 0x50 ] head->previous = NULL; 400116fc: c0 26 20 54 clr [ %i0 + 0x54 ] 40011700: 90 10 00 18 mov %i0, %o0 40011704: 92 60 3f ff subx %g0, -1, %o1 40011708: 94 10 20 80 mov 0x80, %o2 4001170c: 96 10 20 06 mov 6, %o3 40011710: 40 00 09 87 call 40013d2c <_Thread_queue_Initialize> 40011714: b0 10 20 01 mov 1, %i0 STATES_WAITING_FOR_MESSAGE, CORE_MESSAGE_QUEUE_STATUS_TIMEOUT ); return true; } 40011718: b0 0e 20 01 and %i0, 1, %i0 4001171c: 81 c7 e0 08 ret 40011720: 81 e8 00 00 restore =============================================================================== 40008e8c <_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 ) { 40008e8c: 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)) ) { 40008e90: 90 10 00 18 mov %i0, %o0 40008e94: 40 00 07 27 call 4000ab30 <_Thread_queue_Dequeue> 40008e98: ba 10 00 18 mov %i0, %i5 40008e9c: 80 a2 20 00 cmp %o0, 0 40008ea0: 12 80 00 0e bne 40008ed8 <_CORE_semaphore_Surrender+0x4c> 40008ea4: 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 ); 40008ea8: 7f ff e5 68 call 40002448 40008eac: 01 00 00 00 nop if ( the_semaphore->count < the_semaphore->Attributes.maximum_count ) 40008eb0: c2 07 60 48 ld [ %i5 + 0x48 ], %g1 40008eb4: c4 07 60 40 ld [ %i5 + 0x40 ], %g2 40008eb8: 80 a0 40 02 cmp %g1, %g2 40008ebc: 1a 80 00 05 bcc 40008ed0 <_CORE_semaphore_Surrender+0x44> <== NEVER TAKEN 40008ec0: b0 10 20 04 mov 4, %i0 the_semaphore->count += 1; 40008ec4: 82 00 60 01 inc %g1 { Thread_Control *the_thread; ISR_Level level; CORE_semaphore_Status status; status = CORE_SEMAPHORE_STATUS_SUCCESSFUL; 40008ec8: b0 10 20 00 clr %i0 #endif } else { _ISR_Disable( level ); if ( the_semaphore->count < the_semaphore->Attributes.maximum_count ) the_semaphore->count += 1; 40008ecc: c2 27 60 48 st %g1, [ %i5 + 0x48 ] else status = CORE_SEMAPHORE_MAXIMUM_COUNT_EXCEEDED; _ISR_Enable( level ); 40008ed0: 7f ff e5 62 call 40002458 40008ed4: 01 00 00 00 nop } return status; } 40008ed8: 81 c7 e0 08 ret 40008edc: 81 e8 00 00 restore =============================================================================== 40007b84 <_Event_Surrender>: rtems_event_set event_in, Event_Control *event, Thread_blocking_operation_States *sync_state, States_Control wait_state ) { 40007b84: 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; 40007b88: e0 06 20 30 ld [ %i0 + 0x30 ], %l0 _ISR_Disable( level ); 40007b8c: 7f ff ea 2f call 40002448 40007b90: ba 10 00 18 mov %i0, %i5 40007b94: 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; 40007b98: c2 06 80 00 ld [ %i2 ], %g1 40007b9c: b2 16 40 01 or %i1, %g1, %i1 40007ba0: 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; 40007ba4: 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 ) ) { 40007ba8: 82 8e 40 02 andcc %i1, %g2, %g1 40007bac: 02 80 00 3d be 40007ca0 <_Event_Surrender+0x11c> 40007bb0: 07 10 00 78 sethi %hi(0x4001e000), %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() && 40007bb4: 86 10 e1 30 or %g3, 0x130, %g3 ! 4001e130 <_Per_CPU_Information> 40007bb8: c8 00 e0 08 ld [ %g3 + 8 ], %g4 40007bbc: 80 a1 20 00 cmp %g4, 0 40007bc0: 22 80 00 18 be,a 40007c20 <_Event_Surrender+0x9c> 40007bc4: c6 07 60 10 ld [ %i5 + 0x10 ], %g3 40007bc8: c6 00 e0 10 ld [ %g3 + 0x10 ], %g3 40007bcc: 80 a7 40 03 cmp %i5, %g3 40007bd0: 32 80 00 14 bne,a 40007c20 <_Event_Surrender+0x9c> 40007bd4: c6 07 60 10 ld [ %i5 + 0x10 ], %g3 _Thread_Is_executing( the_thread ) && ((*sync_state == THREAD_BLOCKING_OPERATION_TIMEOUT) || 40007bd8: c6 06 c0 00 ld [ %i3 ], %g3 40007bdc: 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 ) && 40007be0: 80 a0 e0 01 cmp %g3, 1 40007be4: 38 80 00 0f bgu,a 40007c20 <_Event_Surrender+0x9c> 40007be8: 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) ) { 40007bec: 80 a0 40 02 cmp %g1, %g2 40007bf0: 02 80 00 04 be 40007c00 <_Event_Surrender+0x7c> 40007bf4: 80 8c 20 02 btst 2, %l0 40007bf8: 02 80 00 2a be 40007ca0 <_Event_Surrender+0x11c> <== NEVER TAKEN 40007bfc: 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) ); 40007c00: 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; 40007c04: 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( 40007c08: f2 26 80 00 st %i1, [ %i2 ] pending_events, seized_events ); the_thread->Wait.count = 0; 40007c0c: c0 27 60 24 clr [ %i5 + 0x24 ] *(rtems_event_set *)the_thread->Wait.return_argument = seized_events; 40007c10: c2 20 80 00 st %g1, [ %g2 ] *sync_state = THREAD_BLOCKING_OPERATION_SATISFIED; 40007c14: 82 10 20 03 mov 3, %g1 40007c18: 10 80 00 22 b 40007ca0 <_Event_Surrender+0x11c> 40007c1c: 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 ) ) { 40007c20: 80 8f 00 03 btst %i4, %g3 40007c24: 02 80 00 1f be 40007ca0 <_Event_Surrender+0x11c> 40007c28: 80 a0 40 02 cmp %g1, %g2 if ( seized_events == event_condition || _Options_Is_any( option_set ) ) { 40007c2c: 02 80 00 04 be 40007c3c <_Event_Surrender+0xb8> 40007c30: 80 8c 20 02 btst 2, %l0 40007c34: 02 80 00 1b be 40007ca0 <_Event_Surrender+0x11c> <== NEVER TAKEN 40007c38: 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; 40007c3c: c4 07 60 28 ld [ %i5 + 0x28 ], %g2 40007c40: 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( 40007c44: f2 26 80 00 st %i1, [ %i2 ] pending_events, seized_events ); the_thread->Wait.count = 0; 40007c48: c0 27 60 24 clr [ %i5 + 0x24 ] *(rtems_event_set *)the_thread->Wait.return_argument = seized_events; 40007c4c: c2 20 80 00 st %g1, [ %g2 ] _ISR_Flash( level ); 40007c50: 7f ff ea 02 call 40002458 40007c54: 90 10 00 18 mov %i0, %o0 40007c58: 7f ff e9 fc call 40002448 40007c5c: 01 00 00 00 nop if ( !_Watchdog_Is_active( &the_thread->Timer ) ) { 40007c60: c2 07 60 50 ld [ %i5 + 0x50 ], %g1 40007c64: 80 a0 60 02 cmp %g1, 2 40007c68: 02 80 00 06 be 40007c80 <_Event_Surrender+0xfc> 40007c6c: 82 10 20 03 mov 3, %g1 _ISR_Enable( level ); 40007c70: 7f ff e9 fa call 40002458 40007c74: 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 ); 40007c78: 10 80 00 08 b 40007c98 <_Event_Surrender+0x114> 40007c7c: 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; 40007c80: c2 27 60 50 st %g1, [ %i5 + 0x50 ] _Thread_Unblock( the_thread ); } else { _Watchdog_Deactivate( &the_thread->Timer ); _ISR_Enable( level ); 40007c84: 7f ff e9 f5 call 40002458 40007c88: 33 04 01 ff sethi %hi(0x1007fc00), %i1 (void) _Watchdog_Remove( &the_thread->Timer ); 40007c8c: 40 00 0e 35 call 4000b560 <_Watchdog_Remove> 40007c90: 90 07 60 48 add %i5, 0x48, %o0 40007c94: b2 16 63 f8 or %i1, 0x3f8, %i1 40007c98: 40 00 0a 03 call 4000a4a4 <_Thread_Clear_state> 40007c9c: 91 e8 00 1d restore %g0, %i5, %o0 _Thread_Unblock( the_thread ); } return; } } _ISR_Enable( level ); 40007ca0: 7f ff e9 ee call 40002458 40007ca4: 81 e8 00 00 restore =============================================================================== 40007ca8 <_Event_Timeout>: void _Event_Timeout( Objects_Id id, void *arg ) { 40007ca8: 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 ); 40007cac: 90 10 00 18 mov %i0, %o0 40007cb0: 40 00 0a df call 4000a82c <_Thread_Get> 40007cb4: 92 07 bf fc add %fp, -4, %o1 switch ( location ) { 40007cb8: c2 07 bf fc ld [ %fp + -4 ], %g1 40007cbc: 80 a0 60 00 cmp %g1, 0 40007cc0: 12 80 00 1b bne 40007d2c <_Event_Timeout+0x84> <== NEVER TAKEN 40007cc4: 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 ); 40007cc8: 7f ff e9 e0 call 40002448 40007ccc: 01 00 00 00 nop RTEMS_INLINE_ROUTINE bool _Thread_Is_executing ( const Thread_Control *the_thread ) { return ( the_thread == _Thread_Executing ); 40007cd0: 03 10 00 78 sethi %hi(0x4001e000), %g1 return; } #endif the_thread->Wait.count = 0; if ( _Thread_Is_executing( the_thread ) ) { 40007cd4: c2 00 61 40 ld [ %g1 + 0x140 ], %g1 ! 4001e140 <_Per_CPU_Information+0x10> 40007cd8: 80 a7 40 01 cmp %i5, %g1 40007cdc: 12 80 00 08 bne 40007cfc <_Event_Timeout+0x54> 40007ce0: c0 27 60 24 clr [ %i5 + 0x24 ] if ( *sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED ) 40007ce4: c2 06 40 00 ld [ %i1 ], %g1 40007ce8: 80 a0 60 01 cmp %g1, 1 40007cec: 12 80 00 05 bne 40007d00 <_Event_Timeout+0x58> 40007cf0: 82 10 20 06 mov 6, %g1 *sync_state = THREAD_BLOCKING_OPERATION_TIMEOUT; 40007cf4: 82 10 20 02 mov 2, %g1 40007cf8: c2 26 40 00 st %g1, [ %i1 ] } the_thread->Wait.return_code = RTEMS_TIMEOUT; 40007cfc: 82 10 20 06 mov 6, %g1 40007d00: c2 27 60 34 st %g1, [ %i5 + 0x34 ] _ISR_Enable( level ); 40007d04: 7f ff e9 d5 call 40002458 40007d08: 01 00 00 00 nop RTEMS_INLINE_ROUTINE void _Thread_Unblock ( Thread_Control *the_thread ) { _Thread_Clear_state( the_thread, STATES_BLOCKED ); 40007d0c: 90 10 00 1d mov %i5, %o0 40007d10: 13 04 01 ff sethi %hi(0x1007fc00), %o1 40007d14: 40 00 09 e4 call 4000a4a4 <_Thread_Clear_state> 40007d18: 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; 40007d1c: 03 10 00 77 sethi %hi(0x4001dc00), %g1 40007d20: c4 00 63 30 ld [ %g1 + 0x330 ], %g2 ! 4001df30 <_Thread_Dispatch_disable_level> --level; 40007d24: 84 00 bf ff add %g2, -1, %g2 _Thread_Dispatch_disable_level = level; 40007d28: c4 20 63 30 st %g2, [ %g1 + 0x330 ] 40007d2c: 81 c7 e0 08 ret 40007d30: 81 e8 00 00 restore =============================================================================== 4000d40c <_Heap_Free>: return do_free; } #endif bool _Heap_Free( Heap_Control *heap, void *alloc_begin_ptr ) { 4000d40c: 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 ) { 4000d410: 80 a6 60 00 cmp %i1, 0 4000d414: 02 80 00 7a be 4000d5fc <_Heap_Free+0x1f0> 4000d418: 88 10 20 01 mov 1, %g4 4000d41c: d2 06 20 10 ld [ %i0 + 0x10 ], %o1 4000d420: 40 00 2b 64 call 400181b0 <.urem> 4000d424: 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 4000d428: 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); 4000d42c: 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); 4000d430: 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; 4000d434: 80 a2 00 1b cmp %o0, %i3 4000d438: 0a 80 00 05 bcs 4000d44c <_Heap_Free+0x40> 4000d43c: 82 10 20 00 clr %g1 4000d440: c2 06 20 24 ld [ %i0 + 0x24 ], %g1 4000d444: 80 a0 40 08 cmp %g1, %o0 4000d448: 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 ) ) { 4000d44c: 80 a0 60 00 cmp %g1, 0 4000d450: 02 80 00 6b be 4000d5fc <_Heap_Free+0x1f0> 4000d454: 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; 4000d458: f8 02 20 04 ld [ %o0 + 4 ], %i4 4000d45c: 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); 4000d460: 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; 4000d464: 80 a0 40 1b cmp %g1, %i3 4000d468: 0a 80 00 05 bcs 4000d47c <_Heap_Free+0x70> <== NEVER TAKEN 4000d46c: 86 10 20 00 clr %g3 4000d470: c6 06 20 24 ld [ %i0 + 0x24 ], %g3 4000d474: 80 a0 c0 01 cmp %g3, %g1 4000d478: 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 ) ) { 4000d47c: 80 a0 e0 00 cmp %g3, 0 4000d480: 02 80 00 5f be 4000d5fc <_Heap_Free+0x1f0> <== NEVER TAKEN 4000d484: 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; 4000d488: fa 00 60 04 ld [ %g1 + 4 ], %i5 return false; } _Heap_Protection_block_check( heap, next_block ); if ( !_Heap_Is_prev_used( next_block ) ) { 4000d48c: 80 8f 60 01 btst 1, %i5 4000d490: 22 80 00 5c be,a 4000d600 <_Heap_Free+0x1f4> <== NEVER TAKEN 4000d494: 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 4000d498: c8 06 20 24 ld [ %i0 + 0x24 ], %g4 && !_Heap_Is_prev_used( _Heap_Block_at( next_block, next_block_size )); 4000d49c: 80 a0 40 04 cmp %g1, %g4 4000d4a0: 02 80 00 07 be 4000d4bc <_Heap_Free+0xb0> 4000d4a4: ba 0f 7f fe and %i5, -2, %i5 4000d4a8: 86 00 40 1d add %g1, %i5, %g3 4000d4ac: f4 00 e0 04 ld [ %g3 + 4 ], %i2 4000d4b0: b4 1e a0 01 xor %i2, 1, %i2 4000d4b4: 10 80 00 03 b 4000d4c0 <_Heap_Free+0xb4> 4000d4b8: b4 0e a0 01 and %i2, 1, %i2 4000d4bc: b4 10 20 00 clr %i2 if ( !_Heap_Is_prev_used( block ) ) { 4000d4c0: 80 8f 20 01 btst 1, %i4 4000d4c4: 12 80 00 26 bne 4000d55c <_Heap_Free+0x150> 4000d4c8: 80 8e a0 ff btst 0xff, %i2 uintptr_t const prev_size = block->prev_size; 4000d4cc: 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); 4000d4d0: 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; 4000d4d4: 80 a0 c0 1b cmp %g3, %i3 4000d4d8: 0a 80 00 04 bcs 4000d4e8 <_Heap_Free+0xdc> <== NEVER TAKEN 4000d4dc: b2 10 20 00 clr %i1 4000d4e0: 80 a1 00 03 cmp %g4, %g3 4000d4e4: 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 ) ) { 4000d4e8: 80 a6 60 00 cmp %i1, 0 4000d4ec: 02 80 00 44 be 4000d5fc <_Heap_Free+0x1f0> <== NEVER TAKEN 4000d4f0: 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; 4000d4f4: 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) ) { 4000d4f8: 80 8e e0 01 btst 1, %i3 4000d4fc: 02 80 00 40 be 4000d5fc <_Heap_Free+0x1f0> <== NEVER TAKEN 4000d500: 80 8e a0 ff btst 0xff, %i2 _HAssert( false ); return( false ); } if ( next_is_free ) { /* coalesce both */ 4000d504: 22 80 00 0f be,a 4000d540 <_Heap_Free+0x134> 4000d508: 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; 4000d50c: c8 00 60 08 ld [ %g1 + 8 ], %g4 Heap_Block *prev = block->prev; 4000d510: c2 00 60 0c ld [ %g1 + 0xc ], %g1 uintptr_t const size = block_size + prev_size + next_block_size; 4000d514: ba 00 80 1d add %g2, %i5, %i5 prev->next = next; 4000d518: c8 20 60 08 st %g4, [ %g1 + 8 ] next->prev = prev; 4000d51c: c2 21 20 0c st %g1, [ %g4 + 0xc ] _Heap_Free_list_remove( next_block ); stats->free_blocks -= 1; 4000d520: 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; 4000d524: b8 07 40 1c add %i5, %i4, %i4 _Heap_Free_list_remove( next_block ); stats->free_blocks -= 1; 4000d528: 82 00 7f ff add %g1, -1, %g1 4000d52c: 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; 4000d530: 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; 4000d534: 82 17 20 01 or %i4, 1, %g1 4000d538: 10 80 00 27 b 4000d5d4 <_Heap_Free+0x1c8> 4000d53c: 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; 4000d540: 88 17 20 01 or %i4, 1, %g4 4000d544: c8 20 e0 04 st %g4, [ %g3 + 4 ] next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED; 4000d548: c6 00 60 04 ld [ %g1 + 4 ], %g3 next_block->prev_size = size; 4000d54c: 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; 4000d550: 86 08 ff fe and %g3, -2, %g3 4000d554: 10 80 00 20 b 4000d5d4 <_Heap_Free+0x1c8> 4000d558: c6 20 60 04 st %g3, [ %g1 + 4 ] next_block->prev_size = size; } } else if ( next_is_free ) { /* coalesce next */ 4000d55c: 22 80 00 0d be,a 4000d590 <_Heap_Free+0x184> 4000d560: 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; 4000d564: c8 00 60 08 ld [ %g1 + 8 ], %g4 Heap_Block *prev = old_block->prev; 4000d568: c2 00 60 0c ld [ %g1 + 0xc ], %g1 new_block->next = next; 4000d56c: c8 22 20 08 st %g4, [ %o0 + 8 ] new_block->prev = prev; 4000d570: c2 22 20 0c st %g1, [ %o0 + 0xc ] uintptr_t const size = block_size + next_block_size; 4000d574: 86 07 40 02 add %i5, %g2, %g3 next->prev = new_block; prev->next = new_block; 4000d578: 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; 4000d57c: d0 21 20 0c st %o0, [ %g4 + 0xc ] _Heap_Free_list_replace( next_block, block ); block->size_and_flag = size | HEAP_PREV_BLOCK_USED; 4000d580: 82 10 e0 01 or %g3, 1, %g1 next_block = _Heap_Block_at( block, size ); next_block->prev_size = size; 4000d584: 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; 4000d588: 10 80 00 13 b 4000d5d4 <_Heap_Free+0x1c8> 4000d58c: c2 22 20 04 st %g1, [ %o0 + 4 ] ) { Heap_Block *next = block_before->next; new_block->next = next; new_block->prev = block_before; 4000d590: f0 22 20 0c st %i0, [ %o0 + 0xc ] Heap_Block *new_block ) { Heap_Block *next = block_before->next; new_block->next = next; 4000d594: c6 22 20 08 st %g3, [ %o0 + 8 ] new_block->prev = block_before; block_before->next = new_block; next->prev = new_block; 4000d598: 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; 4000d59c: 86 10 a0 01 or %g2, 1, %g3 4000d5a0: c6 22 20 04 st %g3, [ %o0 + 4 ] next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED; 4000d5a4: c6 00 60 04 ld [ %g1 + 4 ], %g3 next_block->prev_size = block_size; 4000d5a8: 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; 4000d5ac: 86 08 ff fe and %g3, -2, %g3 4000d5b0: c6 20 60 04 st %g3, [ %g1 + 4 ] next_block->prev_size = block_size; /* Statistics */ ++stats->free_blocks; 4000d5b4: c2 06 20 38 ld [ %i0 + 0x38 ], %g1 if ( stats->max_free_blocks < stats->free_blocks ) { 4000d5b8: 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; 4000d5bc: 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; 4000d5c0: d0 26 20 08 st %o0, [ %i0 + 8 ] if ( stats->max_free_blocks < stats->free_blocks ) { 4000d5c4: 80 a0 c0 01 cmp %g3, %g1 4000d5c8: 1a 80 00 03 bcc 4000d5d4 <_Heap_Free+0x1c8> 4000d5cc: c2 26 20 38 st %g1, [ %i0 + 0x38 ] stats->max_free_blocks = stats->free_blocks; 4000d5d0: c2 26 20 3c st %g1, [ %i0 + 0x3c ] } } /* Statistics */ --stats->used_blocks; 4000d5d4: c2 06 20 40 ld [ %i0 + 0x40 ], %g1 4000d5d8: 82 00 7f ff add %g1, -1, %g1 4000d5dc: c2 26 20 40 st %g1, [ %i0 + 0x40 ] ++stats->frees; 4000d5e0: c2 06 20 50 ld [ %i0 + 0x50 ], %g1 4000d5e4: 82 00 60 01 inc %g1 4000d5e8: c2 26 20 50 st %g1, [ %i0 + 0x50 ] stats->free_size += block_size; 4000d5ec: c2 06 20 30 ld [ %i0 + 0x30 ], %g1 4000d5f0: 84 00 40 02 add %g1, %g2, %g2 4000d5f4: 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; 4000d5f8: 88 10 20 01 mov 1, %g4 --stats->used_blocks; ++stats->frees; stats->free_size += block_size; return( true ); } 4000d5fc: b0 09 20 01 and %g4, 1, %i0 4000d600: 81 c7 e0 08 ret 4000d604: 81 e8 00 00 restore =============================================================================== 4000b07c <_Heap_Greedy_allocate>: Heap_Block *_Heap_Greedy_allocate( Heap_Control *heap, const uintptr_t *block_sizes, size_t block_count ) { 4000b07c: 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) { 4000b080: b6 10 20 00 clr %i3 Heap_Block *_Heap_Greedy_allocate( Heap_Control *heap, const uintptr_t *block_sizes, size_t block_count ) { 4000b084: 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) { 4000b088: 10 80 00 11 b 4000b0cc <_Heap_Greedy_allocate+0x50> 4000b08c: 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 ); 4000b090: d2 06 40 01 ld [ %i1 + %g1 ], %o1 4000b094: 90 10 00 1d mov %i5, %o0 4000b098: 94 10 20 00 clr %o2 4000b09c: 40 00 1b 73 call 40011e68 <_Heap_Allocate_aligned_with_boundary> 4000b0a0: 96 10 20 00 clr %o3 void *next = _Heap_Allocate( heap, block_sizes [i] ); if ( next != NULL ) { 4000b0a4: 82 92 20 00 orcc %o0, 0, %g1 4000b0a8: 22 80 00 09 be,a 4000b0cc <_Heap_Greedy_allocate+0x50> <== NEVER TAKEN 4000b0ac: 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); 4000b0b0: d2 07 60 10 ld [ %i5 + 0x10 ], %o1 4000b0b4: 40 00 31 25 call 40017548 <.urem> 4000b0b8: 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); 4000b0bc: 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; 4000b0c0: f8 22 20 08 st %i4, [ %o0 + 8 ] 4000b0c4: 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) { 4000b0c8: b6 06 e0 01 inc %i3 4000b0cc: 80 a6 c0 1a cmp %i3, %i2 4000b0d0: 12 bf ff f0 bne 4000b090 <_Heap_Greedy_allocate+0x14> 4000b0d4: 83 2e e0 02 sll %i3, 2, %g1 4000b0d8: 10 80 00 0a b 4000b100 <_Heap_Greedy_allocate+0x84> 4000b0dc: b0 10 20 00 clr %i0 allocated_blocks = next_block; } } while ( (current = _Heap_Free_list_first( heap )) != free_list_tail ) { _Heap_Block_allocate( 4000b0e0: 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; 4000b0e4: 96 0a ff fe and %o3, -2, %o3 4000b0e8: 92 10 00 1b mov %i3, %o1 4000b0ec: 94 06 e0 08 add %i3, 8, %o2 4000b0f0: 40 00 00 cb call 4000b41c <_Heap_Block_allocate> 4000b0f4: 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; 4000b0f8: f0 26 e0 08 st %i0, [ %i3 + 8 ] 4000b0fc: 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; 4000b100: 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 ) { 4000b104: 80 a6 c0 1d cmp %i3, %i5 4000b108: 32 bf ff f6 bne,a 4000b0e0 <_Heap_Greedy_allocate+0x64> 4000b10c: d6 06 e0 04 ld [ %i3 + 4 ], %o3 current->next = blocks; blocks = current; } while ( allocated_blocks != NULL ) { 4000b110: 10 80 00 07 b 4000b12c <_Heap_Greedy_allocate+0xb0> 4000b114: 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 ) ); 4000b118: 92 07 20 08 add %i4, 8, %o1 4000b11c: 90 10 00 1d mov %i5, %o0 4000b120: 40 00 1b c3 call 4001202c <_Heap_Free> 4000b124: b8 10 00 1b mov %i3, %i4 current->next = blocks; blocks = current; } while ( allocated_blocks != NULL ) { 4000b128: 80 a7 20 00 cmp %i4, 0 4000b12c: 32 bf ff fb bne,a 4000b118 <_Heap_Greedy_allocate+0x9c> 4000b130: 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; } 4000b134: 81 c7 e0 08 ret 4000b138: 81 e8 00 00 restore =============================================================================== 40012e70 <_Heap_Iterate>: void _Heap_Iterate( Heap_Control *heap, Heap_Block_visitor visitor, void *visitor_arg ) { 40012e70: 9d e3 bf a0 save %sp, -96, %sp <== NOT EXECUTED Heap_Block *current = heap->first_block; Heap_Block *end = heap->last_block; bool stop = false; 40012e74: 90 10 20 00 clr %o0 <== NOT EXECUTED Heap_Control *heap, Heap_Block_visitor visitor, void *visitor_arg ) { Heap_Block *current = heap->first_block; 40012e78: c2 06 20 20 ld [ %i0 + 0x20 ], %g1 <== NOT EXECUTED Heap_Block *end = heap->last_block; bool stop = false; while ( !stop && current != end ) { 40012e7c: 10 80 00 0a b 40012ea4 <_Heap_Iterate+0x34> <== NOT EXECUTED 40012e80: f8 06 20 24 ld [ %i0 + 0x24 ], %i4 <== NOT EXECUTED uintptr_t size = _Heap_Block_size( current ); Heap_Block *next = _Heap_Block_at( current, size ); bool used = _Heap_Is_prev_used( next ); stop = (*visitor)( current, size, used, visitor_arg ); 40012e84: 90 10 00 01 mov %g1, %o0 <== NOT EXECUTED 40012e88: 92 0a 7f fe and %o1, -2, %o1 <== NOT EXECUTED RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); 40012e8c: ba 00 40 09 add %g1, %o1, %i5 <== NOT EXECUTED block->size_and_flag = size | flag; } RTEMS_INLINE_ROUTINE bool _Heap_Is_prev_used( const Heap_Block *block ) { return block->size_and_flag & HEAP_PREV_BLOCK_USED; 40012e90: d4 07 60 04 ld [ %i5 + 4 ], %o2 <== NOT EXECUTED 40012e94: 96 10 00 1a mov %i2, %o3 <== NOT EXECUTED 40012e98: 9f c6 40 00 call %i1 <== NOT EXECUTED 40012e9c: 94 0a a0 01 and %o2, 1, %o2 <== NOT EXECUTED 40012ea0: 82 10 00 1d mov %i5, %g1 <== NOT EXECUTED { Heap_Block *current = heap->first_block; Heap_Block *end = heap->last_block; bool stop = false; while ( !stop && current != end ) { 40012ea4: 80 a0 40 1c cmp %g1, %i4 <== NOT EXECUTED 40012ea8: 02 80 00 05 be 40012ebc <_Heap_Iterate+0x4c> <== NOT EXECUTED 40012eac: 90 1a 20 01 xor %o0, 1, %o0 <== NOT EXECUTED 40012eb0: 80 8a 20 ff btst 0xff, %o0 <== NOT EXECUTED 40012eb4: 32 bf ff f4 bne,a 40012e84 <_Heap_Iterate+0x14> <== NOT EXECUTED 40012eb8: d2 00 60 04 ld [ %g1 + 4 ], %o1 <== NOT EXECUTED 40012ebc: 81 c7 e0 08 ret <== NOT EXECUTED 40012ec0: 81 e8 00 00 restore <== NOT EXECUTED =============================================================================== 4001b1b0 <_Heap_Size_of_alloc_area>: bool _Heap_Size_of_alloc_area( Heap_Control *heap, void *alloc_begin_ptr, uintptr_t *alloc_size ) { 4001b1b0: 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); 4001b1b4: d2 06 20 10 ld [ %i0 + 0x10 ], %o1 4001b1b8: 7f ff f3 fe call 400181b0 <.urem> 4001b1bc: 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 4001b1c0: 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); 4001b1c4: 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); 4001b1c8: 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; 4001b1cc: 80 a2 00 04 cmp %o0, %g4 4001b1d0: 0a 80 00 05 bcs 4001b1e4 <_Heap_Size_of_alloc_area+0x34> 4001b1d4: 82 10 20 00 clr %g1 4001b1d8: c2 06 20 24 ld [ %i0 + 0x24 ], %g1 4001b1dc: 80 a0 40 08 cmp %g1, %o0 4001b1e0: 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 ) ) { 4001b1e4: 80 a0 60 00 cmp %g1, 0 4001b1e8: 02 80 00 15 be 4001b23c <_Heap_Size_of_alloc_area+0x8c> 4001b1ec: 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; 4001b1f0: c2 02 20 04 ld [ %o0 + 4 ], %g1 4001b1f4: 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); 4001b1f8: 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; 4001b1fc: 80 a0 40 04 cmp %g1, %g4 4001b200: 0a 80 00 05 bcs 4001b214 <_Heap_Size_of_alloc_area+0x64> <== NEVER TAKEN 4001b204: 84 10 20 00 clr %g2 4001b208: c4 06 20 24 ld [ %i0 + 0x24 ], %g2 4001b20c: 80 a0 80 01 cmp %g2, %g1 4001b210: 84 60 3f ff subx %g0, -1, %g2 } block_size = _Heap_Block_size( block ); next_block = _Heap_Block_at( block, block_size ); if ( 4001b214: 80 a0 a0 00 cmp %g2, 0 4001b218: 02 80 00 09 be 4001b23c <_Heap_Size_of_alloc_area+0x8c> <== NEVER TAKEN 4001b21c: 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; 4001b220: c4 00 60 04 ld [ %g1 + 4 ], %g2 !_Heap_Is_block_in_heap( heap, next_block ) || !_Heap_Is_prev_used( next_block ) 4001b224: 80 88 a0 01 btst 1, %g2 4001b228: 02 80 00 05 be 4001b23c <_Heap_Size_of_alloc_area+0x8c> <== NEVER TAKEN 4001b22c: 82 20 40 19 sub %g1, %i1, %g1 return false; } *alloc_size = (uintptr_t) next_block + HEAP_ALLOC_BONUS - alloc_begin; return true; 4001b230: 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; 4001b234: 82 00 60 04 add %g1, 4, %g1 4001b238: c2 26 80 00 st %g1, [ %i2 ] return true; } 4001b23c: b0 08 e0 01 and %g3, 1, %i0 4001b240: 81 c7 e0 08 ret 4001b244: 81 e8 00 00 restore =============================================================================== 40009c74 <_Heap_Walk>: bool _Heap_Walk( Heap_Control *heap, int source, bool dump ) { 40009c74: 9d e3 bf 80 save %sp, -128, %sp 40009c78: ac 10 00 19 mov %i1, %l6 uintptr_t const page_size = heap->page_size; 40009c7c: f8 06 20 10 ld [ %i0 + 0x10 ], %i4 uintptr_t const min_block_size = heap->min_block_size; 40009c80: f6 06 20 14 ld [ %i0 + 0x14 ], %i3 Heap_Block *const first_block = heap->first_block; 40009c84: 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; 40009c88: 80 a6 a0 00 cmp %i2, 0 40009c8c: 02 80 00 05 be 40009ca0 <_Heap_Walk+0x2c> 40009c90: e0 06 20 24 ld [ %i0 + 0x24 ], %l0 40009c94: 3b 10 00 27 sethi %hi(0x40009c00), %i5 40009c98: 10 80 00 04 b 40009ca8 <_Heap_Walk+0x34> 40009c9c: ba 17 60 24 or %i5, 0x24, %i5 ! 40009c24 <_Heap_Walk_print> 40009ca0: 3b 10 00 27 sethi %hi(0x40009c00), %i5 40009ca4: ba 17 60 1c or %i5, 0x1c, %i5 ! 40009c1c <_Heap_Walk_print_nothing> if ( !_System_state_Is_up( _System_state_Get() ) ) { 40009ca8: 05 10 00 61 sethi %hi(0x40018400), %g2 40009cac: c4 00 a2 ec ld [ %g2 + 0x2ec ], %g2 ! 400186ec <_System_state_Current> 40009cb0: 80 a0 a0 03 cmp %g2, 3 40009cb4: 22 80 00 04 be,a 40009cc4 <_Heap_Walk+0x50> 40009cb8: c4 06 20 1c ld [ %i0 + 0x1c ], %g2 return true; 40009cbc: 10 80 01 2a b 4000a164 <_Heap_Walk+0x4f0> 40009cc0: 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)( 40009cc4: da 06 20 18 ld [ %i0 + 0x18 ], %o5 40009cc8: c4 23 a0 5c st %g2, [ %sp + 0x5c ] 40009ccc: f2 23 a0 60 st %i1, [ %sp + 0x60 ] 40009cd0: e0 23 a0 64 st %l0, [ %sp + 0x64 ] 40009cd4: c4 06 20 08 ld [ %i0 + 8 ], %g2 40009cd8: 90 10 00 16 mov %l6, %o0 40009cdc: c4 23 a0 68 st %g2, [ %sp + 0x68 ] 40009ce0: c4 06 20 0c ld [ %i0 + 0xc ], %g2 40009ce4: 92 10 20 00 clr %o1 40009ce8: c4 23 a0 6c st %g2, [ %sp + 0x6c ] 40009cec: 15 10 00 56 sethi %hi(0x40015800), %o2 40009cf0: 96 10 00 1c mov %i4, %o3 40009cf4: 94 12 a3 e8 or %o2, 0x3e8, %o2 40009cf8: 9f c7 40 00 call %i5 40009cfc: 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 ) { 40009d00: 80 a7 20 00 cmp %i4, 0 40009d04: 12 80 00 07 bne 40009d20 <_Heap_Walk+0xac> 40009d08: 80 8f 20 07 btst 7, %i4 (*printer)( source, true, "page size is zero\n" ); 40009d0c: 15 10 00 57 sethi %hi(0x40015c00), %o2 40009d10: 90 10 00 16 mov %l6, %o0 40009d14: 92 10 20 01 mov 1, %o1 40009d18: 10 80 00 37 b 40009df4 <_Heap_Walk+0x180> 40009d1c: 94 12 a0 80 or %o2, 0x80, %o2 return false; } if ( !_Addresses_Is_aligned( (void *) page_size ) ) { 40009d20: 22 80 00 08 be,a 40009d40 <_Heap_Walk+0xcc> 40009d24: 90 10 00 1b mov %i3, %o0 (*printer)( 40009d28: 15 10 00 57 sethi %hi(0x40015c00), %o2 40009d2c: 90 10 00 16 mov %l6, %o0 40009d30: 92 10 20 01 mov 1, %o1 40009d34: 94 12 a0 98 or %o2, 0x98, %o2 40009d38: 10 80 01 12 b 4000a180 <_Heap_Walk+0x50c> 40009d3c: 96 10 00 1c mov %i4, %o3 RTEMS_INLINE_ROUTINE bool _Heap_Is_aligned( uintptr_t value, uintptr_t alignment ) { return (value % alignment) == 0; 40009d40: 7f ff df 91 call 40001b84 <.urem> 40009d44: 92 10 00 1c mov %i4, %o1 ); return false; } if ( !_Heap_Is_aligned( min_block_size, page_size ) ) { 40009d48: 80 a2 20 00 cmp %o0, 0 40009d4c: 22 80 00 08 be,a 40009d6c <_Heap_Walk+0xf8> 40009d50: 90 06 60 08 add %i1, 8, %o0 (*printer)( 40009d54: 15 10 00 57 sethi %hi(0x40015c00), %o2 40009d58: 90 10 00 16 mov %l6, %o0 40009d5c: 92 10 20 01 mov 1, %o1 40009d60: 94 12 a0 b8 or %o2, 0xb8, %o2 40009d64: 10 80 01 07 b 4000a180 <_Heap_Walk+0x50c> 40009d68: 96 10 00 1b mov %i3, %o3 40009d6c: 7f ff df 86 call 40001b84 <.urem> 40009d70: 92 10 00 1c mov %i4, %o1 ); return false; } if ( 40009d74: 80 a2 20 00 cmp %o0, 0 40009d78: 22 80 00 07 be,a 40009d94 <_Heap_Walk+0x120> 40009d7c: c4 06 60 04 ld [ %i1 + 4 ], %g2 !_Heap_Is_aligned( _Heap_Alloc_area_of_block( first_block ), page_size ) ) { (*printer)( 40009d80: 15 10 00 57 sethi %hi(0x40015c00), %o2 40009d84: 90 10 00 16 mov %l6, %o0 40009d88: 92 10 20 01 mov 1, %o1 40009d8c: 10 80 00 fc b 4000a17c <_Heap_Walk+0x508> 40009d90: 94 12 a0 e0 or %o2, 0xe0, %o2 ); return false; } if ( !_Heap_Is_prev_used( first_block ) ) { 40009d94: 80 88 a0 01 btst 1, %g2 40009d98: 32 80 00 07 bne,a 40009db4 <_Heap_Walk+0x140> 40009d9c: f4 04 20 04 ld [ %l0 + 4 ], %i2 (*printer)( 40009da0: 15 10 00 57 sethi %hi(0x40015c00), %o2 40009da4: 90 10 00 16 mov %l6, %o0 40009da8: 92 10 20 01 mov 1, %o1 40009dac: 10 80 00 12 b 40009df4 <_Heap_Walk+0x180> 40009db0: 94 12 a1 18 or %o2, 0x118, %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; 40009db4: 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); 40009db8: 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; 40009dbc: c4 06 a0 04 ld [ %i2 + 4 ], %g2 ); return false; } if ( _Heap_Is_free( last_block ) ) { 40009dc0: 80 88 a0 01 btst 1, %g2 40009dc4: 12 80 00 07 bne 40009de0 <_Heap_Walk+0x16c> 40009dc8: 80 a6 80 19 cmp %i2, %i1 (*printer)( 40009dcc: 15 10 00 57 sethi %hi(0x40015c00), %o2 40009dd0: 90 10 00 16 mov %l6, %o0 40009dd4: 92 10 20 01 mov 1, %o1 40009dd8: 10 80 00 07 b 40009df4 <_Heap_Walk+0x180> 40009ddc: 94 12 a1 48 or %o2, 0x148, %o2 ); return false; } if ( 40009de0: 02 80 00 0a be 40009e08 <_Heap_Walk+0x194> 40009de4: 15 10 00 57 sethi %hi(0x40015c00), %o2 _Heap_Block_at( last_block, _Heap_Block_size( last_block ) ) != first_block ) { (*printer)( 40009de8: 90 10 00 16 mov %l6, %o0 40009dec: 92 10 20 01 mov 1, %o1 40009df0: 94 12 a1 60 or %o2, 0x160, %o2 40009df4: 9f c7 40 00 call %i5 40009df8: b0 10 20 00 clr %i0 40009dfc: b0 0e 20 ff and %i0, 0xff, %i0 40009e00: 81 c7 e0 08 ret 40009e04: 81 e8 00 00 restore int source, Heap_Walk_printer printer, Heap_Control *heap ) { uintptr_t const page_size = heap->page_size; 40009e08: 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; 40009e0c: d6 06 20 08 ld [ %i0 + 8 ], %o3 const Heap_Block *const free_list_tail = _Heap_Free_list_tail( heap ); 40009e10: 10 80 00 30 b 40009ed0 <_Heap_Walk+0x25c> 40009e14: 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; 40009e18: 80 a0 c0 0b cmp %g3, %o3 40009e1c: 18 80 00 05 bgu 40009e30 <_Heap_Walk+0x1bc> 40009e20: 84 10 20 00 clr %g2 40009e24: c4 06 20 24 ld [ %i0 + 0x24 ], %g2 40009e28: 80 a0 80 0b cmp %g2, %o3 40009e2c: 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 ) ) { 40009e30: 80 a0 a0 00 cmp %g2, 0 40009e34: 32 80 00 07 bne,a 40009e50 <_Heap_Walk+0x1dc> 40009e38: 90 02 e0 08 add %o3, 8, %o0 (*printer)( 40009e3c: 15 10 00 57 sethi %hi(0x40015c00), %o2 40009e40: 90 10 00 16 mov %l6, %o0 40009e44: 92 10 20 01 mov 1, %o1 40009e48: 10 80 00 ce b 4000a180 <_Heap_Walk+0x50c> 40009e4c: 94 12 a1 90 or %o2, 0x190, %o2 RTEMS_INLINE_ROUTINE bool _Heap_Is_aligned( uintptr_t value, uintptr_t alignment ) { return (value % alignment) == 0; 40009e50: d6 27 bf fc st %o3, [ %fp + -4 ] 40009e54: 7f ff df 4c call 40001b84 <.urem> 40009e58: 92 10 00 11 mov %l1, %o1 ); return false; } if ( 40009e5c: 80 a2 20 00 cmp %o0, 0 40009e60: 02 80 00 07 be 40009e7c <_Heap_Walk+0x208> 40009e64: d6 07 bf fc ld [ %fp + -4 ], %o3 !_Heap_Is_aligned( _Heap_Alloc_area_of_block( free_block ), page_size ) ) { (*printer)( 40009e68: 15 10 00 57 sethi %hi(0x40015c00), %o2 40009e6c: 90 10 00 16 mov %l6, %o0 40009e70: 92 10 20 01 mov 1, %o1 40009e74: 10 80 00 c3 b 4000a180 <_Heap_Walk+0x50c> 40009e78: 94 12 a1 b0 or %o2, 0x1b0, %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; 40009e7c: c4 02 e0 04 ld [ %o3 + 4 ], %g2 40009e80: 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; 40009e84: 84 02 c0 02 add %o3, %g2, %g2 40009e88: c4 00 a0 04 ld [ %g2 + 4 ], %g2 ); return false; } if ( _Heap_Is_used( free_block ) ) { 40009e8c: 80 88 a0 01 btst 1, %g2 40009e90: 22 80 00 07 be,a 40009eac <_Heap_Walk+0x238> 40009e94: d8 02 e0 0c ld [ %o3 + 0xc ], %o4 (*printer)( 40009e98: 15 10 00 57 sethi %hi(0x40015c00), %o2 40009e9c: 90 10 00 16 mov %l6, %o0 40009ea0: 92 10 20 01 mov 1, %o1 40009ea4: 10 80 00 b7 b 4000a180 <_Heap_Walk+0x50c> 40009ea8: 94 12 a1 e0 or %o2, 0x1e0, %o2 ); return false; } if ( free_block->prev != prev_block ) { 40009eac: 80 a3 00 19 cmp %o4, %i1 40009eb0: 02 80 00 07 be 40009ecc <_Heap_Walk+0x258> 40009eb4: b2 10 00 0b mov %o3, %i1 (*printer)( 40009eb8: 15 10 00 57 sethi %hi(0x40015c00), %o2 40009ebc: 90 10 00 16 mov %l6, %o0 40009ec0: 92 10 20 01 mov 1, %o1 40009ec4: 10 80 00 4d b 40009ff8 <_Heap_Walk+0x384> 40009ec8: 94 12 a2 00 or %o2, 0x200, %o2 return false; } prev_block = free_block; free_block = free_block->next; 40009ecc: 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 ) { 40009ed0: 80 a2 c0 18 cmp %o3, %i0 40009ed4: 32 bf ff d1 bne,a 40009e18 <_Heap_Walk+0x1a4> 40009ed8: 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)( 40009edc: 2b 10 00 57 sethi %hi(0x40015c00), %l5 const Heap_Block *const free_list_tail = _Heap_Free_list_tail( heap ); const Heap_Block *const first_free_block = _Heap_Free_list_first( heap ); const Heap_Block *prev_block = free_list_tail; const Heap_Block *free_block = first_free_block; while ( free_block != free_list_tail ) { 40009ee0: 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)( 40009ee4: aa 15 63 00 or %l5, 0x300, %l5 " (= first free)" : (block->prev == free_list_head ? " (= head)" : ""), block->next, block->next == last_free_block ? " (= last free)" : (block->next == free_list_tail ? " (= tail)" : "") 40009ee8: 23 10 00 57 sethi %hi(0x40015c00), %l1 40009eec: 2f 10 00 56 sethi %hi(0x40015800), %l7 - HEAP_BLOCK_HEADER_SIZE); } RTEMS_INLINE_ROUTINE uintptr_t _Heap_Block_size( const Heap_Block *block ) { return block->size_and_flag & ~HEAP_PREV_BLOCK_USED; 40009ef0: 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; 40009ef4: 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; 40009ef8: 9e 1e 40 10 xor %i1, %l0, %o7 40009efc: 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; 40009f00: a8 0c bf fe and %l2, -2, %l4 40009f04: 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); 40009f08: 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; 40009f0c: 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; 40009f10: 80 a3 00 13 cmp %o4, %l3 40009f14: 18 80 00 05 bgu 40009f28 <_Heap_Walk+0x2b4> <== NEVER TAKEN 40009f18: 9e 10 20 00 clr %o7 40009f1c: de 06 20 24 ld [ %i0 + 0x24 ], %o7 40009f20: 80 a3 c0 13 cmp %o7, %l3 40009f24: 9e 60 3f ff subx %g0, -1, %o7 if ( !_Heap_Is_block_in_heap( heap, next_block ) ) { 40009f28: 80 a3 e0 00 cmp %o7, 0 40009f2c: 32 80 00 07 bne,a 40009f48 <_Heap_Walk+0x2d4> 40009f30: da 27 bf f8 st %o5, [ %fp + -8 ] (*printer)( 40009f34: 15 10 00 57 sethi %hi(0x40015c00), %o2 40009f38: 90 10 00 16 mov %l6, %o0 40009f3c: 92 10 20 01 mov 1, %o1 40009f40: 10 80 00 2c b 40009ff0 <_Heap_Walk+0x37c> 40009f44: 94 12 a2 38 or %o2, 0x238, %o2 RTEMS_INLINE_ROUTINE bool _Heap_Is_aligned( uintptr_t value, uintptr_t alignment ) { return (value % alignment) == 0; 40009f48: 90 10 00 14 mov %l4, %o0 40009f4c: 7f ff df 0e call 40001b84 <.urem> 40009f50: 92 10 00 1c mov %i4, %o1 40009f54: da 07 bf f8 ld [ %fp + -8 ], %o5 ); return false; } if ( !_Heap_Is_aligned( block_size, page_size ) && is_not_last_block ) { 40009f58: 80 a2 20 00 cmp %o0, 0 40009f5c: 02 80 00 0c be 40009f8c <_Heap_Walk+0x318> 40009f60: 9e 0b 60 ff and %o5, 0xff, %o7 40009f64: 80 a3 e0 00 cmp %o7, 0 40009f68: 02 80 00 19 be 40009fcc <_Heap_Walk+0x358> 40009f6c: 80 a6 40 13 cmp %i1, %l3 (*printer)( 40009f70: 15 10 00 57 sethi %hi(0x40015c00), %o2 40009f74: 90 10 00 16 mov %l6, %o0 40009f78: 92 10 20 01 mov 1, %o1 40009f7c: 94 12 a2 68 or %o2, 0x268, %o2 40009f80: 96 10 00 19 mov %i1, %o3 40009f84: 10 80 00 1d b 40009ff8 <_Heap_Walk+0x384> 40009f88: 98 10 00 14 mov %l4, %o4 ); return false; } if ( block_size < min_block_size && is_not_last_block ) { 40009f8c: 80 a3 e0 00 cmp %o7, 0 40009f90: 02 80 00 0f be 40009fcc <_Heap_Walk+0x358> 40009f94: 80 a6 40 13 cmp %i1, %l3 40009f98: 80 a5 00 1b cmp %l4, %i3 40009f9c: 1a 80 00 0c bcc 40009fcc <_Heap_Walk+0x358> 40009fa0: 80 a6 40 13 cmp %i1, %l3 (*printer)( 40009fa4: 90 10 00 16 mov %l6, %o0 40009fa8: 92 10 20 01 mov 1, %o1 40009fac: 15 10 00 57 sethi %hi(0x40015c00), %o2 40009fb0: 96 10 00 19 mov %i1, %o3 40009fb4: 94 12 a2 98 or %o2, 0x298, %o2 40009fb8: 98 10 00 14 mov %l4, %o4 40009fbc: 9f c7 40 00 call %i5 40009fc0: 9a 10 00 1b mov %i3, %o5 "block 0x%08x: next block 0x%08x is not a successor\n", block, next_block ); return false; 40009fc4: 10 80 00 68 b 4000a164 <_Heap_Walk+0x4f0> 40009fc8: b0 10 20 00 clr %i0 ); return false; } if ( next_block_begin <= block_begin && is_not_last_block ) { 40009fcc: 2a 80 00 10 bcs,a 4000a00c <_Heap_Walk+0x398> 40009fd0: de 04 e0 04 ld [ %l3 + 4 ], %o7 40009fd4: 80 8b 60 ff btst 0xff, %o5 40009fd8: 22 80 00 0d be,a 4000a00c <_Heap_Walk+0x398> 40009fdc: de 04 e0 04 ld [ %l3 + 4 ], %o7 (*printer)( 40009fe0: 15 10 00 57 sethi %hi(0x40015c00), %o2 40009fe4: 90 10 00 16 mov %l6, %o0 40009fe8: 92 10 20 01 mov 1, %o1 40009fec: 94 12 a2 c8 or %o2, 0x2c8, %o2 40009ff0: 96 10 00 19 mov %i1, %o3 40009ff4: 98 10 00 13 mov %l3, %o4 40009ff8: 9f c7 40 00 call %i5 40009ffc: b0 10 20 00 clr %i0 4000a000: b0 0e 20 ff and %i0, 0xff, %i0 4000a004: 81 c7 e0 08 ret 4000a008: 81 e8 00 00 restore ); return false; } if ( !_Heap_Is_prev_used( next_block ) ) { 4000a00c: 80 8b e0 01 btst 1, %o7 4000a010: 12 80 00 3f bne 4000a10c <_Heap_Walk+0x498> 4000a014: 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 ? 4000a018: 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)( 4000a01c: d8 06 20 08 ld [ %i0 + 8 ], %o4 4000a020: 80 a3 40 0c cmp %o5, %o4 4000a024: 02 80 00 08 be 4000a044 <_Heap_Walk+0x3d0> 4000a028: 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)" : ""), 4000a02c: 80 a3 40 18 cmp %o5, %i0 4000a030: 12 80 00 07 bne 4000a04c <_Heap_Walk+0x3d8> 4000a034: 96 14 63 70 or %l1, 0x370, %o3 4000a038: 17 10 00 56 sethi %hi(0x40015800), %o3 4000a03c: 10 80 00 04 b 4000a04c <_Heap_Walk+0x3d8> 4000a040: 96 12 e3 b8 or %o3, 0x3b8, %o3 ! 40015bb8 <__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)( 4000a044: 03 10 00 56 sethi %hi(0x40015800), %g1 4000a048: 96 10 63 a8 or %g1, 0x3a8, %o3 ! 40015ba8 <__log2table+0x120> block->prev, block->prev == first_free_block ? " (= first free)" : (block->prev == free_list_head ? " (= head)" : ""), block->next, block->next == last_free_block ? 4000a04c: 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)( 4000a050: 80 a3 00 0f cmp %o4, %o7 4000a054: 02 80 00 06 be 4000a06c <_Heap_Walk+0x3f8> 4000a058: 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)" : "") 4000a05c: 12 80 00 06 bne 4000a074 <_Heap_Walk+0x400> 4000a060: 9e 14 63 70 or %l1, 0x370, %o7 4000a064: 10 80 00 04 b 4000a074 <_Heap_Walk+0x400> 4000a068: 9e 15 e3 d8 or %l7, 0x3d8, %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)( 4000a06c: 03 10 00 56 sethi %hi(0x40015800), %g1 4000a070: 9e 10 63 c8 or %g1, 0x3c8, %o7 ! 40015bc8 <__log2table+0x140> 4000a074: d6 23 a0 5c st %o3, [ %sp + 0x5c ] 4000a078: d8 23 a0 60 st %o4, [ %sp + 0x60 ] 4000a07c: de 23 a0 64 st %o7, [ %sp + 0x64 ] 4000a080: 90 10 00 16 mov %l6, %o0 4000a084: 92 10 20 00 clr %o1 4000a088: 94 10 00 15 mov %l5, %o2 4000a08c: 96 10 00 19 mov %i1, %o3 4000a090: 9f c7 40 00 call %i5 4000a094: 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 ) { 4000a098: da 04 c0 00 ld [ %l3 ], %o5 4000a09c: 80 a5 00 0d cmp %l4, %o5 4000a0a0: 02 80 00 0c be 4000a0d0 <_Heap_Walk+0x45c> 4000a0a4: 80 a4 a0 00 cmp %l2, 0 (*printer)( 4000a0a8: e6 23 a0 5c st %l3, [ %sp + 0x5c ] 4000a0ac: 90 10 00 16 mov %l6, %o0 4000a0b0: 92 10 20 01 mov 1, %o1 4000a0b4: 15 10 00 57 sethi %hi(0x40015c00), %o2 4000a0b8: 96 10 00 19 mov %i1, %o3 4000a0bc: 94 12 a3 38 or %o2, 0x338, %o2 4000a0c0: 9f c7 40 00 call %i5 4000a0c4: 98 10 00 14 mov %l4, %o4 "block 0x%08x: next block 0x%08x is not a successor\n", block, next_block ); return false; 4000a0c8: 10 bf ff ce b 4000a000 <_Heap_Walk+0x38c> 4000a0cc: b0 10 20 00 clr %i0 ); return false; } if ( !prev_used ) { 4000a0d0: 32 80 00 0a bne,a 4000a0f8 <_Heap_Walk+0x484> 4000a0d4: c6 06 20 08 ld [ %i0 + 8 ], %g3 (*printer)( 4000a0d8: 15 10 00 57 sethi %hi(0x40015c00), %o2 4000a0dc: 90 10 00 16 mov %l6, %o0 4000a0e0: 92 10 20 01 mov 1, %o1 4000a0e4: 10 80 00 26 b 4000a17c <_Heap_Walk+0x508> 4000a0e8: 94 12 a3 78 or %o2, 0x378, %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 ) { 4000a0ec: 22 80 00 19 be,a 4000a150 <_Heap_Walk+0x4dc> 4000a0f0: b2 10 00 13 mov %l3, %i1 return true; } free_block = free_block->next; 4000a0f4: 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 ) { 4000a0f8: 80 a0 c0 18 cmp %g3, %i0 4000a0fc: 12 bf ff fc bne 4000a0ec <_Heap_Walk+0x478> 4000a100: 80 a0 c0 19 cmp %g3, %i1 return false; } if ( !_Heap_Walk_is_in_free_list( heap, block ) ) { (*printer)( 4000a104: 10 80 00 1b b 4000a170 <_Heap_Walk+0x4fc> 4000a108: 15 10 00 57 sethi %hi(0x40015c00), %o2 if ( !_Heap_Is_prev_used( next_block ) ) { if ( !_Heap_Walk_check_free_block( source, printer, heap, block ) ) { return false; } } else if (prev_used) { 4000a10c: 80 a4 a0 00 cmp %l2, 0 4000a110: 02 80 00 09 be 4000a134 <_Heap_Walk+0x4c0> 4000a114: 92 10 20 00 clr %o1 (*printer)( 4000a118: 15 10 00 57 sethi %hi(0x40015c00), %o2 4000a11c: 96 10 00 19 mov %i1, %o3 4000a120: 94 12 a3 a8 or %o2, 0x3a8, %o2 4000a124: 9f c7 40 00 call %i5 4000a128: 98 10 00 14 mov %l4, %o4 4000a12c: 10 80 00 09 b 4000a150 <_Heap_Walk+0x4dc> 4000a130: b2 10 00 13 mov %l3, %i1 "block 0x%08x: size %u\n", block, block_size ); } else { (*printer)( 4000a134: da 06 40 00 ld [ %i1 ], %o5 4000a138: 15 10 00 57 sethi %hi(0x40015c00), %o2 4000a13c: 96 10 00 19 mov %i1, %o3 4000a140: 94 12 a3 c0 or %o2, 0x3c0, %o2 4000a144: 9f c7 40 00 call %i5 4000a148: 98 10 00 14 mov %l4, %o4 4000a14c: b2 10 00 13 mov %l3, %i1 block->prev_size ); } block = next_block; } while ( block != first_block ); 4000a150: 80 a4 c0 1a cmp %l3, %i2 4000a154: 32 bf ff 68 bne,a 40009ef4 <_Heap_Walk+0x280> 4000a158: e4 06 60 04 ld [ %i1 + 4 ], %l2 4000a15c: 10 80 00 02 b 4000a164 <_Heap_Walk+0x4f0> 4000a160: b0 10 20 01 mov 1, %i0 4000a164: b0 0e 20 ff and %i0, 0xff, %i0 4000a168: 81 c7 e0 08 ret 4000a16c: 81 e8 00 00 restore return false; } if ( !_Heap_Walk_is_in_free_list( heap, block ) ) { (*printer)( 4000a170: 90 10 00 16 mov %l6, %o0 4000a174: 92 10 20 01 mov 1, %o1 4000a178: 94 12 a3 e8 or %o2, 0x3e8, %o2 4000a17c: 96 10 00 19 mov %i1, %o3 4000a180: 9f c7 40 00 call %i5 4000a184: b0 10 20 00 clr %i0 4000a188: b0 0e 20 ff and %i0, 0xff, %i0 4000a18c: 81 c7 e0 08 ret 4000a190: 81 e8 00 00 restore =============================================================================== 400093b0 <_Internal_error_Occurred>: void _Internal_error_Occurred( Internal_errors_Source the_source, bool is_internal, Internal_errors_t the_error ) { 400093b0: 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 ); 400093b4: 13 10 00 2c sethi %hi(0x4000b000), %o1 400093b8: 90 07 bf f4 add %fp, -12, %o0 400093bc: 92 12 62 d4 or %o1, 0x2d4, %o1 Internal_errors_Source source, bool is_internal, Internal_errors_t error ) { User_extensions_Fatal_context ctx = { source, is_internal, error }; 400093c0: f0 27 bf f4 st %i0, [ %fp + -12 ] 400093c4: f2 2f bf f8 stb %i1, [ %fp + -8 ] _User_extensions_Iterate( &ctx, _User_extensions_Fatal_visitor ); 400093c8: 40 00 07 ce call 4000b300 <_User_extensions_Iterate> 400093cc: 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; 400093d0: 05 10 00 78 sethi %hi(0x4001e000), %g2 <== NOT EXECUTED 400093d4: 82 10 a1 20 or %g2, 0x120, %g1 ! 4001e120 <_Internal_errors_What_happened><== NOT EXECUTED 400093d8: f0 20 a1 20 st %i0, [ %g2 + 0x120 ] <== NOT EXECUTED _Internal_errors_What_happened.is_internal = is_internal; 400093dc: f2 28 60 04 stb %i1, [ %g1 + 4 ] <== NOT EXECUTED _Internal_errors_What_happened.the_error = the_error; 400093e0: 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; 400093e4: 84 10 20 05 mov 5, %g2 <== NOT EXECUTED 400093e8: 03 10 00 78 sethi %hi(0x4001e000), %g1 <== NOT EXECUTED _System_state_Set( SYSTEM_STATE_FAILED ); _CPU_Fatal_halt( the_error ); 400093ec: 7f ff e4 17 call 40002448 <== NOT EXECUTED 400093f0: c4 20 61 2c st %g2, [ %g1 + 0x12c ] ! 4001e12c <_System_state_Current><== NOT EXECUTED 400093f4: 82 10 00 08 mov %o0, %g1 <== NOT EXECUTED 400093f8: 30 80 00 00 b,a 400093f8 <_Internal_error_Occurred+0x48> <== NOT EXECUTED =============================================================================== 40009464 <_Objects_Allocate>: #endif Objects_Control *_Objects_Allocate( Objects_Information *information ) { 40009464: 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 ) 40009468: c2 06 20 18 ld [ %i0 + 0x18 ], %g1 4000946c: 80 a0 60 00 cmp %g1, 0 40009470: 12 80 00 04 bne 40009480 <_Objects_Allocate+0x1c> <== ALWAYS TAKEN 40009474: ba 10 00 18 mov %i0, %i5 return NULL; 40009478: 81 c7 e0 08 ret 4000947c: 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 ); 40009480: b8 06 20 20 add %i0, 0x20, %i4 40009484: 7f ff fd 85 call 40008a98 <_Chain_Get> 40009488: 90 10 00 1c mov %i4, %o0 if ( information->auto_extend ) { 4000948c: c2 0f 60 12 ldub [ %i5 + 0x12 ], %g1 40009490: 80 a0 60 00 cmp %g1, 0 40009494: 02 80 00 1d be 40009508 <_Objects_Allocate+0xa4> 40009498: 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 ) { 4000949c: 80 a2 20 00 cmp %o0, 0 400094a0: 32 80 00 0a bne,a 400094c8 <_Objects_Allocate+0x64> 400094a4: c4 07 60 08 ld [ %i5 + 8 ], %g2 _Objects_Extend_information( information ); 400094a8: 40 00 00 21 call 4000952c <_Objects_Extend_information> 400094ac: 90 10 00 1d mov %i5, %o0 the_object = (Objects_Control *) _Chain_Get( &information->Inactive ); 400094b0: 7f ff fd 7a call 40008a98 <_Chain_Get> 400094b4: 90 10 00 1c mov %i4, %o0 } if ( the_object ) { 400094b8: b0 92 20 00 orcc %o0, 0, %i0 400094bc: 02 bf ff ef be 40009478 <_Objects_Allocate+0x14> 400094c0: 01 00 00 00 nop uint32_t block; block = (uint32_t) _Objects_Get_index( the_object->id ) - 400094c4: c4 07 60 08 ld [ %i5 + 8 ], %g2 400094c8: d0 06 20 08 ld [ %i0 + 8 ], %o0 _Objects_Get_index( information->minimum_id ); block /= information->allocation_size; 400094cc: d2 17 60 14 lduh [ %i5 + 0x14 ], %o1 } if ( the_object ) { uint32_t block; block = (uint32_t) _Objects_Get_index( the_object->id ) - 400094d0: 03 00 00 3f sethi %hi(0xfc00), %g1 400094d4: 82 10 63 ff or %g1, 0x3ff, %g1 ! ffff 400094d8: 90 0a 00 01 and %o0, %g1, %o0 400094dc: 82 08 80 01 and %g2, %g1, %g1 _Objects_Get_index( information->minimum_id ); block /= information->allocation_size; 400094e0: 40 00 3a 88 call 40017f00 <.udiv> 400094e4: 90 22 00 01 sub %o0, %g1, %o0 information->inactive_per_block[ block ]--; 400094e8: c2 07 60 30 ld [ %i5 + 0x30 ], %g1 400094ec: 91 2a 20 02 sll %o0, 2, %o0 400094f0: c4 00 40 08 ld [ %g1 + %o0 ], %g2 400094f4: 84 00 bf ff add %g2, -1, %g2 400094f8: c4 20 40 08 st %g2, [ %g1 + %o0 ] information->inactive--; 400094fc: c2 17 60 2c lduh [ %i5 + 0x2c ], %g1 40009500: 82 00 7f ff add %g1, -1, %g1 40009504: c2 37 60 2c sth %g1, [ %i5 + 0x2c ] ); } #endif return the_object; } 40009508: 81 c7 e0 08 ret 4000950c: 81 e8 00 00 restore =============================================================================== 40009894 <_Objects_Get_information>: Objects_Information *_Objects_Get_information( Objects_APIs the_api, uint16_t the_class ) { 40009894: 9d e3 bf a0 save %sp, -96, %sp Objects_Information *info; int the_class_api_maximum; if ( !the_class ) 40009898: 80 a6 60 00 cmp %i1, 0 4000989c: 12 80 00 04 bne 400098ac <_Objects_Get_information+0x18> 400098a0: 01 00 00 00 nop return NULL; 400098a4: 81 c7 e0 08 ret 400098a8: 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 ); 400098ac: 40 00 0f 57 call 4000d608 <_Objects_API_maximum_class> 400098b0: 90 10 00 18 mov %i0, %o0 if ( the_class_api_maximum == 0 ) 400098b4: 80 a2 20 00 cmp %o0, 0 400098b8: 02 bf ff fb be 400098a4 <_Objects_Get_information+0x10> 400098bc: 80 a6 40 08 cmp %i1, %o0 return NULL; if ( the_class > (uint32_t) the_class_api_maximum ) 400098c0: 18 bf ff f9 bgu 400098a4 <_Objects_Get_information+0x10> 400098c4: 03 10 00 77 sethi %hi(0x4001dc00), %g1 return NULL; if ( !_Objects_Information_table[ the_api ] ) 400098c8: b1 2e 20 02 sll %i0, 2, %i0 400098cc: 82 10 62 94 or %g1, 0x294, %g1 400098d0: c2 00 40 18 ld [ %g1 + %i0 ], %g1 400098d4: 80 a0 60 00 cmp %g1, 0 400098d8: 02 bf ff f3 be 400098a4 <_Objects_Get_information+0x10> <== NEVER TAKEN 400098dc: b3 2e 60 02 sll %i1, 2, %i1 return NULL; info = _Objects_Information_table[ the_api ][ the_class ]; 400098e0: f0 00 40 19 ld [ %g1 + %i1 ], %i0 if ( !info ) 400098e4: 80 a6 20 00 cmp %i0, 0 400098e8: 02 bf ff ef be 400098a4 <_Objects_Get_information+0x10> <== NEVER TAKEN 400098ec: 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 ) 400098f0: c2 16 20 10 lduh [ %i0 + 0x10 ], %g1 400098f4: 80 a0 60 00 cmp %g1, 0 400098f8: 02 bf ff eb be 400098a4 <_Objects_Get_information+0x10> 400098fc: 01 00 00 00 nop return NULL; #endif return info; } 40009900: 81 c7 e0 08 ret 40009904: 81 e8 00 00 restore =============================================================================== 4001bbdc <_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; 4001bbdc: c2 02 20 08 ld [ %o0 + 8 ], %g1 4001bbe0: 92 22 40 01 sub %o1, %g1, %o1 if ( information->maximum >= index ) { 4001bbe4: 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; 4001bbe8: 92 02 60 01 inc %o1 if ( information->maximum >= index ) { 4001bbec: 80 a0 40 09 cmp %g1, %o1 4001bbf0: 0a 80 00 09 bcs 4001bc14 <_Objects_Get_no_protection+0x38> 4001bbf4: 93 2a 60 02 sll %o1, 2, %o1 if ( (the_object = information->local_table[ index ]) != NULL ) { 4001bbf8: c2 02 20 1c ld [ %o0 + 0x1c ], %g1 4001bbfc: d0 00 40 09 ld [ %g1 + %o1 ], %o0 4001bc00: 80 a2 20 00 cmp %o0, 0 4001bc04: 02 80 00 05 be 4001bc18 <_Objects_Get_no_protection+0x3c> <== NEVER TAKEN 4001bc08: 82 10 20 01 mov 1, %g1 *location = OBJECTS_LOCAL; return the_object; 4001bc0c: 81 c3 e0 08 retl 4001bc10: 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; 4001bc14: 82 10 20 01 mov 1, %g1 return NULL; 4001bc18: 90 10 20 00 clr %o0 } 4001bc1c: 81 c3 e0 08 retl 4001bc20: c2 22 80 00 st %g1, [ %o2 ] =============================================================================== 4000d9b8 <_Objects_Id_to_name>: Objects_Name_or_id_lookup_errors _Objects_Id_to_name ( Objects_Id id, Objects_Name *name ) { 4000d9b8: 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; 4000d9bc: 80 a6 20 00 cmp %i0, 0 4000d9c0: 12 80 00 06 bne 4000d9d8 <_Objects_Id_to_name+0x20> 4000d9c4: 83 36 20 18 srl %i0, 0x18, %g1 4000d9c8: 03 10 00 b9 sethi %hi(0x4002e400), %g1 4000d9cc: c2 00 60 60 ld [ %g1 + 0x60 ], %g1 ! 4002e460 <_Per_CPU_Information+0x10> 4000d9d0: f0 00 60 08 ld [ %g1 + 8 ], %i0 4000d9d4: 83 36 20 18 srl %i0, 0x18, %g1 4000d9d8: 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 ) 4000d9dc: 84 00 7f ff add %g1, -1, %g2 4000d9e0: 80 a0 a0 02 cmp %g2, 2 4000d9e4: 08 80 00 14 bleu 4000da34 <_Objects_Id_to_name+0x7c> 4000d9e8: 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; 4000d9ec: 81 c7 e0 08 ret 4000d9f0: 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 ]; 4000d9f4: 85 28 a0 02 sll %g2, 2, %g2 4000d9f8: d0 00 40 02 ld [ %g1 + %g2 ], %o0 if ( !information ) 4000d9fc: 80 a2 20 00 cmp %o0, 0 4000da00: 02 bf ff fb be 4000d9ec <_Objects_Id_to_name+0x34> <== NEVER TAKEN 4000da04: 92 10 00 18 mov %i0, %o1 #if defined(RTEMS_SCORE_OBJECT_ENABLE_STRING_NAMES) if ( information->is_string ) return OBJECTS_INVALID_ID; #endif the_object = _Objects_Get( information, tmpId, &ignored_location ); 4000da08: 7f ff ff cf call 4000d944 <_Objects_Get> 4000da0c: 94 07 bf fc add %fp, -4, %o2 if ( !the_object ) 4000da10: 80 a2 20 00 cmp %o0, 0 4000da14: 02 bf ff f6 be 4000d9ec <_Objects_Id_to_name+0x34> 4000da18: 01 00 00 00 nop return OBJECTS_INVALID_ID; *name = the_object->name; 4000da1c: c2 02 20 0c ld [ %o0 + 0xc ], %g1 _Thread_Enable_dispatch(); return OBJECTS_NAME_OR_ID_LOOKUP_SUCCESSFUL; 4000da20: 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(); 4000da24: 40 00 03 8e call 4000e85c <_Thread_Enable_dispatch> 4000da28: c2 26 40 00 st %g1, [ %i1 ] 4000da2c: 81 c7 e0 08 ret 4000da30: 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 ] ) 4000da34: 05 10 00 b8 sethi %hi(0x4002e000), %g2 4000da38: 84 10 a1 74 or %g2, 0x174, %g2 ! 4002e174 <_Objects_Information_table> 4000da3c: c2 00 80 01 ld [ %g2 + %g1 ], %g1 4000da40: 80 a0 60 00 cmp %g1, 0 4000da44: 12 bf ff ec bne 4000d9f4 <_Objects_Id_to_name+0x3c> 4000da48: 85 36 20 1b srl %i0, 0x1b, %g2 4000da4c: 30 bf ff e8 b,a 4000d9ec <_Objects_Id_to_name+0x34> =============================================================================== 4000a6bc <_RBTree_Extract_unprotected>: */ void _RBTree_Extract_unprotected( RBTree_Control *the_rbtree, RBTree_Node *the_node ) { 4000a6bc: 9d e3 bf a0 save %sp, -96, %sp RBTree_Node *leaf, *target; RBTree_Color victim_color; RBTree_Direction dir; if (!the_node) return; 4000a6c0: 80 a6 60 00 cmp %i1, 0 4000a6c4: 02 80 00 69 be 4000a868 <_RBTree_Extract_unprotected+0x1ac> 4000a6c8: 01 00 00 00 nop /* check if min needs to be updated */ if (the_node == the_rbtree->first[RBT_LEFT]) { 4000a6cc: c2 06 20 08 ld [ %i0 + 8 ], %g1 4000a6d0: 80 a6 40 01 cmp %i1, %g1 4000a6d4: 32 80 00 07 bne,a 4000a6f0 <_RBTree_Extract_unprotected+0x34> 4000a6d8: 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 ); 4000a6dc: 90 10 00 19 mov %i1, %o0 4000a6e0: 40 00 01 31 call 4000aba4 <_RBTree_Next_unprotected> 4000a6e4: 92 10 20 01 mov 1, %o1 RBTree_Node *next; next = _RBTree_Successor_unprotected(the_node); the_rbtree->first[RBT_LEFT] = next; 4000a6e8: 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]) { 4000a6ec: c2 06 20 0c ld [ %i0 + 0xc ], %g1 4000a6f0: 80 a6 40 01 cmp %i1, %g1 4000a6f4: 32 80 00 07 bne,a 4000a710 <_RBTree_Extract_unprotected+0x54> 4000a6f8: 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 ); 4000a6fc: 90 10 00 19 mov %i1, %o0 4000a700: 40 00 01 29 call 4000aba4 <_RBTree_Next_unprotected> 4000a704: 92 10 20 00 clr %o1 RBTree_Node *previous; previous = _RBTree_Predecessor_unprotected(the_node); the_rbtree->first[RBT_RIGHT] = previous; 4000a708: 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]) { 4000a70c: fa 06 60 04 ld [ %i1 + 4 ], %i5 4000a710: 80 a7 60 00 cmp %i5, 0 4000a714: 02 80 00 36 be 4000a7ec <_RBTree_Extract_unprotected+0x130> 4000a718: f8 06 60 08 ld [ %i1 + 8 ], %i4 4000a71c: 80 a7 20 00 cmp %i4, 0 4000a720: 32 80 00 05 bne,a 4000a734 <_RBTree_Extract_unprotected+0x78> 4000a724: c2 07 60 08 ld [ %i5 + 8 ], %g1 4000a728: 10 80 00 35 b 4000a7fc <_RBTree_Extract_unprotected+0x140> 4000a72c: 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]; 4000a730: c2 07 60 08 ld [ %i5 + 8 ], %g1 4000a734: 80 a0 60 00 cmp %g1, 0 4000a738: 32 bf ff fe bne,a 4000a730 <_RBTree_Extract_unprotected+0x74> 4000a73c: 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]; 4000a740: f8 07 60 04 ld [ %i5 + 4 ], %i4 if(leaf) { 4000a744: 80 a7 20 00 cmp %i4, 0 4000a748: 02 80 00 05 be 4000a75c <_RBTree_Extract_unprotected+0xa0> 4000a74c: 01 00 00 00 nop leaf->parent = target->parent; 4000a750: c2 07 40 00 ld [ %i5 ], %g1 4000a754: 10 80 00 04 b 4000a764 <_RBTree_Extract_unprotected+0xa8> 4000a758: c2 27 00 00 st %g1, [ %i4 ] } else { /* fix the tree here if the child is a null leaf. */ _RBTree_Extract_validate_unprotected(target); 4000a75c: 7f ff ff 73 call 4000a528 <_RBTree_Extract_validate_unprotected> 4000a760: 90 10 00 1d mov %i5, %o0 } victim_color = target->color; dir = target != target->parent->child[0]; 4000a764: 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; 4000a768: c2 07 60 0c ld [ %i5 + 0xc ], %g1 dir = target != target->parent->child[0]; 4000a76c: c6 00 a0 04 ld [ %g2 + 4 ], %g3 4000a770: 86 1f 40 03 xor %i5, %g3, %g3 4000a774: 80 a0 00 03 cmp %g0, %g3 4000a778: 86 40 20 00 addx %g0, 0, %g3 target->parent->child[dir] = leaf; 4000a77c: 87 28 e0 02 sll %g3, 2, %g3 4000a780: 84 00 80 03 add %g2, %g3, %g2 4000a784: f8 20 a0 04 st %i4, [ %g2 + 4 ] /* now replace the_node with target */ dir = the_node != the_node->parent->child[0]; 4000a788: c4 06 40 00 ld [ %i1 ], %g2 4000a78c: c6 00 a0 04 ld [ %g2 + 4 ], %g3 4000a790: 86 1e 40 03 xor %i1, %g3, %g3 4000a794: 80 a0 00 03 cmp %g0, %g3 4000a798: 86 40 20 00 addx %g0, 0, %g3 the_node->parent->child[dir] = target; 4000a79c: 87 28 e0 02 sll %g3, 2, %g3 4000a7a0: 84 00 80 03 add %g2, %g3, %g2 4000a7a4: 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]; 4000a7a8: c4 06 60 08 ld [ %i1 + 8 ], %g2 4000a7ac: c4 27 60 08 st %g2, [ %i5 + 8 ] if (the_node->child[RBT_RIGHT]) 4000a7b0: c4 06 60 08 ld [ %i1 + 8 ], %g2 4000a7b4: 80 a0 a0 00 cmp %g2, 0 4000a7b8: 32 80 00 02 bne,a 4000a7c0 <_RBTree_Extract_unprotected+0x104><== ALWAYS TAKEN 4000a7bc: fa 20 80 00 st %i5, [ %g2 ] the_node->child[RBT_RIGHT]->parent = target; target->child[RBT_LEFT] = the_node->child[RBT_LEFT]; 4000a7c0: c4 06 60 04 ld [ %i1 + 4 ], %g2 4000a7c4: c4 27 60 04 st %g2, [ %i5 + 4 ] if (the_node->child[RBT_LEFT]) 4000a7c8: c4 06 60 04 ld [ %i1 + 4 ], %g2 4000a7cc: 80 a0 a0 00 cmp %g2, 0 4000a7d0: 32 80 00 02 bne,a 4000a7d8 <_RBTree_Extract_unprotected+0x11c> 4000a7d4: 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; 4000a7d8: c4 06 40 00 ld [ %i1 ], %g2 4000a7dc: c4 27 40 00 st %g2, [ %i5 ] target->color = the_node->color; 4000a7e0: c4 06 60 0c ld [ %i1 + 0xc ], %g2 4000a7e4: 10 80 00 14 b 4000a834 <_RBTree_Extract_unprotected+0x178> 4000a7e8: 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 ) { 4000a7ec: 80 a7 20 00 cmp %i4, 0 4000a7f0: 32 80 00 04 bne,a 4000a800 <_RBTree_Extract_unprotected+0x144> 4000a7f4: c2 06 40 00 ld [ %i1 ], %g1 4000a7f8: 30 80 00 04 b,a 4000a808 <_RBTree_Extract_unprotected+0x14c> leaf->parent = the_node->parent; 4000a7fc: c2 06 40 00 ld [ %i1 ], %g1 4000a800: 10 80 00 04 b 4000a810 <_RBTree_Extract_unprotected+0x154> 4000a804: 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); 4000a808: 7f ff ff 48 call 4000a528 <_RBTree_Extract_validate_unprotected> 4000a80c: 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]; 4000a810: 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; 4000a814: c2 06 60 0c ld [ %i1 + 0xc ], %g1 /* remove the_node from the tree */ dir = the_node != the_node->parent->child[0]; 4000a818: c6 00 a0 04 ld [ %g2 + 4 ], %g3 4000a81c: 86 1e 40 03 xor %i1, %g3, %g3 4000a820: 80 a0 00 03 cmp %g0, %g3 4000a824: 86 40 20 00 addx %g0, 0, %g3 the_node->parent->child[dir] = leaf; 4000a828: 87 28 e0 02 sll %g3, 2, %g3 4000a82c: 84 00 80 03 add %g2, %g3, %g2 4000a830: 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 */ 4000a834: 80 a0 60 00 cmp %g1, 0 4000a838: 32 80 00 06 bne,a 4000a850 <_RBTree_Extract_unprotected+0x194> 4000a83c: c2 06 20 04 ld [ %i0 + 4 ], %g1 if (leaf) { 4000a840: 80 a7 20 00 cmp %i4, 0 4000a844: 32 80 00 02 bne,a 4000a84c <_RBTree_Extract_unprotected+0x190> 4000a848: 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; 4000a84c: 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; 4000a850: c0 26 60 08 clr [ %i1 + 8 ] 4000a854: c0 26 60 04 clr [ %i1 + 4 ] 4000a858: 80 a0 60 00 cmp %g1, 0 4000a85c: 02 80 00 03 be 4000a868 <_RBTree_Extract_unprotected+0x1ac> 4000a860: c0 26 40 00 clr [ %i1 ] 4000a864: c0 20 60 0c clr [ %g1 + 0xc ] 4000a868: 81 c7 e0 08 ret 4000a86c: 81 e8 00 00 restore =============================================================================== 4000bb3c <_RBTree_Initialize>: void *starting_address, size_t number_nodes, size_t node_size, bool is_unique ) { 4000bb3c: 9d e3 bf a0 save %sp, -96, %sp size_t count; RBTree_Node *next; /* TODO: Error message? */ if (!the_rbtree) return; 4000bb40: 80 a6 20 00 cmp %i0, 0 4000bb44: 02 80 00 10 be 4000bb84 <_RBTree_Initialize+0x48> <== NEVER TAKEN 4000bb48: 01 00 00 00 nop RBTree_Control *the_rbtree, RBTree_Compare_function compare_function, bool is_unique ) { the_rbtree->permanent_null = NULL; 4000bb4c: c0 26 00 00 clr [ %i0 ] the_rbtree->root = NULL; 4000bb50: c0 26 20 04 clr [ %i0 + 4 ] the_rbtree->first[0] = NULL; 4000bb54: c0 26 20 08 clr [ %i0 + 8 ] the_rbtree->first[1] = NULL; 4000bb58: c0 26 20 0c clr [ %i0 + 0xc ] the_rbtree->compare_function = compare_function; 4000bb5c: 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-- ) { 4000bb60: 10 80 00 06 b 4000bb78 <_RBTree_Initialize+0x3c> 4000bb64: fa 2e 20 14 stb %i5, [ %i0 + 0x14 ] _RBTree_Insert_unprotected(the_rbtree, next); 4000bb68: 90 10 00 18 mov %i0, %o0 4000bb6c: 7f ff ff 2e call 4000b824 <_RBTree_Insert_unprotected> 4000bb70: b4 06 80 1c add %i2, %i4, %i2 4000bb74: 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-- ) { 4000bb78: 80 a6 e0 00 cmp %i3, 0 4000bb7c: 12 bf ff fb bne 4000bb68 <_RBTree_Initialize+0x2c> 4000bb80: 92 10 00 1a mov %i2, %o1 4000bb84: 81 c7 e0 08 ret 4000bb88: 81 e8 00 00 restore =============================================================================== 4000a910 <_RBTree_Insert_unprotected>: */ RBTree_Node *_RBTree_Insert_unprotected( RBTree_Control *the_rbtree, RBTree_Node *the_node ) { 4000a910: 9d e3 bf a0 save %sp, -96, %sp if(!the_node) return (RBTree_Node*)-1; 4000a914: 80 a6 60 00 cmp %i1, 0 4000a918: 02 80 00 7c be 4000ab08 <_RBTree_Insert_unprotected+0x1f8> 4000a91c: ba 10 00 18 mov %i0, %i5 RBTree_Node *iter_node = the_rbtree->root; 4000a920: f0 06 20 04 ld [ %i0 + 4 ], %i0 int compare_result; if (!iter_node) { /* special case: first node inserted */ 4000a924: b6 96 20 00 orcc %i0, 0, %i3 4000a928: 32 80 00 0c bne,a 4000a958 <_RBTree_Insert_unprotected+0x48> 4000a92c: c2 07 60 10 ld [ %i5 + 0x10 ], %g1 the_node->color = RBT_BLACK; 4000a930: c0 26 60 0c clr [ %i1 + 0xc ] the_rbtree->root = the_node; 4000a934: f2 27 60 04 st %i1, [ %i5 + 4 ] the_rbtree->first[0] = the_rbtree->first[1] = the_node; 4000a938: f2 27 60 0c st %i1, [ %i5 + 0xc ] 4000a93c: f2 27 60 08 st %i1, [ %i5 + 8 ] the_node->parent = (RBTree_Node *) the_rbtree; 4000a940: fa 26 40 00 st %i5, [ %i1 ] the_node->child[RBT_LEFT] = the_node->child[RBT_RIGHT] = NULL; 4000a944: c0 26 60 08 clr [ %i1 + 8 ] 4000a948: c0 26 60 04 clr [ %i1 + 4 ] 4000a94c: 81 c7 e0 08 ret 4000a950: 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); 4000a954: c2 07 60 10 ld [ %i5 + 0x10 ], %g1 4000a958: 90 10 00 19 mov %i1, %o0 4000a95c: 9f c0 40 00 call %g1 4000a960: 92 10 00 18 mov %i0, %o1 if ( the_rbtree->is_unique && _RBTree_Is_equal( compare_result ) ) 4000a964: c2 0f 60 14 ldub [ %i5 + 0x14 ], %g1 4000a968: 80 a0 60 00 cmp %g1, 0 4000a96c: 02 80 00 05 be 4000a980 <_RBTree_Insert_unprotected+0x70> 4000a970: b8 38 00 08 xnor %g0, %o0, %i4 4000a974: 80 a2 20 00 cmp %o0, 0 4000a978: 02 80 00 65 be 4000ab0c <_RBTree_Insert_unprotected+0x1fc> 4000a97c: 01 00 00 00 nop return iter_node; RBTree_Direction dir = !_RBTree_Is_lesser( compare_result ); 4000a980: b9 37 20 1f srl %i4, 0x1f, %i4 if (!iter_node->child[dir]) { 4000a984: 83 2f 20 02 sll %i4, 2, %g1 4000a988: 82 06 00 01 add %i0, %g1, %g1 4000a98c: f0 00 60 04 ld [ %g1 + 4 ], %i0 4000a990: 80 a6 20 00 cmp %i0, 0 4000a994: 32 bf ff f0 bne,a 4000a954 <_RBTree_Insert_unprotected+0x44> 4000a998: b6 10 00 18 mov %i0, %i3 the_node->child[RBT_LEFT] = the_node->child[RBT_RIGHT] = NULL; 4000a99c: c0 26 60 08 clr [ %i1 + 8 ] 4000a9a0: c0 26 60 04 clr [ %i1 + 4 ] the_node->color = RBT_RED; 4000a9a4: 84 10 20 01 mov 1, %g2 iter_node->child[dir] = the_node; 4000a9a8: 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; 4000a9ac: c4 26 60 0c st %g2, [ %i1 + 0xc ] iter_node->child[dir] = the_node; the_node->parent = iter_node; 4000a9b0: f6 26 40 00 st %i3, [ %i1 ] /* update min/max */ compare_result = the_rbtree->compare_function( 4000a9b4: 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]; 4000a9b8: b6 07 20 02 add %i4, 2, %i3 4000a9bc: 85 2e e0 02 sll %i3, 2, %g2 4000a9c0: d2 07 40 02 ld [ %i5 + %g2 ], %o1 4000a9c4: 9f c0 40 00 call %g1 4000a9c8: 90 10 00 19 mov %i1, %o0 the_node, _RBTree_First(the_rbtree, dir) ); if ( (!dir && _RBTree_Is_lesser(compare_result)) || 4000a9cc: 80 a7 20 00 cmp %i4, 0 4000a9d0: 12 80 00 06 bne 4000a9e8 <_RBTree_Insert_unprotected+0xd8> 4000a9d4: 80 a2 20 00 cmp %o0, 0 4000a9d8: 36 80 00 3c bge,a 4000aac8 <_RBTree_Insert_unprotected+0x1b8> 4000a9dc: d0 06 40 00 ld [ %i1 ], %o0 (dir && _RBTree_Is_greater(compare_result)) ) { the_rbtree->first[dir] = the_node; 4000a9e0: 10 80 00 04 b 4000a9f0 <_RBTree_Insert_unprotected+0xe0> 4000a9e4: 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)) ) { 4000a9e8: 04 80 00 37 ble 4000aac4 <_RBTree_Insert_unprotected+0x1b4> 4000a9ec: b7 2e e0 02 sll %i3, 2, %i3 the_rbtree->first[dir] = the_node; 4000a9f0: 10 80 00 35 b 4000aac4 <_RBTree_Insert_unprotected+0x1b4> 4000a9f4: 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; 4000a9f8: 02 80 00 13 be 4000aa44 <_RBTree_Insert_unprotected+0x134><== NEVER TAKEN 4000a9fc: 82 10 20 00 clr %g1 if(!(the_node->parent->parent->parent)) return NULL; 4000aa00: c2 07 40 00 ld [ %i5 ], %g1 4000aa04: 80 a0 60 00 cmp %g1, 0 4000aa08: 02 80 00 0f be 4000aa44 <_RBTree_Insert_unprotected+0x134><== NEVER TAKEN 4000aa0c: 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]) 4000aa10: c2 07 60 04 ld [ %i5 + 4 ], %g1 4000aa14: 80 a2 00 01 cmp %o0, %g1 4000aa18: 22 80 00 02 be,a 4000aa20 <_RBTree_Insert_unprotected+0x110> 4000aa1c: 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); 4000aa20: 80 a0 60 00 cmp %g1, 0 4000aa24: 02 80 00 09 be 4000aa48 <_RBTree_Insert_unprotected+0x138> 4000aa28: 84 10 20 00 clr %g2 4000aa2c: c4 00 60 0c ld [ %g1 + 0xc ], %g2 4000aa30: 80 a0 a0 01 cmp %g2, 1 4000aa34: 32 80 00 05 bne,a 4000aa48 <_RBTree_Insert_unprotected+0x138> 4000aa38: 84 10 20 00 clr %g2 4000aa3c: 10 80 00 03 b 4000aa48 <_RBTree_Insert_unprotected+0x138> 4000aa40: 84 10 20 01 mov 1, %g2 4000aa44: 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)) { 4000aa48: 80 a0 a0 00 cmp %g2, 0 4000aa4c: 22 80 00 08 be,a 4000aa6c <_RBTree_Insert_unprotected+0x15c> 4000aa50: c2 07 60 04 ld [ %i5 + 4 ], %g1 the_node->parent->color = RBT_BLACK; 4000aa54: c0 22 20 0c clr [ %o0 + 0xc ] u->color = RBT_BLACK; 4000aa58: c0 20 60 0c clr [ %g1 + 0xc ] g->color = RBT_RED; 4000aa5c: b2 10 00 1d mov %i5, %i1 4000aa60: 82 10 20 01 mov 1, %g1 4000aa64: 10 80 00 18 b 4000aac4 <_RBTree_Insert_unprotected+0x1b4> 4000aa68: 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]; 4000aa6c: 82 1a 00 01 xor %o0, %g1, %g1 4000aa70: 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]; 4000aa74: c2 02 20 04 ld [ %o0 + 4 ], %g1 RBTree_Direction pdir = the_node->parent != g->child[0]; 4000aa78: 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]; 4000aa7c: 82 1e 40 01 xor %i1, %g1, %g1 4000aa80: 80 a0 00 01 cmp %g0, %g1 4000aa84: 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) { 4000aa88: 80 a0 40 1c cmp %g1, %i4 4000aa8c: 22 80 00 08 be,a 4000aaac <_RBTree_Insert_unprotected+0x19c> 4000aa90: c2 06 40 00 ld [ %i1 ], %g1 _RBTree_Rotate(the_node->parent, pdir); 4000aa94: 7f ff ff 80 call 4000a894 <_RBTree_Rotate> 4000aa98: 92 10 00 1c mov %i4, %o1 the_node = the_node->child[pdir]; 4000aa9c: 83 2f 20 02 sll %i4, 2, %g1 4000aaa0: b2 06 40 01 add %i1, %g1, %i1 4000aaa4: f2 06 60 04 ld [ %i1 + 4 ], %i1 } the_node->parent->color = RBT_BLACK; 4000aaa8: c2 06 40 00 ld [ %i1 ], %g1 g->color = RBT_RED; 4000aaac: 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; 4000aab0: c0 20 60 0c clr [ %g1 + 0xc ] g->color = RBT_RED; 4000aab4: d2 27 60 0c st %o1, [ %i5 + 0xc ] /* now rotate grandparent in the other branch direction (toward uncle) */ _RBTree_Rotate(g, (1-pdir)); 4000aab8: 90 10 00 1d mov %i5, %o0 4000aabc: 7f ff ff 76 call 4000a894 <_RBTree_Rotate> 4000aac0: 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; 4000aac4: d0 06 40 00 ld [ %i1 ], %o0 4000aac8: fa 02 00 00 ld [ %o0 ], %i5 4000aacc: 80 a7 60 00 cmp %i5, 0 4000aad0: 22 80 00 06 be,a 4000aae8 <_RBTree_Insert_unprotected+0x1d8> 4000aad4: 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); 4000aad8: c2 02 20 0c ld [ %o0 + 0xc ], %g1 4000aadc: 82 18 60 01 xor %g1, 1, %g1 4000aae0: 80 a0 00 01 cmp %g0, %g1 4000aae4: 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))) { 4000aae8: 80 a0 60 00 cmp %g1, 0 4000aaec: 12 bf ff c3 bne 4000a9f8 <_RBTree_Insert_unprotected+0xe8> 4000aaf0: 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; 4000aaf4: 12 80 00 06 bne 4000ab0c <_RBTree_Insert_unprotected+0x1fc> 4000aaf8: 01 00 00 00 nop 4000aafc: c0 26 60 0c clr [ %i1 + 0xc ] 4000ab00: 81 c7 e0 08 ret 4000ab04: 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; 4000ab08: b0 10 3f ff mov -1, %i0 /* verify red-black properties */ _RBTree_Validate_insert_unprotected(the_node); } return (RBTree_Node*)0; } 4000ab0c: 81 c7 e0 08 ret 4000ab10: 81 e8 00 00 restore =============================================================================== 4000ab44 <_RBTree_Iterate_unprotected>: const RBTree_Control *rbtree, RBTree_Direction dir, RBTree_Visitor visitor, void *visitor_arg ) { 4000ab44: 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; 4000ab48: b8 10 20 00 clr %i4 */ RTEMS_INLINE_ROUTINE RBTree_Direction _RBTree_Opposite_direction( RBTree_Direction the_dir ) { return (RBTree_Direction) !((int) the_dir); 4000ab4c: 80 a0 00 19 cmp %g0, %i1 4000ab50: 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]; 4000ab54: 82 00 60 02 add %g1, 2, %g1 4000ab58: 83 28 60 02 sll %g1, 2, %g1 while ( !stop && current != NULL ) { 4000ab5c: 10 80 00 0a b 4000ab84 <_RBTree_Iterate_unprotected+0x40> 4000ab60: fa 06 00 01 ld [ %i0 + %g1 ], %i5 stop = (*visitor)( current, dir, visitor_arg ); 4000ab64: 92 10 00 19 mov %i1, %o1 4000ab68: 9f c6 80 00 call %i2 4000ab6c: 94 10 00 1b mov %i3, %o2 current = _RBTree_Next_unprotected( current, dir ); 4000ab70: 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 ); 4000ab74: b8 10 00 08 mov %o0, %i4 current = _RBTree_Next_unprotected( current, dir ); 4000ab78: 40 00 00 0b call 4000aba4 <_RBTree_Next_unprotected> 4000ab7c: 90 10 00 1d mov %i5, %o0 4000ab80: 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 ) { 4000ab84: 80 a7 60 00 cmp %i5, 0 4000ab88: 02 80 00 05 be 4000ab9c <_RBTree_Iterate_unprotected+0x58> 4000ab8c: b8 1f 20 01 xor %i4, 1, %i4 4000ab90: 80 8f 20 ff btst 0xff, %i4 4000ab94: 12 bf ff f4 bne 4000ab64 <_RBTree_Iterate_unprotected+0x20><== ALWAYS TAKEN 4000ab98: 90 10 00 1d mov %i5, %o0 4000ab9c: 81 c7 e0 08 ret 4000aba0: 81 e8 00 00 restore =============================================================================== 4000a4ac <_RBTree_Rotate>: RBTree_Node *the_node, RBTree_Direction dir ) { RBTree_Node *c; if (the_node == NULL) return; 4000a4ac: 80 a2 20 00 cmp %o0, 0 4000a4b0: 02 80 00 1c be 4000a520 <_RBTree_Rotate+0x74> <== NEVER TAKEN 4000a4b4: 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); 4000a4b8: 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; 4000a4bc: 87 28 e0 02 sll %g3, 2, %g3 4000a4c0: 86 02 00 03 add %o0, %g3, %g3 4000a4c4: c2 00 e0 04 ld [ %g3 + 4 ], %g1 4000a4c8: 80 a0 60 00 cmp %g1, 0 4000a4cc: 02 80 00 15 be 4000a520 <_RBTree_Rotate+0x74> <== NEVER TAKEN 4000a4d0: 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]; 4000a4d4: 84 00 40 09 add %g1, %o1, %g2 4000a4d8: c8 00 a0 04 ld [ %g2 + 4 ], %g4 4000a4dc: c8 20 e0 04 st %g4, [ %g3 + 4 ] if (c->child[dir]) 4000a4e0: c4 00 a0 04 ld [ %g2 + 4 ], %g2 4000a4e4: 80 a0 a0 00 cmp %g2, 0 4000a4e8: 32 80 00 02 bne,a 4000a4f0 <_RBTree_Rotate+0x44> 4000a4ec: 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; 4000a4f0: 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; 4000a4f4: 92 00 40 09 add %g1, %o1, %o1 4000a4f8: d0 22 60 04 st %o0, [ %o1 + 4 ] the_node->parent->child[the_node != the_node->parent->child[0]] = c; 4000a4fc: c6 00 a0 04 ld [ %g2 + 4 ], %g3 c->parent = the_node->parent; 4000a500: 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; 4000a504: 86 1a 00 03 xor %o0, %g3, %g3 c->parent = the_node->parent; the_node->parent = c; 4000a508: 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; 4000a50c: 80 a0 00 03 cmp %g0, %g3 4000a510: 86 40 20 00 addx %g0, 0, %g3 4000a514: 87 28 e0 02 sll %g3, 2, %g3 4000a518: 86 00 80 03 add %g2, %g3, %g3 4000a51c: c2 20 e0 04 st %g1, [ %g3 + 4 ] 4000a520: 81 c3 e0 08 retl =============================================================================== 4000a45c <_RBTree_Sibling>: */ RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_Sibling( const RBTree_Node *the_node ) { if(!the_node) return NULL; 4000a45c: 80 a2 20 00 cmp %o0, 0 4000a460: 02 80 00 10 be 4000a4a0 <_RBTree_Sibling+0x44> <== NEVER TAKEN 4000a464: 82 10 20 00 clr %g1 if(!(the_node->parent)) return NULL; 4000a468: c4 02 00 00 ld [ %o0 ], %g2 4000a46c: 80 a0 a0 00 cmp %g2, 0 4000a470: 22 80 00 0d be,a 4000a4a4 <_RBTree_Sibling+0x48> <== NEVER TAKEN 4000a474: 90 10 00 01 mov %g1, %o0 <== NOT EXECUTED if(!(the_node->parent->parent)) return NULL; 4000a478: c2 00 80 00 ld [ %g2 ], %g1 4000a47c: 80 a0 60 00 cmp %g1, 0 4000a480: 02 80 00 08 be 4000a4a0 <_RBTree_Sibling+0x44> 4000a484: 82 10 20 00 clr %g1 if(the_node == the_node->parent->child[RBT_LEFT]) 4000a488: c2 00 a0 04 ld [ %g2 + 4 ], %g1 4000a48c: 80 a2 00 01 cmp %o0, %g1 4000a490: 22 80 00 04 be,a 4000a4a0 <_RBTree_Sibling+0x44> 4000a494: c2 00 a0 08 ld [ %g2 + 8 ], %g1 return the_node->parent->child[RBT_RIGHT]; 4000a498: 81 c3 e0 08 retl 4000a49c: 90 10 00 01 mov %g1, %o0 else return the_node->parent->child[RBT_LEFT]; } 4000a4a0: 90 10 00 01 mov %g1, %o0 4000a4a4: 81 c3 e0 08 retl =============================================================================== 40009144 <_RTEMS_signal_Post_switch_hook>: #include #include #include static void _RTEMS_signal_Post_switch_hook( Thread_Control *executing ) { 40009144: 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 ]; 40009148: fa 06 21 4c ld [ %i0 + 0x14c ], %i5 if ( !api ) 4000914c: 80 a7 60 00 cmp %i5, 0 40009150: 02 80 00 1c be 400091c0 <_RTEMS_signal_Post_switch_hook+0x7c><== NEVER TAKEN 40009154: 01 00 00 00 nop * Signal Processing */ asr = &api->Signal; _ISR_Disable( level ); 40009158: 7f ff e8 9d call 400033cc 4000915c: 01 00 00 00 nop signal_set = asr->signals_posted; 40009160: f8 07 60 14 ld [ %i5 + 0x14 ], %i4 asr->signals_posted = 0; 40009164: c0 27 60 14 clr [ %i5 + 0x14 ] _ISR_Enable( level ); 40009168: 7f ff e8 9d call 400033dc 4000916c: 01 00 00 00 nop if ( !signal_set ) /* similar to _ASR_Are_signals_pending( asr ) */ 40009170: 80 a7 20 00 cmp %i4, 0 40009174: 02 80 00 13 be 400091c0 <_RTEMS_signal_Post_switch_hook+0x7c> 40009178: 94 07 bf fc add %fp, -4, %o2 return; asr->nest_level += 1; 4000917c: c2 07 60 1c ld [ %i5 + 0x1c ], %g1 rtems_task_mode( asr->mode_set, RTEMS_ALL_MODE_MASKS, &prev_mode ); 40009180: d0 07 60 10 ld [ %i5 + 0x10 ], %o0 if ( !signal_set ) /* similar to _ASR_Are_signals_pending( asr ) */ return; asr->nest_level += 1; 40009184: 82 00 60 01 inc %g1 40009188: c2 27 60 1c st %g1, [ %i5 + 0x1c ] rtems_task_mode( asr->mode_set, RTEMS_ALL_MODE_MASKS, &prev_mode ); 4000918c: 37 00 00 3f sethi %hi(0xfc00), %i3 40009190: 40 00 01 03 call 4000959c 40009194: 92 16 e3 ff or %i3, 0x3ff, %o1 ! ffff (*asr->handler)( signal_set ); 40009198: c2 07 60 0c ld [ %i5 + 0xc ], %g1 4000919c: 9f c0 40 00 call %g1 400091a0: 90 10 00 1c mov %i4, %o0 asr->nest_level -= 1; 400091a4: c2 07 60 1c ld [ %i5 + 0x1c ], %g1 rtems_task_mode( prev_mode, RTEMS_ALL_MODE_MASKS, &prev_mode ); 400091a8: 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; 400091ac: 82 00 7f ff add %g1, -1, %g1 rtems_task_mode( prev_mode, RTEMS_ALL_MODE_MASKS, &prev_mode ); 400091b0: 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; 400091b4: c2 27 60 1c st %g1, [ %i5 + 0x1c ] rtems_task_mode( prev_mode, RTEMS_ALL_MODE_MASKS, &prev_mode ); 400091b8: 40 00 00 f9 call 4000959c 400091bc: 94 07 bf fc add %fp, -4, %o2 400091c0: 81 c7 e0 08 ret 400091c4: 81 e8 00 00 restore =============================================================================== 4003293c <_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 ) { 4003293c: 9d e3 bf 98 save %sp, -104, %sp */ static inline void _TOD_Get_uptime( Timestamp_Control *time ) { _TOD_Get_with_nanoseconds( time, &_TOD.uptime ); 40032940: 13 10 01 8b sethi %hi(0x40062c00), %o1 #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ Timestamp_Control uptime; #endif Thread_Control *owning_thread = the_period->owner; 40032944: f6 06 20 40 ld [ %i0 + 0x40 ], %i3 40032948: 90 07 bf f8 add %fp, -8, %o0 4003294c: 7f ff 57 de call 400088c4 <_TOD_Get_with_nanoseconds> 40032950: 92 12 61 d0 or %o1, 0x1d0, %o1 /* * Determine elapsed wall time since period initiated. */ #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ _TOD_Get_uptime( &uptime ); _Timestamp_Subtract( 40032954: c4 1f bf f8 ldd [ %fp + -8 ], %g2 const Timestamp64_Control *_start, const Timestamp64_Control *_end, Timestamp64_Control *_result ) { *_result = *_end - *_start; 40032958: 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) { 4003295c: 09 10 01 8c sethi %hi(0x40063000), %g4 40032960: ba a0 c0 1d subcc %g3, %i5, %i5 40032964: 88 11 20 80 or %g4, 0x80, %g4 40032968: b8 60 80 1c subx %g2, %i4, %i4 4003296c: f8 3e 40 00 std %i4, [ %i1 ] 40032970: fa 01 20 10 ld [ %g4 + 0x10 ], %i5 #endif /* * Determine cpu usage since period initiated. */ used = owning_thread->cpu_time_used; 40032974: d8 1e e0 80 ldd [ %i3 + 0x80 ], %o4 #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ if (owning_thread == _Thread_Executing) { 40032978: 80 a6 c0 1d cmp %i3, %i5 4003297c: 12 80 00 15 bne 400329d0 <_Rate_monotonic_Get_status+0x94> 40032980: 82 10 20 01 mov 1, %g1 40032984: f8 19 20 20 ldd [ %g4 + 0x20 ], %i4 40032988: 86 a0 c0 1d subcc %g3, %i5, %g3 4003298c: 84 60 80 1c subx %g2, %i4, %g2 static inline void _Timestamp64_implementation_Add_to( Timestamp64_Control *_time, const Timestamp64_Control *_add ) { *_time += *_add; 40032990: ba 83 40 03 addcc %o5, %g3, %i5 40032994: b8 43 00 02 addx %o4, %g2, %i4 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 40032998: 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)) 4003299c: 80 a0 80 1c cmp %g2, %i4 400329a0: 34 80 00 0c bg,a 400329d0 <_Rate_monotonic_Get_status+0x94><== NEVER TAKEN 400329a4: 82 10 20 00 clr %g1 <== NOT EXECUTED 400329a8: 32 80 00 06 bne,a 400329c0 <_Rate_monotonic_Get_status+0x84> 400329ac: 86 a7 40 03 subcc %i5, %g3, %g3 400329b0: 80 a0 c0 1d cmp %g3, %i5 400329b4: 18 80 00 06 bgu 400329cc <_Rate_monotonic_Get_status+0x90> 400329b8: 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; 400329bc: 82 10 20 01 mov 1, %g1 const Timestamp64_Control *_start, const Timestamp64_Control *_end, Timestamp64_Control *_result ) { *_result = *_end - *_start; 400329c0: 84 67 00 02 subx %i4, %g2, %g2 400329c4: 10 80 00 03 b 400329d0 <_Rate_monotonic_Get_status+0x94> 400329c8: 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; 400329cc: 82 10 20 00 clr %g1 return false; *cpu_since_last_period = used - the_period->cpu_usage_period_initiated; #endif return true; } 400329d0: b0 08 60 01 and %g1, 1, %i0 400329d4: 81 c7 e0 08 ret 400329d8: 81 e8 00 00 restore =============================================================================== 40032d44 <_Rate_monotonic_Timeout>: void _Rate_monotonic_Timeout( Objects_Id id, void *ignored ) { 40032d44: 9d e3 bf 98 save %sp, -104, %sp 40032d48: 11 10 01 8c sethi %hi(0x40063000), %o0 40032d4c: 92 10 00 18 mov %i0, %o1 40032d50: 90 12 22 a8 or %o0, 0x2a8, %o0 40032d54: 7f ff 59 83 call 40009360 <_Objects_Get> 40032d58: 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 ) { 40032d5c: c2 07 bf fc ld [ %fp + -4 ], %g1 40032d60: 80 a0 60 00 cmp %g1, 0 40032d64: 12 80 00 24 bne 40032df4 <_Rate_monotonic_Timeout+0xb0> <== NEVER TAKEN 40032d68: ba 10 00 08 mov %o0, %i5 case OBJECTS_LOCAL: the_thread = the_period->owner; 40032d6c: d0 02 20 40 ld [ %o0 + 0x40 ], %o0 if ( _States_Is_waiting_for_period( the_thread->current_state ) && 40032d70: 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); 40032d74: c4 02 20 10 ld [ %o0 + 0x10 ], %g2 40032d78: 80 88 80 01 btst %g2, %g1 40032d7c: 22 80 00 0b be,a 40032da8 <_Rate_monotonic_Timeout+0x64> 40032d80: c2 07 60 38 ld [ %i5 + 0x38 ], %g1 40032d84: c4 02 20 20 ld [ %o0 + 0x20 ], %g2 40032d88: c2 07 60 08 ld [ %i5 + 8 ], %g1 40032d8c: 80 a0 80 01 cmp %g2, %g1 40032d90: 32 80 00 06 bne,a 40032da8 <_Rate_monotonic_Timeout+0x64> 40032d94: 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 ); 40032d98: 13 04 01 ff sethi %hi(0x1007fc00), %o1 40032d9c: 7f ff 5c 11 call 40009de0 <_Thread_Clear_state> 40032da0: 92 12 63 f8 or %o1, 0x3f8, %o1 ! 1007fff8 40032da4: 30 80 00 06 b,a 40032dbc <_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 ) { 40032da8: 80 a0 60 01 cmp %g1, 1 40032dac: 12 80 00 0d bne 40032de0 <_Rate_monotonic_Timeout+0x9c> 40032db0: 82 10 20 04 mov 4, %g1 the_period->state = RATE_MONOTONIC_EXPIRED_WHILE_BLOCKING; 40032db4: 82 10 20 03 mov 3, %g1 40032db8: c2 27 60 38 st %g1, [ %i5 + 0x38 ] _Rate_monotonic_Initiate_statistics( the_period ); 40032dbc: 7f ff ff 51 call 40032b00 <_Rate_monotonic_Initiate_statistics> 40032dc0: 90 10 00 1d mov %i5, %o0 Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 40032dc4: c2 07 60 3c ld [ %i5 + 0x3c ], %g1 _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 40032dc8: 11 10 01 8b sethi %hi(0x40062c00), %o0 Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 40032dcc: c2 27 60 1c st %g1, [ %i5 + 0x1c ] _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 40032dd0: 90 12 23 18 or %o0, 0x318, %o0 40032dd4: 7f ff 5f da call 4000ad3c <_Watchdog_Insert> 40032dd8: 92 07 60 10 add %i5, 0x10, %o1 40032ddc: 30 80 00 02 b,a 40032de4 <_Rate_monotonic_Timeout+0xa0> _Watchdog_Insert_ticks( &the_period->Timer, the_period->next_length ); } else the_period->state = RATE_MONOTONIC_EXPIRED; 40032de0: 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; 40032de4: 03 10 01 8b sethi %hi(0x40062c00), %g1 40032de8: c4 00 62 80 ld [ %g1 + 0x280 ], %g2 ! 40062e80 <_Thread_Dispatch_disable_level> --level; 40032dec: 84 00 bf ff add %g2, -1, %g2 _Thread_Dispatch_disable_level = level; 40032df0: c4 20 62 80 st %g2, [ %g1 + 0x280 ] 40032df4: 81 c7 e0 08 ret 40032df8: 81 e8 00 00 restore =============================================================================== 400329dc <_Rate_monotonic_Update_statistics>: } static void _Rate_monotonic_Update_statistics( Rate_monotonic_Control *the_period ) { 400329dc: 9d e3 bf 90 save %sp, -112, %sp /* * Update the counts. */ stats = &the_period->Statistics; stats->count++; 400329e0: c2 06 20 58 ld [ %i0 + 0x58 ], %g1 400329e4: 82 00 60 01 inc %g1 400329e8: c2 26 20 58 st %g1, [ %i0 + 0x58 ] if ( the_period->state == RATE_MONOTONIC_EXPIRED ) 400329ec: c2 06 20 38 ld [ %i0 + 0x38 ], %g1 400329f0: 80 a0 60 04 cmp %g1, 4 400329f4: 12 80 00 05 bne 40032a08 <_Rate_monotonic_Update_statistics+0x2c> 400329f8: 90 10 00 18 mov %i0, %o0 stats->missed_count++; 400329fc: c2 06 20 5c ld [ %i0 + 0x5c ], %g1 40032a00: 82 00 60 01 inc %g1 40032a04: c2 26 20 5c st %g1, [ %i0 + 0x5c ] /* * Grab status for time statistics. */ valid_status = 40032a08: 92 07 bf f8 add %fp, -8, %o1 40032a0c: 7f ff ff cc call 4003293c <_Rate_monotonic_Get_status> 40032a10: 94 07 bf f0 add %fp, -16, %o2 _Rate_monotonic_Get_status( the_period, &since_last_period, &executed ); if (!valid_status) 40032a14: 80 8a 20 ff btst 0xff, %o0 40032a18: 02 80 00 38 be 40032af8 <_Rate_monotonic_Update_statistics+0x11c> 40032a1c: c4 1f bf f0 ldd [ %fp + -16 ], %g2 static inline void _Timestamp64_implementation_Add_to( Timestamp64_Control *_time, const Timestamp64_Control *_add ) { *_time += *_add; 40032a20: 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 ) ) 40032a24: c2 06 20 60 ld [ %i0 + 0x60 ], %g1 40032a28: b6 87 40 03 addcc %i5, %g3, %i3 40032a2c: b4 47 00 02 addx %i4, %g2, %i2 40032a30: 80 a0 40 02 cmp %g1, %g2 40032a34: 14 80 00 09 bg 40032a58 <_Rate_monotonic_Update_statistics+0x7c> 40032a38: f4 3e 20 70 std %i2, [ %i0 + 0x70 ] 40032a3c: 80 a0 40 02 cmp %g1, %g2 40032a40: 32 80 00 08 bne,a 40032a60 <_Rate_monotonic_Update_statistics+0x84><== NEVER TAKEN 40032a44: c2 06 20 68 ld [ %i0 + 0x68 ], %g1 <== NOT EXECUTED 40032a48: c2 06 20 64 ld [ %i0 + 0x64 ], %g1 40032a4c: 80 a0 40 03 cmp %g1, %g3 40032a50: 28 80 00 04 bleu,a 40032a60 <_Rate_monotonic_Update_statistics+0x84> 40032a54: c2 06 20 68 ld [ %i0 + 0x68 ], %g1 stats->min_cpu_time = executed; 40032a58: c4 3e 20 60 std %g2, [ %i0 + 0x60 ] if ( _Timestamp_Greater_than( &executed, &stats->max_cpu_time ) ) 40032a5c: c2 06 20 68 ld [ %i0 + 0x68 ], %g1 40032a60: 80 a0 40 02 cmp %g1, %g2 40032a64: 26 80 00 0a bl,a 40032a8c <_Rate_monotonic_Update_statistics+0xb0><== NEVER TAKEN 40032a68: c4 3e 20 68 std %g2, [ %i0 + 0x68 ] <== NOT EXECUTED 40032a6c: 80 a0 40 02 cmp %g1, %g2 40032a70: 32 80 00 08 bne,a 40032a90 <_Rate_monotonic_Update_statistics+0xb4><== NEVER TAKEN 40032a74: c4 1f bf f8 ldd [ %fp + -8 ], %g2 <== NOT EXECUTED 40032a78: c2 06 20 6c ld [ %i0 + 0x6c ], %g1 40032a7c: 80 a0 40 03 cmp %g1, %g3 40032a80: 3a 80 00 04 bcc,a 40032a90 <_Rate_monotonic_Update_statistics+0xb4> 40032a84: c4 1f bf f8 ldd [ %fp + -8 ], %g2 stats->max_cpu_time = executed; 40032a88: 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 ); 40032a8c: c4 1f bf f8 ldd [ %fp + -8 ], %g2 40032a90: f8 1e 20 88 ldd [ %i0 + 0x88 ], %i4 if ( _Timestamp_Less_than( &since_last_period, &stats->min_wall_time ) ) 40032a94: c2 06 20 78 ld [ %i0 + 0x78 ], %g1 40032a98: b6 87 40 03 addcc %i5, %g3, %i3 40032a9c: b4 47 00 02 addx %i4, %g2, %i2 40032aa0: 80 a0 40 02 cmp %g1, %g2 40032aa4: 14 80 00 09 bg 40032ac8 <_Rate_monotonic_Update_statistics+0xec> 40032aa8: f4 3e 20 88 std %i2, [ %i0 + 0x88 ] 40032aac: 80 a0 40 02 cmp %g1, %g2 40032ab0: 32 80 00 08 bne,a 40032ad0 <_Rate_monotonic_Update_statistics+0xf4><== NEVER TAKEN 40032ab4: c2 06 20 80 ld [ %i0 + 0x80 ], %g1 <== NOT EXECUTED 40032ab8: c2 06 20 7c ld [ %i0 + 0x7c ], %g1 40032abc: 80 a0 40 03 cmp %g1, %g3 40032ac0: 28 80 00 04 bleu,a 40032ad0 <_Rate_monotonic_Update_statistics+0xf4> 40032ac4: c2 06 20 80 ld [ %i0 + 0x80 ], %g1 stats->min_wall_time = since_last_period; 40032ac8: c4 3e 20 78 std %g2, [ %i0 + 0x78 ] if ( _Timestamp_Greater_than( &since_last_period, &stats->max_wall_time ) ) 40032acc: c2 06 20 80 ld [ %i0 + 0x80 ], %g1 40032ad0: 80 a0 40 02 cmp %g1, %g2 40032ad4: 26 80 00 09 bl,a 40032af8 <_Rate_monotonic_Update_statistics+0x11c><== NEVER TAKEN 40032ad8: c4 3e 20 80 std %g2, [ %i0 + 0x80 ] <== NOT EXECUTED 40032adc: 80 a0 40 02 cmp %g1, %g2 40032ae0: 12 80 00 06 bne 40032af8 <_Rate_monotonic_Update_statistics+0x11c><== NEVER TAKEN 40032ae4: 01 00 00 00 nop 40032ae8: c2 06 20 84 ld [ %i0 + 0x84 ], %g1 40032aec: 80 a0 40 03 cmp %g1, %g3 40032af0: 2a 80 00 02 bcs,a 40032af8 <_Rate_monotonic_Update_statistics+0x11c> 40032af4: c4 3e 20 80 std %g2, [ %i0 + 0x80 ] 40032af8: 81 c7 e0 08 ret 40032afc: 81 e8 00 00 restore =============================================================================== 4000a80c <_Scheduler_CBS_Allocate>: #include void *_Scheduler_CBS_Allocate( Thread_Control *the_thread ) { 4000a80c: 9d e3 bf a0 save %sp, -96, %sp void *sched; Scheduler_CBS_Per_thread *schinfo; sched = _Workspace_Allocate(sizeof(Scheduler_CBS_Per_thread)); 4000a810: 40 00 06 7d call 4000c204 <_Workspace_Allocate> 4000a814: 90 10 20 1c mov 0x1c, %o0 if ( sched ) { 4000a818: 80 a2 20 00 cmp %o0, 0 4000a81c: 02 80 00 06 be 4000a834 <_Scheduler_CBS_Allocate+0x28> <== NEVER TAKEN 4000a820: 82 10 20 02 mov 2, %g1 the_thread->scheduler_info = sched; 4000a824: d0 26 20 88 st %o0, [ %i0 + 0x88 ] schinfo = (Scheduler_CBS_Per_thread *)(the_thread->scheduler_info); schinfo->edf_per_thread.thread = the_thread; 4000a828: f0 22 00 00 st %i0, [ %o0 ] schinfo->edf_per_thread.queue_state = SCHEDULER_EDF_QUEUE_STATE_NEVER_HAS_BEEN; 4000a82c: c2 22 20 14 st %g1, [ %o0 + 0x14 ] schinfo->cbs_server = NULL; 4000a830: c0 22 20 18 clr [ %o0 + 0x18 ] } return sched; } 4000a834: 81 c7 e0 08 ret 4000a838: 91 e8 00 08 restore %g0, %o0, %o0 =============================================================================== 4000bb4c <_Scheduler_CBS_Budget_callout>: Scheduler_CBS_Server **_Scheduler_CBS_Server_list; void _Scheduler_CBS_Budget_callout( Thread_Control *the_thread ) { 4000bb4c: 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; 4000bb50: d2 06 20 ac ld [ %i0 + 0xac ], %o1 if ( the_thread->real_priority != new_priority ) 4000bb54: c2 06 20 18 ld [ %i0 + 0x18 ], %g1 4000bb58: 80 a0 40 09 cmp %g1, %o1 4000bb5c: 32 80 00 02 bne,a 4000bb64 <_Scheduler_CBS_Budget_callout+0x18><== ALWAYS TAKEN 4000bb60: d2 26 20 18 st %o1, [ %i0 + 0x18 ] the_thread->real_priority = new_priority; if ( the_thread->current_priority != new_priority ) 4000bb64: c2 06 20 14 ld [ %i0 + 0x14 ], %g1 4000bb68: 80 a0 40 09 cmp %g1, %o1 4000bb6c: 02 80 00 04 be 4000bb7c <_Scheduler_CBS_Budget_callout+0x30><== NEVER TAKEN 4000bb70: 90 10 00 18 mov %i0, %o0 _Thread_Change_priority(the_thread, new_priority, true); 4000bb74: 40 00 01 81 call 4000c178 <_Thread_Change_priority> 4000bb78: 94 10 20 01 mov 1, %o2 /* Invoke callback function if any. */ sched_info = (Scheduler_CBS_Per_thread *) the_thread->scheduler_info; 4000bb7c: fa 06 20 88 ld [ %i0 + 0x88 ], %i5 if ( sched_info->cbs_server->cbs_budget_overrun ) { 4000bb80: c2 07 60 18 ld [ %i5 + 0x18 ], %g1 4000bb84: c4 00 60 0c ld [ %g1 + 0xc ], %g2 4000bb88: 80 a0 a0 00 cmp %g2, 0 4000bb8c: 02 80 00 09 be 4000bbb0 <_Scheduler_CBS_Budget_callout+0x64><== NEVER TAKEN 4000bb90: 01 00 00 00 nop _Scheduler_CBS_Get_server_id( 4000bb94: d0 00 40 00 ld [ %g1 ], %o0 4000bb98: 7f ff ff d7 call 4000baf4 <_Scheduler_CBS_Get_server_id> 4000bb9c: 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 ); 4000bba0: c2 07 60 18 ld [ %i5 + 0x18 ], %g1 4000bba4: c2 00 60 0c ld [ %g1 + 0xc ], %g1 4000bba8: 9f c0 40 00 call %g1 4000bbac: d0 07 bf fc ld [ %fp + -4 ], %o0 4000bbb0: 81 c7 e0 08 ret 4000bbb4: 81 e8 00 00 restore =============================================================================== 4000b754 <_Scheduler_CBS_Create_server>: int _Scheduler_CBS_Create_server ( Scheduler_CBS_Parameters *params, Scheduler_CBS_Budget_overrun budget_overrun_callback, rtems_id *server_id ) { 4000b754: 9d e3 bf a0 save %sp, -96, %sp unsigned int i; Scheduler_CBS_Server *the_server; if ( params->budget <= 0 || 4000b758: c2 06 20 04 ld [ %i0 + 4 ], %g1 4000b75c: 80 a0 60 00 cmp %g1, 0 4000b760: 04 80 00 1d ble 4000b7d4 <_Scheduler_CBS_Create_server+0x80> 4000b764: 01 00 00 00 nop 4000b768: c2 06 00 00 ld [ %i0 ], %g1 4000b76c: 80 a0 60 00 cmp %g1, 0 4000b770: 04 80 00 19 ble 4000b7d4 <_Scheduler_CBS_Create_server+0x80> 4000b774: 03 10 00 82 sethi %hi(0x40020800), %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++ ) { 4000b778: c4 00 61 30 ld [ %g1 + 0x130 ], %g2 ! 40020930 <_Scheduler_CBS_Maximum_servers> if ( !_Scheduler_CBS_Server_list[i] ) 4000b77c: 03 10 00 86 sethi %hi(0x40021800), %g1 4000b780: c6 00 60 98 ld [ %g1 + 0x98 ], %g3 ! 40021898 <_Scheduler_CBS_Server_list> 4000b784: 10 80 00 07 b 4000b7a0 <_Scheduler_CBS_Create_server+0x4c> 4000b788: 82 10 20 00 clr %g1 4000b78c: c8 00 c0 1c ld [ %g3 + %i4 ], %g4 4000b790: 80 a1 20 00 cmp %g4, 0 4000b794: 02 80 00 14 be 4000b7e4 <_Scheduler_CBS_Create_server+0x90> 4000b798: 3b 10 00 86 sethi %hi(0x40021800), %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++ ) { 4000b79c: 82 00 60 01 inc %g1 4000b7a0: 80 a0 40 02 cmp %g1, %g2 4000b7a4: 12 bf ff fa bne 4000b78c <_Scheduler_CBS_Create_server+0x38> 4000b7a8: 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; 4000b7ac: 81 c7 e0 08 ret 4000b7b0: 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; 4000b7b4: c4 20 60 04 st %g2, [ %g1 + 4 ] 4000b7b8: c4 06 20 04 ld [ %i0 + 4 ], %g2 the_server->task_id = -1; the_server->cbs_budget_overrun = budget_overrun_callback; 4000b7bc: 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; 4000b7c0: c4 20 60 08 st %g2, [ %g1 + 8 ] the_server->task_id = -1; 4000b7c4: 84 10 3f ff mov -1, %g2 4000b7c8: c4 20 40 00 st %g2, [ %g1 ] the_server->cbs_budget_overrun = budget_overrun_callback; return SCHEDULER_CBS_OK; 4000b7cc: 81 c7 e0 08 ret 4000b7d0: 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; 4000b7d4: 81 c7 e0 08 ret 4000b7d8: 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; 4000b7dc: 81 c7 e0 08 ret <== NOT EXECUTED 4000b7e0: 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 *) 4000b7e4: f6 07 60 98 ld [ %i5 + 0x98 ], %i3 } if ( i == _Scheduler_CBS_Maximum_servers ) return SCHEDULER_CBS_ERROR_FULL; *server_id = i; 4000b7e8: c2 26 80 00 st %g1, [ %i2 ] _Scheduler_CBS_Server_list[*server_id] = (Scheduler_CBS_Server *) _Workspace_Allocate( sizeof(Scheduler_CBS_Server) ); 4000b7ec: 40 00 07 6f call 4000d5a8 <_Workspace_Allocate> 4000b7f0: 90 10 20 10 mov 0x10, %o0 the_server = _Scheduler_CBS_Server_list[*server_id]; 4000b7f4: 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 *) 4000b7f8: d0 26 c0 1c st %o0, [ %i3 + %i4 ] _Workspace_Allocate( sizeof(Scheduler_CBS_Server) ); the_server = _Scheduler_CBS_Server_list[*server_id]; 4000b7fc: c4 07 60 98 ld [ %i5 + 0x98 ], %g2 4000b800: 83 28 60 02 sll %g1, 2, %g1 4000b804: c2 00 80 01 ld [ %g2 + %g1 ], %g1 if ( !the_server ) 4000b808: 80 a0 60 00 cmp %g1, 0 4000b80c: 32 bf ff ea bne,a 4000b7b4 <_Scheduler_CBS_Create_server+0x60><== ALWAYS TAKEN 4000b810: c4 06 00 00 ld [ %i0 ], %g2 4000b814: 30 bf ff f2 b,a 4000b7dc <_Scheduler_CBS_Create_server+0x88><== NOT EXECUTED =============================================================================== 4000b88c <_Scheduler_CBS_Detach_thread>: int _Scheduler_CBS_Detach_thread ( Scheduler_CBS_Server_id server_id, rtems_id task_id ) { 4000b88c: 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); 4000b890: 90 10 00 19 mov %i1, %o0 4000b894: 40 00 03 5f call 4000c610 <_Thread_Get> 4000b898: 92 07 bf fc add %fp, -4, %o1 /* The routine _Thread_Get may disable dispatch and not enable again. */ if ( the_thread ) { 4000b89c: ba 92 20 00 orcc %o0, 0, %i5 4000b8a0: 02 80 00 05 be 4000b8b4 <_Scheduler_CBS_Detach_thread+0x28> 4000b8a4: 03 10 00 82 sethi %hi(0x40020800), %g1 _Thread_Enable_dispatch(); 4000b8a8: 40 00 03 4e call 4000c5e0 <_Thread_Enable_dispatch> 4000b8ac: 01 00 00 00 nop } if ( server_id >= _Scheduler_CBS_Maximum_servers ) 4000b8b0: 03 10 00 82 sethi %hi(0x40020800), %g1 4000b8b4: c2 00 61 30 ld [ %g1 + 0x130 ], %g1 ! 40020930 <_Scheduler_CBS_Maximum_servers> 4000b8b8: 80 a6 00 01 cmp %i0, %g1 4000b8bc: 1a 80 00 1b bcc 4000b928 <_Scheduler_CBS_Detach_thread+0x9c> 4000b8c0: 80 a7 60 00 cmp %i5, 0 return SCHEDULER_CBS_ERROR_INVALID_PARAMETER; if ( !the_thread ) 4000b8c4: 02 80 00 19 be 4000b928 <_Scheduler_CBS_Detach_thread+0x9c> 4000b8c8: 03 10 00 86 sethi %hi(0x40021800), %g1 return SCHEDULER_CBS_ERROR_INVALID_PARAMETER; /* Server is not valid. */ if ( !_Scheduler_CBS_Server_list[server_id] ) 4000b8cc: c2 00 60 98 ld [ %g1 + 0x98 ], %g1 ! 40021898 <_Scheduler_CBS_Server_list> 4000b8d0: b1 2e 20 02 sll %i0, 2, %i0 4000b8d4: c2 00 40 18 ld [ %g1 + %i0 ], %g1 4000b8d8: 80 a0 60 00 cmp %g1, 0 4000b8dc: 02 80 00 11 be 4000b920 <_Scheduler_CBS_Detach_thread+0x94> 4000b8e0: 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 ) 4000b8e4: c4 00 40 00 ld [ %g1 ], %g2 4000b8e8: 80 a0 80 19 cmp %g2, %i1 4000b8ec: 12 80 00 0f bne 4000b928 <_Scheduler_CBS_Detach_thread+0x9c><== NEVER TAKEN 4000b8f0: 84 10 3f ff mov -1, %g2 return SCHEDULER_CBS_ERROR_INVALID_PARAMETER; _Scheduler_CBS_Server_list[server_id]->task_id = -1; 4000b8f4: c4 20 40 00 st %g2, [ %g1 ] sched_info = (Scheduler_CBS_Per_thread *) the_thread->scheduler_info; sched_info->cbs_server = NULL; 4000b8f8: c2 07 60 88 ld [ %i5 + 0x88 ], %g1 4000b8fc: c0 20 60 18 clr [ %g1 + 0x18 ] the_thread->budget_algorithm = the_thread->Start.budget_algorithm; 4000b900: c2 07 60 a0 ld [ %i5 + 0xa0 ], %g1 4000b904: c2 27 60 78 st %g1, [ %i5 + 0x78 ] the_thread->budget_callout = the_thread->Start.budget_callout; 4000b908: c2 07 60 a4 ld [ %i5 + 0xa4 ], %g1 4000b90c: c2 27 60 7c st %g1, [ %i5 + 0x7c ] the_thread->is_preemptible = the_thread->Start.is_preemptible; 4000b910: c2 0f 60 9c ldub [ %i5 + 0x9c ], %g1 4000b914: c2 2f 60 70 stb %g1, [ %i5 + 0x70 ] return SCHEDULER_CBS_OK; 4000b918: 81 c7 e0 08 ret 4000b91c: 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; 4000b920: 81 c7 e0 08 ret 4000b924: 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; } 4000b928: 81 c7 e0 08 ret 4000b92c: 91 e8 3f ee restore %g0, -18, %o0 =============================================================================== 4000bbb8 <_Scheduler_CBS_Initialize>: } } int _Scheduler_CBS_Initialize(void) { 4000bbb8: 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*) ); 4000bbbc: 3b 10 00 82 sethi %hi(0x40020800), %i5 4000bbc0: d0 07 61 30 ld [ %i5 + 0x130 ], %o0 ! 40020930 <_Scheduler_CBS_Maximum_servers> } int _Scheduler_CBS_Initialize(void) { unsigned int i; _Scheduler_CBS_Server_list = (Scheduler_CBS_Server **) _Workspace_Allocate( 4000bbc4: 40 00 06 79 call 4000d5a8 <_Workspace_Allocate> 4000bbc8: 91 2a 20 02 sll %o0, 2, %o0 4000bbcc: 05 10 00 86 sethi %hi(0x40021800), %g2 _Scheduler_CBS_Maximum_servers * sizeof(Scheduler_CBS_Server*) ); if ( !_Scheduler_CBS_Server_list ) 4000bbd0: 80 a2 20 00 cmp %o0, 0 4000bbd4: 02 80 00 0d be 4000bc08 <_Scheduler_CBS_Initialize+0x50> <== NEVER TAKEN 4000bbd8: d0 20 a0 98 st %o0, [ %g2 + 0x98 ] return SCHEDULER_CBS_ERROR_NO_MEMORY; for (i = 0; i<_Scheduler_CBS_Maximum_servers; i++) { 4000bbdc: c6 07 61 30 ld [ %i5 + 0x130 ], %g3 4000bbe0: 10 80 00 05 b 4000bbf4 <_Scheduler_CBS_Initialize+0x3c> 4000bbe4: 82 10 20 00 clr %g1 _Scheduler_CBS_Server_list[i] = NULL; 4000bbe8: 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++) { 4000bbec: 82 00 60 01 inc %g1 _Scheduler_CBS_Server_list[i] = NULL; 4000bbf0: 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++) { 4000bbf4: 80 a0 40 03 cmp %g1, %g3 4000bbf8: 12 bf ff fc bne 4000bbe8 <_Scheduler_CBS_Initialize+0x30> 4000bbfc: fa 00 a0 98 ld [ %g2 + 0x98 ], %i5 _Scheduler_CBS_Server_list[i] = NULL; } return SCHEDULER_CBS_OK; 4000bc00: 81 c7 e0 08 ret 4000bc04: 91 e8 20 00 restore %g0, 0, %o0 } 4000bc08: 81 c7 e0 08 ret <== NOT EXECUTED 4000bc0c: 91 e8 3f ef restore %g0, -17, %o0 <== NOT EXECUTED =============================================================================== 4000a83c <_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; 4000a83c: c2 02 20 88 ld [ %o0 + 0x88 ], %g1 if (deadline) { 4000a840: 80 a2 60 00 cmp %o1, 0 4000a844: 02 80 00 10 be 4000a884 <_Scheduler_CBS_Release_job+0x48> 4000a848: c2 00 60 18 ld [ %g1 + 0x18 ], %g1 /* Initializing or shifting deadline. */ if (serv_info) 4000a84c: 80 a0 60 00 cmp %g1, 0 4000a850: 02 80 00 08 be 4000a870 <_Scheduler_CBS_Release_job+0x34> 4000a854: 05 10 00 7f sethi %hi(0x4001fc00), %g2 new_priority = (_Watchdog_Ticks_since_boot + serv_info->parameters.deadline) 4000a858: d2 00 a0 08 ld [ %g2 + 8 ], %o1 ! 4001fc08 <_Watchdog_Ticks_since_boot> 4000a85c: c4 00 60 04 ld [ %g1 + 4 ], %g2 4000a860: 92 02 40 02 add %o1, %g2, %o1 4000a864: 05 20 00 00 sethi %hi(0x80000000), %g2 4000a868: 10 80 00 0a b 4000a890 <_Scheduler_CBS_Release_job+0x54> 4000a86c: 92 2a 40 02 andn %o1, %g2, %o1 & ~SCHEDULER_EDF_PRIO_MSB; else new_priority = (_Watchdog_Ticks_since_boot + deadline) 4000a870: c2 00 a0 08 ld [ %g2 + 8 ], %g1 4000a874: 92 02 40 01 add %o1, %g1, %o1 4000a878: 03 20 00 00 sethi %hi(0x80000000), %g1 4000a87c: 10 80 00 07 b 4000a898 <_Scheduler_CBS_Release_job+0x5c> 4000a880: 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) 4000a884: 80 a0 60 00 cmp %g1, 0 4000a888: 02 80 00 04 be 4000a898 <_Scheduler_CBS_Release_job+0x5c> <== NEVER TAKEN 4000a88c: d2 02 20 ac ld [ %o0 + 0xac ], %o1 the_thread->cpu_time_budget = serv_info->parameters.budget; 4000a890: c2 00 60 08 ld [ %g1 + 8 ], %g1 4000a894: c2 22 20 74 st %g1, [ %o0 + 0x74 ] the_thread->real_priority = new_priority; 4000a898: d2 22 20 18 st %o1, [ %o0 + 0x18 ] _Thread_Change_priority(the_thread, new_priority, true); 4000a89c: 94 10 20 01 mov 1, %o2 4000a8a0: 82 13 c0 00 mov %o7, %g1 4000a8a4: 40 00 01 24 call 4000ad34 <_Thread_Change_priority> 4000a8a8: 9e 10 40 00 mov %g1, %o7 =============================================================================== 4000a8ac <_Scheduler_CBS_Unblock>: #include void _Scheduler_CBS_Unblock( Thread_Control *the_thread ) { 4000a8ac: 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); 4000a8b0: 40 00 00 4c call 4000a9e0 <_Scheduler_EDF_Enqueue> 4000a8b4: 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; 4000a8b8: c2 06 20 88 ld [ %i0 + 0x88 ], %g1 4000a8bc: 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) { 4000a8c0: 80 a7 60 00 cmp %i5, 0 4000a8c4: 02 80 00 18 be 4000a924 <_Scheduler_CBS_Unblock+0x78> 4000a8c8: 03 10 00 7f sethi %hi(0x4001fc00), %g1 time_t budget = serv_info->parameters.budget; time_t deadline_left = the_thread->cpu_time_budget; time_t budget_left = the_thread->real_priority - _Watchdog_Ticks_since_boot; if ( deadline*budget_left > budget*deadline_left ) { 4000a8cc: 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 - 4000a8d0: d0 00 60 08 ld [ %g1 + 8 ], %o0 4000a8d4: f8 06 20 18 ld [ %i0 + 0x18 ], %i4 _Watchdog_Ticks_since_boot; if ( deadline*budget_left > budget*deadline_left ) { 4000a8d8: 40 00 3b b7 call 400197b4 <.umul> 4000a8dc: 90 27 00 08 sub %i4, %o0, %o0 4000a8e0: d2 06 20 74 ld [ %i0 + 0x74 ], %o1 4000a8e4: b6 10 00 08 mov %o0, %i3 4000a8e8: 40 00 3b b3 call 400197b4 <.umul> 4000a8ec: d0 07 60 08 ld [ %i5 + 8 ], %o0 4000a8f0: 80 a6 c0 08 cmp %i3, %o0 4000a8f4: 24 80 00 0d ble,a 4000a928 <_Scheduler_CBS_Unblock+0x7c> 4000a8f8: 3b 10 00 7f sethi %hi(0x4001fc00), %i5 /* Put late unblocked task to background until the end of period. */ new_priority = the_thread->Start.initial_priority; 4000a8fc: d2 06 20 ac ld [ %i0 + 0xac ], %o1 if ( the_thread->real_priority != new_priority ) 4000a900: 80 a7 00 09 cmp %i4, %o1 4000a904: 32 80 00 02 bne,a 4000a90c <_Scheduler_CBS_Unblock+0x60> 4000a908: d2 26 20 18 st %o1, [ %i0 + 0x18 ] the_thread->real_priority = new_priority; if ( the_thread->current_priority != new_priority ) 4000a90c: c2 06 20 14 ld [ %i0 + 0x14 ], %g1 4000a910: 80 a0 40 09 cmp %g1, %o1 4000a914: 02 80 00 04 be 4000a924 <_Scheduler_CBS_Unblock+0x78> 4000a918: 90 10 00 18 mov %i0, %o0 _Thread_Change_priority(the_thread, new_priority, true); 4000a91c: 40 00 01 06 call 4000ad34 <_Thread_Change_priority> 4000a920: 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, 4000a924: 3b 10 00 7f sethi %hi(0x4001fc00), %i5 4000a928: ba 17 61 20 or %i5, 0x120, %i5 ! 4001fd20 <_Per_CPU_Information> 4000a92c: c4 07 60 14 ld [ %i5 + 0x14 ], %g2 4000a930: 03 10 00 7b sethi %hi(0x4001ec00), %g1 4000a934: d0 06 20 14 ld [ %i0 + 0x14 ], %o0 4000a938: c2 00 62 14 ld [ %g1 + 0x214 ], %g1 4000a93c: 9f c0 40 00 call %g1 4000a940: d2 00 a0 14 ld [ %g2 + 0x14 ], %o1 4000a944: 80 a2 20 00 cmp %o0, 0 4000a948: 04 80 00 0f ble 4000a984 <_Scheduler_CBS_Unblock+0xd8> 4000a94c: 01 00 00 00 nop _Thread_Heir->current_priority)) { _Thread_Heir = the_thread; if ( _Thread_Executing->is_preemptible || 4000a950: 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; 4000a954: f0 27 60 14 st %i0, [ %i5 + 0x14 ] if ( _Thread_Executing->is_preemptible || 4000a958: c2 08 60 70 ldub [ %g1 + 0x70 ], %g1 4000a95c: 80 a0 60 00 cmp %g1, 0 4000a960: 12 80 00 06 bne 4000a978 <_Scheduler_CBS_Unblock+0xcc> 4000a964: 84 10 20 01 mov 1, %g2 4000a968: c2 06 20 14 ld [ %i0 + 0x14 ], %g1 4000a96c: 80 a0 60 00 cmp %g1, 0 4000a970: 12 80 00 05 bne 4000a984 <_Scheduler_CBS_Unblock+0xd8> <== ALWAYS TAKEN 4000a974: 01 00 00 00 nop the_thread->current_priority == 0 ) _Thread_Dispatch_necessary = true; 4000a978: 03 10 00 7f sethi %hi(0x4001fc00), %g1 4000a97c: 82 10 61 20 or %g1, 0x120, %g1 ! 4001fd20 <_Per_CPU_Information> 4000a980: c4 28 60 0c stb %g2, [ %g1 + 0xc ] 4000a984: 81 c7 e0 08 ret 4000a988: 81 e8 00 00 restore =============================================================================== 4000a80c <_Scheduler_EDF_Allocate>: #include void *_Scheduler_EDF_Allocate( Thread_Control *the_thread ) { 4000a80c: 9d e3 bf a0 save %sp, -96, %sp void *sched; Scheduler_EDF_Per_thread *schinfo; sched = _Workspace_Allocate( sizeof(Scheduler_EDF_Per_thread) ); 4000a810: 40 00 06 52 call 4000c158 <_Workspace_Allocate> 4000a814: 90 10 20 18 mov 0x18, %o0 if ( sched ) { 4000a818: 80 a2 20 00 cmp %o0, 0 4000a81c: 02 80 00 05 be 4000a830 <_Scheduler_EDF_Allocate+0x24> <== NEVER TAKEN 4000a820: 82 10 20 02 mov 2, %g1 the_thread->scheduler_info = sched; 4000a824: d0 26 20 88 st %o0, [ %i0 + 0x88 ] schinfo = (Scheduler_EDF_Per_thread *)(the_thread->scheduler_info); schinfo->thread = the_thread; 4000a828: f0 22 00 00 st %i0, [ %o0 ] schinfo->queue_state = SCHEDULER_EDF_QUEUE_STATE_NEVER_HAS_BEEN; 4000a82c: c2 22 20 14 st %g1, [ %o0 + 0x14 ] } return sched; } 4000a830: 81 c7 e0 08 ret 4000a834: 91 e8 00 08 restore %g0, %o0, %o0 =============================================================================== 4000a9d4 <_Scheduler_EDF_Unblock>: #include void _Scheduler_EDF_Unblock( Thread_Control *the_thread ) { 4000a9d4: 9d e3 bf a0 save %sp, -96, %sp _Scheduler_EDF_Enqueue(the_thread); 4000a9d8: 7f ff ff ad call 4000a88c <_Scheduler_EDF_Enqueue> 4000a9dc: 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( 4000a9e0: 3b 10 00 7f sethi %hi(0x4001fc00), %i5 4000a9e4: ba 17 60 70 or %i5, 0x70, %i5 ! 4001fc70 <_Per_CPU_Information> 4000a9e8: c4 07 60 14 ld [ %i5 + 0x14 ], %g2 4000a9ec: 03 10 00 7b sethi %hi(0x4001ec00), %g1 4000a9f0: d0 00 a0 14 ld [ %g2 + 0x14 ], %o0 4000a9f4: c2 00 61 64 ld [ %g1 + 0x164 ], %g1 4000a9f8: 9f c0 40 00 call %g1 4000a9fc: d2 06 20 14 ld [ %i0 + 0x14 ], %o1 4000aa00: 80 a2 20 00 cmp %o0, 0 4000aa04: 16 80 00 0f bge 4000aa40 <_Scheduler_EDF_Unblock+0x6c> 4000aa08: 01 00 00 00 nop _Thread_Heir->current_priority, the_thread->current_priority )) { _Thread_Heir = the_thread; if ( _Thread_Executing->is_preemptible || 4000aa0c: 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; 4000aa10: f0 27 60 14 st %i0, [ %i5 + 0x14 ] if ( _Thread_Executing->is_preemptible || 4000aa14: c2 08 60 70 ldub [ %g1 + 0x70 ], %g1 4000aa18: 80 a0 60 00 cmp %g1, 0 4000aa1c: 12 80 00 06 bne 4000aa34 <_Scheduler_EDF_Unblock+0x60> 4000aa20: 84 10 20 01 mov 1, %g2 4000aa24: c2 06 20 14 ld [ %i0 + 0x14 ], %g1 4000aa28: 80 a0 60 00 cmp %g1, 0 4000aa2c: 12 80 00 05 bne 4000aa40 <_Scheduler_EDF_Unblock+0x6c> <== ALWAYS TAKEN 4000aa30: 01 00 00 00 nop the_thread->current_priority == 0 ) _Thread_Dispatch_necessary = true; 4000aa34: 03 10 00 7f sethi %hi(0x4001fc00), %g1 4000aa38: 82 10 60 70 or %g1, 0x70, %g1 ! 4001fc70 <_Per_CPU_Information> 4000aa3c: c4 28 60 0c stb %g2, [ %g1 + 0xc ] 4000aa40: 81 c7 e0 08 ret 4000aa44: 81 e8 00 00 restore =============================================================================== 40008dc4 <_TOD_Validate>: }; bool _TOD_Validate( const rtems_time_of_day *the_tod ) { 40008dc4: 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 / 40008dc8: 03 10 00 75 sethi %hi(0x4001d400), %g1 40008dcc: d2 00 63 4c ld [ %g1 + 0x34c ], %o1 ! 4001d74c 40008dd0: 11 00 03 d0 sethi %hi(0xf4000), %o0 40008dd4: 40 00 44 bf call 4001a0d0 <.udiv> 40008dd8: 90 12 22 40 or %o0, 0x240, %o0 ! f4240 rtems_configuration_get_microseconds_per_tick(); if ((!the_tod) || 40008ddc: 80 a6 20 00 cmp %i0, 0 40008de0: 02 80 00 28 be 40008e80 <_TOD_Validate+0xbc> <== NEVER TAKEN 40008de4: 84 10 20 00 clr %g2 40008de8: c2 06 20 18 ld [ %i0 + 0x18 ], %g1 40008dec: 80 a0 40 08 cmp %g1, %o0 40008df0: 3a 80 00 25 bcc,a 40008e84 <_TOD_Validate+0xc0> 40008df4: b0 08 a0 01 and %g2, 1, %i0 (the_tod->ticks >= ticks_per_second) || 40008df8: c2 06 20 14 ld [ %i0 + 0x14 ], %g1 40008dfc: 80 a0 60 3b cmp %g1, 0x3b 40008e00: 38 80 00 21 bgu,a 40008e84 <_TOD_Validate+0xc0> 40008e04: b0 08 a0 01 and %g2, 1, %i0 (the_tod->second >= TOD_SECONDS_PER_MINUTE) || 40008e08: c2 06 20 10 ld [ %i0 + 0x10 ], %g1 40008e0c: 80 a0 60 3b cmp %g1, 0x3b 40008e10: 38 80 00 1d bgu,a 40008e84 <_TOD_Validate+0xc0> 40008e14: b0 08 a0 01 and %g2, 1, %i0 (the_tod->minute >= TOD_MINUTES_PER_HOUR) || 40008e18: c2 06 20 0c ld [ %i0 + 0xc ], %g1 40008e1c: 80 a0 60 17 cmp %g1, 0x17 40008e20: 38 80 00 19 bgu,a 40008e84 <_TOD_Validate+0xc0> 40008e24: b0 08 a0 01 and %g2, 1, %i0 (the_tod->hour >= TOD_HOURS_PER_DAY) || (the_tod->month == 0) || 40008e28: 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) || 40008e2c: 80 a0 60 00 cmp %g1, 0 40008e30: 02 80 00 14 be 40008e80 <_TOD_Validate+0xbc> <== NEVER TAKEN 40008e34: 80 a0 60 0c cmp %g1, 0xc (the_tod->month == 0) || 40008e38: 38 80 00 13 bgu,a 40008e84 <_TOD_Validate+0xc0> 40008e3c: b0 08 a0 01 and %g2, 1, %i0 (the_tod->month > TOD_MONTHS_PER_YEAR) || (the_tod->year < TOD_BASE_YEAR) || 40008e40: 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) || 40008e44: 80 a1 27 c3 cmp %g4, 0x7c3 40008e48: 28 80 00 0f bleu,a 40008e84 <_TOD_Validate+0xc0> 40008e4c: b0 08 a0 01 and %g2, 1, %i0 (the_tod->year < TOD_BASE_YEAR) || (the_tod->day == 0) ) 40008e50: 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) || 40008e54: 80 a0 e0 00 cmp %g3, 0 40008e58: 02 80 00 0a be 40008e80 <_TOD_Validate+0xbc> <== NEVER TAKEN 40008e5c: 80 89 20 03 btst 3, %g4 40008e60: 05 10 00 7a sethi %hi(0x4001e800), %g2 (the_tod->day == 0) ) return false; if ( (the_tod->year % 4) == 0 ) 40008e64: 12 80 00 03 bne 40008e70 <_TOD_Validate+0xac> 40008e68: 84 10 a0 48 or %g2, 0x48, %g2 ! 4001e848 <_TOD_Days_per_month> days_in_month = _TOD_Days_per_month[ 1 ][ the_tod->month ]; 40008e6c: 82 00 60 0d add %g1, 0xd, %g1 else days_in_month = _TOD_Days_per_month[ 0 ][ the_tod->month ]; 40008e70: 83 28 60 02 sll %g1, 2, %g1 40008e74: c2 00 80 01 ld [ %g2 + %g1 ], %g1 if ( the_tod->day > days_in_month ) 40008e78: 80 a0 40 03 cmp %g1, %g3 40008e7c: 84 60 3f ff subx %g0, -1, %g2 return false; return true; } 40008e80: b0 08 a0 01 and %g2, 1, %i0 40008e84: 81 c7 e0 08 ret 40008e88: 81 e8 00 00 restore =============================================================================== 4000a394 <_Thread_Change_priority>: void _Thread_Change_priority( Thread_Control *the_thread, Priority_Control new_priority, bool prepend_it ) { 4000a394: 9d e3 bf a0 save %sp, -96, %sp 4000a398: ba 10 00 18 mov %i0, %i5 States_Control state, original_state; /* * Save original state */ original_state = the_thread->current_state; 4000a39c: 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 ); 4000a3a0: 40 00 03 46 call 4000b0b8 <_Thread_Set_transient> 4000a3a4: 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 ) 4000a3a8: c2 07 60 14 ld [ %i5 + 0x14 ], %g1 4000a3ac: 80 a0 40 19 cmp %g1, %i1 4000a3b0: 02 80 00 04 be 4000a3c0 <_Thread_Change_priority+0x2c> 4000a3b4: 90 10 00 1d mov %i5, %o0 _Thread_Set_priority( the_thread, new_priority ); 4000a3b8: 40 00 03 27 call 4000b054 <_Thread_Set_priority> 4000a3bc: 92 10 00 19 mov %i1, %o1 _ISR_Disable( level ); 4000a3c0: 7f ff e0 22 call 40002448 4000a3c4: 01 00 00 00 nop 4000a3c8: 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; 4000a3cc: f8 07 60 10 ld [ %i5 + 0x10 ], %i4 if ( state != STATES_TRANSIENT ) { 4000a3d0: 80 a7 20 04 cmp %i4, 4 4000a3d4: 02 80 00 10 be 4000a414 <_Thread_Change_priority+0x80> 4000a3d8: 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 ) ) 4000a3dc: 80 a0 60 00 cmp %g1, 0 4000a3e0: 12 80 00 03 bne 4000a3ec <_Thread_Change_priority+0x58> <== NEVER TAKEN 4000a3e4: 82 0f 3f fb and %i4, -5, %g1 the_thread->current_state = _States_Clear( STATES_TRANSIENT, state ); 4000a3e8: c2 27 60 10 st %g1, [ %i5 + 0x10 ] _ISR_Enable( level ); 4000a3ec: 7f ff e0 1b call 40002458 4000a3f0: 90 10 00 1b mov %i3, %o0 if ( _States_Is_waiting_on_thread_queue( state ) ) { 4000a3f4: 03 00 00 ef sethi %hi(0x3bc00), %g1 4000a3f8: 82 10 62 e0 or %g1, 0x2e0, %g1 ! 3bee0 4000a3fc: 80 8f 00 01 btst %i4, %g1 4000a400: 02 80 00 27 be 4000a49c <_Thread_Change_priority+0x108> 4000a404: 01 00 00 00 nop _Thread_queue_Requeue( the_thread->Wait.queue, the_thread ); 4000a408: f0 07 60 44 ld [ %i5 + 0x44 ], %i0 4000a40c: 40 00 02 e5 call 4000afa0 <_Thread_queue_Requeue> 4000a410: 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 ) ) { 4000a414: 80 a0 60 00 cmp %g1, 0 4000a418: 12 80 00 0b bne 4000a444 <_Thread_Change_priority+0xb0> <== NEVER TAKEN 4000a41c: 03 10 00 74 sethi %hi(0x4001d000), %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 ); 4000a420: c0 27 60 10 clr [ %i5 + 0x10 ] if ( prepend_it ) 4000a424: 80 a6 a0 00 cmp %i2, 0 4000a428: 02 80 00 04 be 4000a438 <_Thread_Change_priority+0xa4> 4000a42c: 82 10 62 64 or %g1, 0x264, %g1 */ RTEMS_INLINE_ROUTINE void _Scheduler_Enqueue_first( Thread_Control *the_thread ) { _Scheduler.Operations.enqueue_first( the_thread ); 4000a430: 10 80 00 03 b 4000a43c <_Thread_Change_priority+0xa8> 4000a434: c2 00 60 28 ld [ %g1 + 0x28 ], %g1 */ RTEMS_INLINE_ROUTINE void _Scheduler_Enqueue( Thread_Control *the_thread ) { _Scheduler.Operations.enqueue( the_thread ); 4000a438: c2 00 60 24 ld [ %g1 + 0x24 ], %g1 4000a43c: 9f c0 40 00 call %g1 4000a440: 90 10 00 1d mov %i5, %o0 _Scheduler_Enqueue_first( the_thread ); else _Scheduler_Enqueue( the_thread ); } _ISR_Flash( level ); 4000a444: 7f ff e0 05 call 40002458 4000a448: 90 10 00 1b mov %i3, %o0 4000a44c: 7f ff df ff call 40002448 4000a450: 01 00 00 00 nop 4000a454: 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(); 4000a458: 03 10 00 74 sethi %hi(0x4001d000), %g1 4000a45c: c2 00 62 6c ld [ %g1 + 0x26c ], %g1 ! 4001d26c <_Scheduler+0x8> 4000a460: 9f c0 40 00 call %g1 4000a464: 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 ); 4000a468: 03 10 00 78 sethi %hi(0x4001e000), %g1 4000a46c: 82 10 61 30 or %g1, 0x130, %g1 ! 4001e130 <_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() && 4000a470: c4 18 60 10 ldd [ %g1 + 0x10 ], %g2 4000a474: 80 a0 80 03 cmp %g2, %g3 4000a478: 02 80 00 07 be 4000a494 <_Thread_Change_priority+0x100> 4000a47c: 01 00 00 00 nop 4000a480: c4 08 a0 70 ldub [ %g2 + 0x70 ], %g2 4000a484: 80 a0 a0 00 cmp %g2, 0 4000a488: 02 80 00 03 be 4000a494 <_Thread_Change_priority+0x100> 4000a48c: 84 10 20 01 mov 1, %g2 _Thread_Executing->is_preemptible ) _Thread_Dispatch_necessary = true; 4000a490: c4 28 60 0c stb %g2, [ %g1 + 0xc ] _ISR_Enable( level ); 4000a494: 7f ff df f1 call 40002458 4000a498: 81 e8 00 00 restore 4000a49c: 81 c7 e0 08 ret 4000a4a0: 81 e8 00 00 restore =============================================================================== 4000a664 <_Thread_Delay_ended>: void _Thread_Delay_ended( Objects_Id id, void *ignored __attribute__((unused)) ) { 4000a664: 9d e3 bf 98 save %sp, -104, %sp Thread_Control *the_thread; Objects_Locations location; the_thread = _Thread_Get( id, &location ); 4000a668: 90 10 00 18 mov %i0, %o0 4000a66c: 40 00 00 70 call 4000a82c <_Thread_Get> 4000a670: 92 07 bf fc add %fp, -4, %o1 switch ( location ) { 4000a674: c2 07 bf fc ld [ %fp + -4 ], %g1 4000a678: 80 a0 60 00 cmp %g1, 0 4000a67c: 12 80 00 08 bne 4000a69c <_Thread_Delay_ended+0x38> <== NEVER TAKEN 4000a680: 13 04 00 00 sethi %hi(0x10000000), %o1 #if defined(RTEMS_MULTIPROCESSING) case OBJECTS_REMOTE: /* impossible */ #endif break; case OBJECTS_LOCAL: _Thread_Clear_state( 4000a684: 7f ff ff 88 call 4000a4a4 <_Thread_Clear_state> 4000a688: 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; 4000a68c: 03 10 00 77 sethi %hi(0x4001dc00), %g1 4000a690: c4 00 63 30 ld [ %g1 + 0x330 ], %g2 ! 4001df30 <_Thread_Dispatch_disable_level> --level; 4000a694: 84 00 bf ff add %g2, -1, %g2 _Thread_Dispatch_disable_level = level; 4000a698: c4 20 63 30 st %g2, [ %g1 + 0x330 ] 4000a69c: 81 c7 e0 08 ret 4000a6a0: 81 e8 00 00 restore =============================================================================== 4000a6a4 <_Thread_Dispatch>: #if defined(RTEMS_SMP) #include #endif void _Thread_Dispatch( void ) { 4000a6a4: 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; 4000a6a8: 35 10 00 78 sethi %hi(0x4001e000), %i2 4000a6ac: 82 16 a1 30 or %i2, 0x130, %g1 ! 4001e130 <_Per_CPU_Information> _ISR_Disable( level ); 4000a6b0: 7f ff df 66 call 40002448 4000a6b4: f6 00 60 10 ld [ %g1 + 0x10 ], %i3 */ static inline void _TOD_Get_uptime( Timestamp_Control *time ) { _TOD_Get_with_nanoseconds( time, &_TOD.uptime ); 4000a6b8: 21 10 00 77 sethi %hi(0x4001dc00), %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 ) { 4000a6bc: 27 10 00 74 sethi %hi(0x4001d000), %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; 4000a6c0: 33 10 00 77 sethi %hi(0x4001dc00), %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; 4000a6c4: 31 10 00 77 sethi %hi(0x4001dc00), %i0 4000a6c8: a0 14 22 80 or %l0, 0x280, %l0 #endif /* * Switch libc's task specific data. */ if ( _Thread_libc_reent ) { 4000a6cc: 23 10 00 77 sethi %hi(0x4001dc00), %l1 */ RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_first( const Chain_Control *the_chain ) { return _Chain_Immutable_head( the_chain )->next; 4000a6d0: 25 10 00 74 sethi %hi(0x4001d000), %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 ) { 4000a6d4: 10 80 00 3b b 4000a7c0 <_Thread_Dispatch+0x11c> 4000a6d8: a6 14 e3 94 or %l3, 0x394, %l3 4000a6dc: 84 10 20 01 mov 1, %g2 4000a6e0: c4 26 63 30 st %g2, [ %i1 + 0x330 ] heir = _Thread_Heir; #ifndef RTEMS_SMP _Thread_Dispatch_set_disable_level( 1 ); #endif _Thread_Dispatch_necessary = false; 4000a6e4: 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 ) 4000a6e8: 80 a5 00 1b cmp %l4, %i3 4000a6ec: 12 80 00 0a bne 4000a714 <_Thread_Dispatch+0x70> 4000a6f0: e8 20 60 10 st %l4, [ %g1 + 0x10 ] 4000a6f4: 03 10 00 77 sethi %hi(0x4001dc00), %g1 4000a6f8: c0 20 63 30 clr [ %g1 + 0x330 ] ! 4001df30 <_Thread_Dispatch_disable_level> post_switch: #ifndef RTEMS_SMP _Thread_Dispatch_set_disable_level( 0 ); #endif _ISR_Enable( level ); 4000a6fc: 7f ff df 57 call 40002458 4000a700: 39 10 00 77 sethi %hi(0x4001dc00), %i4 4000a704: 03 10 00 77 sethi %hi(0x4001dc00), %g1 4000a708: fa 00 63 a0 ld [ %g1 + 0x3a0 ], %i5 ! 4001dfa0 <_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 ) { 4000a70c: 10 80 00 37 b 4000a7e8 <_Thread_Dispatch+0x144> 4000a710: b8 17 23 a4 or %i4, 0x3a4, %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 ) 4000a714: c2 05 20 78 ld [ %l4 + 0x78 ], %g1 4000a718: 80 a0 60 01 cmp %g1, 1 4000a71c: 12 80 00 03 bne 4000a728 <_Thread_Dispatch+0x84> 4000a720: c2 06 22 90 ld [ %i0 + 0x290 ], %g1 heir->cpu_time_budget = _Thread_Ticks_per_timeslice; 4000a724: c2 25 20 74 st %g1, [ %l4 + 0x74 ] _ISR_Enable( level ); 4000a728: 7f ff df 4c call 40002458 4000a72c: 01 00 00 00 nop 4000a730: 90 07 bf f8 add %fp, -8, %o0 4000a734: 7f ff f9 eb call 40008ee0 <_TOD_Get_with_nanoseconds> 4000a738: 92 10 00 10 mov %l0, %o1 #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ { Timestamp_Control uptime, ran; _TOD_Get_uptime( &uptime ); _Timestamp_Subtract( 4000a73c: c4 1f bf f8 ldd [ %fp + -8 ], %g2 4000a740: 82 16 a1 30 or %i2, 0x130, %g1 const Timestamp64_Control *_start, const Timestamp64_Control *_end, Timestamp64_Control *_result ) { *_result = *_end - *_start; 4000a744: f8 18 60 20 ldd [ %g1 + 0x20 ], %i4 4000a748: 96 a0 c0 1d subcc %g3, %i5, %o3 4000a74c: 94 60 80 1c subx %g2, %i4, %o2 static inline void _Timestamp64_implementation_Add_to( Timestamp64_Control *_time, const Timestamp64_Control *_add ) { *_time += *_add; 4000a750: f8 1e e0 80 ldd [ %i3 + 0x80 ], %i4 4000a754: 9a 87 40 0b addcc %i5, %o3, %o5 4000a758: 98 47 00 0a addx %i4, %o2, %o4 4000a75c: 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; 4000a760: c4 38 60 20 std %g2, [ %g1 + 0x20 ] #endif /* * Switch libc's task specific data. */ if ( _Thread_libc_reent ) { 4000a764: c2 04 63 9c ld [ %l1 + 0x39c ], %g1 4000a768: 80 a0 60 00 cmp %g1, 0 4000a76c: 22 80 00 0c be,a 4000a79c <_Thread_Dispatch+0xf8> <== NEVER TAKEN 4000a770: fa 04 a3 90 ld [ %l2 + 0x390 ], %i5 <== NOT EXECUTED executing->libc_reent = *_Thread_libc_reent; 4000a774: c4 00 40 00 ld [ %g1 ], %g2 4000a778: c4 26 e1 48 st %g2, [ %i3 + 0x148 ] *_Thread_libc_reent = heir->libc_reent; 4000a77c: c4 05 21 48 ld [ %l4 + 0x148 ], %g2 4000a780: c4 20 40 00 st %g2, [ %g1 ] 4000a784: 10 80 00 06 b 4000a79c <_Thread_Dispatch+0xf8> 4000a788: fa 04 a3 90 ld [ %l2 + 0x390 ], %i5 const User_extensions_Switch_control *extension = (const User_extensions_Switch_control *) node; (*extension->thread_switch)( executing, heir ); 4000a78c: 90 10 00 1b mov %i3, %o0 4000a790: 9f c0 40 00 call %g1 4000a794: 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; 4000a798: 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 ) { 4000a79c: 80 a7 40 13 cmp %i5, %l3 4000a7a0: 32 bf ff fb bne,a 4000a78c <_Thread_Dispatch+0xe8> 4000a7a4: 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 ); 4000a7a8: 90 06 e0 c0 add %i3, 0xc0, %o0 4000a7ac: 40 00 04 22 call 4000b834 <_CPU_Context_switch> 4000a7b0: 92 05 20 c0 add %l4, 0xc0, %o1 if ( executing->fp_context != NULL ) _Context_Restore_fp( &executing->fp_context ); #endif #endif executing = _Thread_Executing; 4000a7b4: 82 16 a1 30 or %i2, 0x130, %g1 _ISR_Disable( level ); 4000a7b8: 7f ff df 24 call 40002448 4000a7bc: 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 ) { 4000a7c0: 82 16 a1 30 or %i2, 0x130, %g1 4000a7c4: c4 08 60 0c ldub [ %g1 + 0xc ], %g2 4000a7c8: 80 a0 a0 00 cmp %g2, 0 4000a7cc: 32 bf ff c4 bne,a 4000a6dc <_Thread_Dispatch+0x38> 4000a7d0: e8 00 60 14 ld [ %g1 + 0x14 ], %l4 4000a7d4: 10 bf ff c9 b 4000a6f8 <_Thread_Dispatch+0x54> 4000a7d8: 03 10 00 77 sethi %hi(0x4001dc00), %g1 const API_extensions_Post_switch_control *post_switch = (const API_extensions_Post_switch_control *) node; (*post_switch->hook)( executing ); 4000a7dc: 9f c0 40 00 call %g1 4000a7e0: 90 10 00 1b mov %i3, %o0 4000a7e4: 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 ) { 4000a7e8: 80 a7 40 1c cmp %i5, %i4 4000a7ec: 32 bf ff fc bne,a 4000a7dc <_Thread_Dispatch+0x138> 4000a7f0: c2 07 60 08 ld [ %i5 + 8 ], %g1 #ifdef RTEMS_SMP _Thread_Unnest_dispatch(); #endif _API_extensions_Run_post_switch( executing ); } 4000a7f4: 81 c7 e0 08 ret 4000a7f8: 81 e8 00 00 restore =============================================================================== 4000eba8 <_Thread_Handler>: #define INIT_NAME __main #define EXECUTE_GLOBAL_CONSTRUCTORS #endif void _Thread_Handler( void ) { 4000eba8: 9d e3 bf a0 save %sp, -96, %sp #if defined(EXECUTE_GLOBAL_CONSTRUCTORS) static bool doneConstructors; bool doCons; #endif executing = _Thread_Executing; 4000ebac: 03 10 00 78 sethi %hi(0x4001e000), %g1 4000ebb0: fa 00 61 40 ld [ %g1 + 0x140 ], %i5 ! 4001e140 <_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(); 4000ebb4: 3f 10 00 3a sethi %hi(0x4000e800), %i7 4000ebb8: be 17 e3 a8 or %i7, 0x3a8, %i7 ! 4000eba8 <_Thread_Handler> /* * have to put level into a register for those cpu's that use * inline asm here */ level = executing->Start.isr_level; 4000ebbc: d0 07 60 a8 ld [ %i5 + 0xa8 ], %o0 _ISR_Set_level(level); 4000ebc0: 7f ff ce 26 call 40002458 4000ebc4: 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; 4000ebc8: 03 10 00 76 sethi %hi(0x4001d800), %g1 doneConstructors = true; 4000ebcc: 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; 4000ebd0: f8 08 62 c0 ldub [ %g1 + 0x2c0 ], %i4 ); } static inline void _User_extensions_Thread_begin( Thread_Control *executing ) { _User_extensions_Iterate( 4000ebd4: 90 10 00 1d mov %i5, %o0 4000ebd8: 13 10 00 2c sethi %hi(0x4000b000), %o1 4000ebdc: 92 12 62 8c or %o1, 0x28c, %o1 ! 4000b28c <_User_extensions_Thread_begin_visitor> 4000ebe0: 7f ff f1 c8 call 4000b300 <_User_extensions_Iterate> 4000ebe4: c4 28 62 c0 stb %g2, [ %g1 + 0x2c0 ] _User_extensions_Thread_begin( executing ); /* * At this point, the dispatch disable level BETTER be 1. */ _Thread_Enable_dispatch(); 4000ebe8: 7f ff ef 05 call 4000a7fc <_Thread_Enable_dispatch> 4000ebec: 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) */ { 4000ebf0: 80 8f 20 ff btst 0xff, %i4 4000ebf4: 32 80 00 05 bne,a 4000ec08 <_Thread_Handler+0x60> 4000ebf8: c2 07 60 90 ld [ %i5 + 0x90 ], %g1 INIT_NAME (); 4000ebfc: 40 00 39 65 call 4001d190 <_init> 4000ec00: 01 00 00 00 nop _Thread_Enable_dispatch(); #endif } #endif if ( executing->Start.prototype == THREAD_START_NUMERIC ) { 4000ec04: c2 07 60 90 ld [ %i5 + 0x90 ], %g1 4000ec08: 80 a0 60 00 cmp %g1, 0 4000ec0c: 12 80 00 07 bne 4000ec28 <_Thread_Handler+0x80> <== NEVER TAKEN 4000ec10: 90 10 00 1d mov %i5, %o0 executing->Wait.return_argument = (*(Thread_Entry_numeric) executing->Start.entry_point)( 4000ec14: c2 07 60 8c ld [ %i5 + 0x8c ], %g1 4000ec18: 9f c0 40 00 call %g1 4000ec1c: d0 07 60 98 ld [ %i5 + 0x98 ], %o0 #endif } #endif if ( executing->Start.prototype == THREAD_START_NUMERIC ) { executing->Wait.return_argument = 4000ec20: d0 27 60 28 st %o0, [ %i5 + 0x28 ] } } static inline void _User_extensions_Thread_exitted( Thread_Control *executing ) { _User_extensions_Iterate( 4000ec24: 90 10 00 1d mov %i5, %o0 4000ec28: 13 10 00 2c sethi %hi(0x4000b000), %o1 4000ec2c: 7f ff f1 b5 call 4000b300 <_User_extensions_Iterate> 4000ec30: 92 12 62 b0 or %o1, 0x2b0, %o1 ! 4000b2b0 <_User_extensions_Thread_exitted_visitor> * able to fit in a (void *). */ _User_extensions_Thread_exitted( executing ); _Internal_error_Occurred( 4000ec34: 90 10 20 00 clr %o0 4000ec38: 92 10 20 01 mov 1, %o1 4000ec3c: 7f ff e9 dd call 400093b0 <_Internal_error_Occurred> 4000ec40: 94 10 20 05 mov 5, %o2 =============================================================================== 4000aa88 <_Thread_Handler_initialization>: #if defined(RTEMS_SMP) #include #endif void _Thread_Handler_initialization(void) { 4000aa88: 9d e3 bf 98 save %sp, -104, %sp uint32_t ticks_per_timeslice = 4000aa8c: 03 10 00 6d sethi %hi(0x4001b400), %g1 4000aa90: 82 10 60 c8 or %g1, 0xc8, %g1 ! 4001b4c8 #if defined(RTEMS_MULTIPROCESSING) uint32_t maximum_proxies = _Configuration_MP_table->maximum_proxies; #endif if ( rtems_configuration_get_stack_allocate_hook() == NULL || 4000aa94: c6 00 60 28 ld [ %g1 + 0x28 ], %g3 #include #endif void _Thread_Handler_initialization(void) { uint32_t ticks_per_timeslice = 4000aa98: fa 00 60 14 ld [ %g1 + 0x14 ], %i5 rtems_configuration_get_ticks_per_timeslice(); uint32_t maximum_extensions = 4000aa9c: 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 || 4000aaa0: 80 a0 e0 00 cmp %g3, 0 4000aaa4: 02 80 00 06 be 4000aabc <_Thread_Handler_initialization+0x34><== NEVER TAKEN 4000aaa8: c4 00 60 24 ld [ %g1 + 0x24 ], %g2 4000aaac: c6 00 60 2c ld [ %g1 + 0x2c ], %g3 4000aab0: 80 a0 e0 00 cmp %g3, 0 4000aab4: 12 80 00 06 bne 4000aacc <_Thread_Handler_initialization+0x44> 4000aab8: 80 a0 a0 00 cmp %g2, 0 rtems_configuration_get_stack_free_hook() == NULL) _Internal_error_Occurred( 4000aabc: 90 10 20 00 clr %o0 4000aac0: 92 10 20 01 mov 1, %o1 4000aac4: 7f ff fa 3b call 400093b0 <_Internal_error_Occurred> 4000aac8: 94 10 20 0e mov 0xe, %o2 INTERNAL_ERROR_CORE, true, INTERNAL_ERROR_BAD_STACK_HOOK ); if ( stack_allocate_init_hook != NULL ) 4000aacc: 22 80 00 05 be,a 4000aae0 <_Thread_Handler_initialization+0x58> 4000aad0: 03 10 00 78 sethi %hi(0x4001e000), %g1 (*stack_allocate_init_hook)( rtems_configuration_get_stack_space_size() ); 4000aad4: 9f c0 80 00 call %g2 4000aad8: d0 00 60 04 ld [ %g1 + 4 ], %o0 ! 4001e004 <_API_Mutex_Information+0x30> _Thread_Dispatch_necessary = false; 4000aadc: 03 10 00 78 sethi %hi(0x4001e000), %g1 4000aae0: 82 10 61 30 or %g1, 0x130, %g1 ! 4001e130 <_Per_CPU_Information> 4000aae4: c0 28 60 0c clrb [ %g1 + 0xc ] _Thread_Executing = NULL; 4000aae8: c0 20 60 10 clr [ %g1 + 0x10 ] _Thread_Heir = NULL; 4000aaec: c0 20 60 14 clr [ %g1 + 0x14 ] #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) _Thread_Allocated_fp = NULL; #endif _Thread_Maximum_extensions = maximum_extensions; 4000aaf0: 03 10 00 77 sethi %hi(0x4001dc00), %g1 4000aaf4: f8 20 63 ac st %i4, [ %g1 + 0x3ac ] ! 4001dfac <_Thread_Maximum_extensions> _Thread_Ticks_per_timeslice = ticks_per_timeslice; 4000aaf8: 03 10 00 77 sethi %hi(0x4001dc00), %g1 4000aafc: fa 20 62 90 st %i5, [ %g1 + 0x290 ] ! 4001de90 <_Thread_Ticks_per_timeslice> #if defined(RTEMS_MULTIPROCESSING) if ( _System_state_Is_multiprocessing ) maximum_internal_threads += 1; #endif _Objects_Initialize_information( 4000ab00: 82 10 20 08 mov 8, %g1 4000ab04: 11 10 00 78 sethi %hi(0x4001e000), %o0 4000ab08: c2 23 a0 5c st %g1, [ %sp + 0x5c ] 4000ab0c: 90 12 20 20 or %o0, 0x20, %o0 4000ab10: 92 10 20 01 mov 1, %o1 4000ab14: 94 10 20 01 mov 1, %o2 4000ab18: 96 10 20 01 mov 1, %o3 4000ab1c: 98 10 21 60 mov 0x160, %o4 4000ab20: 7f ff fb b4 call 400099f0 <_Objects_Initialize_information> 4000ab24: 9a 10 20 00 clr %o5 4000ab28: 81 c7 e0 08 ret 4000ab2c: 81 e8 00 00 restore =============================================================================== 4000a8dc <_Thread_Initialize>: Thread_CPU_budget_algorithms budget_algorithm, Thread_CPU_budget_algorithm_callout budget_callout, uint32_t isr_level, Objects_Name name ) { 4000a8dc: 9d e3 bf 98 save %sp, -104, %sp 4000a8e0: c2 07 a0 6c ld [ %fp + 0x6c ], %g1 4000a8e4: f4 0f a0 5f ldub [ %fp + 0x5f ], %i2 4000a8e8: e0 00 40 00 ld [ %g1 ], %l0 /* * Zero out all the allocated memory fields */ for ( i=0 ; i <= THREAD_API_LAST ; i++ ) the_thread->API_Extensions[i] = NULL; 4000a8ec: c0 26 61 4c clr [ %i1 + 0x14c ] 4000a8f0: c0 26 61 50 clr [ %i1 + 0x150 ] extensions_area = NULL; the_thread->libc_reent = NULL; 4000a8f4: c0 26 61 48 clr [ %i1 + 0x148 ] /* * Allocate and Initialize the stack for this thread. */ #if !defined(RTEMS_SCORE_THREAD_ENABLE_USER_PROVIDED_STACK_VIA_API) actual_stack_size = _Thread_Stack_Allocate( the_thread, stack_size ); 4000a8f8: 90 10 00 19 mov %i1, %o0 4000a8fc: 40 00 01 fe call 4000b0f4 <_Thread_Stack_Allocate> 4000a900: 92 10 00 1b mov %i3, %o1 if ( !actual_stack_size || actual_stack_size < stack_size ) 4000a904: 80 a2 00 1b cmp %o0, %i3 4000a908: 0a 80 00 5c bcs 4000aa78 <_Thread_Initialize+0x19c> 4000a90c: 80 a2 20 00 cmp %o0, 0 4000a910: 22 80 00 5b be,a 4000aa7c <_Thread_Initialize+0x1a0> <== NEVER TAKEN 4000a914: b0 10 20 00 clr %i0 <== NOT EXECUTED Stack_Control *the_stack, void *starting_address, size_t size ) { the_stack->area = starting_address; 4000a918: c2 06 60 b8 ld [ %i1 + 0xb8 ], %g1 the_stack->size = size; 4000a91c: d0 26 60 b0 st %o0, [ %i1 + 0xb0 ] Stack_Control *the_stack, void *starting_address, size_t size ) { the_stack->area = starting_address; 4000a920: c2 26 60 b4 st %g1, [ %i1 + 0xb4 ] #endif /* * Allocate the extensions area for this thread */ if ( _Thread_Maximum_extensions ) { 4000a924: 03 10 00 77 sethi %hi(0x4001dc00), %g1 4000a928: d0 00 63 ac ld [ %g1 + 0x3ac ], %o0 ! 4001dfac <_Thread_Maximum_extensions> Watchdog_Service_routine_entry routine, Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; 4000a92c: c0 26 60 50 clr [ %i1 + 0x50 ] the_watchdog->routine = routine; 4000a930: c0 26 60 64 clr [ %i1 + 0x64 ] the_watchdog->id = id; 4000a934: c0 26 60 68 clr [ %i1 + 0x68 ] the_watchdog->user_data = user_data; 4000a938: c0 26 60 6c clr [ %i1 + 0x6c ] 4000a93c: 80 a2 20 00 cmp %o0, 0 4000a940: 02 80 00 08 be 4000a960 <_Thread_Initialize+0x84> 4000a944: b8 10 20 00 clr %i4 extensions_area = _Workspace_Allocate( 4000a948: 90 02 20 01 inc %o0 4000a94c: 40 00 03 9e call 4000b7c4 <_Workspace_Allocate> 4000a950: 91 2a 20 02 sll %o0, 2, %o0 (_Thread_Maximum_extensions + 1) * sizeof( void * ) ); if ( !extensions_area ) 4000a954: b8 92 20 00 orcc %o0, 0, %i4 4000a958: 02 80 00 3c be 4000aa48 <_Thread_Initialize+0x16c> 4000a95c: b6 10 20 00 clr %i3 * if they are linked to the thread. An extension user may * create the extension long after tasks have been created * so they cannot rely on the thread create user extension * call. */ if ( the_thread->extensions ) { 4000a960: 80 a7 20 00 cmp %i4, 0 4000a964: 12 80 00 17 bne 4000a9c0 <_Thread_Initialize+0xe4> 4000a968: f8 26 61 54 st %i4, [ %i1 + 0x154 ] /* * General initialization */ the_thread->Start.is_preemptible = is_preemptible; the_thread->Start.budget_algorithm = budget_algorithm; 4000a96c: c2 07 a0 60 ld [ %fp + 0x60 ], %g1 /* * General initialization */ the_thread->Start.is_preemptible = is_preemptible; 4000a970: f4 2e 60 9c stb %i2, [ %i1 + 0x9c ] the_thread->Start.budget_algorithm = budget_algorithm; 4000a974: c2 26 60 a0 st %g1, [ %i1 + 0xa0 ] the_thread->Start.budget_callout = budget_callout; 4000a978: c2 07 a0 64 ld [ %fp + 0x64 ], %g1 #endif } the_thread->Start.isr_level = isr_level; the_thread->current_state = STATES_DORMANT; 4000a97c: b4 10 20 01 mov 1, %i2 * General initialization */ the_thread->Start.is_preemptible = is_preemptible; the_thread->Start.budget_algorithm = budget_algorithm; the_thread->Start.budget_callout = budget_callout; 4000a980: c2 26 60 a4 st %g1, [ %i1 + 0xa4 ] case THREAD_CPU_BUDGET_ALGORITHM_CALLOUT: break; #endif } the_thread->Start.isr_level = isr_level; 4000a984: c2 07 a0 68 ld [ %fp + 0x68 ], %g1 the_thread->current_state = STATES_DORMANT; 4000a988: f4 26 60 10 st %i2, [ %i1 + 0x10 ] case THREAD_CPU_BUDGET_ALGORITHM_CALLOUT: break; #endif } the_thread->Start.isr_level = isr_level; 4000a98c: c2 26 60 a8 st %g1, [ %i1 + 0xa8 ] */ RTEMS_INLINE_ROUTINE void* _Scheduler_Allocate( Thread_Control *the_thread ) { return _Scheduler.Operations.allocate( the_thread ); 4000a990: 03 10 00 74 sethi %hi(0x4001d000), %g1 4000a994: c2 00 62 7c ld [ %g1 + 0x27c ], %g1 ! 4001d27c <_Scheduler+0x18> the_thread->current_state = STATES_DORMANT; the_thread->Wait.queue = NULL; 4000a998: c0 26 60 44 clr [ %i1 + 0x44 ] the_thread->resource_count = 0; 4000a99c: c0 26 60 1c clr [ %i1 + 0x1c ] the_thread->real_priority = priority; 4000a9a0: fa 26 60 18 st %i5, [ %i1 + 0x18 ] the_thread->Start.initial_priority = priority; 4000a9a4: fa 26 60 ac st %i5, [ %i1 + 0xac ] 4000a9a8: 9f c0 40 00 call %g1 4000a9ac: 90 10 00 19 mov %i1, %o0 sched =_Scheduler_Allocate( the_thread ); if ( !sched ) 4000a9b0: b6 92 20 00 orcc %o0, 0, %i3 4000a9b4: 12 80 00 0f bne 4000a9f0 <_Thread_Initialize+0x114> 4000a9b8: 90 10 00 19 mov %i1, %o0 4000a9bc: 30 80 00 23 b,a 4000aa48 <_Thread_Initialize+0x16c> * create the extension long after tasks have been created * so they cannot rely on the thread create user extension * call. */ if ( the_thread->extensions ) { for ( i = 0; i <= _Thread_Maximum_extensions ; i++ ) 4000a9c0: 03 10 00 77 sethi %hi(0x4001dc00), %g1 4000a9c4: c4 00 63 ac ld [ %g1 + 0x3ac ], %g2 ! 4001dfac <_Thread_Maximum_extensions> 4000a9c8: 10 80 00 05 b 4000a9dc <_Thread_Initialize+0x100> 4000a9cc: 82 10 20 00 clr %g1 the_thread->extensions[i] = NULL; 4000a9d0: 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++ ) 4000a9d4: 82 00 60 01 inc %g1 the_thread->extensions[i] = NULL; 4000a9d8: 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++ ) 4000a9dc: 80 a0 40 02 cmp %g1, %g2 4000a9e0: 28 bf ff fc bleu,a 4000a9d0 <_Thread_Initialize+0xf4> 4000a9e4: c8 06 61 54 ld [ %i1 + 0x154 ], %g4 /* * General initialization */ the_thread->Start.is_preemptible = is_preemptible; the_thread->Start.budget_algorithm = budget_algorithm; 4000a9e8: 10 bf ff e2 b 4000a970 <_Thread_Initialize+0x94> 4000a9ec: c2 07 a0 60 ld [ %fp + 0x60 ], %g1 the_thread->real_priority = priority; the_thread->Start.initial_priority = priority; sched =_Scheduler_Allocate( the_thread ); if ( !sched ) goto failed; _Thread_Set_priority( the_thread, priority ); 4000a9f0: 40 00 01 99 call 4000b054 <_Thread_Set_priority> 4000a9f4: 92 10 00 1d mov %i5, %o1 #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 4000a9f8: c4 06 20 1c ld [ %i0 + 0x1c ], %g2 Objects_Information *information, Objects_Control *the_object, Objects_Name name ) { _Objects_Set_local_object( 4000a9fc: c2 16 60 0a lduh [ %i1 + 0xa ], %g1 static inline void _Timestamp64_implementation_Set_to_zero( Timestamp64_Control *_time ) { *_time = 0; 4000aa00: c0 26 60 80 clr [ %i1 + 0x80 ] 4000aa04: c0 26 60 84 clr [ %i1 + 0x84 ] #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 4000aa08: 83 28 60 02 sll %g1, 2, %g1 4000aa0c: f2 20 80 01 st %i1, [ %g2 + %g1 ] information, _Objects_Get_index( the_object->id ), the_object ); the_object->name = name; 4000aa10: e0 26 60 0c st %l0, [ %i1 + 0xc ] * @{ */ static inline bool _User_extensions_Thread_create( Thread_Control *created ) { User_extensions_Thread_create_context ctx = { created, true }; 4000aa14: f2 27 bf f8 st %i1, [ %fp + -8 ] 4000aa18: f4 2f bf fc stb %i2, [ %fp + -4 ] _User_extensions_Iterate( &ctx, _User_extensions_Thread_create_visitor ); 4000aa1c: 90 07 bf f8 add %fp, -8, %o0 4000aa20: 13 10 00 2c sethi %hi(0x4000b000), %o1 4000aa24: 40 00 02 37 call 4000b300 <_User_extensions_Iterate> 4000aa28: 92 12 61 dc or %o1, 0x1dc, %o1 ! 4000b1dc <_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 ) 4000aa2c: c2 0f bf fc ldub [ %fp + -4 ], %g1 4000aa30: 80 a0 60 00 cmp %g1, 0 4000aa34: 02 80 00 05 be 4000aa48 <_Thread_Initialize+0x16c> 4000aa38: b0 10 20 01 mov 1, %i0 4000aa3c: b0 0e 20 01 and %i0, 1, %i0 4000aa40: 81 c7 e0 08 ret 4000aa44: 81 e8 00 00 restore return true; failed: _Workspace_Free( the_thread->libc_reent ); 4000aa48: 40 00 03 67 call 4000b7e4 <_Workspace_Free> 4000aa4c: d0 06 61 48 ld [ %i1 + 0x148 ], %o0 for ( i=0 ; i <= THREAD_API_LAST ; i++ ) _Workspace_Free( the_thread->API_Extensions[i] ); 4000aa50: 40 00 03 65 call 4000b7e4 <_Workspace_Free> 4000aa54: d0 06 61 4c ld [ %i1 + 0x14c ], %o0 4000aa58: 40 00 03 63 call 4000b7e4 <_Workspace_Free> 4000aa5c: d0 06 61 50 ld [ %i1 + 0x150 ], %o0 _Workspace_Free( extensions_area ); 4000aa60: 40 00 03 61 call 4000b7e4 <_Workspace_Free> 4000aa64: 90 10 00 1c mov %i4, %o0 #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) _Workspace_Free( fp_area ); #endif _Workspace_Free( sched ); 4000aa68: 40 00 03 5f call 4000b7e4 <_Workspace_Free> 4000aa6c: 90 10 00 1b mov %i3, %o0 _Thread_Stack_Free( the_thread ); 4000aa70: 40 00 01 b1 call 4000b134 <_Thread_Stack_Free> 4000aa74: 90 10 00 19 mov %i1, %o0 * Allocate and Initialize the stack for this thread. */ #if !defined(RTEMS_SCORE_THREAD_ENABLE_USER_PROVIDED_STACK_VIA_API) actual_stack_size = _Thread_Stack_Allocate( the_thread, stack_size ); if ( !actual_stack_size || actual_stack_size < stack_size ) return false; /* stack allocation failed */ 4000aa78: b0 10 20 00 clr %i0 _Workspace_Free( sched ); _Thread_Stack_Free( the_thread ); return false; } 4000aa7c: b0 0e 20 01 and %i0, 1, %i0 4000aa80: 81 c7 e0 08 ret 4000aa84: 81 e8 00 00 restore =============================================================================== 4000ec48 <_Thread_queue_Extract_fifo>: void _Thread_queue_Extract_fifo( Thread_queue_Control *the_thread_queue __attribute__((unused)), Thread_Control *the_thread ) { 4000ec48: 9d e3 bf a0 save %sp, -96, %sp <== NOT EXECUTED ISR_Level level; _ISR_Disable( level ); 4000ec4c: 7f ff cd ff call 40002448 <== NOT EXECUTED 4000ec50: 01 00 00 00 nop <== NOT EXECUTED 4000ec54: b0 10 00 08 mov %o0, %i0 <== NOT EXECUTED 4000ec58: c4 06 60 10 ld [ %i1 + 0x10 ], %g2 <== NOT EXECUTED if ( !_States_Is_waiting_on_thread_queue( the_thread->current_state ) ) { 4000ec5c: 03 00 00 ef sethi %hi(0x3bc00), %g1 <== NOT EXECUTED 4000ec60: 82 10 62 e0 or %g1, 0x2e0, %g1 ! 3bee0 <== NOT EXECUTED 4000ec64: 80 88 80 01 btst %g2, %g1 <== NOT EXECUTED 4000ec68: 32 80 00 04 bne,a 4000ec78 <_Thread_queue_Extract_fifo+0x30><== NOT EXECUTED 4000ec6c: c2 06 60 04 ld [ %i1 + 4 ], %g1 <== NOT EXECUTED _ISR_Enable( level ); 4000ec70: 7f ff cd fa call 40002458 <== NOT EXECUTED 4000ec74: 81 e8 00 00 restore <== NOT EXECUTED ) { Chain_Node *next; Chain_Node *previous; next = the_node->next; 4000ec78: c4 06 40 00 ld [ %i1 ], %g2 <== NOT EXECUTED previous = the_node->previous; next->previous = previous; 4000ec7c: c2 20 a0 04 st %g1, [ %g2 + 4 ] <== NOT EXECUTED previous->next = next; 4000ec80: c4 20 40 00 st %g2, [ %g1 ] <== NOT EXECUTED _Chain_Extract_unprotected( &the_thread->Object.Node ); the_thread->Wait.queue = NULL; if ( !_Watchdog_Is_active( &the_thread->Timer ) ) { 4000ec84: c2 06 60 50 ld [ %i1 + 0x50 ], %g1 <== NOT EXECUTED 4000ec88: 80 a0 60 02 cmp %g1, 2 <== NOT EXECUTED 4000ec8c: 02 80 00 06 be 4000eca4 <_Thread_queue_Extract_fifo+0x5c> <== NOT EXECUTED 4000ec90: c0 26 60 44 clr [ %i1 + 0x44 ] <== NOT EXECUTED _ISR_Enable( level ); 4000ec94: 7f ff cd f1 call 40002458 <== NOT EXECUTED 4000ec98: b0 10 00 19 mov %i1, %i0 <== NOT EXECUTED 4000ec9c: 10 80 00 09 b 4000ecc0 <_Thread_queue_Extract_fifo+0x78> <== NOT EXECUTED 4000eca0: 33 04 01 ff sethi %hi(0x1007fc00), %i1 <== NOT EXECUTED 4000eca4: 82 10 20 03 mov 3, %g1 <== NOT EXECUTED 4000eca8: c2 26 60 50 st %g1, [ %i1 + 0x50 ] <== NOT EXECUTED } else { _Watchdog_Deactivate( &the_thread->Timer ); _ISR_Enable( level ); 4000ecac: 7f ff cd eb call 40002458 <== NOT EXECUTED 4000ecb0: b0 10 00 19 mov %i1, %i0 <== NOT EXECUTED (void) _Watchdog_Remove( &the_thread->Timer ); 4000ecb4: 7f ff f2 2b call 4000b560 <_Watchdog_Remove> <== NOT EXECUTED 4000ecb8: 90 06 60 48 add %i1, 0x48, %o0 <== NOT EXECUTED 4000ecbc: 33 04 01 ff sethi %hi(0x1007fc00), %i1 <== NOT EXECUTED 4000ecc0: b2 16 63 f8 or %i1, 0x3f8, %i1 ! 1007fff8 <== NOT EXECUTED 4000ecc4: 7f ff ed f8 call 4000a4a4 <_Thread_Clear_state> <== NOT EXECUTED 4000ecc8: 81 e8 00 00 restore <== NOT EXECUTED =============================================================================== 4000afa0 <_Thread_queue_Requeue>: void _Thread_queue_Requeue( Thread_queue_Control *the_thread_queue, Thread_Control *the_thread ) { 4000afa0: 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 ) 4000afa4: 80 a6 20 00 cmp %i0, 0 4000afa8: 02 80 00 19 be 4000b00c <_Thread_queue_Requeue+0x6c> <== NEVER TAKEN 4000afac: 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 ) { 4000afb0: fa 06 20 34 ld [ %i0 + 0x34 ], %i5 4000afb4: 80 a7 60 01 cmp %i5, 1 4000afb8: 12 80 00 15 bne 4000b00c <_Thread_queue_Requeue+0x6c> <== NEVER TAKEN 4000afbc: 01 00 00 00 nop Thread_queue_Control *tq = the_thread_queue; ISR_Level level; ISR_Level level_ignored; _ISR_Disable( level ); 4000afc0: 7f ff dd 22 call 40002448 4000afc4: 01 00 00 00 nop 4000afc8: b8 10 00 08 mov %o0, %i4 4000afcc: c4 06 60 10 ld [ %i1 + 0x10 ], %g2 if ( _States_Is_waiting_on_thread_queue( the_thread->current_state ) ) { 4000afd0: 03 00 00 ef sethi %hi(0x3bc00), %g1 4000afd4: 82 10 62 e0 or %g1, 0x2e0, %g1 ! 3bee0 4000afd8: 80 88 80 01 btst %g2, %g1 4000afdc: 02 80 00 0a be 4000b004 <_Thread_queue_Requeue+0x64> <== NEVER TAKEN 4000afe0: 90 10 00 18 mov %i0, %o0 _Thread_queue_Enter_critical_section( tq ); _Thread_queue_Extract_priority_helper( tq, the_thread, true ); 4000afe4: 92 10 00 19 mov %i1, %o1 4000afe8: 94 10 20 01 mov 1, %o2 4000afec: 40 00 09 e4 call 4000d77c <_Thread_queue_Extract_priority_helper> 4000aff0: fa 26 20 30 st %i5, [ %i0 + 0x30 ] (void) _Thread_queue_Enqueue_priority( tq, the_thread, &level_ignored ); 4000aff4: 90 10 00 18 mov %i0, %o0 4000aff8: 92 10 00 19 mov %i1, %o1 4000affc: 7f ff ff 50 call 4000ad3c <_Thread_queue_Enqueue_priority> 4000b000: 94 07 bf fc add %fp, -4, %o2 } _ISR_Enable( level ); 4000b004: 7f ff dd 15 call 40002458 4000b008: 90 10 00 1c mov %i4, %o0 4000b00c: 81 c7 e0 08 ret 4000b010: 81 e8 00 00 restore =============================================================================== 4000b014 <_Thread_queue_Timeout>: void _Thread_queue_Timeout( Objects_Id id, void *ignored __attribute__((unused)) ) { 4000b014: 9d e3 bf 98 save %sp, -104, %sp Thread_Control *the_thread; Objects_Locations location; the_thread = _Thread_Get( id, &location ); 4000b018: 90 10 00 18 mov %i0, %o0 4000b01c: 7f ff fe 04 call 4000a82c <_Thread_Get> 4000b020: 92 07 bf fc add %fp, -4, %o1 switch ( location ) { 4000b024: c2 07 bf fc ld [ %fp + -4 ], %g1 4000b028: 80 a0 60 00 cmp %g1, 0 4000b02c: 12 80 00 08 bne 4000b04c <_Thread_queue_Timeout+0x38> <== NEVER TAKEN 4000b030: 01 00 00 00 nop #if defined(RTEMS_MULTIPROCESSING) case OBJECTS_REMOTE: /* impossible */ #endif break; case OBJECTS_LOCAL: _Thread_queue_Process_timeout( the_thread ); 4000b034: 40 00 0a 09 call 4000d858 <_Thread_queue_Process_timeout> 4000b038: 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; 4000b03c: 03 10 00 77 sethi %hi(0x4001dc00), %g1 4000b040: c4 00 63 30 ld [ %g1 + 0x330 ], %g2 ! 4001df30 <_Thread_Dispatch_disable_level> --level; 4000b044: 84 00 bf ff add %g2, -1, %g2 _Thread_Dispatch_disable_level = level; 4000b048: c4 20 63 30 st %g2, [ %g1 + 0x330 ] 4000b04c: 81 c7 e0 08 ret 4000b050: 81 e8 00 00 restore =============================================================================== 40019300 <_Timer_server_Body>: * @a arg points to the corresponding timer server control block. */ static rtems_task _Timer_server_Body( rtems_task_argument arg ) { 40019300: 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; 40019304: 27 10 00 f4 sethi %hi(0x4003d000), %l3 ) { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); head->next = tail; 40019308: a4 07 bf e8 add %fp, -24, %l2 4001930c: aa 07 bf ec add %fp, -20, %l5 40019310: b8 07 bf f4 add %fp, -12, %i4 40019314: b2 07 bf f8 add %fp, -8, %i1 40019318: ea 27 bf e8 st %l5, [ %fp + -24 ] head->previous = NULL; 4001931c: c0 27 bf ec clr [ %fp + -20 ] tail->previous = head; 40019320: 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; 40019324: f2 27 bf f4 st %i1, [ %fp + -12 ] head->previous = NULL; 40019328: c0 27 bf f8 clr [ %fp + -8 ] tail->previous = head; 4001932c: 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 ); 40019330: 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(); 40019334: 29 10 00 f4 sethi %hi(0x4003d000), %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 ); 40019338: 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 ); 4001933c: 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 ); 40019340: 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; 40019344: 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; 40019348: c2 04 e2 18 ld [ %l3 + 0x218 ], %g1 /* * We assume adequate unsigned arithmetic here. */ Watchdog_Interval delta = snapshot - watchdogs->last_snapshot; 4001934c: d2 06 20 3c ld [ %i0 + 0x3c ], %o1 watchdogs->last_snapshot = snapshot; _Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain ); 40019350: 90 10 00 1a mov %i2, %o0 40019354: 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; 40019358: c2 26 20 3c st %g1, [ %i0 + 0x3c ] _Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain ); 4001935c: 40 00 11 18 call 4001d7bc <_Watchdog_Adjust_to_chain> 40019360: 94 10 00 1c mov %i4, %o2 40019364: d0 1d 20 78 ldd [ %l4 + 0x78 ], %o0 40019368: 94 10 20 00 clr %o2 4001936c: 17 0e e6 b2 sethi %hi(0x3b9ac800), %o3 40019370: 40 00 4b b1 call 4002c234 <__divdi3> 40019374: 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; 40019378: 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 ) { 4001937c: 80 a2 40 0a cmp %o1, %o2 40019380: 08 80 00 07 bleu 4001939c <_Timer_server_Body+0x9c> 40019384: 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 ); 40019388: 92 22 40 0a sub %o1, %o2, %o1 4001938c: 90 10 00 1b mov %i3, %o0 40019390: 40 00 11 0b call 4001d7bc <_Watchdog_Adjust_to_chain> 40019394: 94 10 00 1c mov %i4, %o2 40019398: 30 80 00 06 b,a 400193b0 <_Timer_server_Body+0xb0> } else if ( snapshot < last_snapshot ) { 4001939c: 1a 80 00 05 bcc 400193b0 <_Timer_server_Body+0xb0> 400193a0: 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 ); 400193a4: 92 10 20 01 mov 1, %o1 400193a8: 40 00 10 dd call 4001d71c <_Watchdog_Adjust> 400193ac: 94 22 80 1d sub %o2, %i5, %o2 } watchdogs->last_snapshot = snapshot; 400193b0: 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 ); 400193b4: d0 06 20 78 ld [ %i0 + 0x78 ], %o0 400193b8: 40 00 02 d8 call 40019f18 <_Chain_Get> 400193bc: 01 00 00 00 nop if ( timer == NULL ) { 400193c0: 92 92 20 00 orcc %o0, 0, %o1 400193c4: 02 80 00 0c be 400193f4 <_Timer_server_Body+0xf4> 400193c8: 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 ) { 400193cc: c2 02 60 38 ld [ %o1 + 0x38 ], %g1 400193d0: 80 a0 60 01 cmp %g1, 1 400193d4: 02 80 00 05 be 400193e8 <_Timer_server_Body+0xe8> 400193d8: 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 ) { 400193dc: 80 a0 60 03 cmp %g1, 3 400193e0: 12 bf ff f5 bne 400193b4 <_Timer_server_Body+0xb4> <== NEVER TAKEN 400193e4: 90 10 00 1b mov %i3, %o0 _Watchdog_Insert( &ts->TOD_watchdogs.Chain, &timer->Ticker ); 400193e8: 40 00 11 1f call 4001d864 <_Watchdog_Insert> 400193ec: 92 02 60 10 add %o1, 0x10, %o1 400193f0: 30 bf ff f1 b,a 400193b4 <_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 ); 400193f4: 7f ff dc 70 call 400105b4 400193f8: 01 00 00 00 nop if ( _Chain_Is_empty( insert_chain ) ) { 400193fc: c2 07 bf e8 ld [ %fp + -24 ], %g1 40019400: 80 a0 40 15 cmp %g1, %l5 40019404: 12 80 00 0a bne 4001942c <_Timer_server_Body+0x12c> <== NEVER TAKEN 40019408: 01 00 00 00 nop ts->insert_chain = NULL; 4001940c: c0 26 20 78 clr [ %i0 + 0x78 ] _ISR_Enable( level ); 40019410: 7f ff dc 6d call 400105c4 40019414: 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 ) ) { 40019418: c2 07 bf f4 ld [ %fp + -12 ], %g1 4001941c: 80 a0 40 19 cmp %g1, %i1 40019420: 12 80 00 06 bne 40019438 <_Timer_server_Body+0x138> 40019424: 01 00 00 00 nop 40019428: 30 80 00 18 b,a 40019488 <_Timer_server_Body+0x188> ts->insert_chain = NULL; _ISR_Enable( level ); break; } else { _ISR_Enable( level ); 4001942c: 7f ff dc 66 call 400105c4 <== NOT EXECUTED 40019430: 01 00 00 00 nop <== NOT EXECUTED 40019434: 30 bf ff c5 b,a 40019348 <_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 ); 40019438: 7f ff dc 5f call 400105b4 4001943c: 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; 40019440: 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)) 40019444: 80 a7 40 19 cmp %i5, %i1 40019448: 02 80 00 0d be 4001947c <_Timer_server_Body+0x17c> 4001944c: 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; 40019450: c2 07 40 00 ld [ %i5 ], %g1 head->next = new_first; new_first->previous = head; 40019454: 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; 40019458: c2 27 bf f4 st %g1, [ %fp + -12 ] watchdog = (Watchdog_Control *) _Chain_Get_unprotected( &fire_chain ); if ( watchdog != NULL ) { watchdog->state = WATCHDOG_INACTIVE; 4001945c: c0 27 60 08 clr [ %i5 + 8 ] _ISR_Enable( level ); 40019460: 7f ff dc 59 call 400105c4 40019464: 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 ); 40019468: c2 07 60 1c ld [ %i5 + 0x1c ], %g1 4001946c: d0 07 60 20 ld [ %i5 + 0x20 ], %o0 40019470: 9f c0 40 00 call %g1 40019474: d2 07 60 24 ld [ %i5 + 0x24 ], %o1 } 40019478: 30 bf ff f0 b,a 40019438 <_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 ); 4001947c: 7f ff dc 52 call 400105c4 40019480: 01 00 00 00 nop 40019484: 30 bf ff b0 b,a 40019344 <_Timer_server_Body+0x44> * the active flag of the timer server is true. */ (*watchdog->routine)( watchdog->id, watchdog->user_data ); } } else { ts->active = false; 40019488: 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; 4001948c: 03 10 00 f4 sethi %hi(0x4003d000), %g1 40019490: c4 00 61 30 ld [ %g1 + 0x130 ], %g2 ! 4003d130 <_Thread_Dispatch_disable_level> ++level; 40019494: 84 00 a0 01 inc %g2 _Thread_Dispatch_disable_level = level; 40019498: c4 20 61 30 st %g2, [ %g1 + 0x130 ] /* * Block until there is something to do. */ _Thread_Disable_dispatch(); _Thread_Set_state( ts->thread, STATES_DELAYING ); 4001949c: d0 06 00 00 ld [ %i0 ], %o0 400194a0: 40 00 0f bc call 4001d390 <_Thread_Set_state> 400194a4: 92 10 20 08 mov 8, %o1 _Timer_server_Reset_interval_system_watchdog( ts ); 400194a8: 7f ff ff 6e call 40019260 <_Timer_server_Reset_interval_system_watchdog> 400194ac: 90 10 00 18 mov %i0, %o0 _Timer_server_Reset_tod_system_watchdog( ts ); 400194b0: 7f ff ff 80 call 400192b0 <_Timer_server_Reset_tod_system_watchdog> 400194b4: 90 10 00 18 mov %i0, %o0 _Thread_Enable_dispatch(); 400194b8: 40 00 0d 7b call 4001caa4 <_Thread_Enable_dispatch> 400194bc: 01 00 00 00 nop ts->active = true; 400194c0: 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 ); 400194c4: 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; 400194c8: 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 ); 400194cc: 40 00 11 3e call 4001d9c4 <_Watchdog_Remove> 400194d0: 01 00 00 00 nop static void _Timer_server_Stop_tod_system_watchdog( Timer_server_Control *ts ) { _Watchdog_Remove( &ts->TOD_watchdogs.System_watchdog ); 400194d4: 40 00 11 3c call 4001d9c4 <_Watchdog_Remove> 400194d8: 90 10 00 10 mov %l0, %o0 400194dc: 30 bf ff 9a b,a 40019344 <_Timer_server_Body+0x44> =============================================================================== 400194e0 <_Timer_server_Schedule_operation_method>: static void _Timer_server_Schedule_operation_method( Timer_server_Control *ts, Timer_Control *timer ) { 400194e0: 9d e3 bf a0 save %sp, -96, %sp if ( ts->insert_chain == NULL ) { 400194e4: c2 06 20 78 ld [ %i0 + 0x78 ], %g1 400194e8: 80 a0 60 00 cmp %g1, 0 400194ec: 12 80 00 51 bne 40019630 <_Timer_server_Schedule_operation_method+0x150> 400194f0: 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; 400194f4: 03 10 00 f4 sethi %hi(0x4003d000), %g1 400194f8: c4 00 61 30 ld [ %g1 + 0x130 ], %g2 ! 4003d130 <_Thread_Dispatch_disable_level> ++level; 400194fc: 84 00 a0 01 inc %g2 _Thread_Dispatch_disable_level = level; 40019500: c4 20 61 30 st %g2, [ %g1 + 0x130 ] * being inserted. This could result in an integer overflow. */ _Thread_Disable_dispatch(); if ( timer->the_class == TIMER_INTERVAL_ON_TASK ) { 40019504: c2 06 60 38 ld [ %i1 + 0x38 ], %g1 40019508: 80 a0 60 01 cmp %g1, 1 4001950c: 12 80 00 1f bne 40019588 <_Timer_server_Schedule_operation_method+0xa8> 40019510: 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 ); 40019514: 7f ff dc 28 call 400105b4 40019518: 01 00 00 00 nop snapshot = _Watchdog_Ticks_since_boot; 4001951c: 03 10 00 f4 sethi %hi(0x4003d000), %g1 40019520: c4 00 62 18 ld [ %g1 + 0x218 ], %g2 ! 4003d218 <_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; 40019524: c2 06 20 30 ld [ %i0 + 0x30 ], %g1 last_snapshot = ts->Interval_watchdogs.last_snapshot; 40019528: 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 ); 4001952c: 86 06 20 34 add %i0, 0x34, %g3 if ( !_Chain_Is_empty( &ts->Interval_watchdogs.Chain ) ) { 40019530: 80 a0 40 03 cmp %g1, %g3 40019534: 02 80 00 08 be 40019554 <_Timer_server_Schedule_operation_method+0x74> 40019538: 88 20 80 04 sub %g2, %g4, %g4 /* * We assume adequate unsigned arithmetic here. */ delta = snapshot - last_snapshot; delta_interval = first_watchdog->delta_interval; 4001953c: f8 00 60 10 ld [ %g1 + 0x10 ], %i4 if (delta_interval > delta) { 40019540: 80 a7 00 04 cmp %i4, %g4 40019544: 08 80 00 03 bleu 40019550 <_Timer_server_Schedule_operation_method+0x70> 40019548: 86 10 20 00 clr %g3 delta_interval -= delta; 4001954c: 86 27 00 04 sub %i4, %g4, %g3 } else { delta_interval = 0; } first_watchdog->delta_interval = delta_interval; 40019550: c6 20 60 10 st %g3, [ %g1 + 0x10 ] } ts->Interval_watchdogs.last_snapshot = snapshot; 40019554: c4 26 20 3c st %g2, [ %i0 + 0x3c ] _ISR_Enable( level ); 40019558: 7f ff dc 1b call 400105c4 4001955c: 01 00 00 00 nop _Watchdog_Insert( &ts->Interval_watchdogs.Chain, &timer->Ticker ); 40019560: 90 06 20 30 add %i0, 0x30, %o0 40019564: 40 00 10 c0 call 4001d864 <_Watchdog_Insert> 40019568: 92 07 60 10 add %i5, 0x10, %o1 if ( !ts->active ) { 4001956c: c2 0e 20 7c ldub [ %i0 + 0x7c ], %g1 40019570: 80 a0 60 00 cmp %g1, 0 40019574: 12 80 00 2d bne 40019628 <_Timer_server_Schedule_operation_method+0x148> 40019578: 01 00 00 00 nop _Timer_server_Reset_interval_system_watchdog( ts ); 4001957c: 7f ff ff 39 call 40019260 <_Timer_server_Reset_interval_system_watchdog> 40019580: 90 10 00 18 mov %i0, %o0 40019584: 30 80 00 29 b,a 40019628 <_Timer_server_Schedule_operation_method+0x148> } } else if ( timer->the_class == TIMER_TIME_OF_DAY_ON_TASK ) { 40019588: 12 80 00 28 bne 40019628 <_Timer_server_Schedule_operation_method+0x148> 4001958c: 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 ); 40019590: 7f ff dc 09 call 400105b4 40019594: 01 00 00 00 nop 40019598: b8 10 00 08 mov %o0, %i4 4001959c: 03 10 00 f4 sethi %hi(0x4003d000), %g1 400195a0: d0 18 60 78 ldd [ %g1 + 0x78 ], %o0 ! 4003d078 <_TOD> 400195a4: 94 10 20 00 clr %o2 400195a8: 17 0e e6 b2 sethi %hi(0x3b9ac800), %o3 400195ac: 40 00 4b 22 call 4002c234 <__divdi3> 400195b0: 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; 400195b4: c2 06 20 68 ld [ %i0 + 0x68 ], %g1 snapshot = (Watchdog_Interval) _TOD_Seconds_since_epoch(); last_snapshot = ts->TOD_watchdogs.last_snapshot; 400195b8: 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 ); 400195bc: 86 06 20 6c add %i0, 0x6c, %g3 if ( !_Chain_Is_empty( &ts->TOD_watchdogs.Chain ) ) { 400195c0: 80 a0 40 03 cmp %g1, %g3 400195c4: 02 80 00 0d be 400195f8 <_Timer_server_Schedule_operation_method+0x118> 400195c8: 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 ) { 400195cc: 08 80 00 08 bleu 400195ec <_Timer_server_Schedule_operation_method+0x10c> 400195d0: c6 00 60 10 ld [ %g1 + 0x10 ], %g3 /* * We advanced in time. */ delta = snapshot - last_snapshot; 400195d4: 88 22 40 02 sub %o1, %g2, %g4 if (delta_interval > delta) { 400195d8: 80 a0 c0 04 cmp %g3, %g4 400195dc: 08 80 00 06 bleu 400195f4 <_Timer_server_Schedule_operation_method+0x114><== NEVER TAKEN 400195e0: 84 10 20 00 clr %g2 delta_interval -= delta; 400195e4: 10 80 00 04 b 400195f4 <_Timer_server_Schedule_operation_method+0x114> 400195e8: 84 20 c0 04 sub %g3, %g4, %g2 } } else { /* * Someone put us in the past. */ delta = last_snapshot - snapshot; 400195ec: 84 00 c0 02 add %g3, %g2, %g2 delta_interval += delta; 400195f0: 84 20 80 09 sub %g2, %o1, %g2 } first_watchdog->delta_interval = delta_interval; 400195f4: c4 20 60 10 st %g2, [ %g1 + 0x10 ] } ts->TOD_watchdogs.last_snapshot = snapshot; 400195f8: d2 26 20 74 st %o1, [ %i0 + 0x74 ] _ISR_Enable( level ); 400195fc: 7f ff db f2 call 400105c4 40019600: 90 10 00 1c mov %i4, %o0 _Watchdog_Insert( &ts->TOD_watchdogs.Chain, &timer->Ticker ); 40019604: 90 06 20 68 add %i0, 0x68, %o0 40019608: 40 00 10 97 call 4001d864 <_Watchdog_Insert> 4001960c: 92 07 60 10 add %i5, 0x10, %o1 if ( !ts->active ) { 40019610: c2 0e 20 7c ldub [ %i0 + 0x7c ], %g1 40019614: 80 a0 60 00 cmp %g1, 0 40019618: 12 80 00 04 bne 40019628 <_Timer_server_Schedule_operation_method+0x148> 4001961c: 01 00 00 00 nop _Timer_server_Reset_tod_system_watchdog( ts ); 40019620: 7f ff ff 24 call 400192b0 <_Timer_server_Reset_tod_system_watchdog> 40019624: 90 10 00 18 mov %i0, %o0 } } _Thread_Enable_dispatch(); 40019628: 40 00 0d 1f call 4001caa4 <_Thread_Enable_dispatch> 4001962c: 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 ); 40019630: f0 06 20 78 ld [ %i0 + 0x78 ], %i0 40019634: 40 00 02 2d call 40019ee8 <_Chain_Append> 40019638: 81 e8 00 00 restore =============================================================================== 4000cad0 <_Timestamp64_Divide>: const Timestamp64_Control *_lhs, const Timestamp64_Control *_rhs, uint32_t *_ival_percentage, uint32_t *_fval_percentage ) { 4000cad0: 9d e3 bf a0 save %sp, -96, %sp Timestamp64_Control answer; if ( *_rhs == 0 ) { 4000cad4: d4 1e 40 00 ldd [ %i1 ], %o2 4000cad8: 80 92 80 0b orcc %o2, %o3, %g0 4000cadc: 32 80 00 06 bne,a 4000caf4 <_Timestamp64_Divide+0x24> <== ALWAYS TAKEN 4000cae0: d8 1e 00 00 ldd [ %i0 ], %o4 *_ival_percentage = 0; 4000cae4: c0 26 80 00 clr [ %i2 ] <== NOT EXECUTED *_fval_percentage = 0; 4000cae8: c0 26 c0 00 clr [ %i3 ] <== NOT EXECUTED return; 4000caec: 81 c7 e0 08 ret <== NOT EXECUTED 4000caf0: 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; 4000caf4: 83 2b 20 02 sll %o4, 2, %g1 4000caf8: 87 2b 60 02 sll %o5, 2, %g3 4000cafc: 89 33 60 1e srl %o5, 0x1e, %g4 4000cb00: bb 28 e0 05 sll %g3, 5, %i5 4000cb04: 84 11 00 01 or %g4, %g1, %g2 4000cb08: 83 30 e0 1b srl %g3, 0x1b, %g1 4000cb0c: b9 28 a0 05 sll %g2, 5, %i4 4000cb10: 86 a7 40 03 subcc %i5, %g3, %g3 4000cb14: b8 10 40 1c or %g1, %i4, %i4 4000cb18: 84 67 00 02 subx %i4, %g2, %g2 4000cb1c: b2 80 c0 0d addcc %g3, %o5, %i1 4000cb20: b0 40 80 0c addx %g2, %o4, %i0 4000cb24: 83 36 60 1e srl %i1, 0x1e, %g1 4000cb28: 87 2e 60 02 sll %i1, 2, %g3 4000cb2c: 85 2e 20 02 sll %i0, 2, %g2 4000cb30: 84 10 40 02 or %g1, %g2, %g2 4000cb34: ba 86 40 03 addcc %i1, %g3, %i5 4000cb38: b8 46 00 02 addx %i0, %g2, %i4 4000cb3c: 83 37 60 1e srl %i5, 0x1e, %g1 4000cb40: 87 2f 60 02 sll %i5, 2, %g3 4000cb44: 85 2f 20 02 sll %i4, 2, %g2 4000cb48: 84 10 40 02 or %g1, %g2, %g2 4000cb4c: 92 87 40 03 addcc %i5, %g3, %o1 4000cb50: 90 47 00 02 addx %i4, %g2, %o0 4000cb54: 87 32 60 1b srl %o1, 0x1b, %g3 4000cb58: 85 2a 20 05 sll %o0, 5, %g2 4000cb5c: 83 2a 60 05 sll %o1, 5, %g1 4000cb60: 90 10 c0 02 or %g3, %g2, %o0 4000cb64: 40 00 36 b3 call 4001a630 <__divdi3> 4000cb68: 92 10 00 01 mov %g1, %o1 *_ival_percentage = answer / 1000; 4000cb6c: 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; 4000cb70: b8 10 00 08 mov %o0, %i4 4000cb74: ba 10 00 09 mov %o1, %i5 *_ival_percentage = answer / 1000; 4000cb78: 40 00 36 ae call 4001a630 <__divdi3> 4000cb7c: 96 10 23 e8 mov 0x3e8, %o3 *_fval_percentage = answer % 1000; 4000cb80: 90 10 00 1c mov %i4, %o0 * TODO: Rounding on the last digit of the fval. */ answer = (*_lhs * 100000) / *_rhs; *_ival_percentage = answer / 1000; 4000cb84: d2 26 80 00 st %o1, [ %i2 ] *_fval_percentage = answer % 1000; 4000cb88: 94 10 20 00 clr %o2 4000cb8c: 92 10 00 1d mov %i5, %o1 4000cb90: 40 00 37 93 call 4001a9dc <__moddi3> 4000cb94: 96 10 23 e8 mov 0x3e8, %o3 4000cb98: d2 26 c0 00 st %o1, [ %i3 ] 4000cb9c: 81 c7 e0 08 ret 4000cba0: 81 e8 00 00 restore =============================================================================== 4000b3c0 <_User_extensions_Handler_initialization>: } } void _User_extensions_Handler_initialization(void) { 4000b3c0: 9d e3 bf 98 save %sp, -104, %sp uint32_t number_of_initial_extensions = 4000b3c4: 03 10 00 6d sethi %hi(0x4001b400), %g1 4000b3c8: c2 00 61 08 ld [ %g1 + 0x108 ], %g1 ! 4001b508 rtems_configuration_get_number_of_initial_extensions(); if ( number_of_initial_extensions > 0 ) { 4000b3cc: 80 a0 60 00 cmp %g1, 0 4000b3d0: 02 80 00 0a be 4000b3f8 <_User_extensions_Handler_initialization+0x38><== NEVER TAKEN 4000b3d4: 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 ) 4000b3d8: 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 = 4000b3dc: 40 00 01 08 call 4000b7fc <_Workspace_Allocate_or_fatal_error> 4000b3e0: 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 ); 4000b3e4: 13 10 00 2c sethi %hi(0x4000b000), %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 }; 4000b3e8: d0 27 bf fc st %o0, [ %fp + -4 ] _User_extensions_Iterate( &ctx, _User_extensions_Switch_visitor ); 4000b3ec: 92 12 63 7c or %o1, 0x37c, %o1 4000b3f0: 7f ff ff c4 call 4000b300 <_User_extensions_Iterate> 4000b3f4: 90 07 bf fc add %fp, -4, %o0 4000b3f8: 81 c7 e0 08 ret 4000b3fc: 81 e8 00 00 restore =============================================================================== 4000ce08 <_Watchdog_Adjust>: void _Watchdog_Adjust( Chain_Control *header, Watchdog_Adjust_directions direction, Watchdog_Interval units ) { 4000ce08: 9d e3 bf a0 save %sp, -96, %sp ISR_Level level; _ISR_Disable( level ); 4000ce0c: 7f ff d9 21 call 40003290 4000ce10: 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; 4000ce14: 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 ); 4000ce18: 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 ) ) { 4000ce1c: 80 a0 40 1c cmp %g1, %i4 4000ce20: 02 80 00 20 be 4000cea0 <_Watchdog_Adjust+0x98> 4000ce24: 80 a6 60 00 cmp %i1, 0 switch ( direction ) { 4000ce28: 02 80 00 1b be 4000ce94 <_Watchdog_Adjust+0x8c> 4000ce2c: b6 10 20 01 mov 1, %i3 4000ce30: 80 a6 60 01 cmp %i1, 1 4000ce34: 12 80 00 1b bne 4000cea0 <_Watchdog_Adjust+0x98> <== NEVER TAKEN 4000ce38: 01 00 00 00 nop case WATCHDOG_BACKWARD: _Watchdog_First( header )->delta_interval += units; 4000ce3c: c4 00 60 10 ld [ %g1 + 0x10 ], %g2 4000ce40: 10 80 00 07 b 4000ce5c <_Watchdog_Adjust+0x54> 4000ce44: b4 00 80 1a add %g2, %i2, %i2 break; case WATCHDOG_FORWARD: while ( units ) { if ( units < _Watchdog_First( header )->delta_interval ) { 4000ce48: c4 00 60 10 ld [ %g1 + 0x10 ], %g2 4000ce4c: 80 a6 80 02 cmp %i2, %g2 4000ce50: 3a 80 00 05 bcc,a 4000ce64 <_Watchdog_Adjust+0x5c> 4000ce54: f6 20 60 10 st %i3, [ %g1 + 0x10 ] _Watchdog_First( header )->delta_interval -= units; 4000ce58: b4 20 80 1a sub %g2, %i2, %i2 break; 4000ce5c: 10 80 00 11 b 4000cea0 <_Watchdog_Adjust+0x98> 4000ce60: f4 20 60 10 st %i2, [ %g1 + 0x10 ] } else { units -= _Watchdog_First( header )->delta_interval; 4000ce64: b4 26 80 02 sub %i2, %g2, %i2 _Watchdog_First( header )->delta_interval = 1; _ISR_Enable( level ); 4000ce68: 7f ff d9 0e call 400032a0 4000ce6c: 01 00 00 00 nop _Watchdog_Tickle( header ); 4000ce70: 40 00 00 90 call 4000d0b0 <_Watchdog_Tickle> 4000ce74: 90 10 00 18 mov %i0, %o0 _ISR_Disable( level ); 4000ce78: 7f ff d9 06 call 40003290 4000ce7c: 01 00 00 00 nop if ( _Chain_Is_empty( header ) ) 4000ce80: c2 06 00 00 ld [ %i0 ], %g1 4000ce84: 80 a0 40 1c cmp %g1, %i4 4000ce88: 12 80 00 04 bne 4000ce98 <_Watchdog_Adjust+0x90> 4000ce8c: 80 a6 a0 00 cmp %i2, 0 4000ce90: 30 80 00 04 b,a 4000cea0 <_Watchdog_Adjust+0x98> switch ( direction ) { case WATCHDOG_BACKWARD: _Watchdog_First( header )->delta_interval += units; break; case WATCHDOG_FORWARD: while ( units ) { 4000ce94: 80 a6 a0 00 cmp %i2, 0 4000ce98: 32 bf ff ec bne,a 4000ce48 <_Watchdog_Adjust+0x40> <== ALWAYS TAKEN 4000ce9c: c2 06 00 00 ld [ %i0 ], %g1 } break; } } _ISR_Enable( level ); 4000cea0: 7f ff d9 00 call 400032a0 4000cea4: 91 e8 00 08 restore %g0, %o0, %o0 =============================================================================== 4000b560 <_Watchdog_Remove>: #include Watchdog_States _Watchdog_Remove( Watchdog_Control *the_watchdog ) { 4000b560: 9d e3 bf a0 save %sp, -96, %sp ISR_Level level; Watchdog_States previous_state; Watchdog_Control *next_watchdog; _ISR_Disable( level ); 4000b564: 7f ff db b9 call 40002448 4000b568: ba 10 00 18 mov %i0, %i5 previous_state = the_watchdog->state; 4000b56c: f0 06 20 08 ld [ %i0 + 8 ], %i0 switch ( previous_state ) { 4000b570: 80 a6 20 01 cmp %i0, 1 4000b574: 22 80 00 1e be,a 4000b5ec <_Watchdog_Remove+0x8c> 4000b578: c0 27 60 08 clr [ %i5 + 8 ] 4000b57c: 0a 80 00 1d bcs 4000b5f0 <_Watchdog_Remove+0x90> 4000b580: 03 10 00 78 sethi %hi(0x4001e000), %g1 4000b584: 80 a6 20 03 cmp %i0, 3 4000b588: 18 80 00 1a bgu 4000b5f0 <_Watchdog_Remove+0x90> <== NEVER TAKEN 4000b58c: 01 00 00 00 nop RTEMS_INLINE_ROUTINE Watchdog_Control *_Watchdog_Next( Watchdog_Control *the_watchdog ) { return ( (Watchdog_Control *) the_watchdog->Node.next ); 4000b590: 10 80 00 02 b 4000b598 <_Watchdog_Remove+0x38> 4000b594: c2 07 40 00 ld [ %i5 ], %g1 break; case WATCHDOG_ACTIVE: case WATCHDOG_REMOVE_IT: the_watchdog->state = WATCHDOG_INACTIVE; 4000b598: c0 27 60 08 clr [ %i5 + 8 ] next_watchdog = _Watchdog_Next( the_watchdog ); if ( _Watchdog_Next(next_watchdog) ) 4000b59c: c4 00 40 00 ld [ %g1 ], %g2 4000b5a0: 80 a0 a0 00 cmp %g2, 0 4000b5a4: 02 80 00 07 be 4000b5c0 <_Watchdog_Remove+0x60> 4000b5a8: 05 10 00 78 sethi %hi(0x4001e000), %g2 next_watchdog->delta_interval += the_watchdog->delta_interval; 4000b5ac: c6 00 60 10 ld [ %g1 + 0x10 ], %g3 4000b5b0: c4 07 60 10 ld [ %i5 + 0x10 ], %g2 4000b5b4: 84 00 c0 02 add %g3, %g2, %g2 4000b5b8: c4 20 60 10 st %g2, [ %g1 + 0x10 ] if ( _Watchdog_Sync_count ) 4000b5bc: 05 10 00 78 sethi %hi(0x4001e000), %g2 4000b5c0: c4 00 a0 14 ld [ %g2 + 0x14 ], %g2 ! 4001e014 <_Watchdog_Sync_count> 4000b5c4: 80 a0 a0 00 cmp %g2, 0 4000b5c8: 22 80 00 07 be,a 4000b5e4 <_Watchdog_Remove+0x84> 4000b5cc: c4 07 60 04 ld [ %i5 + 4 ], %g2 _Watchdog_Sync_level = _ISR_Nest_level; 4000b5d0: 05 10 00 78 sethi %hi(0x4001e000), %g2 4000b5d4: c6 00 a1 38 ld [ %g2 + 0x138 ], %g3 ! 4001e138 <_Per_CPU_Information+0x8> 4000b5d8: 05 10 00 77 sethi %hi(0x4001dc00), %g2 4000b5dc: c6 20 a3 b4 st %g3, [ %g2 + 0x3b4 ] ! 4001dfb4 <_Watchdog_Sync_level> { Chain_Node *next; Chain_Node *previous; next = the_node->next; previous = the_node->previous; 4000b5e0: c4 07 60 04 ld [ %i5 + 4 ], %g2 next->previous = previous; 4000b5e4: c4 20 60 04 st %g2, [ %g1 + 4 ] previous->next = next; 4000b5e8: c2 20 80 00 st %g1, [ %g2 ] _Chain_Extract_unprotected( &the_watchdog->Node ); break; } the_watchdog->stop_time = _Watchdog_Ticks_since_boot; 4000b5ec: 03 10 00 78 sethi %hi(0x4001e000), %g1 4000b5f0: c2 00 60 18 ld [ %g1 + 0x18 ], %g1 ! 4001e018 <_Watchdog_Ticks_since_boot> 4000b5f4: c2 27 60 18 st %g1, [ %i5 + 0x18 ] _ISR_Enable( level ); 4000b5f8: 7f ff db 98 call 40002458 4000b5fc: 01 00 00 00 nop return( previous_state ); } 4000b600: 81 c7 e0 08 ret 4000b604: 81 e8 00 00 restore =============================================================================== 4000c7b4 <_Watchdog_Report_chain>: void _Watchdog_Report_chain( const char *name, Chain_Control *header ) { 4000c7b4: 9d e3 bf a0 save %sp, -96, %sp ISR_Level level; Chain_Node *node; _ISR_Disable( level ); 4000c7b8: 7f ff d9 93 call 40002e04 4000c7bc: b8 10 00 18 mov %i0, %i4 4000c7c0: b0 10 00 08 mov %o0, %i0 printk( "Watchdog Chain: %s %p\n", name, header ); 4000c7c4: 11 10 00 78 sethi %hi(0x4001e000), %o0 4000c7c8: 94 10 00 19 mov %i1, %o2 4000c7cc: 90 12 20 c8 or %o0, 0xc8, %o0 4000c7d0: 7f ff e4 12 call 40005818 4000c7d4: 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; 4000c7d8: 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 ); 4000c7dc: b2 06 60 04 add %i1, 4, %i1 if ( !_Chain_Is_empty( header ) ) { 4000c7e0: 80 a7 40 19 cmp %i5, %i1 4000c7e4: 12 80 00 04 bne 4000c7f4 <_Watchdog_Report_chain+0x40> 4000c7e8: 92 10 00 1d mov %i5, %o1 _Watchdog_Report( NULL, watch ); } printk( "== end of %s \n", name ); } else { printk( "Chain is empty\n" ); 4000c7ec: 10 80 00 0d b 4000c820 <_Watchdog_Report_chain+0x6c> 4000c7f0: 11 10 00 78 sethi %hi(0x4001e000), %o0 node != _Chain_Tail(header) ; node = node->next ) { Watchdog_Control *watch = (Watchdog_Control *) node; _Watchdog_Report( NULL, watch ); 4000c7f4: 40 00 00 0f call 4000c830 <_Watchdog_Report> 4000c7f8: 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 ) 4000c7fc: 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 ) ; 4000c800: 80 a7 40 19 cmp %i5, %i1 4000c804: 12 bf ff fc bne 4000c7f4 <_Watchdog_Report_chain+0x40> <== NEVER TAKEN 4000c808: 92 10 00 1d mov %i5, %o1 { Watchdog_Control *watch = (Watchdog_Control *) node; _Watchdog_Report( NULL, watch ); } printk( "== end of %s \n", name ); 4000c80c: 11 10 00 78 sethi %hi(0x4001e000), %o0 4000c810: 92 10 00 1c mov %i4, %o1 4000c814: 7f ff e4 01 call 40005818 4000c818: 90 12 20 e0 or %o0, 0xe0, %o0 4000c81c: 30 80 00 03 b,a 4000c828 <_Watchdog_Report_chain+0x74> } else { printk( "Chain is empty\n" ); 4000c820: 7f ff e3 fe call 40005818 4000c824: 90 12 20 f0 or %o0, 0xf0, %o0 } _ISR_Enable( level ); 4000c828: 7f ff d9 7b call 40002e14 4000c82c: 81 e8 00 00 restore =============================================================================== 4000b608 <_Watchdog_Tickle>: #include void _Watchdog_Tickle( Chain_Control *header ) { 4000b608: 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 ); 4000b60c: 7f ff db 8f call 40002448 4000b610: b8 10 00 18 mov %i0, %i4 4000b614: 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; 4000b618: 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 ); 4000b61c: b6 07 20 04 add %i4, 4, %i3 if ( _Chain_Is_empty( header ) ) 4000b620: 80 a7 40 1b cmp %i5, %i3 4000b624: 02 80 00 1f be 4000b6a0 <_Watchdog_Tickle+0x98> 4000b628: 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) { 4000b62c: c2 07 60 10 ld [ %i5 + 0x10 ], %g1 4000b630: 80 a0 60 00 cmp %g1, 0 4000b634: 02 80 00 06 be 4000b64c <_Watchdog_Tickle+0x44> <== NEVER TAKEN 4000b638: 82 00 7f ff add %g1, -1, %g1 the_watchdog->delta_interval--; 4000b63c: c2 27 60 10 st %g1, [ %i5 + 0x10 ] if ( the_watchdog->delta_interval != 0 ) 4000b640: 80 a0 60 00 cmp %g1, 0 4000b644: 12 80 00 17 bne 4000b6a0 <_Watchdog_Tickle+0x98> 4000b648: 01 00 00 00 nop goto leave; } do { watchdog_state = _Watchdog_Remove( the_watchdog ); 4000b64c: 7f ff ff c5 call 4000b560 <_Watchdog_Remove> 4000b650: 90 10 00 1d mov %i5, %o0 4000b654: b4 10 00 08 mov %o0, %i2 _ISR_Enable( level ); 4000b658: 7f ff db 80 call 40002458 4000b65c: 90 10 00 18 mov %i0, %o0 switch( watchdog_state ) { 4000b660: 80 a6 a0 02 cmp %i2, 2 4000b664: 12 80 00 06 bne 4000b67c <_Watchdog_Tickle+0x74> 4000b668: 01 00 00 00 nop case WATCHDOG_ACTIVE: (*the_watchdog->routine)( 4000b66c: c2 07 60 1c ld [ %i5 + 0x1c ], %g1 4000b670: d0 07 60 20 ld [ %i5 + 0x20 ], %o0 4000b674: 9f c0 40 00 call %g1 4000b678: d2 07 60 24 ld [ %i5 + 0x24 ], %o1 case WATCHDOG_REMOVE_IT: break; } _ISR_Disable( level ); 4000b67c: 7f ff db 73 call 40002448 4000b680: 01 00 00 00 nop 4000b684: b0 10 00 08 mov %o0, %i0 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_First( Chain_Control *the_chain ) { return _Chain_Head( the_chain )->next; 4000b688: fa 07 00 00 ld [ %i4 ], %i5 the_watchdog = _Watchdog_First( header ); } while ( !_Chain_Is_empty( header ) && (the_watchdog->delta_interval == 0) ); 4000b68c: 80 a7 40 1b cmp %i5, %i3 4000b690: 02 80 00 04 be 4000b6a0 <_Watchdog_Tickle+0x98> 4000b694: 01 00 00 00 nop } _ISR_Disable( level ); the_watchdog = _Watchdog_First( header ); } while ( !_Chain_Is_empty( header ) && 4000b698: 10 bf ff ea b 4000b640 <_Watchdog_Tickle+0x38> 4000b69c: c2 07 60 10 ld [ %i5 + 0x10 ], %g1 (the_watchdog->delta_interval == 0) ); leave: _ISR_Enable(level); 4000b6a0: 7f ff db 6e call 40002458 4000b6a4: 81 e8 00 00 restore =============================================================================== 4000b6a8 <_Workspace_Handler_initialization>: void _Workspace_Handler_initialization( Heap_Area *areas, size_t area_count, Heap_Initialization_or_extend_handler extend ) { 4000b6a8: 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(); 4000b6ac: 05 10 00 6d sethi %hi(0x4001b400), %g2 4000b6b0: 82 10 a0 c8 or %g2, 0xc8, %g1 ! 4001b4c8 4000b6b4: c6 08 60 32 ldub [ %g1 + 0x32 ], %g3 4000b6b8: fa 00 a0 c8 ld [ %g2 + 0xc8 ], %i5 4000b6bc: 80 a0 e0 00 cmp %g3, 0 4000b6c0: 12 80 00 03 bne 4000b6cc <_Workspace_Handler_initialization+0x24> 4000b6c4: 84 10 20 00 clr %g2 4000b6c8: 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; 4000b6cc: 21 10 00 24 sethi %hi(0x40009000), %l0 } else { size = 0; } } space_available = (*init_or_extend)( 4000b6d0: 27 10 00 77 sethi %hi(0x4001dc00), %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(); 4000b6d4: 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) { 4000b6d8: 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; 4000b6dc: a0 14 21 64 or %l0, 0x164, %l0 size_t i; for (i = 0; i < area_count; ++i) { Heap_Area *area = &areas [i]; if ( do_zero ) { 4000b6e0: e2 08 60 30 ldub [ %g1 + 0x30 ], %l1 if ( area->size > overhead ) { uintptr_t space_available; uintptr_t size; if ( unified ) { 4000b6e4: 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) { 4000b6e8: 10 80 00 2c b 4000b798 <_Workspace_Handler_initialization+0xf0> 4000b6ec: a6 14 e3 40 or %l3, 0x340, %l3 Heap_Area *area = &areas [i]; if ( do_zero ) { 4000b6f0: 22 80 00 07 be,a 4000b70c <_Workspace_Handler_initialization+0x64> 4000b6f4: f8 06 20 04 ld [ %i0 + 4 ], %i4 memset( area->begin, 0, area->size ); 4000b6f8: d0 06 00 00 ld [ %i0 ], %o0 4000b6fc: d4 06 20 04 ld [ %i0 + 4 ], %o2 4000b700: 40 00 10 1f call 4000f77c 4000b704: 92 10 20 00 clr %o1 } if ( area->size > overhead ) { 4000b708: f8 06 20 04 ld [ %i0 + 4 ], %i4 4000b70c: 80 a7 20 16 cmp %i4, 0x16 4000b710: 28 80 00 21 bleu,a 4000b794 <_Workspace_Handler_initialization+0xec> 4000b714: b6 06 e0 01 inc %i3 uintptr_t space_available; uintptr_t size; if ( unified ) { 4000b718: 80 a4 a0 00 cmp %l2, 0 4000b71c: 32 80 00 0c bne,a 4000b74c <_Workspace_Handler_initialization+0xa4> 4000b720: d2 06 00 00 ld [ %i0 ], %o1 size = area->size; } else { if ( remaining > 0 ) { 4000b724: 80 a7 60 00 cmp %i5, 0 4000b728: 22 80 00 08 be,a 4000b748 <_Workspace_Handler_initialization+0xa0><== NEVER TAKEN 4000b72c: b8 10 20 00 clr %i4 <== NOT EXECUTED size = remaining < area->size - overhead ? 4000b730: 82 07 3f ea add %i4, -22, %g1 remaining + overhead : area->size; 4000b734: 80 a7 40 01 cmp %i5, %g1 4000b738: 2a 80 00 04 bcs,a 4000b748 <_Workspace_Handler_initialization+0xa0><== ALWAYS TAKEN 4000b73c: b8 07 60 16 add %i5, 0x16, %i4 } else { size = 0; } } space_available = (*init_or_extend)( 4000b740: 10 80 00 03 b 4000b74c <_Workspace_Handler_initialization+0xa4><== NOT EXECUTED 4000b744: d2 06 00 00 ld [ %i0 ], %o1 <== NOT EXECUTED 4000b748: d2 06 00 00 ld [ %i0 ], %o1 4000b74c: 94 10 00 1c mov %i4, %o2 4000b750: 90 10 00 13 mov %l3, %o0 4000b754: 9f c4 00 00 call %l0 4000b758: 96 10 20 08 mov 8, %o3 area->begin, size, page_size ); area->begin = (char *) area->begin + size; 4000b75c: c2 06 00 00 ld [ %i0 ], %g1 area->size -= size; if ( space_available < remaining ) { 4000b760: 80 a2 00 1d cmp %o0, %i5 area->begin, size, page_size ); area->begin = (char *) area->begin + size; 4000b764: 82 00 40 1c add %g1, %i4, %g1 4000b768: c2 26 00 00 st %g1, [ %i0 ] area->size -= size; 4000b76c: c2 06 20 04 ld [ %i0 + 4 ], %g1 4000b770: b8 20 40 1c sub %g1, %i4, %i4 if ( space_available < remaining ) { 4000b774: 1a 80 00 05 bcc 4000b788 <_Workspace_Handler_initialization+0xe0><== ALWAYS TAKEN 4000b778: f8 26 20 04 st %i4, [ %i0 + 4 ] remaining -= space_available; 4000b77c: ba 27 40 08 sub %i5, %o0, %i5 <== NOT EXECUTED } else { remaining = 0; } init_or_extend = extend; 4000b780: 10 80 00 04 b 4000b790 <_Workspace_Handler_initialization+0xe8><== NOT EXECUTED 4000b784: a0 10 00 1a mov %i2, %l0 <== NOT EXECUTED 4000b788: a0 10 00 1a mov %i2, %l0 area->size -= size; if ( space_available < remaining ) { remaining -= space_available; } else { remaining = 0; 4000b78c: 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) { 4000b790: b6 06 e0 01 inc %i3 4000b794: b0 06 20 08 add %i0, 8, %i0 4000b798: 80 a6 c0 19 cmp %i3, %i1 4000b79c: 12 bf ff d5 bne 4000b6f0 <_Workspace_Handler_initialization+0x48> 4000b7a0: 80 a4 60 00 cmp %l1, 0 init_or_extend = extend; } } if ( remaining > 0 ) { 4000b7a4: 80 a7 60 00 cmp %i5, 0 4000b7a8: 02 80 00 05 be 4000b7bc <_Workspace_Handler_initialization+0x114> 4000b7ac: 90 10 20 00 clr %o0 _Internal_error_Occurred( 4000b7b0: 92 10 20 01 mov 1, %o1 4000b7b4: 7f ff f6 ff call 400093b0 <_Internal_error_Occurred> 4000b7b8: 94 10 20 02 mov 2, %o2 4000b7bc: 81 c7 e0 08 ret 4000b7c0: 81 e8 00 00 restore =============================================================================== 4000b730 <_Workspace_String_duplicate>: char *_Workspace_String_duplicate( const char *string, size_t len ) { 4000b730: 9d e3 bf a0 save %sp, -96, %sp char *dup = _Workspace_Allocate(len + 1); 4000b734: 7f ff ff e3 call 4000b6c0 <_Workspace_Allocate> 4000b738: 90 06 60 01 add %i1, 1, %o0 if (dup != NULL) { 4000b73c: ba 92 20 00 orcc %o0, 0, %i5 4000b740: 02 80 00 05 be 4000b754 <_Workspace_String_duplicate+0x24><== NEVER TAKEN 4000b744: 92 10 00 18 mov %i0, %o1 dup [len] = '\0'; 4000b748: c0 2f 40 19 clrb [ %i5 + %i1 ] memcpy(dup, string, len); 4000b74c: 40 00 0f 7e call 4000f544 4000b750: 94 10 00 19 mov %i1, %o2 } return dup; } 4000b754: 81 c7 e0 08 ret 4000b758: 91 e8 00 1d restore %g0, %i5, %o0 =============================================================================== 4001acac <__kill>: #endif int __kill( pid_t pid, int sig ) { return 0; } 4001acac: 81 c3 e0 08 retl <== NOT EXECUTED 4001acb0: 90 10 20 00 clr %o0 <== NOT EXECUTED =============================================================================== 4001ab2c <_calloc_r>: struct _reent *ignored __attribute__((unused)), size_t elements, size_t size ) { return calloc( elements, size ); 4001ab2c: 90 10 00 09 mov %o1, %o0 <== NOT EXECUTED 4001ab30: 92 10 00 0a mov %o2, %o1 <== NOT EXECUTED 4001ab34: 82 13 c0 00 mov %o7, %g1 <== NOT EXECUTED 4001ab38: 7f ff a4 88 call 40003d58 <== NOT EXECUTED 4001ab3c: 9e 10 40 00 mov %g1, %o7 <== NOT EXECUTED =============================================================================== 4001abb4 <_close_r>: int _close_r( struct _reent *ptr __attribute__((unused)), int fd ) { return close( fd ); 4001abb4: 90 10 00 09 mov %o1, %o0 4001abb8: 82 13 c0 00 mov %o7, %g1 4001abbc: 7f ff ff e1 call 4001ab40 4001abc0: 9e 10 40 00 mov %g1, %o7 =============================================================================== 40013478 <_fat_block_read>: uint32_t start, uint32_t offset, uint32_t count, void *buff ) { 40013478: 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) 4001347c: 10 80 00 17 b 400134d8 <_fat_block_read+0x60> 40013480: ba 10 20 00 clr %i5 { rc = fat_buf_access(fs_info, sec_num, FAT_OP_TYPE_READ, &sec_buf); 40013484: 92 10 00 19 mov %i1, %o1 40013488: 94 10 20 01 mov 1, %o2 4001348c: 7f ff ff cc call 400133bc 40013490: 96 07 bf fc add %fp, -4, %o3 if (rc != RC_OK) 40013494: 80 a2 20 00 cmp %o0, 0 40013498: 32 80 00 15 bne,a 400134ec <_fat_block_read+0x74> <== NEVER TAKEN 4001349c: ba 10 3f ff mov -1, %i5 <== NOT EXECUTED return -1; c = MIN(count, (fs_info->vol.bps - ofs)); 400134a0: e0 16 00 00 lduh [ %i0 ], %l0 400134a4: a0 24 00 1a sub %l0, %i2, %l0 400134a8: 80 a4 00 1b cmp %l0, %i3 400134ac: 38 80 00 02 bgu,a 400134b4 <_fat_block_read+0x3c> 400134b0: a0 10 00 1b mov %i3, %l0 memcpy((buff + cmpltd), (sec_buf + ofs), c); 400134b4: d2 07 bf fc ld [ %fp + -4 ], %o1 400134b8: 90 07 00 1d add %i4, %i5, %o0 400134bc: 92 02 40 1a add %o1, %i2, %o1 400134c0: 94 10 00 10 mov %l0, %o2 400134c4: 40 00 20 5d call 4001b638 400134c8: b6 26 c0 10 sub %i3, %l0, %i3 count -= c; cmpltd += c; 400134cc: ba 04 00 1d add %l0, %i5, %i5 sec_num++; 400134d0: b2 06 60 01 inc %i1 ofs = 0; 400134d4: 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) 400134d8: 80 a6 e0 00 cmp %i3, 0 400134dc: 12 bf ff ea bne 40013484 <_fat_block_read+0xc> 400134e0: 90 10 00 18 mov %i0, %o0 cmpltd += c; sec_num++; ofs = 0; } return cmpltd; } 400134e4: 81 c7 e0 08 ret 400134e8: 91 e8 00 1d restore %g0, %i5, %o0 400134ec: b0 10 00 1d mov %i5, %i0 <== NOT EXECUTED 400134f0: 81 c7 e0 08 ret <== NOT EXECUTED 400134f4: 81 e8 00 00 restore <== NOT EXECUTED =============================================================================== 40004164 <_gettimeofday>: int _gettimeofday( struct timeval *tp, struct timezone *tzp ) { return gettimeofday( tp, tzp ); 40004164: 82 13 c0 00 mov %o7, %g1 <== NOT EXECUTED 40004168: 7f ff ff d9 call 400040cc <== NOT EXECUTED 4000416c: 9e 10 40 00 mov %g1, %o7 <== NOT EXECUTED =============================================================================== 40004ba4 <_lstat_r>: struct _reent *ptr __attribute__((unused)), const char *path, struct stat *buf ) { return _STAT_NAME( path, buf ); 40004ba4: 90 10 00 09 mov %o1, %o0 <== NOT EXECUTED 40004ba8: 92 10 00 0a mov %o2, %o1 <== NOT EXECUTED 40004bac: 82 13 c0 00 mov %o7, %g1 <== NOT EXECUTED 40004bb0: 7f ff ff e9 call 40004b54 <== NOT EXECUTED 40004bb4: 9e 10 40 00 mov %g1, %o7 <== NOT EXECUTED =============================================================================== 40004ee4 <_stat_r>: struct _reent *ptr __attribute__((unused)), const char *path, struct stat *buf ) { return _STAT_NAME( path, buf ); 40004ee4: 90 10 00 09 mov %o1, %o0 <== NOT EXECUTED 40004ee8: 92 10 00 0a mov %o2, %o1 <== NOT EXECUTED 40004eec: 82 13 c0 00 mov %o7, %g1 <== NOT EXECUTED 40004ef0: 7f ff ff e9 call 40004e94 <== NOT EXECUTED 40004ef4: 9e 10 40 00 mov %g1, %o7 <== NOT EXECUTED =============================================================================== 400047d4 : #include #include int chroot( const char *path ) { 400047d4: 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( 400047d8: 94 10 20 19 mov 0x19, %o2 400047dc: 92 10 00 18 mov %i0, %o1 400047e0: 90 07 bf c8 add %fp, -56, %o0 400047e4: 17 10 00 46 sethi %hi(0x40011800), %o3 400047e8: 96 12 e3 c0 or %o3, 0x3c0, %o3 ! 40011bc0 400047ec: 40 00 04 c3 call 40005af8 400047f0: 98 02 ff fc add %o3, -4, %o4 400047f4: 90 07 bf b0 add %fp, -80, %o0 400047f8: 40 00 05 da call 40005f60 400047fc: 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 ); 40004800: 40 00 06 50 call 40006140 40004804: 90 07 bf b0 add %fp, -80, %o0 if ( !rtems_filesystem_global_location_is_null( new_current_loc ) ) { 40004808: c2 02 20 10 ld [ %o0 + 0x10 ], %g1 4000480c: 39 10 00 45 sethi %hi(0x40011400), %i4 40004810: b8 17 22 44 or %i4, 0x244, %i4 ! 40011644 40004814: 80 a0 40 1c cmp %g1, %i4 40004818: 02 80 00 29 be 400048bc 4000481c: d0 27 bf ac st %o0, [ %fp + -84 ] rtems_filesystem_global_location_t *new_root_loc = 40004820: 40 00 06 16 call 40006078 40004824: 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)( 40004828: c2 02 20 14 ld [ %o0 + 0x14 ], %g1 4000482c: 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 = 40004830: c2 00 60 14 ld [ %g1 + 0x14 ], %g1 40004834: 9f c0 40 00 call %g1 40004838: 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 ) { 4000483c: 80 a2 20 00 cmp %o0, 0 40004840: 32 80 00 17 bne,a 4000489c 40004844: c2 07 60 10 ld [ %i5 + 0x10 ], %g1 sc = rtems_libio_set_private_env(); 40004848: 40 00 03 1d call 400054bc 4000484c: 01 00 00 00 nop if (sc == RTEMS_SUCCESSFUL) { 40004850: 80 a2 20 00 cmp %o0, 0 40004854: 12 80 00 0c bne 40004884 40004858: 80 a2 20 0d cmp %o0, 0xd rtems_filesystem_global_location_assign( 4000485c: 39 10 00 46 sethi %hi(0x40011800), %i4 40004860: d0 07 23 b8 ld [ %i4 + 0x3b8 ], %o0 ! 40011bb8 40004864: 92 10 00 1d mov %i5, %o1 40004868: 40 00 05 fb call 40006054 4000486c: 90 02 20 04 add %o0, 4, %o0 &rtems_filesystem_root, new_root_loc ); rtems_filesystem_global_location_assign( 40004870: d0 07 23 b8 ld [ %i4 + 0x3b8 ], %o0 40004874: d2 07 bf ac ld [ %fp + -84 ], %o1 40004878: 40 00 05 f7 call 40006054 4000487c: b0 10 20 00 clr %i0 40004880: 30 80 00 10 b,a 400048c0 &rtems_filesystem_current, new_current_loc ); } else { if (sc != RTEMS_UNSATISFIED) { 40004884: 02 80 00 18 be 400048e4 <== NEVER TAKEN 40004888: 01 00 00 00 nop errno = ENOMEM; 4000488c: 40 00 1b e0 call 4000b80c <__errno> 40004890: 01 00 00 00 nop 40004894: 10 80 00 08 b 400048b4 40004898: 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 ) ) { 4000489c: 80 a0 40 1c cmp %g1, %i4 400048a0: 02 80 00 11 be 400048e4 <== NEVER TAKEN 400048a4: 01 00 00 00 nop errno = eno; 400048a8: 40 00 1b d9 call 4000b80c <__errno> 400048ac: 01 00 00 00 nop 400048b0: 82 10 20 14 mov 0x14, %g1 ! 14 400048b4: 10 80 00 0c b 400048e4 400048b8: c2 22 00 00 st %g1, [ %o0 ] if ( rv != 0 ) { rtems_filesystem_global_location_release( new_root_loc ); } } else { rv = -1; 400048bc: b0 10 3f ff mov -1, %i0 } rtems_filesystem_eval_path_cleanup( &ctx ); 400048c0: 40 00 04 d4 call 40005c10 400048c4: 90 07 bf c8 add %fp, -56, %o0 if ( rv != 0 ) { 400048c8: 80 a6 20 00 cmp %i0, 0 400048cc: 02 80 00 0a be 400048f4 400048d0: 01 00 00 00 nop rtems_filesystem_global_location_release( new_current_loc ); 400048d4: 40 00 05 c8 call 40005ff4 400048d8: d0 07 bf ac ld [ %fp + -84 ], %o0 400048dc: 81 c7 e0 08 ret 400048e0: 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 ); 400048e4: 40 00 05 c4 call 40005ff4 400048e8: 90 10 00 1d mov %i5, %o0 } } else { rv = -1; 400048ec: 10 bf ff f5 b 400048c0 400048f0: b0 10 3f ff mov -1, %i0 if ( rv != 0 ) { rtems_filesystem_global_location_release( new_current_loc ); } return rv; } 400048f4: 81 c7 e0 08 ret 400048f8: 81 e8 00 00 restore =============================================================================== 400041d0 : dev_t dev, const char *name, rtems_disk_device **dd_ptr, char **alloc_name_ptr ) { 400041d0: 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) { 400041d4: 03 10 00 68 sethi %hi(0x4001a000), %g1 400041d8: e0 00 63 10 ld [ %g1 + 0x310 ], %l0 ! 4001a310 400041dc: 80 a6 00 10 cmp %i0, %l0 400041e0: 0a 80 00 16 bcs 40004238 400041e4: 03 10 00 68 sethi %hi(0x4001a000), %g1 rtems_disk_device_table *table = disktab; rtems_device_major_number old_size = disktab_size; rtems_device_major_number new_size = 2 * old_size; 400041e8: bb 2c 20 01 sll %l0, 1, %i5 if (major >= new_size) { 400041ec: 80 a6 00 1d cmp %i0, %i5 400041f0: 0a 80 00 03 bcs 400041fc <== NEVER TAKEN 400041f4: d0 00 63 14 ld [ %g1 + 0x314 ], %o0 new_size = major + 1; 400041f8: ba 06 20 01 add %i0, 1, %i5 } table = realloc(table, new_size * sizeof(*table)); 400041fc: 40 00 07 ce call 40006134 40004200: 93 2f 60 03 sll %i5, 3, %o1 if (table == NULL) { 40004204: a2 92 20 00 orcc %o0, 0, %l1 40004208: 02 80 00 58 be 40004368 <== ALWAYS TAKEN 4000420c: 94 27 40 10 sub %i5, %l0, %o2 return NULL; } memset(table + old_size, 0, (new_size - old_size) * sizeof(*table)); 40004210: 91 2c 20 03 sll %l0, 3, %o0 <== NOT EXECUTED 40004214: 92 10 20 00 clr %o1 <== NOT EXECUTED 40004218: 90 04 40 08 add %l1, %o0, %o0 <== NOT EXECUTED 4000421c: 40 00 3e cd call 40013d50 <== NOT EXECUTED 40004220: 95 2a a0 03 sll %o2, 3, %o2 <== NOT EXECUTED disktab = table; 40004224: 03 10 00 68 sethi %hi(0x4001a000), %g1 <== NOT EXECUTED 40004228: e2 20 63 14 st %l1, [ %g1 + 0x314 ] ! 4001a314 <== NOT EXECUTED disktab_size = new_size; 4000422c: 03 10 00 68 sethi %hi(0x4001a000), %g1 <== NOT EXECUTED 40004230: fa 20 63 10 st %i5, [ %g1 + 0x310 ] ! 4001a310 <== NOT EXECUTED } if (disktab [major].minor == NULL || minor >= disktab[major].size) { 40004234: 03 10 00 68 sethi %hi(0x4001a000), %g1 <== NOT EXECUTED 40004238: e4 00 63 14 ld [ %g1 + 0x314 ], %l2 ! 4001a314 4000423c: a3 2e 20 03 sll %i0, 3, %l1 40004240: d0 04 80 11 ld [ %l2 + %l1 ], %o0 40004244: a8 04 80 11 add %l2, %l1, %l4 40004248: 80 a2 20 00 cmp %o0, 0 4000424c: 02 80 00 05 be 40004260 40004250: e0 05 20 04 ld [ %l4 + 4 ], %l0 40004254: 80 a6 40 10 cmp %i1, %l0 40004258: 2a 80 00 16 bcs,a 400042b0 4000425c: 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) { 40004260: 80 a4 20 00 cmp %l0, 0 40004264: 02 80 00 03 be 40004270 40004268: ba 10 20 08 mov 8, %i5 new_size = DISKTAB_INITIAL_SIZE; } else { new_size = 2 * old_size; 4000426c: bb 2c 20 01 sll %l0, 1, %i5 } if (minor >= new_size) { 40004270: 80 a6 40 1d cmp %i1, %i5 40004274: 3a 80 00 02 bcc,a 4000427c 40004278: ba 06 60 01 add %i1, 1, %i5 new_size = minor + 1; } table = realloc(table, new_size * sizeof(*table)); 4000427c: 40 00 07 ae call 40006134 40004280: 93 2f 60 02 sll %i5, 2, %o1 if (table == NULL) { 40004284: a6 92 20 00 orcc %o0, 0, %l3 40004288: 02 80 00 38 be 40004368 4000428c: 94 27 40 10 sub %i5, %l0, %o2 return NULL; } memset(table + old_size, 0, (new_size - old_size) * sizeof(*table)); 40004290: 91 2c 20 02 sll %l0, 2, %o0 40004294: 92 10 20 00 clr %o1 40004298: 90 04 c0 08 add %l3, %o0, %o0 4000429c: 40 00 3e ad call 40013d50 400042a0: 95 2a a0 02 sll %o2, 2, %o2 disktab [major].minor = table; 400042a4: e6 24 80 11 st %l3, [ %l2 + %l1 ] disktab [major].size = new_size; 400042a8: fa 25 20 04 st %i5, [ %l4 + 4 ] } return disktab [major].minor + minor; 400042ac: e2 04 80 11 ld [ %l2 + %l1 ], %l1 400042b0: a1 2e 60 02 sll %i1, 2, %l0 400042b4: 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) { 400042b8: 80 a0 60 00 cmp %g1, 0 400042bc: 32 80 00 04 bne,a 400042cc <== ALWAYS TAKEN 400042c0: c4 04 40 10 ld [ %l1 + %l0 ], %g2 return RTEMS_NO_MEMORY; 400042c4: 10 80 00 2a b 4000436c <== NOT EXECUTED 400042c8: 82 10 20 1a mov 0x1a, %g1 <== NOT EXECUTED } if (*dd_entry != NULL) { 400042cc: 80 a0 a0 00 cmp %g2, 0 400042d0: 12 80 00 27 bne 4000436c 400042d4: 82 10 20 0c mov 0xc, %g1 return RTEMS_RESOURCE_IN_USE; } dd = malloc(sizeof(*dd)); 400042d8: 40 00 04 f5 call 400056ac 400042dc: 90 10 20 78 mov 0x78, %o0 if (dd == NULL) { 400042e0: ba 92 20 00 orcc %o0, 0, %i5 400042e4: 02 80 00 21 be 40004368 <== NEVER TAKEN 400042e8: 80 a6 a0 00 cmp %i2, 0 return RTEMS_NO_MEMORY; } if (name != NULL) { 400042ec: 02 80 00 11 be 40004330 400042f0: a4 10 20 00 clr %l2 alloc_name = strdup(name); 400042f4: 40 00 3f 71 call 400140b8 400042f8: 90 10 00 1a mov %i2, %o0 if (alloc_name == NULL) { 400042fc: a4 92 20 00 orcc %o0, 0, %l2 40004300: 12 80 00 11 bne 40004344 <== ALWAYS TAKEN 40004304: b4 10 00 08 mov %o0, %i2 free(dd); 40004308: 40 00 03 a8 call 400051a8 <== NOT EXECUTED 4000430c: 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; 40004310: 10 80 00 17 b 4000436c <== NOT EXECUTED 40004314: 82 10 20 1a mov 0x1a, %g1 <== NOT EXECUTED } } if (name != NULL) { if (mknod(alloc_name, 0777 | S_IFBLK, dev) < 0) { free(alloc_name); 40004318: 40 00 03 a4 call 400051a8 <== NOT EXECUTED 4000431c: 90 10 00 1a mov %i2, %o0 <== NOT EXECUTED free(dd); 40004320: 40 00 03 a2 call 400051a8 <== NOT EXECUTED 40004324: 90 10 00 1d mov %i5, %o0 <== NOT EXECUTED return RTEMS_UNSATISFIED; 40004328: 10 80 00 11 b 4000436c <== NOT EXECUTED 4000432c: 82 10 20 0d mov 0xd, %g1 <== NOT EXECUTED } } *dd_entry = dd; 40004330: fa 24 40 10 st %i5, [ %l1 + %l0 ] *dd_ptr = dd; 40004334: fa 26 c0 00 st %i5, [ %i3 ] *alloc_name_ptr = alloc_name; 40004338: e4 27 00 00 st %l2, [ %i4 ] return RTEMS_SUCCESSFUL; 4000433c: 10 80 00 0c b 4000436c 40004340: 82 10 20 00 clr %g1 return RTEMS_NO_MEMORY; } } if (name != NULL) { if (mknod(alloc_name, 0777 | S_IFBLK, dev) < 0) { 40004344: 13 00 00 18 sethi %hi(0x6000), %o1 40004348: 94 10 00 18 mov %i0, %o2 4000434c: 92 12 61 ff or %o1, 0x1ff, %o1 40004350: 40 00 05 47 call 4000586c 40004354: 96 10 00 19 mov %i1, %o3 40004358: 80 a2 20 00 cmp %o0, 0 4000435c: 36 bf ff f6 bge,a 40004334 <== ALWAYS TAKEN 40004360: fa 24 40 10 st %i5, [ %l1 + %l0 ] 40004364: 30 bf ff ed b,a 40004318 <== 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; 40004368: 82 10 20 1a mov 0x1a, %g1 *dd_entry = dd; *dd_ptr = dd; *alloc_name_ptr = alloc_name; return RTEMS_SUCCESSFUL; } 4000436c: 81 c7 e0 08 ret 40004370: 91 e8 00 01 restore %g0, %g1, %o0 =============================================================================== 40005330 : * 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) 40005330: 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) 40005334: 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) 40005338: b8 10 00 18 mov %i0, %i4 if (new_part_desc == NULL) { return RTEMS_INTERNAL_ERROR; } *new_part_desc = NULL; 4000533c: c0 26 40 00 clr [ %i1 ] if ((part_desc = calloc(1, sizeof(rtems_part_desc_t))) == NULL) 40005340: 92 10 20 28 mov 0x28, %o1 40005344: 40 00 03 1a call 40005fac 40005348: b0 10 20 1a mov 0x1a, %i0 4000534c: 80 a2 20 00 cmp %o0, 0 40005350: 02 80 00 27 be 400053ec <== NEVER TAKEN 40005354: ba 10 00 08 mov %o0, %i5 { return RTEMS_NO_MEMORY; } part_desc->bootable = *(data + RTEMS_IDE_PARTITION_BOOTABLE_OFFSET); 40005358: 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)); 4000535c: 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); 40005360: c2 2a 00 00 stb %g1, [ %o0 ] part_desc->sys_type = *(data + RTEMS_IDE_PARTITION_SYS_TYPE_OFFSET); 40005364: 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)); 40005368: 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); 4000536c: 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)); 40005370: 40 00 3e 52 call 40014cb8 40005374: 90 07 bf fc add %fp, -4, %o0 part_desc->start = LE_TO_CPU_U32(temp); 40005378: 7f ff ff ac call 40005228 4000537c: d0 07 bf fc ld [ %fp + -4 ], %o0 memcpy(&temp, data + RTEMS_IDE_PARTITION_SIZE_OFFSET, sizeof(uint32_t)); 40005380: 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); 40005384: d0 27 60 04 st %o0, [ %i5 + 4 ] memcpy(&temp, data + RTEMS_IDE_PARTITION_SIZE_OFFSET, sizeof(uint32_t)); 40005388: 94 10 20 04 mov 4, %o2 4000538c: 40 00 3e 4b call 40014cb8 40005390: 90 07 bf fc add %fp, -4, %o0 part_desc->size = LE_TO_CPU_U32(temp); 40005394: 7f ff ff a5 call 40005228 40005398: d0 07 bf fc ld [ %fp + -4 ], %o0 4000539c: 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) || 400053a0: 82 0e e0 7f and %i3, 0x7f, %g1 400053a4: 80 a0 60 05 cmp %g1, 5 400053a8: 02 80 00 0c be 400053d8 400053ac: 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))); 400053b0: 11 10 00 91 sethi %hi(0x40024400), %o0 400053b4: 92 0e e0 ff and %i3, 0xff, %o1 400053b8: 90 12 20 e0 or %o0, 0xe0, %o0 400053bc: 40 00 3d d1 call 40014b00 400053c0: 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) || 400053c4: 80 a2 20 00 cmp %o0, 0 400053c8: 02 80 00 06 be 400053e0 400053cc: 80 a7 20 00 cmp %i4, 0 ((is_fat_partition(part_desc->sys_type)) && (part_desc->size != 0))) { 400053d0: 02 80 00 04 be 400053e0 <== NEVER TAKEN 400053d4: 01 00 00 00 nop *new_part_desc = part_desc; 400053d8: 10 80 00 04 b 400053e8 400053dc: fa 26 40 00 st %i5, [ %i1 ] } else { /* empty partition */ free(part_desc); 400053e0: 40 00 03 2b call 4000608c 400053e4: 90 10 00 1d mov %i5, %o0 } return RTEMS_SUCCESSFUL; 400053e8: b0 10 20 00 clr %i0 } 400053ec: 81 c7 e0 08 ret 400053f0: 81 e8 00 00 restore =============================================================================== 40003460 : #endif #include "devfs.h" void devFS_Show(void) { 40003460: 9d e3 bf a0 save %sp, -96, %sp rtems_filesystem_location_info_t *rootloc = &rtems_filesystem_root->location; 40003464: 03 10 00 4a sethi %hi(0x40012800), %g1 40003468: c2 00 63 7c ld [ %g1 + 0x37c ], %g1 ! 40012b7c if (rootloc->mt_entry->ops == &devFS_ops) { 4000346c: 05 10 00 47 sethi %hi(0x40011c00), %g2 40003470: c2 00 60 04 ld [ %g1 + 4 ], %g1 40003474: 84 10 a3 d4 or %g2, 0x3d4, %g2 40003478: c2 00 60 14 ld [ %g1 + 0x14 ], %g1 4000347c: c6 00 60 0c ld [ %g1 + 0xc ], %g3 40003480: 80 a0 c0 02 cmp %g3, %g2 40003484: 12 80 00 25 bne 40003518 <== NEVER TAKEN 40003488: 33 10 00 48 sethi %hi(0x40012000), %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; 4000348c: 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]); 40003490: 31 10 00 48 sethi %hi(0x40012000), %i0 } printk( 40003494: 21 10 00 48 sethi %hi(0x40012000), %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; 40003498: f4 00 60 04 ld [ %g1 + 4 ], %i2 4000349c: fa 00 40 00 ld [ %g1 ], %i5 devFS_node *nodes = data->nodes; for (i = 0; i < n; ++i) { 400034a0: b6 10 20 00 clr %i3 if (current->name != NULL) { size_t j = 0; size_t m = current->namelen; printk("/"); 400034a4: b2 16 60 28 or %i1, 0x28, %i1 for (j = 0; j < m; ++j) { printk("%c", current->name [j]); 400034a8: b0 16 20 30 or %i0, 0x30, %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) { 400034ac: 10 80 00 18 b 4000350c 400034b0: a0 14 20 38 or %l0, 0x38, %l0 devFS_node *current = nodes + i; if (current->name != NULL) { 400034b4: 80 a0 60 00 cmp %g1, 0 400034b8: 22 80 00 14 be,a 40003508 400034bc: b6 06 e0 01 inc %i3 size_t j = 0; size_t m = current->namelen; 400034c0: e2 07 60 04 ld [ %i5 + 4 ], %l1 printk("/"); 400034c4: 90 10 00 19 mov %i1, %o0 400034c8: 40 00 03 d1 call 4000440c 400034cc: b8 10 20 00 clr %i4 for (j = 0; j < m; ++j) { 400034d0: 10 80 00 07 b 400034ec 400034d4: 80 a7 00 11 cmp %i4, %l1 printk("%c", current->name [j]); 400034d8: 90 10 00 18 mov %i0, %o0 400034dc: d2 48 40 1c ldsb [ %g1 + %i4 ], %o1 400034e0: 40 00 03 cb call 4000440c 400034e4: 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) { 400034e8: 80 a7 00 11 cmp %i4, %l1 400034ec: 32 bf ff fb bne,a 400034d8 400034f0: c2 07 40 00 ld [ %i5 ], %g1 printk("%c", current->name [j]); } printk( 400034f4: d2 07 60 08 ld [ %i5 + 8 ], %o1 400034f8: d4 07 60 0c ld [ %i5 + 0xc ], %o2 400034fc: 40 00 03 c4 call 4000440c 40003500: 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) { 40003504: b6 06 e0 01 inc %i3 40003508: ba 07 60 14 add %i5, 0x14, %i5 4000350c: 80 a6 c0 1a cmp %i3, %i2 40003510: 32 bf ff e9 bne,a 400034b4 40003514: c2 07 40 00 ld [ %i5 ], %g1 40003518: 81 c7 e0 08 ret 4000351c: 81 e8 00 00 restore =============================================================================== 4000d178 : } void devFS_eval_path( rtems_filesystem_eval_path_context_t *ctx ) { 4000d178: 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; 4000d17c: 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; 4000d180: f2 06 00 00 ld [ %i0 ], %i1 4000d184: 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; 4000d188: 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; 4000d18c: e2 00 60 04 ld [ %g1 + 4 ], %l1 4000d190: fa 00 40 00 ld [ %g1 ], %i5 devFS_node *nodes = data->nodes; devFS_node *node = NULL; 4000d194: b8 10 20 00 clr %i4 devFS_node *free_node = NULL; 4000d198: 82 10 20 00 clr %g1 for (i = 0; (free_node == NULL || node == NULL) && i < n; ++i) { 4000d19c: 10 80 00 12 b 4000d1e4 4000d1a0: b4 10 20 00 clr %i2 devFS_node *current = nodes + i; if (current->name != NULL) { 4000d1a4: 80 a2 20 00 cmp %o0, 0 4000d1a8: 02 80 00 0c be 4000d1d8 4000d1ac: a0 10 00 1d mov %i5, %l0 if ( 4000d1b0: c4 07 60 04 ld [ %i5 + 4 ], %g2 4000d1b4: 80 a0 80 1b cmp %g2, %i3 4000d1b8: 12 80 00 08 bne 4000d1d8 4000d1bc: a0 10 00 01 mov %g1, %l0 current->namelen == pathlen && memcmp(current->name, path, pathlen) == 0 4000d1c0: 92 10 00 19 mov %i1, %o1 4000d1c4: 40 00 09 5d call 4000f738 4000d1c8: 94 10 00 1b mov %i3, %o2 4000d1cc: 80 a2 20 00 cmp %o0, 0 4000d1d0: 22 80 00 02 be,a 4000d1d8 4000d1d4: 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) { 4000d1d8: b4 06 a0 01 inc %i2 4000d1dc: ba 07 60 14 add %i5, 0x14, %i5 4000d1e0: 82 10 00 10 mov %l0, %g1 4000d1e4: 80 a7 20 00 cmp %i4, 0 4000d1e8: 02 80 00 0a be 4000d210 4000d1ec: 80 a6 80 11 cmp %i2, %l1 4000d1f0: 80 a0 60 00 cmp %g1, 0 4000d1f4: 02 80 00 07 be 4000d210 <== NEVER TAKEN 4000d1f8: 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) { 4000d1fc: 80 a7 20 00 cmp %i4, 0 4000d200: 12 80 00 08 bne 4000d220 4000d204: 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) { 4000d208: 10 80 00 0b b 4000d234 4000d20c: 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) { 4000d210: 32 bf ff e5 bne,a 4000d1a4 4000d214: 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) { 4000d218: 10 bf ff fa b 4000d200 4000d21c: 80 a7 20 00 cmp %i4, 0 if ((eval_flags & RTEMS_FS_EXCLUSIVE) == 0) { 4000d220: 80 88 a0 40 btst 0x40, %g2 4000d224: 12 80 00 12 bne 4000d26c 4000d228: b2 10 20 11 mov 0x11, %i1 currentloc->node_access = node; 4000d22c: 10 80 00 0a b 4000d254 4000d230: 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) { 4000d234: 02 80 00 0d be 4000d268 <== NEVER TAKEN 4000d238: 80 a0 60 00 cmp %g1, 0 if (free_node != NULL) { 4000d23c: 02 80 00 09 be 4000d260 4000d240: 84 10 21 ff mov 0x1ff, %g2 free_node->mode = S_IRWXU | S_IRWXG | S_IRWXO; 4000d244: c4 20 60 10 st %g2, [ %g1 + 0x10 ] currentloc->node_access = free_node; 4000d248: c2 26 20 20 st %g1, [ %i0 + 0x20 ] rtems_filesystem_eval_path_context_t *ctx, const char *token, size_t tokenlen ) { ctx->token = token; 4000d24c: f2 26 20 08 st %i1, [ %i0 + 8 ] ctx->tokenlen = tokenlen; 4000d250: 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; 4000d254: c0 26 20 04 clr [ %i0 + 4 ] 4000d258: 81 c7 e0 08 ret 4000d25c: 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); 4000d260: 10 80 00 03 b 4000d26c 4000d264: b2 10 20 1c mov 0x1c, %i1 } } else { rtems_filesystem_eval_path_error(ctx, ENOENT); 4000d268: b2 10 20 02 mov 2, %i1 <== NOT EXECUTED 4000d26c: 7f ff e3 eb call 40006218 4000d270: 81 e8 00 00 restore =============================================================================== 40004ffc : const char *name, size_t namelen, mode_t mode, dev_t dev ) { 40004ffc: 9d e3 bf a0 save %sp, -96, %sp int rv = 0; if (namelen != 3 || name [0] != 'd' || name [1] != 'e' || name [2] != 'v') { 40005000: 80 a6 a0 03 cmp %i2, 3 40005004: 12 80 00 0e bne 4000503c 40005008: 05 00 00 2c sethi %hi(0xb000), %g2 4000500c: c2 4e 40 00 ldsb [ %i1 ], %g1 40005010: 80 a0 60 64 cmp %g1, 0x64 40005014: 12 80 00 0b bne 40005040 <== NEVER TAKEN 40005018: 03 00 00 08 sethi %hi(0x2000), %g1 4000501c: c2 4e 60 01 ldsb [ %i1 + 1 ], %g1 40005020: 80 a0 60 65 cmp %g1, 0x65 40005024: 12 80 00 07 bne 40005040 <== NEVER TAKEN 40005028: 03 00 00 08 sethi %hi(0x2000), %g1 4000502c: c2 4e 60 02 ldsb [ %i1 + 2 ], %g1 40005030: 80 a0 60 76 cmp %g1, 0x76 40005034: 02 80 00 1b be 400050a0 <== ALWAYS TAKEN 40005038: 03 00 00 3c sethi %hi(0xf000), %g1 if (S_ISBLK(mode) || S_ISCHR(mode)) { 4000503c: 03 00 00 08 sethi %hi(0x2000), %g1 40005040: 84 0e c0 02 and %i3, %g2, %g2 40005044: 80 a0 80 01 cmp %g2, %g1 40005048: 12 80 00 1b bne 400050b4 4000504c: 01 00 00 00 nop char *dupname = malloc(namelen); 40005050: 40 00 01 47 call 4000556c 40005054: 90 10 00 1a mov %i2, %o0 if (dupname != NULL) { 40005058: 84 92 20 00 orcc %o0, 0, %g2 4000505c: 02 80 00 0d be 40005090 40005060: 92 10 00 19 mov %i1, %o1 devFS_node *node = parentloc->node_access; 40005064: c2 06 20 08 ld [ %i0 + 8 ], %g1 node->name = dupname; 40005068: c4 20 40 00 st %g2, [ %g1 ] node->namelen = namelen; 4000506c: f4 20 60 04 st %i2, [ %g1 + 4 ] node->major = rtems_filesystem_dev_major_t(dev); 40005070: f8 20 60 08 st %i4, [ %g1 + 8 ] node->minor = rtems_filesystem_dev_minor_t(dev); 40005074: fa 20 60 0c st %i5, [ %g1 + 0xc ] node->mode = mode; 40005078: f6 20 60 10 st %i3, [ %g1 + 0x10 ] memcpy(dupname, name, namelen); 4000507c: 94 10 00 1a mov %i2, %o2 40005080: 40 00 29 d8 call 4000f7e0 40005084: b0 10 20 00 clr %i0 40005088: 81 c7 e0 08 ret 4000508c: 81 e8 00 00 restore } else { errno = ENOMEM; 40005090: 40 00 25 cf call 4000e7cc <__errno> 40005094: 01 00 00 00 nop 40005098: 10 80 00 0a b 400050c0 4000509c: 82 10 20 0c mov 0xc, %g1 ! c } else { errno = ENOTSUP; rv = -1; } } else { if (!S_ISDIR(mode)) { 400050a0: b6 0e c0 01 and %i3, %g1, %i3 400050a4: 03 00 00 10 sethi %hi(0x4000), %g1 400050a8: 80 a6 c0 01 cmp %i3, %g1 400050ac: 02 bf ff f7 be 40005088 <== ALWAYS TAKEN 400050b0: b0 10 20 00 clr %i0 errno = ENOTSUP; 400050b4: 40 00 25 c6 call 4000e7cc <__errno> 400050b8: 01 00 00 00 nop 400050bc: 82 10 20 86 mov 0x86, %g1 ! 86 400050c0: c2 22 00 00 st %g1, [ %o0 ] rv = -1; 400050c4: b0 10 3f ff mov -1, %i0 } } return rv; } 400050c8: 81 c7 e0 08 ret 400050cc: 81 e8 00 00 restore =============================================================================== 40004160 : */ static volatile bool diskdevs_protected; static rtems_status_code disk_lock(void) { 40004160: 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); 40004164: 03 10 00 68 sethi %hi(0x4001a000), %g1 40004168: d0 00 63 0c ld [ %g1 + 0x30c ], %o0 ! 4001a30c 4000416c: 92 10 20 00 clr %o1 40004170: 94 10 20 00 clr %o2 40004174: 40 00 14 b8 call 40009454 40004178: b0 10 20 16 mov 0x16, %i0 if (sc == RTEMS_SUCCESSFUL) { 4000417c: 80 a2 20 00 cmp %o0, 0 40004180: 12 80 00 05 bne 40004194 <== NEVER TAKEN 40004184: 84 10 20 01 mov 1, %g2 diskdevs_protected = true; 40004188: 03 10 00 68 sethi %hi(0x4001a000), %g1 return RTEMS_SUCCESSFUL; 4000418c: 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; 40004190: c4 28 63 08 stb %g2, [ %g1 + 0x308 ] return RTEMS_SUCCESSFUL; } else { return RTEMS_NOT_CONFIGURED; } } 40004194: 81 c7 e0 08 ret 40004198: 81 e8 00 00 restore =============================================================================== 4000419c : static void disk_unlock(void) { 4000419c: 9d e3 bf a0 save %sp, -96, %sp rtems_status_code sc = RTEMS_SUCCESSFUL; diskdevs_protected = false; 400041a0: 03 10 00 68 sethi %hi(0x4001a000), %g1 400041a4: c0 28 63 08 clrb [ %g1 + 0x308 ] ! 4001a308 sc = rtems_semaphore_release(diskdevs_mutex); 400041a8: 03 10 00 68 sethi %hi(0x4001a000), %g1 400041ac: 40 00 14 f3 call 40009578 400041b0: d0 00 63 0c ld [ %g1 + 0x30c ], %o0 ! 4001a30c if (sc != RTEMS_SUCCESSFUL) { 400041b4: 80 a2 20 00 cmp %o0, 0 400041b8: 02 80 00 04 be 400041c8 <== ALWAYS TAKEN 400041bc: 11 37 ab 6f sethi %hi(0xdeadbc00), %o0 /* FIXME: Error number */ rtems_fatal_error_occurred(0xdeadbeef); 400041c0: 40 00 16 56 call 40009b18 <== NOT EXECUTED 400041c4: 90 12 22 ef or %o0, 0x2ef, %o0 ! deadbeef <== NOT EXECUTED 400041c8: 81 c7 e0 08 ret 400041cc: 81 e8 00 00 restore =============================================================================== 40005a84 : /* * Drain output queue */ static void drainOutput (struct rtems_termios_tty *tty) 40005a84: 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); 40005a88: 7f ff f2 70 call 40002448 40005a8c: 01 00 00 00 nop while (tty->rawOutBuf.Tail != tty->rawOutBuf.Head) { tty->rawOutBufState = rob_wait; 40005a90: 10 80 00 0f b 40005acc 40005a94: b8 10 20 02 mov 2, %i4 ! 2 rtems_interrupt_enable (level); 40005a98: 7f ff f2 70 call 40002458 <== NOT EXECUTED 40005a9c: 01 00 00 00 nop <== NOT EXECUTED sc = rtems_semaphore_obtain( 40005aa0: d0 06 20 8c ld [ %i0 + 0x8c ], %o0 <== NOT EXECUTED 40005aa4: 92 10 20 00 clr %o1 <== NOT EXECUTED 40005aa8: 40 00 09 50 call 40007fe8 <== NOT EXECUTED 40005aac: 94 10 20 00 clr %o2 <== NOT EXECUTED tty->rawOutBuf.Semaphore, RTEMS_WAIT, RTEMS_NO_TIMEOUT); if (sc != RTEMS_SUCCESSFUL) 40005ab0: 80 a2 20 00 cmp %o0, 0 <== NOT EXECUTED 40005ab4: 02 80 00 04 be 40005ac4 <== NOT EXECUTED 40005ab8: 01 00 00 00 nop <== NOT EXECUTED rtems_fatal_error_occurred (sc); 40005abc: 40 00 0b 26 call 40008754 <== NOT EXECUTED 40005ac0: 01 00 00 00 nop <== NOT EXECUTED rtems_interrupt_disable (level); 40005ac4: 7f ff f2 61 call 40002448 <== NOT EXECUTED 40005ac8: 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) { 40005acc: c4 06 20 84 ld [ %i0 + 0x84 ], %g2 40005ad0: c2 06 20 80 ld [ %i0 + 0x80 ], %g1 40005ad4: 80 a0 80 01 cmp %g2, %g1 40005ad8: 32 bf ff f0 bne,a 40005a98 <== NEVER TAKEN 40005adc: 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); 40005ae0: 7f ff f2 5e call 40002458 40005ae4: 91 e8 00 08 restore %g0, %o0, %o0 =============================================================================== 40004500 : int dup( int fildes ) { return fcntl( fildes, F_DUPFD, 0 ); 40004500: 92 10 20 00 clr %o1 40004504: 94 10 20 00 clr %o2 40004508: 82 13 c0 00 mov %o7, %g1 4000450c: 40 00 00 0c call 4000453c 40004510: 9e 10 40 00 mov %g1, %o7 40004514: 40 00 45 bc call 40015c04 <== NOT EXECUTED 40004518: 40 00 46 98 call 40015f78 <== NOT EXECUTED 4000451c: 40 00 46 a4 call 40015fac <== NOT EXECUTED 40004520: 40 00 46 bc call 40016010 <== NOT EXECUTED 40004524: 40 00 46 cc call 40016054 <== NOT EXECUTED 40004528: 40 00 46 f0 call 400160e8 <== NOT EXECUTED 4000452c: 40 00 46 f0 call 400160ec <== NOT EXECUTED 40004530: 40 00 46 f0 call 400160f0 <== NOT EXECUTED 40004534: 40 00 46 f0 call 400160f4 <== NOT EXECUTED 40004538: 40 00 46 f0 call 400160f8 <== NOT EXECUTED =============================================================================== 400044b4 : */ int dup2( int fildes, int fildes2 ) { 400044b4: 9d e3 bf 58 save %sp, -168, %sp /* * If fildes is not valid, then fildes2 should not be closed. */ status = fstat( fildes, &buf ); 400044b8: 90 10 00 18 mov %i0, %o0 400044bc: 40 00 01 46 call 400049d4 400044c0: 92 07 bf b8 add %fp, -72, %o1 if ( status == -1 ) 400044c4: 80 a2 3f ff cmp %o0, -1 400044c8: 12 80 00 04 bne 400044d8 400044cc: 90 10 00 19 mov %i1, %o0 return -1; 400044d0: 81 c7 e0 08 ret 400044d4: 91 e8 3f ff restore %g0, -1, %o0 /* * If fildes2 is not valid, then we should not do anything either. */ status = fstat( fildes2, &buf ); 400044d8: 40 00 01 3f call 400049d4 400044dc: 92 07 bf b8 add %fp, -72, %o1 if ( status == -1 ) 400044e0: 80 a2 3f ff cmp %o0, -1 400044e4: 02 bf ff fb be 400044d0 <== NEVER TAKEN 400044e8: 90 10 00 18 mov %i0, %o0 /* * This fcntl handles everything else. */ return fcntl( fildes, F_DUPFD, fildes2 ); 400044ec: 92 10 20 00 clr %o1 400044f0: 40 00 00 13 call 4000453c 400044f4: 94 10 00 19 mov %i1, %o2 } 400044f8: 81 c7 e0 08 ret 400044fc: 91 e8 00 08 restore %g0, %o0, %o0 =============================================================================== 40006870 : /* * Echo a typed character */ static void echo (unsigned char c, struct rtems_termios_tty *tty) { 40006870: 9d e3 bf 98 save %sp, -104, %sp if ((tty->termios.c_lflag & ECHOCTL) && 40006874: c2 06 60 3c ld [ %i1 + 0x3c ], %g1 40006878: 80 88 62 00 btst 0x200, %g1 4000687c: 02 80 00 19 be 400068e0 <== NEVER TAKEN 40006880: 03 10 00 75 sethi %hi(0x4001d400), %g1 iscntrl(c) && (c != '\t') && (c != '\n')) { 40006884: c2 00 60 18 ld [ %g1 + 0x18 ], %g1 ! 4001d418 <__ctype_ptr__> 40006888: 82 00 40 18 add %g1, %i0, %g1 4000688c: 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) && 40006890: 80 88 60 20 btst 0x20, %g1 40006894: 02 80 00 14 be 400068e4 40006898: 90 10 00 18 mov %i0, %o0 iscntrl(c) && (c != '\t') && (c != '\n')) { 4000689c: 82 06 3f f7 add %i0, -9, %g1 400068a0: 82 08 60 ff and %g1, 0xff, %g1 400068a4: 80 a0 60 01 cmp %g1, 1 400068a8: 08 80 00 0f bleu 400068e4 400068ac: 82 10 20 5e mov 0x5e, %g1 char echobuf[2]; echobuf[0] = '^'; echobuf[1] = c ^ 0x40; 400068b0: 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] = '^'; 400068b4: c2 2f bf f8 stb %g1, [ %fp + -8 ] echobuf[1] = c ^ 0x40; 400068b8: f0 2f bf f9 stb %i0, [ %fp + -7 ] rtems_termios_puts (echobuf, 2, tty); 400068bc: 90 07 bf f8 add %fp, -8, %o0 400068c0: 92 10 20 02 mov 2, %o1 400068c4: 7f ff ff 43 call 400065d0 400068c8: 94 10 00 19 mov %i1, %o2 tty->column += 2; 400068cc: c2 06 60 28 ld [ %i1 + 0x28 ], %g1 400068d0: 82 00 60 02 add %g1, 2, %g1 400068d4: c2 26 60 28 st %g1, [ %i1 + 0x28 ] 400068d8: 81 c7 e0 08 ret 400068dc: 81 e8 00 00 restore } else { oproc (c, tty); 400068e0: 90 10 00 18 mov %i0, %o0 <== NOT EXECUTED 400068e4: 7f ff ff 84 call 400066f4 400068e8: 92 10 00 19 mov %i1, %o1 400068ec: 81 c7 e0 08 ret 400068f0: 81 e8 00 00 restore =============================================================================== 400244f4 : } void endgrent(void) { if (group_fp != NULL) 400244f4: 03 10 01 89 sethi %hi(0x40062400), %g1 400244f8: d0 00 63 58 ld [ %g1 + 0x358 ], %o0 ! 40062758 400244fc: 80 a2 20 00 cmp %o0, 0 40024500: 02 80 00 05 be 40024514 <== NEVER TAKEN 40024504: 01 00 00 00 nop fclose(group_fp); 40024508: 82 13 c0 00 mov %o7, %g1 4002450c: 40 00 48 6a call 400366b4 40024510: 9e 10 40 00 mov %g1, %o7 40024514: 81 c3 e0 08 retl <== NOT EXECUTED =============================================================================== 40024350 : } void endpwent(void) { if (passwd_fp != NULL) 40024350: 03 10 01 89 sethi %hi(0x40062400), %g1 40024354: d0 00 62 78 ld [ %g1 + 0x278 ], %o0 ! 40062678 40024358: 80 a2 20 00 cmp %o0, 0 4002435c: 02 80 00 05 be 40024370 <== NEVER TAKEN 40024360: 01 00 00 00 nop fclose(passwd_fp); 40024364: 82 13 c0 00 mov %o7, %g1 40024368: 40 00 48 d3 call 400366b4 4002436c: 9e 10 40 00 mov %g1, %o7 40024370: 81 c3 e0 08 retl <== NOT EXECUTED =============================================================================== 400068f4 : * 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) 400068f4: 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); 400068f8: 35 10 00 70 sethi %hi(0x4001c000), %i2 * Erase a character or line * FIXME: Needs support for WERASE and ECHOPRT. * FIXME: Some of the tests should check for IEXTEN, too. */ static void erase (struct rtems_termios_tty *tty, int lineFlag) 400068fc: ba 10 00 18 mov %i0, %i5 40006900: 37 10 00 75 sethi %hi(0x4001d400), %i3 /* * Back up over the tab */ while (tty->column > col) { rtems_termios_puts ("\b", 1, tty); 40006904: 31 10 00 70 sethi %hi(0x4001c000), %i0 rtems_termios_puts ("\b \b", 3, tty); if (tty->column) tty->column--; } if (!iscntrl (c) || (tty->termios.c_lflag & ECHOCTL)) { rtems_termios_puts ("\b \b", 3, tty); 40006908: b4 16 a0 18 or %i2, 0x18, %i2 /* * Back up over the tab */ while (tty->column > col) { rtems_termios_puts ("\b", 1, tty); 4000690c: 10 80 00 62 b 40006a94 40006910: b0 16 20 10 or %i0, 0x10, %i0 } while (tty->ccount) { unsigned char c = tty->cbuf[--tty->ccount]; if (tty->termios.c_lflag & ECHO) { 40006914: c2 07 60 3c ld [ %i5 + 0x3c ], %g1 return; } } while (tty->ccount) { unsigned char c = tty->cbuf[--tty->ccount]; 40006918: 86 00 ff ff add %g3, -1, %g3 4000691c: c6 27 60 20 st %g3, [ %i5 + 0x20 ] if (tty->termios.c_lflag & ECHO) { 40006920: 80 88 60 08 btst 8, %g1 40006924: 02 80 00 59 be 40006a88 <== NEVER TAKEN 40006928: f8 09 00 03 ldub [ %g4 + %g3 ], %i4 if (!lineFlag && !(tty->termios.c_lflag & ECHOE)) { 4000692c: 80 a6 60 00 cmp %i1, 0 40006930: 32 80 00 08 bne,a 40006950 40006934: b8 0f 20 ff and %i4, 0xff, %i4 40006938: 80 88 60 10 btst 0x10, %g1 4000693c: 32 80 00 05 bne,a 40006950 <== ALWAYS TAKEN 40006940: b8 0f 20 ff and %i4, 0xff, %i4 echo (tty->termios.c_cc[VERASE], tty); 40006944: f0 0f 60 43 ldub [ %i5 + 0x43 ], %i0 <== NOT EXECUTED 40006948: 7f ff ff ca call 40006870 <== NOT EXECUTED 4000694c: 93 e8 00 1d restore %g0, %i5, %o1 <== NOT EXECUTED } else if (c == '\t') { 40006950: 80 a7 20 09 cmp %i4, 9 40006954: 32 80 00 28 bne,a 400069f4 40006958: c4 06 e0 18 ld [ %i3 + 0x18 ], %g2 int col = tty->read_start_column; 4000695c: 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)) { 40006960: da 06 e0 18 ld [ %i3 + 0x18 ], %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; 40006964: 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) 40006968: 10 80 00 12 b 400069b0 4000696c: 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') { 40006970: 80 a3 e0 09 cmp %o7, 9 40006974: 12 80 00 04 bne 40006984 40006978: 84 00 a0 01 inc %g2 col = (col | 7) + 1; 4000697c: 10 80 00 0c b 400069ac 40006980: b8 17 20 07 or %i4, 7, %i4 } else if (iscntrl (c)) { 40006984: 9e 03 40 0f add %o5, %o7, %o7 40006988: de 0b e0 01 ldub [ %o7 + 1 ], %o7 4000698c: 80 8b e0 20 btst 0x20, %o7 40006990: 22 80 00 08 be,a 400069b0 <== ALWAYS TAKEN 40006994: b8 07 20 01 inc %i4 if (tty->termios.c_lflag & ECHOCTL) 40006998: 80 a0 60 00 cmp %g1, 0 <== NOT EXECUTED 4000699c: 32 80 00 05 bne,a 400069b0 <== NOT EXECUTED 400069a0: b8 07 20 02 add %i4, 2, %i4 <== NOT EXECUTED int i = 0; /* * Find the character before the tab */ while (i != tty->ccount) { 400069a4: 10 80 00 04 b 400069b4 <== NOT EXECUTED 400069a8: 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++; 400069ac: b8 07 20 01 inc %i4 int i = 0; /* * Find the character before the tab */ while (i != tty->ccount) { 400069b0: 80 a0 80 03 cmp %g2, %g3 400069b4: 32 bf ff ef bne,a 40006970 400069b8: de 09 00 02 ldub [ %g4 + %g2 ], %o7 } /* * Back up over the tab */ while (tty->column > col) { 400069bc: 10 80 00 09 b 400069e0 400069c0: c2 07 60 28 ld [ %i5 + 0x28 ], %g1 rtems_termios_puts ("\b", 1, tty); 400069c4: 92 10 20 01 mov 1, %o1 400069c8: 7f ff ff 02 call 400065d0 400069cc: 94 10 00 1d mov %i5, %o2 tty->column--; 400069d0: c2 07 60 28 ld [ %i5 + 0x28 ], %g1 400069d4: 82 00 7f ff add %g1, -1, %g1 400069d8: c2 27 60 28 st %g1, [ %i5 + 0x28 ] } /* * Back up over the tab */ while (tty->column > col) { 400069dc: c2 07 60 28 ld [ %i5 + 0x28 ], %g1 400069e0: 80 a0 40 1c cmp %g1, %i4 400069e4: 14 bf ff f8 bg 400069c4 400069e8: 90 10 00 18 mov %i0, %o0 if (tty->column) tty->column--; } } } if (!lineFlag) 400069ec: 10 80 00 28 b 40006a8c 400069f0: 80 a6 60 00 cmp %i1, 0 rtems_termios_puts ("\b", 1, tty); tty->column--; } } else { if (iscntrl (c) && (tty->termios.c_lflag & ECHOCTL)) { 400069f4: b8 07 20 01 inc %i4 400069f8: c4 08 80 1c ldub [ %g2 + %i4 ], %g2 400069fc: 80 88 a0 20 btst 0x20, %g2 40006a00: 22 80 00 10 be,a 40006a40 <== ALWAYS TAKEN 40006a04: c2 06 e0 18 ld [ %i3 + 0x18 ], %g1 40006a08: 80 88 62 00 btst 0x200, %g1 <== NOT EXECUTED 40006a0c: 02 80 00 0d be 40006a40 <== NOT EXECUTED 40006a10: c2 06 e0 18 ld [ %i3 + 0x18 ], %g1 <== NOT EXECUTED rtems_termios_puts ("\b \b", 3, tty); 40006a14: 90 10 00 1a mov %i2, %o0 <== NOT EXECUTED 40006a18: 92 10 20 03 mov 3, %o1 <== NOT EXECUTED 40006a1c: 7f ff fe ed call 400065d0 <== NOT EXECUTED 40006a20: 94 10 00 1d mov %i5, %o2 <== NOT EXECUTED if (tty->column) 40006a24: c2 07 60 28 ld [ %i5 + 0x28 ], %g1 <== NOT EXECUTED 40006a28: 80 a0 60 00 cmp %g1, 0 <== NOT EXECUTED 40006a2c: 22 80 00 05 be,a 40006a40 <== NOT EXECUTED 40006a30: c2 06 e0 18 ld [ %i3 + 0x18 ], %g1 <== NOT EXECUTED tty->column--; 40006a34: 82 00 7f ff add %g1, -1, %g1 <== NOT EXECUTED 40006a38: c2 27 60 28 st %g1, [ %i5 + 0x28 ] <== NOT EXECUTED } if (!iscntrl (c) || (tty->termios.c_lflag & ECHOCTL)) { 40006a3c: c2 06 e0 18 ld [ %i3 + 0x18 ], %g1 <== NOT EXECUTED 40006a40: c2 08 40 1c ldub [ %g1 + %i4 ], %g1 40006a44: 80 88 60 20 btst 0x20, %g1 40006a48: 02 80 00 07 be 40006a64 <== ALWAYS TAKEN 40006a4c: 90 10 00 1a mov %i2, %o0 40006a50: c2 07 60 3c ld [ %i5 + 0x3c ], %g1 <== NOT EXECUTED 40006a54: 80 88 62 00 btst 0x200, %g1 <== NOT EXECUTED 40006a58: 02 80 00 0d be 40006a8c <== NOT EXECUTED 40006a5c: 80 a6 60 00 cmp %i1, 0 <== NOT EXECUTED rtems_termios_puts ("\b \b", 3, tty); 40006a60: 90 10 00 1a mov %i2, %o0 <== NOT EXECUTED 40006a64: 92 10 20 03 mov 3, %o1 40006a68: 7f ff fe da call 400065d0 40006a6c: 94 10 00 1d mov %i5, %o2 if (tty->column) 40006a70: c2 07 60 28 ld [ %i5 + 0x28 ], %g1 40006a74: 80 a0 60 00 cmp %g1, 0 40006a78: 02 80 00 05 be 40006a8c <== NEVER TAKEN 40006a7c: 80 a6 60 00 cmp %i1, 0 tty->column--; 40006a80: 82 00 7f ff add %g1, -1, %g1 40006a84: c2 27 60 28 st %g1, [ %i5 + 0x28 ] } } } if (!lineFlag) 40006a88: 80 a6 60 00 cmp %i1, 0 40006a8c: 02 80 00 06 be 40006aa4 40006a90: 01 00 00 00 nop echo ('\n', tty); return; } } while (tty->ccount) { 40006a94: c6 07 60 20 ld [ %i5 + 0x20 ], %g3 40006a98: 80 a0 e0 00 cmp %g3, 0 40006a9c: 32 bf ff 9e bne,a 40006914 40006aa0: c8 07 60 1c ld [ %i5 + 0x1c ], %g4 40006aa4: 81 c7 e0 08 ret 40006aa8: 81 e8 00 00 restore =============================================================================== 40005080 : size_t pathlen, int eval_flags, rtems_filesystem_global_location_t *const *global_root_ptr, rtems_filesystem_global_location_t *const *global_current_ptr ) { 40005080: 9d e3 bf 98 save %sp, -104, %sp memset(ctx, 0, sizeof(*ctx)); 40005084: 92 10 20 00 clr %o1 40005088: 90 10 00 18 mov %i0, %o0 4000508c: 40 00 29 bc call 4000f77c 40005090: 94 10 20 38 mov 0x38, %o2 ctx->path = path; 40005094: f2 26 00 00 st %i1, [ %i0 ] ctx->pathlen = pathlen; 40005098: 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) { 4000509c: 80 a6 a0 00 cmp %i2, 0 400050a0: 02 80 00 19 be 40005104 400050a4: f6 26 20 10 st %i3, [ %i0 + 0x10 ] char c = ctx->path [0]; 400050a8: f6 0e 40 00 ldub [ %i1 ], %i3 ctx->rootloc = rtems_filesystem_global_location_obtain(global_root_ptr); 400050ac: 40 00 01 79 call 40005690 400050b0: 90 10 00 1c mov %i4, %o0 gid_t node_gid ); static inline bool rtems_filesystem_is_delimiter(char c) { return c == '/' || c == '\\'; 400050b4: 83 2e e0 18 sll %i3, 0x18, %g1 400050b8: 83 38 60 18 sra %g1, 0x18, %g1 if (rtems_filesystem_is_delimiter(c)) { 400050bc: 80 a0 60 5c cmp %g1, 0x5c 400050c0: 02 80 00 05 be 400050d4 <== NEVER TAKEN 400050c4: d0 26 20 30 st %o0, [ %i0 + 0x30 ] 400050c8: 80 a0 60 2f cmp %g1, 0x2f 400050cc: 12 80 00 0a bne 400050f4 400050d0: 90 10 00 1d mov %i5, %o0 ++ctx->path; 400050d4: c2 06 00 00 ld [ %i0 ], %g1 --ctx->pathlen; ctx->startloc = rtems_filesystem_global_location_obtain( 400050d8: 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; 400050dc: 82 00 60 01 inc %g1 400050e0: c2 26 00 00 st %g1, [ %i0 ] --ctx->pathlen; 400050e4: c2 06 20 04 ld [ %i0 + 4 ], %g1 400050e8: 82 00 7f ff add %g1, -1, %g1 400050ec: 10 80 00 02 b 400050f4 400050f0: 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( 400050f4: 40 00 01 67 call 40005690 400050f8: 01 00 00 00 nop 400050fc: 10 80 00 0d b 40005130 40005100: 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; 40005104: c0 27 bf fc clr [ %fp + -4 ] return rtems_filesystem_global_location_obtain( &global_loc ); 40005108: 40 00 01 62 call 40005690 4000510c: 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; 40005110: c0 27 bf fc clr [ %fp + -4 ] global_current_ptr ); } } else { ctx->rootloc = rtems_filesystem_global_location_obtain_null(); 40005114: d0 26 20 30 st %o0, [ %i0 + 0x30 ] return rtems_filesystem_global_location_obtain( &global_loc ); 40005118: 40 00 01 5e call 40005690 4000511c: 90 07 bf fc add %fp, -4, %o0 ctx->startloc = rtems_filesystem_global_location_obtain_null(); errno = ENOENT; 40005120: 40 00 27 09 call 4000ed44 <__errno> 40005124: d0 26 20 34 st %o0, [ %i0 + 0x34 ] 40005128: 82 10 20 02 mov 2, %g1 4000512c: 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; 40005130: c2 06 20 34 ld [ %i0 + 0x34 ], %g1 40005134: d0 00 60 14 ld [ %g1 + 0x14 ], %o0 (*mt_entry->ops->lock_h)( mt_entry ); 40005138: c2 02 20 0c ld [ %o0 + 0xc ], %g1 4000513c: c2 00 40 00 ld [ %g1 ], %g1 40005140: 9f c0 40 00 call %g1 40005144: 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( 40005148: d2 06 20 34 ld [ %i0 + 0x34 ], %o1 4000514c: 40 00 1c af call 4000c408 40005150: 90 10 00 1d mov %i5, %o0 &ctx->currentloc, &ctx->startloc->location ); rtems_filesystem_eval_path_continue(ctx); 40005154: 90 10 00 18 mov %i0, %o0 40005158: 7f ff ff b0 call 40005018 4000515c: b0 10 00 1d mov %i5, %i0 return &ctx->currentloc; } 40005160: 81 c7 e0 08 ret 40005164: 81 e8 00 00 restore =============================================================================== 400133bc : int fat_buf_access(fat_fs_info_t *fs_info, const uint32_t sec_num, const int op_type, uint8_t **sec_buf) { 400133bc: 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); 400133c0: c2 0e 20 02 ldub [ %i0 + 2 ], %g1 400133c4: c4 0e 20 0c ldub [ %i0 + 0xc ], %g2 400133c8: 84 20 80 01 sub %g2, %g1, %g2 400133cc: 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); 400133d0: 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 - 400133d4: 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); 400133d8: 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) 400133dc: c2 0e 20 89 ldub [ %i0 + 0x89 ], %g1 400133e0: 80 a0 60 00 cmp %g1, 0 400133e4: 02 80 00 06 be 400133fc 400133e8: 01 00 00 00 nop 400133ec: c2 06 20 84 ld [ %i0 + 0x84 ], %g1 400133f0: 80 a0 40 19 cmp %g1, %i1 400133f4: 22 80 00 1c be,a 40013464 400133f8: c2 06 20 8c ld [ %i0 + 0x8c ], %g1 { fat_buf_release(fs_info); 400133fc: 7f ff ff 7c call 400131ec 40013400: 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); 40013404: 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) 40013408: 80 a6 a0 01 cmp %i2, 1 4001340c: d0 06 20 64 ld [ %i0 + 0x64 ], %o0 40013410: 12 80 00 06 bne 40013428 40013414: 94 06 20 8c add %i0, 0x8c, %o2 sc = rtems_bdbuf_read(fs_info->vol.dd, blk, &fs_info->c.buf); 40013418: 7f ff f7 ae call 400112d0 4001341c: 01 00 00 00 nop else sc = rtems_bdbuf_get(fs_info->vol.dd, blk, &fs_info->c.buf); if (sc != RTEMS_SUCCESSFUL) 40013420: 10 80 00 05 b 40013434 40013424: 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); 40013428: 7f ff f7 79 call 4001120c 4001342c: 01 00 00 00 nop if (sc != RTEMS_SUCCESSFUL) 40013430: 80 a2 20 00 cmp %o0, 0 40013434: 02 80 00 08 be 40013454 <== ALWAYS TAKEN 40013438: 82 10 20 01 mov 1, %g1 rtems_set_errno_and_return_minus_one(EIO); 4001343c: 40 00 1d da call 4001aba4 <__errno> <== NOT EXECUTED 40013440: b0 10 3f ff mov -1, %i0 <== NOT EXECUTED 40013444: 82 10 20 05 mov 5, %g1 <== NOT EXECUTED 40013448: c2 22 00 00 st %g1, [ %o0 ] <== NOT EXECUTED 4001344c: 81 c7 e0 08 ret <== NOT EXECUTED 40013450: 81 e8 00 00 restore <== NOT EXECUTED fs_info->c.blk_num = sec_num; 40013454: f2 26 20 84 st %i1, [ %i0 + 0x84 ] fs_info->c.modified = 0; 40013458: c0 2e 20 88 clrb [ %i0 + 0x88 ] fs_info->c.state = FAT_CACHE_ACTUAL; 4001345c: c2 2e 20 89 stb %g1, [ %i0 + 0x89 ] } *sec_buf = &fs_info->c.buf->buffer[blk_ofs]; 40013460: c2 06 20 8c ld [ %i0 + 0x8c ], %g1 40013464: c2 00 60 1c ld [ %g1 + 0x1c ], %g1 40013468: b8 00 40 1c add %g1, %i4, %i4 4001346c: f8 26 c0 00 st %i4, [ %i3 ] return RC_OK; } 40013470: 81 c7 e0 08 ret 40013474: 91 e8 20 00 restore %g0, 0, %o0 =============================================================================== 400131ec : return RC_OK; } int fat_buf_release(fat_fs_info_t *fs_info) { 400131ec: 9d e3 bf 98 save %sp, -104, %sp rtems_status_code sc = RTEMS_SUCCESSFUL; if (fs_info->c.state == FAT_CACHE_EMPTY) 400131f0: c2 0e 20 89 ldub [ %i0 + 0x89 ], %g1 return RC_OK; } int fat_buf_release(fat_fs_info_t *fs_info) { 400131f4: ba 10 00 18 mov %i0, %i5 rtems_status_code sc = RTEMS_SUCCESSFUL; if (fs_info->c.state == FAT_CACHE_EMPTY) 400131f8: 80 a0 60 00 cmp %g1, 0 400131fc: 02 80 00 6e be 400133b4 40013200: b0 10 20 00 clr %i0 return RC_OK; if (fs_info->c.modified) 40013204: c2 0f 60 88 ldub [ %i5 + 0x88 ], %g1 40013208: 80 a0 60 00 cmp %g1, 0 4001320c: 02 80 00 5d be 40013380 40013210: 01 00 00 00 nop { uint32_t sec_num = fs_info->c.blk_num; 40013214: c2 07 60 84 ld [ %i5 + 0x84 ], %g1 bool sec_of_fat = ((sec_num >= fs_info->vol.fat_loc) && 40013218: c4 17 60 18 lduh [ %i5 + 0x18 ], %g2 4001321c: 80 a0 40 02 cmp %g1, %g2 40013220: 0a 80 00 05 bcs 40013234 40013224: b8 10 20 00 clr %i4 40013228: c4 07 60 20 ld [ %i5 + 0x20 ], %g2 4001322c: 80 a0 40 02 cmp %g1, %g2 40013230: b8 40 20 00 addx %g0, 0, %i4 uint32_t ino ) { return (ino >= fs_info->uino_base); } 40013234: 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) 40013238: 80 8f 20 ff btst 0xff, %i4 4001323c: 02 80 00 12 be 40013284 40013240: c6 0f 60 0c ldub [ %i5 + 0xc ], %g3 40013244: c8 0f 60 54 ldub [ %i5 + 0x54 ], %g4 40013248: 80 a1 20 00 cmp %g4, 0 4001324c: 12 80 00 0e bne 40013284 <== NEVER TAKEN 40013250: 84 08 a0 ff and %g2, 0xff, %g2 memcpy(fs_info->sec_buf, fs_info->c.buf->buffer + blk_ofs, 40013254: 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, 40013258: d0 07 60 90 ld [ %i5 + 0x90 ], %o0 4001325c: d2 01 20 1c ld [ %g4 + 0x1c ], %o1 40013260: d4 17 40 00 lduh [ %i5 ], %o2 40013264: 86 08 e0 ff and %g3, 0xff, %g3 40013268: 86 20 c0 02 sub %g3, %g2, %g3 4001326c: 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); 40013270: 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 - 40013274: 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); 40013278: 85 28 40 02 sll %g1, %g2, %g2 4001327c: 40 00 20 ef call 4001b638 40013280: 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); 40013284: 7f ff f8 c4 call 40011594 40013288: d0 07 60 8c ld [ %i5 + 0x8c ], %o0 if (sc != RTEMS_SUCCESSFUL) 4001328c: 80 a2 20 00 cmp %o0, 0 40013290: 12 80 00 41 bne 40013394 <== NEVER TAKEN 40013294: 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) 40013298: 02 80 00 45 be 400133ac 4001329c: c0 2f 60 88 clrb [ %i5 + 0x88 ] 400132a0: c2 0f 60 54 ldub [ %i5 + 0x54 ], %g1 400132a4: 80 a0 60 00 cmp %g1, 0 400132a8: 22 80 00 2f be,a 40013364 <== ALWAYS TAKEN 400132ac: 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; 400132b0: 10 80 00 40 b 400133b0 <== NOT EXECUTED 400132b4: 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, 400132b8: 7f ff bc e6 call 40002650 <.umul> 400132bc: d2 07 60 1c ld [ %i5 + 0x1c ], %o1 400132c0: 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); 400132c4: c2 0f 60 02 ldub [ %i5 + 2 ], %g1 400132c8: 90 02 00 1b add %o0, %i3, %o0 400132cc: f6 0f 60 0c ldub [ %i5 + 0xc ], %i3 400132d0: b6 26 c0 01 sub %i3, %g1, %i3 400132d4: 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); 400132d8: 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 - 400132dc: 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); 400132e0: 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 400132e4: 80 a6 e0 00 cmp %i3, 0 400132e8: 12 80 00 0b bne 40013314 400132ec: d0 07 60 64 ld [ %i5 + 0x64 ], %o0 && fs_info->vol.bps == fs_info->vol.bytes_per_block) 400132f0: c4 17 40 00 lduh [ %i5 ], %g2 400132f4: c2 17 60 0a lduh [ %i5 + 0xa ], %g1 400132f8: 80 a0 80 01 cmp %g2, %g1 400132fc: 12 80 00 06 bne 40013314 40013300: 01 00 00 00 nop { sc = rtems_bdbuf_get(fs_info->vol.dd, blk, &bd); 40013304: 7f ff f7 c2 call 4001120c 40013308: 94 07 bf fc add %fp, -4, %o2 } else { sc = rtems_bdbuf_read(fs_info->vol.dd, blk, &bd); } if ( sc != RTEMS_SUCCESSFUL) 4001330c: 10 80 00 05 b 40013320 40013310: 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); 40013314: 7f ff f7 ef call 400112d0 40013318: 94 07 bf fc add %fp, -4, %o2 } if ( sc != RTEMS_SUCCESSFUL) 4001331c: 80 a2 20 00 cmp %o0, 0 40013320: 22 80 00 03 be,a 4001332c <== ALWAYS TAKEN 40013324: c2 07 bf fc ld [ %fp + -4 ], %g1 40013328: 30 80 00 0b b,a 40013354 <== NOT EXECUTED rtems_set_errno_and_return_minus_one(ENOMEM); memcpy(bd->buffer + blk_ofs, fs_info->sec_buf, fs_info->vol.bps); 4001332c: d2 07 60 90 ld [ %i5 + 0x90 ], %o1 40013330: d0 00 60 1c ld [ %g1 + 0x1c ], %o0 40013334: d4 17 40 00 lduh [ %i5 ], %o2 40013338: 40 00 20 c0 call 4001b638 4001333c: 90 02 00 1b add %o0, %i3, %o0 sc = rtems_bdbuf_release_modified(bd); 40013340: 7f ff f8 95 call 40011594 40013344: d0 07 bf fc ld [ %fp + -4 ], %o0 if ( sc != RTEMS_SUCCESSFUL) 40013348: 80 a2 20 00 cmp %o0, 0 4001334c: 22 80 00 06 be,a 40013364 <== ALWAYS TAKEN 40013350: b8 07 20 01 inc %i4 rtems_set_errno_and_return_minus_one(ENOMEM); 40013354: 40 00 1e 14 call 4001aba4 <__errno> <== NOT EXECUTED 40013358: 01 00 00 00 nop <== NOT EXECUTED 4001335c: 10 80 00 11 b 400133a0 <== NOT EXECUTED 40013360: 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++) 40013364: c2 0f 60 0d ldub [ %i5 + 0xd ], %g1 40013368: 90 0f 20 ff and %i4, 0xff, %o0 4001336c: 80 a2 00 01 cmp %o0, %g1 40013370: 0a bf ff d2 bcs 400132b8 40013374: 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; 40013378: 10 80 00 0e b 400133b0 4001337c: c0 2f 60 89 clrb [ %i5 + 0x89 ] } } } else { sc = rtems_bdbuf_release(fs_info->c.buf); 40013380: 7f ff f8 50 call 400114c0 40013384: d0 07 60 8c ld [ %i5 + 0x8c ], %o0 if (sc != RTEMS_SUCCESSFUL) 40013388: 80 a2 20 00 cmp %o0, 0 4001338c: 22 80 00 09 be,a 400133b0 <== ALWAYS TAKEN 40013390: c0 2f 60 89 clrb [ %i5 + 0x89 ] rtems_set_errno_and_return_minus_one(EIO); 40013394: 40 00 1e 04 call 4001aba4 <__errno> <== NOT EXECUTED 40013398: 01 00 00 00 nop <== NOT EXECUTED 4001339c: 82 10 20 05 mov 5, %g1 ! 5 <== NOT EXECUTED 400133a0: c2 22 00 00 st %g1, [ %o0 ] <== NOT EXECUTED 400133a4: 81 c7 e0 08 ret <== NOT EXECUTED 400133a8: 91 e8 3f ff restore %g0, -1, %o0 <== NOT EXECUTED } fs_info->c.state = FAT_CACHE_EMPTY; 400133ac: c0 2f 60 89 clrb [ %i5 + 0x89 ] return RC_OK; 400133b0: b0 10 20 00 clr %i0 } 400133b4: 81 c7 e0 08 ret 400133b8: 81 e8 00 00 restore =============================================================================== 40013190 : 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)) ) 40013190: 80 a2 60 00 cmp %o1, 0 40013194: 32 80 00 0c bne,a 400131c4 40013198: c2 0a 20 0c ldub [ %o0 + 0xc ], %g1 4001319c: c2 0a 20 0e ldub [ %o0 + 0xe ], %g1 400131a0: 80 88 60 03 btst 3, %g1 400131a4: 22 80 00 08 be,a 400131c4 <== NEVER TAKEN 400131a8: 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); 400131ac: c4 0a 20 0c ldub [ %o0 + 0xc ], %g2 400131b0: c2 0a 20 02 ldub [ %o0 + 2 ], %g1 400131b4: d0 02 20 20 ld [ %o0 + 0x20 ], %o0 400131b8: 82 20 80 01 sub %g2, %g1, %g1 400131bc: 81 c3 e0 08 retl 400131c0: 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); 400131c4: 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; 400131c8: 92 02 7f fe add %o1, -2, %o1 blk = cln << (fs_info->vol.bpc_log2 - fs_info->vol.bytes_per_block_log2); 400131cc: 84 20 80 01 sub %g2, %g1, %g2 400131d0: 93 2a 40 02 sll %o1, %g2, %o1 400131d4: c4 0a 20 02 ldub [ %o0 + 2 ], %g2 400131d8: d0 02 20 34 ld [ %o0 + 0x34 ], %o0 400131dc: 82 20 40 02 sub %g1, %g2, %g1 400131e0: 91 32 00 01 srl %o0, %g1, %o0 blk += fat_sector_num_to_block_num(fs_info, fs_info->vol.data_fsec); } return blk; } 400131e4: 81 c3 e0 08 retl 400131e8: 90 02 00 09 add %o0, %o1, %o0 =============================================================================== 400124ec : 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)) ) 400124ec: 80 a2 60 00 cmp %o1, 0 400124f0: 32 80 00 08 bne,a 40012510 400124f4: c2 0a 20 05 ldub [ %o0 + 5 ], %g1 400124f8: c2 0a 20 0e ldub [ %o0 + 0xe ], %g1 400124fc: 80 88 60 03 btst 3, %g1 40012500: 22 80 00 04 be,a 40012510 <== NEVER TAKEN 40012504: c2 0a 20 05 ldub [ %o0 + 5 ], %g1 <== NOT EXECUTED return fs_info->vol.rdir_loc; 40012508: 81 c3 e0 08 retl 4001250c: d0 02 20 20 ld [ %o0 + 0x20 ], %o0 return (((cln - FAT_RSRVD_CLN) << fs_info->vol.spc_log2) + 40012510: 92 02 7f fe add %o1, -2, %o1 40012514: 93 2a 40 01 sll %o1, %g1, %o1 40012518: c2 02 20 34 ld [ %o0 + 0x34 ], %g1 fs_info->vol.data_fsec); } 4001251c: 81 c3 e0 08 retl 40012520: 90 02 40 01 add %o1, %g1, %o0 =============================================================================== 40013590 : fat_fs_info_t *fs_info, const uint32_t start_cln, const uint32_t offset, const uint32_t count, const uint8_t pattern) { 40013590: 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)); 40013594: c2 16 20 06 lduh [ %i0 + 6 ], %g1 40013598: 82 20 40 1a sub %g1, %i2, %g1 4001359c: 80 a6 c0 01 cmp %i3, %g1 400135a0: 38 80 00 02 bgu,a 400135a8 <== NEVER TAKEN 400135a4: b6 10 00 01 mov %g1, %i3 <== NOT EXECUTED uint32_t cur_blk = fat_cluster_num_to_block_num(fs_info, start_cln); 400135a8: 90 10 00 18 mov %i0, %o0 400135ac: 7f ff fe f9 call 40013190 400135b0: 92 10 00 19 mov %i1, %o1 uint32_t blocks_in_offset = offset >> fs_info->vol.bytes_per_block_log2; 400135b4: 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; 400135b8: 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; 400135bc: a3 36 80 01 srl %i2, %g1, %l1 uint32_t ofs_blk = offset - (blocks_in_offset << fs_info->vol.bytes_per_block_log2); 400135c0: 83 2c 40 01 sll %l1, %g1, %g1 400135c4: a4 10 20 01 mov 1, %l2 400135c8: b4 26 80 01 sub %i2, %g1, %i2 ssize_t bytes_written = 0; ssize_t ret; cur_blk += blocks_in_offset; 400135cc: a2 02 00 11 add %o0, %l1, %l1 while ( (RC_OK == rc) 400135d0: 10 80 00 2a b 40013678 400135d4: 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)); 400135d8: 82 20 80 1a sub %g2, %i2, %g1 400135dc: 80 a0 40 1b cmp %g1, %i3 400135e0: 08 80 00 03 bleu 400135ec <== ALWAYS TAKEN 400135e4: ba 10 00 01 mov %g1, %i5 400135e8: 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)); 400135ec: 80 a7 40 01 cmp %i5, %g1 400135f0: 08 80 00 03 bleu 400135fc <== ALWAYS TAKEN 400135f4: b2 10 00 1d mov %i5, %i1 400135f8: b2 10 00 01 mov %g1, %i1 <== NOT EXECUTED uint32_t ino ) { return (ino >= fs_info->uino_base); } 400135fc: 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) 40013600: 80 a6 60 00 cmp %i1, 0 40013604: 02 80 00 27 be 400136a0 <== NEVER TAKEN 40013608: 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); 4001360c: 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); 40013610: 90 10 00 18 mov %i0, %o0 40013614: 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) 40013618: 80 a6 40 02 cmp %i1, %g2 4001361c: 02 80 00 03 be 40013628 40013620: 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); 40013624: 94 10 20 01 mov 1, %o2 40013628: 7f ff ff 65 call 400133bc 4001362c: 96 07 bf fc add %fp, -4, %o3 if (RC_OK == rc) 40013630: 80 a2 20 00 cmp %o0, 0 40013634: 12 80 00 0a bne 4001365c <== NEVER TAKEN 40013638: 80 a7 40 08 cmp %i5, %o0 { memset(blk_buf + offset, pattern, bytes_to_write); 4001363c: d0 07 bf fc ld [ %fp + -4 ], %o0 40013640: 92 10 00 1c mov %i4, %o1 40013644: 90 02 00 1a add %o0, %i2, %o0 40013648: 40 00 20 39 call 4001b72c 4001364c: 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; 40013650: 10 80 00 14 b 400136a0 40013654: e4 2e 20 88 stb %l2, [ %i0 + 0x88 ] fs_info, cur_blk, ofs_blk, c, pattern); if (c != ret) 40013658: 80 a7 40 08 cmp %i5, %o0 4001365c: 12 80 00 06 bne 40013674 <== NEVER TAKEN 40013660: 82 10 3f ff mov -1, %g1 rc = -1; else { bytes_to_write -= ret; 40013664: b6 26 c0 1d sub %i3, %i5, %i3 bytes_written += ret; 40013668: a0 04 00 1d add %l0, %i5, %l0 ++cur_blk; 4001366c: a2 04 60 01 inc %l1 40013670: 82 10 20 00 clr %g1 40013674: b4 10 20 00 clr %i2 ssize_t bytes_written = 0; ssize_t ret; cur_blk += blocks_in_offset; while ( (RC_OK == rc) 40013678: 80 a6 e0 00 cmp %i3, 0 4001367c: 02 80 00 04 be 4001368c 40013680: 80 a0 60 00 cmp %g1, 0 40013684: 22 bf ff d5 be,a 400135d8 <== ALWAYS TAKEN 40013688: c4 16 20 0a lduh [ %i0 + 0xa ], %g2 bytes_written += ret; ++cur_blk; } ofs_blk = 0; } if (RC_OK != rc) 4001368c: 80 a0 60 00 cmp %g1, 0 40013690: 12 80 00 06 bne 400136a8 <== NEVER TAKEN 40013694: b0 10 3f ff mov -1, %i0 40013698: 81 c7 e0 08 ret 4001369c: 91 e8 00 10 restore %g0, %l0, %o0 } } if (RC_OK != rc) return rc; else return bytes_to_write; 400136a0: 10 bf ff ee b 40013658 400136a4: 90 10 00 19 mov %i1, %o0 } if (RC_OK != rc) return rc; else return bytes_written; } 400136a8: 81 c7 e0 08 ret <== NOT EXECUTED 400136ac: 81 e8 00 00 restore <== NOT EXECUTED =============================================================================== 400136b0 : const uint32_t start_cln, const uint32_t offset, const uint32_t count, const void *buff, const bool overwrite_cluster) { 400136b0: 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)); 400136b4: c2 16 20 06 lduh [ %i0 + 6 ], %g1 400136b8: 82 20 40 1a sub %g1, %i2, %g1 400136bc: 80 a6 c0 01 cmp %i3, %g1 400136c0: 38 80 00 02 bgu,a 400136c8 <== NEVER TAKEN 400136c4: b6 10 00 01 mov %g1, %i3 <== NOT EXECUTED uint32_t cur_blk = fat_cluster_num_to_block_num(fs_info, start_cln); 400136c8: 90 10 00 18 mov %i0, %o0 400136cc: 7f ff fe b1 call 40013190 400136d0: 92 10 00 19 mov %i1, %o1 uint32_t blocks_in_offset = (offset >> fs_info->vol.bytes_per_block_log2); 400136d4: 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; 400136d8: 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); 400136dc: a5 36 80 01 srl %i2, %g1, %l2 uint32_t ofs_blk = offset - (blocks_in_offset << fs_info->vol.bytes_per_block_log2); 400136e0: 83 2c 80 01 sll %l2, %g1, %g1 400136e4: a6 10 20 01 mov 1, %l3 400136e8: 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; 400136ec: a4 02 00 12 add %o0, %l2, %l2 while ( (RC_OK == rc) 400136f0: 10 80 00 2d b 400137a4 400136f4: 82 10 20 00 clr %g1 && (0 < bytes_to_write)) { c = MIN(bytes_to_write, (fs_info->vol.bytes_per_block - ofs_blk)); 400136f8: 82 20 80 1a sub %g2, %i2, %g1 400136fc: 80 a0 40 1b cmp %g1, %i3 40013700: 08 80 00 03 bleu 4001370c 40013704: b2 10 00 01 mov %g1, %i1 40013708: 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)); 4001370c: 80 a6 40 01 cmp %i1, %g1 40013710: 08 80 00 03 bleu 4001371c <== ALWAYS TAKEN 40013714: a0 10 00 19 mov %i1, %l0 40013718: a0 10 00 01 mov %g1, %l0 <== NOT EXECUTED uint32_t ino ) { return (ino >= fs_info->uino_base); } 4001371c: 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) 40013720: 80 a4 20 00 cmp %l0, 0 40013724: 02 80 00 2a be 400137cc <== NEVER TAKEN 40013728: 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); 4001372c: 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); 40013730: 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 40013734: 80 a7 60 00 cmp %i5, 0 40013738: 12 80 00 05 bne 4001374c 4001373c: 93 2c 80 09 sll %l2, %o1, %o1 || (bytes_to_write == fs_info->vol.bytes_per_block)) 40013740: 80 a4 00 02 cmp %l0, %g2 40013744: 12 80 00 04 bne 40013754 40013748: 94 10 20 01 mov 1, %o2 { rc = fat_buf_access(fs_info, sec_num, FAT_OP_TYPE_GET, &blk_buf); 4001374c: 10 80 00 02 b 40013754 40013750: 94 10 20 02 mov 2, %o2 } else rc = fat_buf_access(fs_info, sec_num, FAT_OP_TYPE_READ, &blk_buf); 40013754: 7f ff ff 1a call 400133bc 40013758: 96 07 bf fc add %fp, -4, %o3 if (RC_OK == rc) 4001375c: 80 a2 20 00 cmp %o0, 0 40013760: 12 80 00 0a bne 40013788 <== NEVER TAKEN 40013764: 80 a6 40 08 cmp %i1, %o0 { memcpy(blk_buf + offset, buf, bytes_to_write); 40013768: d0 07 bf fc ld [ %fp + -4 ], %o0 4001376c: 92 07 00 11 add %i4, %l1, %o1 40013770: 90 02 00 1a add %o0, %i2, %o0 40013774: 40 00 1f b1 call 4001b638 40013778: 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; 4001377c: 10 80 00 14 b 400137cc 40013780: e6 2e 20 88 stb %l3, [ %i0 + 0x88 ] cur_blk, ofs_blk, c, &buffer[bytes_written], overwrite_cluster); if (c != ret) 40013784: 80 a6 40 08 cmp %i1, %o0 40013788: 12 80 00 06 bne 400137a0 <== NEVER TAKEN 4001378c: 82 10 3f ff mov -1, %g1 rc = -1; else { bytes_to_write -= ret; 40013790: b6 26 c0 19 sub %i3, %i1, %i3 bytes_written += ret; 40013794: a2 04 40 19 add %l1, %i1, %l1 ++cur_blk; 40013798: a4 04 a0 01 inc %l2 4001379c: 82 10 20 00 clr %g1 400137a0: b4 10 20 00 clr %i2 ssize_t ret; uint32_t c; cur_blk += blocks_in_offset; while ( (RC_OK == rc) 400137a4: 80 a6 e0 00 cmp %i3, 0 400137a8: 02 80 00 04 be 400137b8 400137ac: 80 a0 60 00 cmp %g1, 0 400137b0: 22 bf ff d2 be,a 400136f8 <== ALWAYS TAKEN 400137b4: c4 16 20 0a lduh [ %i0 + 0xa ], %g2 bytes_written += ret; ++cur_blk; } ofs_blk = 0; } if (RC_OK != rc) 400137b8: 80 a0 60 00 cmp %g1, 0 400137bc: 12 80 00 06 bne 400137d4 <== NEVER TAKEN 400137c0: b0 10 3f ff mov -1, %i0 400137c4: 81 c7 e0 08 ret 400137c8: 91 e8 00 11 restore %g0, %l1, %o0 } } if (RC_OK != rc) return rc; else return bytes_to_write; 400137cc: 10 bf ff ee b 40013784 400137d0: 90 10 00 10 mov %l0, %o0 } if (RC_OK != rc) return rc; else return bytes_written; } 400137d4: 81 c7 e0 08 ret <== NOT EXECUTED 400137d8: 81 e8 00 00 restore <== NOT EXECUTED =============================================================================== 40012a58 : int fat_file_close( fat_fs_info_t *fs_info, fat_file_fd_t *fat_fd ) { 40012a58: 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) 40012a5c: c2 06 60 08 ld [ %i1 + 8 ], %g1 40012a60: 80 a0 60 01 cmp %g1, 1 40012a64: 08 80 00 05 bleu 40012a78 40012a68: 82 00 7f ff add %g1, -1, %g1 { fat_fd->links_num--; return rc; 40012a6c: 90 10 20 00 clr %o0 40012a70: 10 80 00 25 b 40012b04 40012a74: 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) 40012a78: c2 0e 60 30 ldub [ %i1 + 0x30 ], %g1 40012a7c: 80 88 60 01 btst 1, %g1 40012a80: 02 80 00 14 be 40012ad0 40012a84: 90 10 00 18 mov %i0, %o0 { rc = fat_file_truncate(fs_info, fat_fd, 0); 40012a88: 92 10 00 19 mov %i1, %o1 40012a8c: 7f ff ff ae call 40012944 40012a90: 94 10 20 00 clr %o2 if ( rc != RC_OK ) 40012a94: 80 a2 20 00 cmp %o0, 0 40012a98: 12 80 00 1b bne 40012b04 <== NEVER TAKEN 40012a9c: 01 00 00 00 nop */ RTEMS_INLINE_ROUTINE void rtems_chain_extract( rtems_chain_node *the_node ) { _Chain_Extract( the_node ); 40012aa0: 40 00 0c 7d call 40015c94 <_Chain_Extract> 40012aa4: 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) ) 40012aa8: d2 06 60 0c ld [ %i1 + 0xc ], %o1 40012aac: 40 00 06 01 call 400142b0 40012ab0: 90 10 00 18 mov %i0, %o0 40012ab4: 80 8a 20 ff btst 0xff, %o0 40012ab8: 02 80 00 0f be 40012af4 <== ALWAYS TAKEN 40012abc: 01 00 00 00 nop fat_free_unique_ino(fs_info, fat_fd->ino); 40012ac0: d2 06 60 0c ld [ %i1 + 0xc ], %o1 <== NOT EXECUTED 40012ac4: 40 00 05 f0 call 40014284 <== NOT EXECUTED 40012ac8: 90 10 00 18 mov %i0, %o0 <== NOT EXECUTED 40012acc: 30 80 00 0a b,a 40012af4 <== NOT EXECUTED free(fat_fd); } else { if (fat_ino_is_unique(fs_info, fat_fd->ino)) 40012ad0: 40 00 05 f8 call 400142b0 40012ad4: d2 06 60 0c ld [ %i1 + 0xc ], %o1 40012ad8: 80 8a 20 ff btst 0xff, %o0 40012adc: 02 80 00 04 be 40012aec 40012ae0: 01 00 00 00 nop { fat_fd->links_num = 0; 40012ae4: 10 80 00 06 b 40012afc 40012ae8: c0 26 60 08 clr [ %i1 + 8 ] 40012aec: 40 00 0c 6a call 40015c94 <_Chain_Extract> 40012af0: 90 10 00 19 mov %i1, %o0 } else { _hash_delete(fs_info->vhash, key, fat_fd->ino, fat_fd); free(fat_fd); 40012af4: 7f ff cc 19 call 40005b58 40012af8: 90 10 00 19 mov %i1, %o0 } } /* * flush any modified "cached" buffer back to disk */ rc = fat_buf_release(fs_info); 40012afc: 40 00 01 bc call 400131ec 40012b00: 81 e8 00 00 restore return rc; } 40012b04: 81 c7 e0 08 ret 40012b08: 91 e8 00 08 restore %g0, %o0, %o0 =============================================================================== 40012bdc : fat_file_fd_t *fat_fd, bool zero_fill, uint32_t new_length, uint32_t *a_length ) { 40012bdc: 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; 40012be0: f6 27 00 00 st %i3, [ %i4 ] if (new_length <= fat_fd->fat_file_size) 40012be4: c2 06 60 18 ld [ %i1 + 0x18 ], %g1 uint32_t new_length, uint32_t *a_length ) { int rc = RC_OK; uint32_t chain = 0; 40012be8: 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; 40012bec: 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) 40012bf0: 80 a6 c0 01 cmp %i3, %g1 40012bf4: 18 80 00 04 bgu 40012c04 40012bf8: ba 10 00 18 mov %i0, %i5 return RC_OK; 40012bfc: 81 c7 e0 08 ret 40012c00: 91 e8 20 00 restore %g0, 0, %o0 if ((FAT_FD_OF_ROOT_DIR(fat_fd)) && 40012c04: c4 06 60 20 ld [ %i1 + 0x20 ], %g2 40012c08: 80 a0 a0 01 cmp %g2, 1 40012c0c: 32 80 00 0b bne,a 40012c38 40012c10: e0 17 60 06 lduh [ %i5 + 6 ], %l0 40012c14: c4 06 60 24 ld [ %i1 + 0x24 ], %g2 40012c18: 80 a0 a0 00 cmp %g2, 0 40012c1c: 32 80 00 07 bne,a 40012c38 <== NEVER TAKEN 40012c20: e0 17 60 06 lduh [ %i5 + 6 ], %l0 <== NOT EXECUTED (fs_info->vol.type & (FAT_FAT12 | FAT_FAT16))) 40012c24: 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)) && 40012c28: 80 88 a0 03 btst 3, %g2 40012c2c: 22 80 00 03 be,a 40012c38 <== NEVER TAKEN 40012c30: e0 17 60 06 lduh [ %i5 + 6 ], %l0 <== NOT EXECUTED 40012c34: 30 80 00 34 b,a 40012d04 (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))) & 40012c38: 84 04 3f ff add %l0, -1, %g2 40012c3c: 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 - 40012c40: a0 24 00 12 sub %l0, %l2, %l0 40012c44: 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; 40012c48: 84 26 c0 01 sub %i3, %g1, %g2 if (bytes2add > bytes_remain) 40012c4c: 80 a0 80 10 cmp %g2, %l0 40012c50: 08 80 00 03 bleu 40012c5c 40012c54: a2 10 20 00 clr %l1 bytes2add -= bytes_remain; 40012c58: a2 20 80 10 sub %g2, %l0, %l1 else bytes2add = 0; if (zero_fill && bytes_remain > 0) { 40012c5c: 80 a4 20 00 cmp %l0, 0 40012c60: 02 80 00 17 be 40012cbc 40012c64: 80 a4 60 00 cmp %l1, 0 40012c68: 80 a6 a0 00 cmp %i2, 0 40012c6c: 02 80 00 14 be 40012cbc 40012c70: 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; 40012c74: 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); 40012c78: 90 10 00 1d mov %i5, %o0 40012c7c: 92 10 00 19 mov %i1, %o1 40012c80: 95 30 40 0a srl %g1, %o2, %o2 40012c84: 7f ff fe 39 call 40012568 40012c88: 96 07 bf fc add %fp, -4, %o3 if (rc != RC_OK) 40012c8c: b0 92 60 00 orcc %o1, 0, %i0 40012c90: 12 80 00 21 bne 40012d14 <== NEVER TAKEN 40012c94: d2 07 bf fc ld [ %fp + -4 ], %o1 return rc; bytes_written = fat_cluster_set (fs_info, cur_cln, ofs, bytes_remain, 0); 40012c98: 90 10 00 1d mov %i5, %o0 40012c9c: 94 10 00 12 mov %l2, %o2 40012ca0: 96 10 00 10 mov %l0, %o3 40012ca4: 98 10 20 00 clr %o4 40012ca8: 40 00 02 3a call 40013590 40012cac: b0 10 3f ff mov -1, %i0 if (bytes_remain != bytes_written) 40012cb0: 80 a4 00 08 cmp %l0, %o0 40012cb4: 12 80 00 18 bne 40012d14 <== NEVER TAKEN 40012cb8: 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) 40012cbc: 02 bf ff d0 be 40012bfc 40012cc0: a4 04 7f ff add %l1, -1, %l2 return RC_OK; cls2add = ((bytes2add - 1) >> fs_info->vol.bpc_log2) + 1; 40012cc4: c2 0f 60 08 ldub [ %i5 + 8 ], %g1 rc = fat_scan_fat_for_free_clusters(fs_info, &chain, cls2add, 40012cc8: 90 10 00 1d mov %i5, %o0 * file ) - return */ if (bytes2add == 0) return RC_OK; cls2add = ((bytes2add - 1) >> fs_info->vol.bpc_log2) + 1; 40012ccc: a5 34 80 01 srl %l2, %g1, %l2 rc = fat_scan_fat_for_free_clusters(fs_info, &chain, cls2add, 40012cd0: 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; 40012cd4: a4 04 a0 01 inc %l2 rc = fat_scan_fat_for_free_clusters(fs_info, &chain, cls2add, 40012cd8: 96 07 bf fc add %fp, -4, %o3 40012cdc: 94 10 00 12 mov %l2, %o2 40012ce0: 98 07 bf f8 add %fp, -8, %o4 40012ce4: 40 00 1a 28 call 40019584 40012ce8: 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) 40012cec: b0 92 20 00 orcc %o0, 0, %i0 40012cf0: 12 80 00 09 bne 40012d14 <== NEVER TAKEN 40012cf4: 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)) 40012cf8: 80 94 00 01 orcc %l0, %g1, %g0 40012cfc: 12 80 00 08 bne 40012d1c <== ALWAYS TAKEN 40012d00: 80 a4 80 01 cmp %l2, %g1 rtems_set_errno_and_return_minus_one(ENOSPC); 40012d04: 40 00 1f a8 call 4001aba4 <__errno> 40012d08: b0 10 3f ff mov -1, %i0 40012d0c: 82 10 20 1c mov 0x1c, %g1 40012d10: c2 22 00 00 st %g1, [ %o0 ] 40012d14: 81 c7 e0 08 ret 40012d18: 81 e8 00 00 restore /* check wether we satisfied request for 'cls2add' clusters */ if (cls2add != cls_added) 40012d1c: 02 80 00 09 be 40012d40 <== ALWAYS TAKEN 40012d20: 82 24 80 01 sub %l2, %g1, %g1 { new_length -= bytes2add & (fs_info->vol.bpc - 1); 40012d24: c4 17 60 06 lduh [ %i5 + 6 ], %g2 <== NOT EXECUTED 40012d28: 84 00 bf ff add %g2, -1, %g2 <== NOT EXECUTED 40012d2c: a2 0c 40 02 and %l1, %g2, %l1 <== NOT EXECUTED new_length -= (cls2add - cls_added) << fs_info->vol.bpc_log2; 40012d30: 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); 40012d34: b6 26 c0 11 sub %i3, %l1, %i3 <== NOT EXECUTED new_length -= (cls2add - cls_added) << fs_info->vol.bpc_log2; 40012d38: 83 28 40 02 sll %g1, %g2, %g1 <== NOT EXECUTED 40012d3c: 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 ) 40012d40: d6 06 60 18 ld [ %i1 + 0x18 ], %o3 40012d44: 80 a2 e0 00 cmp %o3, 0 40012d48: 32 80 00 07 bne,a 40012d64 40012d4c: c2 06 60 3c ld [ %i1 + 0x3c ], %g1 { fat_fd->map.disk_cln = fat_fd->cln = chain; 40012d50: c2 07 bf f0 ld [ %fp + -16 ], %g1 fat_fd->map.file_cln = 0; 40012d54: 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; 40012d58: c2 26 60 1c st %g1, [ %i1 + 0x1c ] 40012d5c: 10 80 00 1d b 40012dd0 40012d60: c2 26 60 38 st %g1, [ %i1 + 0x38 ] fat_fd->map.file_cln = 0; } else { if (fat_fd->map.last_cln != FAT_UNDEFINED_VALUE) 40012d64: 80 a0 7f ff cmp %g1, -1 40012d68: 22 80 00 04 be,a 40012d78 <== NEVER TAKEN 40012d6c: 90 10 00 1d mov %i5, %o0 <== NOT EXECUTED { old_last_cl = fat_fd->map.last_cln; 40012d70: 10 80 00 0c b 40012da0 40012d74: c2 27 bf f4 st %g1, [ %fp + -12 ] } else { rc = fat_file_ioctl(fs_info, fat_fd, F_CLU_NUM, 40012d78: 92 10 00 19 mov %i1, %o1 <== NOT EXECUTED 40012d7c: 94 10 20 01 mov 1, %o2 <== NOT EXECUTED 40012d80: 96 02 ff ff add %o3, -1, %o3 <== NOT EXECUTED 40012d84: 7f ff ff 62 call 40012b0c <== NOT EXECUTED 40012d88: 98 07 bf f4 add %fp, -12, %o4 <== NOT EXECUTED (fat_fd->fat_file_size - 1), &old_last_cl); if ( rc != RC_OK ) 40012d8c: b4 92 20 00 orcc %o0, 0, %i2 <== NOT EXECUTED 40012d90: 02 80 00 05 be 40012da4 <== NOT EXECUTED 40012d94: 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); 40012d98: 10 80 00 1f b 40012e14 <== NOT EXECUTED 40012d9c: 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); 40012da0: d2 07 bf f4 ld [ %fp + -12 ], %o1 40012da4: d4 07 bf f0 ld [ %fp + -16 ], %o2 40012da8: 40 00 19 27 call 40019244 40012dac: 90 10 00 1d mov %i5, %o0 40012db0: b4 10 00 08 mov %o0, %i2 if ( rc != RC_OK ) 40012db4: 80 a6 a0 00 cmp %i2, 0 40012db8: 02 80 00 04 be 40012dc8 <== ALWAYS TAKEN 40012dbc: 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); 40012dc0: 10 80 00 16 b 40012e18 <== NOT EXECUTED 40012dc4: 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); 40012dc8: 40 00 01 09 call 400131ec 40012dcc: 01 00 00 00 nop } /* update number of the last cluster of the file if it changed */ if (cls_added != 0) 40012dd0: c2 07 bf fc ld [ %fp + -4 ], %g1 40012dd4: 80 a0 60 00 cmp %g1, 0 40012dd8: 22 80 00 14 be,a 40012e28 <== NEVER TAKEN 40012ddc: f6 27 00 00 st %i3, [ %i4 ] <== NOT EXECUTED { fat_fd->map.last_cln = last_cl; 40012de0: c2 07 bf f8 ld [ %fp + -8 ], %g1 40012de4: c2 26 60 3c st %g1, [ %i1 + 0x3c ] if (fat_fd->fat_file_type == FAT_DIRECTORY) 40012de8: c2 06 60 10 ld [ %i1 + 0x10 ], %g1 40012dec: 80 a0 60 00 cmp %g1, 0 40012df0: 32 80 00 0e bne,a 40012e28 40012df4: f6 27 00 00 st %i3, [ %i4 ] { rc = fat_init_clusters_chain(fs_info, chain); 40012df8: d2 07 bf f0 ld [ %fp + -16 ], %o1 40012dfc: 40 00 04 d4 call 4001414c 40012e00: 90 10 00 1d mov %i5, %o0 if ( rc != RC_OK ) 40012e04: b4 92 20 00 orcc %o0, 0, %i2 40012e08: 22 80 00 08 be,a 40012e28 <== ALWAYS TAKEN 40012e0c: f6 27 00 00 st %i3, [ %i4 ] { fat_free_fat_clusters_chain(fs_info, chain); 40012e10: 90 10 00 1d mov %i5, %o0 <== NOT EXECUTED 40012e14: d2 07 bf f0 ld [ %fp + -16 ], %o1 <== NOT EXECUTED 40012e18: 40 00 19 ac call 400194c8 <== NOT EXECUTED 40012e1c: b0 10 00 1a mov %i2, %i0 <== NOT EXECUTED 40012e20: 81 c7 e0 08 ret <== NOT EXECUTED 40012e24: 81 e8 00 00 restore <== NOT EXECUTED } } } *a_length = new_length; fat_fd->fat_file_size = new_length; 40012e28: f6 26 60 18 st %i3, [ %i1 + 0x18 ] return RC_OK; } 40012e2c: 81 c7 e0 08 ret 40012e30: 81 e8 00 00 restore =============================================================================== 40012b0c : fat_file_ioctl( fat_fs_info_t *fs_info, fat_file_fd_t *fat_fd, int cmd, ...) { 40012b0c: 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); 40012b10: 82 07 a0 50 add %fp, 0x50, %g1 40012b14: f6 27 a0 50 st %i3, [ %fp + 0x50 ] 40012b18: f8 27 a0 54 st %i4, [ %fp + 0x54 ] 40012b1c: 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; 40012b20: c0 27 bf f8 clr [ %fp + -8 ] uint32_t *ret; va_list ap; va_start(ap, cmd); switch (cmd) 40012b24: 80 a6 a0 01 cmp %i2, 1 40012b28: 12 80 00 26 bne 40012bc0 <== NEVER TAKEN 40012b2c: c2 27 bf fc st %g1, [ %fp + -4 ] { case F_CLU_NUM: pos = va_arg(ap, uint32_t); ret = va_arg(ap, uint32_t *); 40012b30: 82 07 a0 58 add %fp, 0x58, %g1 40012b34: c2 27 bf fc st %g1, [ %fp + -4 ] /* sanity check */ if ( pos >= fat_fd->fat_file_size ) { 40012b38: c2 06 60 18 ld [ %i1 + 0x18 ], %g1 40012b3c: 80 a6 c0 01 cmp %i3, %g1 40012b40: 0a 80 00 06 bcs 40012b58 <== ALWAYS TAKEN 40012b44: ba 10 00 1c mov %i4, %i5 va_end(ap); rtems_set_errno_and_return_minus_one( EIO ); 40012b48: 40 00 20 17 call 4001aba4 <__errno> <== NOT EXECUTED 40012b4c: 01 00 00 00 nop <== NOT EXECUTED 40012b50: 10 80 00 1f b 40012bcc <== NOT EXECUTED 40012b54: 82 10 20 05 mov 5, %g1 ! 5 <== NOT EXECUTED } if ((FAT_FD_OF_ROOT_DIR(fat_fd)) && 40012b58: c2 06 60 20 ld [ %i1 + 0x20 ], %g1 40012b5c: 80 a0 60 01 cmp %g1, 1 40012b60: 32 80 00 0d bne,a 40012b94 40012b64: d4 0e 20 08 ldub [ %i0 + 8 ], %o2 40012b68: c2 06 60 24 ld [ %i1 + 0x24 ], %g1 40012b6c: 80 a0 60 00 cmp %g1, 0 40012b70: 32 80 00 09 bne,a 40012b94 <== NEVER TAKEN 40012b74: d4 0e 20 08 ldub [ %i0 + 8 ], %o2 <== NOT EXECUTED (fs_info->vol.type & (FAT_FAT12 | FAT_FAT16))) 40012b78: 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)) && 40012b7c: 80 88 60 03 btst 3, %g1 40012b80: 22 80 00 05 be,a 40012b94 40012b84: 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; 40012b88: c0 27 00 00 clr [ %i4 ] rc = RC_OK; break; 40012b8c: 81 c7 e0 08 ret 40012b90: 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); 40012b94: 90 10 00 18 mov %i0, %o0 40012b98: 92 10 00 19 mov %i1, %o1 40012b9c: 95 36 c0 0a srl %i3, %o2, %o2 40012ba0: 7f ff fe 72 call 40012568 40012ba4: 96 07 bf f8 add %fp, -8, %o3 if ( rc != RC_OK ) 40012ba8: b0 92 60 00 orcc %o1, 0, %i0 40012bac: 12 80 00 03 bne 40012bb8 <== NEVER TAKEN 40012bb0: c2 07 bf f8 ld [ %fp + -8 ], %g1 break; *ret = cur_cln; 40012bb4: c2 27 40 00 st %g1, [ %i5 ] break; 40012bb8: 81 c7 e0 08 ret 40012bbc: 81 e8 00 00 restore default: errno = EINVAL; 40012bc0: 40 00 1f f9 call 4001aba4 <__errno> <== NOT EXECUTED 40012bc4: 01 00 00 00 nop <== NOT EXECUTED 40012bc8: 82 10 20 16 mov 0x16, %g1 ! 16 <== NOT EXECUTED 40012bcc: c2 22 00 00 st %g1, [ %o0 ] <== NOT EXECUTED rc = -1; 40012bd0: b0 10 3f ff mov -1, %i0 <== NOT EXECUTED break; } va_end(ap); return rc; } 40012bd4: 81 c7 e0 08 ret <== NOT EXECUTED 40012bd8: 81 e8 00 00 restore <== NOT EXECUTED =============================================================================== 40012568 : fat_fs_info_t *fs_info, fat_file_fd_t *fat_fd, uint32_t file_cln, uint32_t *disk_cln ) { 40012568: 9d e3 bf 98 save %sp, -104, %sp int rc = RC_OK; if (file_cln == fat_fd->map.file_cln) 4001256c: c2 06 60 34 ld [ %i1 + 0x34 ], %g1 40012570: 80 a6 80 01 cmp %i2, %g1 40012574: 12 80 00 05 bne 40012588 40012578: 01 00 00 00 nop *disk_cln = fat_fd->map.disk_cln; 4001257c: c2 06 60 38 ld [ %i1 + 0x38 ], %g1 40012580: 10 80 00 1b b 400125ec 40012584: 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) 40012588: 28 80 00 06 bleu,a 400125a0 4001258c: c2 06 60 1c ld [ %i1 + 0x1c ], %g1 { cur_cln = fat_fd->map.disk_cln; 40012590: c4 06 60 38 ld [ %i1 + 0x38 ], %g2 count = file_cln - fat_fd->map.file_cln; 40012594: 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; 40012598: 10 80 00 04 b 400125a8 4001259c: c4 27 bf fc st %g2, [ %fp + -4 ] count = file_cln - fat_fd->map.file_cln; } else { cur_cln = fat_fd->cln; 400125a0: b8 10 00 1a mov %i2, %i4 400125a4: c2 27 bf fc st %g1, [ %fp + -4 ] count = file_cln; } /* skip over the clusters */ for (i = 0; i < count; i++) 400125a8: 10 80 00 0b b 400125d4 400125ac: ba 10 20 00 clr %i5 { rc = fat_get_fat_cluster(fs_info, cur_cln, &cur_cln); 400125b0: 90 10 00 18 mov %i0, %o0 400125b4: 40 00 1a b2 call 4001907c 400125b8: 94 07 bf fc add %fp, -4, %o2 if ( rc != RC_OK ) 400125bc: 80 a2 20 00 cmp %o0, 0 400125c0: 22 80 00 05 be,a 400125d4 <== ALWAYS TAKEN 400125c4: ba 07 60 01 inc %i5 return rc; 400125c8: 86 10 00 08 mov %o0, %g3 <== NOT EXECUTED 400125cc: 10 80 00 0a b 400125f4 <== NOT EXECUTED 400125d0: 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++) 400125d4: 80 a7 40 1c cmp %i5, %i4 400125d8: 12 bf ff f6 bne 400125b0 400125dc: d2 07 bf fc ld [ %fp + -4 ], %o1 if ( rc != RC_OK ) return rc; } /* update cache */ fat_fd->map.file_cln = file_cln; 400125e0: f4 26 60 34 st %i2, [ %i1 + 0x34 ] fat_fd->map.disk_cln = cur_cln; 400125e4: d2 26 60 38 st %o1, [ %i1 + 0x38 ] *disk_cln = cur_cln; 400125e8: d2 26 c0 00 st %o1, [ %i3 ] } return RC_OK; 400125ec: 84 10 20 00 clr %g2 400125f0: 86 10 20 00 clr %g3 } 400125f4: b0 10 00 02 mov %g2, %i0 400125f8: 81 c7 e0 08 ret 400125fc: 93 e8 00 03 restore %g0, %g3, %o1 =============================================================================== 40012600 : fat_file_open( fat_fs_info_t *fs_info, fat_dir_pos_t *dir_pos, fat_file_fd_t **fat_fd ) { 40012600: 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); 40012604: 90 10 00 18 mov %i0, %o0 40012608: 7f ff ff c7 call 40012524 4001260c: 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; 40012610: 82 0a 20 01 and %o0, 1, %g1 rtems_chain_node *the_node = rtems_chain_first(hash + mod); 40012614: 85 28 60 02 sll %g1, 2, %g2 40012618: b7 28 60 04 sll %g1, 4, %i3 4001261c: c2 06 20 6c ld [ %i0 + 0x6c ], %g1 40012620: 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); 40012624: 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); 40012628: 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; 4001262c: 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 )); 40012630: 10 80 00 0c b 40012660 40012634: 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); 40012638: 7f ff ff bb call 40012524 4001263c: 92 07 60 20 add %i5, 0x20, %o1 if ( (key1) == ck) 40012640: 80 a7 00 08 cmp %i4, %o0 40012644: 32 80 00 07 bne,a 40012660 40012648: 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++; 4001264c: 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; 40012650: fa 26 80 00 st %i5, [ %i2 ] lfat_fd->links_num++; 40012654: 82 00 60 01 inc %g1 40012658: 10 80 00 42 b 40012760 4001265c: 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) ; ) 40012660: 80 a7 40 10 cmp %i5, %l0 40012664: 12 bf ff f5 bne 40012638 40012668: 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); 4001266c: 10 80 00 3f b 40012768 40012670: 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); 40012674: 7f ff ff ac call 40012524 <== NOT EXECUTED 40012678: 92 07 60 20 add %i5, 0x20, %o1 <== NOT EXECUTED if ( (key1) == ck) 4001267c: 80 a7 00 08 cmp %i4, %o0 <== NOT EXECUTED 40012680: 32 80 00 0a bne,a 400126a8 <== NOT EXECUTED 40012684: fa 07 40 00 ld [ %i5 ], %i5 <== NOT EXECUTED { if ( ((key2) == 0) || ((key2) == ffd->ino) ) 40012688: 80 a7 20 00 cmp %i4, 0 <== NOT EXECUTED 4001268c: 22 80 00 0b be,a 400126b8 <== NOT EXECUTED 40012690: a0 10 20 00 clr %l0 <== NOT EXECUTED 40012694: c2 07 60 0c ld [ %i5 + 0xc ], %g1 <== NOT EXECUTED 40012698: 80 a7 00 01 cmp %i4, %g1 <== NOT EXECUTED 4001269c: 22 80 00 07 be,a 400126b8 <== NOT EXECUTED 400126a0: a0 10 20 00 clr %l0 <== NOT EXECUTED { *ret = (void *)the_node; return 0; } } the_node = the_node->next; 400126a4: 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) ; ) 400126a8: 80 a7 40 10 cmp %i5, %l0 400126ac: 12 bf ff f2 bne 40012674 <== NEVER TAKEN 400126b0: 90 10 00 18 mov %i0, %o0 400126b4: 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)); 400126b8: 7f ff ce 72 call 40006080 400126bc: 90 10 20 44 mov 0x44, %o0 400126c0: d0 26 80 00 st %o0, [ %i2 ] if ( lfat_fd == NULL ) 400126c4: 80 a2 20 00 cmp %o0, 0 400126c8: 02 80 00 1c be 40012738 <== NEVER TAKEN 400126cc: ba 10 00 08 mov %o0, %i5 rtems_set_errno_and_return_minus_one( ENOMEM ); memset(lfat_fd, 0, sizeof(fat_file_fd_t)); 400126d0: 92 10 20 00 clr %o1 400126d4: 40 00 24 16 call 4001b72c 400126d8: 94 10 20 44 mov 0x44, %o2 lfat_fd->links_num = 1; 400126dc: 82 10 20 01 mov 1, %g1 400126e0: c2 27 60 08 st %g1, [ %i5 + 8 ] lfat_fd->flags &= ~FAT_FILE_REMOVED; 400126e4: c2 0f 60 30 ldub [ %i5 + 0x30 ], %g1 lfat_fd->map.last_cln = FAT_UNDEFINED_VALUE; lfat_fd->dir_pos = *dir_pos; 400126e8: 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; 400126ec: 82 08 7f fe and %g1, -2, %g1 400126f0: c2 2f 60 30 stb %g1, [ %i5 + 0x30 ] lfat_fd->map.last_cln = FAT_UNDEFINED_VALUE; 400126f4: 82 10 3f ff mov -1, %g1 lfat_fd->dir_pos = *dir_pos; 400126f8: 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; 400126fc: c2 27 60 3c st %g1, [ %i5 + 0x3c ] lfat_fd->dir_pos = *dir_pos; 40012700: 40 00 23 ce call 4001b638 40012704: 94 10 20 10 mov 0x10, %o2 if ( rc != RC_OK ) 40012708: 80 a4 20 00 cmp %l0, 0 4001270c: 02 80 00 04 be 4001271c <== NEVER TAKEN 40012710: 01 00 00 00 nop lfat_fd->ino = key; 40012714: 10 80 00 0f b 40012750 40012718: f8 27 60 0c st %i4, [ %i5 + 0xc ] else { lfat_fd->ino = fat_get_unique_ino(fs_info); 4001271c: 40 00 06 aa call 400141c4 <== NOT EXECUTED 40012720: 90 10 00 18 mov %i0, %o0 <== NOT EXECUTED if ( lfat_fd->ino == 0 ) 40012724: 80 a2 20 00 cmp %o0, 0 <== NOT EXECUTED 40012728: 12 80 00 0a bne 40012750 <== NOT EXECUTED 4001272c: d0 27 60 0c st %o0, [ %i5 + 0xc ] <== NOT EXECUTED { free((*fat_fd)); 40012730: 7f ff cd 0a call 40005b58 <== NOT EXECUTED 40012734: 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 ); 40012738: 40 00 21 1b call 4001aba4 <__errno> <== NOT EXECUTED 4001273c: b0 10 3f ff mov -1, %i0 <== NOT EXECUTED 40012740: 82 10 20 0c mov 0xc, %g1 <== NOT EXECUTED 40012744: c2 22 00 00 st %g1, [ %o0 ] <== NOT EXECUTED 40012748: 81 c7 e0 08 ret <== NOT EXECUTED 4001274c: 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); 40012750: 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 ); 40012754: 92 10 00 1d mov %i5, %o1 40012758: 7f ff e0 bd call 4000aa4c <_Chain_Append> 4001275c: 90 02 00 1b add %o0, %i3, %o0 /* * other fields of fat-file descriptor will be initialized on upper * level */ return RC_OK; 40012760: 81 c7 e0 08 ret 40012764: 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); 40012768: 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; 4001276c: 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 )); 40012770: 10 bf ff ce b 400126a8 40012774: a0 04 20 04 add %l0, 4, %l0 =============================================================================== 4001278c : fat_file_fd_t *fat_fd, uint32_t start, uint32_t count, uint8_t *buf ) { 4001278c: 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; 40012790: c0 27 bf fc clr [ %fp + -4 ] fat_file_fd_t *fat_fd, uint32_t start, uint32_t count, uint8_t *buf ) { 40012794: 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) 40012798: 80 a6 e0 00 cmp %i3, 0 4001279c: 02 80 00 68 be 4001293c <== NEVER TAKEN 400127a0: 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 ) 400127a4: c2 06 60 18 ld [ %i1 + 0x18 ], %g1 400127a8: 80 a6 80 01 cmp %i2, %g1 400127ac: 1a 80 00 64 bcc 4001293c 400127b0: 80 a6 c0 01 cmp %i3, %g1 return FAT_EOF; if ((count > fat_fd->fat_file_size) || 400127b4: 38 80 00 07 bgu,a 400127d0 <== NEVER TAKEN 400127b8: b6 20 40 1a sub %g1, %i2, %i3 <== NOT EXECUTED (start > fat_fd->fat_file_size - count)) 400127bc: 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) || 400127c0: 80 a6 80 02 cmp %i2, %g2 400127c4: 28 80 00 04 bleu,a 400127d4 400127c8: c2 06 60 20 ld [ %i1 + 0x20 ], %g1 (start > fat_fd->fat_file_size - count)) count = fat_fd->fat_file_size - start; 400127cc: b6 20 40 1a sub %g1, %i2, %i3 if ((FAT_FD_OF_ROOT_DIR(fat_fd)) && 400127d0: c2 06 60 20 ld [ %i1 + 0x20 ], %g1 400127d4: 80 a0 60 01 cmp %g1, 1 400127d8: 32 80 00 1c bne,a 40012848 400127dc: e4 0f 60 08 ldub [ %i5 + 8 ], %l2 400127e0: c2 06 60 24 ld [ %i1 + 0x24 ], %g1 400127e4: 80 a0 60 00 cmp %g1, 0 400127e8: 32 80 00 18 bne,a 40012848 <== NEVER TAKEN 400127ec: e4 0f 60 08 ldub [ %i5 + 8 ], %l2 <== NOT EXECUTED (fs_info->vol.type & (FAT_FAT12 | FAT_FAT16))) 400127f0: 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)) && 400127f4: 80 88 60 03 btst 3, %g1 400127f8: 22 80 00 14 be,a 40012848 400127fc: 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); 40012800: d2 06 60 1c ld [ %i1 + 0x1c ], %o1 40012804: 7f ff ff 3a call 400124ec 40012808: 90 10 00 1d mov %i5, %o0 sec += (start >> fs_info->vol.sec_log2); 4001280c: d2 0f 60 02 ldub [ %i5 + 2 ], %o1 byte = start & (fs_info->vol.bps - 1); 40012810: 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); 40012814: 93 36 80 09 srl %i2, %o1, %o1 byte = start & (fs_info->vol.bps - 1); 40012818: 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); 4001281c: 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); 40012820: 94 0e 80 0a and %i2, %o2, %o2 40012824: 90 10 00 1d mov %i5, %o0 40012828: 96 10 00 1b mov %i3, %o3 4001282c: 40 00 03 13 call 40013478 <_fat_block_read> 40012830: 98 10 00 1c mov %i4, %o4 if ( ret < 0 ) 40012834: 80 a2 20 00 cmp %o0, 0 40012838: 16 80 00 41 bge 4001293c <== ALWAYS TAKEN 4001283c: 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; 40012840: 10 80 00 3f b 4001293c <== NOT EXECUTED 40012844: 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); 40012848: f0 17 60 06 lduh [ %i5 + 6 ], %i0 return -1; return ret; } cl_start = start >> fs_info->vol.bpc_log2; 4001284c: 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); 40012850: a6 07 bf fc add %fp, -4, %l3 40012854: 90 10 00 1d mov %i5, %o0 40012858: 92 10 00 19 mov %i1, %o1 4001285c: 94 10 00 12 mov %l2, %o2 40012860: 7f ff ff 42 call 40012568 40012864: 96 10 00 13 mov %l3, %o3 if (rc != RC_OK) 40012868: 90 92 60 00 orcc %o1, 0, %o0 4001286c: 12 80 00 34 bne 4001293c <== NEVER TAKEN 40012870: 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); 40012874: b1 2e 20 10 sll %i0, 0x10, %i0 40012878: b1 36 20 10 srl %i0, 0x10, %i0 4001287c: b0 06 3f ff add %i0, -1, %i0 40012880: b4 0e 80 18 and %i2, %i0, %i2 40012884: b0 10 20 00 clr %i0 40012888: 10 80 00 20 b 40012908 4001288c: a2 10 00 1a mov %i2, %l1 if (rc != RC_OK) return rc; while (count > 0) { c = MIN(count, (fs_info->vol.bpc - ofs)); 40012890: a0 24 00 11 sub %l0, %l1, %l0 40012894: 80 a4 00 1b cmp %l0, %i3 40012898: 38 80 00 02 bgu,a 400128a0 4001289c: a0 10 00 1b mov %i3, %l0 sec = fat_cluster_num_to_sector_num(fs_info, cur_cln); 400128a0: d2 07 bf fc ld [ %fp + -4 ], %o1 400128a4: 7f ff ff 12 call 400124ec 400128a8: 90 10 00 1d mov %i5, %o0 sec += (ofs >> fs_info->vol.sec_log2); 400128ac: d2 0f 60 02 ldub [ %i5 + 2 ], %o1 byte = ofs & (fs_info->vol.bps - 1); 400128b0: 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); 400128b4: 93 34 40 09 srl %l1, %o1, %o1 byte = ofs & (fs_info->vol.bps - 1); 400128b8: 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); 400128bc: 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); 400128c0: 94 0c 40 0a and %l1, %o2, %o2 400128c4: 90 10 00 1d mov %i5, %o0 400128c8: 96 10 00 10 mov %l0, %o3 400128cc: 40 00 02 eb call 40013478 <_fat_block_read> 400128d0: 98 07 00 18 add %i4, %i0, %o4 if ( ret < 0 ) 400128d4: 80 a2 20 00 cmp %o0, 0 400128d8: 06 80 00 18 bl 40012938 <== NEVER TAKEN 400128dc: b6 26 c0 10 sub %i3, %l0, %i3 return -1; count -= c; cmpltd += c; 400128e0: b0 06 00 10 add %i0, %l0, %i0 save_cln = cur_cln; 400128e4: e0 07 bf fc ld [ %fp + -4 ], %l0 rc = fat_get_fat_cluster(fs_info, cur_cln, &cur_cln); 400128e8: 90 10 00 1d mov %i5, %o0 400128ec: 92 10 00 10 mov %l0, %o1 400128f0: 94 10 00 13 mov %l3, %o2 400128f4: 40 00 19 e2 call 4001907c 400128f8: a2 10 20 00 clr %l1 if ( rc != RC_OK ) 400128fc: 80 a2 20 00 cmp %o0, 0 40012900: 12 80 00 0f bne 4001293c <== NEVER TAKEN 40012904: 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) 40012908: 80 a6 e0 00 cmp %i3, 0 4001290c: 32 bf ff e1 bne,a 40012890 40012910: 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); 40012914: c2 0f 60 08 ldub [ %i5 + 8 ], %g1 40012918: b4 06 bf ff add %i2, -1, %i2 fat_fd->map.disk_cln = save_cln; 4001291c: 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); 40012920: b4 06 80 18 add %i2, %i0, %i2 fat_fd->map.disk_cln = save_cln; return cmpltd; 40012924: 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); 40012928: 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 + 4001292c: a4 06 80 12 add %i2, %l2, %l2 40012930: 10 80 00 03 b 4001293c 40012934: 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; 40012938: 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; } 4001293c: 81 c7 e0 08 ret 40012940: 91 e8 00 08 restore %g0, %o0, %o0 =============================================================================== 400130b4 : int fat_file_size( fat_fs_info_t *fs_info, fat_file_fd_t *fat_fd ) { 400130b4: 9d e3 bf 98 save %sp, -104, %sp int rc = RC_OK; uint32_t cur_cln = fat_fd->cln; 400130b8: c2 06 60 1c ld [ %i1 + 0x1c ], %g1 400130bc: 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)) && 400130c0: c2 06 60 20 ld [ %i1 + 0x20 ], %g1 400130c4: 80 a0 60 01 cmp %g1, 1 400130c8: 12 80 00 0d bne 400130fc 400130cc: ba 10 00 18 mov %i0, %i5 400130d0: c2 06 60 24 ld [ %i1 + 0x24 ], %g1 400130d4: 80 a0 60 00 cmp %g1, 0 400130d8: 32 80 00 0a bne,a 40013100 <== NEVER TAKEN 400130dc: c0 26 60 18 clr [ %i1 + 0x18 ] <== NOT EXECUTED (fs_info->vol.type & (FAT_FAT12 | FAT_FAT16))) 400130e0: 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)) && 400130e4: 80 88 60 03 btst 3, %g1 400130e8: 22 80 00 06 be,a 40013100 <== ALWAYS TAKEN 400130ec: 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; 400130f0: c2 06 20 2c ld [ %i0 + 0x2c ], %g1 <== NOT EXECUTED 400130f4: 10 80 00 18 b 40013154 <== NOT EXECUTED 400130f8: c2 26 60 18 st %g1, [ %i1 + 0x18 ] <== NOT EXECUTED return rc; } fat_fd->fat_file_size = 0; 400130fc: c0 26 60 18 clr [ %i1 + 0x18 ] while ((cur_cln & fs_info->vol.mask) < fs_info->vol.eoc_val) 40013100: 10 80 00 0d b 40013134 40013104: 82 10 20 00 clr %g1 { save_cln = cur_cln; rc = fat_get_fat_cluster(fs_info, cur_cln, &cur_cln); 40013108: 92 10 00 1c mov %i4, %o1 4001310c: 40 00 17 dc call 4001907c 40013110: 94 07 bf fc add %fp, -4, %o2 if ( rc != RC_OK ) 40013114: b0 92 20 00 orcc %o0, 0, %i0 40013118: 12 80 00 10 bne 40013158 <== NEVER TAKEN 4001311c: 01 00 00 00 nop return rc; fat_fd->fat_file_size += fs_info->vol.bpc; 40013120: c2 17 60 06 lduh [ %i5 + 6 ], %g1 40013124: c4 06 60 18 ld [ %i1 + 0x18 ], %g2 40013128: 82 00 80 01 add %g2, %g1, %g1 4001312c: 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; 40013130: 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) 40013134: f8 07 bf fc ld [ %fp + -4 ], %i4 40013138: c6 07 60 10 ld [ %i5 + 0x10 ], %g3 4001313c: c4 07 60 14 ld [ %i5 + 0x14 ], %g2 40013140: 86 0f 00 03 and %i4, %g3, %g3 40013144: 80 a0 c0 02 cmp %g3, %g2 40013148: 0a bf ff f0 bcs 40013108 4001314c: 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; 40013150: c2 26 60 3c st %g1, [ %i1 + 0x3c ] 40013154: b0 10 20 00 clr %i0 return rc; } 40013158: 81 c7 e0 08 ret 4001315c: 81 e8 00 00 restore =============================================================================== 40012944 : fat_file_truncate( fat_fs_info_t *fs_info, fat_file_fd_t *fat_fd, uint32_t new_length ) { 40012944: 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; 40012948: 82 10 3f ff mov -1, %g1 4001294c: c2 27 bf fc st %g1, [ %fp + -4 ] if ( new_length >= fat_fd->fat_file_size ) 40012950: c2 06 60 18 ld [ %i1 + 0x18 ], %g1 40012954: 80 a6 80 01 cmp %i2, %g1 40012958: 0a 80 00 04 bcs 40012968 4001295c: c0 27 bf f8 clr [ %fp + -8 ] return rc; 40012960: 10 80 00 3b b 40012a4c 40012964: 92 10 20 00 clr %o1 assert(fat_fd->fat_file_size); 40012968: 80 a0 60 00 cmp %g1, 0 4001296c: 32 80 00 0a bne,a 40012994 <== ALWAYS TAKEN 40012970: c4 0e 20 08 ldub [ %i0 + 8 ], %g2 40012974: 11 10 00 ad sethi %hi(0x4002b400), %o0 <== NOT EXECUTED 40012978: 15 10 00 ad sethi %hi(0x4002b400), %o2 <== NOT EXECUTED 4001297c: 17 10 00 ad sethi %hi(0x4002b400), %o3 <== NOT EXECUTED 40012980: 90 12 21 70 or %o0, 0x170, %o0 <== NOT EXECUTED 40012984: 92 10 22 d1 mov 0x2d1, %o1 <== NOT EXECUTED 40012988: 94 12 a1 d0 or %o2, 0x1d0, %o2 <== NOT EXECUTED 4001298c: 7f ff cc 0d call 400059c0 <__assert_func> <== NOT EXECUTED 40012990: 96 12 e1 b8 or %o3, 0x1b8, %o3 <== NOT EXECUTED cl_start = (new_length + fs_info->vol.bpc - 1) >> fs_info->vol.bpc_log2; 40012994: c6 16 20 06 lduh [ %i0 + 6 ], %g3 40012998: 86 00 ff ff add %g3, -1, %g3 4001299c: b4 00 c0 1a add %g3, %i2, %i2 400129a0: b5 36 80 02 srl %i2, %g2, %i2 if ((cl_start << fs_info->vol.bpc_log2) >= fat_fd->fat_file_size) 400129a4: 85 2e 80 02 sll %i2, %g2, %g2 400129a8: 80 a0 80 01 cmp %g2, %g1 400129ac: 1a bf ff ed bcc 40012960 400129b0: 80 a6 a0 00 cmp %i2, 0 return RC_OK; if (cl_start != 0) 400129b4: 12 80 00 0b bne 400129e0 400129b8: 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); 400129bc: 92 10 00 19 mov %i1, %o1 400129c0: 94 10 00 1a mov %i2, %o2 400129c4: 7f ff fe e9 call 40012568 400129c8: 96 07 bf f8 add %fp, -8, %o3 if (rc != RC_OK) 400129cc: 80 a2 60 00 cmp %o1, 0 400129d0: 32 80 00 20 bne,a 40012a50 <== NEVER TAKEN 400129d4: b0 10 00 09 mov %o1, %i0 <== NOT EXECUTED return rc; rc = fat_free_fat_clusters_chain(fs_info, cur_cln); 400129d8: 10 80 00 0b b 40012a04 400129dc: 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); 400129e0: 92 10 00 19 mov %i1, %o1 400129e4: 94 06 bf ff add %i2, -1, %o2 400129e8: 7f ff fe e0 call 40012568 400129ec: 96 07 bf fc add %fp, -4, %o3 if (rc != RC_OK) 400129f0: 80 a2 60 00 cmp %o1, 0 400129f4: 02 bf ff f2 be 400129bc <== ALWAYS TAKEN 400129f8: 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; } 400129fc: 81 c7 e0 08 ret <== NOT EXECUTED 40012a00: 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); 40012a04: 40 00 1a b1 call 400194c8 40012a08: 90 10 00 18 mov %i0, %o0 if (rc != RC_OK) 40012a0c: 92 92 20 00 orcc %o0, 0, %o1 40012a10: 12 80 00 0f bne 40012a4c <== NEVER TAKEN 40012a14: 80 a6 a0 00 cmp %i2, 0 return rc; if (cl_start != 0) 40012a18: 02 80 00 0d be 40012a4c 40012a1c: 92 10 20 00 clr %o1 { rc = fat_set_fat_cluster(fs_info, new_last_cln, FAT_GENFAT_EOC); 40012a20: d2 07 bf fc ld [ %fp + -4 ], %o1 40012a24: 90 10 00 18 mov %i0, %o0 40012a28: 40 00 1a 07 call 40019244 40012a2c: 94 10 3f ff mov -1, %o2 if ( rc != RC_OK ) 40012a30: 92 92 20 00 orcc %o0, 0, %o1 40012a34: 12 80 00 06 bne 40012a4c <== NEVER TAKEN 40012a38: c2 07 bf fc ld [ %fp + -4 ], %g1 return rc; fat_fd->map.file_cln = cl_start - 1; 40012a3c: b4 06 bf ff add %i2, -1, %i2 fat_fd->map.disk_cln = new_last_cln; 40012a40: 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; 40012a44: f4 26 60 34 st %i2, [ %i1 + 0x34 ] fat_fd->map.disk_cln = new_last_cln; fat_fd->map.last_cln = new_last_cln; 40012a48: c2 26 60 3c st %g1, [ %i1 + 0x3c ] } return RC_OK; } 40012a4c: b0 10 00 09 mov %o1, %i0 40012a50: 81 c7 e0 08 ret 40012a54: 81 e8 00 00 restore =============================================================================== 40012e34 : fat_file_fd_t *fat_fd, uint32_t start, uint32_t count, const uint8_t *buf ) { 40012e34: 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; 40012e38: c0 27 bf f8 clr [ %fp + -8 ] fat_file_fd_t *fat_fd, uint32_t start, uint32_t count, const uint8_t *buf ) { 40012e3c: 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; 40012e40: c2 06 60 18 ld [ %i1 + 0x18 ], %g1 uint32_t file_cln_initial = fat_fd->map.file_cln; 40012e44: e6 06 60 34 ld [ %i1 + 0x34 ], %l3 uint32_t cln; if ( count == 0 ) 40012e48: 80 a6 e0 00 cmp %i3, 0 40012e4c: 02 80 00 84 be 4001305c <== NEVER TAKEN 40012e50: 90 10 20 00 clr %o0 return cmpltd; if (start >= fat_fd->size_limit) 40012e54: fa 06 60 14 ld [ %i1 + 0x14 ], %i5 40012e58: 80 a6 80 1d cmp %i2, %i5 40012e5c: 2a 80 00 07 bcs,a 40012e78 <== ALWAYS TAKEN 40012e60: ba 27 40 1a sub %i5, %i2, %i5 rtems_set_errno_and_return_minus_one(EFBIG); 40012e64: 40 00 1f 50 call 4001aba4 <__errno> <== NOT EXECUTED 40012e68: 01 00 00 00 nop <== NOT EXECUTED 40012e6c: 82 10 20 1b mov 0x1b, %g1 ! 1b <== NOT EXECUTED 40012e70: 10 80 00 30 b 40012f30 <== NOT EXECUTED 40012e74: c2 22 00 00 st %g1, [ %o0 ] <== NOT EXECUTED 40012e78: 80 a7 40 1b cmp %i5, %i3 40012e7c: 38 80 00 02 bgu,a 40012e84 <== ALWAYS TAKEN 40012e80: 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; 40012e84: 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); 40012e88: b6 07 40 1a add %i5, %i2, %i3 40012e8c: 94 40 20 00 addx %g0, 0, %o2 40012e90: 90 10 00 10 mov %l0, %o0 40012e94: 92 10 00 19 mov %i1, %o1 40012e98: 96 10 00 1b mov %i3, %o3 40012e9c: 7f ff ff 50 call 40012bdc 40012ea0: 98 07 bf f8 add %fp, -8, %o4 if (RC_OK == rc) 40012ea4: 80 a2 20 00 cmp %o0, 0 40012ea8: 12 80 00 6d bne 4001305c 40012eac: 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)) 40012eb0: 80 a0 40 1b cmp %g1, %i3 40012eb4: 32 80 00 02 bne,a 40012ebc <== NEVER TAKEN 40012eb8: 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)); 40012ebc: 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)) 40012ec0: 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)); 40012ec4: 80 a0 e0 01 cmp %g3, 1 40012ec8: 12 80 00 09 bne 40012eec 40012ecc: 82 10 20 00 clr %g1 40012ed0: c6 06 60 24 ld [ %i1 + 0x24 ], %g3 40012ed4: 80 a0 e0 00 cmp %g3, 0 40012ed8: 12 80 00 06 bne 40012ef0 <== NEVER TAKEN 40012edc: 80 a0 60 00 cmp %g1, 0 40012ee0: 82 08 a0 03 and %g2, 3, %g1 40012ee4: 80 a0 00 01 cmp %g0, %g1 40012ee8: 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)) 40012eec: 80 a0 60 00 cmp %g1, 0 40012ef0: 02 80 00 12 be 40012f38 40012ef4: f6 0c 20 08 ldub [ %l0 + 8 ], %i3 { cln = fat_fd->cln; 40012ef8: d2 06 60 1c ld [ %i1 + 0x1c ], %o1 cln += (start >> fs_info->vol.bpc_log2); byte = start & (fs_info->vol.bpc -1); 40012efc: 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); 40012f00: b7 36 80 1b srl %i2, %i3, %i3 byte = start & (fs_info->vol.bpc -1); 40012f04: 94 02 bf ff add %o2, -1, %o2 ret = fat_cluster_write(fs_info, 40012f08: 90 10 00 10 mov %l0, %o0 40012f0c: 92 06 c0 09 add %i3, %o1, %o1 40012f10: 94 0e 80 0a and %i2, %o2, %o2 40012f14: 96 10 00 1d mov %i5, %o3 40012f18: 98 10 00 1c mov %i4, %o4 40012f1c: 40 00 01 e5 call 400136b0 40012f20: 9a 10 20 00 clr %o5 cln, byte, count, buf, false); if (0 > ret) 40012f24: 80 a2 20 00 cmp %o0, 0 40012f28: 16 80 00 4d bge 4001305c <== ALWAYS TAKEN 40012f2c: 01 00 00 00 nop rc = -1; 40012f30: 10 80 00 4b b 4001305c <== NOT EXECUTED 40012f34: 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; 40012f38: 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; 40012f3c: 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); 40012f40: 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; 40012f44: 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); 40012f48: 90 10 00 10 mov %l0, %o0 40012f4c: 92 10 00 19 mov %i1, %o1 40012f50: 94 10 00 11 mov %l1, %o2 40012f54: 7f ff fd 85 call 40012568 40012f58: 96 10 00 15 mov %l5, %o3 if (RC_OK == rc) 40012f5c: 80 a2 60 00 cmp %o1, 0 40012f60: 12 80 00 34 bne 40013030 <== NEVER TAKEN 40012f64: b7 2c 40 1b sll %l1, %i3, %i3 { file_cln_cnt = cur_cln - fat_fd->cln; 40012f68: c2 06 60 1c ld [ %i1 + 0x1c ], %g1 40012f6c: e4 07 bf fc ld [ %fp + -4 ], %l2 40012f70: 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); 40012f74: 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; 40012f78: 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); 40012f7c: 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; 40012f80: 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 */ 40012f84: 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; 40012f88: 10 80 00 1a b 40012ff0 40012f8c: 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)); 40012f90: 96 22 c0 18 sub %o3, %i0, %o3 40012f94: 80 a2 c0 1d cmp %o3, %i5 40012f98: 38 80 00 02 bgu,a 40012fa0 40012f9c: 96 10 00 1d mov %i5, %o3 if (file_cln_initial < file_cln_cnt) 40012fa0: 80 a4 c0 12 cmp %l3, %l2 40012fa4: 2a 80 00 02 bcs,a 40012fac 40012fa8: a8 10 20 01 mov 1, %l4 overwrite_cluster = true; ret = fat_cluster_write(fs_info, 40012fac: d2 07 bf fc ld [ %fp + -4 ], %o1 40012fb0: 90 10 00 10 mov %l0, %o0 40012fb4: 94 10 00 18 mov %i0, %o2 40012fb8: 98 07 00 1b add %i4, %i3, %o4 40012fbc: 40 00 01 bd call 400136b0 40012fc0: 9a 0d 20 01 and %l4, 1, %o5 40012fc4: 82 10 00 08 mov %o0, %g1 cur_cln, ofs_cln, c, &buf[cmpltd], overwrite_cluster); if (0 > ret) 40012fc8: 80 a0 60 00 cmp %g1, 0 40012fcc: 16 80 00 1d bge 40013040 <== ALWAYS TAKEN 40012fd0: 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) 40012fd4: 10 80 00 08 b 40012ff4 <== NOT EXECUTED 40012fd8: 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); 40012fdc: 90 10 00 10 mov %l0, %o0 40012fe0: 92 10 00 16 mov %l6, %o1 40012fe4: 40 00 18 26 call 4001907c 40012fe8: 94 10 00 15 mov %l5, %o2 ofs_cln = 0; 40012fec: 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) 40012ff0: 80 a7 60 00 cmp %i5, 0 40012ff4: 02 80 00 04 be 40013004 40012ff8: 80 a2 20 00 cmp %o0, 0 40012ffc: 22 bf ff e5 be,a 40012f90 <== ALWAYS TAKEN 40013000: 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); 40013004: c2 0c 20 08 ldub [ %l0 + 8 ], %g1 40013008: b4 06 bf ff add %i2, -1, %i2 fat_fd->map.disk_cln = save_cln; 4001300c: 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); 40013010: b4 06 80 1b add %i2, %i3, %i2 40013014: b5 36 80 01 srl %i2, %g1, %i2 } } /* update cache */ /* XXX: check this - I'm not sure :( */ fat_fd->map.file_cln = start_cln + 40013018: 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) 4001301c: 92 92 20 00 orcc %o0, 0, %o1 40013020: 12 80 00 03 bne 4001302c <== NEVER TAKEN 40013024: e2 26 60 34 st %l1, [ %i1 + 0x34 ] return rc; else return cmpltd; 40013028: 92 10 00 1b mov %i3, %o1 fat_fd, start, count, buf, file_cln_initial); if (0 > ret) 4001302c: 80 a2 60 00 cmp %o1, 0 40013030: 16 80 00 0b bge 4001305c <== ALWAYS TAKEN 40013034: 90 10 00 09 mov %o1, %o0 40013038: 10 80 00 09 b 4001305c <== NOT EXECUTED 4001303c: 90 10 3f ff mov -1, %o0 <== NOT EXECUTED if (0 > ret) rc = -1; if (RC_OK == rc) { ++file_cln_cnt; 40013040: a4 04 a0 01 inc %l2 bytes_to_write -= ret; cmpltd += ret; 40013044: b6 06 c0 01 add %i3, %g1, %i3 save_cln = cur_cln; if (0 < bytes_to_write) 40013048: ba a7 40 01 subcc %i5, %g1, %i5 4001304c: 12 bf ff e4 bne 40012fdc 40013050: ec 07 bf fc ld [ %fp + -4 ], %l6 40013054: 10 bf ff e6 b 40012fec 40013058: 90 10 20 00 clr %o0 } if (RC_OK != rc) return rc; else return cmpltd; } 4001305c: 81 c7 e0 08 ret 40013060: 91 e8 00 08 restore %g0, %o0, %o0 =============================================================================== 400194c8 : int fat_free_fat_clusters_chain( fat_fs_info_t *fs_info, uint32_t chain ) { 400194c8: 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; 400194cc: b8 10 20 00 clr %i4 int fat_free_fat_clusters_chain( fat_fs_info_t *fs_info, uint32_t chain ) { 400194d0: ba 10 00 18 mov %i0, %i5 int rc = RC_OK, rc1 = RC_OK; uint32_t cur_cln = chain; uint32_t next_cln = 0; 400194d4: 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; 400194d8: 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) 400194dc: 10 80 00 19 b 40019540 400194e0: b4 10 20 00 clr %i2 { rc = fat_get_fat_cluster(fs_info, cur_cln, &next_cln); 400194e4: 92 10 00 1b mov %i3, %o1 400194e8: 7f ff fe e5 call 4001907c 400194ec: 94 07 bf fc add %fp, -4, %o2 if ( rc != RC_OK ) 400194f0: b0 92 20 00 orcc %o0, 0, %i0 400194f4: 02 80 00 0b be 40019520 <== ALWAYS TAKEN 400194f8: 90 10 00 1d mov %i5, %o0 { if(fs_info->vol.free_cls != FAT_UNDEFINED_VALUE) 400194fc: c2 07 60 44 ld [ %i5 + 0x44 ], %g1 <== NOT EXECUTED 40019500: 80 a0 7f ff cmp %g1, -1 <== NOT EXECUTED 40019504: 02 80 00 03 be 40019510 <== NOT EXECUTED 40019508: b8 07 00 01 add %i4, %g1, %i4 <== NOT EXECUTED fs_info->vol.free_cls += freed_cls_cnt; 4001950c: f8 27 60 44 st %i4, [ %i5 + 0x44 ] <== NOT EXECUTED fat_buf_release(fs_info); 40019510: 7f ff e7 37 call 400131ec <== NOT EXECUTED 40019514: 90 10 00 1d mov %i5, %o0 <== NOT EXECUTED 40019518: 81 c7 e0 08 ret <== NOT EXECUTED 4001951c: 81 e8 00 00 restore <== NOT EXECUTED return rc; } rc = fat_set_fat_cluster(fs_info, cur_cln, FAT_GENFAT_FREE); 40019520: 92 10 00 1b mov %i3, %o1 40019524: 7f ff ff 48 call 40019244 40019528: 94 10 20 00 clr %o2 if ( rc != RC_OK ) 4001952c: 80 a2 20 00 cmp %o0, 0 40019530: 32 80 00 02 bne,a 40019538 <== NEVER TAKEN 40019534: b4 10 00 08 mov %o0, %i2 <== NOT EXECUTED rc1 = rc; freed_cls_cnt++; cur_cln = next_cln; 40019538: 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++; 4001953c: 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) 40019540: c4 07 60 10 ld [ %i5 + 0x10 ], %g2 40019544: c2 07 60 14 ld [ %i5 + 0x14 ], %g1 40019548: 84 0e c0 02 and %i3, %g2, %g2 4001954c: 80 a0 80 01 cmp %g2, %g1 40019550: 0a bf ff e5 bcs 400194e4 40019554: 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) 40019558: c2 07 60 44 ld [ %i5 + 0x44 ], %g1 4001955c: 80 a0 7f ff cmp %g1, -1 40019560: 02 80 00 05 be 40019574 <== ALWAYS TAKEN 40019564: f2 27 60 4c st %i1, [ %i5 + 0x4c ] fs_info->vol.free_cls += freed_cls_cnt; 40019568: b8 07 00 01 add %i4, %g1, %i4 <== NOT EXECUTED 4001956c: f8 27 60 44 st %i4, [ %i5 + 0x44 ] <== NOT EXECUTED fat_buf_release(fs_info); 40019570: 90 10 00 1d mov %i5, %o0 <== NOT EXECUTED 40019574: 7f ff e7 1e call 400131ec 40019578: b0 10 00 1a mov %i2, %i0 if (rc1 != RC_OK) return rc1; return RC_OK; } 4001957c: 81 c7 e0 08 ret 40019580: 81 e8 00 00 restore =============================================================================== 40014284 : 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); 40014284: c2 02 20 80 ld [ %o0 + 0x80 ], %g1 <== NOT EXECUTED 40014288: c4 02 20 74 ld [ %o0 + 0x74 ], %g2 <== NOT EXECUTED 4001428c: 86 10 20 01 mov 1, %g3 <== NOT EXECUTED 40014290: 92 22 40 01 sub %o1, %g1, %o1 <== NOT EXECUTED 40014294: 83 32 60 03 srl %o1, 3, %g1 <== NOT EXECUTED 40014298: 92 0a 60 07 and %o1, 7, %o1 <== NOT EXECUTED 4001429c: 93 28 c0 09 sll %g3, %o1, %o1 <== NOT EXECUTED 400142a0: c6 08 80 01 ldub [ %g2 + %g1 ], %g3 <== NOT EXECUTED 400142a4: 92 28 c0 09 andn %g3, %o1, %o1 <== NOT EXECUTED 400142a8: 81 c3 e0 08 retl <== NOT EXECUTED 400142ac: d2 28 80 01 stb %o1, [ %g2 + %g1 ] <== NOT EXECUTED =============================================================================== 4001907c : fat_get_fat_cluster( fat_fs_info_t *fs_info, uint32_t cln, uint32_t *ret_val ) { 4001907c: 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)) ) 40019080: 80 a6 60 01 cmp %i1, 1 40019084: 08 80 00 67 bleu 40019220 <== NEVER TAKEN 40019088: ba 10 00 18 mov %i0, %i5 4001908c: c2 06 20 38 ld [ %i0 + 0x38 ], %g1 40019090: 82 00 60 01 inc %g1 40019094: 80 a6 40 01 cmp %i1, %g1 40019098: 28 80 00 03 bleu,a 400190a4 <== ALWAYS TAKEN 4001909c: c2 0e 20 0e ldub [ %i0 + 0xe ], %g1 400190a0: 30 80 00 60 b,a 40019220 <== NOT EXECUTED rtems_set_errno_and_return_minus_one(EIO); sec = (FAT_FAT_OFFSET(fs_info->vol.type, cln) >> fs_info->vol.sec_log2) + 400190a4: 86 08 60 01 and %g1, 1, %g3 400190a8: 80 88 e0 ff btst 0xff, %g3 400190ac: 02 80 00 05 be 400190c0 400190b0: 88 08 60 02 and %g1, 2, %g4 400190b4: 85 36 60 01 srl %i1, 1, %g2 400190b8: 10 80 00 06 b 400190d0 400190bc: 84 00 80 19 add %g2, %i1, %g2 400190c0: 80 89 20 ff btst 0xff, %g4 400190c4: 02 80 00 03 be 400190d0 400190c8: 85 2e 60 02 sll %i1, 2, %g2 400190cc: 85 2e 60 01 sll %i1, 1, %g2 400190d0: f6 0f 60 02 ldub [ %i5 + 2 ], %i3 400190d4: c8 07 60 58 ld [ %i5 + 0x58 ], %g4 400190d8: 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); 400190dc: 80 88 e0 ff btst 0xff, %g3 400190e0: 02 80 00 05 be 400190f4 400190e4: b6 00 80 04 add %g2, %g4, %i3 400190e8: b9 36 60 01 srl %i1, 1, %i4 400190ec: 10 80 00 07 b 40019108 400190f0: b8 07 00 19 add %i4, %i1, %i4 400190f4: 82 08 60 02 and %g1, 2, %g1 400190f8: 80 88 60 ff btst 0xff, %g1 400190fc: 02 80 00 03 be 40019108 40019100: b9 2e 60 02 sll %i1, 2, %i4 40019104: b9 2e 60 01 sll %i1, 1, %i4 40019108: e0 17 40 00 lduh [ %i5 ], %l0 rc = fat_buf_access(fs_info, sec, FAT_OP_TYPE_READ, &sec_buf); 4001910c: 90 10 00 1d mov %i5, %o0 40019110: 92 10 00 1b mov %i3, %o1 40019114: 94 10 20 01 mov 1, %o2 40019118: 7f ff e8 a9 call 400133bc 4001911c: 96 07 bf fc add %fp, -4, %o3 if (rc != RC_OK) 40019120: b0 92 20 00 orcc %o0, 0, %i0 40019124: 12 80 00 37 bne 40019200 <== NEVER TAKEN 40019128: 83 2c 20 10 sll %l0, 0x10, %g1 return rc; switch ( fs_info->vol.type ) 4001912c: c4 0f 60 0e ldub [ %i5 + 0xe ], %g2 40019130: 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); 40019134: 83 30 60 10 srl %g1, 0x10, %g1 40019138: 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 ) 4001913c: 02 80 00 27 be 400191d8 40019140: 82 0f 00 01 and %i4, %g1, %g1 40019144: 80 a0 a0 04 cmp %g2, 4 40019148: 02 80 00 30 be 40019208 4001914c: 80 a0 a0 01 cmp %g2, 1 40019150: 12 80 00 34 bne 40019220 <== NEVER TAKEN 40019154: 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) ) 40019158: 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)); 4001915c: c4 08 c0 01 ldub [ %g3 + %g1 ], %g2 if ( ofs == (fs_info->vol.bps - 1) ) 40019160: 88 01 3f ff add %g4, -1, %g4 40019164: 80 a0 40 04 cmp %g1, %g4 40019168: 12 80 00 10 bne 400191a8 <== ALWAYS TAKEN 4001916c: c4 26 80 00 st %g2, [ %i2 ] { rc = fat_buf_access(fs_info, sec + 1, FAT_OP_TYPE_READ, 40019170: 90 10 00 1d mov %i5, %o0 <== NOT EXECUTED 40019174: 92 06 e0 01 add %i3, 1, %o1 <== NOT EXECUTED 40019178: 94 10 20 01 mov 1, %o2 <== NOT EXECUTED 4001917c: 7f ff e8 90 call 400133bc <== NOT EXECUTED 40019180: 96 07 bf fc add %fp, -4, %o3 <== NOT EXECUTED &sec_buf); if (rc != RC_OK) 40019184: 80 a2 20 00 cmp %o0, 0 <== NOT EXECUTED 40019188: 12 80 00 2c bne 40019238 <== NOT EXECUTED 4001918c: c2 07 bf fc ld [ %fp + -4 ], %g1 <== NOT EXECUTED return rc; *ret_val |= *sec_buf << 8; 40019190: c4 06 80 00 ld [ %i2 ], %g2 <== NOT EXECUTED 40019194: c2 08 40 00 ldub [ %g1 ], %g1 <== NOT EXECUTED 40019198: 83 28 60 08 sll %g1, 8, %g1 <== NOT EXECUTED 4001919c: 82 10 80 01 or %g2, %g1, %g1 <== NOT EXECUTED 400191a0: 10 80 00 07 b 400191bc <== NOT EXECUTED 400191a4: c2 26 80 00 st %g1, [ %i2 ] <== NOT EXECUTED } else { *ret_val |= *(sec_buf + ofs + 1) << 8; 400191a8: 82 00 c0 01 add %g3, %g1, %g1 400191ac: c2 08 60 01 ldub [ %g1 + 1 ], %g1 400191b0: 83 28 60 08 sll %g1, 8, %g1 400191b4: 84 10 40 02 or %g1, %g2, %g2 400191b8: c4 26 80 00 st %g2, [ %i2 ] } if ( FAT_CLUSTER_IS_ODD(cln) ) 400191bc: 80 8e 60 01 btst 1, %i1 400191c0: 02 80 00 04 be 400191d0 400191c4: c2 06 80 00 ld [ %i2 ], %g1 *ret_val = (*ret_val) >> FAT12_SHIFT; 400191c8: 10 80 00 0d b 400191fc 400191cc: 83 30 60 04 srl %g1, 4, %g1 else *ret_val = (*ret_val) & FAT_FAT12_MASK; 400191d0: 10 80 00 0b b 400191fc 400191d4: 82 08 6f ff and %g1, 0xfff, %g1 break; case FAT_FAT16: *ret_val = *((uint16_t *)(sec_buf + ofs)); 400191d8: c4 07 bf fc ld [ %fp + -4 ], %g2 *ret_val = CF_LE_W(*ret_val); 400191dc: 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)); 400191e0: c2 10 80 01 lduh [ %g2 + %g1 ], %g1 *ret_val = CF_LE_W(*ret_val); 400191e4: 86 10 e3 ff or %g3, 0x3ff, %g3 400191e8: 83 28 60 10 sll %g1, 0x10, %g1 400191ec: 85 30 60 18 srl %g1, 0x18, %g2 400191f0: 83 30 60 08 srl %g1, 8, %g1 400191f4: 82 08 40 03 and %g1, %g3, %g1 400191f8: 82 10 80 01 or %g2, %g1, %g1 400191fc: c2 26 80 00 st %g1, [ %i2 ] break; 40019200: 81 c7 e0 08 ret 40019204: 81 e8 00 00 restore case FAT_FAT32: *ret_val = *((uint32_t *)(sec_buf + ofs)); *ret_val = CF_LE_L(*ret_val); 40019208: c4 07 bf fc ld [ %fp + -4 ], %g2 4001920c: 7f ff ff 90 call 4001904c 40019210: d0 00 80 01 ld [ %g2 + %g1 ], %o0 40019214: d0 26 80 00 st %o0, [ %i2 ] break; 40019218: 81 c7 e0 08 ret 4001921c: 81 e8 00 00 restore default: rtems_set_errno_and_return_minus_one(EIO); 40019220: 40 00 06 61 call 4001aba4 <__errno> <== NOT EXECUTED 40019224: b0 10 3f ff mov -1, %i0 <== NOT EXECUTED 40019228: 82 10 20 05 mov 5, %g1 <== NOT EXECUTED 4001922c: c2 22 00 00 st %g1, [ %o0 ] <== NOT EXECUTED 40019230: 81 c7 e0 08 ret <== NOT EXECUTED 40019234: 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) 40019238: b0 10 00 08 mov %o0, %i0 <== NOT EXECUTED rtems_set_errno_and_return_minus_one(EIO); break; } return RC_OK; } 4001923c: 81 c7 e0 08 ret <== NOT EXECUTED 40019240: 81 e8 00 00 restore <== NOT EXECUTED =============================================================================== 400141c4 : * 0 means FAILED !!! * */ uint32_t fat_get_unique_ino(fat_fs_info_t *fs_info) { 400141c4: 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)) 400141c8: 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) 400141cc: 10 80 00 2b b 40014278 <== NOT EXECUTED 400141d0: 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)) 400141d4: c2 06 20 78 ld [ %i0 + 0x78 ], %g1 <== NOT EXECUTED 400141d8: 85 30 60 03 srl %g1, 3, %g2 <== NOT EXECUTED 400141dc: b6 00 c0 02 add %g3, %g2, %i3 <== NOT EXECUTED 400141e0: f4 08 c0 02 ldub [ %g3 + %g2 ], %i2 <== NOT EXECUTED 400141e4: c4 48 c0 02 ldsb [ %g3 + %g2 ], %g2 <== NOT EXECUTED 400141e8: ba 08 60 07 and %g1, 7, %i5 <== NOT EXECUTED 400141ec: 85 38 80 1d sra %g2, %i5, %g2 <== NOT EXECUTED 400141f0: 80 88 a0 01 btst 1, %g2 <== NOT EXECUTED 400141f4: 12 80 00 0a bne 4001421c <== NOT EXECUTED 400141f8: 82 00 60 01 inc %g1 <== NOT EXECUTED { FAT_SET_UNIQ_INO_BUSY(fs_info->index, fs_info->uino); 400141fc: 82 10 20 01 mov 1, %g1 <== NOT EXECUTED 40014200: bb 28 40 1d sll %g1, %i5, %i5 <== NOT EXECUTED 40014204: ba 17 40 1a or %i5, %i2, %i5 <== NOT EXECUTED 40014208: fa 2e c0 00 stb %i5, [ %i3 ] <== NOT EXECUTED return (fs_info->uino_base + fs_info->index); 4001420c: c4 06 20 78 ld [ %i0 + 0x78 ], %g2 <== NOT EXECUTED 40014210: c2 06 20 80 ld [ %i0 + 0x80 ], %g1 <== NOT EXECUTED 40014214: 81 c7 e0 08 ret <== NOT EXECUTED 40014218: 91 e8 80 01 restore %g2, %g1, %o0 <== NOT EXECUTED } fs_info->index++; if (fs_info->index >= fs_info->uino_pool_size) 4001421c: 80 a0 40 04 cmp %g1, %g4 <== NOT EXECUTED 40014220: 3a 80 00 03 bcc,a 4001422c <== NOT EXECUTED 40014224: c0 26 20 78 clr [ %i0 + 0x78 ] <== NOT EXECUTED 40014228: 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++) 4001422c: 92 02 60 01 inc %o1 <== NOT EXECUTED 40014230: 80 a2 40 04 cmp %o1, %g4 <== NOT EXECUTED 40014234: 32 bf ff e8 bne,a 400141d4 <== NOT EXECUTED 40014238: 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)) 4001423c: c2 06 20 80 ld [ %i0 + 0x80 ], %g1 <== NOT EXECUTED 40014240: 93 2a 60 01 sll %o1, 1, %o1 <== NOT EXECUTED 40014244: 82 27 00 01 sub %i4, %g1, %g1 <== NOT EXECUTED 40014248: 80 a2 40 01 cmp %o1, %g1 <== NOT EXECUTED 4001424c: 2a 80 00 04 bcs,a 4001425c <== NOT EXECUTED 40014250: d0 06 20 74 ld [ %i0 + 0x74 ], %o0 <== NOT EXECUTED resrc_unsuff = true; } else resrc_unsuff = true; } return 0; 40014254: 81 c7 e0 08 ret <== NOT EXECUTED 40014258: 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); 4001425c: 7f ff ca 2b call 40006b08 <== NOT EXECUTED 40014260: d2 26 20 7c st %o1, [ %i0 + 0x7c ] <== NOT EXECUTED if (fs_info->uino != NULL) 40014264: 80 a2 20 00 cmp %o0, 0 <== NOT EXECUTED 40014268: 02 bf ff fb be 40014254 <== NOT EXECUTED 4001426c: d0 26 20 74 st %o0, [ %i0 + 0x74 ] <== NOT EXECUTED fs_info->index = fs_info->uino_pool_size; 40014270: c2 06 20 7c ld [ %i0 + 0x7c ], %g1 <== NOT EXECUTED 40014274: 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++) 40014278: c8 06 20 7c ld [ %i0 + 0x7c ], %g4 <== NOT EXECUTED 4001427c: 10 bf ff ed b 40014230 <== NOT EXECUTED 40014280: 92 10 20 00 clr %o1 <== NOT EXECUTED =============================================================================== 4001414c : int fat_init_clusters_chain( fat_fs_info_t *fs_info, uint32_t start_cln ) { 4001414c: 9d e3 bf 98 save %sp, -104, %sp 40014150: 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) 40014154: 10 80 00 10 b 40014194 40014158: f2 27 bf fc st %i1, [ %fp + -4 ] { ret = fat_cluster_set(fs_info, cur_cln, 0, fs_info->vol.bpc, 0); 4001415c: 90 10 00 1d mov %i5, %o0 40014160: 94 10 20 00 clr %o2 40014164: 7f ff fd 0b call 40013590 40014168: 98 10 20 00 clr %o4 if ( ret != fs_info->vol.bpc ) 4001416c: c2 17 60 06 lduh [ %i5 + 6 ], %g1 40014170: 80 a2 00 01 cmp %o0, %g1 40014174: 12 80 00 11 bne 400141b8 <== NEVER TAKEN 40014178: d2 07 bf fc ld [ %fp + -4 ], %o1 { return -1; } rc = fat_get_fat_cluster(fs_info, cur_cln, &cur_cln); 4001417c: 90 10 00 1d mov %i5, %o0 40014180: 40 00 13 bf call 4001907c 40014184: 94 07 bf fc add %fp, -4, %o2 if ( rc != RC_OK ) 40014188: b0 92 20 00 orcc %o0, 0, %i0 4001418c: 12 80 00 0c bne 400141bc <== NEVER TAKEN 40014190: 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) 40014194: d2 07 bf fc ld [ %fp + -4 ], %o1 40014198: c4 07 60 10 ld [ %i5 + 0x10 ], %g2 4001419c: c2 07 60 14 ld [ %i5 + 0x14 ], %g1 400141a0: 84 0a 40 02 and %o1, %g2, %g2 400141a4: 80 a0 80 01 cmp %g2, %g1 400141a8: 2a bf ff ed bcs,a 4001415c 400141ac: d6 17 60 06 lduh [ %i5 + 6 ], %o3 return rc; } } return rc; 400141b0: 81 c7 e0 08 ret 400141b4: 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; 400141b8: b0 10 3f ff mov -1, %i0 <== NOT EXECUTED } } return rc; } 400141bc: 81 c7 e0 08 ret <== NOT EXECUTED 400141c0: 81 e8 00 00 restore <== NOT EXECUTED =============================================================================== 400137dc : * 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) { 400137dc: 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); 400137e0: 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) { 400137e4: 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; 400137e8: c0 27 bf a4 clr [ %fp + -92 ] vol->fd = open(device, O_RDWR); 400137ec: 7f ff cc 2c call 4000689c 400137f0: 90 10 00 19 mov %i1, %o0 if (vol->fd < 0) 400137f4: 80 a2 20 00 cmp %o0, 0 400137f8: 06 80 00 17 bl 40013854 <== NEVER TAKEN 400137fc: d0 26 e0 60 st %o0, [ %i3 + 0x60 ] { rtems_set_errno_and_return_minus_one(ENXIO); } rc = fstat(vol->fd, &stat_buf); 40013800: 7f ff c9 00 call 40005c00 40013804: 92 07 bf b8 add %fp, -72, %o1 if (rc != 0) 40013808: 80 a2 20 00 cmp %o0, 0 4001380c: 12 80 00 10 bne 4001384c <== NEVER TAKEN 40013810: 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)) 40013814: c6 07 bf c4 ld [ %fp + -60 ], %g3 40013818: 05 00 00 3c sethi %hi(0xf000), %g2 4001381c: 86 08 c0 02 and %g3, %g2, %g3 40013820: 05 00 00 18 sethi %hi(0x6000), %g2 40013824: 80 a0 c0 02 cmp %g3, %g2 40013828: 12 80 00 09 bne 4001384c <== NEVER TAKEN 4001382c: 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); 40013830: 94 06 20 64 add %i0, 0x64, %o2 40013834: 40 00 05 35 call 40014d08 40013838: 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) { 4001383c: 80 a2 20 00 cmp %o0, 0 40013840: 22 80 00 09 be,a 40013864 <== ALWAYS TAKEN 40013844: d0 06 20 64 ld [ %i0 + 0x64 ], %o0 close(vol->fd); 40013848: d0 06 20 60 ld [ %i0 + 0x60 ], %o0 <== NOT EXECUTED 4001384c: 7f ff c8 a2 call 40005ad4 <== NOT EXECUTED 40013850: 01 00 00 00 nop <== NOT EXECUTED rtems_set_errno_and_return_minus_one(ENXIO); 40013854: 40 00 1c d4 call 4001aba4 <__errno> <== NOT EXECUTED 40013858: 01 00 00 00 nop <== NOT EXECUTED 4001385c: 10 80 01 af b 40013f18 <== NOT EXECUTED 40013860: 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); 40013864: 92 10 20 00 clr %o1 40013868: 7f ff f6 9a call 400112d0 4001386c: 94 07 bf a4 add %fp, -92, %o2 if (sc != RTEMS_SUCCESSFUL) 40013870: 80 a2 20 00 cmp %o0, 0 40013874: 22 80 00 03 be,a 40013880 <== ALWAYS TAKEN 40013878: d0 07 bf a4 ld [ %fp + -92 ], %o0 4001387c: 30 80 00 32 b,a 40013944 <== NOT EXECUTED { close(vol->fd); rtems_set_errno_and_return_minus_one( EIO); } memcpy( boot_rec, block->buffer, FAT_MAX_BPB_SIZE); 40013880: c6 02 20 1c ld [ %o0 + 0x1c ], %g3 40013884: c2 08 e0 20 ldub [ %g3 + 0x20 ], %g1 40013888: c4 08 e0 0b ldub [ %g3 + 0xb ], %g2 4001388c: c2 2f bf 9a stb %g1, [ %fp + -102 ] 40013890: c2 08 e0 22 ldub [ %g3 + 0x22 ], %g1 40013894: d2 08 e0 0c ldub [ %g3 + 0xc ], %o1 40013898: c2 2f bf 9b stb %g1, [ %fp + -101 ] 4001389c: c2 08 e0 23 ldub [ %g3 + 0x23 ], %g1 400138a0: d8 08 e0 0e ldub [ %g3 + 0xe ], %o4 400138a4: c2 2f bf 8f stb %g1, [ %fp + -113 ] 400138a8: c2 08 e0 2c ldub [ %g3 + 0x2c ], %g1 400138ac: d6 08 e0 0f ldub [ %g3 + 0xf ], %o3 400138b0: c2 2f bf 9e stb %g1, [ %fp + -98 ] 400138b4: c2 08 e0 2d ldub [ %g3 + 0x2d ], %g1 400138b8: c8 08 e0 11 ldub [ %g3 + 0x11 ], %g4 400138bc: c2 2f bf 9d stb %g1, [ %fp + -99 ] 400138c0: c2 08 e0 2e ldub [ %g3 + 0x2e ], %g1 400138c4: da 08 e0 12 ldub [ %g3 + 0x12 ], %o5 400138c8: c2 2f bf 9c stb %g1, [ %fp + -100 ] 400138cc: c2 08 e0 2f ldub [ %g3 + 0x2f ], %g1 400138d0: fa 08 e0 0d ldub [ %g3 + 0xd ], %i5 400138d4: f4 08 e0 10 ldub [ %g3 + 0x10 ], %i2 400138d8: e2 08 e0 13 ldub [ %g3 + 0x13 ], %l1 400138dc: e4 08 e0 14 ldub [ %g3 + 0x14 ], %l2 400138e0: ee 08 e0 16 ldub [ %g3 + 0x16 ], %l7 400138e4: f0 08 e0 17 ldub [ %g3 + 0x17 ], %i0 400138e8: e0 08 e0 21 ldub [ %g3 + 0x21 ], %l0 400138ec: e8 08 e0 24 ldub [ %g3 + 0x24 ], %l4 400138f0: ec 08 e0 25 ldub [ %g3 + 0x25 ], %l6 400138f4: ea 08 e0 26 ldub [ %g3 + 0x26 ], %l5 400138f8: e6 08 e0 27 ldub [ %g3 + 0x27 ], %l3 400138fc: f8 08 e0 28 ldub [ %g3 + 0x28 ], %i4 40013900: c2 2f bf 97 stb %g1, [ %fp + -105 ] 40013904: c2 08 e0 30 ldub [ %g3 + 0x30 ], %g1 40013908: f2 08 e0 31 ldub [ %g3 + 0x31 ], %i1 4001390c: c2 2f bf 9f stb %g1, [ %fp + -97 ] sc = rtems_bdbuf_release( block); 40013910: c4 27 bf 80 st %g2, [ %fp + -128 ] 40013914: c8 27 bf 7c st %g4, [ %fp + -132 ] 40013918: d2 27 bf 78 st %o1, [ %fp + -136 ] 4001391c: d6 27 bf 74 st %o3, [ %fp + -140 ] 40013920: 7f ff f6 e8 call 400114c0 40013924: d8 3f bf 68 std %o4, [ %fp + -152 ] if (sc != RTEMS_SUCCESSFUL) 40013928: c4 07 bf 80 ld [ %fp + -128 ], %g2 4001392c: 80 a2 20 00 cmp %o0, 0 40013930: c8 07 bf 7c ld [ %fp + -132 ], %g4 40013934: d2 07 bf 78 ld [ %fp + -136 ], %o1 40013938: d6 07 bf 74 ld [ %fp + -140 ], %o3 4001393c: 02 80 00 08 be 4001395c <== ALWAYS TAKEN 40013940: d8 1f bf 68 ldd [ %fp + -152 ], %o4 { close(vol->fd); 40013944: 7f ff c8 64 call 40005ad4 <== NOT EXECUTED 40013948: d0 06 e0 60 ld [ %i3 + 0x60 ], %o0 <== NOT EXECUTED rtems_set_errno_and_return_minus_one( EIO ); 4001394c: 40 00 1c 96 call 4001aba4 <__errno> <== NOT EXECUTED 40013950: 01 00 00 00 nop <== NOT EXECUTED 40013954: 10 80 01 71 b 40013f18 <== NOT EXECUTED 40013958: 82 10 20 05 mov 5, %g1 ! 5 <== NOT EXECUTED } /* Evaluate boot record */ vol->bps = FAT_GET_BR_BYTES_PER_SECTOR(boot_rec); 4001395c: 84 08 a0 ff and %g2, 0xff, %g2 40013960: 92 0a 60 ff and %o1, 0xff, %o1 40013964: 93 2a 60 08 sll %o1, 8, %o1 40013968: 92 12 40 02 or %o1, %g2, %o1 4001396c: d2 36 c0 00 sth %o1, [ %i3 ] if ( (vol->bps != 512) && 40013970: 85 2a 60 10 sll %o1, 0x10, %g2 40013974: 85 30 a0 10 srl %g2, 0x10, %g2 40013978: 80 a0 a4 00 cmp %g2, 0x400 4001397c: 02 80 00 0c be 400139ac <== NEVER TAKEN 40013980: 86 10 00 09 mov %o1, %g3 40013984: 80 a0 a2 00 cmp %g2, 0x200 40013988: 22 80 00 0a be,a 400139b0 <== ALWAYS TAKEN 4001398c: 85 2a 60 10 sll %o1, 0x10, %g2 (vol->bps != 1024) && 40013990: 80 a0 a8 00 cmp %g2, 0x800 <== NOT EXECUTED 40013994: 02 80 00 06 be 400139ac <== NOT EXECUTED 40013998: 1f 00 00 04 sethi %hi(0x1000), %o7 <== NOT EXECUTED (vol->bps != 2048) && 4001399c: 80 a0 80 0f cmp %g2, %o7 <== NOT EXECUTED 400139a0: 02 80 00 04 be 400139b0 <== NOT EXECUTED 400139a4: 85 2a 60 10 sll %o1, 0x10, %g2 <== NOT EXECUTED 400139a8: 30 80 00 d6 b,a 40013d00 <== 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; 400139ac: 85 2a 60 10 sll %o1, 0x10, %g2 <== NOT EXECUTED 400139b0: c0 2e e0 03 clrb [ %i3 + 3 ] 400139b4: 10 80 00 05 b 400139c8 400139b8: 85 30 a0 19 srl %g2, 0x19, %g2 i >>= 1, vol->sec_mul++); 400139bc: 85 38 a0 01 sra %g2, 1, %g2 <== NOT EXECUTED 400139c0: 9e 03 e0 01 inc %o7 <== NOT EXECUTED 400139c4: 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; 400139c8: 80 88 a0 01 btst 1, %g2 400139cc: 22 bf ff fc be,a 400139bc <== NEVER TAKEN 400139d0: 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; 400139d4: 93 2a 60 10 sll %o1, 0x10, %o1 400139d8: c0 2e e0 02 clrb [ %i3 + 2 ] 400139dc: 93 32 60 10 srl %o1, 0x10, %o1 400139e0: 10 80 00 05 b 400139f4 400139e4: 9e 10 00 09 mov %o1, %o7 i >>= 1, vol->sec_log2++); 400139e8: 84 00 a0 01 inc %g2 400139ec: 9f 3b e0 01 sra %o7, 1, %o7 400139f0: 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; 400139f4: 80 8b e0 01 btst 1, %o7 400139f8: 02 bf ff fc be 400139e8 400139fc: c4 0e e0 02 ldub [ %i3 + 2 ], %g2 i >>= 1, vol->sec_log2++); vol->bytes_per_block = vol->bps; 40013a00: c6 36 e0 0a sth %g3, [ %i3 + 0xa ] vol->bytes_per_block_log2 = vol->sec_log2; 40013a04: c4 2e e0 0c stb %g2, [ %i3 + 0xc ] vol->sectors_per_block = 1; 40013a08: 86 10 20 01 mov 1, %g3 vol->spc = FAT_GET_BR_SECTORS_PER_CLUSTER(boot_rec); 40013a0c: 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) 40013a10: 9e 8f 60 ff andcc %i5, 0xff, %o7 40013a14: 02 80 00 bb be 40013d00 <== NEVER TAKEN 40013a18: 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; 40013a1c: 10 80 00 05 b 40013a30 40013a20: c0 2e e0 05 clrb [ %i3 + 5 ] i >>= 1, vol->spc_log2++); 40013a24: 86 00 e0 01 inc %g3 40013a28: 9f 3b e0 01 sra %o7, 1, %o7 40013a2c: 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; 40013a30: 80 8b e0 01 btst 1, %o7 40013a34: 02 bf ff fc be 40013a24 40013a38: 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) 40013a3c: 87 2a 40 03 sll %o1, %g3, %g3 40013a40: 95 28 e0 10 sll %g3, 0x10, %o2 40013a44: 1f 20 00 00 sethi %hi(0x80000000), %o7 40013a48: 80 a2 80 0f cmp %o2, %o7 40013a4c: 18 80 00 ad bgu 40013d00 <== NEVER TAKEN 40013a50: 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; 40013a54: 1f 00 00 3f sethi %hi(0xfc00), %o7 40013a58: c0 2e e0 08 clrb [ %i3 + 8 ] 40013a5c: 9e 13 e3 ff or %o7, 0x3ff, %o7 40013a60: 10 80 00 05 b 40013a74 40013a64: 86 08 c0 0f and %g3, %o7, %g3 i >>= 1, vol->bpc_log2++); 40013a68: 87 38 e0 01 sra %g3, 1, %g3 40013a6c: 9e 03 e0 01 inc %o7 40013a70: 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; 40013a74: 80 88 e0 01 btst 1, %g3 40013a78: 22 bf ff fc be,a 40013a68 40013a7c: de 0e e0 08 ldub [ %i3 + 8 ], %o7 i >>= 1, vol->bpc_log2++); vol->fats = FAT_GET_BR_FAT_NUM(boot_rec); 40013a80: 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)) / 40013a84: 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); 40013a88: 96 0a e0 ff and %o3, 0xff, %o3 40013a8c: 98 0b 20 ff and %o4, 0xff, %o4 40013a90: 97 2a e0 08 sll %o3, 8, %o3 vol->rdir_entrs = FAT_GET_BR_FILES_PER_ROOT_DIR(boot_rec); 40013a94: 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); 40013a98: 98 12 c0 0c or %o3, %o4, %o4 vol->rdir_entrs = FAT_GET_BR_FILES_PER_ROOT_DIR(boot_rec); 40013a9c: 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); 40013aa0: d8 36 e0 18 sth %o4, [ %i3 + 0x18 ] vol->rdir_entrs = FAT_GET_BR_FILES_PER_ROOT_DIR(boot_rec); 40013aa4: 88 09 20 ff and %g4, 0xff, %g4 40013aa8: 88 13 40 04 or %o5, %g4, %g4 40013aac: 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)) / 40013ab0: 89 29 20 10 sll %g4, 0x10, %g4 40013ab4: c4 27 bf 80 st %g2, [ %fp + -128 ] 40013ab8: 91 31 20 0b srl %g4, 0xb, %o0 40013abc: d8 27 bf 68 st %o4, [ %fp + -152 ] 40013ac0: 7f ff bb 20 call 40002740 <.div> 40013ac4: 90 02 00 03 add %o0, %g3, %o0 vol->bps; vol->rdir_size = vol->rdir_secs << vol->sec_log2; 40013ac8: 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)) / 40013acc: d0 26 e0 28 st %o0, [ %i3 + 0x28 ] vol->bps; vol->rdir_size = vol->rdir_secs << vol->sec_log2; 40013ad0: 85 2a 00 02 sll %o0, %g2, %g2 40013ad4: c4 26 e0 2c st %g2, [ %i3 + 0x2c ] if ( (FAT_GET_BR_SECTORS_PER_FAT(boot_rec)) != 0) 40013ad8: b0 0e 20 ff and %i0, 0xff, %i0 40013adc: ae 0d e0 ff and %l7, 0xff, %l7 40013ae0: 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)) / 40013ae4: 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) 40013ae8: ae 16 00 17 or %i0, %l7, %l7 40013aec: af 2d e0 10 sll %l7, 0x10, %l7 40013af0: 80 a5 e0 00 cmp %l7, 0 40013af4: 02 80 00 05 be 40013b08 40013af8: d8 07 bf 68 ld [ %fp + -152 ], %o4 vol->fat_length = FAT_GET_BR_SECTORS_PER_FAT(boot_rec); 40013afc: af 35 e0 10 srl %l7, 0x10, %l7 40013b00: 10 80 00 0c b 40013b30 40013b04: ee 26 e0 1c st %l7, [ %i3 + 0x1c ] else vol->fat_length = FAT_GET_BR_SECTORS_PER_FAT32(boot_rec); 40013b08: ac 0d a0 ff and %l6, 0xff, %l6 40013b0c: aa 0d 60 ff and %l5, 0xff, %l5 40013b10: ad 2d a0 08 sll %l6, 8, %l6 40013b14: ab 2d 60 10 sll %l5, 0x10, %l5 40013b18: a8 0d 20 ff and %l4, 0xff, %l4 40013b1c: aa 15 80 15 or %l6, %l5, %l5 40013b20: a7 2c e0 18 sll %l3, 0x18, %l3 40013b24: a8 15 40 14 or %l5, %l4, %l4 40013b28: a6 15 00 13 or %l4, %l3, %l3 40013b2c: e6 26 e0 1c st %l3, [ %i3 + 0x1c ] vol->data_fsec = vol->fat_loc + vol->fats * vol->fat_length + 40013b30: d2 06 e0 1c ld [ %i3 + 0x1c ], %o1 40013b34: 99 2b 20 10 sll %o4, 0x10, %o4 40013b38: c6 27 bf 84 st %g3, [ %fp + -124 ] 40013b3c: b1 33 20 10 srl %o4, 0x10, %i0 40013b40: 7f ff ba c4 call 40002650 <.umul> 40013b44: 90 0e a0 ff and %i2, 0xff, %o0 40013b48: c6 07 bf 84 ld [ %fp + -124 ], %g3 40013b4c: 90 06 00 08 add %i0, %o0, %o0 40013b50: 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; 40013b54: d0 26 e0 20 st %o0, [ %i3 + 0x20 ] if ( (FAT_GET_BR_TOTAL_SECTORS_NUM16(boot_rec)) != 0) 40013b58: a4 0c a0 ff and %l2, 0xff, %l2 40013b5c: a2 0c 60 ff and %l1, 0xff, %l1 40013b60: a5 2c a0 08 sll %l2, 8, %l2 40013b64: a2 14 80 11 or %l2, %l1, %l1 40013b68: a3 2c 60 10 sll %l1, 0x10, %l1 40013b6c: 80 a4 60 00 cmp %l1, 0 40013b70: 02 80 00 05 be 40013b84 40013b74: c6 26 e0 34 st %g3, [ %i3 + 0x34 ] vol->tot_secs = FAT_GET_BR_TOTAL_SECTORS_NUM16(boot_rec); 40013b78: a3 34 60 10 srl %l1, 0x10, %l1 40013b7c: 10 80 00 0d b 40013bb0 40013b80: e2 26 e0 30 st %l1, [ %i3 + 0x30 ] else vol->tot_secs = FAT_GET_BR_TOTAL_SECTORS_NUM32(boot_rec); 40013b84: c8 0f bf 9a ldub [ %fp + -102 ], %g4 40013b88: c4 0f bf 9b ldub [ %fp + -101 ], %g2 40013b8c: c2 0f bf 8f ldub [ %fp + -113 ], %g1 40013b90: a0 0c 20 ff and %l0, 0xff, %l0 40013b94: 85 28 a0 10 sll %g2, 0x10, %g2 40013b98: a1 2c 20 08 sll %l0, 8, %l0 40013b9c: 84 14 00 02 or %l0, %g2, %g2 40013ba0: 84 10 80 04 or %g2, %g4, %g2 40013ba4: 89 28 60 18 sll %g1, 0x18, %g4 40013ba8: 84 10 80 04 or %g2, %g4, %g2 40013bac: c4 26 e0 30 st %g2, [ %i3 + 0x30 ] data_secs = vol->tot_secs - vol->data_fsec; 40013bb0: d0 06 e0 30 ld [ %i3 + 0x30 ], %o0 vol->data_cls = data_secs / vol->spc; 40013bb4: 92 0f 60 ff and %i5, 0xff, %o1 40013bb8: 7f ff ba e0 call 40002738 <.udiv> 40013bbc: 90 22 00 03 sub %o0, %g3, %o0 /* determine FAT type at least */ if ( vol->data_cls < FAT_FAT12_MAX_CLN) 40013bc0: 80 a2 2f f4 cmp %o0, 0xff4 40013bc4: 18 80 00 08 bgu 40013be4 40013bc8: d0 26 e0 38 st %o0, [ %i3 + 0x38 ] { vol->type = FAT_FAT12; 40013bcc: 84 10 20 01 mov 1, %g2 40013bd0: c4 2e e0 0e stb %g2, [ %i3 + 0xe ] vol->mask = FAT_FAT12_MASK; 40013bd4: 84 10 2f ff mov 0xfff, %g2 40013bd8: c4 26 e0 10 st %g2, [ %i3 + 0x10 ] vol->eoc_val = FAT_FAT12_EOC; 40013bdc: 10 80 00 0f b 40013c18 40013be0: 84 10 2f f8 mov 0xff8, %g2 } else { if ( vol->data_cls < FAT_FAT16_MAX_CLN) 40013be4: 05 00 00 3f sethi %hi(0xfc00), %g2 40013be8: 86 10 a3 f4 or %g2, 0x3f4, %g3 ! fff4 40013bec: 80 a2 00 03 cmp %o0, %g3 40013bf0: 38 80 00 05 bgu,a 40013c04 40013bf4: 84 10 20 04 mov 4, %g2 { vol->type = FAT_FAT16; 40013bf8: 86 10 20 02 mov 2, %g3 40013bfc: 10 80 00 04 b 40013c0c 40013c00: c6 2e e0 0e stb %g3, [ %i3 + 0xe ] vol->mask = FAT_FAT16_MASK; vol->eoc_val = FAT_FAT16_EOC; } else { vol->type = FAT_FAT32; 40013c04: c4 2e e0 0e stb %g2, [ %i3 + 0xe ] vol->mask = FAT_FAT32_MASK; 40013c08: 05 03 ff ff sethi %hi(0xffffc00), %g2 40013c0c: 86 10 a3 ff or %g2, 0x3ff, %g3 ! fffffff vol->eoc_val = FAT_FAT32_EOC; 40013c10: 84 10 a3 f8 or %g2, 0x3f8, %g2 vol->eoc_val = FAT_FAT16_EOC; } else { vol->type = FAT_FAT32; vol->mask = FAT_FAT32_MASK; 40013c14: c6 26 e0 10 st %g3, [ %i3 + 0x10 ] vol->eoc_val = FAT_FAT32_EOC; 40013c18: c4 26 e0 14 st %g2, [ %i3 + 0x14 ] } } if (vol->type == FAT_FAT32) 40013c1c: c4 0e e0 0e ldub [ %i3 + 0xe ], %g2 40013c20: 80 a0 a0 04 cmp %g2, 4 40013c24: 12 80 00 63 bne 40013db0 40013c28: 82 10 3f ff mov -1, %g1 { vol->rdir_cl = FAT_GET_BR_FAT32_ROOT_CLUSTER(boot_rec); 40013c2c: c6 0f bf 9d ldub [ %fp + -99 ], %g3 40013c30: c4 0f bf 9c ldub [ %fp + -100 ], %g2 40013c34: 87 28 e0 08 sll %g3, 8, %g3 40013c38: 85 28 a0 10 sll %g2, 0x10, %g2 40013c3c: c2 0f bf 97 ldub [ %fp + -105 ], %g1 40013c40: 84 10 c0 02 or %g3, %g2, %g2 40013c44: c6 0f bf 9e ldub [ %fp + -98 ], %g3 40013c48: 84 10 80 03 or %g2, %g3, %g2 40013c4c: 87 28 60 18 sll %g1, 0x18, %g3 40013c50: 84 10 80 03 or %g2, %g3, %g2 40013c54: c4 26 e0 3c st %g2, [ %i3 + 0x3c ] vol->mirror = FAT_GET_BR_EXT_FLAGS(boot_rec) & FAT_BR_EXT_FLAGS_MIRROR; 40013c58: 84 0f 3f 80 and %i4, -128, %g2 if (vol->mirror) 40013c5c: 80 88 a0 80 btst 0x80, %g2 40013c60: 02 80 00 05 be 40013c74 <== ALWAYS TAKEN 40013c64: c4 2e e0 54 stb %g2, [ %i3 + 0x54 ] vol->afat = FAT_GET_BR_EXT_FLAGS(boot_rec) & FAT_BR_EXT_FLAGS_FAT_NUM; 40013c68: b8 0f 20 0f and %i4, 0xf, %i4 <== NOT EXECUTED 40013c6c: 10 80 00 03 b 40013c78 <== NOT EXECUTED 40013c70: f8 2e e0 5c stb %i4, [ %i3 + 0x5c ] <== NOT EXECUTED else vol->afat = 0; 40013c74: c0 2e e0 5c clrb [ %i3 + 0x5c ] vol->info_sec = FAT_GET_BR_FAT32_FS_INFO_SECTOR(boot_rec); 40013c78: f4 0f bf 9f ldub [ %fp + -97 ], %i2 40013c7c: b2 0e 60 ff and %i1, 0xff, %i1 40013c80: b3 2e 60 08 sll %i1, 8, %i1 40013c84: b4 16 40 1a or %i1, %i2, %i2 40013c88: f4 36 e0 40 sth %i2, [ %i3 + 0x40 ] if( vol->info_sec == 0 ) 40013c8c: b5 2e a0 10 sll %i2, 0x10, %i2 40013c90: 93 36 a0 10 srl %i2, 0x10, %o1 40013c94: 80 a2 60 00 cmp %o1, 0 40013c98: 32 80 00 03 bne,a 40013ca4 <== ALWAYS TAKEN 40013c9c: 90 10 00 1b mov %i3, %o0 40013ca0: 30 80 00 18 b,a 40013d00 <== NOT EXECUTED close(vol->fd); rtems_set_errno_and_return_minus_one( EINVAL ); } else { ret = _fat_block_read(fs_info, vol->info_sec , 0, 40013ca4: 94 10 20 00 clr %o2 40013ca8: 96 10 20 04 mov 4, %o3 40013cac: 7f ff fd f3 call 40013478 <_fat_block_read> 40013cb0: 98 07 bf a8 add %fp, -88, %o4 FAT_FSI_LEADSIG_SIZE, fs_info_sector); if ( ret < 0 ) 40013cb4: 80 a2 20 00 cmp %o0, 0 40013cb8: 06 80 00 22 bl 40013d40 <== NEVER TAKEN 40013cbc: c4 0f bf aa ldub [ %fp + -86 ], %g2 { close(vol->fd); return -1; } if (FAT_GET_FSINFO_LEAD_SIGNATURE(fs_info_sector) != 40013cc0: c6 0f bf a9 ldub [ %fp + -87 ], %g3 40013cc4: 85 28 a0 10 sll %g2, 0x10, %g2 40013cc8: 87 28 e0 08 sll %g3, 8, %g3 40013ccc: 86 10 c0 02 or %g3, %g2, %g3 40013cd0: c4 0f bf a8 ldub [ %fp + -88 ], %g2 40013cd4: 86 10 c0 02 or %g3, %g2, %g3 40013cd8: c4 0f bf ab ldub [ %fp + -85 ], %g2 40013cdc: 85 28 a0 18 sll %g2, 0x18, %g2 40013ce0: 86 10 c0 02 or %g3, %g2, %g3 40013ce4: 05 10 58 54 sethi %hi(0x41615000), %g2 40013ce8: 84 10 a2 52 or %g2, 0x252, %g2 ! 41615252 40013cec: 80 a0 c0 02 cmp %g3, %g2 40013cf0: 02 80 00 0a be 40013d18 <== ALWAYS TAKEN 40013cf4: 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); 40013cf8: 7f ff fd 3d call 400131ec <== NOT EXECUTED 40013cfc: 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); 40013d00: 7f ff c7 75 call 40005ad4 <== NOT EXECUTED 40013d04: d0 06 e0 60 ld [ %i3 + 0x60 ], %o0 <== NOT EXECUTED rtems_set_errno_and_return_minus_one( EINVAL ); 40013d08: 40 00 1b a7 call 4001aba4 <__errno> <== NOT EXECUTED 40013d0c: 01 00 00 00 nop <== NOT EXECUTED 40013d10: 10 80 00 82 b 40013f18 <== NOT EXECUTED 40013d14: 82 10 20 16 mov 0x16, %g1 ! 16 <== NOT EXECUTED } else { ret = _fat_block_read(fs_info, vol->info_sec , FAT_FSI_INFO, 40013d18: d2 16 e0 40 lduh [ %i3 + 0x40 ], %o1 40013d1c: 94 10 21 e4 mov 0x1e4, %o2 40013d20: 96 10 20 0c mov 0xc, %o3 40013d24: 7f ff fd d5 call 40013478 <_fat_block_read> 40013d28: 98 07 bf a8 add %fp, -88, %o4 FAT_USEFUL_INFO_SIZE, fs_info_sector); if ( ret < 0 ) 40013d2c: 80 a2 20 00 cmp %o0, 0 40013d30: 16 80 00 08 bge 40013d50 <== ALWAYS TAKEN 40013d34: 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); 40013d38: 7f ff fd 2d call 400131ec <== NOT EXECUTED 40013d3c: 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); 40013d40: 7f ff c7 65 call 40005ad4 <== NOT EXECUTED 40013d44: 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 ); 40013d48: 81 c7 e0 08 ret <== NOT EXECUTED 40013d4c: 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); 40013d50: c4 0f bf ae ldub [ %fp + -82 ], %g2 40013d54: 87 28 e0 08 sll %g3, 8, %g3 40013d58: 85 28 a0 10 sll %g2, 0x10, %g2 40013d5c: 84 10 c0 02 or %g3, %g2, %g2 40013d60: c6 0f bf ac ldub [ %fp + -84 ], %g3 40013d64: 84 10 80 03 or %g2, %g3, %g2 40013d68: c6 0f bf af ldub [ %fp + -81 ], %g3 40013d6c: 87 28 e0 18 sll %g3, 0x18, %g3 40013d70: 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); 40013d74: c6 0f bf b1 ldub [ %fp + -79 ], %g3 _fat_block_release(fs_info); close(vol->fd); return -1; } vol->free_cls_in_fs_info = 40013d78: 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; 40013d7c: c4 26 e0 44 st %g2, [ %i3 + 0x44 ] vol->next_cl_in_fs_info = FAT_GET_FSINFO_NEXT_FREE_CLUSTER(fs_info_sector); 40013d80: c4 0f bf b2 ldub [ %fp + -78 ], %g2 40013d84: 87 28 e0 08 sll %g3, 8, %g3 40013d88: 85 28 a0 10 sll %g2, 0x10, %g2 40013d8c: 84 10 c0 02 or %g3, %g2, %g2 40013d90: c6 0f bf b0 ldub [ %fp + -80 ], %g3 40013d94: 84 10 80 03 or %g2, %g3, %g2 40013d98: c6 0f bf b3 ldub [ %fp + -77 ], %g3 40013d9c: 87 28 e0 18 sll %g3, 0x18, %g3 40013da0: 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 = 40013da4: 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; 40013da8: 10 80 00 07 b 40013dc4 40013dac: c4 26 e0 4c st %g2, [ %i3 + 0x4c ] } } } else { vol->rdir_cl = 0; 40013db0: c0 26 e0 3c clr [ %i3 + 0x3c ] vol->mirror = 0; 40013db4: c0 2e e0 54 clrb [ %i3 + 0x54 ] vol->afat = 0; 40013db8: c0 2e e0 5c clrb [ %i3 + 0x5c ] vol->free_cls = FAT_UNDEFINED_VALUE; 40013dbc: c2 26 e0 44 st %g1, [ %i3 + 0x44 ] vol->next_cl = FAT_UNDEFINED_VALUE; 40013dc0: 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); 40013dc4: 7f ff fd 0a call 400131ec 40013dc8: 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; 40013dcc: d2 06 e0 1c ld [ %i3 + 0x1c ], %o1 40013dd0: 7f ff ba 20 call 40002650 <.umul> 40013dd4: d0 0e e0 5c ldub [ %i3 + 0x5c ], %o0 40013dd8: 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)); 40013ddc: 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; 40013de0: 90 02 00 02 add %o0, %g2, %o0 40013de4: 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)); 40013de8: 7f ff c7 24 call 40005a78 40013dec: 90 10 20 02 mov 2, %o0 if ( fs_info->vhash == NULL ) 40013df0: 80 a2 20 00 cmp %o0, 0 40013df4: 02 80 00 12 be 40013e3c <== NEVER TAKEN 40013df8: 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 ); 40013dfc: 84 02 20 04 add %o0, 4, %g2 40013e00: 86 02 20 10 add %o0, 0x10, %g3 head->next = tail; 40013e04: 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 ); 40013e08: 84 02 20 0c add %o0, 0xc, %g2 head->next = tail; head->previous = NULL; 40013e0c: c0 22 20 04 clr [ %o0 + 4 ] tail->previous = head; 40013e10: 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; 40013e14: c6 22 20 0c st %g3, [ %o0 + 0xc ] head->previous = NULL; 40013e18: c0 22 20 10 clr [ %o0 + 0x10 ] tail->previous = head; 40013e1c: 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)); 40013e20: 92 10 20 0c mov 0xc, %o1 40013e24: 7f ff c7 15 call 40005a78 40013e28: 90 10 20 02 mov 2, %o0 if ( fs_info->rhash == NULL ) 40013e2c: 80 a2 20 00 cmp %o0, 0 40013e30: 12 80 00 06 bne 40013e48 <== ALWAYS TAKEN 40013e34: d0 26 e0 70 st %o0, [ %i3 + 0x70 ] 40013e38: 30 80 00 1c b,a 40013ea8 <== 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); 40013e3c: 7f ff c7 26 call 40005ad4 <== NOT EXECUTED 40013e40: d0 06 e0 60 ld [ %i3 + 0x60 ], %o0 <== NOT EXECUTED 40013e44: 30 80 00 32 b,a 40013f0c <== 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 ); 40013e48: 84 02 20 04 add %o0, 4, %g2 head->next = tail; 40013e4c: 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 ); 40013e50: 84 02 20 0c add %o0, 0xc, %g2 head->next = tail; head->previous = NULL; 40013e54: c0 22 20 04 clr [ %o0 + 4 ] tail->previous = head; 40013e58: c4 22 20 14 st %g2, [ %o0 + 0x14 ] 40013e5c: 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; 40013e60: 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 ); 40013e64: 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; 40013e68: 84 10 21 00 mov 0x100, %g2 head->next = tail; 40013e6c: c6 22 20 0c st %g3, [ %o0 + 0xc ] 40013e70: c4 26 e0 7c st %g2, [ %i3 + 0x7c ] fs_info->uino_base = (vol->tot_secs << vol->sec_mul) << 4; 40013e74: c6 06 e0 30 ld [ %i3 + 0x30 ], %g3 40013e78: c4 0e e0 03 ldub [ %i3 + 3 ], %g2 fs_info->index = 0; 40013e7c: 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; 40013e80: 85 28 c0 02 sll %g3, %g2, %g2 40013e84: 85 28 a0 04 sll %g2, 4, %g2 fs_info->index = 0; fs_info->uino = (char *)calloc(fs_info->uino_pool_size, sizeof(char)); 40013e88: 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; 40013e8c: c4 26 e0 80 st %g2, [ %i3 + 0x80 ] fs_info->index = 0; fs_info->uino = (char *)calloc(fs_info->uino_pool_size, sizeof(char)); 40013e90: 7f ff c6 fa call 40005a78 40013e94: 92 10 20 01 mov 1, %o1 if ( fs_info->uino == NULL ) 40013e98: 80 a2 20 00 cmp %o0, 0 40013e9c: 12 80 00 0d bne 40013ed0 <== ALWAYS TAKEN 40013ea0: d0 26 e0 74 st %o0, [ %i3 + 0x74 ] 40013ea4: 30 80 00 05 b,a 40013eb8 <== 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); 40013ea8: 7f ff c7 0b call 40005ad4 <== NOT EXECUTED 40013eac: d0 06 e0 60 ld [ %i3 + 0x60 ], %o0 <== NOT EXECUTED free(fs_info->vhash); 40013eb0: 10 80 00 15 b 40013f04 <== NOT EXECUTED 40013eb4: 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); 40013eb8: 7f ff c7 07 call 40005ad4 <== NOT EXECUTED 40013ebc: d0 06 e0 60 ld [ %i3 + 0x60 ], %o0 <== NOT EXECUTED free(fs_info->vhash); 40013ec0: 7f ff c7 26 call 40005b58 <== NOT EXECUTED 40013ec4: d0 06 e0 6c ld [ %i3 + 0x6c ], %o0 <== NOT EXECUTED free(fs_info->rhash); 40013ec8: 10 80 00 0f b 40013f04 <== NOT EXECUTED 40013ecc: 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)); 40013ed0: d0 16 c0 00 lduh [ %i3 ], %o0 40013ed4: 7f ff c6 e9 call 40005a78 40013ed8: 92 10 20 01 mov 1, %o1 if (fs_info->sec_buf == NULL) 40013edc: 80 a2 20 00 cmp %o0, 0 40013ee0: 12 80 00 11 bne 40013f24 <== ALWAYS TAKEN 40013ee4: d0 26 e0 90 st %o0, [ %i3 + 0x90 ] { close(vol->fd); 40013ee8: 7f ff c6 fb call 40005ad4 <== NOT EXECUTED 40013eec: d0 06 e0 60 ld [ %i3 + 0x60 ], %o0 <== NOT EXECUTED free(fs_info->vhash); 40013ef0: 7f ff c7 1a call 40005b58 <== NOT EXECUTED 40013ef4: d0 06 e0 6c ld [ %i3 + 0x6c ], %o0 <== NOT EXECUTED free(fs_info->rhash); 40013ef8: 7f ff c7 18 call 40005b58 <== NOT EXECUTED 40013efc: d0 06 e0 70 ld [ %i3 + 0x70 ], %o0 <== NOT EXECUTED free(fs_info->uino); 40013f00: d0 06 e0 74 ld [ %i3 + 0x74 ], %o0 <== NOT EXECUTED 40013f04: 7f ff c7 15 call 40005b58 <== NOT EXECUTED 40013f08: 01 00 00 00 nop <== NOT EXECUTED rtems_set_errno_and_return_minus_one( ENOMEM ); 40013f0c: 40 00 1b 26 call 4001aba4 <__errno> <== NOT EXECUTED 40013f10: 01 00 00 00 nop <== NOT EXECUTED 40013f14: 82 10 20 0c mov 0xc, %g1 ! c <== NOT EXECUTED 40013f18: c2 22 00 00 st %g1, [ %o0 ] <== NOT EXECUTED 40013f1c: 81 c7 e0 08 ret <== NOT EXECUTED 40013f20: 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; 40013f24: c4 0e e0 04 ldub [ %i3 + 4 ], %g2 40013f28: c6 06 e0 34 ld [ %i3 + 0x34 ], %g3 40013f2c: 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) 40013f30: 80 88 80 03 btst %g2, %g3 40013f34: 22 80 00 04 be,a 40013f44 <== ALWAYS TAKEN 40013f38: 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; 40013f3c: 81 c7 e0 08 ret <== NOT EXECUTED 40013f40: 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))) 40013f44: 80 a0 e0 04 cmp %g3, 4 40013f48: 22 80 00 07 be,a 40013f64 40013f4c: 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; 40013f50: 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))) 40013f54: 80 88 80 03 btst %g2, %g3 40013f58: 12 80 00 0f bne 40013f94 <== NEVER TAKEN 40013f5c: b0 10 20 00 clr %i0 { sc = rtems_bdbuf_set_block_size (vol->dd, vol->bpc, true); 40013f60: d0 06 e0 64 ld [ %i3 + 0x64 ], %o0 40013f64: d2 16 e0 06 lduh [ %i3 + 6 ], %o1 40013f68: 7f ff f6 78 call 40011948 40013f6c: 94 10 20 01 mov 1, %o2 if (sc == RTEMS_SUCCESSFUL) 40013f70: 80 a2 20 00 cmp %o0, 0 40013f74: 12 80 00 08 bne 40013f94 <== NEVER TAKEN 40013f78: b0 10 20 00 clr %i0 { vol->bytes_per_block = vol->bpc; 40013f7c: c4 16 e0 06 lduh [ %i3 + 6 ], %g2 40013f80: c4 36 e0 0a sth %g2, [ %i3 + 0xa ] vol->bytes_per_block_log2 = vol->bpc_log2; 40013f84: c4 0e e0 08 ldub [ %i3 + 8 ], %g2 40013f88: c4 2e e0 0c stb %g2, [ %i3 + 0xc ] vol->sectors_per_block = vol->spc; 40013f8c: c4 0e e0 04 ldub [ %i3 + 4 ], %g2 40013f90: c4 2e e0 09 stb %g2, [ %i3 + 9 ] } } return RC_OK; } 40013f94: 81 c7 e0 08 ret 40013f98: 81 e8 00 00 restore =============================================================================== 40019584 : uint32_t count, uint32_t *cls_added, uint32_t *last_cl, bool zero_fill ) { 40019584: 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; 40019588: e8 06 20 38 ld [ %i0 + 0x38 ], %l4 bool zero_fill ) { int rc = RC_OK; uint32_t cl4find = 2; uint32_t next_cln = 0; 4001958c: 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; 40019590: c0 26 c0 00 clr [ %i3 ] if (count == 0) 40019594: 80 a6 a0 00 cmp %i2, 0 40019598: 02 80 00 7e be 40019790 <== NEVER TAKEN 4001959c: a2 10 20 00 clr %l1 return rc; if (fs_info->vol.next_cl != FAT_UNDEFINED_VALUE) 400195a0: e0 06 20 4c ld [ %i0 + 0x4c ], %l0 400195a4: 80 a4 3f ff cmp %l0, -1 400195a8: 22 80 00 02 be,a 400195b0 400195ac: 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; 400195b0: a8 05 20 02 add %l4, 2, %l4 400195b4: a6 10 20 02 mov 2, %l3 400195b8: 10 80 00 5a b 40019720 400195bc: 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); 400195c0: 92 10 00 10 mov %l0, %o1 400195c4: 7f ff fe ae call 4001907c 400195c8: 94 07 bf fc add %fp, -4, %o2 if ( rc != RC_OK ) 400195cc: a2 92 20 00 orcc %o0, 0, %l1 400195d0: 02 80 00 0b be 400195fc <== ALWAYS TAKEN 400195d4: c2 07 bf fc ld [ %fp + -4 ], %g1 { if (*cls_added != 0) 400195d8: c2 06 c0 00 ld [ %i3 ], %g1 <== NOT EXECUTED 400195dc: 80 a0 60 00 cmp %g1, 0 <== NOT EXECUTED 400195e0: 22 80 00 6d be,a 40019794 <== NOT EXECUTED 400195e4: b0 10 00 11 mov %l1, %i0 <== NOT EXECUTED fat_free_fat_clusters_chain(fs_info, (*chain)); 400195e8: d2 06 40 00 ld [ %i1 ], %o1 <== NOT EXECUTED 400195ec: 7f ff ff b7 call 400194c8 <== NOT EXECUTED 400195f0: 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; } 400195f4: 81 c7 e0 08 ret <== NOT EXECUTED 400195f8: 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) 400195fc: 80 a0 60 00 cmp %g1, 0 40019600: 32 80 00 44 bne,a 40019710 40019604: 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) 40019608: c2 06 c0 00 ld [ %i3 ], %g1 4001960c: 80 a0 60 00 cmp %g1, 0 40019610: 12 80 00 0e bne 40019648 40019614: 90 10 00 18 mov %i0, %o0 { *chain = cl4find; 40019618: e0 26 40 00 st %l0, [ %i1 ] rc = fat_set_fat_cluster(fs_info, cl4find, FAT_GENFAT_EOC); 4001961c: 92 10 00 10 mov %l0, %o1 40019620: 7f ff ff 09 call 40019244 40019624: 94 10 3f ff mov -1, %o2 if ( rc != RC_OK ) 40019628: 80 a2 20 00 cmp %o0, 0 4001962c: 32 80 00 59 bne,a 40019790 <== NEVER TAKEN 40019630: 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) 40019634: 80 a7 60 00 cmp %i5, 0 40019638: 22 80 00 18 be,a 40019698 4001963c: c2 06 c0 00 ld [ %i3 ], %g1 { bytes_written = fat_cluster_set (fs_info, cl4find, 0, fs_info->vol.bpc, 0); 40019640: 10 80 00 1c b 400196b0 40019644: 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); 40019648: 92 10 00 10 mov %l0, %o1 4001964c: 7f ff fe fe call 40019244 40019650: 94 10 3f ff mov -1, %o2 40019654: aa 10 00 08 mov %o0, %l5 if ( rc != RC_OK ) 40019658: 80 a5 60 00 cmp %l5, 0 4001965c: 02 80 00 07 be 40019678 <== ALWAYS TAKEN 40019660: 90 10 00 18 mov %i0, %o0 { /* cleanup activity */ fat_free_fat_clusters_chain(fs_info, (*chain)); 40019664: d2 06 40 00 ld [ %i1 ], %o1 <== NOT EXECUTED 40019668: 7f ff ff 98 call 400194c8 <== NOT EXECUTED 4001966c: 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; } 40019670: 81 c7 e0 08 ret <== NOT EXECUTED 40019674: 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); 40019678: 92 10 00 12 mov %l2, %o1 4001967c: 7f ff fe f2 call 40019244 40019680: 94 10 00 10 mov %l0, %o2 if ( rc != RC_OK ) 40019684: a4 92 20 00 orcc %o0, 0, %l2 40019688: 02 bf ff ec be 40019638 <== ALWAYS TAKEN 4001968c: 80 a7 60 00 cmp %i5, 0 return RC_OK; cleanup: /* cleanup activity */ fat_free_fat_clusters_chain(fs_info, (*chain)); 40019690: 10 80 00 35 b 40019764 <== NOT EXECUTED 40019694: d2 06 40 00 ld [ %i1 ], %o1 <== NOT EXECUTED goto cleanup; } } save_cln = cl4find; (*cls_added)++; 40019698: 82 00 60 01 inc %g1 /* have we satisfied request ? */ if (*cls_added == count) 4001969c: 80 a0 40 1a cmp %g1, %i2 400196a0: 02 80 00 0f be 400196dc 400196a4: c2 26 c0 00 st %g1, [ %i3 ] 400196a8: 10 80 00 19 b 4001970c 400196ac: 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); 400196b0: 90 10 00 18 mov %i0, %o0 400196b4: 92 10 00 10 mov %l0, %o1 400196b8: 94 10 20 00 clr %o2 400196bc: 7f ff e7 b5 call 40013590 400196c0: 98 10 20 00 clr %o4 if (fs_info->vol.bpc != bytes_written) 400196c4: c2 16 20 06 lduh [ %i0 + 6 ], %g1 400196c8: 80 a0 40 08 cmp %g1, %o0 400196cc: 22 bf ff f3 be,a 40019698 <== ALWAYS TAKEN 400196d0: c2 06 c0 00 ld [ %i3 ], %g1 { rc = -1; 400196d4: 10 80 00 23 b 40019760 <== NOT EXECUTED 400196d8: 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) 400196dc: c2 06 20 44 ld [ %i0 + 0x44 ], %g1 400196e0: 80 a0 7f ff cmp %g1, -1 400196e4: 02 80 00 05 be 400196f8 <== ALWAYS TAKEN 400196e8: e0 26 20 4c st %l0, [ %i0 + 0x4c ] fs_info->vol.free_cls -= (*cls_added); 400196ec: c4 06 c0 00 ld [ %i3 ], %g2 <== NOT EXECUTED 400196f0: 82 20 40 02 sub %g1, %g2, %g1 <== NOT EXECUTED 400196f4: c2 26 20 44 st %g1, [ %i0 + 0x44 ] <== NOT EXECUTED *last_cl = save_cln; 400196f8: e0 27 00 00 st %l0, [ %i4 ] fat_buf_release(fs_info); 400196fc: 7f ff e6 bc call 400131ec 40019700: 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; } 40019704: 81 c7 e0 08 ret 40019708: 91 e8 00 11 restore %g0, %l1, %o0 fat_buf_release(fs_info); return rc; } } i++; cl4find++; 4001970c: a0 04 20 01 inc %l0 if (cl4find >= data_cls_val) 40019710: 80 a4 00 14 cmp %l0, %l4 40019714: 0a 80 00 03 bcs 40019720 <== ALWAYS TAKEN 40019718: a6 04 e0 01 inc %l3 cl4find = 2; 4001971c: 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) 40019720: 80 a4 c0 14 cmp %l3, %l4 40019724: 0a bf ff a7 bcs 400195c0 <== ALWAYS TAKEN 40019728: 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) 4001972c: c2 06 20 44 ld [ %i0 + 0x44 ], %g1 <== NOT EXECUTED 40019730: 80 a0 7f ff cmp %g1, -1 <== NOT EXECUTED 40019734: 02 80 00 05 be 40019748 <== NOT EXECUTED 40019738: e4 26 20 4c st %l2, [ %i0 + 0x4c ] <== NOT EXECUTED fs_info->vol.free_cls -= (*cls_added); 4001973c: c4 06 c0 00 ld [ %i3 ], %g2 <== NOT EXECUTED 40019740: 82 20 40 02 sub %g1, %g2, %g1 <== NOT EXECUTED 40019744: c2 26 20 44 st %g1, [ %i0 + 0x44 ] <== NOT EXECUTED *last_cl = save_cln; 40019748: e4 27 00 00 st %l2, [ %i4 ] <== NOT EXECUTED fat_buf_release(fs_info); 4001974c: 90 10 00 18 mov %i0, %o0 <== NOT EXECUTED 40019750: 7f ff e6 a7 call 400131ec <== NOT EXECUTED 40019754: 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; } 40019758: 81 c7 e0 08 ret <== NOT EXECUTED 4001975c: 91 e8 00 11 restore %g0, %l1, %o0 <== NOT EXECUTED return RC_OK; cleanup: /* cleanup activity */ fat_free_fat_clusters_chain(fs_info, (*chain)); 40019760: d2 06 40 00 ld [ %i1 ], %o1 <== NOT EXECUTED 40019764: 7f ff ff 59 call 400194c8 <== NOT EXECUTED 40019768: 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); 4001976c: 92 10 00 10 mov %l0, %o1 <== NOT EXECUTED 40019770: 94 10 20 00 clr %o2 <== NOT EXECUTED 40019774: 7f ff fe b4 call 40019244 <== NOT EXECUTED 40019778: 90 10 00 18 mov %i0, %o0 <== NOT EXECUTED fat_buf_release(fs_info); 4001977c: 90 10 00 18 mov %i0, %o0 <== NOT EXECUTED 40019780: 7f ff e6 9b call 400131ec <== NOT EXECUTED 40019784: a2 10 00 12 mov %l2, %l1 <== NOT EXECUTED return rc; } 40019788: 81 c7 e0 08 ret <== NOT EXECUTED 4001978c: 91 e8 00 11 restore %g0, %l1, %o0 <== NOT EXECUTED 40019790: b0 10 00 11 mov %l1, %i0 <== NOT EXECUTED 40019794: 81 c7 e0 08 ret <== NOT EXECUTED 40019798: 81 e8 00 00 restore <== NOT EXECUTED =============================================================================== 400134f8 : fat_fs_info_t *fs_info, uint32_t start, uint32_t offset, uint32_t count, const void *buff) { 400134f8: 9d e3 bf 98 save %sp, -104, %sp int rc = RC_OK; ssize_t cmpltd = 0; 400134fc: 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) 40013500: 10 80 00 1b b 4001356c 40013504: a2 10 20 01 mov 1, %l1 { c = MIN(count, (fs_info->vol.bps - ofs)); 40013508: ba 27 40 1a sub %i5, %i2, %i5 4001350c: 80 a7 40 1b cmp %i5, %i3 40013510: 38 80 00 02 bgu,a 40013518 40013514: ba 10 00 1b mov %i3, %i5 if (c == fs_info->vol.bytes_per_block) 40013518: c2 16 20 0a lduh [ %i0 + 0xa ], %g1 rc = fat_buf_access(fs_info, sec_num, FAT_OP_TYPE_GET, &sec_buf); 4001351c: 90 10 00 18 mov %i0, %o0 40013520: 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) 40013524: 80 a7 40 01 cmp %i5, %g1 40013528: 02 80 00 03 be 40013534 <== NEVER TAKEN 4001352c: 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); 40013530: 94 10 20 01 mov 1, %o2 40013534: 7f ff ff a2 call 400133bc 40013538: 96 07 bf fc add %fp, -4, %o3 if (rc != RC_OK) 4001353c: 80 a2 20 00 cmp %o0, 0 40013540: 12 80 00 10 bne 40013580 <== NEVER TAKEN 40013544: d0 07 bf fc ld [ %fp + -4 ], %o0 return -1; memcpy((sec_buf + ofs), (buff + cmpltd), c); 40013548: 92 07 00 10 add %i4, %l0, %o1 4001354c: 90 02 00 1a add %o0, %i2, %o0 40013550: 94 10 00 1d mov %i5, %o2 40013554: 40 00 20 39 call 4001b638 40013558: b6 26 c0 1d sub %i3, %i5, %i3 fat_buf_mark_modified(fs_info); count -= c; cmpltd +=c; 4001355c: 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; 40013560: e2 2e 20 88 stb %l1, [ %i0 + 0x88 ] sec_num++; 40013564: b2 06 60 01 inc %i1 ofs = 0; 40013568: 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) 4001356c: 80 a6 e0 00 cmp %i3, 0 40013570: 32 bf ff e6 bne,a 40013508 40013574: fa 16 00 00 lduh [ %i0 ], %i5 cmpltd +=c; sec_num++; ofs = 0; } return cmpltd; } 40013578: 81 c7 e0 08 ret 4001357c: 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; 40013580: a0 10 3f ff mov -1, %l0 <== NOT EXECUTED cmpltd +=c; sec_num++; ofs = 0; } return cmpltd; } 40013584: b0 10 00 10 mov %l0, %i0 <== NOT EXECUTED 40013588: 81 c7 e0 08 ret <== NOT EXECUTED 4001358c: 81 e8 00 00 restore <== NOT EXECUTED =============================================================================== 40019244 : fat_set_fat_cluster( fat_fs_info_t *fs_info, uint32_t cln, uint32_t in_val ) { 40019244: 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; 40019248: c0 27 bf fc clr [ %fp + -4 ] /* sanity check */ if ( (cln < 2) || (cln > (fs_info->vol.data_cls + 1)) ) 4001924c: 80 a6 60 01 cmp %i1, 1 40019250: 08 80 00 98 bleu 400194b0 <== NEVER TAKEN 40019254: ba 10 00 18 mov %i0, %i5 40019258: c2 06 20 38 ld [ %i0 + 0x38 ], %g1 4001925c: 82 00 60 01 inc %g1 40019260: 80 a6 40 01 cmp %i1, %g1 40019264: 28 80 00 03 bleu,a 40019270 <== ALWAYS TAKEN 40019268: c2 0e 20 0e ldub [ %i0 + 0xe ], %g1 4001926c: 30 80 00 91 b,a 400194b0 <== NOT EXECUTED rtems_set_errno_and_return_minus_one(EIO); sec = (FAT_FAT_OFFSET(fs_info->vol.type, cln) >> fs_info->vol.sec_log2) + 40019270: 84 08 60 01 and %g1, 1, %g2 40019274: 80 88 a0 ff btst 0xff, %g2 40019278: 02 80 00 05 be 4001928c 4001927c: 86 08 60 02 and %g1, 2, %g3 40019280: a1 36 60 01 srl %i1, 1, %l0 40019284: 10 80 00 06 b 4001929c 40019288: a0 04 00 19 add %l0, %i1, %l0 4001928c: 80 88 e0 ff btst 0xff, %g3 40019290: 02 80 00 03 be 4001929c 40019294: a1 2e 60 02 sll %i1, 2, %l0 40019298: a1 2e 60 01 sll %i1, 1, %l0 4001929c: 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); 400192a0: 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) + 400192a4: a1 34 00 03 srl %l0, %g3, %l0 400192a8: 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); 400192ac: 02 80 00 05 be 400192c0 400192b0: a0 04 00 03 add %l0, %g3, %l0 400192b4: b7 36 60 01 srl %i1, 1, %i3 400192b8: 10 80 00 07 b 400192d4 400192bc: b6 06 c0 19 add %i3, %i1, %i3 400192c0: 82 08 60 02 and %g1, 2, %g1 400192c4: 80 88 60 ff btst 0xff, %g1 400192c8: 02 80 00 03 be 400192d4 400192cc: b7 2e 60 02 sll %i1, 2, %i3 400192d0: b7 2e 60 01 sll %i1, 1, %i3 400192d4: f8 17 40 00 lduh [ %i5 ], %i4 rc = fat_buf_access(fs_info, sec, FAT_OP_TYPE_READ, &sec_buf); 400192d8: 90 10 00 1d mov %i5, %o0 400192dc: 92 10 00 10 mov %l0, %o1 400192e0: 94 10 20 01 mov 1, %o2 400192e4: 7f ff e8 36 call 400133bc 400192e8: 96 07 bf fc add %fp, -4, %o3 if (rc != RC_OK) 400192ec: b0 92 20 00 orcc %o0, 0, %i0 400192f0: 12 80 00 4c bne 40019420 <== NEVER TAKEN 400192f4: 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); 400192f8: b9 37 20 10 srl %i4, 0x10, %i4 400192fc: b8 07 3f ff add %i4, -1, %i4 40019300: 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 ) 40019304: f6 0f 60 0e ldub [ %i5 + 0xe ], %i3 40019308: 80 a6 e0 02 cmp %i3, 2 4001930c: 02 80 00 53 be 40019458 40019310: 80 a6 e0 04 cmp %i3, 4 40019314: 02 80 00 5b be 40019480 40019318: 80 a6 e0 01 cmp %i3, 1 4001931c: 12 80 00 65 bne 400194b0 <== NEVER TAKEN 40019320: 80 8e 60 01 btst 1, %i1 { case FAT_FAT12: if ( FAT_CLUSTER_IS_ODD(cln) ) 40019324: 02 80 00 23 be 400193b0 40019328: c2 07 bf fc ld [ %fp + -4 ], %g1 { fat16_clv = ((uint16_t )in_val) << FAT_FAT12_SHIFT; *(sec_buf + ofs) &= 0x0F; 4001932c: c4 08 40 1c ldub [ %g1 + %i4 ], %g2 40019330: 84 08 a0 0f and %g2, 0xf, %g2 40019334: c4 28 40 1c stb %g2, [ %g1 + %i4 ] *(sec_buf + ofs) |= (uint8_t)(fat16_clv & 0x00F0); 40019338: c2 07 bf fc ld [ %fp + -4 ], %g1 4001933c: 85 2e a0 04 sll %i2, 4, %g2 40019340: c6 08 40 1c ldub [ %g1 + %i4 ], %g3 40019344: 84 10 c0 02 or %g3, %g2, %g2 40019348: c4 28 40 1c stb %g2, [ %g1 + %i4 ] fat_buf_mark_modified(fs_info); if ( ofs == (fs_info->vol.bps - 1) ) 4001934c: c2 17 40 00 lduh [ %i5 ], %g1 40019350: 82 00 7f ff add %g1, -1, %g1 40019354: 80 a7 00 01 cmp %i4, %g1 40019358: 12 80 00 0f bne 40019394 <== ALWAYS TAKEN 4001935c: f6 2f 60 88 stb %i3, [ %i5 + 0x88 ] { rc = fat_buf_access(fs_info, sec + 1, FAT_OP_TYPE_READ, 40019360: 90 10 00 1d mov %i5, %o0 <== NOT EXECUTED 40019364: 92 04 20 01 add %l0, 1, %o1 <== NOT EXECUTED 40019368: 94 10 20 01 mov 1, %o2 <== NOT EXECUTED 4001936c: 7f ff e8 14 call 400133bc <== NOT EXECUTED 40019370: 96 07 bf fc add %fp, -4, %o3 <== NOT EXECUTED &sec_buf); if (rc != RC_OK) 40019374: b0 92 20 00 orcc %o0, 0, %i0 <== NOT EXECUTED 40019378: 12 80 00 2a bne 40019420 <== NOT EXECUTED 4001937c: c2 07 bf fc ld [ %fp + -4 ], %g1 <== NOT EXECUTED return rc; *sec_buf &= 0x00; *sec_buf |= (uint8_t)((fat16_clv & 0xFF00)>>8); 40019380: 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; 40019384: c0 28 40 00 clrb [ %g1 ] <== NOT EXECUTED *sec_buf |= (uint8_t)((fat16_clv & 0xFF00)>>8); 40019388: b5 36 a0 18 srl %i2, 0x18, %i2 <== NOT EXECUTED 4001938c: 10 80 00 21 b 40019410 <== NOT EXECUTED 40019390: c2 07 bf fc ld [ %fp + -4 ], %g1 <== NOT EXECUTED fat_buf_mark_modified(fs_info); } else { *(sec_buf + ofs + 1) &= 0x00; 40019394: c2 07 bf fc ld [ %fp + -4 ], %g1 40019398: b8 07 20 01 inc %i4 *(sec_buf + ofs + 1) |= (uint8_t )((fat16_clv & 0xFF00)>>8); 4001939c: b5 2e a0 14 sll %i2, 0x14, %i2 fat_buf_mark_modified(fs_info); } else { *(sec_buf + ofs + 1) &= 0x00; 400193a0: c0 28 40 1c clrb [ %g1 + %i4 ] *(sec_buf + ofs + 1) |= (uint8_t )((fat16_clv & 0xFF00)>>8); 400193a4: b5 36 a0 18 srl %i2, 0x18, %i2 400193a8: 10 80 00 27 b 40019444 400193ac: c2 07 bf fc ld [ %fp + -4 ], %g1 } } else { fat16_clv = ((uint16_t )in_val) & FAT_FAT12_MASK; *(sec_buf + ofs) &= 0x00; 400193b0: c0 28 40 1c clrb [ %g1 + %i4 ] *(sec_buf + ofs) |= (uint8_t)(fat16_clv & 0x00FF); 400193b4: 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; 400193b8: b4 0e af ff and %i2, 0xfff, %i2 *(sec_buf + ofs) &= 0x00; *(sec_buf + ofs) |= (uint8_t)(fat16_clv & 0x00FF); 400193bc: c4 08 40 1c ldub [ %g1 + %i4 ], %g2 400193c0: 84 10 80 1a or %g2, %i2, %g2 400193c4: c4 28 40 1c stb %g2, [ %g1 + %i4 ] fat_buf_mark_modified(fs_info); if ( ofs == (fs_info->vol.bps - 1) ) 400193c8: c2 17 40 00 lduh [ %i5 ], %g1 400193cc: 82 00 7f ff add %g1, -1, %g1 400193d0: 80 a7 00 01 cmp %i4, %g1 400193d4: 12 80 00 15 bne 40019428 <== ALWAYS TAKEN 400193d8: f6 2f 60 88 stb %i3, [ %i5 + 0x88 ] { rc = fat_buf_access(fs_info, sec + 1, FAT_OP_TYPE_READ, 400193dc: 90 10 00 1d mov %i5, %o0 <== NOT EXECUTED 400193e0: 92 04 20 01 add %l0, 1, %o1 <== NOT EXECUTED 400193e4: 94 10 20 01 mov 1, %o2 <== NOT EXECUTED 400193e8: 7f ff e7 f5 call 400133bc <== NOT EXECUTED 400193ec: 96 07 bf fc add %fp, -4, %o3 <== NOT EXECUTED &sec_buf); if (rc != RC_OK) 400193f0: b0 92 20 00 orcc %o0, 0, %i0 <== NOT EXECUTED 400193f4: 12 80 00 0b bne 40019420 <== NOT EXECUTED 400193f8: c2 07 bf fc ld [ %fp + -4 ], %g1 <== NOT EXECUTED return rc; *sec_buf &= 0xF0; *sec_buf |= (uint8_t)((fat16_clv & 0xFF00)>>8); 400193fc: 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; 40019400: c4 08 40 00 ldub [ %g1 ], %g2 <== NOT EXECUTED 40019404: 84 08 bf f0 and %g2, -16, %g2 <== NOT EXECUTED 40019408: c4 28 40 00 stb %g2, [ %g1 ] <== NOT EXECUTED *sec_buf |= (uint8_t)((fat16_clv & 0xFF00)>>8); 4001940c: c2 07 bf fc ld [ %fp + -4 ], %g1 <== NOT EXECUTED 40019410: c4 08 40 00 ldub [ %g1 ], %g2 <== NOT EXECUTED 40019414: b4 16 80 02 or %i2, %g2, %i2 <== NOT EXECUTED 40019418: 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; 4001941c: f6 2f 60 88 stb %i3, [ %i5 + 0x88 ] <== NOT EXECUTED 40019420: 81 c7 e0 08 ret <== NOT EXECUTED 40019424: 81 e8 00 00 restore <== NOT EXECUTED fat_buf_mark_modified(fs_info); } else { *(sec_buf + ofs + 1) &= 0xF0; 40019428: c2 07 bf fc ld [ %fp + -4 ], %g1 4001942c: b8 07 20 01 inc %i4 40019430: c4 08 40 1c ldub [ %g1 + %i4 ], %g2 *(sec_buf + ofs+1) |= (uint8_t)((fat16_clv & 0xFF00)>>8); 40019434: b5 36 a0 08 srl %i2, 8, %i2 fat_buf_mark_modified(fs_info); } else { *(sec_buf + ofs + 1) &= 0xF0; 40019438: 84 08 bf f0 and %g2, -16, %g2 4001943c: c4 28 40 1c stb %g2, [ %g1 + %i4 ] *(sec_buf + ofs+1) |= (uint8_t)((fat16_clv & 0xFF00)>>8); 40019440: c2 07 bf fc ld [ %fp + -4 ], %g1 40019444: c4 08 40 1c ldub [ %g1 + %i4 ], %g2 40019448: b4 10 80 1a or %g2, %i2, %i2 4001944c: f4 28 40 1c stb %i2, [ %g1 + %i4 ] 40019450: 81 c7 e0 08 ret 40019454: 81 e8 00 00 restore break; } return RC_OK; } 40019458: 03 00 00 3f sethi %hi(0xfc00), %g1 4001945c: 82 10 63 ff or %g1, 0x3ff, %g1 ! ffff 40019460: 82 0e 80 01 and %i2, %g1, %g1 } break; case FAT_FAT16: *((uint16_t *)(sec_buf + ofs)) = (uint16_t )(CT_LE_W(in_val)); 40019464: 83 28 60 08 sll %g1, 8, %g1 40019468: b5 2e a0 10 sll %i2, 0x10, %i2 4001946c: b5 36 a0 18 srl %i2, 0x18, %i2 40019470: b4 10 40 1a or %g1, %i2, %i2 } } break; case FAT_FAT16: *((uint16_t *)(sec_buf + ofs)) = 40019474: c2 07 bf fc ld [ %fp + -4 ], %g1 40019478: 10 80 00 0a b 400194a0 4001947c: 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)); 40019480: 11 3c 00 00 sethi %hi(0xf0000000), %o0 40019484: 7f ff fe f2 call 4001904c 40019488: 90 2e 80 08 andn %i2, %o0, %o0 *((uint32_t *)(sec_buf + ofs)) &= CT_LE_L(0xF0000000); 4001948c: c2 07 bf fc ld [ %fp + -4 ], %g1 40019490: c4 00 40 1c ld [ %g1 + %i4 ], %g2 40019494: 84 08 a0 f0 and %g2, 0xf0, %g2 *((uint32_t *)(sec_buf + ofs)) |= fat32_clv; 40019498: 90 12 00 02 or %o0, %g2, %o0 4001949c: d0 20 40 1c st %o0, [ %g1 + %i4 ] 400194a0: 82 10 20 01 mov 1, %g1 400194a4: c2 2f 60 88 stb %g1, [ %i5 + 0x88 ] 400194a8: 81 c7 e0 08 ret 400194ac: 81 e8 00 00 restore fat_buf_mark_modified(fs_info); break; default: rtems_set_errno_and_return_minus_one(EIO); 400194b0: 40 00 05 bd call 4001aba4 <__errno> <== NOT EXECUTED 400194b4: b0 10 3f ff mov -1, %i0 <== NOT EXECUTED 400194b8: 82 10 20 05 mov 5, %g1 <== NOT EXECUTED 400194bc: c2 22 00 00 st %g1, [ %o0 ] <== NOT EXECUTED break; } return RC_OK; } 400194c0: 81 c7 e0 08 ret <== NOT EXECUTED 400194c4: 81 e8 00 00 restore <== NOT EXECUTED =============================================================================== 4001406c : * RC_OK on success, or -1 if error occured * and errno set appropriately */ int fat_shutdown_drive(fat_fs_info_t *fs_info) { 4001406c: 9d e3 bf a0 save %sp, -96, %sp int rc = RC_OK; int i = 0; rc = fat_sync(fs_info); 40014070: 90 10 00 18 mov %i0, %o0 40014074: 7f ff ff ca call 40013f9c 40014078: ba 10 00 18 mov %i0, %i5 if ( rc != RC_OK ) 4001407c: b0 92 20 00 orcc %o0, 0, %i0 40014080: 32 80 00 02 bne,a 40014088 <== NEVER TAKEN 40014084: b0 10 3f ff mov -1, %i0 <== NOT EXECUTED rc = -1; 40014088: 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; 4001408c: f6 07 60 6c ld [ %i5 + 0x6c ], %i3 while ( (node = rtems_chain_get(the_chain)) != NULL ) 40014090: 10 80 00 04 b 400140a0 40014094: b6 06 c0 1c add %i3, %i4, %i3 free(node); 40014098: 7f ff c6 b0 call 40005b58 4001409c: 01 00 00 00 nop */ RTEMS_INLINE_ROUTINE rtems_chain_node *rtems_chain_get( rtems_chain_control *the_chain ) { return _Chain_Get( the_chain ); 400140a0: 7f ff da 77 call 4000aa7c <_Chain_Get> 400140a4: 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 ) 400140a8: 80 a2 20 00 cmp %o0, 0 400140ac: 12 bf ff fb bne 40014098 400140b0: 01 00 00 00 nop 400140b4: 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++) 400140b8: 80 a7 20 18 cmp %i4, 0x18 400140bc: 32 bf ff f5 bne,a 40014090 400140c0: f6 07 60 6c ld [ %i5 + 0x6c ], %i3 400140c4: 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; 400140c8: f6 07 60 70 ld [ %i5 + 0x70 ], %i3 while ( (node = rtems_chain_get(the_chain)) != NULL ) 400140cc: 10 80 00 04 b 400140dc 400140d0: b6 06 c0 1c add %i3, %i4, %i3 free(node); 400140d4: 7f ff c6 a1 call 40005b58 <== NOT EXECUTED 400140d8: 01 00 00 00 nop <== NOT EXECUTED 400140dc: 7f ff da 68 call 4000aa7c <_Chain_Get> 400140e0: 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 ) 400140e4: 80 a2 20 00 cmp %o0, 0 400140e8: 12 bf ff fb bne 400140d4 <== NEVER TAKEN 400140ec: 01 00 00 00 nop 400140f0: 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++) 400140f4: 80 a7 20 18 cmp %i4, 0x18 400140f8: 32 bf ff f5 bne,a 400140cc 400140fc: f6 07 60 70 ld [ %i5 + 0x70 ], %i3 while ( (node = rtems_chain_get(the_chain)) != NULL ) free(node); } free(fs_info->vhash); 40014100: 7f ff c6 96 call 40005b58 40014104: d0 07 60 6c ld [ %i5 + 0x6c ], %o0 free(fs_info->rhash); 40014108: 7f ff c6 94 call 40005b58 4001410c: d0 07 60 70 ld [ %i5 + 0x70 ], %o0 free(fs_info->uino); 40014110: 7f ff c6 92 call 40005b58 40014114: d0 07 60 74 ld [ %i5 + 0x74 ], %o0 free(fs_info->sec_buf); 40014118: 7f ff c6 90 call 40005b58 4001411c: d0 07 60 90 ld [ %i5 + 0x90 ], %o0 close(fs_info->vol.fd); 40014120: 7f ff c6 6d call 40005ad4 40014124: d0 07 60 60 ld [ %i5 + 0x60 ], %o0 if (rc) 40014128: 80 a6 20 00 cmp %i0, 0 4001412c: 02 80 00 06 be 40014144 <== ALWAYS TAKEN 40014130: 01 00 00 00 nop errno = EIO; 40014134: 40 00 1a 9c call 4001aba4 <__errno> <== NOT EXECUTED 40014138: 01 00 00 00 nop <== NOT EXECUTED 4001413c: 82 10 20 05 mov 5, %g1 ! 5 <== NOT EXECUTED 40014140: c2 22 00 00 st %g1, [ %o0 ] <== NOT EXECUTED return rc; } 40014144: 81 c7 e0 08 ret 40014148: 81 e8 00 00 restore =============================================================================== 40013f9c : return RC_OK; } int fat_sync(fat_fs_info_t *fs_info) { 40013f9c: 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) 40013fa0: c4 0e 20 0e ldub [ %i0 + 0xe ], %g2 return RC_OK; } int fat_sync(fat_fs_info_t *fs_info) { 40013fa4: 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; 40013fa8: 90 10 20 00 clr %o0 if (fs_info->vol.type == FAT_FAT32) 40013fac: 80 a0 a0 04 cmp %g2, 4 40013fb0: 12 80 00 20 bne 40014030 40013fb4: b4 10 20 00 clr %i2 { uint32_t free_count = fs_info->vol.free_cls; 40013fb8: 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) 40013fbc: c2 06 20 48 ld [ %i0 + 0x48 ], %g1 40013fc0: 80 a6 c0 01 cmp %i3, %g1 40013fc4: 02 80 00 0d be 40013ff8 <== ALWAYS TAKEN 40013fc8: f8 06 20 4c ld [ %i0 + 0x4c ], %i4 { uint32_t le_free_count = CT_LE_L(free_count); 40013fcc: 7f ff fc 65 call 40013160 <== NOT EXECUTED 40013fd0: 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, 40013fd4: 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); 40013fd8: d0 27 bf fc st %o0, [ %fp + -4 ] <== NOT EXECUTED fs_info->vol.free_cls_in_fs_info = free_count; 40013fdc: f6 26 20 48 st %i3, [ %i0 + 0x48 ] <== NOT EXECUTED ret1 = fat_sector_write(fs_info, 40013fe0: 90 10 00 18 mov %i0, %o0 <== NOT EXECUTED 40013fe4: 94 10 21 e8 mov 0x1e8, %o2 <== NOT EXECUTED 40013fe8: 96 10 20 04 mov 4, %o3 <== NOT EXECUTED 40013fec: 7f ff fd 43 call 400134f8 <== NOT EXECUTED 40013ff0: 98 07 bf fc add %fp, -4, %o4 <== NOT EXECUTED 40013ff4: 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) 40013ff8: c4 07 60 50 ld [ %i5 + 0x50 ], %g2 40013ffc: 80 a7 00 02 cmp %i4, %g2 40014000: 02 80 00 0c be 40014030 <== NEVER TAKEN 40014004: 90 10 20 00 clr %o0 { uint32_t le_next_free = CT_LE_L(next_free); 40014008: 7f ff fc 56 call 40013160 4001400c: 90 10 00 1c mov %i4, %o0 fs_info->vol.next_cl_in_fs_info = next_free; ret2 = fat_sector_write(fs_info, 40014010: 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); 40014014: d0 27 bf fc st %o0, [ %fp + -4 ] fs_info->vol.next_cl_in_fs_info = next_free; 40014018: f8 27 60 50 st %i4, [ %i5 + 0x50 ] ret2 = fat_sector_write(fs_info, 4001401c: 90 10 00 1d mov %i5, %o0 40014020: 94 10 21 ec mov 0x1ec, %o2 40014024: 96 10 20 04 mov 4, %o3 40014028: 7f ff fd 34 call 400134f8 4001402c: 98 07 bf fc add %fp, -4, %o4 sizeof(le_next_free), &le_next_free); } } if ( (ret1 < 0) || (ret2 < 0) ) 40014030: 80 a2 20 00 cmp %o0, 0 40014034: 06 80 00 04 bl 40014044 <== NEVER TAKEN 40014038: 80 a6 a0 00 cmp %i2, 0 4001403c: 16 80 00 03 bge 40014048 <== ALWAYS TAKEN 40014040: b0 10 20 00 clr %i0 { int rc = RC_OK; rc = fat_fat32_update_fsinfo_sector(fs_info); if ( rc != RC_OK ) rc = -1; 40014044: b0 10 3f ff mov -1, %i0 <== NOT EXECUTED fat_buf_release(fs_info); 40014048: 7f ff fc 69 call 400131ec 4001404c: 90 10 00 1d mov %i5, %o0 if (rtems_bdbuf_syncdev(fs_info->vol.dd) != RTEMS_SUCCESSFUL) 40014050: 7f ff f5 bb call 4001173c 40014054: d0 07 60 64 ld [ %i5 + 0x64 ], %o0 40014058: 80 a2 20 00 cmp %o0, 0 4001405c: 32 80 00 02 bne,a 40014064 <== NEVER TAKEN 40014060: b0 10 3f ff mov -1, %i0 <== NOT EXECUTED rc = -1; return rc; } 40014064: 81 c7 e0 08 ret 40014068: 81 e8 00 00 restore =============================================================================== 40032220 : /** * compatible with SVr4, 4.4BSD and X/OPEN - Change Directory */ int fchdir( int fd ) { 40032220: 9d e3 bf 40 save %sp, -192, %sp <== NOT EXECUTED st.st_mode = 0; st.st_uid = 0; st.st_gid = 0; rtems_libio_check_fd( fd ); 40032224: 03 10 01 7a sethi %hi(0x4005e800), %g1 <== NOT EXECUTED 40032228: c2 00 62 a0 ld [ %g1 + 0x2a0 ], %g1 ! 4005eaa0 <== NOT EXECUTED int rv = 0; rtems_libio_t *iop; struct stat st; rtems_filesystem_location_info_t loc; st.st_mode = 0; 4003222c: c0 27 bf c4 clr [ %fp + -60 ] <== NOT EXECUTED st.st_uid = 0; 40032230: c0 37 bf ca clrh [ %fp + -54 ] <== NOT EXECUTED st.st_gid = 0; rtems_libio_check_fd( fd ); 40032234: 80 a6 00 01 cmp %i0, %g1 <== NOT EXECUTED 40032238: 1a 80 00 0c bcc 40032268 <== NOT EXECUTED 4003223c: c0 37 bf cc clrh [ %fp + -52 ] <== NOT EXECUTED iop = rtems_libio_iop( fd ); 40032240: 83 2e 20 03 sll %i0, 3, %g1 <== NOT EXECUTED 40032244: b1 2e 20 06 sll %i0, 6, %i0 <== NOT EXECUTED 40032248: b0 26 00 01 sub %i0, %g1, %i0 <== NOT EXECUTED 4003224c: 03 10 01 8b sethi %hi(0x40062c00), %g1 <== NOT EXECUTED 40032250: fa 00 60 f0 ld [ %g1 + 0xf0 ], %i5 ! 40062cf0 <== NOT EXECUTED 40032254: ba 07 40 18 add %i5, %i0, %i5 <== NOT EXECUTED rtems_libio_check_is_open( iop ); 40032258: c2 07 60 10 ld [ %i5 + 0x10 ], %g1 <== NOT EXECUTED 4003225c: 80 88 61 00 btst 0x100, %g1 <== NOT EXECUTED 40032260: 32 80 00 08 bne,a 40032280 <== NOT EXECUTED 40032264: d0 07 60 28 ld [ %i5 + 0x28 ], %o0 <== NOT EXECUTED 40032268: 40 00 10 c1 call 4003656c <__errno> <== NOT EXECUTED 4003226c: b0 10 3f ff mov -1, %i0 <== NOT EXECUTED 40032270: 82 10 20 09 mov 9, %g1 <== NOT EXECUTED 40032274: c2 22 00 00 st %g1, [ %o0 ] <== NOT EXECUTED 40032278: 81 c7 e0 08 ret <== NOT EXECUTED 4003227c: 81 e8 00 00 restore <== NOT EXECUTED const rtems_filesystem_location_info_t *loc ) { const rtems_filesystem_mount_table_entry_t *mt_entry = loc->mt_entry; (*mt_entry->ops->lock_h)( mt_entry ); 40032280: c2 02 20 0c ld [ %o0 + 0xc ], %g1 <== NOT EXECUTED 40032284: c2 00 40 00 ld [ %g1 ], %g1 <== NOT EXECUTED 40032288: 9f c0 40 00 call %g1 <== NOT EXECUTED 4003228c: b8 07 60 14 add %i5, 0x14, %i4 <== NOT EXECUTED rtems_filesystem_instance_lock( &iop->pathinfo ); rv = (*iop->pathinfo.handlers->fstat_h)( &iop->pathinfo, &st ); 40032290: c2 07 60 24 ld [ %i5 + 0x24 ], %g1 <== NOT EXECUTED 40032294: 90 10 00 1c mov %i4, %o0 <== NOT EXECUTED 40032298: c2 00 60 18 ld [ %g1 + 0x18 ], %g1 <== NOT EXECUTED 4003229c: 9f c0 40 00 call %g1 <== NOT EXECUTED 400322a0: 92 07 bf b8 add %fp, -72, %o1 <== NOT EXECUTED if ( rv == 0 ) { 400322a4: b0 92 20 00 orcc %o0, 0, %i0 <== NOT EXECUTED 400322a8: 32 80 00 13 bne,a 400322f4 <== NOT EXECUTED 400322ac: d0 07 60 28 ld [ %i5 + 0x28 ], %o0 <== NOT EXECUTED bool access_ok = rtems_filesystem_check_access( 400322b0: d2 07 bf c4 ld [ %fp + -60 ], %o1 <== NOT EXECUTED 400322b4: d4 17 bf ca lduh [ %fp + -54 ], %o2 <== NOT EXECUTED 400322b8: d6 17 bf cc lduh [ %fp + -52 ], %o3 <== NOT EXECUTED 400322bc: 7f ff 70 e7 call 4000e658 <== NOT EXECUTED 400322c0: 90 10 20 01 mov 1, %o0 <== NOT EXECUTED st.st_mode, st.st_uid, st.st_gid ); if ( access_ok ) { 400322c4: 80 8a 20 ff btst 0xff, %o0 <== NOT EXECUTED 400322c8: 02 80 00 06 be 400322e0 <== NOT EXECUTED 400322cc: 90 07 bf a0 add %fp, -96, %o0 <== NOT EXECUTED rtems_filesystem_location_clone( &loc, &iop->pathinfo ); 400322d0: 7f ff 6f 56 call 4000e028 <== NOT EXECUTED 400322d4: 92 10 00 1c mov %i4, %o1 <== NOT EXECUTED static inline void rtems_filesystem_instance_unlock( const rtems_filesystem_location_info_t *loc ) { const rtems_filesystem_mount_table_entry_t *mt_entry = loc->mt_entry; 400322d8: 10 80 00 07 b 400322f4 <== NOT EXECUTED 400322dc: d0 07 60 28 ld [ %i5 + 0x28 ], %o0 <== NOT EXECUTED } else { errno = EACCES; 400322e0: 40 00 10 a3 call 4003656c <__errno> <== NOT EXECUTED 400322e4: b0 10 3f ff mov -1, %i0 <== NOT EXECUTED 400322e8: 82 10 20 0d mov 0xd, %g1 <== NOT EXECUTED 400322ec: c2 22 00 00 st %g1, [ %o0 ] <== NOT EXECUTED 400322f0: d0 07 60 28 ld [ %i5 + 0x28 ], %o0 <== NOT EXECUTED (*mt_entry->ops->unlock_h)( mt_entry ); 400322f4: c2 02 20 0c ld [ %o0 + 0xc ], %g1 <== NOT EXECUTED 400322f8: c2 00 60 04 ld [ %g1 + 4 ], %g1 <== NOT EXECUTED 400322fc: 9f c0 40 00 call %g1 <== NOT EXECUTED 40032300: 01 00 00 00 nop <== NOT EXECUTED rv = -1; } } rtems_filesystem_instance_unlock( &iop->pathinfo ); if ( rv == 0 ) { 40032304: 80 a6 20 00 cmp %i0, 0 <== NOT EXECUTED 40032308: 12 80 00 05 bne 4003231c <== NOT EXECUTED 4003230c: 01 00 00 00 nop <== NOT EXECUTED rv = rtems_filesystem_chdir( &loc ); 40032310: 7f ff c4 0b call 4002333c <== NOT EXECUTED 40032314: 90 07 bf a0 add %fp, -96, %o0 <== NOT EXECUTED 40032318: b0 10 00 08 mov %o0, %i0 <== NOT EXECUTED } return rv; } 4003231c: 81 c7 e0 08 ret <== NOT EXECUTED 40032320: 81 e8 00 00 restore <== NOT EXECUTED 40032324: 40 03 23 cc call 400fb254 <__end+0x97d14> <== NOT EXECUTED 40032328: 40 03 24 a8 call 400fb5c8 <__end+0x98088> <== NOT EXECUTED 4003232c: 40 03 24 b4 call 400fb5fc <__end+0x980bc> <== NOT EXECUTED 40032330: 40 03 24 cc call 400fb660 <__end+0x98120> <== NOT EXECUTED 40032334: 40 03 24 dc call 400fb6a4 <__end+0x98164> <== NOT EXECUTED 40032338: 40 03 25 00 call 400fb738 <__end+0x981f8> <== NOT EXECUTED 4003233c: 40 03 25 00 call 400fb73c <__end+0x981fc> <== NOT EXECUTED 40032340: 40 03 25 00 call 400fb740 <__end+0x98200> <== NOT EXECUTED 40032344: 40 03 25 00 call 400fb744 <__end+0x98204> <== NOT EXECUTED 40032348: 40 03 25 00 call 400fb748 <__end+0x98208> <== NOT EXECUTED =============================================================================== 40023894 : /** * POSIX 1003.1b 5.6.4 - Change File Modes */ int fchmod( int fd, mode_t mode ) { 40023894: 9d e3 bf a0 save %sp, -96, %sp int rv; rtems_libio_t *iop; rtems_libio_check_fd( fd ); 40023898: 03 10 01 7a sethi %hi(0x4005e800), %g1 4002389c: c2 00 62 a0 ld [ %g1 + 0x2a0 ], %g1 ! 4005eaa0 400238a0: 80 a6 00 01 cmp %i0, %g1 400238a4: 2a 80 00 03 bcs,a 400238b0 400238a8: 83 2e 20 03 sll %i0, 3, %g1 400238ac: 30 80 00 0a b,a 400238d4 iop = rtems_libio_iop( fd ); 400238b0: b1 2e 20 06 sll %i0, 6, %i0 400238b4: b0 26 00 01 sub %i0, %g1, %i0 400238b8: 03 10 01 8b sethi %hi(0x40062c00), %g1 400238bc: fa 00 60 f0 ld [ %g1 + 0xf0 ], %i5 ! 40062cf0 400238c0: ba 07 40 18 add %i5, %i0, %i5 rtems_libio_check_is_open(iop); 400238c4: c2 07 60 10 ld [ %i5 + 0x10 ], %g1 400238c8: 80 88 61 00 btst 0x100, %g1 400238cc: 32 80 00 06 bne,a 400238e4 400238d0: d0 07 60 28 ld [ %i5 + 0x28 ], %o0 400238d4: 40 00 4b 26 call 4003656c <__errno> 400238d8: 01 00 00 00 nop 400238dc: 10 80 00 1b b 40023948 400238e0: 82 10 20 09 mov 9, %g1 ! 9 if (iop->pathinfo.mt_entry->writeable) { 400238e4: c2 0a 20 29 ldub [ %o0 + 0x29 ], %g1 400238e8: 80 a0 60 00 cmp %g1, 0 400238ec: 02 80 00 14 be 4002393c <== NEVER TAKEN 400238f0: 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 ); 400238f4: c2 02 20 0c ld [ %o0 + 0xc ], %g1 400238f8: c2 00 40 00 ld [ %g1 ], %g1 400238fc: 9f c0 40 00 call %g1 40023900: 01 00 00 00 nop rtems_filesystem_instance_lock( &iop->pathinfo ); rv = (*iop->pathinfo.mt_entry->ops->fchmod_h)( &iop->pathinfo, mode ); 40023904: c2 07 60 28 ld [ %i5 + 0x28 ], %g1 40023908: 90 07 60 14 add %i5, 0x14, %o0 4002390c: c2 00 60 0c ld [ %g1 + 0xc ], %g1 40023910: c2 00 60 20 ld [ %g1 + 0x20 ], %g1 40023914: 9f c0 40 00 call %g1 40023918: 92 10 00 19 mov %i1, %o1 4002391c: 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; 40023920: d0 07 60 28 ld [ %i5 + 0x28 ], %o0 (*mt_entry->ops->unlock_h)( mt_entry ); 40023924: c2 02 20 0c ld [ %o0 + 0xc ], %g1 40023928: c2 00 60 04 ld [ %g1 + 4 ], %g1 4002392c: 9f c0 40 00 call %g1 40023930: 01 00 00 00 nop 40023934: 81 c7 e0 08 ret 40023938: 81 e8 00 00 restore rtems_filesystem_instance_unlock( &iop->pathinfo ); } else { errno = EROFS; 4002393c: 40 00 4b 0c call 4003656c <__errno> <== NOT EXECUTED 40023940: 01 00 00 00 nop <== NOT EXECUTED 40023944: 82 10 20 1e mov 0x1e, %g1 ! 1e <== NOT EXECUTED 40023948: c2 22 00 00 st %g1, [ %o0 ] rv = -1; } return rv; } 4002394c: 81 c7 e0 08 ret 40023950: 91 e8 3f ff restore %g0, -1, %o0 =============================================================================== 40023954 : /** * POSIX 1003.1b 5.6.5 - Change Owner and Group of a File */ int fchown( int fd, uid_t owner, gid_t group ) { 40023954: 9d e3 bf a0 save %sp, -96, %sp int rv = 0; rtems_libio_t *iop; rtems_libio_check_fd( fd ); 40023958: 03 10 01 7a sethi %hi(0x4005e800), %g1 4002395c: c2 00 62 a0 ld [ %g1 + 0x2a0 ], %g1 ! 4005eaa0 40023960: 80 a6 00 01 cmp %i0, %g1 40023964: 2a 80 00 03 bcs,a 40023970 40023968: 83 2e 20 03 sll %i0, 3, %g1 4002396c: 30 80 00 0a b,a 40023994 iop = rtems_libio_iop( fd ); 40023970: b1 2e 20 06 sll %i0, 6, %i0 40023974: b0 26 00 01 sub %i0, %g1, %i0 40023978: 03 10 01 8b sethi %hi(0x40062c00), %g1 4002397c: fa 00 60 f0 ld [ %g1 + 0xf0 ], %i5 ! 40062cf0 40023980: ba 07 40 18 add %i5, %i0, %i5 rtems_libio_check_is_open(iop); 40023984: c2 07 60 10 ld [ %i5 + 0x10 ], %g1 40023988: 80 88 61 00 btst 0x100, %g1 4002398c: 32 80 00 06 bne,a 400239a4 40023990: d0 07 60 28 ld [ %i5 + 0x28 ], %o0 40023994: 40 00 4a f6 call 4003656c <__errno> 40023998: 01 00 00 00 nop 4002399c: 10 80 00 1c b 40023a0c 400239a0: 82 10 20 09 mov 9, %g1 ! 9 if (iop->pathinfo.mt_entry->writeable) { 400239a4: c2 0a 20 29 ldub [ %o0 + 0x29 ], %g1 400239a8: 80 a0 60 00 cmp %g1, 0 400239ac: 02 80 00 15 be 40023a00 <== NEVER TAKEN 400239b0: 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 ); 400239b4: c2 02 20 0c ld [ %o0 + 0xc ], %g1 400239b8: c2 00 40 00 ld [ %g1 ], %g1 400239bc: 9f c0 40 00 call %g1 400239c0: 01 00 00 00 nop rtems_filesystem_instance_lock( &iop->pathinfo ); rv = (*iop->pathinfo.mt_entry->ops->chown_h)( 400239c4: c2 07 60 28 ld [ %i5 + 0x28 ], %g1 400239c8: 90 07 60 14 add %i5, 0x14, %o0 400239cc: c2 00 60 0c ld [ %g1 + 0xc ], %g1 400239d0: 92 10 00 19 mov %i1, %o1 400239d4: c2 00 60 24 ld [ %g1 + 0x24 ], %g1 400239d8: 9f c0 40 00 call %g1 400239dc: 94 10 00 1a mov %i2, %o2 400239e0: 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; 400239e4: d0 07 60 28 ld [ %i5 + 0x28 ], %o0 (*mt_entry->ops->unlock_h)( mt_entry ); 400239e8: c2 02 20 0c ld [ %o0 + 0xc ], %g1 400239ec: c2 00 60 04 ld [ %g1 + 4 ], %g1 400239f0: 9f c0 40 00 call %g1 400239f4: 01 00 00 00 nop 400239f8: 81 c7 e0 08 ret 400239fc: 81 e8 00 00 restore owner, group ); rtems_filesystem_instance_unlock( &iop->pathinfo ); } else { errno = EROFS; 40023a00: 40 00 4a db call 4003656c <__errno> <== NOT EXECUTED 40023a04: 01 00 00 00 nop <== NOT EXECUTED 40023a08: 82 10 20 1e mov 0x1e, %g1 ! 1e <== NOT EXECUTED 40023a0c: c2 22 00 00 st %g1, [ %o0 ] rv = -1; } return rv; } 40023a10: 81 c7 e0 08 ret 40023a14: 91 e8 3f ff restore %g0, -1, %o0 =============================================================================== 40030938 : int fcntl( int fd, int cmd, ... ) { 40030938: 9d e3 bf 98 save %sp, -104, %sp int fd2; int flags; int mask; int ret = 0; rtems_libio_check_fd( fd ); 4003093c: 05 10 00 d9 sethi %hi(0x40036400), %g2 40030940: c4 00 a0 3c ld [ %g2 + 0x3c ], %g2 ! 4003643c ... ) { int ret; va_list ap; va_start( ap, cmd ); 40030944: 82 07 a0 4c add %fp, 0x4c, %g1 40030948: f4 27 a0 4c st %i2, [ %fp + 0x4c ] 4003094c: f6 27 a0 50 st %i3, [ %fp + 0x50 ] 40030950: f8 27 a0 54 st %i4, [ %fp + 0x54 ] 40030954: fa 27 a0 58 st %i5, [ %fp + 0x58 ] int fd2; int flags; int mask; int ret = 0; rtems_libio_check_fd( fd ); 40030958: 80 a6 00 02 cmp %i0, %g2 4003095c: 1a 80 00 0c bcc 4003098c 40030960: c2 27 bf fc st %g1, [ %fp + -4 ] iop = rtems_libio_iop( fd ); 40030964: 85 2e 20 03 sll %i0, 3, %g2 40030968: b1 2e 20 06 sll %i0, 6, %i0 4003096c: b0 26 00 02 sub %i0, %g2, %i0 40030970: 05 10 01 1c sethi %hi(0x40047000), %g2 40030974: fa 00 a0 9c ld [ %g2 + 0x9c ], %i5 ! 4004709c 40030978: ba 07 40 18 add %i5, %i0, %i5 rtems_libio_check_is_open(iop); 4003097c: d0 07 60 10 ld [ %i5 + 0x10 ], %o0 40030980: 80 8a 21 00 btst 0x100, %o0 40030984: 12 80 00 06 bne 4003099c 40030988: 80 a6 60 09 cmp %i1, 9 4003098c: 7f ff be 6c call 4002033c <__errno> 40030990: 01 00 00 00 nop 40030994: 10 80 00 5d b 40030b08 40030998: 82 10 20 09 mov 9, %g1 ! 9 /* * This switch should contain all the cases from POSIX. */ switch ( cmd ) { 4003099c: 18 80 00 58 bgu 40030afc 400309a0: 85 2e 60 02 sll %i1, 2, %g2 400309a4: 07 10 00 c2 sethi %hi(0x40030800), %g3 400309a8: 86 10 e1 10 or %g3, 0x110, %g3 ! 40030910 <_calloc_r+0x14> 400309ac: c4 00 c0 02 ld [ %g3 + %g2 ], %g2 400309b0: 81 c0 80 00 jmp %g2 400309b4: 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(); 400309b8: 7f ff 60 6d call 40008b6c 400309bc: 01 00 00 00 nop if (diop != NULL) { 400309c0: b8 92 20 00 orcc %o0, 0, %i4 400309c4: 02 80 00 62 be 40030b4c 400309c8: b0 10 3f ff mov -1, %i0 int oflag = rtems_libio_to_fcntl_flags( iop->flags ); 400309cc: 7f ff 60 52 call 40008b14 400309d0: d0 07 60 10 ld [ %i5 + 0x10 ], %o0 oflag &= ~O_CREAT; diop->flags |= rtems_libio_fcntl_flags( oflag ); 400309d4: 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; 400309d8: b6 0a 3d ff and %o0, -513, %i3 diop->flags |= rtems_libio_fcntl_flags( oflag ); 400309dc: 7f ff 60 41 call 40008ae0 400309e0: 90 10 00 1b mov %i3, %o0 400309e4: 90 12 00 1a or %o0, %i2, %o0 400309e8: 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; 400309ec: d0 07 60 28 ld [ %i5 + 0x28 ], %o0 (*mt_entry->ops->lock_h)( mt_entry ); 400309f0: c2 02 20 0c ld [ %o0 + 0xc ], %g1 400309f4: c2 00 40 00 ld [ %g1 ], %g1 400309f8: 9f c0 40 00 call %g1 400309fc: 01 00 00 00 nop rtems_filesystem_instance_lock( &iop->pathinfo ); rtems_filesystem_location_clone( &diop->pathinfo, &iop->pathinfo ); 40030a00: 92 07 60 14 add %i5, 0x14, %o1 40030a04: 7f ff 99 27 call 40016ea0 40030a08: 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; 40030a0c: d0 07 60 28 ld [ %i5 + 0x28 ], %o0 (*mt_entry->ops->unlock_h)( mt_entry ); 40030a10: c2 02 20 0c ld [ %o0 + 0xc ], %g1 40030a14: c2 00 60 04 ld [ %g1 + 4 ], %g1 40030a18: 9f c0 40 00 call %g1 40030a1c: 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 ); 40030a20: c2 07 20 24 ld [ %i4 + 0x24 ], %g1 40030a24: 90 10 00 1c mov %i4, %o0 40030a28: c2 00 40 00 ld [ %g1 ], %g1 40030a2c: 92 10 20 00 clr %o1 40030a30: 94 10 00 1b mov %i3, %o2 40030a34: 9f c0 40 00 call %g1 40030a38: 96 10 20 00 clr %o3 if ( rv == 0 ) { 40030a3c: b0 92 20 00 orcc %o0, 0, %i0 40030a40: 12 80 00 11 bne 40030a84 <== NEVER TAKEN 40030a44: 03 10 01 1c sethi %hi(0x40047000), %g1 rv = diop - rtems_libio_iops; 40030a48: f0 00 60 9c ld [ %g1 + 0x9c ], %i0 ! 4004709c 40030a4c: b8 27 00 18 sub %i4, %i0, %i4 40030a50: b9 3f 20 03 sra %i4, 3, %i4 40030a54: 85 2f 20 03 sll %i4, 3, %g2 40030a58: 83 2f 20 06 sll %i4, 6, %g1 40030a5c: 82 00 80 01 add %g2, %g1, %g1 40030a60: 85 28 60 06 sll %g1, 6, %g2 40030a64: 82 00 40 02 add %g1, %g2, %g1 40030a68: 82 00 40 1c add %g1, %i4, %g1 40030a6c: b1 28 60 0f sll %g1, 0xf, %i0 40030a70: 82 00 40 18 add %g1, %i0, %g1 40030a74: 83 28 60 03 sll %g1, 3, %g1 40030a78: b8 00 40 1c add %g1, %i4, %i4 40030a7c: 10 80 00 25 b 40030b10 40030a80: b0 20 00 1c neg %i4, %i0 } else { rtems_libio_free( diop ); 40030a84: 7f ff 60 51 call 40008bc8 <== NOT EXECUTED 40030a88: 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) { 40030a8c: 10 80 00 22 b 40030b14 <== NOT EXECUTED 40030a90: 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); 40030a94: b1 32 20 0b srl %o0, 0xb, %i0 40030a98: 10 80 00 21 b 40030b1c 40030a9c: 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 ) ) 40030aa0: c2 00 40 00 ld [ %g1 ], %g1 40030aa4: 80 a0 60 00 cmp %g1, 0 40030aa8: 22 80 00 0e be,a 40030ae0 40030aac: 90 0a 37 ff and %o0, -2049, %o0 iop->flags |= LIBIO_FLAGS_CLOSE_ON_EXEC; 40030ab0: 10 80 00 0c b 40030ae0 40030ab4: 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 ); 40030ab8: 7f ff 60 17 call 40008b14 40030abc: 01 00 00 00 nop 40030ac0: 10 80 00 14 b 40030b10 40030ac4: b0 10 00 08 mov %o0, %i0 break; case F_SETFL: flags = rtems_libio_fcntl_flags( va_arg( ap, int ) ); 40030ac8: 7f ff 60 06 call 40008ae0 40030acc: 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); 40030ad0: c2 07 60 10 ld [ %i5 + 0x10 ], %g1 40030ad4: 90 0a 22 01 and %o0, 0x201, %o0 40030ad8: 82 08 7d fe and %g1, -514, %g1 40030adc: 90 12 00 01 or %o0, %g1, %o0 40030ae0: d0 27 60 10 st %o0, [ %i5 + 0x10 ] { rtems_libio_t *iop; int fd2; int flags; int mask; int ret = 0; 40030ae4: 10 80 00 0e b 40030b1c 40030ae8: b0 10 20 00 clr %i0 errno = ENOTSUP; ret = -1; break; case F_GETOWN: /* for sockets. */ errno = ENOTSUP; 40030aec: 7f ff be 14 call 4002033c <__errno> 40030af0: 01 00 00 00 nop 40030af4: 10 80 00 05 b 40030b08 40030af8: 82 10 20 86 mov 0x86, %g1 ! 86 ret = -1; break; default: errno = EINVAL; 40030afc: 7f ff be 10 call 4002033c <__errno> 40030b00: 01 00 00 00 nop 40030b04: 82 10 20 16 mov 0x16, %g1 ! 16 40030b08: 10 80 00 10 b 40030b48 40030b0c: 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) { 40030b10: 80 a6 20 00 cmp %i0, 0 40030b14: 06 80 00 0e bl 40030b4c <== NEVER TAKEN 40030b18: 01 00 00 00 nop int err = (*iop->pathinfo.handlers->fcntl_h)( iop, cmd ); 40030b1c: c2 07 60 24 ld [ %i5 + 0x24 ], %g1 40030b20: 90 10 00 1d mov %i5, %o0 40030b24: c2 00 60 28 ld [ %g1 + 0x28 ], %g1 40030b28: 9f c0 40 00 call %g1 40030b2c: 92 10 00 19 mov %i1, %o1 if (err) { 40030b30: ba 92 20 00 orcc %o0, 0, %i5 40030b34: 02 80 00 06 be 40030b4c <== ALWAYS TAKEN 40030b38: 01 00 00 00 nop errno = err; 40030b3c: 7f ff be 00 call 4002033c <__errno> <== NOT EXECUTED 40030b40: 01 00 00 00 nop <== NOT EXECUTED 40030b44: 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); 40030b48: b0 10 3f ff mov -1, %i0 va_list ap; va_start( ap, cmd ); ret = vfcntl(fd,cmd,ap); va_end(ap); return ret; } 40030b4c: 81 c7 e0 08 ret 40030b50: 81 e8 00 00 restore =============================================================================== 4000498c : #include int fdatasync( int fd ) { 4000498c: 9d e3 bf a0 save %sp, -96, %sp rtems_libio_t *iop; rtems_libio_check_fd( fd ); 40004990: 03 10 00 58 sethi %hi(0x40016000), %g1 40004994: c2 00 63 04 ld [ %g1 + 0x304 ], %g1 ! 40016304 40004998: 80 a6 00 01 cmp %i0, %g1 4000499c: 1a 80 00 0d bcc 400049d0 400049a0: 83 2e 20 03 sll %i0, 3, %g1 iop = rtems_libio_iop( fd ); 400049a4: b1 2e 20 06 sll %i0, 6, %i0 400049a8: b0 26 00 01 sub %i0, %g1, %i0 400049ac: 03 10 00 5b sethi %hi(0x40016c00), %g1 400049b0: d0 00 61 d0 ld [ %g1 + 0x1d0 ], %o0 ! 40016dd0 400049b4: 90 02 00 18 add %o0, %i0, %o0 rtems_libio_check_is_open(iop); 400049b8: c2 02 20 10 ld [ %o0 + 0x10 ], %g1 400049bc: 80 88 61 00 btst 0x100, %g1 400049c0: 02 80 00 04 be 400049d0 <== NEVER TAKEN 400049c4: 80 88 60 04 btst 4, %g1 rtems_libio_check_permissions_with_error( iop, LIBIO_FLAGS_WRITE, EBADF ); 400049c8: 32 80 00 08 bne,a 400049e8 400049cc: c2 02 20 24 ld [ %o0 + 0x24 ], %g1 400049d0: 40 00 2b d7 call 4000f92c <__errno> 400049d4: b0 10 3f ff mov -1, %i0 400049d8: 82 10 20 09 mov 9, %g1 400049dc: c2 22 00 00 st %g1, [ %o0 ] 400049e0: 81 c7 e0 08 ret 400049e4: 81 e8 00 00 restore /* * Now process the fdatasync(). */ return (*iop->pathinfo.handlers->fdatasync_h)( iop ); 400049e8: c2 00 60 24 ld [ %g1 + 0x24 ], %g1 400049ec: 9f c0 40 00 call %g1 400049f0: 01 00 00 00 nop } 400049f4: 81 c7 e0 08 ret 400049f8: 91 e8 00 08 restore %g0, %o0, %o0 =============================================================================== 4000de80 : int fifo_open( pipe_control_t **pipep, rtems_libio_t *iop ) { 4000de80: 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) { 4000de84: 3b 10 00 89 sethi %hi(0x40022400), %i5 4000de88: c2 07 60 40 ld [ %i5 + 0x40 ], %g1 ! 40022440 int fifo_open( pipe_control_t **pipep, rtems_libio_t *iop ) { 4000de8c: b6 10 00 18 mov %i0, %i3 static int pipe_lock(void) { rtems_status_code sc = RTEMS_SUCCESSFUL; if (pipe_semaphore == RTEMS_ID_NONE) { 4000de90: 80 a0 60 00 cmp %g1, 0 4000de94: 02 80 00 0c be 4000dec4 4000de98: b8 17 60 40 or %i5, 0x40, %i4 rtems_libio_unlock(); } if (sc == RTEMS_SUCCESSFUL) { sc = rtems_semaphore_obtain(pipe_semaphore, RTEMS_WAIT, RTEMS_NO_TIMEOUT); 4000de9c: 03 10 00 89 sethi %hi(0x40022400), %g1 4000dea0: d0 00 60 40 ld [ %g1 + 0x40 ], %o0 ! 40022440 4000dea4: 92 10 20 00 clr %o1 4000dea8: 7f ff ed 5f call 40009424 4000deac: 94 10 20 00 clr %o2 } if (sc == RTEMS_SUCCESSFUL) { 4000deb0: 80 a2 20 00 cmp %o0, 0 4000deb4: 22 80 00 ee be,a 4000e26c <== ALWAYS TAKEN 4000deb8: fa 06 c0 00 ld [ %i3 ], %i5 return 0; } else { return -ENOMEM; 4000debc: 81 c7 e0 08 ret <== NOT EXECUTED 4000dec0: 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 ); 4000dec4: 03 10 00 89 sethi %hi(0x40022400), %g1 4000dec8: d0 00 63 2c ld [ %g1 + 0x32c ], %o0 ! 4002272c 4000decc: 92 10 20 00 clr %o1 4000ded0: 7f ff ed 55 call 40009424 4000ded4: 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) { 4000ded8: c2 07 60 40 ld [ %i5 + 0x40 ], %g1 4000dedc: 80 a0 60 00 cmp %g1, 0 4000dee0: 12 80 00 0a bne 4000df08 <== NEVER TAKEN 4000dee4: ba 10 20 00 clr %i5 sc = rtems_semaphore_create( 4000dee8: 11 14 12 54 sethi %hi(0x50495000), %o0 4000deec: 92 10 20 01 mov 1, %o1 4000def0: 90 12 20 45 or %o0, 0x45, %o0 4000def4: 94 10 20 54 mov 0x54, %o2 4000def8: 96 10 20 00 clr %o3 4000defc: 7f ff ec ad call 400091b0 4000df00: 98 10 00 1c mov %i4, %o4 4000df04: ba 10 00 08 mov %o0, %i5 } static inline void rtems_libio_unlock( void ) { rtems_semaphore_release( rtems_libio_semaphore ); 4000df08: 03 10 00 89 sethi %hi(0x40022400), %g1 4000df0c: 7f ff ed 8f call 40009548 4000df10: d0 00 63 2c ld [ %g1 + 0x32c ], %o0 ! 4002272c } rtems_libio_unlock(); } if (sc == RTEMS_SUCCESSFUL) { 4000df14: 80 a7 60 00 cmp %i5, 0 4000df18: 02 bf ff e1 be 4000de9c 4000df1c: b0 10 3f f4 mov -12, %i0 4000df20: 81 c7 e0 08 ret 4000df24: 81 e8 00 00 restore { static char c = 'a'; pipe_control_t *pipe; int err = -ENOMEM; pipe = malloc(sizeof(pipe_control_t)); 4000df28: 7f ff dd 04 call 40005338 4000df2c: 90 10 20 34 mov 0x34, %o0 if (pipe == NULL) 4000df30: ba 92 20 00 orcc %o0, 0, %i5 4000df34: 02 80 00 d2 be 4000e27c <== NEVER TAKEN 4000df38: 92 10 20 00 clr %o1 return err; memset(pipe, 0, sizeof(pipe_control_t)); 4000df3c: 40 00 0d 79 call 40011520 4000df40: 94 10 20 34 mov 0x34, %o2 pipe->Size = PIPE_BUF; 4000df44: 82 10 22 00 mov 0x200, %g1 pipe->Buffer = malloc(pipe->Size); 4000df48: 90 10 22 00 mov 0x200, %o0 4000df4c: 7f ff dc fb call 40005338 4000df50: c2 27 60 04 st %g1, [ %i5 + 4 ] if (! pipe->Buffer) 4000df54: 80 a2 20 00 cmp %o0, 0 4000df58: 02 80 00 2e be 4000e010 <== NEVER TAKEN 4000df5c: d0 27 40 00 st %o0, [ %i5 ] goto err_buf; err = -ENOMEM; if (rtems_barrier_create( rtems_build_name ('P', 'I', 'r', c), 4000df60: 39 10 00 87 sethi %hi(0x40021c00), %i4 4000df64: d0 4f 21 40 ldsb [ %i4 + 0x140 ], %o0 ! 40021d40 if (! pipe->Buffer) goto err_buf; err = -ENOMEM; if (rtems_barrier_create( 4000df68: 35 14 12 5c sethi %hi(0x50497000), %i2 4000df6c: 82 16 a2 00 or %i2, 0x200, %g1 ! 50497200 4000df70: 92 10 20 00 clr %o1 4000df74: 90 12 00 01 or %o0, %g1, %o0 4000df78: 94 10 20 00 clr %o2 4000df7c: 40 00 04 04 call 4000ef8c 4000df80: 96 07 60 2c add %i5, 0x2c, %o3 4000df84: 80 a2 20 00 cmp %o0, 0 4000df88: 12 80 00 20 bne 4000e008 4000df8c: d0 4f 21 40 ldsb [ %i4 + 0x140 ], %o0 rtems_build_name ('P', 'I', 'r', c), RTEMS_BARRIER_MANUAL_RELEASE, 0, &pipe->readBarrier) != RTEMS_SUCCESSFUL) goto err_rbar; if (rtems_barrier_create( 4000df90: 03 14 12 5d sethi %hi(0x50497400), %g1 4000df94: 82 10 63 00 or %g1, 0x300, %g1 ! 50497700 4000df98: 92 10 20 00 clr %o1 4000df9c: 90 12 00 01 or %o0, %g1, %o0 4000dfa0: 94 10 20 00 clr %o2 4000dfa4: 40 00 03 fa call 4000ef8c 4000dfa8: 96 07 60 30 add %i5, 0x30, %o3 4000dfac: 80 a2 20 00 cmp %o0, 0 4000dfb0: 12 80 00 14 bne 4000e000 4000dfb4: d0 4f 21 40 ldsb [ %i4 + 0x140 ], %o0 rtems_build_name ('P', 'I', 'w', c), RTEMS_BARRIER_MANUAL_RELEASE, 0, &pipe->writeBarrier) != RTEMS_SUCCESSFUL) goto err_wbar; if (rtems_semaphore_create( 4000dfb8: b4 16 a3 00 or %i2, 0x300, %i2 4000dfbc: 92 10 20 01 mov 1, %o1 4000dfc0: 90 12 00 1a or %o0, %i2, %o0 4000dfc4: 94 10 20 10 mov 0x10, %o2 4000dfc8: 96 10 20 00 clr %o3 4000dfcc: 7f ff ec 79 call 400091b0 4000dfd0: 98 07 60 28 add %i5, 0x28, %o4 4000dfd4: 80 a2 20 00 cmp %o0, 0 4000dfd8: 12 80 00 08 bne 4000dff8 4000dfdc: c2 0f 21 40 ldub [ %i4 + 0x140 ], %g1 #ifdef RTEMS_POSIX_API pipe_interruptible(pipe); #endif *pipep = pipe; if (c ++ == 'z') 4000dfe0: c4 4f 21 40 ldsb [ %i4 + 0x140 ], %g2 4000dfe4: 80 a0 a0 7a cmp %g2, 0x7a 4000dfe8: 12 80 00 a7 bne 4000e284 4000dfec: 82 00 60 01 inc %g1 c = 'a'; 4000dff0: 10 80 00 a5 b 4000e284 4000dff4: 82 10 20 61 mov 0x61, %g1 return 0; err_sem: rtems_barrier_delete(pipe->writeBarrier); 4000dff8: 40 00 04 14 call 4000f048 4000dffc: d0 07 60 30 ld [ %i5 + 0x30 ], %o0 err_wbar: rtems_barrier_delete(pipe->readBarrier); 4000e000: 40 00 04 12 call 4000f048 4000e004: d0 07 60 2c ld [ %i5 + 0x2c ], %o0 err_rbar: free(pipe->Buffer); 4000e008: 7f ff db bc call 40004ef8 4000e00c: d0 07 40 00 ld [ %i5 ], %o0 err_buf: free(pipe); 4000e010: 7f ff db ba call 40004ef8 4000e014: 90 10 00 1d mov %i5, %o0 if (err) goto out; } if (! PIPE_LOCK(pipe)) err = -EINTR; 4000e018: 10 80 00 13 b 4000e064 4000e01c: b0 10 3f f4 mov -12, %i0 err = pipe_alloc(&pipe); if (err) goto out; } if (! PIPE_LOCK(pipe)) 4000e020: d0 07 60 28 ld [ %i5 + 0x28 ], %o0 4000e024: 92 10 20 00 clr %o1 4000e028: 7f ff ec ff call 40009424 4000e02c: 94 10 20 00 clr %o2 err = -EINTR; if (*pipep == NULL) { 4000e030: c2 06 c0 00 ld [ %i3 ], %g1 err = pipe_alloc(&pipe); if (err) goto out; } if (! PIPE_LOCK(pipe)) 4000e034: 80 a0 00 08 cmp %g0, %o0 4000e038: b0 60 20 00 subx %g0, 0, %i0 err = -EINTR; if (*pipep == NULL) { 4000e03c: 80 a0 60 00 cmp %g1, 0 4000e040: 12 80 00 09 bne 4000e064 4000e044: b0 0e 3f fc and %i0, -4, %i0 if (err) 4000e048: 80 a6 20 00 cmp %i0, 0 4000e04c: 22 80 00 06 be,a 4000e064 <== ALWAYS TAKEN 4000e050: fa 26 c0 00 st %i5, [ %i3 ] pipe_free(pipe); 4000e054: 7f ff ff 53 call 4000dda0 <== NOT EXECUTED 4000e058: 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); 4000e05c: 10 80 00 03 b 4000e068 <== NOT EXECUTED 4000e060: 03 10 00 89 sethi %hi(0x40022400), %g1 <== NOT EXECUTED 4000e064: 03 10 00 89 sethi %hi(0x40022400), %g1 4000e068: 7f ff ed 38 call 40009548 4000e06c: d0 00 60 40 ld [ %g1 + 0x40 ], %o0 ! 40022440 pipe_control_t *pipe; unsigned int prevCounter; int err; err = pipe_new(pipep); if (err) 4000e070: 80 a6 20 00 cmp %i0, 0 4000e074: 12 80 00 86 bne 4000e28c 4000e078: 01 00 00 00 nop return err; pipe = *pipep; switch (LIBIO_ACCMODE(iop)) { 4000e07c: c2 06 60 10 ld [ %i1 + 0x10 ], %g1 4000e080: 82 08 60 06 and %g1, 6, %g1 4000e084: 80 a0 60 04 cmp %g1, 4 4000e088: 02 80 00 2e be 4000e140 4000e08c: fa 06 c0 00 ld [ %i3 ], %i5 4000e090: 80 a0 60 06 cmp %g1, 6 4000e094: 02 80 00 56 be 4000e1ec 4000e098: 80 a0 60 02 cmp %g1, 2 4000e09c: 12 80 00 6a bne 4000e244 <== NEVER TAKEN 4000e0a0: 01 00 00 00 nop case LIBIO_FLAGS_READ: pipe->readerCounter ++; 4000e0a4: c2 07 60 20 ld [ %i5 + 0x20 ], %g1 4000e0a8: 82 00 60 01 inc %g1 4000e0ac: c2 27 60 20 st %g1, [ %i5 + 0x20 ] if (pipe->Readers ++ == 0) 4000e0b0: c2 07 60 10 ld [ %i5 + 0x10 ], %g1 4000e0b4: 84 00 60 01 add %g1, 1, %g2 4000e0b8: 80 a0 60 00 cmp %g1, 0 4000e0bc: 12 80 00 05 bne 4000e0d0 <== NEVER TAKEN 4000e0c0: c4 27 60 10 st %g2, [ %i5 + 0x10 ] PIPE_WAKEUPWRITERS(pipe); 4000e0c4: d0 07 60 30 ld [ %i5 + 0x30 ], %o0 4000e0c8: 40 00 04 09 call 4000f0ec 4000e0cc: 92 07 bf fc add %fp, -4, %o1 if (pipe->Writers == 0) { 4000e0d0: c2 07 60 14 ld [ %i5 + 0x14 ], %g1 4000e0d4: 80 a0 60 00 cmp %g1, 0 4000e0d8: 12 80 00 5b bne 4000e244 4000e0dc: 01 00 00 00 nop /* Not an error */ if (LIBIO_NODELAY(iop)) 4000e0e0: c2 06 60 10 ld [ %i1 + 0x10 ], %g1 4000e0e4: 80 88 60 01 btst 1, %g1 4000e0e8: 12 80 00 57 bne 4000e244 4000e0ec: 01 00 00 00 nop break; prevCounter = pipe->writerCounter; 4000e0f0: f8 07 60 24 ld [ %i5 + 0x24 ], %i4 err = -EINTR; /* Wait until a writer opens the pipe */ do { PIPE_UNLOCK(pipe); 4000e0f4: 7f ff ed 15 call 40009548 4000e0f8: d0 07 60 28 ld [ %i5 + 0x28 ], %o0 if (! PIPE_READWAIT(pipe)) 4000e0fc: d0 07 60 2c ld [ %i5 + 0x2c ], %o0 4000e100: 40 00 04 11 call 4000f144 4000e104: 92 10 20 00 clr %o1 4000e108: 80 a2 20 00 cmp %o0, 0 4000e10c: 12 80 00 52 bne 4000e254 <== NEVER TAKEN 4000e110: 92 10 20 00 clr %o1 goto out_error; if (! PIPE_LOCK(pipe)) 4000e114: d0 07 60 28 ld [ %i5 + 0x28 ], %o0 4000e118: 7f ff ec c3 call 40009424 4000e11c: 94 10 20 00 clr %o2 4000e120: 80 a2 20 00 cmp %o0, 0 4000e124: 32 80 00 4d bne,a 4000e258 <== NEVER TAKEN 4000e128: b0 10 3f fc mov -4, %i0 <== NOT EXECUTED goto out_error; } while (prevCounter == pipe->writerCounter); 4000e12c: c2 07 60 24 ld [ %i5 + 0x24 ], %g1 4000e130: 80 a7 00 01 cmp %i4, %g1 4000e134: 02 bf ff f0 be 4000e0f4 <== NEVER TAKEN 4000e138: 01 00 00 00 nop 4000e13c: 30 80 00 42 b,a 4000e244 } break; case LIBIO_FLAGS_WRITE: pipe->writerCounter ++; 4000e140: c2 07 60 24 ld [ %i5 + 0x24 ], %g1 4000e144: 82 00 60 01 inc %g1 4000e148: c2 27 60 24 st %g1, [ %i5 + 0x24 ] if (pipe->Writers ++ == 0) 4000e14c: c2 07 60 14 ld [ %i5 + 0x14 ], %g1 4000e150: 84 00 60 01 add %g1, 1, %g2 4000e154: 80 a0 60 00 cmp %g1, 0 4000e158: 12 80 00 05 bne 4000e16c <== NEVER TAKEN 4000e15c: c4 27 60 14 st %g2, [ %i5 + 0x14 ] PIPE_WAKEUPREADERS(pipe); 4000e160: d0 07 60 2c ld [ %i5 + 0x2c ], %o0 4000e164: 40 00 03 e2 call 4000f0ec 4000e168: 92 07 bf fc add %fp, -4, %o1 if (pipe->Readers == 0 && LIBIO_NODELAY(iop)) { 4000e16c: c2 07 60 10 ld [ %i5 + 0x10 ], %g1 4000e170: 80 a0 60 00 cmp %g1, 0 4000e174: 12 80 00 34 bne 4000e244 4000e178: 01 00 00 00 nop 4000e17c: c2 06 60 10 ld [ %i1 + 0x10 ], %g1 4000e180: 80 88 60 01 btst 1, %g1 4000e184: 22 80 00 07 be,a 4000e1a0 4000e188: f8 07 60 20 ld [ %i5 + 0x20 ], %i4 PIPE_UNLOCK(pipe); 4000e18c: d0 07 60 28 ld [ %i5 + 0x28 ], %o0 4000e190: 7f ff ec ee call 40009548 4000e194: b0 10 3f fa mov -6, %i0 err = -ENXIO; goto out_error; 4000e198: 10 80 00 31 b 4000e25c 4000e19c: 90 10 00 1b mov %i3, %o0 if (pipe->Readers == 0) { prevCounter = pipe->readerCounter; err = -EINTR; do { PIPE_UNLOCK(pipe); 4000e1a0: 7f ff ec ea call 40009548 4000e1a4: d0 07 60 28 ld [ %i5 + 0x28 ], %o0 if (! PIPE_WRITEWAIT(pipe)) 4000e1a8: d0 07 60 30 ld [ %i5 + 0x30 ], %o0 4000e1ac: 40 00 03 e6 call 4000f144 4000e1b0: 92 10 20 00 clr %o1 4000e1b4: 80 a2 20 00 cmp %o0, 0 4000e1b8: 12 80 00 27 bne 4000e254 <== NEVER TAKEN 4000e1bc: 92 10 20 00 clr %o1 goto out_error; if (! PIPE_LOCK(pipe)) 4000e1c0: d0 07 60 28 ld [ %i5 + 0x28 ], %o0 4000e1c4: 7f ff ec 98 call 40009424 4000e1c8: 94 10 20 00 clr %o2 4000e1cc: 80 a2 20 00 cmp %o0, 0 4000e1d0: 32 80 00 22 bne,a 4000e258 <== NEVER TAKEN 4000e1d4: b0 10 3f fc mov -4, %i0 <== NOT EXECUTED goto out_error; } while (prevCounter == pipe->readerCounter); 4000e1d8: c2 07 60 20 ld [ %i5 + 0x20 ], %g1 4000e1dc: 80 a7 00 01 cmp %i4, %g1 4000e1e0: 02 bf ff f0 be 4000e1a0 <== NEVER TAKEN 4000e1e4: 01 00 00 00 nop 4000e1e8: 30 80 00 17 b,a 4000e244 } break; case LIBIO_FLAGS_READ_WRITE: pipe->readerCounter ++; 4000e1ec: c2 07 60 20 ld [ %i5 + 0x20 ], %g1 4000e1f0: 82 00 60 01 inc %g1 4000e1f4: c2 27 60 20 st %g1, [ %i5 + 0x20 ] if (pipe->Readers ++ == 0) 4000e1f8: c2 07 60 10 ld [ %i5 + 0x10 ], %g1 4000e1fc: 84 00 60 01 add %g1, 1, %g2 4000e200: 80 a0 60 00 cmp %g1, 0 4000e204: 12 80 00 05 bne 4000e218 <== NEVER TAKEN 4000e208: c4 27 60 10 st %g2, [ %i5 + 0x10 ] PIPE_WAKEUPWRITERS(pipe); 4000e20c: d0 07 60 30 ld [ %i5 + 0x30 ], %o0 4000e210: 40 00 03 b7 call 4000f0ec 4000e214: 92 07 bf fc add %fp, -4, %o1 pipe->writerCounter ++; 4000e218: c2 07 60 24 ld [ %i5 + 0x24 ], %g1 4000e21c: 82 00 60 01 inc %g1 4000e220: c2 27 60 24 st %g1, [ %i5 + 0x24 ] if (pipe->Writers ++ == 0) 4000e224: c2 07 60 14 ld [ %i5 + 0x14 ], %g1 4000e228: 84 00 60 01 add %g1, 1, %g2 4000e22c: 80 a0 60 00 cmp %g1, 0 4000e230: 12 80 00 05 bne 4000e244 <== NEVER TAKEN 4000e234: c4 27 60 14 st %g2, [ %i5 + 0x14 ] PIPE_WAKEUPREADERS(pipe); 4000e238: d0 07 60 2c ld [ %i5 + 0x2c ], %o0 4000e23c: 40 00 03 ac call 4000f0ec 4000e240: 92 07 bf fc add %fp, -4, %o1 break; } PIPE_UNLOCK(pipe); 4000e244: 7f ff ec c1 call 40009548 4000e248: d0 07 60 28 ld [ %i5 + 0x28 ], %o0 return 0; 4000e24c: 81 c7 e0 08 ret 4000e250: 81 e8 00 00 restore /* Not an error */ if (LIBIO_NODELAY(iop)) break; prevCounter = pipe->writerCounter; err = -EINTR; 4000e254: b0 10 3f fc mov -4, %i0 <== NOT EXECUTED PIPE_UNLOCK(pipe); return 0; out_error: pipe_release(pipep, iop); 4000e258: 90 10 00 1b mov %i3, %o0 <== NOT EXECUTED 4000e25c: 7f ff fe dc call 4000ddcc 4000e260: 92 10 00 19 mov %i1, %o1 return err; 4000e264: 81 c7 e0 08 ret 4000e268: 81 e8 00 00 restore err = pipe_lock(); if (err) return err; pipe = *pipep; if (pipe == NULL) { 4000e26c: 80 a7 60 00 cmp %i5, 0 4000e270: 32 bf ff 6d bne,a 4000e024 4000e274: d0 07 60 28 ld [ %i5 + 0x28 ], %o0 4000e278: 30 bf ff 2c b,a 4000df28 if (err) goto out; } if (! PIPE_LOCK(pipe)) err = -EINTR; 4000e27c: 10 bf ff 7a b 4000e064 <== NOT EXECUTED 4000e280: b0 10 3f f4 mov -12, %i0 <== NOT EXECUTED #ifdef RTEMS_POSIX_API pipe_interruptible(pipe); #endif *pipep = pipe; if (c ++ == 'z') 4000e284: 10 bf ff 67 b 4000e020 4000e288: c2 2f 21 40 stb %g1, [ %i4 + 0x140 ] return 0; out_error: pipe_release(pipep, iop); return err; } 4000e28c: 81 c7 e0 08 ret 4000e290: 81 e8 00 00 restore =============================================================================== 4000a1f4 : */ long fpathconf( int fd, int name ) { 4000a1f4: 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); 4000a1f8: 03 10 00 46 sethi %hi(0x40011800), %g1 4000a1fc: c2 00 63 98 ld [ %g1 + 0x398 ], %g1 ! 40011b98 4000a200: 80 a6 00 01 cmp %i0, %g1 4000a204: 2a 80 00 03 bcs,a 4000a210 4000a208: 83 2e 20 03 sll %i0, 3, %g1 4000a20c: 30 80 00 0a b,a 4000a234 iop = rtems_libio_iop(fd); 4000a210: b1 2e 20 06 sll %i0, 6, %i0 4000a214: b0 26 00 01 sub %i0, %g1, %i0 4000a218: 03 10 00 49 sethi %hi(0x40012400), %g1 4000a21c: c2 00 60 dc ld [ %g1 + 0xdc ], %g1 ! 400124dc 4000a220: b0 00 40 18 add %g1, %i0, %i0 rtems_libio_check_is_open(iop); 4000a224: c2 06 20 10 ld [ %i0 + 0x10 ], %g1 4000a228: 80 88 61 00 btst 0x100, %g1 4000a22c: 32 80 00 06 bne,a 4000a244 <== ALWAYS TAKEN 4000a230: c2 06 20 28 ld [ %i0 + 0x28 ], %g1 4000a234: 40 00 05 76 call 4000b80c <__errno> 4000a238: 01 00 00 00 nop 4000a23c: 10 80 00 32 b 4000a304 4000a240: 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 ) { 4000a244: 80 a6 60 0b cmp %i1, 0xb 4000a248: 18 80 00 2c bgu 4000a2f8 4000a24c: c2 00 60 2c ld [ %g1 + 0x2c ], %g1 4000a250: b3 2e 60 02 sll %i1, 2, %i1 4000a254: 05 10 00 28 sethi %hi(0x4000a000), %g2 4000a258: 84 10 a1 c4 or %g2, 0x1c4, %g2 ! 4000a1c4 <_close_r+0x10> 4000a25c: c4 00 80 19 ld [ %g2 + %i1 ], %g2 4000a260: 81 c0 80 00 jmp %g2 4000a264: 01 00 00 00 nop case _PC_LINK_MAX: return_value = the_limits->link_max; 4000a268: f0 00 40 00 ld [ %g1 ], %i0 break; 4000a26c: 81 c7 e0 08 ret 4000a270: 81 e8 00 00 restore case _PC_MAX_CANON: return_value = the_limits->max_canon; 4000a274: f0 00 60 04 ld [ %g1 + 4 ], %i0 break; 4000a278: 81 c7 e0 08 ret 4000a27c: 81 e8 00 00 restore case _PC_MAX_INPUT: return_value = the_limits->max_input; 4000a280: f0 00 60 08 ld [ %g1 + 8 ], %i0 break; 4000a284: 81 c7 e0 08 ret 4000a288: 81 e8 00 00 restore case _PC_NAME_MAX: return_value = the_limits->name_max; 4000a28c: f0 00 60 0c ld [ %g1 + 0xc ], %i0 break; 4000a290: 81 c7 e0 08 ret 4000a294: 81 e8 00 00 restore case _PC_PATH_MAX: return_value = the_limits->path_max; 4000a298: f0 00 60 10 ld [ %g1 + 0x10 ], %i0 break; 4000a29c: 81 c7 e0 08 ret 4000a2a0: 81 e8 00 00 restore case _PC_PIPE_BUF: return_value = the_limits->pipe_buf; 4000a2a4: f0 00 60 14 ld [ %g1 + 0x14 ], %i0 break; 4000a2a8: 81 c7 e0 08 ret 4000a2ac: 81 e8 00 00 restore case _PC_CHOWN_RESTRICTED: return_value = the_limits->posix_chown_restrictions; 4000a2b0: f0 00 60 1c ld [ %g1 + 0x1c ], %i0 break; 4000a2b4: 81 c7 e0 08 ret 4000a2b8: 81 e8 00 00 restore case _PC_NO_TRUNC: return_value = the_limits->posix_no_trunc; 4000a2bc: f0 00 60 20 ld [ %g1 + 0x20 ], %i0 break; 4000a2c0: 81 c7 e0 08 ret 4000a2c4: 81 e8 00 00 restore case _PC_VDISABLE: return_value = the_limits->posix_vdisable; 4000a2c8: f0 00 60 2c ld [ %g1 + 0x2c ], %i0 break; 4000a2cc: 81 c7 e0 08 ret 4000a2d0: 81 e8 00 00 restore case _PC_ASYNC_IO: return_value = the_limits->posix_async_io; 4000a2d4: f0 00 60 18 ld [ %g1 + 0x18 ], %i0 break; 4000a2d8: 81 c7 e0 08 ret 4000a2dc: 81 e8 00 00 restore case _PC_PRIO_IO: return_value = the_limits->posix_prio_io; 4000a2e0: f0 00 60 24 ld [ %g1 + 0x24 ], %i0 break; 4000a2e4: 81 c7 e0 08 ret 4000a2e8: 81 e8 00 00 restore case _PC_SYNC_IO: return_value = the_limits->posix_sync_io; 4000a2ec: f0 00 60 28 ld [ %g1 + 0x28 ], %i0 break; 4000a2f0: 81 c7 e0 08 ret 4000a2f4: 81 e8 00 00 restore default: rtems_set_errno_and_return_minus_one( EINVAL ); 4000a2f8: 40 00 05 45 call 4000b80c <__errno> 4000a2fc: 01 00 00 00 nop 4000a300: 82 10 20 16 mov 0x16, %g1 ! 16 4000a304: c2 22 00 00 st %g1, [ %o0 ] break; } return return_value; } 4000a308: 81 c7 e0 08 ret 4000a30c: 91 e8 3f ff restore %g0, -1, %o0 =============================================================================== 40004024 : #include void free( void *ptr ) { 40004024: 9d e3 bf a0 save %sp, -96, %sp MSBUMP(free_calls, 1); 40004028: 03 10 00 77 sethi %hi(0x4001dc00), %g1 4000402c: 82 10 61 b0 or %g1, 0x1b0, %g1 ! 4001ddb0 40004030: c4 00 60 0c ld [ %g1 + 0xc ], %g2 #include void free( void *ptr ) { 40004034: b2 10 00 18 mov %i0, %i1 MSBUMP(free_calls, 1); 40004038: 84 00 a0 01 inc %g2 if ( !ptr ) 4000403c: 80 a6 20 00 cmp %i0, 0 40004040: 02 80 00 21 be 400040c4 40004044: 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()) && 40004048: 03 10 00 78 sethi %hi(0x4001e000), %g1 4000404c: c2 00 61 2c ld [ %g1 + 0x12c ], %g1 ! 4001e12c <_System_state_Current> 40004050: 80 a0 60 03 cmp %g1, 3 40004054: 12 80 00 09 bne 40004078 <== NEVER TAKEN 40004058: 03 10 00 76 sethi %hi(0x4001d800), %g1 !malloc_is_system_state_OK() ) { 4000405c: 40 00 00 78 call 4000423c 40004060: 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()) && 40004064: 80 8a 20 ff btst 0xff, %o0 40004068: 12 80 00 04 bne 40004078 4000406c: 03 10 00 76 sethi %hi(0x4001d800), %g1 !malloc_is_system_state_OK() ) { malloc_deferred_free(ptr); 40004070: 40 00 00 8c call 400042a0 40004074: 81 e8 00 00 restore } /* * If configured, update the statistics */ if ( rtems_malloc_statistics_helpers ) 40004078: c2 00 61 14 ld [ %g1 + 0x114 ], %g1 4000407c: 80 a0 60 00 cmp %g1, 0 40004080: 02 80 00 06 be 40004098 40004084: 3b 10 00 74 sethi %hi(0x4001d000), %i5 (*rtems_malloc_statistics_helpers->at_free)(ptr); 40004088: c2 00 60 08 ld [ %g1 + 8 ], %g1 4000408c: 9f c0 40 00 call %g1 40004090: 90 10 00 19 mov %i1, %o0 if ( !_Protected_heap_Free( RTEMS_Malloc_Heap, ptr ) ) { 40004094: 3b 10 00 74 sethi %hi(0x4001d000), %i5 40004098: d0 07 62 60 ld [ %i5 + 0x260 ], %o0 ! 4001d260 4000409c: 40 00 16 f9 call 40009c80 <_Protected_heap_Free> 400040a0: 92 10 00 19 mov %i1, %o1 400040a4: 80 8a 20 ff btst 0xff, %o0 400040a8: 12 80 00 07 bne 400040c4 400040ac: c2 07 62 60 ld [ %i5 + 0x260 ], %g1 printk( "Program heap: free of bad pointer %p -- range %p - %p \n", 400040b0: 31 10 00 6f sethi %hi(0x4001bc00), %i0 400040b4: f4 00 60 18 ld [ %g1 + 0x18 ], %i2 400040b8: f6 00 60 1c ld [ %g1 + 0x1c ], %i3 400040bc: 40 00 03 68 call 40004e5c 400040c0: 91 ee 21 d8 restore %i0, 0x1d8, %o0 400040c4: 81 c7 e0 08 ret 400040c8: 81 e8 00 00 restore =============================================================================== 4001abd4 : int fstat( int fd, struct stat *sbuf ) { 4001abd4: 9d e3 bf a0 save %sp, -96, %sp rtems_libio_t *iop; /* * Check to see if we were passed a valid pointer. */ if ( !sbuf ) 4001abd8: 80 a6 60 00 cmp %i1, 0 4001abdc: 32 80 00 06 bne,a 4001abf4 <== ALWAYS TAKEN 4001abe0: 03 10 00 74 sethi %hi(0x4001d000), %g1 rtems_set_errno_and_return_minus_one( EFAULT ); 4001abe4: 7f ff d0 58 call 4000ed44 <__errno> <== NOT EXECUTED 4001abe8: 01 00 00 00 nop <== NOT EXECUTED 4001abec: 10 80 00 12 b 4001ac34 <== NOT EXECUTED 4001abf0: 82 10 20 0e mov 0xe, %g1 ! e <== NOT EXECUTED /* * Now process the stat() request. */ iop = rtems_libio_iop( fd ); 4001abf4: c2 00 62 a4 ld [ %g1 + 0x2a4 ], %g1 4001abf8: 80 a6 00 01 cmp %i0, %g1 4001abfc: 1a 80 00 0b bcc 4001ac28 4001ac00: 83 2e 20 03 sll %i0, 3, %g1 4001ac04: b1 2e 20 06 sll %i0, 6, %i0 4001ac08: b0 26 00 01 sub %i0, %g1, %i0 4001ac0c: 03 10 00 77 sethi %hi(0x4001dc00), %g1 4001ac10: c2 00 61 a4 ld [ %g1 + 0x1a4 ], %g1 ! 4001dda4 4001ac14: b0 00 40 18 add %g1, %i0, %i0 rtems_libio_check_fd( fd ); rtems_libio_check_is_open(iop); 4001ac18: c2 06 20 10 ld [ %i0 + 0x10 ], %g1 4001ac1c: 80 88 61 00 btst 0x100, %g1 4001ac20: 12 80 00 08 bne 4001ac40 4001ac24: 94 10 20 48 mov 0x48, %o2 /* * Now process the stat() request. */ iop = rtems_libio_iop( fd ); rtems_libio_check_fd( fd ); 4001ac28: 7f ff d0 47 call 4000ed44 <__errno> 4001ac2c: 01 00 00 00 nop 4001ac30: 82 10 20 09 mov 9, %g1 ! 9 4001ac34: c2 22 00 00 st %g1, [ %o0 ] 4001ac38: 81 c7 e0 08 ret 4001ac3c: 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) ); 4001ac40: 90 10 00 19 mov %i1, %o0 4001ac44: 7f ff d2 ce call 4000f77c 4001ac48: 92 10 20 00 clr %o1 return (*iop->pathinfo.handlers->fstat_h)( &iop->pathinfo, sbuf ); 4001ac4c: c2 06 20 24 ld [ %i0 + 0x24 ], %g1 4001ac50: 90 06 20 14 add %i0, 0x14, %o0 4001ac54: c2 00 60 18 ld [ %g1 + 0x18 ], %g1 4001ac58: 9f c0 40 00 call %g1 4001ac5c: 92 10 00 19 mov %i1, %o1 } 4001ac60: 81 c7 e0 08 ret 4001ac64: 91 e8 00 08 restore %g0, %o0, %o0 =============================================================================== 40004074 : 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) { 40004074: 03 10 00 68 sethi %hi(0x4001a000), %g1 40004078: c2 00 63 10 ld [ %g1 + 0x310 ], %g1 ! 4001a310 4000407c: 80 a2 00 01 cmp %o0, %g1 40004080: 1a 80 00 1e bcc 400040f8 <== NEVER TAKEN 40004084: 03 10 00 68 sethi %hi(0x4001a000), %g1 40004088: c2 00 63 14 ld [ %g1 + 0x314 ], %g1 ! 4001a314 4000408c: 80 a0 60 00 cmp %g1, 0 40004090: 22 80 00 1b be,a 400040fc <== NEVER TAKEN 40004094: 90 10 20 00 clr %o0 <== NOT EXECUTED rtems_disk_device_table *dtab = disktab + major; 40004098: 91 2a 20 03 sll %o0, 3, %o0 4000409c: 84 00 40 08 add %g1, %o0, %g2 if (minor < dtab->size && dtab->minor != NULL) { 400040a0: c4 00 a0 04 ld [ %g2 + 4 ], %g2 400040a4: 80 a2 40 02 cmp %o1, %g2 400040a8: 3a 80 00 15 bcc,a 400040fc <== NEVER TAKEN 400040ac: 90 10 20 00 clr %o0 <== NOT EXECUTED 400040b0: c2 00 40 08 ld [ %g1 + %o0 ], %g1 400040b4: 80 a0 60 00 cmp %g1, 0 400040b8: 02 80 00 10 be 400040f8 <== NEVER TAKEN 400040bc: 93 2a 60 02 sll %o1, 2, %o1 rtems_disk_device *dd = dtab->minor [minor]; if (dd != NULL && !lookup_only) { 400040c0: 80 a2 a0 01 cmp %o2, 1 400040c4: 02 80 00 0e be 400040fc 400040c8: d0 00 40 09 ld [ %g1 + %o1 ], %o0 400040cc: 80 a2 20 00 cmp %o0, 0 400040d0: 02 80 00 0b be 400040fc <== NEVER TAKEN 400040d4: 01 00 00 00 nop if (!dd->deleted) { 400040d8: c2 0a 20 40 ldub [ %o0 + 0x40 ], %g1 400040dc: 80 a0 60 00 cmp %g1, 0 400040e0: 32 80 00 07 bne,a 400040fc 400040e4: 90 10 20 00 clr %o0 ++dd->uses; 400040e8: c2 02 20 14 ld [ %o0 + 0x14 ], %g1 400040ec: 82 00 60 01 inc %g1 400040f0: 81 c3 e0 08 retl 400040f4: c2 22 20 14 st %g1, [ %o0 + 0x14 ] return dd; } } return NULL; 400040f8: 90 10 20 00 clr %o0 <== NOT EXECUTED } 400040fc: 81 c3 e0 08 retl =============================================================================== 400052d8 : * 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, 400052d8: 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); 400052dc: 40 00 04 fd call 400066d0 400052e0: 90 10 22 04 mov 0x204, %o0 if (s == NULL) { return RTEMS_NO_MEMORY; 400052e4: 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) 400052e8: 80 a2 20 00 cmp %o0, 0 400052ec: 02 80 00 0f be 40005328 <== NEVER TAKEN 400052f0: ba 10 00 08 mov %o0, %i5 { return RTEMS_NO_MEMORY; } n = read(fd, s->data, RTEMS_IDE_SECTOR_SIZE); 400052f4: 90 10 00 18 mov %i0, %o0 400052f8: 92 07 60 04 add %i5, 4, %o1 400052fc: 40 00 07 97 call 40007158 40005300: 94 10 22 00 mov 0x200, %o2 if (n != RTEMS_IDE_SECTOR_SIZE) 40005304: 80 a2 22 00 cmp %o0, 0x200 40005308: 22 80 00 06 be,a 40005320 <== ALWAYS TAKEN 4000530c: f2 27 40 00 st %i1, [ %i5 ] { free(s); 40005310: 40 00 03 5f call 4000608c <== NOT EXECUTED 40005314: 90 10 00 1d mov %i5, %o0 <== NOT EXECUTED return RTEMS_IO_ERROR; 40005318: 10 80 00 04 b 40005328 <== NOT EXECUTED 4000531c: 82 10 20 1b mov 0x1b, %g1 <== NOT EXECUTED } s->sector_num = sector_num; *sector = s; 40005320: fa 26 80 00 st %i5, [ %i2 ] return RTEMS_SUCCESSFUL; 40005324: 82 10 20 00 clr %g1 } 40005328: 81 c7 e0 08 ret 4000532c: 91 e8 00 01 restore %g0, %g1, %o0 =============================================================================== 40030b7c : int getdents( int dd_fd, char *dd_buf, int dd_len ) { 40030b7c: 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 ); 40030b80: 03 10 00 d9 sethi %hi(0x40036400), %g1 40030b84: c2 00 60 3c ld [ %g1 + 0x3c ], %g1 ! 4003643c 40030b88: 80 a6 00 01 cmp %i0, %g1 40030b8c: 1a 80 00 08 bcc 40030bac <== NEVER TAKEN 40030b90: ba 10 20 00 clr %i5 40030b94: 83 2e 20 03 sll %i0, 3, %g1 40030b98: b1 2e 20 06 sll %i0, 6, %i0 40030b9c: b0 26 00 01 sub %i0, %g1, %i0 40030ba0: 03 10 01 1c sethi %hi(0x40047000), %g1 40030ba4: fa 00 60 9c ld [ %g1 + 0x9c ], %i5 ! 4004709c 40030ba8: ba 07 40 18 add %i5, %i0, %i5 /* * Make sure we are working on a directory */ type = rtems_filesystem_node_type( &iop->pathinfo ); 40030bac: 7f ff 66 a8 call 4000a64c 40030bb0: 90 07 60 14 add %i5, 0x14, %o0 if ( type != RTEMS_FILESYSTEM_DIRECTORY ) 40030bb4: 80 a2 20 00 cmp %o0, 0 40030bb8: 22 80 00 08 be,a 40030bd8 40030bbc: c2 07 60 24 ld [ %i5 + 0x24 ], %g1 rtems_set_errno_and_return_minus_one( ENOTDIR ); 40030bc0: 7f ff bd df call 4002033c <__errno> 40030bc4: b0 10 3f ff mov -1, %i0 40030bc8: 82 10 20 14 mov 0x14, %g1 40030bcc: c2 22 00 00 st %g1, [ %o0 ] 40030bd0: 81 c7 e0 08 ret 40030bd4: 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 ); 40030bd8: 90 10 00 1d mov %i5, %o0 40030bdc: c2 00 60 08 ld [ %g1 + 8 ], %g1 40030be0: 92 10 00 19 mov %i1, %o1 40030be4: 9f c0 40 00 call %g1 40030be8: 94 10 00 1a mov %i2, %o2 } 40030bec: 81 c7 e0 08 ret 40030bf0: 91 e8 00 08 restore %g0, %o0, %o0 =============================================================================== 400040cc : */ int gettimeofday( struct timeval *tp, void * __tz __attribute__((unused)) ) { 400040cc: 9d e3 bf 98 save %sp, -104, %sp /* struct timezone* tzp = (struct timezone*) __tz; */ if ( !tp ) 400040d0: 80 a6 20 00 cmp %i0, 0 400040d4: 12 80 00 08 bne 400040f4 <== ALWAYS TAKEN 400040d8: 90 07 bf f8 add %fp, -8, %o0 rtems_set_errno_and_return_minus_one( EFAULT ); 400040dc: 40 00 2b 1a call 4000ed44 <__errno> <== NOT EXECUTED 400040e0: b0 10 3f ff mov -1, %i0 <== NOT EXECUTED 400040e4: 82 10 20 0e mov 0xe, %g1 <== NOT EXECUTED 400040e8: c2 22 00 00 st %g1, [ %o0 ] <== NOT EXECUTED 400040ec: 81 c7 e0 08 ret <== NOT EXECUTED 400040f0: 81 e8 00 00 restore <== NOT EXECUTED ) { Timestamp_Control snapshot_as_timestamp; Timestamp_Control *snapshot_as_timestamp_ptr; snapshot_as_timestamp_ptr = 400040f4: 13 10 00 77 sethi %hi(0x4001dc00), %o1 400040f8: 40 00 13 7a call 40008ee0 <_TOD_Get_with_nanoseconds> 400040fc: 92 12 62 78 or %o1, 0x278, %o1 ! 4001de78 <_TOD> struct timeval *tp, struct timezone *tzp ) { return gettimeofday( tp, tzp ); } 40004100: f8 1a 00 00 ldd [ %o0 ], %i4 static inline void _Timestamp64_implementation_To_timeval( const Timestamp64_Control *_timestamp, struct timeval *_timeval ) { _timeval->tv_sec = (time_t) (*_timestamp / 1000000000U); 40004104: 94 10 20 00 clr %o2 40004108: 90 10 00 1c mov %i4, %o0 4000410c: 92 10 00 1d mov %i5, %o1 40004110: 17 0e e6 b2 sethi %hi(0x3b9ac800), %o3 40004114: 40 00 50 d3 call 40018460 <__divdi3> 40004118: 96 12 e2 00 or %o3, 0x200, %o3 ! 3b9aca00 _timeval->tv_usec = (suseconds_t) ((*_timestamp % 1000000000U) / 1000U); 4000411c: 90 10 00 1c mov %i4, %o0 static inline void _Timestamp64_implementation_To_timeval( const Timestamp64_Control *_timestamp, struct timeval *_timeval ) { _timeval->tv_sec = (time_t) (*_timestamp / 1000000000U); 40004120: d2 26 00 00 st %o1, [ %i0 ] _timeval->tv_usec = (suseconds_t) ((*_timestamp % 1000000000U) / 1000U); 40004124: 94 10 20 00 clr %o2 40004128: 92 10 00 1d mov %i5, %o1 4000412c: 17 0e e6 b2 sethi %hi(0x3b9ac800), %o3 40004130: 40 00 51 b7 call 4001880c <__moddi3> 40004134: 96 12 e2 00 or %o3, 0x200, %o3 ! 3b9aca00 40004138: 94 10 20 00 clr %o2 4000413c: 40 00 50 c9 call 40018460 <__divdi3> 40004140: 96 10 23 e8 mov 0x3e8, %o3 40004144: d2 26 20 04 st %o1, [ %i0 + 4 ] * with Eric Norum, this is how GNU/Linux, Solaris, and MacOS X * do it. This puts us in good company. */ return 0; } 40004148: 81 c7 e0 08 ret 4000414c: 91 e8 20 00 restore %g0, 0, %o0 =============================================================================== 40023fa0 : /** * Initialize useable but dummy databases */ void init_etc_passwd_group(void) { 40023fa0: 9d e3 bf a0 save %sp, -96, %sp FILE *fp; static char etc_passwd_initted = 0; if (etc_passwd_initted) 40023fa4: 03 10 01 89 sethi %hi(0x40062400), %g1 40023fa8: c4 48 61 90 ldsb [ %g1 + 0x190 ], %g2 ! 40062590 40023fac: 80 a0 a0 00 cmp %g2, 0 40023fb0: 12 80 00 2f bne 4002406c 40023fb4: 84 10 20 01 mov 1, %g2 return; etc_passwd_initted = 1; mkdir("/etc", 0777); 40023fb8: 92 10 21 ff mov 0x1ff, %o1 FILE *fp; static char etc_passwd_initted = 0; if (etc_passwd_initted) return; etc_passwd_initted = 1; 40023fbc: c4 28 61 90 stb %g2, [ %g1 + 0x190 ] mkdir("/etc", 0777); 40023fc0: 11 10 01 67 sethi %hi(0x40059c00), %o0 40023fc4: 7f ff 7f f2 call 40003f8c 40023fc8: 90 12 20 00 mov %o0, %o0 ! 40059c00 /* * Initialize /etc/passwd */ if ((fp = fopen("/etc/passwd", "r")) != NULL) { 40023fcc: 3b 10 01 67 sethi %hi(0x40059c00), %i5 40023fd0: 13 10 01 78 sethi %hi(0x4005e000), %o1 40023fd4: 90 17 60 08 or %i5, 8, %o0 40023fd8: 40 00 4c 15 call 4003702c 40023fdc: 92 12 63 18 or %o1, 0x318, %o1 40023fe0: 80 a2 20 00 cmp %o0, 0 40023fe4: 22 80 00 03 be,a 40023ff0 40023fe8: 90 17 60 08 or %i5, 8, %o0 40023fec: 30 80 00 0b b,a 40024018 fclose(fp); } else if ((fp = fopen("/etc/passwd", "w")) != NULL) { 40023ff0: 13 10 01 5d sethi %hi(0x40057400), %o1 40023ff4: 40 00 4c 0e call 4003702c 40023ff8: 92 12 62 d0 or %o1, 0x2d0, %o1 ! 400576d0 40023ffc: ba 92 20 00 orcc %o0, 0, %i5 40024000: 02 80 00 08 be 40024020 <== NEVER TAKEN 40024004: 11 10 01 67 sethi %hi(0x40059c00), %o0 fprintf(fp, "root:*:0:0:root::/:/bin/sh\n" 40024008: 92 10 00 1d mov %i5, %o1 4002400c: 40 00 4c 6b call 400371b8 40024010: 90 12 20 18 or %o0, 0x18, %o0 "rtems:*:1:1:RTEMS Application::/:/bin/sh\n" "tty:!:2:2:tty owner::/:/bin/false\n" ); fclose(fp); 40024014: 90 10 00 1d mov %i5, %o0 40024018: 40 00 49 a7 call 400366b4 4002401c: 01 00 00 00 nop } /* * Initialize /etc/group */ if ((fp = fopen("/etc/group", "r")) != NULL) { 40024020: 3b 10 01 67 sethi %hi(0x40059c00), %i5 40024024: 13 10 01 78 sethi %hi(0x4005e000), %o1 40024028: 90 17 60 80 or %i5, 0x80, %o0 4002402c: 40 00 4c 00 call 4003702c 40024030: 92 12 63 18 or %o1, 0x318, %o1 40024034: b0 92 20 00 orcc %o0, 0, %i0 40024038: 12 80 00 0b bne 40024064 4002403c: 90 17 60 80 or %i5, 0x80, %o0 fclose(fp); } else if ((fp = fopen("/etc/group", "w")) != NULL) { 40024040: 13 10 01 5d sethi %hi(0x40057400), %o1 40024044: 40 00 4b fa call 4003702c 40024048: 92 12 62 d0 or %o1, 0x2d0, %o1 ! 400576d0 4002404c: b0 92 20 00 orcc %o0, 0, %i0 40024050: 02 80 00 07 be 4002406c <== NEVER TAKEN 40024054: 11 10 01 67 sethi %hi(0x40059c00), %o0 fprintf( fp, "root:x:0:root\n" 40024058: 92 10 00 18 mov %i0, %o1 4002405c: 40 00 4c 57 call 400371b8 40024060: 90 12 20 90 or %o0, 0x90, %o0 "rtems:x:1:rtems\n" "tty:x:2:tty\n" ); fclose(fp); 40024064: 40 00 49 94 call 400366b4 40024068: 81 e8 00 00 restore 4002406c: 81 c7 e0 08 ret 40024070: 81 e8 00 00 restore =============================================================================== 40006aac : /* * Process a single input character */ static int iproc (unsigned char c, struct rtems_termios_tty *tty) { 40006aac: 9d e3 bf a0 save %sp, -96, %sp if (tty->termios.c_iflag & ISTRIP) 40006ab0: c2 06 60 30 ld [ %i1 + 0x30 ], %g1 40006ab4: 80 88 60 20 btst 0x20, %g1 40006ab8: 32 80 00 02 bne,a 40006ac0 <== NEVER TAKEN 40006abc: b0 0e 20 7f and %i0, 0x7f, %i0 <== NOT EXECUTED c &= 0x7f; if (tty->termios.c_iflag & IUCLC) 40006ac0: 80 88 62 00 btst 0x200, %g1 40006ac4: 02 80 00 0c be 40006af4 40006ac8: 80 a6 20 0d cmp %i0, 0xd c = tolower (c); 40006acc: 05 10 00 75 sethi %hi(0x4001d400), %g2 40006ad0: c4 00 a0 18 ld [ %g2 + 0x18 ], %g2 ! 4001d418 <__ctype_ptr__> 40006ad4: 84 00 80 18 add %g2, %i0, %g2 40006ad8: c4 08 a0 01 ldub [ %g2 + 1 ], %g2 40006adc: 84 08 a0 03 and %g2, 3, %g2 40006ae0: 80 a0 a0 01 cmp %g2, 1 40006ae4: 22 80 00 02 be,a 40006aec 40006ae8: b0 06 20 20 add %i0, 0x20, %i0 40006aec: b0 0e 20 ff and %i0, 0xff, %i0 if (c == '\r') { 40006af0: 80 a6 20 0d cmp %i0, 0xd 40006af4: 12 80 00 0b bne 40006b20 40006af8: 80 a6 20 0a cmp %i0, 0xa if (tty->termios.c_iflag & IGNCR) 40006afc: 80 88 60 80 btst 0x80, %g1 40006b00: 02 80 00 04 be 40006b10 <== ALWAYS TAKEN 40006b04: 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; 40006b08: 81 c7 e0 08 ret <== NOT EXECUTED 40006b0c: 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) 40006b10: 32 80 00 0d bne,a 40006b44 <== ALWAYS TAKEN 40006b14: 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)) { 40006b18: 10 80 00 0c b 40006b48 <== NOT EXECUTED 40006b1c: 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)) { 40006b20: 12 80 00 07 bne 40006b3c 40006b24: 80 a6 20 00 cmp %i0, 0 40006b28: 80 88 60 40 btst 0x40, %g1 40006b2c: 32 80 00 06 bne,a 40006b44 <== NEVER TAKEN 40006b30: b0 10 20 0d mov 0xd, %i0 <== NOT EXECUTED c = '\r'; } if ((c != '\0') && (tty->termios.c_lflag & ICANON)) { 40006b34: 10 80 00 05 b 40006b48 40006b38: c2 06 60 3c ld [ %i1 + 0x3c ], %g1 40006b3c: 02 80 00 51 be 40006c80 <== NEVER TAKEN 40006b40: 03 10 00 74 sethi %hi(0x4001d000), %g1 40006b44: c2 06 60 3c ld [ %i1 + 0x3c ], %g1 40006b48: 80 88 60 02 btst 2, %g1 40006b4c: 22 80 00 4d be,a 40006c80 40006b50: 03 10 00 74 sethi %hi(0x4001d000), %g1 if (c == tty->termios.c_cc[VERASE]) { 40006b54: c4 0e 60 43 ldub [ %i1 + 0x43 ], %g2 40006b58: 80 a0 80 18 cmp %g2, %i0 40006b5c: 32 80 00 08 bne,a 40006b7c 40006b60: 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) 40006b64: c2 06 60 20 ld [ %i1 + 0x20 ], %g1 40006b68: 80 a0 60 00 cmp %g1, 0 40006b6c: 02 80 00 57 be 40006cc8 40006b70: 90 10 00 19 mov %i1, %o0 40006b74: 10 80 00 1d b 40006be8 40006b78: 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]) { 40006b7c: 80 a0 80 18 cmp %g2, %i0 40006b80: 32 80 00 1d bne,a 40006bf4 40006b84: 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) 40006b88: c4 06 60 20 ld [ %i1 + 0x20 ], %g2 40006b8c: 80 a0 a0 00 cmp %g2, 0 40006b90: 02 80 00 4e be 40006cc8 <== NEVER TAKEN 40006b94: 80 88 60 08 btst 8, %g1 return; if (lineFlag) { if (!(tty->termios.c_lflag & ECHO)) { 40006b98: 12 80 00 04 bne 40006ba8 <== ALWAYS TAKEN 40006b9c: 90 10 00 19 mov %i1, %o0 tty->ccount = 0; 40006ba0: 10 80 00 4a b 40006cc8 <== NOT EXECUTED 40006ba4: c0 26 60 20 clr [ %i1 + 0x20 ] <== NOT EXECUTED return; } if (!(tty->termios.c_lflag & ECHOE)) { 40006ba8: 80 88 60 10 btst 0x10, %g1 40006bac: 12 80 00 0f bne 40006be8 <== ALWAYS TAKEN 40006bb0: 92 10 20 01 mov 1, %o1 tty->ccount = 0; 40006bb4: c0 26 60 20 clr [ %i1 + 0x20 ] <== NOT EXECUTED echo (tty->termios.c_cc[VKILL], tty); 40006bb8: 90 10 00 18 mov %i0, %o0 <== NOT EXECUTED 40006bbc: 7f ff ff 2d call 40006870 <== NOT EXECUTED 40006bc0: 92 10 00 19 mov %i1, %o1 <== NOT EXECUTED if (tty->termios.c_lflag & ECHOK) 40006bc4: c2 06 60 3c ld [ %i1 + 0x3c ], %g1 <== NOT EXECUTED 40006bc8: 80 88 60 20 btst 0x20, %g1 <== NOT EXECUTED 40006bcc: 22 80 00 42 be,a 40006cd4 <== NOT EXECUTED 40006bd0: b0 10 20 00 clr %i0 <== NOT EXECUTED echo ('\n', tty); 40006bd4: 90 10 20 0a mov 0xa, %o0 <== NOT EXECUTED 40006bd8: 7f ff ff 26 call 40006870 <== NOT EXECUTED 40006bdc: 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; 40006be0: 81 c7 e0 08 ret <== NOT EXECUTED 40006be4: 91 e8 20 00 restore %g0, 0, %o0 <== NOT EXECUTED 40006be8: 7f ff ff 43 call 400068f4 40006bec: b0 10 20 00 clr %i0 40006bf0: 30 80 00 39 b,a 40006cd4 } else if (c == tty->termios.c_cc[VKILL]) { erase (tty, 1); return 0; } else if (c == tty->termios.c_cc[VEOF]) { 40006bf4: 80 a0 80 18 cmp %g2, %i0 40006bf8: 02 80 00 36 be 40006cd0 <== NEVER TAKEN 40006bfc: 80 a6 20 0a cmp %i0, 0xa return 1; } else if (c == '\n') { 40006c00: 32 80 00 0d bne,a 40006c34 40006c04: c4 0e 60 4c ldub [ %i1 + 0x4c ], %g2 if (tty->termios.c_lflag & (ECHO | ECHONL)) 40006c08: 80 88 60 48 btst 0x48, %g1 40006c0c: 22 80 00 06 be,a 40006c24 <== NEVER TAKEN 40006c10: c2 06 60 20 ld [ %i1 + 0x20 ], %g1 <== NOT EXECUTED echo (c, tty); 40006c14: 90 10 20 0a mov 0xa, %o0 40006c18: 7f ff ff 16 call 40006870 40006c1c: 92 10 00 19 mov %i1, %o1 tty->cbuf[tty->ccount++] = c; 40006c20: c2 06 60 20 ld [ %i1 + 0x20 ], %g1 40006c24: c4 06 60 1c ld [ %i1 + 0x1c ], %g2 40006c28: 86 10 20 0a mov 0xa, %g3 40006c2c: 10 80 00 12 b 40006c74 40006c30: c6 28 80 01 stb %g3, [ %g2 + %g1 ] return 1; } else if ((c == tty->termios.c_cc[VEOL]) || 40006c34: 80 a0 80 18 cmp %g2, %i0 40006c38: 02 80 00 07 be 40006c54 <== NEVER TAKEN 40006c3c: 80 88 60 08 btst 8, %g1 40006c40: c4 0e 60 51 ldub [ %i1 + 0x51 ], %g2 40006c44: 80 a0 80 18 cmp %g2, %i0 40006c48: 32 80 00 0e bne,a 40006c80 <== ALWAYS TAKEN 40006c4c: 03 10 00 74 sethi %hi(0x4001d000), %g1 (c == tty->termios.c_cc[VEOL2])) { if (tty->termios.c_lflag & ECHO) 40006c50: 80 88 60 08 btst 8, %g1 <== NOT EXECUTED 40006c54: 22 80 00 06 be,a 40006c6c <== NOT EXECUTED 40006c58: c2 06 60 20 ld [ %i1 + 0x20 ], %g1 <== NOT EXECUTED echo (c, tty); 40006c5c: 90 10 00 18 mov %i0, %o0 <== NOT EXECUTED 40006c60: 7f ff ff 04 call 40006870 <== NOT EXECUTED 40006c64: 92 10 00 19 mov %i1, %o1 <== NOT EXECUTED tty->cbuf[tty->ccount++] = c; 40006c68: c2 06 60 20 ld [ %i1 + 0x20 ], %g1 <== NOT EXECUTED 40006c6c: c4 06 60 1c ld [ %i1 + 0x1c ], %g2 <== NOT EXECUTED 40006c70: f0 28 80 01 stb %i0, [ %g2 + %g1 ] <== NOT EXECUTED 40006c74: 82 00 60 01 inc %g1 40006c78: 10 80 00 16 b 40006cd0 40006c7c: c2 26 60 20 st %g1, [ %i1 + 0x20 ] } /* * FIXME: Should do IMAXBEL handling somehow */ if (tty->ccount < (CBUFSIZE-1)) { 40006c80: c4 06 60 20 ld [ %i1 + 0x20 ], %g2 40006c84: c2 00 62 e8 ld [ %g1 + 0x2e8 ], %g1 40006c88: 82 00 7f ff add %g1, -1, %g1 40006c8c: 80 a0 80 01 cmp %g2, %g1 40006c90: 3a 80 00 11 bcc,a 40006cd4 <== NEVER TAKEN 40006c94: b0 10 20 00 clr %i0 <== NOT EXECUTED if (tty->termios.c_lflag & ECHO) 40006c98: c2 06 60 3c ld [ %i1 + 0x3c ], %g1 40006c9c: 80 88 60 08 btst 8, %g1 40006ca0: 22 80 00 06 be,a 40006cb8 <== NEVER TAKEN 40006ca4: c2 06 60 20 ld [ %i1 + 0x20 ], %g1 <== NOT EXECUTED echo (c, tty); 40006ca8: 90 10 00 18 mov %i0, %o0 40006cac: 7f ff fe f1 call 40006870 40006cb0: 92 10 00 19 mov %i1, %o1 tty->cbuf[tty->ccount++] = c; 40006cb4: c2 06 60 20 ld [ %i1 + 0x20 ], %g1 40006cb8: c4 06 60 1c ld [ %i1 + 0x1c ], %g2 40006cbc: f0 28 80 01 stb %i0, [ %g2 + %g1 ] 40006cc0: 82 00 60 01 inc %g1 40006cc4: c2 26 60 20 st %g1, [ %i1 + 0x20 ] } return 0; 40006cc8: 81 c7 e0 08 ret 40006ccc: 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; 40006cd0: b0 10 20 01 mov 1, %i0 if (tty->termios.c_lflag & ECHO) echo (c, tty); tty->cbuf[tty->ccount++] = c; } return 0; } 40006cd4: 81 c7 e0 08 ret 40006cd8: 81 e8 00 00 restore =============================================================================== 4001ac9c : #if !defined(RTEMS_POSIX_API) int kill( pid_t pid, int sig ) { return 0; } 4001ac9c: 81 c3 e0 08 retl <== NOT EXECUTED 4001aca0: 90 10 20 00 clr %o0 <== NOT EXECUTED =============================================================================== 400048a4 : extern void _wrapup_reent(struct _reent *); extern void _reclaim_reent(struct _reent *); void libc_wrapup(void) { 400048a4: 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())) 400048a8: 03 10 00 78 sethi %hi(0x4001e000), %g1 400048ac: c2 00 61 2c ld [ %g1 + 0x12c ], %g1 ! 4001e12c <_System_state_Current> 400048b0: 80 a0 60 03 cmp %g1, 3 400048b4: 12 80 00 16 bne 4000490c <== NEVER TAKEN 400048b8: 03 10 00 71 sethi %hi(0x4001c400), %g1 /* * This was already done if the user called exit() directly . _wrapup_reent(0); */ if (_REENT != _global_impure_ptr) { 400048bc: 39 10 00 75 sethi %hi(0x4001d400), %i4 400048c0: fa 00 63 a0 ld [ %g1 + 0x3a0 ], %i5 400048c4: c2 07 20 20 ld [ %i4 + 0x20 ], %g1 400048c8: 80 a0 40 1d cmp %g1, %i5 400048cc: 22 80 00 06 be,a 400048e4 400048d0: 3b 10 00 75 sethi %hi(0x4001d400), %i5 _wrapup_reent(_global_impure_ptr); 400048d4: 40 00 2c 4b call 4000fa00 <_wrapup_reent> 400048d8: 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; 400048dc: fa 27 20 20 st %i5, [ %i4 + 0x20 ] * * Should this be changed to do *all* file streams? * _fwalk (_REENT, fclose); */ fclose (stdin); 400048e0: 3b 10 00 75 sethi %hi(0x4001d400), %i5 400048e4: c2 07 60 20 ld [ %i5 + 0x20 ], %g1 ! 4001d420 <_impure_ptr> 400048e8: 40 00 29 69 call 4000ee8c 400048ec: d0 00 60 04 ld [ %g1 + 4 ], %o0 fclose (stdout); 400048f0: c2 07 60 20 ld [ %i5 + 0x20 ], %g1 400048f4: 40 00 29 66 call 4000ee8c 400048f8: d0 00 60 08 ld [ %g1 + 8 ], %o0 fclose (stderr); 400048fc: c2 07 60 20 ld [ %i5 + 0x20 ], %g1 40004900: f0 00 60 0c ld [ %g1 + 0xc ], %i0 40004904: 40 00 29 62 call 4000ee8c 40004908: 81 e8 00 00 restore 4000490c: 81 c7 e0 08 ret <== NOT EXECUTED 40004910: 81 e8 00 00 restore <== NOT EXECUTED =============================================================================== 40004374 : #include "malloc_p.h" void *malloc( size_t size ) { 40004374: 9d e3 bf a0 save %sp, -96, %sp void *return_this; MSBUMP(malloc_calls, 1); 40004378: 03 10 00 77 sethi %hi(0x4001dc00), %g1 4000437c: 82 10 61 b0 or %g1, 0x1b0, %g1 ! 4001ddb0 40004380: c4 00 60 04 ld [ %g1 + 4 ], %g2 40004384: 84 00 a0 01 inc %g2 /* * If some free's have been deferred, then do them now. */ malloc_deferred_frees_process(); 40004388: 7f ff ff b9 call 4000426c 4000438c: c4 20 60 04 st %g2, [ %g1 + 4 ] /* * Validate the parameters */ if ( !size ) 40004390: 80 a6 20 00 cmp %i0, 0 40004394: 12 80 00 04 bne 400043a4 40004398: 03 10 00 78 sethi %hi(0x4001e000), %g1 return (void *) 0; 4000439c: 10 80 00 32 b 40004464 400043a0: 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()) && 400043a4: c2 00 61 2c ld [ %g1 + 0x12c ], %g1 400043a8: 80 a0 60 03 cmp %g1, 3 400043ac: 02 80 00 0c be 400043dc 400043b0: 39 10 00 74 sethi %hi(0x4001d000), %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 ); 400043b4: d0 07 22 60 ld [ %i4 + 0x260 ], %o0 ! 4001d260 400043b8: 92 10 00 18 mov %i0, %o1 400043bc: 94 10 20 00 clr %o2 400043c0: 40 00 16 22 call 40009c48 <_Protected_heap_Allocate_aligned_with_boundary> 400043c4: 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 ) { 400043c8: ba 92 20 00 orcc %o0, 0, %i5 400043cc: 12 80 00 18 bne 4000442c 400043d0: 03 10 00 76 sethi %hi(0x4001d800), %g1 return_this = (*rtems_malloc_extend_handler)( RTEMS_Malloc_Heap, size ); 400043d4: 10 80 00 09 b 400043f8 400043d8: d0 07 22 60 ld [ %i4 + 0x260 ], %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() ) 400043dc: 7f ff ff 98 call 4000423c 400043e0: 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()) && 400043e4: 80 8a 20 ff btst 0xff, %o0 400043e8: 12 bf ff f3 bne 400043b4 <== ALWAYS TAKEN 400043ec: 01 00 00 00 nop 400043f0: 10 80 00 1d b 40004464 <== NOT EXECUTED 400043f4: 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 ); 400043f8: 03 10 00 6d sethi %hi(0x4001b400), %g1 400043fc: c2 00 61 10 ld [ %g1 + 0x110 ], %g1 ! 4001b510 40004400: 9f c0 40 00 call %g1 40004404: 92 10 00 18 mov %i0, %o1 if ( !return_this ) { 40004408: ba 92 20 00 orcc %o0, 0, %i5 4000440c: 12 80 00 08 bne 4000442c <== NEVER TAKEN 40004410: 03 10 00 76 sethi %hi(0x4001d800), %g1 errno = ENOMEM; 40004414: 40 00 2a 4c call 4000ed44 <__errno> 40004418: b0 10 00 1d mov %i5, %i0 4000441c: 82 10 20 0c mov 0xc, %g1 40004420: c2 22 00 00 st %g1, [ %o0 ] 40004424: 81 c7 e0 08 ret 40004428: 81 e8 00 00 restore } /* * If the user wants us to dirty the allocated memory, then do it. */ if ( rtems_malloc_dirty_helper ) 4000442c: c2 00 61 10 ld [ %g1 + 0x110 ], %g1 40004430: 80 a0 60 00 cmp %g1, 0 40004434: 02 80 00 04 be 40004444 40004438: 90 10 00 1d mov %i5, %o0 (*rtems_malloc_dirty_helper)( return_this, size ); 4000443c: 9f c0 40 00 call %g1 40004440: 92 10 00 18 mov %i0, %o1 /* * If configured, update the statistics */ if ( rtems_malloc_statistics_helpers ) 40004444: 03 10 00 76 sethi %hi(0x4001d800), %g1 40004448: c2 00 61 14 ld [ %g1 + 0x114 ], %g1 ! 4001d914 4000444c: 80 a0 60 00 cmp %g1, 0 40004450: 22 80 00 06 be,a 40004468 40004454: b0 10 00 1d mov %i5, %i0 (*rtems_malloc_statistics_helpers->at_malloc)(return_this); 40004458: c2 00 60 04 ld [ %g1 + 4 ], %g1 4000445c: 9f c0 40 00 call %g1 40004460: 90 10 00 1d mov %i5, %o0 return return_this; } 40004464: b0 10 00 1d mov %i5, %i0 40004468: 81 c7 e0 08 ret 4000446c: 81 e8 00 00 restore =============================================================================== 4000d928 : * Allocate a block for an in-memory file. */ int memfile_blocks_allocated = 0; void *memfile_alloc_block(void) { 4000d928: 9d e3 bf a0 save %sp, -96, %sp void *memory; memory = (void *)calloc(1, IMFS_MEMFILE_BYTES_PER_BLOCK); 4000d92c: 03 10 00 76 sethi %hi(0x4001d800), %g1 4000d930: d2 00 61 a8 ld [ %g1 + 0x1a8 ], %o1 ! 4001d9a8 4000d934: 7f ff d9 09 call 40003d58 4000d938: 90 10 20 01 mov 1, %o0 if ( memory ) 4000d93c: b0 92 20 00 orcc %o0, 0, %i0 4000d940: 02 80 00 05 be 4000d954 <== NEVER TAKEN 4000d944: 03 10 00 76 sethi %hi(0x4001d800), %g1 memfile_blocks_allocated++; 4000d948: c4 00 62 bc ld [ %g1 + 0x2bc ], %g2 ! 4001dabc 4000d94c: 84 00 a0 01 inc %g2 4000d950: c4 20 62 bc st %g2, [ %g1 + 0x2bc ] return memory; } 4000d954: 81 c7 e0 08 ret 4000d958: 81 e8 00 00 restore =============================================================================== 4000e450 : int memfile_ftruncate( rtems_libio_t *iop, off_t length ) { 4000e450: 9d e3 bf 98 save %sp, -104, %sp <== NOT EXECUTED IMFS_jnode_t *the_jnode; the_jnode = iop->pathinfo.node_access; 4000e454: fa 06 20 1c ld [ %i0 + 0x1c ], %i5 <== NOT EXECUTED * POSIX 1003.1b does not specify what happens if you truncate a file * and the new length is greater than the current size. We treat this * as an extend operation. */ if ( length > the_jnode->info.file.size ) 4000e458: c2 07 60 50 ld [ %i5 + 0x50 ], %g1 <== NOT EXECUTED 4000e45c: 80 a0 40 19 cmp %g1, %i1 <== NOT EXECUTED 4000e460: 06 80 00 09 bl 4000e484 <== NOT EXECUTED 4000e464: 90 10 00 1d mov %i5, %o0 <== NOT EXECUTED 4000e468: 32 80 00 0d bne,a 4000e49c <== NOT EXECUTED 4000e46c: f2 27 60 50 st %i1, [ %i5 + 0x50 ] <== NOT EXECUTED 4000e470: c2 07 60 54 ld [ %i5 + 0x54 ], %g1 <== NOT EXECUTED 4000e474: 80 a0 40 1a cmp %g1, %i2 <== NOT EXECUTED 4000e478: 3a 80 00 09 bcc,a 4000e49c <== NOT EXECUTED 4000e47c: f2 27 60 50 st %i1, [ %i5 + 0x50 ] <== NOT EXECUTED return IMFS_memfile_extend( the_jnode, true, length ); 4000e480: 90 10 00 1d mov %i5, %o0 <== NOT EXECUTED 4000e484: 92 10 20 01 mov 1, %o1 <== NOT EXECUTED 4000e488: 94 10 00 19 mov %i1, %o2 <== NOT EXECUTED 4000e48c: 7f ff fe df call 4000e008 <== NOT EXECUTED 4000e490: 96 10 00 1a mov %i2, %o3 <== NOT EXECUTED 4000e494: 81 c7 e0 08 ret <== NOT EXECUTED 4000e498: 91 e8 00 08 restore %g0, %o0, %o0 <== NOT EXECUTED /* * The in-memory files do not currently reclaim memory until the file is * deleted. So we leave the previously allocated blocks in place for * future use and just set the length. */ the_jnode->info.file.size = length; 4000e49c: f4 27 60 54 st %i2, [ %i5 + 0x54 ] <== NOT EXECUTED IMFS_update_atime( the_jnode ); 4000e4a0: 90 07 bf f8 add %fp, -8, %o0 <== NOT EXECUTED 4000e4a4: 7f ff d7 0a call 400040cc <== NOT EXECUTED 4000e4a8: 92 10 20 00 clr %o1 <== NOT EXECUTED 4000e4ac: c2 07 bf f8 ld [ %fp + -8 ], %g1 <== NOT EXECUTED 4000e4b0: c2 27 60 40 st %g1, [ %i5 + 0x40 ] <== NOT EXECUTED return 0; } 4000e4b4: 81 c7 e0 08 ret <== NOT EXECUTED 4000e4b8: 91 e8 20 00 restore %g0, 0, %o0 <== NOT EXECUTED =============================================================================== 4000e3d4 : rtems_libio_t *iop, const char *pathname, int oflag, mode_t mode ) { 4000e3d4: 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) 4000e3d8: c2 06 20 10 ld [ %i0 + 0x10 ], %g1 4000e3dc: 80 88 60 04 btst 4, %g1 4000e3e0: 12 80 00 04 bne 4000e3f0 4000e3e4: d0 06 20 1c ld [ %i0 + 0x1c ], %o0 if ((count != 0) && (IMFS_memfile_write(the_jnode, 0, buffer, count) == -1)) return -1; } return 0; 4000e3e8: 81 c7 e0 08 ret 4000e3ec: 91 e8 20 00 restore %g0, 0, %o0 4000e3f0: 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)) { 4000e3f4: c2 00 40 00 ld [ %g1 ], %g1 4000e3f8: 80 a0 60 05 cmp %g1, 5 4000e3fc: 12 bf ff fb bne 4000e3e8 <== ALWAYS TAKEN 4000e400: 03 10 00 70 sethi %hi(0x4001c000), %g1 uint32_t count = the_jnode->info.linearfile.size; 4000e404: d8 02 20 54 ld [ %o0 + 0x54 ], %o4 <== NOT EXECUTED const unsigned char *buffer = the_jnode->info.linearfile.direct; 4000e408: d6 02 20 58 ld [ %o0 + 0x58 ], %o3 <== NOT EXECUTED the_jnode->control = &IMFS_node_control_memfile; the_jnode->info.file.size = 0; 4000e40c: 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; 4000e410: 82 10 63 8c or %g1, 0x38c, %g1 <== NOT EXECUTED the_jnode->info.file.size = 0; 4000e414: 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; 4000e418: c2 22 20 4c st %g1, [ %o0 + 0x4c ] <== NOT EXECUTED the_jnode->info.file.size = 0; the_jnode->info.file.indirect = 0; 4000e41c: c0 22 20 58 clr [ %o0 + 0x58 ] <== NOT EXECUTED the_jnode->info.file.doubly_indirect = 0; 4000e420: c0 22 20 5c clr [ %o0 + 0x5c ] <== NOT EXECUTED the_jnode->info.file.triply_indirect = 0; if ((count != 0) 4000e424: 80 a3 20 00 cmp %o4, 0 <== NOT EXECUTED 4000e428: 02 bf ff f0 be 4000e3e8 <== NOT EXECUTED 4000e42c: c0 22 20 60 clr [ %o0 + 0x60 ] <== NOT EXECUTED && (IMFS_memfile_write(the_jnode, 0, buffer, count) == -1)) 4000e430: 92 10 20 00 clr %o1 <== NOT EXECUTED 4000e434: 7f ff ff 5d call 4000e1a8 <== NOT EXECUTED 4000e438: 94 10 20 00 clr %o2 <== NOT EXECUTED return -1; 4000e43c: 90 38 00 08 xnor %g0, %o0, %o0 <== NOT EXECUTED 4000e440: 80 a0 00 08 cmp %g0, %o0 <== NOT EXECUTED 4000e444: b0 40 3f ff addx %g0, -1, %i0 <== NOT EXECUTED } return 0; } 4000e448: 81 c7 e0 08 ret <== NOT EXECUTED 4000e44c: 81 e8 00 00 restore <== NOT EXECUTED =============================================================================== 40004590 : const char *target, const char *filesystemtype, rtems_filesystem_options_t options, const void *data ) { 40004590: 9d e3 bf 50 save %sp, -176, %sp int rv = 0; if ( 40004594: 80 a6 e0 01 cmp %i3, 1 40004598: 18 80 00 b4 bgu 40004868 4000459c: 01 00 00 00 nop options == RTEMS_FILESYSTEM_READ_ONLY || options == RTEMS_FILESYSTEM_READ_WRITE ) { rtems_filesystem_fsmount_me_t fsmount_me_h = 400045a0: 40 00 20 73 call 4000c76c 400045a4: 90 10 00 1a mov %i2, %o0 rtems_filesystem_get_mount_handler( filesystemtype ); if ( fsmount_me_h != NULL ) { 400045a8: a6 92 20 00 orcc %o0, 0, %l3 400045ac: 02 80 00 af be 40004868 400045b0: 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 : "/"; 400045b4: 12 80 00 04 bne 400045c4 400045b8: 01 00 00 00 nop 400045bc: 23 10 00 6f sethi %hi(0x4001bc00), %l1 400045c0: a2 14 62 10 or %l1, 0x210, %l1 ! 4001be10 size_t filesystemtype_size = strlen( filesystemtype ) + 1; 400045c4: 40 00 2f 67 call 40010360 400045c8: 90 10 00 1a mov %i2, %o0 size_t source_size = source_or_null != NULL ? strlen( source_or_null ) + 1 : 0; 400045cc: 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; 400045d0: ba 10 00 08 mov %o0, %i5 size_t source_size = source_or_null != NULL ? strlen( source_or_null ) + 1 : 0; 400045d4: 02 80 00 06 be 400045ec 400045d8: ac 02 20 01 add %o0, 1, %l6 400045dc: 40 00 2f 61 call 40010360 400045e0: 90 10 00 18 mov %i0, %o0 400045e4: 10 80 00 03 b 400045f0 400045e8: a0 02 20 01 add %o0, 1, %l0 400045ec: 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 400045f0: 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; 400045f4: 40 00 2f 5b call 40010360 400045f8: 90 10 00 11 mov %l1, %o0 size_t size = sizeof( rtems_filesystem_mount_table_entry_t ) + filesystemtype_size + source_size + target_size 400045fc: 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; 40004600: 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 ); 40004604: 90 10 20 01 mov 1, %o0 40004608: 7f ff fd d4 call 40003d58 4000460c: 92 02 40 15 add %o1, %l5, %o1 if ( mt_entry != NULL ) { 40004610: ba 92 20 00 orcc %o0, 0, %i5 40004614: 02 80 00 9d be 40004888 <== NEVER TAKEN 40004618: 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 ); 4000461c: 92 10 00 1a mov %i2, %o1 40004620: 90 10 00 12 mov %l2, %o0 40004624: 40 00 2c 19 call 4000f688 40004628: 94 10 00 16 mov %l6, %o2 mt_entry->type = str; 4000462c: 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 = 40004630: 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 ) { 40004634: 80 a6 20 00 cmp %i0, 0 40004638: 02 80 00 08 be 40004658 4000463c: b4 04 80 16 add %l2, %l6, %i2 memcpy( str, source_or_null, source_size ); 40004640: 90 10 00 1a mov %i2, %o0 40004644: 92 10 00 18 mov %i0, %o1 40004648: 40 00 2c 10 call 4000f688 4000464c: 94 10 00 10 mov %l0, %o2 mt_entry->dev = str; 40004650: f4 27 60 38 st %i2, [ %i5 + 0x38 ] str += source_size; 40004654: b4 06 80 10 add %i2, %l0, %i2 } memcpy( str, target, target_size ); 40004658: 92 10 00 11 mov %l1, %o1 4000465c: 94 10 00 15 mov %l5, %o2 40004660: 40 00 2c 0a call 4000f688 40004664: 90 10 00 1a mov %i2, %o0 mt_entry->target = str; str += target_size; mt_entry->mounted = true; 40004668: 82 10 20 01 mov 1, %g1 4000466c: 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; 40004670: 03 10 00 6f sethi %hi(0x4001bc00), %g1 40004674: 82 10 62 14 or %g1, 0x214, %g1 ! 4001be14 40004678: c2 27 60 2c st %g1, [ %i5 + 0x2c ] mt_fs_root->location.mt_entry = mt_entry; mt_fs_root->reference_count = 1; 4000467c: 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 ); 40004680: 90 07 60 14 add %i5, 0x14, %o0 40004684: c2 27 60 58 st %g1, [ %i5 + 0x58 ] 40004688: 92 10 00 14 mov %l4, %o1 4000468c: 94 10 20 01 mov 1, %o2 40004690: 96 10 20 24 mov 0x24, %o3 mt_entry->dev = str; str += source_size; } memcpy( str, target, target_size ); mt_entry->target = str; 40004694: f4 27 60 30 st %i2, [ %i5 + 0x30 ] str += target_size; mt_entry->mounted = true; mt_entry->mt_fs_root = mt_fs_root; 40004698: e8 27 60 24 st %l4, [ %i5 + 0x24 ] 4000469c: 40 00 11 0e call 40008ad4 <_Chain_Initialize> 400046a0: fa 27 60 54 st %i5, [ %i5 + 0x54 ] filesystemtype, &target_length ); if ( mt_entry != NULL ) { mt_entry->writeable = options == RTEMS_FILESYSTEM_READ_WRITE; 400046a4: b6 0e e0 01 and %i3, 1, %i3 rv = (*fsmount_me_h)( mt_entry, data ); 400046a8: 90 10 00 1d mov %i5, %o0 filesystemtype, &target_length ); if ( mt_entry != NULL ) { mt_entry->writeable = options == RTEMS_FILESYSTEM_READ_WRITE; 400046ac: f6 2f 60 29 stb %i3, [ %i5 + 0x29 ] rv = (*fsmount_me_h)( mt_entry, data ); 400046b0: 9f c4 c0 00 call %l3 400046b4: 92 10 00 1c mov %i4, %o1 if ( rv == 0 ) { 400046b8: b0 92 20 00 orcc %o0, 0, %i0 400046bc: 12 80 00 6f bne 40004878 400046c0: 80 a6 60 00 cmp %i1, 0 if ( target != NULL ) { 400046c4: 02 80 00 38 be 400047a4 400046c8: 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 = 400046cc: 94 10 20 1f mov 0x1f, %o2 400046d0: 40 00 02 b0 call 40005190 400046d4: 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; 400046d8: c2 02 20 14 ld [ %o0 + 0x14 ], %g1 return (*mt_entry->ops->are_nodes_equal_h)( 400046dc: c4 00 60 0c ld [ %g1 + 0xc ], %g2 400046e0: c4 00 a0 10 ld [ %g2 + 0x10 ], %g2 400046e4: 9f c0 80 00 call %g2 400046e8: 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 ) ) { 400046ec: 80 8a 20 ff btst 0xff, %o0 400046f0: 12 80 00 22 bne 40004778 400046f4: 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( 400046f8: 40 00 03 a0 call 40005578 400046fc: 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 ); 40004700: 40 00 04 16 call 40005758 40004704: 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 ); 40004708: 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; 4000470c: d0 27 60 20 st %o0, [ %i5 + 0x20 ] rv = (*mt_point_node->location.mt_entry->ops->mount_h)( mt_entry ); 40004710: 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 ); 40004714: 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 ); 40004718: c2 00 60 30 ld [ %g1 + 0x30 ], %g1 4000471c: 9f c0 40 00 call %g1 40004720: 90 10 00 1d mov %i5, %o0 if ( rv == 0 ) { 40004724: b0 92 20 00 orcc %o0, 0, %i0 40004728: 12 80 00 11 bne 4000476c 4000472c: 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 ); 40004730: 39 10 00 77 sethi %hi(0x4001dc00), %i4 40004734: d0 07 21 ac ld [ %i4 + 0x1ac ], %o0 ! 4001ddac 40004738: 40 00 0e 2c call 40007fe8 4000473c: 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; 40004740: 03 10 00 74 sethi %hi(0x4001d000), %g1 } static inline void rtems_libio_unlock( void ) { rtems_semaphore_release( rtems_libio_semaphore ); 40004744: d0 07 21 ac ld [ %i4 + 0x1ac ], %o0 40004748: 82 10 62 d0 or %g1, 0x2d0, %g1 4000474c: c4 00 60 08 ld [ %g1 + 8 ], %g2 the_node->next = tail; 40004750: 86 00 60 04 add %g1, 4, %g3 40004754: c6 27 40 00 st %g3, [ %i5 ] tail->previous = the_node; 40004758: fa 20 60 08 st %i5, [ %g1 + 8 ] old_last->next = the_node; 4000475c: fa 20 80 00 st %i5, [ %g2 ] 40004760: 40 00 0e 6b call 4000810c 40004764: c4 27 60 04 st %g2, [ %i5 + 4 ] 40004768: 30 80 00 08 b,a 40004788 &rtems_filesystem_mount_table, &mt_entry->mt_node ); rtems_filesystem_mt_unlock(); } else { rtems_filesystem_global_location_release( mt_point_node ); 4000476c: 40 00 03 a8 call 4000560c 40004770: 90 10 00 1c mov %i4, %o0 40004774: 30 80 00 05 b,a 40004788 } } else { rtems_filesystem_eval_path_error( &ctx, EBUSY ); 40004778: 90 07 bf c8 add %fp, -56, %o0 4000477c: 92 10 20 10 mov 0x10, %o1 40004780: 40 00 01 ee call 40004f38 40004784: b0 10 3f ff mov -1, %i0 rv = -1; } rtems_filesystem_eval_path_cleanup( &ctx ); 40004788: 40 00 02 be call 40005280 4000478c: 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 ) { 40004790: 80 a6 20 00 cmp %i0, 0 40004794: 02 80 00 42 be 4000489c 40004798: 01 00 00 00 nop (*mt_entry->ops->fsunmount_me_h)( mt_entry ); 4000479c: 10 80 00 2f b 40004858 400047a0: 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 ); 400047a4: 03 10 00 77 sethi %hi(0x4001dc00), %g1 400047a8: d0 00 61 ac ld [ %g1 + 0x1ac ], %o0 ! 4001ddac 400047ac: 92 10 20 00 clr %o1 400047b0: 40 00 0e 0e call 40007fe8 400047b4: 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; 400047b8: 05 10 00 74 sethi %hi(0x4001d000), %g2 ) { int rv = 0; rtems_filesystem_mt_lock(); if ( rtems_chain_is_empty( &rtems_filesystem_mount_table ) ) { 400047bc: c6 00 a2 d0 ld [ %g2 + 0x2d0 ], %g3 ! 4001d2d0 400047c0: 82 10 a2 d0 or %g2, 0x2d0, %g1 400047c4: 84 00 60 04 add %g1, 4, %g2 400047c8: 80 a0 c0 02 cmp %g3, %g2 400047cc: 12 80 00 08 bne 400047ec <== NEVER TAKEN 400047d0: 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; 400047d4: c4 00 60 08 ld [ %g1 + 8 ], %g2 the_node->next = tail; 400047d8: c6 27 40 00 st %g3, [ %i5 ] tail->previous = the_node; 400047dc: fa 20 60 08 st %i5, [ %g1 + 8 ] old_last->next = the_node; 400047e0: fa 20 80 00 st %i5, [ %g2 ] the_node->previous = old_last; 400047e4: 10 80 00 06 b 400047fc 400047e8: c4 27 60 04 st %g2, [ %i5 + 4 ] rtems_chain_append_unprotected( &rtems_filesystem_mount_table, &mt_entry->mt_node ); } else { errno = EINVAL; 400047ec: 40 00 29 56 call 4000ed44 <__errno> <== NOT EXECUTED 400047f0: b0 10 3f ff mov -1, %i0 <== NOT EXECUTED 400047f4: 82 10 20 16 mov 0x16, %g1 <== NOT EXECUTED 400047f8: c2 22 00 00 st %g1, [ %o0 ] <== NOT EXECUTED } static inline void rtems_libio_unlock( void ) { rtems_semaphore_release( rtems_libio_semaphore ); 400047fc: 03 10 00 77 sethi %hi(0x4001dc00), %g1 40004800: 40 00 0e 43 call 4000810c 40004804: d0 00 61 ac ld [ %g1 + 0x1ac ], %o0 ! 4001ddac rv = -1; } rtems_filesystem_mt_unlock(); if ( rv == 0 ) { 40004808: 80 a6 20 00 cmp %i0, 0 4000480c: 32 80 00 13 bne,a 40004858 <== NEVER TAKEN 40004810: 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 ); 40004814: 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 = 40004818: 40 00 03 9e call 40005690 4000481c: 90 10 00 1d mov %i5, %o0 40004820: 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 = 40004824: 40 00 03 9b call 40005690 40004828: 90 10 00 1d mov %i5, %o0 rtems_filesystem_global_location_obtain( &mt_entry->mt_fs_root ); rtems_filesystem_global_location_assign( 4000482c: 3b 10 00 74 sethi %hi(0x4001d000), %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 = 40004830: b8 10 00 08 mov %o0, %i4 rtems_filesystem_global_location_obtain( &mt_entry->mt_fs_root ); rtems_filesystem_global_location_assign( 40004834: d0 07 62 f0 ld [ %i5 + 0x2f0 ], %o0 40004838: 92 10 00 1b mov %i3, %o1 4000483c: 40 00 03 8c call 4000566c 40004840: 90 02 20 04 add %o0, 4, %o0 &rtems_filesystem_root, new_fs_root ); rtems_filesystem_global_location_assign( 40004844: d0 07 62 f0 ld [ %i5 + 0x2f0 ], %o0 40004848: 40 00 03 89 call 4000566c 4000484c: 92 10 00 1c mov %i4, %o1 40004850: 81 c7 e0 08 ret 40004854: 81 e8 00 00 restore } else { rv = register_root_file_system( mt_entry ); } if ( rv != 0 ) { (*mt_entry->ops->fsunmount_me_h)( mt_entry ); 40004858: c2 00 60 3c ld [ %g1 + 0x3c ], %g1 4000485c: 9f c0 40 00 call %g1 40004860: 90 10 00 1d mov %i5, %o0 40004864: 30 80 00 05 b,a 40004878 } else { errno = EINVAL; rv = -1; } } else { errno = EINVAL; 40004868: 40 00 29 37 call 4000ed44 <__errno> 4000486c: 01 00 00 00 nop 40004870: 10 80 00 09 b 40004894 40004874: 82 10 20 16 mov 0x16, %g1 ! 16 (*mt_entry->ops->fsunmount_me_h)( mt_entry ); } } if ( rv != 0 ) { free( mt_entry ); 40004878: 7f ff fd eb call 40004024 4000487c: 90 10 00 1d mov %i5, %o0 40004880: 81 c7 e0 08 ret 40004884: 81 e8 00 00 restore } } else { errno = ENOMEM; 40004888: 40 00 29 2f call 4000ed44 <__errno> <== NOT EXECUTED 4000488c: 01 00 00 00 nop <== NOT EXECUTED 40004890: 82 10 20 0c mov 0xc, %g1 ! c <== NOT EXECUTED 40004894: c2 22 00 00 st %g1, [ %o0 ] rv = -1; 40004898: b0 10 3f ff mov -1, %i0 errno = EINVAL; rv = -1; } return rv; } 4000489c: 81 c7 e0 08 ret 400048a0: 81 e8 00 00 restore =============================================================================== 40008ffc : const char *target, const char *filesystemtype, rtems_filesystem_options_t options, const void *data ) { 40008ffc: 9d e3 bf a0 save %sp, -96, %sp int rv = -1; if (target != NULL) { 40009000: 90 96 60 00 orcc %i1, 0, %o0 40009004: 02 80 00 09 be 40009028 40009008: 01 00 00 00 nop rv = rtems_mkdir(target, S_IRWXU | S_IRWXG | S_IRWXO); 4000900c: 40 00 02 cd call 40009b40 40009010: 92 10 21 ff mov 0x1ff, %o1 ! 1ff if (rv == 0) { 40009014: 80 a2 20 00 cmp %o0, 0 40009018: 12 80 00 09 bne 4000903c <== NEVER TAKEN 4000901c: 01 00 00 00 nop rv = mount( 40009020: 40 00 00 09 call 40009044 40009024: 81 e8 00 00 restore options, data ); } } else { errno = EINVAL; 40009028: 40 00 5c c5 call 4002033c <__errno> 4000902c: 01 00 00 00 nop 40009030: 82 10 20 16 mov 0x16, %g1 ! 16 40009034: c2 22 00 00 st %g1, [ %o0 ] const char *filesystemtype, rtems_filesystem_options_t options, const void *data ) { int rv = -1; 40009038: 90 10 3f ff mov -1, %o0 } else { errno = EINVAL; } return rv; } 4000903c: 81 c7 e0 08 ret 40009040: 91 e8 00 08 restore %g0, %o0, %o0 =============================================================================== 40017200 : msdos_node_type_t type, const char *name, int name_len, mode_t mode, const fat_file_fd_t *link_fd) { 40017200: 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; 40017204: 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); 40017208: 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; 4001720c: 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; 40017210: 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); 40017214: 94 10 20 20 mov 0x20, %o2 40017218: c2 27 bf 78 st %g1, [ %fp + -136 ] dir_pos->lname.ofs = FAT_FILE_SHORT_NAME; 4001721c: 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; 40017220: e0 06 20 08 ld [ %i0 + 8 ], %l0 fat_file_fd_t *fat_fd = NULL; 40017224: c0 27 bf 6c clr [ %fp + -148 ] time_t time_ret = 0; uint16_t time_val = 0; 40017228: c0 37 bf 68 clrh [ %fp + -152 ] uint16_t date = 0; 4001722c: 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; 40017230: c0 27 bf 70 clr [ %fp + -144 ] dir_pos->sname.ofs = 0; 40017234: 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); 40017238: 40 00 11 3d call 4001b72c 4001723c: 90 07 bf 80 add %fp, -128, %o0 memset(dot_dotdot, 0, MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE * 2); 40017240: 90 07 bf c0 add %fp, -64, %o0 40017244: 92 10 20 00 clr %o1 40017248: 40 00 11 39 call 4001b72c 4001724c: 94 10 20 40 mov 0x40, %o2 if (name_len > MSDOS_NAME_MAX_LFN_WITH_DOT) { 40017250: 80 a6 e1 04 cmp %i3, 0x104 40017254: 24 80 00 06 ble,a 4001726c <== ALWAYS TAKEN 40017258: 90 10 00 1a mov %i2, %o0 rtems_set_errno_and_return_minus_one(ENAMETOOLONG); 4001725c: 40 00 0e 52 call 4001aba4 <__errno> <== NOT EXECUTED 40017260: 01 00 00 00 nop <== NOT EXECUTED 40017264: 10 80 00 0c b 40017294 <== NOT EXECUTED 40017268: 82 10 20 5b mov 0x5b, %g1 ! 5b <== NOT EXECUTED } name_type = msdos_long_to_short (name, name_len, 4001726c: 92 10 00 1b mov %i3, %o1 40017270: 94 07 bf 80 add %fp, -128, %o2 40017274: 40 00 01 45 call 40017788 40017278: 96 10 20 0b mov 0xb, %o3 MSDOS_DIR_NAME(short_node), MSDOS_NAME_MAX); if (name_type == MSDOS_NAME_INVALID) { 4001727c: a4 92 20 00 orcc %o0, 0, %l2 40017280: 32 80 00 08 bne,a 400172a0 <== ALWAYS TAKEN 40017284: c0 2f bf 8c clrb [ %fp + -116 ] rtems_set_errno_and_return_minus_one(EINVAL); 40017288: 40 00 0e 47 call 4001aba4 <__errno> <== NOT EXECUTED 4001728c: 01 00 00 00 nop <== NOT EXECUTED 40017290: 82 10 20 16 mov 0x16, %g1 ! 16 <== NOT EXECUTED 40017294: c2 22 00 00 st %g1, [ %o0 ] <== NOT EXECUTED 40017298: 10 80 00 ce b 400175d0 <== NOT EXECUTED 4001729c: 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); 400172a0: 40 00 1f e6 call 4001f238