=============================================================================== 4000bcd4 : int IMFS_chown( const rtems_filesystem_location_info_t *loc, uid_t owner, gid_t group ) { 4000bcd4: 9d e3 bf 98 save %sp, -104, %sp /* * Verify I am the owner of the node or the super user. */ #if defined(RTEMS_POSIX_API) st_uid = geteuid(); 4000bcd8: 40 00 02 6f call 4000c694 4000bcdc: fa 06 20 08 ld [ %i0 + 8 ], %i5 if ( ( st_uid != jnode->st_uid ) && ( st_uid != 0 ) ) 4000bce0: c2 17 60 3c lduh [ %i5 + 0x3c ], %g1 4000bce4: 91 2a 20 10 sll %o0, 0x10, %o0 4000bce8: 91 32 20 10 srl %o0, 0x10, %o0 4000bcec: 80 a2 00 01 cmp %o0, %g1 4000bcf0: 02 80 00 0a be 4000bd18 4000bcf4: 80 a2 20 00 cmp %o0, 0 4000bcf8: 22 80 00 09 be,a 4000bd1c <== NEVER TAKEN 4000bcfc: f2 37 60 3c sth %i1, [ %i5 + 0x3c ] <== NOT EXECUTED rtems_set_errno_and_return_minus_one( EPERM ); 4000bd00: 40 00 0f 79 call 4000fae4 <__errno> 4000bd04: b0 10 3f ff mov -1, %i0 4000bd08: 82 10 20 01 mov 1, %g1 4000bd0c: c2 22 00 00 st %g1, [ %o0 ] 4000bd10: 81 c7 e0 08 ret 4000bd14: 81 e8 00 00 restore #endif jnode->st_uid = owner; 4000bd18: f2 37 60 3c sth %i1, [ %i5 + 0x3c ] jnode->st_gid = group; 4000bd1c: f4 37 60 3e sth %i2, [ %i5 + 0x3e ] IMFS_update_ctime( jnode ); 4000bd20: 90 07 bf f8 add %fp, -8, %o0 4000bd24: 7f ff e0 ea call 400040cc 4000bd28: 92 10 20 00 clr %o1 4000bd2c: c2 07 bf f8 ld [ %fp + -8 ], %g1 4000bd30: c2 27 60 48 st %g1, [ %i5 + 0x48 ] return 0; } 4000bd34: 81 c7 e0 08 ret 4000bd38: 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 8f sethi %hi(0x40023c00), %i2 400060bc: 39 10 00 97 sethi %hi(0x40025c00), %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 8f sethi %hi(0x40023c00), %l0 return; } puts(""); 400060c4: 23 10 00 91 sethi %hi(0x40024400), %l1 case IMFS_SYM_LINK: fprintf(stdout, " links not printed\n" ); return; case IMFS_FIFO: fprintf(stdout, " FIFO not printed\n" ); 400060c8: 25 10 00 8f sethi %hi(0x40023c00), %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 a0 88 or %i2, 0x88, %i2 400060d4: b8 17 21 08 or %i4, 0x108, %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 20 f8 or %l0, 0xf8, %l0 return; } puts(""); 400060dc: a2 14 61 f8 or %l1, 0x1f8, %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 a0 e0 or %l2, 0xe0, %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 37 85 call 40013f00 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 37 7d call 40013f00 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 37 3a call 40013e30 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 8f sethi %hi(0x40023c00), %o1 4000615c: d0 00 60 08 ld [ %g1 + 8 ], %o0 40006160: 92 12 60 90 or %o1, 0x90, %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 8f sethi %hi(0x40023c00), %o1 40006180: 92 12 60 a8 or %o1, 0xa8, %o1 ! 40023ca8 40006184: 40 00 37 0f call 40013dc0 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 8f sethi %hi(0x40023c00), %o1 400061a0: 40 00 37 08 call 40013dc0 400061a4: 92 12 60 b8 or %o1, 0xb8, %o1 ! 40023cb8 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 8f sethi %hi(0x40023c00), %o0 400061b0: c2 07 00 00 ld [ %i4 ], %g1 400061b4: 10 80 00 04 b 400061c4 400061b8: 90 12 20 c8 or %o0, 0xc8, %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 37 4f call 40013f00 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 36 fa call 40013dc0 <== 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 3e 2d call 40015a9c 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 =============================================================================== 4000be78 : rtems_filesystem_eval_path_context_t *ctx, void *arg, const char *token, size_t tokenlen ) { 4000be78: 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; 4000be7c: f8 06 20 20 ld [ %i0 + 0x20 ], %i4 bool access_ok = rtems_filesystem_eval_path_check_access( 4000be80: 90 10 00 18 mov %i0, %o0 4000be84: d4 07 20 30 ld [ %i4 + 0x30 ], %o2 4000be88: d6 17 20 3c lduh [ %i4 + 0x3c ], %o3 4000be8c: d8 17 20 3e lduh [ %i4 + 0x3e ], %o4 4000be90: 40 00 03 18 call 4000caf0 4000be94: 92 10 20 01 mov 1, %o1 dir->st_mode, dir->st_uid, dir->st_gid ); if ( access_ok ) { 4000be98: 80 8a 20 ff btst 0xff, %o0 4000be9c: 12 80 00 04 bne 4000beac 4000bea0: 80 a6 e0 01 cmp %i3, 1 void *arg, const char *token, size_t tokenlen ) { rtems_filesystem_eval_path_generic_status status = 4000bea4: 81 c7 e0 08 ret 4000bea8: 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] == '.'; 4000beac: 12 80 00 06 bne 4000bec4 4000beb0: 82 10 20 00 clr %g1 4000beb4: c2 4e 80 00 ldsb [ %i2 ], %g1 4000beb8: 82 18 60 2e xor %g1, 0x2e, %g1 4000bebc: 80 a0 00 01 cmp %g0, %g1 4000bec0: 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 ) ) { 4000bec4: 80 a0 60 00 cmp %g1, 0 4000bec8: 12 80 00 2b bne 4000bf74 4000becc: 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] == '.'; 4000bed0: 12 80 00 0b bne 4000befc 4000bed4: 80 a0 60 00 cmp %g1, 0 4000bed8: c4 4e 80 00 ldsb [ %i2 ], %g2 4000bedc: 80 a0 a0 2e cmp %g2, 0x2e 4000bee0: 12 80 00 07 bne 4000befc 4000bee4: 80 a0 60 00 cmp %g1, 0 4000bee8: c2 4e a0 01 ldsb [ %i2 + 1 ], %g1 4000beec: 82 18 60 2e xor %g1, 0x2e, %g1 4000bef0: 80 a0 00 01 cmp %g0, %g1 4000bef4: 82 60 3f ff subx %g0, -1, %g1 return dir; } else { if ( rtems_filesystem_is_parent_directory( token, tokenlen ) ) { 4000bef8: 80 a0 60 00 cmp %g1, 0 4000befc: 22 80 00 04 be,a 4000bf0c 4000bf00: fa 07 20 50 ld [ %i4 + 0x50 ], %i5 return dir->Parent; 4000bf04: 10 80 00 17 b 4000bf60 4000bf08: 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 ); 4000bf0c: 10 80 00 10 b 4000bf4c 4000bf10: 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 4000bf14: 92 10 00 1a mov %i2, %o1 4000bf18: 40 00 14 ac call 400111c8 4000bf1c: 94 10 00 1b mov %i3, %o2 && entry->name [tokenlen] == '\0'; 4000bf20: 80 a2 20 00 cmp %o0, 0 4000bf24: 12 80 00 06 bne 4000bf3c 4000bf28: 82 10 20 00 clr %g1 4000bf2c: 82 07 40 1b add %i5, %i3, %g1 4000bf30: c2 48 60 0c ldsb [ %g1 + 0xc ], %g1 4000bf34: 80 a0 00 01 cmp %g0, %g1 4000bf38: 82 60 3f ff subx %g0, -1, %g1 if ( match ) { 4000bf3c: 80 a0 60 00 cmp %g1, 0 4000bf40: 12 80 00 09 bne 4000bf64 4000bf44: 80 a7 60 00 cmp %i5, 0 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Next( Chain_Node *the_node ) { return the_node->next; 4000bf48: 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 ) { 4000bf4c: 80 a7 40 19 cmp %i5, %i1 4000bf50: 12 bf ff f1 bne 4000bf14 4000bf54: 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; 4000bf58: 81 c7 e0 08 ret 4000bf5c: 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 ) { 4000bf60: 80 a7 60 00 cmp %i5, 0 4000bf64: 32 80 00 06 bne,a 4000bf7c 4000bf68: 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; 4000bf6c: 81 c7 e0 08 ret 4000bf70: 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 ) ) { 4000bf74: 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 ); 4000bf78: 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; 4000bf7c: c6 06 20 10 ld [ %i0 + 0x10 ], %g3 4000bf80: 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; 4000bf84: c2 07 60 4c ld [ %i5 + 0x4c ], %g1 4000bf88: 84 60 3f ff subx %g0, -1, %g2 4000bf8c: 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; 4000bf90: 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)) { 4000bf94: 80 a0 60 02 cmp %g1, 2 4000bf98: 12 80 00 0a bne 4000bfc0 4000bf9c: 88 10 00 02 mov %g2, %g4 4000bfa0: 80 a0 a0 00 cmp %g2, 0 4000bfa4: 22 80 00 2b be,a 4000c050 4000bfa8: fa 07 60 50 ld [ %i5 + 0x50 ], %i5 4000bfac: 80 88 e0 08 btst 8, %g3 4000bfb0: 22 80 00 29 be,a 4000c054 4000bfb4: c2 17 20 34 lduh [ %i4 + 0x34 ], %g1 entry = entry->info.hard_link.link_node; 4000bfb8: 10 80 00 26 b 4000c050 4000bfbc: fa 07 60 50 ld [ %i5 + 0x50 ], %i5 } if ( type == IMFS_SYM_LINK && (follow_sym_link || !terminal)) { 4000bfc0: 80 a0 60 03 cmp %g1, 3 4000bfc4: 12 80 00 10 bne 4000c004 4000bfc8: 80 a0 60 00 cmp %g1, 0 4000bfcc: 80 a0 a0 00 cmp %g2, 0 4000bfd0: 02 80 00 04 be 4000bfe0 4000bfd4: 80 88 e0 10 btst 0x10, %g3 4000bfd8: 22 80 00 1f be,a 4000c054 4000bfdc: c2 17 20 34 lduh [ %i4 + 0x34 ], %g1 const char *target = entry->info.sym_link.name; 4000bfe0: fa 07 60 50 ld [ %i5 + 0x50 ], %i5 rtems_filesystem_eval_path_recursive( ctx, target, strlen( target ) ); 4000bfe4: 40 00 14 47 call 40011100 4000bfe8: 90 10 00 1d mov %i5, %o0 4000bfec: 92 10 00 1d mov %i5, %o1 4000bff0: 94 10 00 08 mov %o0, %o2 4000bff4: 7f ff e4 cf call 40005330 4000bff8: 90 10 00 18 mov %i0, %o0 void *arg, const char *token, size_t tokenlen ) { rtems_filesystem_eval_path_generic_status status = 4000bffc: 81 c7 e0 08 ret 4000c000: 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 ) { 4000c004: 32 80 00 14 bne,a 4000c054 4000c008: c2 17 20 34 lduh [ %i4 + 0x34 ], %g1 if ( node->info.directory.mt_fs != NULL ) { 4000c00c: d2 07 60 5c ld [ %i5 + 0x5c ], %o1 4000c010: 80 a2 60 00 cmp %o1, 0 4000c014: 02 80 00 0f be 4000c050 4000c018: 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( 4000c01c: d4 07 60 30 ld [ %i5 + 0x30 ], %o2 4000c020: d6 17 60 3c lduh [ %i5 + 0x3c ], %o3 4000c024: 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; 4000c028: 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( 4000c02c: 40 00 02 b1 call 4000caf0 4000c030: 92 10 20 01 mov 1, %o1 RTEMS_FS_PERMS_EXEC, entry->st_mode, entry->st_uid, entry->st_gid ); if ( access_ok ) { 4000c034: 80 8a 20 ff btst 0xff, %o0 4000c038: 02 80 00 04 be 4000c048 <== NEVER TAKEN 4000c03c: 90 10 00 18 mov %i0, %o0 rtems_filesystem_eval_path_restart( ctx, fs_root_ptr ); 4000c040: 7f ff e4 a3 call 400052cc 4000c044: 92 10 00 1c mov %i4, %o1 void *arg, const char *token, size_t tokenlen ) { rtems_filesystem_eval_path_generic_status status = 4000c048: 81 c7 e0 08 ret 4000c04c: 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; 4000c050: c2 17 20 34 lduh [ %i4 + 0x34 ], %g1 4000c054: 82 00 7f ff add %g1, -1, %g1 4000c058: c2 37 20 34 sth %g1, [ %i4 + 0x34 ] ++entry->reference_count; 4000c05c: c2 17 60 34 lduh [ %i5 + 0x34 ], %g1 4000c060: 82 00 60 01 inc %g1 4000c064: 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; 4000c068: c2 07 60 4c ld [ %i5 + 0x4c ], %g1 currentloc->node_access = entry; 4000c06c: fa 26 20 20 st %i5, [ %i0 + 0x20 ] 4000c070: c2 00 60 04 ld [ %g1 + 4 ], %g1 4000c074: c2 26 20 28 st %g1, [ %i0 + 0x28 ] void *arg, const char *token, size_t tokenlen ) { rtems_filesystem_eval_path_generic_status status = 4000c078: b0 09 20 ff and %g4, 0xff, %i0 status = RTEMS_FILESYSTEM_EVAL_PATH_GENERIC_NO_ENTRY; } } return status; } 4000c07c: 81 c7 e0 08 ret 4000c080: 81 e8 00 00 restore =============================================================================== 4000c09c : int IMFS_fchmod( const rtems_filesystem_location_info_t *loc, mode_t mode ) { 4000c09c: 9d e3 bf 98 save %sp, -104, %sp /* * Verify I am the owner of the node or the super user. */ #if defined(RTEMS_POSIX_API) st_uid = geteuid(); 4000c0a0: 40 00 01 7d call 4000c694 4000c0a4: fa 06 20 08 ld [ %i0 + 8 ], %i5 if ( ( st_uid != jnode->st_uid ) && ( st_uid != 0 ) ) 4000c0a8: c2 17 60 3c lduh [ %i5 + 0x3c ], %g1 4000c0ac: 91 2a 20 10 sll %o0, 0x10, %o0 4000c0b0: 91 32 20 10 srl %o0, 0x10, %o0 4000c0b4: 80 a2 00 01 cmp %o0, %g1 4000c0b8: 02 80 00 0a be 4000c0e0 4000c0bc: 80 a2 20 00 cmp %o0, 0 4000c0c0: 22 80 00 09 be,a 4000c0e4 <== NEVER TAKEN 4000c0c4: c2 07 60 30 ld [ %i5 + 0x30 ], %g1 <== NOT EXECUTED rtems_set_errno_and_return_minus_one( EPERM ); 4000c0c8: 40 00 0e 87 call 4000fae4 <__errno> 4000c0cc: b0 10 3f ff mov -1, %i0 4000c0d0: 82 10 20 01 mov 1, %g1 4000c0d4: c2 22 00 00 st %g1, [ %o0 ] 4000c0d8: 81 c7 e0 08 ret 4000c0dc: 81 e8 00 00 restore /* * Change only the RWX permissions on the jnode to mode. */ jnode->st_mode &= ~(S_IRWXU | S_IRWXG | S_IRWXO | S_ISUID | S_ISGID | S_ISVTX); 4000c0e0: c2 07 60 30 ld [ %i5 + 0x30 ], %g1 jnode->st_mode |= mode & (S_IRWXU | S_IRWXG | S_IRWXO | S_ISUID | S_ISGID | S_ISVTX); IMFS_update_ctime( jnode ); 4000c0e4: 90 07 bf f8 add %fp, -8, %o0 /* * Change only the RWX permissions on the jnode to mode. */ jnode->st_mode &= ~(S_IRWXU | S_IRWXG | S_IRWXO | S_ISUID | S_ISGID | S_ISVTX); 4000c0e8: 82 08 70 00 and %g1, -4096, %g1 jnode->st_mode |= mode & (S_IRWXU | S_IRWXG | S_IRWXO | S_ISUID | S_ISGID | S_ISVTX); IMFS_update_ctime( jnode ); 4000c0ec: 92 10 20 00 clr %o1 /* * Change only the RWX permissions on the jnode to mode. */ jnode->st_mode &= ~(S_IRWXU | S_IRWXG | S_IRWXO | S_ISUID | S_ISGID | S_ISVTX); jnode->st_mode |= mode & (S_IRWXU | S_IRWXG | S_IRWXO | S_ISUID | S_ISGID | S_ISVTX); 4000c0f0: b2 0e 6f ff and %i1, 0xfff, %i1 4000c0f4: b2 16 40 01 or %i1, %g1, %i1 IMFS_update_ctime( jnode ); 4000c0f8: 7f ff df f5 call 400040cc 4000c0fc: f2 27 60 30 st %i1, [ %i5 + 0x30 ] 4000c100: c2 07 bf f8 ld [ %fp + -8 ], %g1 4000c104: c2 27 60 48 st %g1, [ %i5 + 0x48 ] return 0; } 4000c108: 81 c7 e0 08 ret 4000c10c: 91 e8 20 00 restore %g0, 0, %o0 =============================================================================== 400042b4 : static ssize_t IMFS_fifo_write( rtems_libio_t *iop, const void *buffer, size_t count ) { 400042b4: 9d e3 bf 98 save %sp, -104, %sp IMFS_jnode_t *jnode = iop->pathinfo.node_access; 400042b8: fa 06 20 1c ld [ %i0 + 0x1c ], %i5 int err = pipe_write(JNODE2PIPE(jnode), buffer, count, iop); 400042bc: 96 10 00 18 mov %i0, %o3 400042c0: d0 07 60 50 ld [ %i5 + 0x50 ], %o0 400042c4: 92 10 00 19 mov %i1, %o1 400042c8: 40 00 28 f5 call 4000e69c 400042cc: 94 10 00 1a mov %i2, %o2 if (err > 0) { 400042d0: b0 92 20 00 orcc %o0, 0, %i0 400042d4: 04 80 00 09 ble 400042f8 400042d8: 90 07 bf f8 add %fp, -8, %o0 IMFS_mtime_ctime_update(jnode); 400042dc: 40 00 03 86 call 400050f4 400042e0: 92 10 20 00 clr %o1 400042e4: c2 07 bf f8 ld [ %fp + -8 ], %g1 400042e8: c2 27 60 44 st %g1, [ %i5 + 0x44 ] 400042ec: c2 27 60 48 st %g1, [ %i5 + 0x48 ] 400042f0: 81 c7 e0 08 ret 400042f4: 81 e8 00 00 restore } IMFS_FIFO_RETURN(err); 400042f8: 80 a6 20 00 cmp %i0, 0 400042fc: 02 80 00 06 be 40004314 <== NEVER TAKEN 40004300: 01 00 00 00 nop 40004304: 40 00 34 fb call 400116f0 <__errno> 40004308: b0 20 00 18 neg %i0 4000430c: f0 22 00 00 st %i0, [ %o0 ] 40004310: b0 10 3f ff mov -1, %i0 } 40004314: 81 c7 e0 08 ret 40004318: 81 e8 00 00 restore =============================================================================== 4000c110 : ((IMFS_jnode_t *)( rtems_chain_head( jnode_get_control( jnode ) )->next)) void IMFS_fsunmount( rtems_filesystem_mount_table_entry_t *temp_mt_entry ) { 4000c110: 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; 4000c114: f6 06 20 24 ld [ %i0 + 0x24 ], %i3 4000c118: b8 07 bf e8 add %fp, -24, %i4 4000c11c: 92 10 00 1b mov %i3, %o1 4000c120: 90 10 00 1c mov %i4, %o0 4000c124: 40 00 10 c1 call 40010428 4000c128: 94 10 20 18 mov 0x18, %o2 jnode = (IMFS_jnode_t *)loc.node_access; 4000c12c: 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; 4000c130: c0 26 e0 08 clr [ %i3 + 8 ] 4000c134: b6 10 00 1c mov %i4, %i3 4000c138: c2 07 60 4c ld [ %i5 + 0x4c ], %g1 do { next = jnode->Parent; 4000c13c: f8 07 60 08 ld [ %i5 + 8 ], %i4 4000c140: 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 ) ) { 4000c144: 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; 4000c148: fa 27 bf f0 st %i5, [ %fp + -16 ] IMFS_Set_handlers( &loc ); if ( !IMFS_is_directory( jnode ) || jnode_has_no_children( jnode ) ) { 4000c14c: 80 a0 60 00 cmp %g1, 0 4000c150: 12 80 00 07 bne 4000c16c 4000c154: c4 27 bf f8 st %g2, [ %fp + -8 ] 4000c158: 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 ); 4000c15c: 82 07 60 54 add %i5, 0x54, %g1 4000c160: 80 a0 80 01 cmp %g2, %g1 4000c164: 32 80 00 10 bne,a 4000c1a4 4000c168: c2 07 60 4c ld [ %i5 + 0x4c ], %g1 result = IMFS_rmnod( NULL, &loc ); 4000c16c: 90 10 20 00 clr %o0 4000c170: 7f ff de 4d call 40003aa4 4000c174: 92 10 00 1b mov %i3, %o1 if ( result != 0 ) 4000c178: 80 a2 20 00 cmp %o0, 0 4000c17c: 02 80 00 04 be 4000c18c <== ALWAYS TAKEN 4000c180: 11 37 ab 6f sethi %hi(0xdeadbc00), %o0 rtems_fatal_error_occurred( 0xdeadbeef ); 4000c184: 7f ff f1 76 call 4000875c <== NOT EXECUTED 4000c188: 90 12 22 ef or %o0, 0x2ef, %o0 ! deadbeef <== NOT EXECUTED IMFS_node_destroy( jnode ); 4000c18c: 7f ff dd 74 call 4000375c 4000c190: 90 10 00 1d mov %i5, %o0 jnode = next; } if ( jnode != NULL ) { 4000c194: 80 a7 20 00 cmp %i4, 0 4000c198: 02 80 00 0e be 4000c1d0 4000c19c: 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; 4000c1a0: c2 07 60 4c ld [ %i5 + 0x4c ], %g1 if ( IMFS_is_directory( jnode ) ) { 4000c1a4: c2 00 40 00 ld [ %g1 ], %g1 4000c1a8: 80 a0 60 00 cmp %g1, 0 4000c1ac: 32 bf ff e4 bne,a 4000c13c <== NEVER TAKEN 4000c1b0: 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; 4000c1b4: 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 ); 4000c1b8: 84 07 60 54 add %i5, 0x54, %g2 if ( jnode_has_children( jnode ) ) 4000c1bc: 80 a0 40 02 cmp %g1, %g2 4000c1c0: 02 bf ff de be 4000c138 4000c1c4: 80 a0 60 00 cmp %g1, 0 jnode = jnode_get_first_child( jnode ); } } } while (jnode != NULL); 4000c1c8: 12 bf ff dc bne 4000c138 <== ALWAYS TAKEN 4000c1cc: ba 10 00 01 mov %g1, %i5 4000c1d0: 81 c7 e0 08 ret 4000c1d4: 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 7b sethi %hi(0x4001ec00), %g1 IMFS_jnode_t *root_node; fs_info->instance = imfs_instance++; 4000366c: c4 00 62 fc ld [ %g1 + 0x2fc ], %g2 ! 4001eefc 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 62 fc st %g2, [ %g1 + 0x2fc ] memcpy( 40003684: 40 00 33 69 call 40010428 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 74 sethi %hi(0x4001d000), %o2 40003698: 96 10 20 00 clr %o3 4000369c: 94 12 a3 18 or %o2, 0x318, %o2 400036a0: 19 00 00 10 sethi %hi(0x4000), %o4 400036a4: 9a 10 20 00 clr %o5 400036a8: 40 00 21 a5 call 4000bd3c 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 75 sethi %hi(0x4001d400), %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 61 84 or %g1, 0x184, %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 79 sethi %hi(0x4001e400), %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 63 70 ld [ %g1 + 0x370 ], %g1 } else { errno = ENOMEM; rv = -1; } } else { errno = ENOMEM; 400036f4: 40 00 30 fc call 4000fae4 <__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 7b sethi %hi(0x4001ec00), %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 7b sethi %hi(0x4001ec00), %g2 40003734: c2 20 a2 f8 st %g1, [ %g2 + 0x2f8 ] ! 4001eef8 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 6c sethi %hi(0x4001b000), %g1 40005428: c2 00 62 3c ld [ %g1 + 0x23c ], %g1 ! 4001b23c 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 2d 13 call 400108fc 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 3c 84 call 40014720 <__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 =============================================================================== 4000e708 : */ MEMFILE_STATIC int IMFS_memfile_addblock( IMFS_jnode_t *the_jnode, unsigned int block ) { 4000e708: 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 ); 4000e70c: 94 10 20 01 mov 1, %o2 4000e710: 90 10 00 18 mov %i0, %o0 4000e714: 7f ff fe d7 call 4000e270 4000e718: 92 10 00 19 mov %i1, %o1 if ( *block_entry_ptr ) 4000e71c: 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 ); 4000e720: ba 10 00 08 mov %o0, %i5 if ( *block_entry_ptr ) 4000e724: 80 a0 60 00 cmp %g1, 0 4000e728: 12 80 00 08 bne 4000e748 4000e72c: b0 10 20 00 clr %i0 return 0; /* * There is no memory for this block number so allocate it. */ memory = memfile_alloc_block(); 4000e730: 7f ff fe c3 call 4000e23c 4000e734: 01 00 00 00 nop if ( !memory ) 4000e738: 80 a2 20 00 cmp %o0, 0 4000e73c: 22 80 00 03 be,a 4000e748 <== NEVER TAKEN 4000e740: b0 10 20 01 mov 1, %i0 <== NOT EXECUTED return 1; *block_entry_ptr = memory; 4000e744: d0 27 40 00 st %o0, [ %i5 ] return 0; 4000e748: 81 c7 e0 08 ret 4000e74c: 81 e8 00 00 restore =============================================================================== 4000e91c : MEMFILE_STATIC int IMFS_memfile_extend( IMFS_jnode_t *the_jnode, bool zero_fill, off_t new_length ) { 4000e91c: 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 ) 4000e920: 03 10 00 7b sethi %hi(0x4001ec00), %g1 4000e924: fa 00 62 f8 ld [ %g1 + 0x2f8 ], %i5 ! 4001eef8 4000e928: b9 37 60 02 srl %i5, 2, %i4 4000e92c: 92 10 00 1c mov %i4, %o1 4000e930: 40 00 28 a2 call 40018bb8 <.umul> 4000e934: 90 07 20 01 add %i4, 1, %o0 4000e938: 92 10 00 1c mov %i4, %o1 4000e93c: 40 00 28 9f call 40018bb8 <.umul> 4000e940: 90 02 20 01 inc %o0 4000e944: 92 10 00 1d mov %i5, %o1 4000e948: 40 00 28 9c call 40018bb8 <.umul> 4000e94c: 90 02 3f ff add %o0, -1, %o0 4000e950: 82 10 20 00 clr %g1 4000e954: 80 a0 40 1a cmp %g1, %i2 4000e958: 34 80 00 0b bg,a 4000e984 <== NEVER TAKEN 4000e95c: f8 06 20 50 ld [ %i0 + 0x50 ], %i4 <== NOT EXECUTED 4000e960: 80 a0 40 1a cmp %g1, %i2 4000e964: 12 80 00 04 bne 4000e974 <== NEVER TAKEN 4000e968: 80 a2 00 1b cmp %o0, %i3 4000e96c: 38 80 00 06 bgu,a 4000e984 4000e970: f8 06 20 50 ld [ %i0 + 0x50 ], %i4 rtems_set_errno_and_return_minus_one( EFBIG ); 4000e974: 40 00 04 5c call 4000fae4 <__errno> 4000e978: 01 00 00 00 nop 4000e97c: 10 80 00 3c b 4000ea6c 4000e980: 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 ) 4000e984: 80 a6 80 1c cmp %i2, %i4 4000e988: 14 80 00 07 bg 4000e9a4 <== NEVER TAKEN 4000e98c: e0 06 20 54 ld [ %i0 + 0x54 ], %l0 4000e990: 80 a6 80 1c cmp %i2, %i4 4000e994: 12 80 00 48 bne 4000eab4 <== NEVER TAKEN 4000e998: 80 a6 c0 10 cmp %i3, %l0 4000e99c: 08 80 00 46 bleu 4000eab4 <== NEVER TAKEN 4000e9a0: 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; 4000e9a4: a3 3f 60 1f sra %i5, 0x1f, %l1 4000e9a8: 96 10 00 1d mov %i5, %o3 4000e9ac: 94 10 00 11 mov %l1, %o2 4000e9b0: 90 10 00 1a mov %i2, %o0 4000e9b4: 40 00 2a 13 call 40019200 <__divdi3> 4000e9b8: 92 10 00 1b mov %i3, %o1 old_blocks = the_jnode->info.file.size / IMFS_MEMFILE_BYTES_PER_BLOCK; 4000e9bc: 94 10 00 11 mov %l1, %o2 4000e9c0: 90 10 00 1c mov %i4, %o0 4000e9c4: 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; 4000e9c8: a4 10 00 09 mov %o1, %l2 old_blocks = the_jnode->info.file.size / IMFS_MEMFILE_BYTES_PER_BLOCK; 4000e9cc: 40 00 2a 0d call 40019200 <__divdi3> 4000e9d0: 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++ ) { 4000e9d4: 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; 4000e9d8: 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; 4000e9dc: 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; 4000e9e0: 27 10 00 7b sethi %hi(0x4001ec00), %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; 4000e9e4: 40 00 28 75 call 40018bb8 <.umul> 4000e9e8: 92 10 00 1d mov %i5, %o1 /* * Now allocate each of those blocks. */ for ( block=old_blocks ; block<=new_blocks ; block++ ) { 4000e9ec: 10 80 00 23 b 4000ea78 4000e9f0: a0 24 00 08 sub %l0, %o0, %l0 if ( !IMFS_memfile_addblock( the_jnode, block ) ) { 4000e9f4: 7f ff ff 45 call 4000e708 4000e9f8: 92 10 00 1d mov %i5, %o1 4000e9fc: 80 a2 20 00 cmp %o0, 0 4000ea00: 12 80 00 15 bne 4000ea54 <== NEVER TAKEN 4000ea04: 80 a6 60 00 cmp %i1, 0 if ( zero_fill ) { 4000ea08: 22 80 00 1c be,a 4000ea78 4000ea0c: a2 04 60 01 inc %l1 size_t count = IMFS_MEMFILE_BYTES_PER_BLOCK - offset; 4000ea10: e8 04 e2 f8 ld [ %l3 + 0x2f8 ], %l4 block_p *block_ptr = 4000ea14: 92 10 00 1d mov %i5, %o1 4000ea18: 94 10 20 00 clr %o2 4000ea1c: 7f ff fe 15 call 4000e270 4000ea20: 90 10 00 18 mov %i0, %o0 IMFS_memfile_get_block_pointer( the_jnode, block, 0 ); memset( &(*block_ptr) [offset], 0, count); 4000ea24: 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; 4000ea28: 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); 4000ea2c: 90 02 00 10 add %o0, %l0, %o0 4000ea30: 92 10 20 00 clr %o1 4000ea34: 94 10 00 14 mov %l4, %o2 4000ea38: 40 00 06 b9 call 4001051c 4000ea3c: a0 10 20 00 clr %l0 4000ea40: 10 80 00 0e b 4000ea78 4000ea44: a2 04 60 01 inc %l1 offset = 0; } } else { for ( ; block>=old_blocks ; block-- ) { IMFS_memfile_remove_block( the_jnode, block ); 4000ea48: 90 10 00 18 mov %i0, %o0 <== NOT EXECUTED 4000ea4c: 7f ff ff a8 call 4000e8ec <== NOT EXECUTED 4000ea50: ba 07 7f ff add %i5, -1, %i5 <== NOT EXECUTED memset( &(*block_ptr) [offset], 0, count); offset = 0; } } else { for ( ; block>=old_blocks ; block-- ) { 4000ea54: 80 a7 40 1c cmp %i5, %i4 <== NOT EXECUTED 4000ea58: 1a bf ff fc bcc 4000ea48 <== NOT EXECUTED 4000ea5c: 92 10 00 1d mov %i5, %o1 <== NOT EXECUTED IMFS_memfile_remove_block( the_jnode, block ); } rtems_set_errno_and_return_minus_one( ENOSPC ); 4000ea60: 40 00 04 21 call 4000fae4 <__errno> <== NOT EXECUTED 4000ea64: 01 00 00 00 nop <== NOT EXECUTED 4000ea68: 82 10 20 1c mov 0x1c, %g1 ! 1c <== NOT EXECUTED 4000ea6c: c2 22 00 00 st %g1, [ %o0 ] 4000ea70: 81 c7 e0 08 ret 4000ea74: 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( 4000ea78: 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++ ) { 4000ea7c: 80 a7 40 12 cmp %i5, %l2 4000ea80: 08 bf ff dd bleu 4000e9f4 4000ea84: 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); 4000ea88: 92 10 20 00 clr %o1 } /* * Set the new length of the file. */ the_jnode->info.file.size = new_length; 4000ea8c: f4 3e 20 50 std %i2, [ %i0 + 0x50 ] IMFS_update_ctime(the_jnode); 4000ea90: 7f ff d5 8f call 400040cc 4000ea94: 90 07 bf f8 add %fp, -8, %o0 4000ea98: c2 07 bf f8 ld [ %fp + -8 ], %g1 IMFS_update_mtime(the_jnode); 4000ea9c: 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); 4000eaa0: c2 26 20 48 st %g1, [ %i0 + 0x48 ] IMFS_update_mtime(the_jnode); 4000eaa4: 7f ff d5 8a call 400040cc 4000eaa8: 92 10 20 00 clr %o1 4000eaac: c2 07 bf f8 ld [ %fp + -8 ], %g1 4000eab0: c2 26 20 44 st %g1, [ %i0 + 0x44 ] return 0; } 4000eab4: 81 c7 e0 08 ret 4000eab8: 91 e8 20 00 restore %g0, 0, %o0 =============================================================================== 4000e270 : #endif IMFS_jnode_t *the_jnode, unsigned int block, int malloc_it ) { 4000e270: 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 ) { 4000e274: 03 10 00 7b sethi %hi(0x4001ec00), %g1 4000e278: fa 00 62 f8 ld [ %g1 + 0x2f8 ], %i5 ! 4001eef8 4000e27c: bb 37 60 02 srl %i5, 2, %i5 4000e280: 82 07 7f ff add %i5, -1, %g1 4000e284: 80 a6 40 01 cmp %i1, %g1 4000e288: 18 80 00 18 bgu 4000e2e8 4000e28c: 90 07 60 01 add %i5, 1, %o0 p = info->indirect; if ( malloc_it ) { 4000e290: 80 a6 a0 00 cmp %i2, 0 4000e294: 02 80 00 10 be 4000e2d4 4000e298: c2 06 20 58 ld [ %i0 + 0x58 ], %g1 if ( !p ) { 4000e29c: 80 a0 60 00 cmp %g1, 0 4000e2a0: 32 80 00 0a bne,a 4000e2c8 4000e2a4: f0 06 20 58 ld [ %i0 + 0x58 ], %i0 p = memfile_alloc_block(); 4000e2a8: 7f ff ff e5 call 4000e23c 4000e2ac: 01 00 00 00 nop if ( !p ) 4000e2b0: 80 a2 20 00 cmp %o0, 0 4000e2b4: 32 80 00 04 bne,a 4000e2c4 <== ALWAYS TAKEN 4000e2b8: d0 26 20 58 st %o0, [ %i0 + 0x58 ] return 0; 4000e2bc: 81 c7 e0 08 ret <== NOT EXECUTED 4000e2c0: 91 e8 20 00 restore %g0, 0, %o0 <== NOT EXECUTED info->indirect = p; } return &info->indirect[ my_block ]; 4000e2c4: f0 06 20 58 ld [ %i0 + 0x58 ], %i0 4000e2c8: b3 2e 60 02 sll %i1, 2, %i1 4000e2cc: 81 c7 e0 08 ret 4000e2d0: 91 ee 00 19 restore %i0, %i1, %o0 } if ( !p ) 4000e2d4: 80 a0 60 00 cmp %g1, 0 4000e2d8: 02 bf ff f9 be 4000e2bc <== NEVER TAKEN 4000e2dc: b3 2e 60 02 sll %i1, 2, %i1 return 0; return &info->indirect[ my_block ]; 4000e2e0: 81 c7 e0 08 ret 4000e2e4: 91 e8 40 19 restore %g1, %i1, %o0 /* * Is the block number in the doubly indirect portion? */ if ( my_block <= LAST_DOUBLY_INDIRECT ) { 4000e2e8: 40 00 2a 34 call 40018bb8 <.umul> 4000e2ec: 92 10 00 1d mov %i5, %o1 4000e2f0: 82 02 3f ff add %o0, -1, %g1 4000e2f4: 80 a6 40 01 cmp %i1, %g1 4000e2f8: 18 80 00 2c bgu 4000e3a8 4000e2fc: b8 10 00 08 mov %o0, %i4 my_block -= FIRST_DOUBLY_INDIRECT; 4000e300: b2 26 40 1d sub %i1, %i5, %i1 singly = my_block % IMFS_MEMFILE_BLOCK_SLOTS; 4000e304: 92 10 00 1d mov %i5, %o1 4000e308: 40 00 2b 12 call 40018f50 <.urem> 4000e30c: 90 10 00 19 mov %i1, %o0 doubly = my_block / IMFS_MEMFILE_BLOCK_SLOTS; 4000e310: 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; 4000e314: b8 10 00 08 mov %o0, %i4 doubly = my_block / IMFS_MEMFILE_BLOCK_SLOTS; 4000e318: 40 00 2a 62 call 40018ca0 <.udiv> 4000e31c: 90 10 00 19 mov %i1, %o0 p = info->doubly_indirect; if ( malloc_it ) { 4000e320: 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; 4000e324: ba 10 00 08 mov %o0, %i5 p = info->doubly_indirect; if ( malloc_it ) { 4000e328: 02 80 00 17 be 4000e384 4000e32c: d0 06 20 5c ld [ %i0 + 0x5c ], %o0 if ( !p ) { 4000e330: 80 a2 20 00 cmp %o0, 0 4000e334: 12 80 00 08 bne 4000e354 4000e338: bb 2f 60 02 sll %i5, 2, %i5 p = memfile_alloc_block(); 4000e33c: 7f ff ff c0 call 4000e23c 4000e340: 01 00 00 00 nop if ( !p ) 4000e344: 80 a2 20 00 cmp %o0, 0 4000e348: 02 bf ff dd be 4000e2bc <== NEVER TAKEN 4000e34c: 01 00 00 00 nop return 0; info->doubly_indirect = p; 4000e350: d0 26 20 5c st %o0, [ %i0 + 0x5c ] } p1 = (block_p *)p[ doubly ]; 4000e354: b6 02 00 1d add %o0, %i5, %i3 4000e358: d0 02 00 1d ld [ %o0 + %i5 ], %o0 if ( !p1 ) { 4000e35c: 80 a2 20 00 cmp %o0, 0 4000e360: 12 80 00 4a bne 4000e488 4000e364: b1 2f 20 02 sll %i4, 2, %i0 p1 = memfile_alloc_block(); 4000e368: 7f ff ff b5 call 4000e23c 4000e36c: 01 00 00 00 nop if ( !p1 ) 4000e370: 80 a2 20 00 cmp %o0, 0 4000e374: 02 bf ff d2 be 4000e2bc <== NEVER TAKEN 4000e378: 01 00 00 00 nop return 0; p[ doubly ] = (block_p) p1; 4000e37c: 10 80 00 43 b 4000e488 4000e380: d0 26 c0 00 st %o0, [ %i3 ] } return (block_p *)&p1[ singly ]; } if ( !p ) 4000e384: 80 a2 20 00 cmp %o0, 0 4000e388: 02 bf ff cd be 4000e2bc <== NEVER TAKEN 4000e38c: bb 2f 60 02 sll %i5, 2, %i5 return 0; p = (block_p *)p[ doubly ]; 4000e390: c2 02 00 1d ld [ %o0 + %i5 ], %g1 if ( !p ) 4000e394: 80 a0 60 00 cmp %g1, 0 4000e398: 02 bf ff c9 be 4000e2bc <== NEVER TAKEN 4000e39c: 01 00 00 00 nop return 0; return (block_p *)&p[ singly ]; 4000e3a0: 10 80 00 48 b 4000e4c0 4000e3a4: b1 2f 20 02 sll %i4, 2, %i0 } /* * Is the block number in the triply indirect portion? */ if ( my_block <= LAST_TRIPLY_INDIRECT ) { 4000e3a8: 90 02 20 01 inc %o0 4000e3ac: 40 00 2a 03 call 40018bb8 <.umul> 4000e3b0: 92 10 00 1d mov %i5, %o1 4000e3b4: 90 02 3f ff add %o0, -1, %o0 4000e3b8: 80 a6 40 08 cmp %i1, %o0 4000e3bc: 18 bf ff c0 bgu 4000e2bc <== NEVER TAKEN 4000e3c0: b2 26 40 1c sub %i1, %i4, %i1 my_block -= FIRST_TRIPLY_INDIRECT; singly = my_block % IMFS_MEMFILE_BLOCK_SLOTS; 4000e3c4: 92 10 00 1d mov %i5, %o1 4000e3c8: 40 00 2a e2 call 40018f50 <.urem> 4000e3cc: 90 10 00 19 mov %i1, %o0 doubly = my_block / IMFS_MEMFILE_BLOCK_SLOTS; 4000e3d0: 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; 4000e3d4: b6 10 00 08 mov %o0, %i3 doubly = my_block / IMFS_MEMFILE_BLOCK_SLOTS; 4000e3d8: 40 00 2a 32 call 40018ca0 <.udiv> 4000e3dc: 90 10 00 19 mov %i1, %o0 triply = doubly / IMFS_MEMFILE_BLOCK_SLOTS; 4000e3e0: 92 10 00 1d mov %i5, %o1 4000e3e4: 40 00 2a 2f call 40018ca0 <.udiv> 4000e3e8: b2 10 00 08 mov %o0, %i1 doubly %= IMFS_MEMFILE_BLOCK_SLOTS; 4000e3ec: 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; 4000e3f0: b8 10 00 08 mov %o0, %i4 doubly %= IMFS_MEMFILE_BLOCK_SLOTS; 4000e3f4: 40 00 2a d7 call 40018f50 <.urem> 4000e3f8: 90 10 00 19 mov %i1, %o0 p = info->triply_indirect; if ( malloc_it ) { 4000e3fc: 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; 4000e400: ba 10 00 08 mov %o0, %i5 p = info->triply_indirect; if ( malloc_it ) { 4000e404: 02 80 00 23 be 4000e490 4000e408: d0 06 20 60 ld [ %i0 + 0x60 ], %o0 if ( !p ) { 4000e40c: 80 a2 20 00 cmp %o0, 0 4000e410: 12 80 00 08 bne 4000e430 4000e414: b9 2f 20 02 sll %i4, 2, %i4 p = memfile_alloc_block(); 4000e418: 7f ff ff 89 call 4000e23c 4000e41c: 01 00 00 00 nop if ( !p ) 4000e420: 80 a2 20 00 cmp %o0, 0 4000e424: 02 bf ff a6 be 4000e2bc <== NEVER TAKEN 4000e428: 01 00 00 00 nop return 0; info->triply_indirect = p; 4000e42c: d0 26 20 60 st %o0, [ %i0 + 0x60 ] } p1 = (block_p *) p[ triply ]; 4000e430: b4 02 00 1c add %o0, %i4, %i2 4000e434: d0 02 00 1c ld [ %o0 + %i4 ], %o0 if ( !p1 ) { 4000e438: 80 a2 20 00 cmp %o0, 0 4000e43c: 12 80 00 08 bne 4000e45c 4000e440: bb 2f 60 02 sll %i5, 2, %i5 p1 = memfile_alloc_block(); 4000e444: 7f ff ff 7e call 4000e23c 4000e448: 01 00 00 00 nop if ( !p1 ) 4000e44c: 80 a2 20 00 cmp %o0, 0 4000e450: 02 bf ff 9b be 4000e2bc <== NEVER TAKEN 4000e454: 01 00 00 00 nop return 0; p[ triply ] = (block_p) p1; 4000e458: d0 26 80 00 st %o0, [ %i2 ] } p2 = (block_p *)p1[ doubly ]; 4000e45c: b8 02 00 1d add %o0, %i5, %i4 4000e460: d0 02 00 1d ld [ %o0 + %i5 ], %o0 if ( !p2 ) { 4000e464: 80 a2 20 00 cmp %o0, 0 4000e468: 12 80 00 08 bne 4000e488 4000e46c: b1 2e e0 02 sll %i3, 2, %i0 p2 = memfile_alloc_block(); 4000e470: 7f ff ff 73 call 4000e23c 4000e474: 01 00 00 00 nop if ( !p2 ) 4000e478: 80 a2 20 00 cmp %o0, 0 4000e47c: 02 bf ff 90 be 4000e2bc <== NEVER TAKEN 4000e480: 01 00 00 00 nop return 0; p1[ doubly ] = (block_p) p2; 4000e484: d0 27 00 00 st %o0, [ %i4 ] } return (block_p *)&p2[ singly ]; 4000e488: 81 c7 e0 08 ret 4000e48c: 91 ea 00 18 restore %o0, %i0, %o0 } if ( !p ) 4000e490: 80 a2 20 00 cmp %o0, 0 4000e494: 02 bf ff 8a be 4000e2bc <== NEVER TAKEN 4000e498: b9 2f 20 02 sll %i4, 2, %i4 return 0; p1 = (block_p *) p[ triply ]; 4000e49c: c2 02 00 1c ld [ %o0 + %i4 ], %g1 if ( !p1 ) 4000e4a0: 80 a0 60 00 cmp %g1, 0 4000e4a4: 02 bf ff 86 be 4000e2bc <== NEVER TAKEN 4000e4a8: bb 2f 60 02 sll %i5, 2, %i5 return 0; p2 = (block_p *)p1[ doubly ]; 4000e4ac: c2 00 40 1d ld [ %g1 + %i5 ], %g1 if ( !p2 ) 4000e4b0: 80 a0 60 00 cmp %g1, 0 4000e4b4: 02 bf ff 82 be 4000e2bc <== NEVER TAKEN 4000e4b8: 01 00 00 00 nop return 0; return (block_p *)&p2[ singly ]; 4000e4bc: b1 2e e0 02 sll %i3, 2, %i0 /* * This means the requested block number is out of range. */ return 0; } 4000e4c0: 81 c7 e0 08 ret 4000e4c4: 91 e8 40 18 restore %g1, %i0, %o0 =============================================================================== 4000e4c8 : IMFS_jnode_t *the_jnode, off_t start, unsigned char *destination, unsigned int length ) { 4000e4c8: 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; 4000e4cc: c2 06 20 4c ld [ %i0 + 0x4c ], %g1 4000e4d0: 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 ) { 4000e4d4: c2 00 40 00 ld [ %g1 ], %g1 IMFS_jnode_t *the_jnode, off_t start, unsigned char *destination, unsigned int length ) { 4000e4d8: a0 10 00 19 mov %i1, %l0 4000e4dc: 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 ) { 4000e4e0: 80 a0 60 05 cmp %g1, 5 4000e4e4: 12 80 00 17 bne 4000e540 4000e4e8: 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)) 4000e4ec: f4 1e 20 50 ldd [ %i0 + 0x50 ], %i2 4000e4f0: 82 10 20 00 clr %g1 4000e4f4: 86 a6 c0 11 subcc %i3, %l1, %g3 4000e4f8: 84 66 80 19 subx %i2, %i1, %g2 4000e4fc: 80 a0 40 02 cmp %g1, %g2 4000e500: 14 80 00 07 bg 4000e51c <== NEVER TAKEN 4000e504: d2 06 20 58 ld [ %i0 + 0x58 ], %o1 4000e508: 80 a0 40 02 cmp %g1, %g2 4000e50c: 12 80 00 06 bne 4000e524 <== NEVER TAKEN 4000e510: 80 a7 00 03 cmp %i4, %g3 4000e514: 28 80 00 05 bleu,a 4000e528 <== NEVER TAKEN 4000e518: b0 10 00 1c mov %i4, %i0 <== NOT EXECUTED my_length = the_jnode->info.linearfile.size - start; 4000e51c: 10 80 00 03 b 4000e528 4000e520: 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; 4000e524: 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); 4000e528: 90 10 00 12 mov %l2, %o0 4000e52c: 92 02 40 11 add %o1, %l1, %o1 4000e530: 40 00 07 be call 40010428 4000e534: 94 10 00 18 mov %i0, %o2 return copied; memcpy( dest, &(*block_ptr)[ 0 ], my_length ); copied += my_length; } IMFS_update_atime( the_jnode ); 4000e538: 10 80 00 5d b 4000e6ac 4000e53c: 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 ) 4000e540: c6 06 20 50 ld [ %i0 + 0x50 ], %g3 4000e544: 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; 4000e548: 82 10 00 1a mov %i2, %g1 if ( last_byte > the_jnode->info.file.size ) 4000e54c: c4 06 20 54 ld [ %i0 + 0x54 ], %g2 4000e550: 80 a1 00 03 cmp %g4, %g3 4000e554: 14 80 00 08 bg 4000e574 <== NEVER TAKEN 4000e558: b6 07 00 1a add %i4, %i2, %i3 4000e55c: 80 a1 00 03 cmp %g4, %g3 4000e560: 32 80 00 07 bne,a 4000e57c <== NEVER TAKEN 4000e564: 03 10 00 7b sethi %hi(0x4001ec00), %g1 <== NOT EXECUTED 4000e568: 80 a6 c0 02 cmp %i3, %g2 4000e56c: 28 80 00 04 bleu,a 4000e57c 4000e570: 03 10 00 7b sethi %hi(0x4001ec00), %g1 my_length = the_jnode->info.file.size - start; 4000e574: 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; 4000e578: 03 10 00 7b sethi %hi(0x4001ec00), %g1 4000e57c: f6 00 62 f8 ld [ %g1 + 0x2f8 ], %i3 ! 4001eef8 4000e580: 90 10 00 10 mov %l0, %o0 4000e584: b5 3e e0 1f sra %i3, 0x1f, %i2 4000e588: 96 10 00 1b mov %i3, %o3 4000e58c: 94 10 00 1a mov %i2, %o2 4000e590: 40 00 2c 07 call 400195ac <__moddi3> 4000e594: 92 10 00 11 mov %l1, %o1 block = start / IMFS_MEMFILE_BYTES_PER_BLOCK; 4000e598: 94 10 00 1a mov %i2, %o2 */ /* * Phase 1: possibly the last part of one block */ start_offset = start % IMFS_MEMFILE_BYTES_PER_BLOCK; 4000e59c: a6 10 00 09 mov %o1, %l3 block = start / IMFS_MEMFILE_BYTES_PER_BLOCK; 4000e5a0: 90 10 00 10 mov %l0, %o0 4000e5a4: 92 10 00 11 mov %l1, %o1 4000e5a8: 40 00 2b 16 call 40019200 <__divdi3> 4000e5ac: 96 10 00 1b mov %i3, %o3 if ( start_offset ) { 4000e5b0: 80 a4 e0 00 cmp %l3, 0 4000e5b4: 02 80 00 18 be 4000e614 4000e5b8: b4 10 00 09 mov %o1, %i2 to_copy = IMFS_MEMFILE_BYTES_PER_BLOCK - start_offset; 4000e5bc: b6 26 c0 13 sub %i3, %l3, %i3 4000e5c0: 80 a7 00 1b cmp %i4, %i3 4000e5c4: 08 80 00 03 bleu 4000e5d0 4000e5c8: b2 10 00 1c mov %i4, %i1 4000e5cc: 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 ); 4000e5d0: 90 10 00 1d mov %i5, %o0 4000e5d4: 92 10 00 1a mov %i2, %o1 4000e5d8: 94 10 20 00 clr %o2 4000e5dc: 7f ff ff 25 call 4000e270 4000e5e0: b0 10 20 00 clr %i0 if ( !block_ptr ) 4000e5e4: 80 a2 20 00 cmp %o0, 0 4000e5e8: 02 80 00 35 be 4000e6bc <== NEVER TAKEN 4000e5ec: 94 10 00 19 mov %i1, %o2 return copied; memcpy( dest, &(*block_ptr)[ start_offset ], to_copy ); 4000e5f0: d2 02 00 00 ld [ %o0 ], %o1 4000e5f4: 90 10 00 12 mov %l2, %o0 4000e5f8: 92 02 40 13 add %o1, %l3, %o1 4000e5fc: 40 00 07 8b call 40010428 4000e600: a4 04 80 19 add %l2, %i1, %l2 dest += to_copy; block++; 4000e604: b4 06 a0 01 inc %i2 my_length -= to_copy; 4000e608: b8 27 00 19 sub %i4, %i1, %i4 copied += to_copy; 4000e60c: 10 80 00 03 b 4000e618 4000e610: 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; 4000e614: b0 10 20 00 clr %i0 } /* * Phase 2: all of zero of more blocks */ to_copy = IMFS_MEMFILE_BYTES_PER_BLOCK; 4000e618: 03 10 00 7b sethi %hi(0x4001ec00), %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( 4000e61c: a4 24 80 18 sub %l2, %i0, %l2 } /* * Phase 2: all of zero of more blocks */ to_copy = IMFS_MEMFILE_BYTES_PER_BLOCK; 4000e620: f6 00 62 f8 ld [ %g1 + 0x2f8 ], %i3 while ( my_length >= IMFS_MEMFILE_BYTES_PER_BLOCK ) { 4000e624: 10 80 00 0f b 4000e660 4000e628: a0 10 00 01 mov %g1, %l0 block_ptr = IMFS_memfile_get_block_pointer( the_jnode, block, 0 ); 4000e62c: 90 10 00 1d mov %i5, %o0 4000e630: 92 10 00 1a mov %i2, %o1 4000e634: 7f ff ff 0f call 4000e270 4000e638: 94 10 20 00 clr %o2 if ( !block_ptr ) 4000e63c: 82 92 20 00 orcc %o0, 0, %g1 4000e640: 02 80 00 1f be 4000e6bc <== NEVER TAKEN 4000e644: 90 10 00 19 mov %i1, %o0 return copied; memcpy( dest, &(*block_ptr)[ 0 ], to_copy ); 4000e648: d2 00 40 00 ld [ %g1 ], %o1 4000e64c: 94 10 00 1b mov %i3, %o2 4000e650: 40 00 07 76 call 40010428 4000e654: b4 06 a0 01 inc %i2 dest += to_copy; block++; my_length -= to_copy; 4000e658: b8 27 00 1b sub %i4, %i3, %i4 copied += to_copy; 4000e65c: 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 ) { 4000e660: c2 04 22 f8 ld [ %l0 + 0x2f8 ], %g1 4000e664: 80 a7 00 01 cmp %i4, %g1 4000e668: 1a bf ff f1 bcc 4000e62c 4000e66c: 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 ) { 4000e670: 80 a7 20 00 cmp %i4, 0 4000e674: 02 80 00 0e be 4000e6ac 4000e678: 90 07 bf f8 add %fp, -8, %o0 block_ptr = IMFS_memfile_get_block_pointer( the_jnode, block, 0 ); 4000e67c: 90 10 00 1d mov %i5, %o0 4000e680: 92 10 00 1a mov %i2, %o1 4000e684: 7f ff fe fb call 4000e270 4000e688: 94 10 20 00 clr %o2 if ( !block_ptr ) 4000e68c: 82 92 20 00 orcc %o0, 0, %g1 4000e690: 02 80 00 0b be 4000e6bc <== NEVER TAKEN 4000e694: 90 10 00 19 mov %i1, %o0 return copied; memcpy( dest, &(*block_ptr)[ 0 ], my_length ); 4000e698: d2 00 40 00 ld [ %g1 ], %o1 4000e69c: 94 10 00 1c mov %i4, %o2 4000e6a0: 40 00 07 62 call 40010428 4000e6a4: b0 07 00 18 add %i4, %i0, %i0 copied += my_length; } IMFS_update_atime( the_jnode ); 4000e6a8: 90 07 bf f8 add %fp, -8, %o0 4000e6ac: 7f ff d6 88 call 400040cc 4000e6b0: 92 10 20 00 clr %o1 4000e6b4: c2 07 bf f8 ld [ %fp + -8 ], %g1 4000e6b8: c2 27 60 40 st %g1, [ %i5 + 0x40 ] return copied; } 4000e6bc: 81 c7 e0 08 ret 4000e6c0: 81 e8 00 00 restore =============================================================================== 4000e7c0 : * is better to stick to simple, easy to understand algorithms. */ IMFS_jnode_t *IMFS_memfile_remove( IMFS_jnode_t *the_jnode ) { 4000e7c0: 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; 4000e7c4: 03 10 00 7b sethi %hi(0x4001ec00), %g1 4000e7c8: fa 00 62 f8 ld [ %g1 + 0x2f8 ], %i5 ! 4001eef8 * + doubly indirect * + triply indirect */ info = &the_jnode->info.file; if ( info->indirect ) { 4000e7cc: c2 06 20 58 ld [ %i0 + 0x58 ], %g1 4000e7d0: 80 a0 60 00 cmp %g1, 0 4000e7d4: 02 80 00 05 be 4000e7e8 4000e7d8: bb 37 60 02 srl %i5, 2, %i5 memfile_free_blocks_in_table( &info->indirect, to_free ); 4000e7dc: 90 06 20 58 add %i0, 0x58, %o0 4000e7e0: 7f ff ff e5 call 4000e774 4000e7e4: 92 10 00 1d mov %i5, %o1 } if ( info->doubly_indirect ) { 4000e7e8: c2 06 20 5c ld [ %i0 + 0x5c ], %g1 4000e7ec: b8 10 20 00 clr %i4 4000e7f0: 80 a0 60 00 cmp %g1, 0 4000e7f4: 12 80 00 0d bne 4000e828 4000e7f8: 37 10 00 7b sethi %hi(0x4001ec00), %i3 } memfile_free_blocks_in_table( &info->doubly_indirect, to_free ); } if ( info->triply_indirect ) { 4000e7fc: 10 80 00 15 b 4000e850 4000e800: 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( 4000e804: 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] ) { 4000e808: 90 00 80 01 add %g2, %g1, %o0 4000e80c: c2 00 80 01 ld [ %g2 + %g1 ], %g1 4000e810: 80 a0 60 00 cmp %g1, 0 4000e814: 22 80 00 05 be,a 4000e828 <== NEVER TAKEN 4000e818: b8 07 20 01 inc %i4 <== NOT EXECUTED memfile_free_blocks_in_table( 4000e81c: 7f ff ff d6 call 4000e774 4000e820: 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 4000e838: 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 ); 4000e83c: 90 06 20 5c add %i0, 0x5c, %o0 4000e840: 7f ff ff cd call 4000e774 4000e844: 92 10 00 1d mov %i5, %o1 } if ( info->triply_indirect ) { 4000e848: c2 06 20 60 ld [ %i0 + 0x60 ], %g1 4000e84c: b8 10 20 00 clr %i4 4000e850: 80 a0 60 00 cmp %g1, 0 4000e854: 12 80 00 1c bne 4000e8c4 4000e858: 33 10 00 7b sethi %hi(0x4001ec00), %i1 4000e85c: 81 c7 e0 08 ret 4000e860: 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( 4000e864: a1 2f 20 02 sll %i4, 2, %l0 } if ( info->triply_indirect ) { for ( i=0 ; itriply_indirect[i]; 4000e868: f6 00 40 10 ld [ %g1 + %l0 ], %i3 if ( !p ) /* ensure we have a valid pointer */ 4000e86c: 80 a6 e0 00 cmp %i3, 0 4000e870: 02 80 00 1b be 4000e8dc <== NEVER TAKEN 4000e874: 90 06 20 60 add %i0, 0x60, %o0 4000e878: 10 80 00 09 b 4000e89c 4000e87c: b4 10 20 00 clr %i2 break; for ( j=0 ; j <== NEVER TAKEN 4000e888: 90 10 00 1b mov %i3, %o0 memfile_free_blocks_in_table( (block_p **)&p[j], to_free); 4000e88c: 7f ff ff ba call 4000e774 4000e890: 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 4000e8ac: 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( 4000e8b0: d0 06 20 60 ld [ %i0 + 0x60 ], %o0 4000e8b4: 92 10 00 1d mov %i5, %o1 4000e8b8: 90 02 00 10 add %o0, %l0, %o0 4000e8bc: 7f ff ff ae call 4000e774 4000e8c0: b8 07 20 01 inc %i4 memfile_free_blocks_in_table( &info->doubly_indirect, to_free ); } if ( info->triply_indirect ) { for ( i=0 ; i 4000e8d4: 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( 4000e8d8: 90 06 20 60 add %i0, 0x60, %o0 4000e8dc: 7f ff ff a6 call 4000e774 4000e8e0: 92 10 00 1d mov %i5, %o1 (block_p **)&info->triply_indirect, to_free ); } return the_jnode; } 4000e8e4: 81 c7 e0 08 ret 4000e8e8: 81 e8 00 00 restore =============================================================================== 4000e8ec : */ MEMFILE_STATIC int IMFS_memfile_remove_block( IMFS_jnode_t *the_jnode, unsigned int block ) { 4000e8ec: 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 ); 4000e8f0: 94 10 20 00 clr %o2 <== NOT EXECUTED 4000e8f4: 92 10 00 19 mov %i1, %o1 <== NOT EXECUTED 4000e8f8: 7f ff fe 5e call 4000e270 <== NOT EXECUTED 4000e8fc: 90 10 00 18 mov %i0, %o0 <== NOT EXECUTED 4000e900: 82 10 00 08 mov %o0, %g1 <== NOT EXECUTED IMFS_assert( block_ptr ); ptr = *block_ptr; 4000e904: d0 02 00 00 ld [ %o0 ], %o0 <== NOT EXECUTED *block_ptr = 0; memfile_free_block( ptr ); return 1; } 4000e908: 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 ); 4000e90c: 7f ff ff 91 call 4000e750 <== NOT EXECUTED 4000e910: c0 20 40 00 clr [ %g1 ] <== NOT EXECUTED return 1; } 4000e914: 81 c7 e0 08 ret <== NOT EXECUTED 4000e918: 81 e8 00 00 restore <== NOT EXECUTED =============================================================================== 4000eabc : IMFS_jnode_t *the_jnode, off_t start, const unsigned char *source, unsigned int length ) { 4000eabc: 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 ) { 4000eac0: c2 06 20 50 ld [ %i0 + 0x50 ], %g1 4000eac4: 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; 4000eac8: 96 07 00 1a add %i4, %i2, %o3 if ( last_byte > the_jnode->info.file.size ) { 4000eacc: 80 a0 c0 01 cmp %g3, %g1 4000ead0: 14 80 00 1b bg 4000eb3c <== NEVER TAKEN 4000ead4: c4 06 20 54 ld [ %i0 + 0x54 ], %g2 4000ead8: 80 a0 c0 01 cmp %g3, %g1 4000eadc: 32 80 00 06 bne,a 4000eaf4 <== NEVER TAKEN 4000eae0: 03 10 00 7b sethi %hi(0x4001ec00), %g1 <== NOT EXECUTED 4000eae4: 80 a2 c0 02 cmp %o3, %g2 4000eae8: 18 80 00 16 bgu 4000eb40 4000eaec: 80 a6 40 01 cmp %i1, %g1 */ /* * Phase 1: possibly the last part of one block */ start_offset = start % IMFS_MEMFILE_BYTES_PER_BLOCK; 4000eaf0: 03 10 00 7b sethi %hi(0x4001ec00), %g1 4000eaf4: fa 00 62 f8 ld [ %g1 + 0x2f8 ], %i5 ! 4001eef8 4000eaf8: 92 10 00 1a mov %i2, %o1 4000eafc: a3 3f 60 1f sra %i5, 0x1f, %l1 4000eb00: 96 10 00 1d mov %i5, %o3 4000eb04: 94 10 00 11 mov %l1, %o2 4000eb08: 40 00 2a a9 call 400195ac <__moddi3> 4000eb0c: 90 10 00 19 mov %i1, %o0 block = start / IMFS_MEMFILE_BYTES_PER_BLOCK; 4000eb10: 90 10 00 19 mov %i1, %o0 */ /* * Phase 1: possibly the last part of one block */ start_offset = start % IMFS_MEMFILE_BYTES_PER_BLOCK; 4000eb14: a0 10 00 09 mov %o1, %l0 block = start / IMFS_MEMFILE_BYTES_PER_BLOCK; 4000eb18: 94 10 00 11 mov %l1, %o2 4000eb1c: 92 10 00 1a mov %i2, %o1 4000eb20: 40 00 29 b8 call 40019200 <__divdi3> 4000eb24: 96 10 00 1d mov %i5, %o3 if ( start_offset ) { 4000eb28: 80 a4 20 00 cmp %l0, 0 4000eb2c: 12 80 00 17 bne 4000eb88 4000eb30: b4 10 00 09 mov %o1, %i2 status = IMFS_memfile_extend( the_jnode, zero_fill, last_byte ); if ( status ) return status; } copied = 0; 4000eb34: 10 80 00 28 b 4000ebd4 4000eb38: 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; 4000eb3c: 80 a6 40 01 cmp %i1, %g1 <== NOT EXECUTED 4000eb40: 14 80 00 09 bg 4000eb64 <== NEVER TAKEN 4000eb44: 92 10 20 01 mov 1, %o1 4000eb48: 80 a6 40 01 cmp %i1, %g1 4000eb4c: 32 80 00 06 bne,a 4000eb64 <== NEVER TAKEN 4000eb50: 92 10 20 00 clr %o1 <== NOT EXECUTED 4000eb54: 80 a6 80 02 cmp %i2, %g2 4000eb58: 18 80 00 04 bgu 4000eb68 4000eb5c: 90 10 00 18 mov %i0, %o0 4000eb60: 92 10 20 00 clr %o1 status = IMFS_memfile_extend( the_jnode, zero_fill, last_byte ); 4000eb64: 90 10 00 18 mov %i0, %o0 4000eb68: 92 0a 60 01 and %o1, 1, %o1 4000eb6c: 7f ff ff 6c call 4000e91c 4000eb70: 94 10 20 00 clr %o2 if ( status ) 4000eb74: 82 92 20 00 orcc %o0, 0, %g1 4000eb78: 22 bf ff df be,a 4000eaf4 4000eb7c: 03 10 00 7b sethi %hi(0x4001ec00), %g1 } IMFS_mtime_ctime_update( the_jnode ); return copied; } 4000eb80: 81 c7 e0 08 ret 4000eb84: 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; 4000eb88: ba 27 40 10 sub %i5, %l0, %i5 4000eb8c: 80 a7 40 1c cmp %i5, %i4 4000eb90: 38 80 00 02 bgu,a 4000eb98 4000eb94: 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 ); 4000eb98: 90 10 00 18 mov %i0, %o0 4000eb9c: 92 10 00 1a mov %i2, %o1 4000eba0: 7f ff fd b4 call 4000e270 4000eba4: 94 10 20 00 clr %o2 if ( !block_ptr ) 4000eba8: 80 a2 20 00 cmp %o0, 0 4000ebac: 02 80 00 36 be 4000ec84 <== NEVER TAKEN 4000ebb0: 82 10 20 00 clr %g1 block, to_copy, src ); #endif memcpy( &(*block_ptr)[ start_offset ], src, to_copy ); 4000ebb4: d0 02 00 00 ld [ %o0 ], %o0 4000ebb8: 92 10 00 1b mov %i3, %o1 4000ebbc: 90 02 00 10 add %o0, %l0, %o0 4000ebc0: 94 10 00 1d mov %i5, %o2 4000ebc4: 40 00 06 19 call 40010428 4000ebc8: b6 06 c0 1d add %i3, %i5, %i3 src += to_copy; block++; 4000ebcc: b4 06 a0 01 inc %i2 my_length -= to_copy; 4000ebd0: b8 27 00 1d sub %i4, %i5, %i4 /* * Phase 2: all of zero of more blocks */ to_copy = IMFS_MEMFILE_BYTES_PER_BLOCK; 4000ebd4: 03 10 00 7b sethi %hi(0x4001ec00), %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( 4000ebd8: b6 26 c0 1d sub %i3, %i5, %i3 /* * Phase 2: all of zero of more blocks */ to_copy = IMFS_MEMFILE_BYTES_PER_BLOCK; 4000ebdc: f2 00 62 f8 ld [ %g1 + 0x2f8 ], %i1 while ( my_length >= IMFS_MEMFILE_BYTES_PER_BLOCK ) { 4000ebe0: 10 80 00 0f b 4000ec1c 4000ebe4: a2 10 00 01 mov %g1, %l1 block_ptr = IMFS_memfile_get_block_pointer( the_jnode, block, 0 ); 4000ebe8: 90 10 00 18 mov %i0, %o0 4000ebec: 92 10 00 1a mov %i2, %o1 4000ebf0: 7f ff fd a0 call 4000e270 4000ebf4: 94 10 20 00 clr %o2 if ( !block_ptr ) 4000ebf8: 80 a2 20 00 cmp %o0, 0 4000ebfc: 02 80 00 21 be 4000ec80 <== NEVER TAKEN 4000ec00: 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 ); 4000ec04: d0 02 00 00 ld [ %o0 ], %o0 4000ec08: 92 10 00 10 mov %l0, %o1 4000ec0c: 40 00 06 07 call 40010428 4000ec10: b4 06 a0 01 inc %i2 src += to_copy; block++; my_length -= to_copy; 4000ec14: 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( 4000ec18: 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 ) { 4000ec1c: c2 04 62 f8 ld [ %l1 + 0x2f8 ], %g1 4000ec20: 80 a7 00 01 cmp %i4, %g1 4000ec24: 1a bf ff f1 bcc 4000ebe8 4000ec28: 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 ) { 4000ec2c: 80 a7 20 00 cmp %i4, 0 4000ec30: 02 80 00 0f be 4000ec6c 4000ec34: 90 07 bf f8 add %fp, -8, %o0 block_ptr = IMFS_memfile_get_block_pointer( the_jnode, block, 0 ); 4000ec38: 90 10 00 18 mov %i0, %o0 4000ec3c: 92 10 00 1a mov %i2, %o1 4000ec40: 7f ff fd 8c call 4000e270 4000ec44: 94 10 20 00 clr %o2 if ( !block_ptr ) 4000ec48: 80 a2 20 00 cmp %o0, 0 4000ec4c: 02 80 00 0e be 4000ec84 <== NEVER TAKEN 4000ec50: 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 ); 4000ec54: d0 02 00 00 ld [ %o0 ], %o0 4000ec58: 92 10 00 10 mov %l0, %o1 4000ec5c: 94 10 00 1c mov %i4, %o2 4000ec60: 40 00 05 f2 call 40010428 4000ec64: ba 07 40 1c add %i5, %i4, %i5 my_length = 0; copied += to_copy; } IMFS_mtime_ctime_update( the_jnode ); 4000ec68: 90 07 bf f8 add %fp, -8, %o0 4000ec6c: 7f ff d5 18 call 400040cc 4000ec70: 92 10 20 00 clr %o1 4000ec74: c2 07 bf f8 ld [ %fp + -8 ], %g1 4000ec78: c2 26 20 44 st %g1, [ %i0 + 0x44 ] 4000ec7c: 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 ) 4000ec80: 82 10 00 1d mov %i5, %g1 } IMFS_mtime_ctime_update( the_jnode ); return copied; } 4000ec84: b0 10 00 01 mov %g1, %i0 4000ec88: 81 c7 e0 08 ret 4000ec8c: 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 4e call 4000be08 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 30 63 call 4000fae4 <__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 30 5f call 4000fae4 <__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 =============================================================================== 4000c258 : } static IMFS_jnode_t *IMFS_node_remove_directory( IMFS_jnode_t *node ) { 4000c258: 9d e3 bf a0 save %sp, -96, %sp if ( !rtems_chain_is_empty( &node->info.directory.Entries ) ) { 4000c25c: 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 ); 4000c260: 82 06 20 54 add %i0, 0x54, %g1 4000c264: 80 a0 80 01 cmp %g2, %g1 4000c268: 22 80 00 06 be,a 4000c280 4000c26c: c2 06 20 5c ld [ %i0 + 0x5c ], %g1 errno = ENOTEMPTY; 4000c270: 40 00 0e 1d call 4000fae4 <__errno> 4000c274: 01 00 00 00 nop 4000c278: 10 80 00 08 b 4000c298 4000c27c: 82 10 20 5a mov 0x5a, %g1 ! 5a node = NULL; } else if ( IMFS_is_mount_point( node ) ) { 4000c280: 80 a0 60 00 cmp %g1, 0 4000c284: 02 80 00 07 be 4000c2a0 <== ALWAYS TAKEN 4000c288: 01 00 00 00 nop errno = EBUSY; 4000c28c: 40 00 0e 16 call 4000fae4 <__errno> <== NOT EXECUTED 4000c290: 01 00 00 00 nop <== NOT EXECUTED 4000c294: 82 10 20 10 mov 0x10, %g1 ! 10 <== NOT EXECUTED 4000c298: c2 22 00 00 st %g1, [ %o0 ] 4000c29c: b0 10 20 00 clr %i0 node = NULL; } return node; } 4000c2a0: 81 c7 e0 08 ret 4000c2a4: 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 32 81 call 40010428 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 30 1a call 4000fae4 <__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 30 16 call 4000fae4 <__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 2f cb call 4000fae4 <__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 2f c7 call 4000fae4 <__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 79 sethi %hi(0x4001e400), %g1 400042c0: f6 00 63 30 ld [ %g1 + 0x330 ], %i3 ! 4001e730 if ( !rtems_configuration_get_unified_work_area() ) { 400042c4: 03 10 00 72 sethi %hi(0x4001c800), %g1 400042c8: c2 08 60 09 ldub [ %g1 + 9 ], %g1 ! 4001c809 400042cc: 80 a0 60 00 cmp %g1, 0 400042d0: 12 80 00 1b bne 4000433c 400042d4: 03 10 00 7b sethi %hi(0x4001ec00), %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 d4 or %i5, 0x1d4, %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 d4 or %g1, 0x1d4, %g1 ! 400091d4 <_Heap_Initialize> 40004320: 80 a7 40 01 cmp %i5, %g1 40004324: 12 80 00 06 bne 4000433c 40004328: 03 10 00 7b sethi %hi(0x4001ec00), %g1 _Internal_error_Occurred( 4000432c: 90 10 20 00 clr %o0 40004330: 92 10 20 01 mov 1, %o1 40004334: 40 00 14 3b call 40009420 <_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 62 60 ld [ %g1 + 0x260 ], %g1 40004340: 80 a0 60 00 cmp %g1, 0 40004344: 02 80 00 05 be 40004358 40004348: 3b 10 00 7c sethi %hi(0x4001f000), %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 63 00 ld [ %i5 + 0x300 ], %i4 4000435c: 40 00 16 7b call 40009d48 <_Protected_heap_Get_size> 40004360: 90 10 00 1b mov %i3, %o0 40004364: 90 02 00 1c add %o0, %i4, %o0 40004368: d0 27 63 00 st %o0, [ %i5 + 0x300 ] 4000436c: 81 c7 e0 08 ret 40004370: 81 e8 00 00 restore =============================================================================== 400228e0 : static rtems_printk_plugin_t print_handler; static void Stack_check_Dump_threads_usage( Thread_Control *the_thread ) { 400228e0: 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) { 400228e4: 80 a6 3f ff cmp %i0, -1 <== NOT EXECUTED 400228e8: 32 80 00 0a bne,a 40022910 <== NOT EXECUTED 400228ec: e0 06 21 38 ld [ %i0 + 0x138 ], %l0 <== NOT EXECUTED if (!Stack_check_Interrupt_stack.area) 400228f0: 3b 10 01 93 sethi %hi(0x40064c00), %i5 <== NOT EXECUTED 400228f4: ba 17 62 7c or %i5, 0x27c, %i5 ! 40064e7c <== NOT EXECUTED 400228f8: c2 07 60 04 ld [ %i5 + 4 ], %g1 <== NOT EXECUTED 400228fc: 80 a0 60 00 cmp %g1, 0 <== NOT EXECUTED 40022900: 02 80 00 4c be 40022a30 <== NOT EXECUTED 40022904: a0 10 20 00 clr %l0 <== NOT EXECUTED return; stack = &Stack_check_Interrupt_stack; the_thread = 0; 40022908: 10 80 00 04 b 40022918 <== NOT EXECUTED 4002290c: b0 10 20 00 clr %i0 <== NOT EXECUTED current = 0; } else #endif { stack = &the_thread->Start.Initial_stack; 40022910: ba 06 20 b4 add %i0, 0xb4, %i5 <== NOT EXECUTED current = (void *)_CPU_Context_Get_SP( &the_thread->Registers ); } low = Stack_check_usable_stack_start(stack); 40022914: c2 07 60 04 ld [ %i5 + 4 ], %g1 <== NOT EXECUTED size = Stack_check_usable_stack_size(stack); 40022918: 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); 4002291c: 84 00 60 10 add %g1, 0x10, %g2 <== NOT EXECUTED size = Stack_check_usable_stack_size(stack); 40022920: 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; 40022924: 82 00 60 20 add %g1, 0x20, %g1 <== NOT EXECUTED for (ebase = base + length; base < ebase; base++) 40022928: 86 0e 7f fc and %i1, -4, %g3 <== NOT EXECUTED if (*base != U32_PATTERN) 4002292c: 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++) 40022930: 86 00 40 03 add %g1, %g3, %g3 <== NOT EXECUTED if (*base != U32_PATTERN) 40022934: 10 80 00 06 b 4002294c <== NOT EXECUTED 40022938: 88 11 21 a5 or %g4, 0x1a5, %g4 <== NOT EXECUTED 4002293c: 80 a7 00 04 cmp %i4, %g4 <== NOT EXECUTED 40022940: 12 80 00 08 bne 40022960 <== NOT EXECUTED 40022944: 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++) 40022948: 82 00 60 04 add %g1, 4, %g1 <== NOT EXECUTED 4002294c: 80 a0 40 03 cmp %g1, %g3 <== NOT EXECUTED 40022950: 2a bf ff fb bcs,a 4002293c <== NOT EXECUTED 40022954: 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; 40022958: 10 80 00 06 b 40022970 <== NOT EXECUTED 4002295c: 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 ) 40022960: 02 80 00 04 be 40022970 <== NOT EXECUTED 40022964: b8 10 20 00 clr %i4 <== NOT EXECUTED used = Stack_check_Calculate_used( low, size, high_water_mark ); 40022968: b8 00 80 19 add %g2, %i1, %i4 <== NOT EXECUTED 4002296c: b8 27 00 01 sub %i4, %g1, %i4 <== NOT EXECUTED else used = 0; #if (CPU_ALLOCATE_INTERRUPT_STACK == TRUE) if ( the_thread ) 40022970: 80 a6 20 00 cmp %i0, 0 <== NOT EXECUTED 40022974: 02 80 00 12 be 400229bc <== NOT EXECUTED 40022978: 03 10 01 8e sethi %hi(0x40063800), %g1 <== NOT EXECUTED #endif { (*print_handler)( 4002297c: f6 06 20 08 ld [ %i0 + 8 ], %i3 <== NOT EXECUTED 40022980: f4 00 63 28 ld [ %g1 + 0x328 ], %i2 <== NOT EXECUTED 40022984: 03 10 01 8e sethi %hi(0x40063800), %g1 <== NOT EXECUTED 40022988: e2 00 63 24 ld [ %g1 + 0x324 ], %l1 ! 40063b24 <== NOT EXECUTED 4002298c: 94 07 bf f8 add %fp, -8, %o2 <== NOT EXECUTED 40022990: 90 10 00 1b mov %i3, %o0 <== NOT EXECUTED 40022994: 7f ff b2 92 call 4000f3dc <== NOT EXECUTED 40022998: 92 10 20 05 mov 5, %o1 <== NOT EXECUTED 4002299c: 13 10 01 6a sethi %hi(0x4005a800), %o1 <== NOT EXECUTED 400229a0: 96 10 00 08 mov %o0, %o3 <== NOT EXECUTED 400229a4: 92 12 60 08 or %o1, 8, %o1 <== NOT EXECUTED 400229a8: 90 10 00 11 mov %l1, %o0 <== NOT EXECUTED 400229ac: 9f c6 80 00 call %i2 <== NOT EXECUTED 400229b0: 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, 400229b4: 10 80 00 0a b 400229dc <== NOT EXECUTED 400229b8: 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 ); 400229bc: 05 10 01 8e sethi %hi(0x40063800), %g2 <== NOT EXECUTED 400229c0: c2 00 63 28 ld [ %g1 + 0x328 ], %g1 <== NOT EXECUTED 400229c4: d0 00 a3 24 ld [ %g2 + 0x324 ], %o0 <== NOT EXECUTED 400229c8: 13 10 01 6a sethi %hi(0x4005a800), %o1 <== NOT EXECUTED 400229cc: 94 10 3f ff mov -1, %o2 <== NOT EXECUTED 400229d0: 9f c0 40 00 call %g1 <== NOT EXECUTED 400229d4: 92 12 60 18 or %o1, 0x18, %o1 <== NOT EXECUTED (*print_handler)( print_context, " %010p - %010p %010p %8" PRId32 " ", stack->area, stack->area + stack->size - 1, 400229d8: d4 07 60 04 ld [ %i5 + 4 ], %o2 <== NOT EXECUTED else { (*print_handler)( print_context, "0x%08" PRIx32 " INTR", ~0 ); } #endif (*print_handler)( 400229dc: 35 10 01 8e sethi %hi(0x40063800), %i2 <== NOT EXECUTED 400229e0: 37 10 01 8e sethi %hi(0x40063800), %i3 <== NOT EXECUTED print_context, " %010p - %010p %010p %8" PRId32 " ", stack->area, stack->area + stack->size - 1, 400229e4: d6 07 40 00 ld [ %i5 ], %o3 <== NOT EXECUTED else { (*print_handler)( print_context, "0x%08" PRIx32 " INTR", ~0 ); } #endif (*print_handler)( 400229e8: c2 06 a3 28 ld [ %i2 + 0x328 ], %g1 <== NOT EXECUTED 400229ec: d0 06 e3 24 ld [ %i3 + 0x324 ], %o0 <== NOT EXECUTED print_context, " %010p - %010p %010p %8" PRId32 " ", stack->area, stack->area + stack->size - 1, 400229f0: 96 02 ff ff add %o3, -1, %o3 <== NOT EXECUTED else { (*print_handler)( print_context, "0x%08" PRIx32 " INTR", ~0 ); } #endif (*print_handler)( 400229f4: 13 10 01 6a sethi %hi(0x4005a800), %o1 <== NOT EXECUTED 400229f8: 96 02 80 0b add %o2, %o3, %o3 <== NOT EXECUTED 400229fc: 92 12 60 28 or %o1, 0x28, %o1 <== NOT EXECUTED 40022a00: 98 10 00 10 mov %l0, %o4 <== NOT EXECUTED 40022a04: 9f c0 40 00 call %g1 <== NOT EXECUTED 40022a08: 9a 10 00 19 mov %i1, %o5 <== NOT EXECUTED stack->area + stack->size - 1, current, size ); if (Stack_check_Initialized == 0) { 40022a0c: 03 10 01 8e sethi %hi(0x40063800), %g1 <== NOT EXECUTED 40022a10: c2 00 63 20 ld [ %g1 + 0x320 ], %g1 ! 40063b20 <== NOT EXECUTED (*print_handler)( print_context, "Unavailable\n" ); 40022a14: d0 06 e3 24 ld [ %i3 + 0x324 ], %o0 <== NOT EXECUTED stack->area + stack->size - 1, current, size ); if (Stack_check_Initialized == 0) { 40022a18: 80 a0 60 00 cmp %g1, 0 <== NOT EXECUTED 40022a1c: 12 80 00 07 bne 40022a38 <== NOT EXECUTED 40022a20: c2 06 a3 28 ld [ %i2 + 0x328 ], %g1 <== NOT EXECUTED (*print_handler)( print_context, "Unavailable\n" ); 40022a24: 13 10 01 6a sethi %hi(0x4005a800), %o1 <== NOT EXECUTED 40022a28: 9f c0 40 00 call %g1 <== NOT EXECUTED 40022a2c: 92 12 60 48 or %o1, 0x48, %o1 ! 4005a848 <== NOT EXECUTED 40022a30: 81 c7 e0 08 ret <== NOT EXECUTED 40022a34: 81 e8 00 00 restore <== NOT EXECUTED } else { (*print_handler)( print_context, "%8" PRId32 "\n", used ); 40022a38: 13 10 01 6a sethi %hi(0x4005a800), %o1 <== NOT EXECUTED 40022a3c: 94 10 00 1c mov %i4, %o2 <== NOT EXECUTED 40022a40: 9f c0 40 00 call %g1 <== NOT EXECUTED 40022a44: 92 12 60 58 or %o1, 0x58, %o1 <== NOT EXECUTED 40022a48: 81 c7 e0 08 ret <== NOT EXECUTED 40022a4c: 81 e8 00 00 restore <== NOT EXECUTED =============================================================================== 40022b38 : Thread_Control *running, bool pattern_ok ) RTEMS_COMPILER_NO_RETURN_ATTRIBUTE; void Stack_check_report_blown_task(Thread_Control *running, bool pattern_ok) { 40022b38: 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"); 40022b3c: 11 10 01 6a sethi %hi(0x4005a800), %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); 40022b40: fa 06 20 b8 ld [ %i0 + 0xb8 ], %i5 <== NOT EXECUTED char name[32]; printk("BLOWN STACK!!!\n"); 40022b44: 7f ff 87 69 call 400048e8 <== NOT EXECUTED 40022b48: 90 12 20 60 or %o0, 0x60, %o0 <== NOT EXECUTED printk("task control block: 0x%08" PRIxPTR "\n", running); 40022b4c: 92 10 00 18 mov %i0, %o1 <== NOT EXECUTED 40022b50: 11 10 01 6a sethi %hi(0x4005a800), %o0 <== NOT EXECUTED 40022b54: 7f ff 87 65 call 400048e8 <== NOT EXECUTED 40022b58: 90 12 20 70 or %o0, 0x70, %o0 ! 4005a870 <== NOT EXECUTED printk("task ID: 0x%08lx\n", (unsigned long) running->Object.id); 40022b5c: d2 06 20 08 ld [ %i0 + 8 ], %o1 <== NOT EXECUTED 40022b60: 11 10 01 6a sethi %hi(0x4005a800), %o0 <== NOT EXECUTED 40022b64: 7f ff 87 61 call 400048e8 <== NOT EXECUTED 40022b68: 90 12 20 90 or %o0, 0x90, %o0 ! 4005a890 <== NOT EXECUTED printk( 40022b6c: d2 06 20 0c ld [ %i0 + 0xc ], %o1 <== NOT EXECUTED 40022b70: 11 10 01 6a sethi %hi(0x4005a800), %o0 <== NOT EXECUTED 40022b74: 7f ff 87 5d call 400048e8 <== NOT EXECUTED 40022b78: 90 12 20 a8 or %o0, 0xa8, %o0 ! 4005a8a8 <== NOT EXECUTED "task name: 0x%08" PRIx32 "\n", running->Object.name.name_u32 ); printk( 40022b7c: d0 06 20 08 ld [ %i0 + 8 ], %o0 <== NOT EXECUTED 40022b80: 94 07 bf e0 add %fp, -32, %o2 <== NOT EXECUTED 40022b84: 7f ff b2 16 call 4000f3dc <== NOT EXECUTED 40022b88: 92 10 20 20 mov 0x20, %o1 <== NOT EXECUTED 40022b8c: 92 10 00 08 mov %o0, %o1 <== NOT EXECUTED 40022b90: 11 10 01 6a sethi %hi(0x4005a800), %o0 <== NOT EXECUTED 40022b94: 7f ff 87 55 call 400048e8 <== NOT EXECUTED 40022b98: 90 12 20 c0 or %o0, 0xc0, %o0 ! 4005a8c0 <== 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) 40022b9c: d4 06 20 b8 ld [ %i0 + 0xb8 ], %o2 <== NOT EXECUTED 40022ba0: d2 06 20 b4 ld [ %i0 + 0xb4 ], %o1 <== NOT EXECUTED ); printk( "task name string: %s\n", rtems_object_get_name(running->Object.id, sizeof(name), name) ); printk( 40022ba4: 11 10 01 6a sethi %hi(0x4005a800), %o0 <== NOT EXECUTED 40022ba8: 96 02 80 09 add %o2, %o1, %o3 <== NOT EXECUTED 40022bac: 7f ff 87 4f call 400048e8 <== NOT EXECUTED 40022bb0: 90 12 20 d8 or %o0, 0xd8, %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) { 40022bb4: 80 a6 60 00 cmp %i1, 0 <== NOT EXECUTED 40022bb8: 32 80 00 09 bne,a 40022bdc <== NOT EXECUTED 40022bbc: d2 06 20 0c ld [ %i0 + 0xc ], %o1 <== NOT EXECUTED printk( 40022bc0: 11 10 01 6a sethi %hi(0x4005a800), %o0 <== NOT EXECUTED 40022bc4: 92 10 20 10 mov 0x10, %o1 <== NOT EXECUTED 40022bc8: 90 12 21 08 or %o0, 0x108, %o0 <== NOT EXECUTED 40022bcc: 94 07 60 08 add %i5, 8, %o2 <== NOT EXECUTED 40022bd0: 7f ff 87 46 call 400048e8 <== NOT EXECUTED 40022bd4: 96 07 60 18 add %i5, 0x18, %o3 <== NOT EXECUTED rtems_configuration_get_user_multiprocessing_table()->node ); } #endif rtems_fatal( 40022bd8: d2 06 20 0c ld [ %i0 + 0xc ], %o1 <== NOT EXECUTED 40022bdc: 7f ff 95 53 call 40008128 <== NOT EXECUTED 40022be0: 90 10 20 09 mov 9, %o0 <== NOT EXECUTED =============================================================================== 4000ad6c <_CORE_RWLock_Release>: #include CORE_RWLock_Status _CORE_RWLock_Release( CORE_RWLock_Control *the_rwlock ) { 4000ad6c: 9d e3 bf a0 save %sp, -96, %sp ISR_Level level; Thread_Control *executing = _Thread_Executing; 4000ad70: 03 10 00 6d sethi %hi(0x4001b400), %g1 * Otherwise, we have to block. * If locked for reading and no waiters, then OK to read. * If any thread is waiting, then we wait. */ _ISR_Disable( level ); 4000ad74: 7f ff e2 fc call 40003964 4000ad78: fa 00 60 20 ld [ %g1 + 0x20 ], %i5 ! 4001b420 <_Per_CPU_Information+0x10> 4000ad7c: 84 10 00 08 mov %o0, %g2 if ( the_rwlock->current_state == CORE_RWLOCK_UNLOCKED){ 4000ad80: c2 06 20 44 ld [ %i0 + 0x44 ], %g1 4000ad84: 80 a0 60 00 cmp %g1, 0 4000ad88: 12 80 00 08 bne 4000ada8 <_CORE_RWLock_Release+0x3c> 4000ad8c: 80 a0 60 01 cmp %g1, 1 _ISR_Enable( level ); 4000ad90: 7f ff e2 f9 call 40003974 4000ad94: b0 10 20 00 clr %i0 executing->Wait.return_code = CORE_RWLOCK_UNAVAILABLE; 4000ad98: 82 10 20 02 mov 2, %g1 4000ad9c: c2 27 60 34 st %g1, [ %i5 + 0x34 ] 4000ada0: 81 c7 e0 08 ret 4000ada4: 81 e8 00 00 restore return CORE_RWLOCK_SUCCESSFUL; } if ( the_rwlock->current_state == CORE_RWLOCK_LOCKED_FOR_READING ) { 4000ada8: 32 80 00 0b bne,a 4000add4 <_CORE_RWLock_Release+0x68> 4000adac: c0 27 60 34 clr [ %i5 + 0x34 ] the_rwlock->number_of_readers -= 1; 4000adb0: c2 06 20 48 ld [ %i0 + 0x48 ], %g1 4000adb4: 82 00 7f ff add %g1, -1, %g1 if ( the_rwlock->number_of_readers != 0 ) { 4000adb8: 80 a0 60 00 cmp %g1, 0 4000adbc: 02 80 00 05 be 4000add0 <_CORE_RWLock_Release+0x64> 4000adc0: c2 26 20 48 st %g1, [ %i0 + 0x48 ] /* must be unlocked again */ _ISR_Enable( level ); 4000adc4: 7f ff e2 ec call 40003974 4000adc8: b0 10 20 00 clr %i0 return CORE_RWLOCK_SUCCESSFUL; 4000adcc: 30 80 00 24 b,a 4000ae5c <_CORE_RWLock_Release+0xf0> } } /* CORE_RWLOCK_LOCKED_FOR_WRITING or READING with readers */ executing->Wait.return_code = CORE_RWLOCK_SUCCESSFUL; 4000add0: c0 27 60 34 clr [ %i5 + 0x34 ] /* * Implicitly transition to "unlocked" and find another thread interested * in obtaining this rwlock. */ the_rwlock->current_state = CORE_RWLOCK_UNLOCKED; 4000add4: c0 26 20 44 clr [ %i0 + 0x44 ] _ISR_Enable( level ); 4000add8: 7f ff e2 e7 call 40003974 4000addc: 90 10 00 02 mov %g2, %o0 next = _Thread_queue_Dequeue( &the_rwlock->Wait_queue ); 4000ade0: 40 00 07 6d call 4000cb94 <_Thread_queue_Dequeue> 4000ade4: 90 10 00 18 mov %i0, %o0 if ( next ) { 4000ade8: 80 a2 20 00 cmp %o0, 0 4000adec: 22 80 00 1c be,a 4000ae5c <_CORE_RWLock_Release+0xf0> 4000adf0: b0 10 20 00 clr %i0 if ( next->Wait.option == CORE_RWLOCK_THREAD_WAITING_FOR_WRITE ) { 4000adf4: c2 02 20 30 ld [ %o0 + 0x30 ], %g1 4000adf8: 80 a0 60 01 cmp %g1, 1 4000adfc: 32 80 00 05 bne,a 4000ae10 <_CORE_RWLock_Release+0xa4> 4000ae00: c2 06 20 48 ld [ %i0 + 0x48 ], %g1 the_rwlock->current_state = CORE_RWLOCK_LOCKED_FOR_WRITING; 4000ae04: 82 10 20 02 mov 2, %g1 return CORE_RWLOCK_SUCCESSFUL; 4000ae08: 10 80 00 14 b 4000ae58 <_CORE_RWLock_Release+0xec> 4000ae0c: c2 26 20 44 st %g1, [ %i0 + 0x44 ] } /* * Must be CORE_RWLOCK_THREAD_WAITING_FOR_READING */ the_rwlock->number_of_readers += 1; 4000ae10: 82 00 60 01 inc %g1 4000ae14: c2 26 20 48 st %g1, [ %i0 + 0x48 ] the_rwlock->current_state = CORE_RWLOCK_LOCKED_FOR_READING; 4000ae18: 82 10 20 01 mov 1, %g1 4000ae1c: c2 26 20 44 st %g1, [ %i0 + 0x44 ] /* * Now see if more readers can be let go. */ while ( 1 ) { next = _Thread_queue_First( &the_rwlock->Wait_queue ); 4000ae20: 40 00 08 99 call 4000d084 <_Thread_queue_First> 4000ae24: 90 10 00 18 mov %i0, %o0 if ( !next || 4000ae28: 92 92 20 00 orcc %o0, 0, %o1 4000ae2c: 22 80 00 0c be,a 4000ae5c <_CORE_RWLock_Release+0xf0> 4000ae30: b0 10 20 00 clr %i0 4000ae34: c2 02 60 30 ld [ %o1 + 0x30 ], %g1 4000ae38: 80 a0 60 01 cmp %g1, 1 4000ae3c: 02 80 00 07 be 4000ae58 <_CORE_RWLock_Release+0xec> <== NEVER TAKEN 4000ae40: 90 10 00 18 mov %i0, %o0 next->Wait.option == CORE_RWLOCK_THREAD_WAITING_FOR_WRITE ) return CORE_RWLOCK_SUCCESSFUL; the_rwlock->number_of_readers += 1; 4000ae44: c2 06 20 48 ld [ %i0 + 0x48 ], %g1 4000ae48: 82 00 60 01 inc %g1 _Thread_queue_Extract( &the_rwlock->Wait_queue, next ); 4000ae4c: 40 00 08 3f call 4000cf48 <_Thread_queue_Extract> 4000ae50: c2 26 20 48 st %g1, [ %i0 + 0x48 ] } 4000ae54: 30 bf ff f3 b,a 4000ae20 <_CORE_RWLock_Release+0xb4> } /* indentation is to match _ISR_Disable at top */ return CORE_RWLOCK_SUCCESSFUL; } 4000ae58: b0 10 20 00 clr %i0 4000ae5c: 81 c7 e0 08 ret 4000ae60: 81 e8 00 00 restore =============================================================================== 4000ae64 <_CORE_RWLock_Timeout>: void _CORE_RWLock_Timeout( Objects_Id id, void *ignored ) { 4000ae64: 9d e3 bf 98 save %sp, -104, %sp Thread_Control *the_thread; Objects_Locations location; the_thread = _Thread_Get( id, &location ); 4000ae68: 90 10 00 18 mov %i0, %o0 4000ae6c: 40 00 06 7e call 4000c864 <_Thread_Get> 4000ae70: 92 07 bf fc add %fp, -4, %o1 switch ( location ) { 4000ae74: c2 07 bf fc ld [ %fp + -4 ], %g1 4000ae78: 80 a0 60 00 cmp %g1, 0 4000ae7c: 12 80 00 08 bne 4000ae9c <_CORE_RWLock_Timeout+0x38> <== NEVER TAKEN 4000ae80: 01 00 00 00 nop #if defined(RTEMS_MULTIPROCESSING) case OBJECTS_REMOTE: /* impossible */ #endif break; case OBJECTS_LOCAL: _Thread_queue_Process_timeout( the_thread ); 4000ae84: 40 00 08 bd call 4000d178 <_Thread_queue_Process_timeout> 4000ae88: 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; 4000ae8c: 03 10 00 6b sethi %hi(0x4001ac00), %g1 4000ae90: c4 00 63 00 ld [ %g1 + 0x300 ], %g2 ! 4001af00 <_Thread_Dispatch_disable_level> --level; 4000ae94: 84 00 bf ff add %g2, -1, %g2 _Thread_Dispatch_disable_level = level; 4000ae98: c4 20 63 00 st %g2, [ %g1 + 0x300 ] 4000ae9c: 81 c7 e0 08 ret 4000aea0: 81 e8 00 00 restore =============================================================================== 40008efc <_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 ) { 40008efc: 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)) ) { 40008f00: 90 10 00 18 mov %i0, %o0 40008f04: 40 00 07 3d call 4000abf8 <_Thread_queue_Dequeue> 40008f08: ba 10 00 18 mov %i0, %i5 40008f0c: 80 a2 20 00 cmp %o0, 0 40008f10: 12 80 00 0e bne 40008f48 <_CORE_semaphore_Surrender+0x4c> 40008f14: 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 ); 40008f18: 7f ff e5 4c call 40002448 40008f1c: 01 00 00 00 nop if ( the_semaphore->count < the_semaphore->Attributes.maximum_count ) 40008f20: c2 07 60 48 ld [ %i5 + 0x48 ], %g1 40008f24: c4 07 60 40 ld [ %i5 + 0x40 ], %g2 40008f28: 80 a0 40 02 cmp %g1, %g2 40008f2c: 1a 80 00 05 bcc 40008f40 <_CORE_semaphore_Surrender+0x44> <== NEVER TAKEN 40008f30: b0 10 20 04 mov 4, %i0 the_semaphore->count += 1; 40008f34: 82 00 60 01 inc %g1 { Thread_Control *the_thread; ISR_Level level; CORE_semaphore_Status status; status = CORE_SEMAPHORE_STATUS_SUCCESSFUL; 40008f38: b0 10 20 00 clr %i0 #endif } else { _ISR_Disable( level ); if ( the_semaphore->count < the_semaphore->Attributes.maximum_count ) the_semaphore->count += 1; 40008f3c: c2 27 60 48 st %g1, [ %i5 + 0x48 ] else status = CORE_SEMAPHORE_MAXIMUM_COUNT_EXCEEDED; _ISR_Enable( level ); 40008f40: 7f ff e5 46 call 40002458 40008f44: 01 00 00 00 nop } return status; } 40008f48: 81 c7 e0 08 ret 40008f4c: 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 7e sethi %hi(0x4001f800), %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 90 or %g3, 0x190, %g3 ! 4001f990 <_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 6a call 4000b634 <_Watchdog_Remove> 40007c90: 90 07 60 48 add %i5, 0x48, %o0 40007c94: b2 16 63 f8 or %i1, 0x3f8, %i1 40007c98: 40 00 0a 2a call 4000a540 <_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 0b 06 call 4000a8c8 <_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 7e sethi %hi(0x4001f800), %g1 return; } #endif the_thread->Wait.count = 0; if ( _Thread_Is_executing( the_thread ) ) { 40007cd4: c2 00 61 a0 ld [ %g1 + 0x1a0 ], %g1 ! 4001f9a0 <_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 0a 0b call 4000a540 <_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 7d sethi %hi(0x4001f400), %g1 40007d20: c4 00 60 80 ld [ %g1 + 0x80 ], %g2 ! 4001f480 <_Thread_Dispatch_disable_level> --level; 40007d24: 84 00 bf ff add %g2, -1, %g2 _Thread_Dispatch_disable_level = level; 40007d28: c4 20 60 80 st %g2, [ %g1 + 0x80 ] 40007d2c: 81 c7 e0 08 ret 40007d30: 81 e8 00 00 restore =============================================================================== 4000dcb0 <_Heap_Free>: return do_free; } #endif bool _Heap_Free( Heap_Control *heap, void *alloc_begin_ptr ) { 4000dcb0: 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 ) { 4000dcb4: 80 a6 60 00 cmp %i1, 0 4000dcb8: 02 80 00 7a be 4000dea0 <_Heap_Free+0x1f0> 4000dcbc: 88 10 20 01 mov 1, %g4 4000dcc0: d2 06 20 10 ld [ %i0 + 0x10 ], %o1 4000dcc4: 40 00 2c a3 call 40018f50 <.urem> 4000dcc8: 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 4000dccc: 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); 4000dcd0: 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); 4000dcd4: 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; 4000dcd8: 80 a2 00 1b cmp %o0, %i3 4000dcdc: 0a 80 00 05 bcs 4000dcf0 <_Heap_Free+0x40> 4000dce0: 82 10 20 00 clr %g1 4000dce4: c2 06 20 24 ld [ %i0 + 0x24 ], %g1 4000dce8: 80 a0 40 08 cmp %g1, %o0 4000dcec: 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 ) ) { 4000dcf0: 80 a0 60 00 cmp %g1, 0 4000dcf4: 02 80 00 6b be 4000dea0 <_Heap_Free+0x1f0> 4000dcf8: 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; 4000dcfc: f8 02 20 04 ld [ %o0 + 4 ], %i4 4000dd00: 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); 4000dd04: 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; 4000dd08: 80 a0 40 1b cmp %g1, %i3 4000dd0c: 0a 80 00 05 bcs 4000dd20 <_Heap_Free+0x70> <== NEVER TAKEN 4000dd10: 86 10 20 00 clr %g3 4000dd14: c6 06 20 24 ld [ %i0 + 0x24 ], %g3 4000dd18: 80 a0 c0 01 cmp %g3, %g1 4000dd1c: 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 ) ) { 4000dd20: 80 a0 e0 00 cmp %g3, 0 4000dd24: 02 80 00 5f be 4000dea0 <_Heap_Free+0x1f0> <== NEVER TAKEN 4000dd28: 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; 4000dd2c: fa 00 60 04 ld [ %g1 + 4 ], %i5 return false; } _Heap_Protection_block_check( heap, next_block ); if ( !_Heap_Is_prev_used( next_block ) ) { 4000dd30: 80 8f 60 01 btst 1, %i5 4000dd34: 22 80 00 5c be,a 4000dea4 <_Heap_Free+0x1f4> <== NEVER TAKEN 4000dd38: 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 4000dd3c: c8 06 20 24 ld [ %i0 + 0x24 ], %g4 && !_Heap_Is_prev_used( _Heap_Block_at( next_block, next_block_size )); 4000dd40: 80 a0 40 04 cmp %g1, %g4 4000dd44: 02 80 00 07 be 4000dd60 <_Heap_Free+0xb0> 4000dd48: ba 0f 7f fe and %i5, -2, %i5 4000dd4c: 86 00 40 1d add %g1, %i5, %g3 4000dd50: f4 00 e0 04 ld [ %g3 + 4 ], %i2 4000dd54: b4 1e a0 01 xor %i2, 1, %i2 4000dd58: 10 80 00 03 b 4000dd64 <_Heap_Free+0xb4> 4000dd5c: b4 0e a0 01 and %i2, 1, %i2 4000dd60: b4 10 20 00 clr %i2 if ( !_Heap_Is_prev_used( block ) ) { 4000dd64: 80 8f 20 01 btst 1, %i4 4000dd68: 12 80 00 26 bne 4000de00 <_Heap_Free+0x150> 4000dd6c: 80 8e a0 ff btst 0xff, %i2 uintptr_t const prev_size = block->prev_size; 4000dd70: 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); 4000dd74: 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; 4000dd78: 80 a0 c0 1b cmp %g3, %i3 4000dd7c: 0a 80 00 04 bcs 4000dd8c <_Heap_Free+0xdc> <== NEVER TAKEN 4000dd80: b2 10 20 00 clr %i1 4000dd84: 80 a1 00 03 cmp %g4, %g3 4000dd88: 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 ) ) { 4000dd8c: 80 a6 60 00 cmp %i1, 0 4000dd90: 02 80 00 44 be 4000dea0 <_Heap_Free+0x1f0> <== NEVER TAKEN 4000dd94: 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; 4000dd98: 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) ) { 4000dd9c: 80 8e e0 01 btst 1, %i3 4000dda0: 02 80 00 40 be 4000dea0 <_Heap_Free+0x1f0> <== NEVER TAKEN 4000dda4: 80 8e a0 ff btst 0xff, %i2 _HAssert( false ); return( false ); } if ( next_is_free ) { /* coalesce both */ 4000dda8: 22 80 00 0f be,a 4000dde4 <_Heap_Free+0x134> 4000ddac: 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; 4000ddb0: c8 00 60 08 ld [ %g1 + 8 ], %g4 Heap_Block *prev = block->prev; 4000ddb4: c2 00 60 0c ld [ %g1 + 0xc ], %g1 uintptr_t const size = block_size + prev_size + next_block_size; 4000ddb8: ba 00 80 1d add %g2, %i5, %i5 prev->next = next; 4000ddbc: c8 20 60 08 st %g4, [ %g1 + 8 ] next->prev = prev; 4000ddc0: c2 21 20 0c st %g1, [ %g4 + 0xc ] _Heap_Free_list_remove( next_block ); stats->free_blocks -= 1; 4000ddc4: 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; 4000ddc8: b8 07 40 1c add %i5, %i4, %i4 _Heap_Free_list_remove( next_block ); stats->free_blocks -= 1; 4000ddcc: 82 00 7f ff add %g1, -1, %g1 4000ddd0: 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; 4000ddd4: 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; 4000ddd8: 82 17 20 01 or %i4, 1, %g1 4000dddc: 10 80 00 27 b 4000de78 <_Heap_Free+0x1c8> 4000dde0: 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; 4000dde4: 88 17 20 01 or %i4, 1, %g4 4000dde8: c8 20 e0 04 st %g4, [ %g3 + 4 ] next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED; 4000ddec: c6 00 60 04 ld [ %g1 + 4 ], %g3 next_block->prev_size = size; 4000ddf0: 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; 4000ddf4: 86 08 ff fe and %g3, -2, %g3 4000ddf8: 10 80 00 20 b 4000de78 <_Heap_Free+0x1c8> 4000ddfc: c6 20 60 04 st %g3, [ %g1 + 4 ] next_block->prev_size = size; } } else if ( next_is_free ) { /* coalesce next */ 4000de00: 22 80 00 0d be,a 4000de34 <_Heap_Free+0x184> 4000de04: 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; 4000de08: c8 00 60 08 ld [ %g1 + 8 ], %g4 Heap_Block *prev = old_block->prev; 4000de0c: c2 00 60 0c ld [ %g1 + 0xc ], %g1 new_block->next = next; 4000de10: c8 22 20 08 st %g4, [ %o0 + 8 ] new_block->prev = prev; 4000de14: c2 22 20 0c st %g1, [ %o0 + 0xc ] uintptr_t const size = block_size + next_block_size; 4000de18: 86 07 40 02 add %i5, %g2, %g3 next->prev = new_block; prev->next = new_block; 4000de1c: 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; 4000de20: d0 21 20 0c st %o0, [ %g4 + 0xc ] _Heap_Free_list_replace( next_block, block ); block->size_and_flag = size | HEAP_PREV_BLOCK_USED; 4000de24: 82 10 e0 01 or %g3, 1, %g1 next_block = _Heap_Block_at( block, size ); next_block->prev_size = size; 4000de28: 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; 4000de2c: 10 80 00 13 b 4000de78 <_Heap_Free+0x1c8> 4000de30: c2 22 20 04 st %g1, [ %o0 + 4 ] ) { Heap_Block *next = block_before->next; new_block->next = next; new_block->prev = block_before; 4000de34: f0 22 20 0c st %i0, [ %o0 + 0xc ] Heap_Block *new_block ) { Heap_Block *next = block_before->next; new_block->next = next; 4000de38: c6 22 20 08 st %g3, [ %o0 + 8 ] new_block->prev = block_before; block_before->next = new_block; next->prev = new_block; 4000de3c: 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; 4000de40: 86 10 a0 01 or %g2, 1, %g3 4000de44: c6 22 20 04 st %g3, [ %o0 + 4 ] next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED; 4000de48: c6 00 60 04 ld [ %g1 + 4 ], %g3 next_block->prev_size = block_size; 4000de4c: 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; 4000de50: 86 08 ff fe and %g3, -2, %g3 4000de54: c6 20 60 04 st %g3, [ %g1 + 4 ] next_block->prev_size = block_size; /* Statistics */ ++stats->free_blocks; 4000de58: c2 06 20 38 ld [ %i0 + 0x38 ], %g1 if ( stats->max_free_blocks < stats->free_blocks ) { 4000de5c: 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; 4000de60: 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; 4000de64: d0 26 20 08 st %o0, [ %i0 + 8 ] if ( stats->max_free_blocks < stats->free_blocks ) { 4000de68: 80 a0 c0 01 cmp %g3, %g1 4000de6c: 1a 80 00 03 bcc 4000de78 <_Heap_Free+0x1c8> 4000de70: c2 26 20 38 st %g1, [ %i0 + 0x38 ] stats->max_free_blocks = stats->free_blocks; 4000de74: c2 26 20 3c st %g1, [ %i0 + 0x3c ] } } /* Statistics */ --stats->used_blocks; 4000de78: c2 06 20 40 ld [ %i0 + 0x40 ], %g1 4000de7c: 82 00 7f ff add %g1, -1, %g1 4000de80: c2 26 20 40 st %g1, [ %i0 + 0x40 ] ++stats->frees; 4000de84: c2 06 20 50 ld [ %i0 + 0x50 ], %g1 4000de88: 82 00 60 01 inc %g1 4000de8c: c2 26 20 50 st %g1, [ %i0 + 0x50 ] stats->free_size += block_size; 4000de90: c2 06 20 30 ld [ %i0 + 0x30 ], %g1 4000de94: 84 00 40 02 add %g1, %g2, %g2 4000de98: 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; 4000de9c: 88 10 20 01 mov 1, %g4 --stats->used_blocks; ++stats->frees; stats->free_size += block_size; return( true ); } 4000dea0: b0 09 20 01 and %g4, 1, %i0 4000dea4: 81 c7 e0 08 ret 4000dea8: 81 e8 00 00 restore =============================================================================== 4000b0ec <_Heap_Greedy_allocate>: Heap_Block *_Heap_Greedy_allocate( Heap_Control *heap, const uintptr_t *block_sizes, size_t block_count ) { 4000b0ec: 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) { 4000b0f0: b6 10 20 00 clr %i3 Heap_Block *_Heap_Greedy_allocate( Heap_Control *heap, const uintptr_t *block_sizes, size_t block_count ) { 4000b0f4: 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) { 4000b0f8: 10 80 00 11 b 4000b13c <_Heap_Greedy_allocate+0x50> 4000b0fc: 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 ); 4000b100: d2 06 40 01 ld [ %i1 + %g1 ], %o1 4000b104: 90 10 00 1d mov %i5, %o0 4000b108: 94 10 20 00 clr %o2 4000b10c: 40 00 1d 80 call 4001270c <_Heap_Allocate_aligned_with_boundary> 4000b110: 96 10 20 00 clr %o3 void *next = _Heap_Allocate( heap, block_sizes [i] ); if ( next != NULL ) { 4000b114: 82 92 20 00 orcc %o0, 0, %g1 4000b118: 22 80 00 09 be,a 4000b13c <_Heap_Greedy_allocate+0x50> <== NEVER TAKEN 4000b11c: 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); 4000b120: d2 07 60 10 ld [ %i5 + 0x10 ], %o1 4000b124: 40 00 34 71 call 400182e8 <.urem> 4000b128: 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); 4000b12c: 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; 4000b130: f8 22 20 08 st %i4, [ %o0 + 8 ] 4000b134: 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) { 4000b138: b6 06 e0 01 inc %i3 4000b13c: 80 a6 c0 1a cmp %i3, %i2 4000b140: 12 bf ff f0 bne 4000b100 <_Heap_Greedy_allocate+0x14> 4000b144: 83 2e e0 02 sll %i3, 2, %g1 4000b148: 10 80 00 0a b 4000b170 <_Heap_Greedy_allocate+0x84> 4000b14c: b0 10 20 00 clr %i0 allocated_blocks = next_block; } } while ( (current = _Heap_Free_list_first( heap )) != free_list_tail ) { _Heap_Block_allocate( 4000b150: 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; 4000b154: 96 0a ff fe and %o3, -2, %o3 4000b158: 92 10 00 1b mov %i3, %o1 4000b15c: 94 06 e0 08 add %i3, 8, %o2 4000b160: 40 00 00 cb call 4000b48c <_Heap_Block_allocate> 4000b164: 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; 4000b168: f0 26 e0 08 st %i0, [ %i3 + 8 ] 4000b16c: 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; 4000b170: 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 ) { 4000b174: 80 a6 c0 1d cmp %i3, %i5 4000b178: 32 bf ff f6 bne,a 4000b150 <_Heap_Greedy_allocate+0x64> 4000b17c: d6 06 e0 04 ld [ %i3 + 4 ], %o3 current->next = blocks; blocks = current; } while ( allocated_blocks != NULL ) { 4000b180: 10 80 00 07 b 4000b19c <_Heap_Greedy_allocate+0xb0> 4000b184: 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 ) ); 4000b188: 92 07 20 08 add %i4, 8, %o1 4000b18c: 90 10 00 1d mov %i5, %o0 4000b190: 40 00 1d d0 call 400128d0 <_Heap_Free> 4000b194: b8 10 00 1b mov %i3, %i4 current->next = blocks; blocks = current; } while ( allocated_blocks != NULL ) { 4000b198: 80 a7 20 00 cmp %i4, 0 4000b19c: 32 bf ff fb bne,a 4000b188 <_Heap_Greedy_allocate+0x9c> 4000b1a0: 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; } 4000b1a4: 81 c7 e0 08 ret 4000b1a8: 81 e8 00 00 restore =============================================================================== 40013714 <_Heap_Iterate>: void _Heap_Iterate( Heap_Control *heap, Heap_Block_visitor visitor, void *visitor_arg ) { 40013714: 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; 40013718: 90 10 20 00 clr %o0 <== NOT EXECUTED Heap_Control *heap, Heap_Block_visitor visitor, void *visitor_arg ) { Heap_Block *current = heap->first_block; 4001371c: c2 06 20 20 ld [ %i0 + 0x20 ], %g1 <== NOT EXECUTED Heap_Block *end = heap->last_block; bool stop = false; while ( !stop && current != end ) { 40013720: 10 80 00 0a b 40013748 <_Heap_Iterate+0x34> <== NOT EXECUTED 40013724: 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 ); 40013728: 90 10 00 01 mov %g1, %o0 <== NOT EXECUTED 4001372c: 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); 40013730: 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; 40013734: d4 07 60 04 ld [ %i5 + 4 ], %o2 <== NOT EXECUTED 40013738: 96 10 00 1a mov %i2, %o3 <== NOT EXECUTED 4001373c: 9f c6 40 00 call %i1 <== NOT EXECUTED 40013740: 94 0a a0 01 and %o2, 1, %o2 <== NOT EXECUTED 40013744: 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 ) { 40013748: 80 a0 40 1c cmp %g1, %i4 <== NOT EXECUTED 4001374c: 02 80 00 05 be 40013760 <_Heap_Iterate+0x4c> <== NOT EXECUTED 40013750: 90 1a 20 01 xor %o0, 1, %o0 <== NOT EXECUTED 40013754: 80 8a 20 ff btst 0xff, %o0 <== NOT EXECUTED 40013758: 32 bf ff f4 bne,a 40013728 <_Heap_Iterate+0x14> <== NOT EXECUTED 4001375c: d2 00 60 04 ld [ %g1 + 4 ], %o1 <== NOT EXECUTED 40013760: 81 c7 e0 08 ret <== NOT EXECUTED 40013764: 81 e8 00 00 restore <== NOT EXECUTED =============================================================================== 4001c4b8 <_Heap_Size_of_alloc_area>: bool _Heap_Size_of_alloc_area( Heap_Control *heap, void *alloc_begin_ptr, uintptr_t *alloc_size ) { 4001c4b8: 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); 4001c4bc: d2 06 20 10 ld [ %i0 + 0x10 ], %o1 4001c4c0: 7f ff f2 a4 call 40018f50 <.urem> 4001c4c4: 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 4001c4c8: 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); 4001c4cc: 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); 4001c4d0: 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; 4001c4d4: 80 a2 00 04 cmp %o0, %g4 4001c4d8: 0a 80 00 05 bcs 4001c4ec <_Heap_Size_of_alloc_area+0x34> 4001c4dc: 82 10 20 00 clr %g1 4001c4e0: c2 06 20 24 ld [ %i0 + 0x24 ], %g1 4001c4e4: 80 a0 40 08 cmp %g1, %o0 4001c4e8: 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 ) ) { 4001c4ec: 80 a0 60 00 cmp %g1, 0 4001c4f0: 02 80 00 15 be 4001c544 <_Heap_Size_of_alloc_area+0x8c> 4001c4f4: 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; 4001c4f8: c2 02 20 04 ld [ %o0 + 4 ], %g1 4001c4fc: 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); 4001c500: 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; 4001c504: 80 a0 40 04 cmp %g1, %g4 4001c508: 0a 80 00 05 bcs 4001c51c <_Heap_Size_of_alloc_area+0x64> <== NEVER TAKEN 4001c50c: 84 10 20 00 clr %g2 4001c510: c4 06 20 24 ld [ %i0 + 0x24 ], %g2 4001c514: 80 a0 80 01 cmp %g2, %g1 4001c518: 84 60 3f ff subx %g0, -1, %g2 } block_size = _Heap_Block_size( block ); next_block = _Heap_Block_at( block, block_size ); if ( 4001c51c: 80 a0 a0 00 cmp %g2, 0 4001c520: 02 80 00 09 be 4001c544 <_Heap_Size_of_alloc_area+0x8c> <== NEVER TAKEN 4001c524: 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; 4001c528: c4 00 60 04 ld [ %g1 + 4 ], %g2 !_Heap_Is_block_in_heap( heap, next_block ) || !_Heap_Is_prev_used( next_block ) 4001c52c: 80 88 a0 01 btst 1, %g2 4001c530: 02 80 00 05 be 4001c544 <_Heap_Size_of_alloc_area+0x8c> <== NEVER TAKEN 4001c534: 82 20 40 19 sub %g1, %i1, %g1 return false; } *alloc_size = (uintptr_t) next_block + HEAP_ALLOC_BONUS - alloc_begin; return true; 4001c538: 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; 4001c53c: 82 00 60 04 add %g1, 4, %g1 4001c540: c2 26 80 00 st %g1, [ %i2 ] return true; } 4001c544: b0 08 e0 01 and %g3, 1, %i0 4001c548: 81 c7 e0 08 ret 4001c54c: 81 e8 00 00 restore =============================================================================== 40009ce4 <_Heap_Walk>: bool _Heap_Walk( Heap_Control *heap, int source, bool dump ) { 40009ce4: 9d e3 bf 80 save %sp, -128, %sp 40009ce8: ac 10 00 19 mov %i1, %l6 uintptr_t const page_size = heap->page_size; 40009cec: f8 06 20 10 ld [ %i0 + 0x10 ], %i4 uintptr_t const min_block_size = heap->min_block_size; 40009cf0: f6 06 20 14 ld [ %i0 + 0x14 ], %i3 Heap_Block *const first_block = heap->first_block; 40009cf4: 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; 40009cf8: 80 a6 a0 00 cmp %i2, 0 40009cfc: 02 80 00 05 be 40009d10 <_Heap_Walk+0x2c> 40009d00: e0 06 20 24 ld [ %i0 + 0x24 ], %l0 40009d04: 3b 10 00 27 sethi %hi(0x40009c00), %i5 40009d08: 10 80 00 04 b 40009d18 <_Heap_Walk+0x34> 40009d0c: ba 17 60 94 or %i5, 0x94, %i5 ! 40009c94 <_Heap_Walk_print> 40009d10: 3b 10 00 27 sethi %hi(0x40009c00), %i5 40009d14: ba 17 60 8c or %i5, 0x8c, %i5 ! 40009c8c <_Heap_Walk_print_nothing> if ( !_System_state_Is_up( _System_state_Get() ) ) { 40009d18: 05 10 00 66 sethi %hi(0x40019800), %g2 40009d1c: c4 00 a1 e8 ld [ %g2 + 0x1e8 ], %g2 ! 400199e8 <_System_state_Current> 40009d20: 80 a0 a0 03 cmp %g2, 3 40009d24: 22 80 00 04 be,a 40009d34 <_Heap_Walk+0x50> 40009d28: c4 06 20 1c ld [ %i0 + 0x1c ], %g2 return true; 40009d2c: 10 80 01 2a b 4000a1d4 <_Heap_Walk+0x4f0> 40009d30: 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)( 40009d34: da 06 20 18 ld [ %i0 + 0x18 ], %o5 40009d38: c4 23 a0 5c st %g2, [ %sp + 0x5c ] 40009d3c: f2 23 a0 60 st %i1, [ %sp + 0x60 ] 40009d40: e0 23 a0 64 st %l0, [ %sp + 0x64 ] 40009d44: c4 06 20 08 ld [ %i0 + 8 ], %g2 40009d48: 90 10 00 16 mov %l6, %o0 40009d4c: c4 23 a0 68 st %g2, [ %sp + 0x68 ] 40009d50: c4 06 20 0c ld [ %i0 + 0xc ], %g2 40009d54: 92 10 20 00 clr %o1 40009d58: c4 23 a0 6c st %g2, [ %sp + 0x6c ] 40009d5c: 15 10 00 5a sethi %hi(0x40016800), %o2 40009d60: 96 10 00 1c mov %i4, %o3 40009d64: 94 12 a1 90 or %o2, 0x190, %o2 40009d68: 9f c7 40 00 call %i5 40009d6c: 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 ) { 40009d70: 80 a7 20 00 cmp %i4, 0 40009d74: 12 80 00 07 bne 40009d90 <_Heap_Walk+0xac> 40009d78: 80 8f 20 07 btst 7, %i4 (*printer)( source, true, "page size is zero\n" ); 40009d7c: 15 10 00 5a sethi %hi(0x40016800), %o2 40009d80: 90 10 00 16 mov %l6, %o0 40009d84: 92 10 20 01 mov 1, %o1 40009d88: 10 80 00 37 b 40009e64 <_Heap_Walk+0x180> 40009d8c: 94 12 a2 28 or %o2, 0x228, %o2 return false; } if ( !_Addresses_Is_aligned( (void *) page_size ) ) { 40009d90: 22 80 00 08 be,a 40009db0 <_Heap_Walk+0xcc> 40009d94: 90 10 00 1b mov %i3, %o0 (*printer)( 40009d98: 15 10 00 5a sethi %hi(0x40016800), %o2 40009d9c: 90 10 00 16 mov %l6, %o0 40009da0: 92 10 20 01 mov 1, %o1 40009da4: 94 12 a2 40 or %o2, 0x240, %o2 40009da8: 10 80 01 12 b 4000a1f0 <_Heap_Walk+0x50c> 40009dac: 96 10 00 1c mov %i4, %o3 RTEMS_INLINE_ROUTINE bool _Heap_Is_aligned( uintptr_t value, uintptr_t alignment ) { return (value % alignment) == 0; 40009db0: 7f ff df 75 call 40001b84 <.urem> 40009db4: 92 10 00 1c mov %i4, %o1 ); return false; } if ( !_Heap_Is_aligned( min_block_size, page_size ) ) { 40009db8: 80 a2 20 00 cmp %o0, 0 40009dbc: 22 80 00 08 be,a 40009ddc <_Heap_Walk+0xf8> 40009dc0: 90 06 60 08 add %i1, 8, %o0 (*printer)( 40009dc4: 15 10 00 5a sethi %hi(0x40016800), %o2 40009dc8: 90 10 00 16 mov %l6, %o0 40009dcc: 92 10 20 01 mov 1, %o1 40009dd0: 94 12 a2 60 or %o2, 0x260, %o2 40009dd4: 10 80 01 07 b 4000a1f0 <_Heap_Walk+0x50c> 40009dd8: 96 10 00 1b mov %i3, %o3 40009ddc: 7f ff df 6a call 40001b84 <.urem> 40009de0: 92 10 00 1c mov %i4, %o1 ); return false; } if ( 40009de4: 80 a2 20 00 cmp %o0, 0 40009de8: 22 80 00 07 be,a 40009e04 <_Heap_Walk+0x120> 40009dec: c4 06 60 04 ld [ %i1 + 4 ], %g2 !_Heap_Is_aligned( _Heap_Alloc_area_of_block( first_block ), page_size ) ) { (*printer)( 40009df0: 15 10 00 5a sethi %hi(0x40016800), %o2 40009df4: 90 10 00 16 mov %l6, %o0 40009df8: 92 10 20 01 mov 1, %o1 40009dfc: 10 80 00 fc b 4000a1ec <_Heap_Walk+0x508> 40009e00: 94 12 a2 88 or %o2, 0x288, %o2 ); return false; } if ( !_Heap_Is_prev_used( first_block ) ) { 40009e04: 80 88 a0 01 btst 1, %g2 40009e08: 32 80 00 07 bne,a 40009e24 <_Heap_Walk+0x140> 40009e0c: f4 04 20 04 ld [ %l0 + 4 ], %i2 (*printer)( 40009e10: 15 10 00 5a sethi %hi(0x40016800), %o2 40009e14: 90 10 00 16 mov %l6, %o0 40009e18: 92 10 20 01 mov 1, %o1 40009e1c: 10 80 00 12 b 40009e64 <_Heap_Walk+0x180> 40009e20: 94 12 a2 c0 or %o2, 0x2c0, %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; 40009e24: 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); 40009e28: 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; 40009e2c: c4 06 a0 04 ld [ %i2 + 4 ], %g2 ); return false; } if ( _Heap_Is_free( last_block ) ) { 40009e30: 80 88 a0 01 btst 1, %g2 40009e34: 12 80 00 07 bne 40009e50 <_Heap_Walk+0x16c> 40009e38: 80 a6 80 19 cmp %i2, %i1 (*printer)( 40009e3c: 15 10 00 5a sethi %hi(0x40016800), %o2 40009e40: 90 10 00 16 mov %l6, %o0 40009e44: 92 10 20 01 mov 1, %o1 40009e48: 10 80 00 07 b 40009e64 <_Heap_Walk+0x180> 40009e4c: 94 12 a2 f0 or %o2, 0x2f0, %o2 ); return false; } if ( 40009e50: 02 80 00 0a be 40009e78 <_Heap_Walk+0x194> 40009e54: 15 10 00 5a sethi %hi(0x40016800), %o2 _Heap_Block_at( last_block, _Heap_Block_size( last_block ) ) != first_block ) { (*printer)( 40009e58: 90 10 00 16 mov %l6, %o0 40009e5c: 92 10 20 01 mov 1, %o1 40009e60: 94 12 a3 08 or %o2, 0x308, %o2 40009e64: 9f c7 40 00 call %i5 40009e68: b0 10 20 00 clr %i0 40009e6c: b0 0e 20 ff and %i0, 0xff, %i0 40009e70: 81 c7 e0 08 ret 40009e74: 81 e8 00 00 restore int source, Heap_Walk_printer printer, Heap_Control *heap ) { uintptr_t const page_size = heap->page_size; 40009e78: 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; 40009e7c: d6 06 20 08 ld [ %i0 + 8 ], %o3 const Heap_Block *const free_list_tail = _Heap_Free_list_tail( heap ); 40009e80: 10 80 00 30 b 40009f40 <_Heap_Walk+0x25c> 40009e84: 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; 40009e88: 80 a0 c0 0b cmp %g3, %o3 40009e8c: 18 80 00 05 bgu 40009ea0 <_Heap_Walk+0x1bc> 40009e90: 84 10 20 00 clr %g2 40009e94: c4 06 20 24 ld [ %i0 + 0x24 ], %g2 40009e98: 80 a0 80 0b cmp %g2, %o3 40009e9c: 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 ) ) { 40009ea0: 80 a0 a0 00 cmp %g2, 0 40009ea4: 32 80 00 07 bne,a 40009ec0 <_Heap_Walk+0x1dc> 40009ea8: 90 02 e0 08 add %o3, 8, %o0 (*printer)( 40009eac: 15 10 00 5a sethi %hi(0x40016800), %o2 40009eb0: 90 10 00 16 mov %l6, %o0 40009eb4: 92 10 20 01 mov 1, %o1 40009eb8: 10 80 00 ce b 4000a1f0 <_Heap_Walk+0x50c> 40009ebc: 94 12 a3 38 or %o2, 0x338, %o2 RTEMS_INLINE_ROUTINE bool _Heap_Is_aligned( uintptr_t value, uintptr_t alignment ) { return (value % alignment) == 0; 40009ec0: d6 27 bf fc st %o3, [ %fp + -4 ] 40009ec4: 7f ff df 30 call 40001b84 <.urem> 40009ec8: 92 10 00 11 mov %l1, %o1 ); return false; } if ( 40009ecc: 80 a2 20 00 cmp %o0, 0 40009ed0: 02 80 00 07 be 40009eec <_Heap_Walk+0x208> 40009ed4: d6 07 bf fc ld [ %fp + -4 ], %o3 !_Heap_Is_aligned( _Heap_Alloc_area_of_block( free_block ), page_size ) ) { (*printer)( 40009ed8: 15 10 00 5a sethi %hi(0x40016800), %o2 40009edc: 90 10 00 16 mov %l6, %o0 40009ee0: 92 10 20 01 mov 1, %o1 40009ee4: 10 80 00 c3 b 4000a1f0 <_Heap_Walk+0x50c> 40009ee8: 94 12 a3 58 or %o2, 0x358, %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; 40009eec: c4 02 e0 04 ld [ %o3 + 4 ], %g2 40009ef0: 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; 40009ef4: 84 02 c0 02 add %o3, %g2, %g2 40009ef8: c4 00 a0 04 ld [ %g2 + 4 ], %g2 ); return false; } if ( _Heap_Is_used( free_block ) ) { 40009efc: 80 88 a0 01 btst 1, %g2 40009f00: 22 80 00 07 be,a 40009f1c <_Heap_Walk+0x238> 40009f04: d8 02 e0 0c ld [ %o3 + 0xc ], %o4 (*printer)( 40009f08: 15 10 00 5a sethi %hi(0x40016800), %o2 40009f0c: 90 10 00 16 mov %l6, %o0 40009f10: 92 10 20 01 mov 1, %o1 40009f14: 10 80 00 b7 b 4000a1f0 <_Heap_Walk+0x50c> 40009f18: 94 12 a3 88 or %o2, 0x388, %o2 ); return false; } if ( free_block->prev != prev_block ) { 40009f1c: 80 a3 00 19 cmp %o4, %i1 40009f20: 02 80 00 07 be 40009f3c <_Heap_Walk+0x258> 40009f24: b2 10 00 0b mov %o3, %i1 (*printer)( 40009f28: 15 10 00 5a sethi %hi(0x40016800), %o2 40009f2c: 90 10 00 16 mov %l6, %o0 40009f30: 92 10 20 01 mov 1, %o1 40009f34: 10 80 00 4d b 4000a068 <_Heap_Walk+0x384> 40009f38: 94 12 a3 a8 or %o2, 0x3a8, %o2 return false; } prev_block = free_block; free_block = free_block->next; 40009f3c: 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 ) { 40009f40: 80 a2 c0 18 cmp %o3, %i0 40009f44: 32 bf ff d1 bne,a 40009e88 <_Heap_Walk+0x1a4> 40009f48: 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)( 40009f4c: 2b 10 00 5b sethi %hi(0x40016c00), %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 ) { 40009f50: 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)( 40009f54: aa 15 60 a8 or %l5, 0xa8, %l5 " (= first free)" : (block->prev == free_list_head ? " (= head)" : ""), block->next, block->next == last_free_block ? " (= last free)" : (block->next == free_list_tail ? " (= tail)" : "") 40009f58: 23 10 00 5b sethi %hi(0x40016c00), %l1 40009f5c: 2f 10 00 5a sethi %hi(0x40016800), %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; 40009f60: 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; 40009f64: 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; 40009f68: 9e 1e 40 10 xor %i1, %l0, %o7 40009f6c: 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; 40009f70: a8 0c bf fe and %l2, -2, %l4 40009f74: 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); 40009f78: 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; 40009f7c: 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; 40009f80: 80 a3 00 13 cmp %o4, %l3 40009f84: 18 80 00 05 bgu 40009f98 <_Heap_Walk+0x2b4> <== NEVER TAKEN 40009f88: 9e 10 20 00 clr %o7 40009f8c: de 06 20 24 ld [ %i0 + 0x24 ], %o7 40009f90: 80 a3 c0 13 cmp %o7, %l3 40009f94: 9e 60 3f ff subx %g0, -1, %o7 if ( !_Heap_Is_block_in_heap( heap, next_block ) ) { 40009f98: 80 a3 e0 00 cmp %o7, 0 40009f9c: 32 80 00 07 bne,a 40009fb8 <_Heap_Walk+0x2d4> 40009fa0: da 27 bf f8 st %o5, [ %fp + -8 ] (*printer)( 40009fa4: 15 10 00 5a sethi %hi(0x40016800), %o2 40009fa8: 90 10 00 16 mov %l6, %o0 40009fac: 92 10 20 01 mov 1, %o1 40009fb0: 10 80 00 2c b 4000a060 <_Heap_Walk+0x37c> 40009fb4: 94 12 a3 e0 or %o2, 0x3e0, %o2 RTEMS_INLINE_ROUTINE bool _Heap_Is_aligned( uintptr_t value, uintptr_t alignment ) { return (value % alignment) == 0; 40009fb8: 90 10 00 14 mov %l4, %o0 40009fbc: 7f ff de f2 call 40001b84 <.urem> 40009fc0: 92 10 00 1c mov %i4, %o1 40009fc4: da 07 bf f8 ld [ %fp + -8 ], %o5 ); return false; } if ( !_Heap_Is_aligned( block_size, page_size ) && is_not_last_block ) { 40009fc8: 80 a2 20 00 cmp %o0, 0 40009fcc: 02 80 00 0c be 40009ffc <_Heap_Walk+0x318> 40009fd0: 9e 0b 60 ff and %o5, 0xff, %o7 40009fd4: 80 a3 e0 00 cmp %o7, 0 40009fd8: 02 80 00 19 be 4000a03c <_Heap_Walk+0x358> 40009fdc: 80 a6 40 13 cmp %i1, %l3 (*printer)( 40009fe0: 15 10 00 5b sethi %hi(0x40016c00), %o2 40009fe4: 90 10 00 16 mov %l6, %o0 40009fe8: 92 10 20 01 mov 1, %o1 40009fec: 94 12 a0 10 or %o2, 0x10, %o2 40009ff0: 96 10 00 19 mov %i1, %o3 40009ff4: 10 80 00 1d b 4000a068 <_Heap_Walk+0x384> 40009ff8: 98 10 00 14 mov %l4, %o4 ); return false; } if ( block_size < min_block_size && is_not_last_block ) { 40009ffc: 80 a3 e0 00 cmp %o7, 0 4000a000: 02 80 00 0f be 4000a03c <_Heap_Walk+0x358> 4000a004: 80 a6 40 13 cmp %i1, %l3 4000a008: 80 a5 00 1b cmp %l4, %i3 4000a00c: 1a 80 00 0c bcc 4000a03c <_Heap_Walk+0x358> 4000a010: 80 a6 40 13 cmp %i1, %l3 (*printer)( 4000a014: 90 10 00 16 mov %l6, %o0 4000a018: 92 10 20 01 mov 1, %o1 4000a01c: 15 10 00 5b sethi %hi(0x40016c00), %o2 4000a020: 96 10 00 19 mov %i1, %o3 4000a024: 94 12 a0 40 or %o2, 0x40, %o2 4000a028: 98 10 00 14 mov %l4, %o4 4000a02c: 9f c7 40 00 call %i5 4000a030: 9a 10 00 1b mov %i3, %o5 "block 0x%08x: next block 0x%08x is not a successor\n", block, next_block ); return false; 4000a034: 10 80 00 68 b 4000a1d4 <_Heap_Walk+0x4f0> 4000a038: b0 10 20 00 clr %i0 ); return false; } if ( next_block_begin <= block_begin && is_not_last_block ) { 4000a03c: 2a 80 00 10 bcs,a 4000a07c <_Heap_Walk+0x398> 4000a040: de 04 e0 04 ld [ %l3 + 4 ], %o7 4000a044: 80 8b 60 ff btst 0xff, %o5 4000a048: 22 80 00 0d be,a 4000a07c <_Heap_Walk+0x398> 4000a04c: de 04 e0 04 ld [ %l3 + 4 ], %o7 (*printer)( 4000a050: 15 10 00 5b sethi %hi(0x40016c00), %o2 4000a054: 90 10 00 16 mov %l6, %o0 4000a058: 92 10 20 01 mov 1, %o1 4000a05c: 94 12 a0 70 or %o2, 0x70, %o2 4000a060: 96 10 00 19 mov %i1, %o3 4000a064: 98 10 00 13 mov %l3, %o4 4000a068: 9f c7 40 00 call %i5 4000a06c: b0 10 20 00 clr %i0 4000a070: b0 0e 20 ff and %i0, 0xff, %i0 4000a074: 81 c7 e0 08 ret 4000a078: 81 e8 00 00 restore ); return false; } if ( !_Heap_Is_prev_used( next_block ) ) { 4000a07c: 80 8b e0 01 btst 1, %o7 4000a080: 12 80 00 3f bne 4000a17c <_Heap_Walk+0x498> 4000a084: 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 ? 4000a088: 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)( 4000a08c: d8 06 20 08 ld [ %i0 + 8 ], %o4 4000a090: 80 a3 40 0c cmp %o5, %o4 4000a094: 02 80 00 08 be 4000a0b4 <_Heap_Walk+0x3d0> 4000a098: 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)" : ""), 4000a09c: 80 a3 40 18 cmp %o5, %i0 4000a0a0: 12 80 00 07 bne 4000a0bc <_Heap_Walk+0x3d8> 4000a0a4: 96 14 61 18 or %l1, 0x118, %o3 4000a0a8: 17 10 00 5a sethi %hi(0x40016800), %o3 4000a0ac: 10 80 00 04 b 4000a0bc <_Heap_Walk+0x3d8> 4000a0b0: 96 12 e1 60 or %o3, 0x160, %o3 ! 40016960 <__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)( 4000a0b4: 03 10 00 5a sethi %hi(0x40016800), %g1 4000a0b8: 96 10 61 50 or %g1, 0x150, %o3 ! 40016950 <__log2table+0x120> block->prev, block->prev == first_free_block ? " (= first free)" : (block->prev == free_list_head ? " (= head)" : ""), block->next, block->next == last_free_block ? 4000a0bc: 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)( 4000a0c0: 80 a3 00 0f cmp %o4, %o7 4000a0c4: 02 80 00 06 be 4000a0dc <_Heap_Walk+0x3f8> 4000a0c8: 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)" : "") 4000a0cc: 12 80 00 06 bne 4000a0e4 <_Heap_Walk+0x400> 4000a0d0: 9e 14 61 18 or %l1, 0x118, %o7 4000a0d4: 10 80 00 04 b 4000a0e4 <_Heap_Walk+0x400> 4000a0d8: 9e 15 e1 80 or %l7, 0x180, %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)( 4000a0dc: 03 10 00 5a sethi %hi(0x40016800), %g1 4000a0e0: 9e 10 61 70 or %g1, 0x170, %o7 ! 40016970 <__log2table+0x140> 4000a0e4: d6 23 a0 5c st %o3, [ %sp + 0x5c ] 4000a0e8: d8 23 a0 60 st %o4, [ %sp + 0x60 ] 4000a0ec: de 23 a0 64 st %o7, [ %sp + 0x64 ] 4000a0f0: 90 10 00 16 mov %l6, %o0 4000a0f4: 92 10 20 00 clr %o1 4000a0f8: 94 10 00 15 mov %l5, %o2 4000a0fc: 96 10 00 19 mov %i1, %o3 4000a100: 9f c7 40 00 call %i5 4000a104: 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 ) { 4000a108: da 04 c0 00 ld [ %l3 ], %o5 4000a10c: 80 a5 00 0d cmp %l4, %o5 4000a110: 02 80 00 0c be 4000a140 <_Heap_Walk+0x45c> 4000a114: 80 a4 a0 00 cmp %l2, 0 (*printer)( 4000a118: e6 23 a0 5c st %l3, [ %sp + 0x5c ] 4000a11c: 90 10 00 16 mov %l6, %o0 4000a120: 92 10 20 01 mov 1, %o1 4000a124: 15 10 00 5b sethi %hi(0x40016c00), %o2 4000a128: 96 10 00 19 mov %i1, %o3 4000a12c: 94 12 a0 e0 or %o2, 0xe0, %o2 4000a130: 9f c7 40 00 call %i5 4000a134: 98 10 00 14 mov %l4, %o4 "block 0x%08x: next block 0x%08x is not a successor\n", block, next_block ); return false; 4000a138: 10 bf ff ce b 4000a070 <_Heap_Walk+0x38c> 4000a13c: b0 10 20 00 clr %i0 ); return false; } if ( !prev_used ) { 4000a140: 32 80 00 0a bne,a 4000a168 <_Heap_Walk+0x484> 4000a144: c6 06 20 08 ld [ %i0 + 8 ], %g3 (*printer)( 4000a148: 15 10 00 5b sethi %hi(0x40016c00), %o2 4000a14c: 90 10 00 16 mov %l6, %o0 4000a150: 92 10 20 01 mov 1, %o1 4000a154: 10 80 00 26 b 4000a1ec <_Heap_Walk+0x508> 4000a158: 94 12 a1 20 or %o2, 0x120, %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 ) { 4000a15c: 22 80 00 19 be,a 4000a1c0 <_Heap_Walk+0x4dc> 4000a160: b2 10 00 13 mov %l3, %i1 return true; } free_block = free_block->next; 4000a164: 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 ) { 4000a168: 80 a0 c0 18 cmp %g3, %i0 4000a16c: 12 bf ff fc bne 4000a15c <_Heap_Walk+0x478> 4000a170: 80 a0 c0 19 cmp %g3, %i1 return false; } if ( !_Heap_Walk_is_in_free_list( heap, block ) ) { (*printer)( 4000a174: 10 80 00 1b b 4000a1e0 <_Heap_Walk+0x4fc> 4000a178: 15 10 00 5b sethi %hi(0x40016c00), %o2 if ( !_Heap_Is_prev_used( next_block ) ) { if ( !_Heap_Walk_check_free_block( source, printer, heap, block ) ) { return false; } } else if (prev_used) { 4000a17c: 80 a4 a0 00 cmp %l2, 0 4000a180: 02 80 00 09 be 4000a1a4 <_Heap_Walk+0x4c0> 4000a184: 92 10 20 00 clr %o1 (*printer)( 4000a188: 15 10 00 5b sethi %hi(0x40016c00), %o2 4000a18c: 96 10 00 19 mov %i1, %o3 4000a190: 94 12 a1 50 or %o2, 0x150, %o2 4000a194: 9f c7 40 00 call %i5 4000a198: 98 10 00 14 mov %l4, %o4 4000a19c: 10 80 00 09 b 4000a1c0 <_Heap_Walk+0x4dc> 4000a1a0: b2 10 00 13 mov %l3, %i1 "block 0x%08x: size %u\n", block, block_size ); } else { (*printer)( 4000a1a4: da 06 40 00 ld [ %i1 ], %o5 4000a1a8: 15 10 00 5b sethi %hi(0x40016c00), %o2 4000a1ac: 96 10 00 19 mov %i1, %o3 4000a1b0: 94 12 a1 68 or %o2, 0x168, %o2 4000a1b4: 9f c7 40 00 call %i5 4000a1b8: 98 10 00 14 mov %l4, %o4 4000a1bc: b2 10 00 13 mov %l3, %i1 block->prev_size ); } block = next_block; } while ( block != first_block ); 4000a1c0: 80 a4 c0 1a cmp %l3, %i2 4000a1c4: 32 bf ff 68 bne,a 40009f64 <_Heap_Walk+0x280> 4000a1c8: e4 06 60 04 ld [ %i1 + 4 ], %l2 4000a1cc: 10 80 00 02 b 4000a1d4 <_Heap_Walk+0x4f0> 4000a1d0: b0 10 20 01 mov 1, %i0 4000a1d4: b0 0e 20 ff and %i0, 0xff, %i0 4000a1d8: 81 c7 e0 08 ret 4000a1dc: 81 e8 00 00 restore return false; } if ( !_Heap_Walk_is_in_free_list( heap, block ) ) { (*printer)( 4000a1e0: 90 10 00 16 mov %l6, %o0 4000a1e4: 92 10 20 01 mov 1, %o1 4000a1e8: 94 12 a1 90 or %o2, 0x190, %o2 4000a1ec: 96 10 00 19 mov %i1, %o3 4000a1f0: 9f c7 40 00 call %i5 4000a1f4: b0 10 20 00 clr %i0 4000a1f8: b0 0e 20 ff and %i0, 0xff, %i0 4000a1fc: 81 c7 e0 08 ret 4000a200: 81 e8 00 00 restore =============================================================================== 40009420 <_Internal_error_Occurred>: void _Internal_error_Occurred( Internal_errors_Source the_source, bool is_internal, Internal_errors_t the_error ) { 40009420: 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 ); 40009424: 13 10 00 2c sethi %hi(0x4000b000), %o1 40009428: 90 07 bf f4 add %fp, -12, %o0 4000942c: 92 12 63 a8 or %o1, 0x3a8, %o1 Internal_errors_Source source, bool is_internal, Internal_errors_t error ) { User_extensions_Fatal_context ctx = { source, is_internal, error }; 40009430: f0 27 bf f4 st %i0, [ %fp + -12 ] 40009434: f2 2f bf f8 stb %i1, [ %fp + -8 ] _User_extensions_Iterate( &ctx, _User_extensions_Fatal_visitor ); 40009438: 40 00 07 e7 call 4000b3d4 <_User_extensions_Iterate> 4000943c: 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; 40009440: 05 10 00 7e sethi %hi(0x4001f800), %g2 <== NOT EXECUTED 40009444: 82 10 a1 7c or %g2, 0x17c, %g1 ! 4001f97c <_Internal_errors_What_happened><== NOT EXECUTED 40009448: f0 20 a1 7c st %i0, [ %g2 + 0x17c ] <== NOT EXECUTED _Internal_errors_What_happened.is_internal = is_internal; 4000944c: f2 28 60 04 stb %i1, [ %g1 + 4 ] <== NOT EXECUTED _Internal_errors_What_happened.the_error = the_error; 40009450: 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; 40009454: 84 10 20 05 mov 5, %g2 <== NOT EXECUTED 40009458: 03 10 00 7e sethi %hi(0x4001f800), %g1 <== NOT EXECUTED _System_state_Set( SYSTEM_STATE_FAILED ); _CPU_Fatal_halt( the_error ); 4000945c: 7f ff e3 fb call 40002448 <== NOT EXECUTED 40009460: c4 20 61 88 st %g2, [ %g1 + 0x188 ] ! 4001f988 <_System_state_Current><== NOT EXECUTED 40009464: 82 10 00 08 mov %o0, %g1 <== NOT EXECUTED 40009468: 30 80 00 00 b,a 40009468 <_Internal_error_Occurred+0x48> <== NOT EXECUTED =============================================================================== 400094d4 <_Objects_Allocate>: #endif Objects_Control *_Objects_Allocate( Objects_Information *information ) { 400094d4: 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 ) 400094d8: c2 06 20 18 ld [ %i0 + 0x18 ], %g1 400094dc: 80 a0 60 00 cmp %g1, 0 400094e0: 12 80 00 04 bne 400094f0 <_Objects_Allocate+0x1c> <== ALWAYS TAKEN 400094e4: ba 10 00 18 mov %i0, %i5 return NULL; 400094e8: 81 c7 e0 08 ret 400094ec: 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 ); 400094f0: b8 06 20 20 add %i0, 0x20, %i4 400094f4: 7f ff fd 85 call 40008b08 <_Chain_Get> 400094f8: 90 10 00 1c mov %i4, %o0 if ( information->auto_extend ) { 400094fc: c2 0f 60 12 ldub [ %i5 + 0x12 ], %g1 40009500: 80 a0 60 00 cmp %g1, 0 40009504: 02 80 00 1d be 40009578 <_Objects_Allocate+0xa4> 40009508: 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 ) { 4000950c: 80 a2 20 00 cmp %o0, 0 40009510: 32 80 00 0a bne,a 40009538 <_Objects_Allocate+0x64> 40009514: c4 07 60 08 ld [ %i5 + 8 ], %g2 _Objects_Extend_information( information ); 40009518: 40 00 00 21 call 4000959c <_Objects_Extend_information> 4000951c: 90 10 00 1d mov %i5, %o0 the_object = (Objects_Control *) _Chain_Get( &information->Inactive ); 40009520: 7f ff fd 7a call 40008b08 <_Chain_Get> 40009524: 90 10 00 1c mov %i4, %o0 } if ( the_object ) { 40009528: b0 92 20 00 orcc %o0, 0, %i0 4000952c: 02 bf ff ef be 400094e8 <_Objects_Allocate+0x14> 40009530: 01 00 00 00 nop uint32_t block; block = (uint32_t) _Objects_Get_index( the_object->id ) - 40009534: c4 07 60 08 ld [ %i5 + 8 ], %g2 40009538: d0 06 20 08 ld [ %i0 + 8 ], %o0 _Objects_Get_index( information->minimum_id ); block /= information->allocation_size; 4000953c: d2 17 60 14 lduh [ %i5 + 0x14 ], %o1 } if ( the_object ) { uint32_t block; block = (uint32_t) _Objects_Get_index( the_object->id ) - 40009540: 03 00 00 3f sethi %hi(0xfc00), %g1 40009544: 82 10 63 ff or %g1, 0x3ff, %g1 ! ffff 40009548: 90 0a 00 01 and %o0, %g1, %o0 4000954c: 82 08 80 01 and %g2, %g1, %g1 _Objects_Get_index( information->minimum_id ); block /= information->allocation_size; 40009550: 40 00 3d d4 call 40018ca0 <.udiv> 40009554: 90 22 00 01 sub %o0, %g1, %o0 information->inactive_per_block[ block ]--; 40009558: c2 07 60 30 ld [ %i5 + 0x30 ], %g1 4000955c: 91 2a 20 02 sll %o0, 2, %o0 40009560: c4 00 40 08 ld [ %g1 + %o0 ], %g2 40009564: 84 00 bf ff add %g2, -1, %g2 40009568: c4 20 40 08 st %g2, [ %g1 + %o0 ] information->inactive--; 4000956c: c2 17 60 2c lduh [ %i5 + 0x2c ], %g1 40009570: 82 00 7f ff add %g1, -1, %g1 40009574: c2 37 60 2c sth %g1, [ %i5 + 0x2c ] ); } #endif return the_object; } 40009578: 81 c7 e0 08 ret 4000957c: 81 e8 00 00 restore =============================================================================== 40009904 <_Objects_Get_information>: Objects_Information *_Objects_Get_information( Objects_APIs the_api, uint16_t the_class ) { 40009904: 9d e3 bf a0 save %sp, -96, %sp Objects_Information *info; int the_class_api_maximum; if ( !the_class ) 40009908: 80 a6 60 00 cmp %i1, 0 4000990c: 12 80 00 04 bne 4000991c <_Objects_Get_information+0x18> 40009910: 01 00 00 00 nop return NULL; 40009914: 81 c7 e0 08 ret 40009918: 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 ); 4000991c: 40 00 11 64 call 4000deac <_Objects_API_maximum_class> 40009920: 90 10 00 18 mov %i0, %o0 if ( the_class_api_maximum == 0 ) 40009924: 80 a2 20 00 cmp %o0, 0 40009928: 02 bf ff fb be 40009914 <_Objects_Get_information+0x10> 4000992c: 80 a6 40 08 cmp %i1, %o0 return NULL; if ( the_class > (uint32_t) the_class_api_maximum ) 40009930: 18 bf ff f9 bgu 40009914 <_Objects_Get_information+0x10> 40009934: 03 10 00 7c sethi %hi(0x4001f000), %g1 return NULL; if ( !_Objects_Information_table[ the_api ] ) 40009938: b1 2e 20 02 sll %i0, 2, %i0 4000993c: 82 10 63 e4 or %g1, 0x3e4, %g1 40009940: c2 00 40 18 ld [ %g1 + %i0 ], %g1 40009944: 80 a0 60 00 cmp %g1, 0 40009948: 02 bf ff f3 be 40009914 <_Objects_Get_information+0x10> <== NEVER TAKEN 4000994c: b3 2e 60 02 sll %i1, 2, %i1 return NULL; info = _Objects_Information_table[ the_api ][ the_class ]; 40009950: f0 00 40 19 ld [ %g1 + %i1 ], %i0 if ( !info ) 40009954: 80 a6 20 00 cmp %i0, 0 40009958: 02 bf ff ef be 40009914 <_Objects_Get_information+0x10> <== NEVER TAKEN 4000995c: 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 ) 40009960: c2 16 20 10 lduh [ %i0 + 0x10 ], %g1 40009964: 80 a0 60 00 cmp %g1, 0 40009968: 02 bf ff eb be 40009914 <_Objects_Get_information+0x10> 4000996c: 01 00 00 00 nop return NULL; #endif return info; } 40009970: 81 c7 e0 08 ret 40009974: 81 e8 00 00 restore =============================================================================== 4001bcfc <_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; 4001bcfc: c2 02 20 08 ld [ %o0 + 8 ], %g1 4001bd00: 92 22 40 01 sub %o1, %g1, %o1 if ( information->maximum >= index ) { 4001bd04: 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; 4001bd08: 92 02 60 01 inc %o1 if ( information->maximum >= index ) { 4001bd0c: 80 a0 40 09 cmp %g1, %o1 4001bd10: 0a 80 00 09 bcs 4001bd34 <_Objects_Get_no_protection+0x38> 4001bd14: 93 2a 60 02 sll %o1, 2, %o1 if ( (the_object = information->local_table[ index ]) != NULL ) { 4001bd18: c2 02 20 1c ld [ %o0 + 0x1c ], %g1 4001bd1c: d0 00 40 09 ld [ %g1 + %o1 ], %o0 4001bd20: 80 a2 20 00 cmp %o0, 0 4001bd24: 02 80 00 05 be 4001bd38 <_Objects_Get_no_protection+0x3c> <== NEVER TAKEN 4001bd28: 82 10 20 01 mov 1, %g1 *location = OBJECTS_LOCAL; return the_object; 4001bd2c: 81 c3 e0 08 retl 4001bd30: 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; 4001bd34: 82 10 20 01 mov 1, %g1 return NULL; 4001bd38: 90 10 20 00 clr %o0 } 4001bd3c: 81 c3 e0 08 retl 4001bd40: c2 22 80 00 st %g1, [ %o2 ] =============================================================================== 4000da28 <_Objects_Id_to_name>: Objects_Name_or_id_lookup_errors _Objects_Id_to_name ( Objects_Id id, Objects_Name *name ) { 4000da28: 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; 4000da2c: 80 a6 20 00 cmp %i0, 0 4000da30: 12 80 00 06 bne 4000da48 <_Objects_Id_to_name+0x20> 4000da34: 83 36 20 18 srl %i0, 0x18, %g1 4000da38: 03 10 00 bf sethi %hi(0x4002fc00), %g1 4000da3c: c2 00 62 b0 ld [ %g1 + 0x2b0 ], %g1 ! 4002feb0 <_Per_CPU_Information+0x10> 4000da40: f0 00 60 08 ld [ %g1 + 8 ], %i0 4000da44: 83 36 20 18 srl %i0, 0x18, %g1 4000da48: 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 ) 4000da4c: 84 00 7f ff add %g1, -1, %g2 4000da50: 80 a0 a0 02 cmp %g2, 2 4000da54: 08 80 00 18 bleu 4000dab4 <_Objects_Id_to_name+0x8c> 4000da58: 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; 4000da5c: 81 c7 e0 08 ret 4000da60: 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 ]; 4000da64: 85 28 a0 02 sll %g2, 2, %g2 4000da68: d0 00 40 02 ld [ %g1 + %g2 ], %o0 if ( !information ) 4000da6c: 80 a2 20 00 cmp %o0, 0 4000da70: 02 bf ff fb be 4000da5c <_Objects_Id_to_name+0x34> <== NEVER TAKEN 4000da74: 01 00 00 00 nop return OBJECTS_INVALID_ID; #if defined(RTEMS_SCORE_OBJECT_ENABLE_STRING_NAMES) if ( information->is_string ) 4000da78: c2 0a 20 38 ldub [ %o0 + 0x38 ], %g1 4000da7c: 80 a0 60 00 cmp %g1, 0 4000da80: 12 bf ff f7 bne 4000da5c <_Objects_Id_to_name+0x34> <== NEVER TAKEN 4000da84: 92 10 00 18 mov %i0, %o1 return OBJECTS_INVALID_ID; #endif the_object = _Objects_Get( information, tmpId, &ignored_location ); 4000da88: 7f ff ff cb call 4000d9b4 <_Objects_Get> 4000da8c: 94 07 bf fc add %fp, -4, %o2 if ( !the_object ) 4000da90: 80 a2 20 00 cmp %o0, 0 4000da94: 02 bf ff f2 be 4000da5c <_Objects_Id_to_name+0x34> 4000da98: 01 00 00 00 nop return OBJECTS_INVALID_ID; *name = the_object->name; 4000da9c: c2 02 20 0c ld [ %o0 + 0xc ], %g1 _Thread_Enable_dispatch(); return OBJECTS_NAME_OR_ID_LOOKUP_SUCCESSFUL; 4000daa0: 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(); 4000daa4: 40 00 03 99 call 4000e908 <_Thread_Enable_dispatch> 4000daa8: c2 26 40 00 st %g1, [ %i1 ] 4000daac: 81 c7 e0 08 ret 4000dab0: 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 ] ) 4000dab4: 05 10 00 be sethi %hi(0x4002f800), %g2 4000dab8: 84 10 a0 b4 or %g2, 0xb4, %g2 ! 4002f8b4 <_Objects_Information_table> 4000dabc: c2 00 80 01 ld [ %g2 + %g1 ], %g1 4000dac0: 80 a0 60 00 cmp %g1, 0 4000dac4: 12 bf ff e8 bne 4000da64 <_Objects_Id_to_name+0x3c> 4000dac8: 85 36 20 1b srl %i0, 0x1b, %g2 4000dacc: 30 bf ff e4 b,a 4000da5c <_Objects_Id_to_name+0x34> =============================================================================== 4000f338 <_POSIX_Keys_Run_destructors>: */ void _POSIX_Keys_Run_destructors( Thread_Control *thread ) { 4000f338: 9d e3 bf a0 save %sp, -96, %sp Objects_Maximum thread_index = _Objects_Get_index( thread->Object.id ); 4000f33c: c2 06 20 08 ld [ %i0 + 8 ], %g1 for ( index = 1 ; index <= max ; ++index ) { POSIX_Keys_Control *key = (POSIX_Keys_Control *) _POSIX_Keys_Information.local_table [ index ]; if ( key != NULL && key->destructor != NULL ) { void *value = key->Values [ thread_api ][ thread_index ]; 4000f340: 39 00 00 3f sethi %hi(0xfc00), %i4 4000f344: b5 30 60 18 srl %g1, 0x18, %i2 4000f348: b8 17 23 ff or %i4, 0x3ff, %i4 4000f34c: b4 0e a0 07 and %i2, 7, %i2 4000f350: b8 08 40 1c and %g1, %i4, %i4 4000f354: b4 06 a0 04 add %i2, 4, %i2 4000f358: b9 2f 20 02 sll %i4, 2, %i4 * * Reference: 17.1.1.2 P1003.1c/Draft 10, p. 163, line 99. */ while ( !done ) { Objects_Maximum index = 0; Objects_Maximum max = _POSIX_Keys_Information.maximum; 4000f35c: 37 10 00 7e sethi %hi(0x4001f800), %i3 for ( index = 1 ; index <= max ; ++index ) { POSIX_Keys_Control *key = (POSIX_Keys_Control *) _POSIX_Keys_Information.local_table [ index ]; if ( key != NULL && key->destructor != NULL ) { void *value = key->Values [ thread_api ][ thread_index ]; 4000f360: b5 2e a0 02 sll %i2, 2, %i2 * * Reference: 17.1.1.2 P1003.1c/Draft 10, p. 163, line 99. */ while ( !done ) { Objects_Maximum index = 0; Objects_Maximum max = _POSIX_Keys_Information.maximum; 4000f364: 82 16 e0 5c or %i3, 0x5c, %g1 done = true; for ( index = 1 ; index <= max ; ++index ) { 4000f368: ba 10 20 01 mov 1, %i5 */ while ( !done ) { Objects_Maximum index = 0; Objects_Maximum max = _POSIX_Keys_Information.maximum; done = true; 4000f36c: 84 10 20 01 mov 1, %g2 for ( index = 1 ; index <= max ; ++index ) { 4000f370: 10 80 00 18 b 4000f3d0 <_POSIX_Keys_Run_destructors+0x98> 4000f374: f2 10 60 10 lduh [ %g1 + 0x10 ], %i1 POSIX_Keys_Control *key = (POSIX_Keys_Control *) _POSIX_Keys_Information.local_table [ index ]; 4000f378: 86 16 e0 5c or %i3, 0x5c, %g3 Objects_Maximum max = _POSIX_Keys_Information.maximum; done = true; for ( index = 1 ; index <= max ; ++index ) { POSIX_Keys_Control *key = (POSIX_Keys_Control *) 4000f37c: c6 00 e0 1c ld [ %g3 + 0x1c ], %g3 4000f380: 83 28 60 02 sll %g1, 2, %g1 4000f384: c2 00 c0 01 ld [ %g3 + %g1 ], %g1 _POSIX_Keys_Information.local_table [ index ]; if ( key != NULL && key->destructor != NULL ) { 4000f388: 80 a0 60 00 cmp %g1, 0 4000f38c: 22 80 00 11 be,a 4000f3d0 <_POSIX_Keys_Run_destructors+0x98> 4000f390: ba 07 60 01 inc %i5 4000f394: c6 00 60 10 ld [ %g1 + 0x10 ], %g3 4000f398: 80 a0 e0 00 cmp %g3, 0 4000f39c: 02 80 00 0c be 4000f3cc <_POSIX_Keys_Run_destructors+0x94> 4000f3a0: 86 00 40 1a add %g1, %i2, %g3 void *value = key->Values [ thread_api ][ thread_index ]; 4000f3a4: c6 00 e0 04 ld [ %g3 + 4 ], %g3 4000f3a8: d0 00 c0 1c ld [ %g3 + %i4 ], %o0 if ( value != NULL ) { 4000f3ac: 80 a2 20 00 cmp %o0, 0 4000f3b0: 22 80 00 08 be,a 4000f3d0 <_POSIX_Keys_Run_destructors+0x98><== ALWAYS TAKEN 4000f3b4: ba 07 60 01 inc %i5 key->Values [ thread_api ][ thread_index ] = NULL; 4000f3b8: c0 20 c0 1c clr [ %g3 + %i4 ] <== NOT EXECUTED (*key->destructor)( value ); 4000f3bc: c2 00 60 10 ld [ %g1 + 0x10 ], %g1 <== NOT EXECUTED 4000f3c0: 9f c0 40 00 call %g1 <== NOT EXECUTED 4000f3c4: 01 00 00 00 nop <== NOT EXECUTED done = false; 4000f3c8: 84 10 20 00 clr %g2 ! 0 <== NOT EXECUTED Objects_Maximum index = 0; Objects_Maximum max = _POSIX_Keys_Information.maximum; done = true; for ( index = 1 ; index <= max ; ++index ) { 4000f3cc: ba 07 60 01 inc %i5 4000f3d0: 83 2f 60 10 sll %i5, 0x10, %g1 4000f3d4: 83 30 60 10 srl %g1, 0x10, %g1 4000f3d8: 80 a0 40 19 cmp %g1, %i1 4000f3dc: 08 bf ff e7 bleu 4000f378 <_POSIX_Keys_Run_destructors+0x40> 4000f3e0: 80 88 a0 ff btst 0xff, %g2 * number of iterations. An infinite loop may happen if destructors set * thread specific data. This can be considered dubious. * * Reference: 17.1.1.2 P1003.1c/Draft 10, p. 163, line 99. */ while ( !done ) { 4000f3e4: 02 bf ff e1 be 4000f368 <_POSIX_Keys_Run_destructors+0x30><== NEVER TAKEN 4000f3e8: 82 16 e0 5c or %i3, 0x5c, %g1 done = false; } } } } } 4000f3ec: 81 c7 e0 08 ret 4000f3f0: 81 e8 00 00 restore =============================================================================== 4000ce74 <_POSIX_Message_queue_Receive_support>: size_t msg_len, unsigned int *msg_prio, bool wait, Watchdog_Interval timeout ) { 4000ce74: 9d e3 bf 98 save %sp, -104, %sp RTEMS_INLINE_ROUTINE POSIX_Message_queue_Control_fd *_POSIX_Message_queue_Get_fd ( mqd_t id, Objects_Locations *location ) { return (POSIX_Message_queue_Control_fd *) _Objects_Get( 4000ce78: 11 10 00 a5 sethi %hi(0x40029400), %o0 4000ce7c: 92 10 00 18 mov %i0, %o1 4000ce80: 90 12 20 30 or %o0, 0x30, %o0 4000ce84: 40 00 0c c3 call 40010190 <_Objects_Get> 4000ce88: 94 07 bf f8 add %fp, -8, %o2 Objects_Locations location; size_t length_out; bool do_wait; the_mq_fd = _POSIX_Message_queue_Get_fd( mqdes, &location ); switch ( location ) { 4000ce8c: c2 07 bf f8 ld [ %fp + -8 ], %g1 4000ce90: 80 a0 60 00 cmp %g1, 0 4000ce94: 12 80 00 40 bne 4000cf94 <_POSIX_Message_queue_Receive_support+0x120> 4000ce98: 01 00 00 00 nop case OBJECTS_LOCAL: if ( (the_mq_fd->oflag & O_ACCMODE) == O_WRONLY ) { 4000ce9c: c2 02 20 14 ld [ %o0 + 0x14 ], %g1 4000cea0: 84 08 60 03 and %g1, 3, %g2 4000cea4: 80 a0 a0 01 cmp %g2, 1 4000cea8: 32 80 00 05 bne,a 4000cebc <_POSIX_Message_queue_Receive_support+0x48> 4000ceac: d0 02 20 10 ld [ %o0 + 0x10 ], %o0 _Thread_Enable_dispatch(); 4000ceb0: 40 00 10 5f call 4001102c <_Thread_Enable_dispatch> 4000ceb4: 01 00 00 00 nop 4000ceb8: 30 80 00 37 b,a 4000cf94 <_POSIX_Message_queue_Receive_support+0x120> rtems_set_errno_and_return_minus_one( EBADF ); } the_mq = the_mq_fd->Queue; if ( msg_len < the_mq->Message_queue.maximum_message_size ) { 4000cebc: c4 02 20 68 ld [ %o0 + 0x68 ], %g2 4000cec0: 80 a6 80 02 cmp %i2, %g2 4000cec4: 1a 80 00 08 bcc 4000cee4 <_POSIX_Message_queue_Receive_support+0x70> 4000cec8: 84 10 3f ff mov -1, %g2 _Thread_Enable_dispatch(); 4000cecc: 40 00 10 58 call 4001102c <_Thread_Enable_dispatch> 4000ced0: 01 00 00 00 nop rtems_set_errno_and_return_minus_one( EMSGSIZE ); 4000ced4: 40 00 26 b4 call 400169a4 <__errno> 4000ced8: 01 00 00 00 nop 4000cedc: 10 80 00 31 b 4000cfa0 <_POSIX_Message_queue_Receive_support+0x12c> 4000cee0: 82 10 20 7a mov 0x7a, %g1 ! 7a /* * Now if something goes wrong, we return a "length" of -1 * to indicate an error. */ length_out = -1; 4000cee4: c4 27 bf fc st %g2, [ %fp + -4 ] /* * A timed receive with a bad time will do a poll regardless. */ if ( wait ) 4000cee8: 80 a7 20 00 cmp %i4, 0 4000ceec: 02 80 00 05 be 4000cf00 <_POSIX_Message_queue_Receive_support+0x8c> 4000cef0: 98 10 20 00 clr %o4 do_wait = (the_mq_fd->oflag & O_NONBLOCK) ? false : true; 4000cef4: 99 30 60 0e srl %g1, 0xe, %o4 4000cef8: 98 1b 20 01 xor %o4, 1, %o4 4000cefc: 98 0b 20 01 and %o4, 1, %o4 do_wait = wait; /* * Now perform the actual message receive */ _CORE_message_queue_Seize( 4000cf00: 90 02 20 1c add %o0, 0x1c, %o0 4000cf04: 92 10 00 18 mov %i0, %o1 4000cf08: 94 10 00 19 mov %i1, %o2 4000cf0c: 96 07 bf fc add %fp, -4, %o3 4000cf10: 98 0b 20 01 and %o4, 1, %o4 4000cf14: 40 00 08 6c call 4000f0c4 <_CORE_message_queue_Seize> 4000cf18: 9a 10 00 1d mov %i5, %o5 &length_out, do_wait, timeout ); _Thread_Enable_dispatch(); 4000cf1c: 40 00 10 44 call 4001102c <_Thread_Enable_dispatch> 4000cf20: 01 00 00 00 nop if (msg_prio) { 4000cf24: 80 a6 e0 00 cmp %i3, 0 4000cf28: 02 80 00 08 be 4000cf48 <_POSIX_Message_queue_Receive_support+0xd4><== NEVER TAKEN 4000cf2c: 03 10 00 a5 sethi %hi(0x40029400), %g1 *msg_prio = _POSIX_Message_queue_Priority_from_core( _Thread_Executing->Wait.count 4000cf30: c2 00 60 c0 ld [ %g1 + 0xc0 ], %g1 ! 400294c0 <_Per_CPU_Information+0x10> RTEMS_INLINE_ROUTINE unsigned int _POSIX_Message_queue_Priority_from_core( CORE_message_queue_Submit_types priority ) { /* absolute value without a library dependency */ return (unsigned int) ((priority >= 0) ? priority : -priority); 4000cf34: c4 00 60 24 ld [ %g1 + 0x24 ], %g2 4000cf38: 83 38 a0 1f sra %g2, 0x1f, %g1 4000cf3c: 84 18 40 02 xor %g1, %g2, %g2 4000cf40: 82 20 80 01 sub %g2, %g1, %g1 timeout ); _Thread_Enable_dispatch(); if (msg_prio) { *msg_prio = _POSIX_Message_queue_Priority_from_core( 4000cf44: c2 26 c0 00 st %g1, [ %i3 ] _Thread_Executing->Wait.count ); } if ( !_Thread_Executing->Wait.return_code ) 4000cf48: 3b 10 00 a5 sethi %hi(0x40029400), %i5 4000cf4c: ba 17 60 b0 or %i5, 0xb0, %i5 ! 400294b0 <_Per_CPU_Information> 4000cf50: c2 07 60 10 ld [ %i5 + 0x10 ], %g1 4000cf54: c2 00 60 34 ld [ %g1 + 0x34 ], %g1 4000cf58: 80 a0 60 00 cmp %g1, 0 4000cf5c: 12 80 00 05 bne 4000cf70 <_POSIX_Message_queue_Receive_support+0xfc> 4000cf60: 01 00 00 00 nop return length_out; 4000cf64: f0 07 bf fc ld [ %fp + -4 ], %i0 4000cf68: 81 c7 e0 08 ret 4000cf6c: 81 e8 00 00 restore rtems_set_errno_and_return_minus_one( 4000cf70: 40 00 26 8d call 400169a4 <__errno> 4000cf74: b0 10 3f ff mov -1, %i0 4000cf78: c2 07 60 10 ld [ %i5 + 0x10 ], %g1 4000cf7c: b8 10 00 08 mov %o0, %i4 4000cf80: 40 00 00 96 call 4000d1d8 <_POSIX_Message_queue_Translate_core_message_queue_return_code> 4000cf84: d0 00 60 34 ld [ %g1 + 0x34 ], %o0 4000cf88: d0 27 00 00 st %o0, [ %i4 ] 4000cf8c: 81 c7 e0 08 ret 4000cf90: 81 e8 00 00 restore #endif case OBJECTS_ERROR: break; } rtems_set_errno_and_return_minus_one( EBADF ); 4000cf94: 40 00 26 84 call 400169a4 <__errno> 4000cf98: 01 00 00 00 nop 4000cf9c: 82 10 20 09 mov 9, %g1 ! 9 4000cfa0: c2 22 00 00 st %g1, [ %o0 ] 4000cfa4: b0 10 3f ff mov -1, %i0 } 4000cfa8: 81 c7 e0 08 ret 4000cfac: 81 e8 00 00 restore =============================================================================== 4000f3d8 <_POSIX_Semaphore_Create_support>: size_t name_len, int pshared, unsigned int value, POSIX_Semaphore_Control **the_sem ) { 4000f3d8: 9d e3 bf a0 save %sp, -96, %sp POSIX_Semaphore_Control *the_semaphore; CORE_semaphore_Attributes *the_sem_attr; char *name; /* Sharing semaphores among processes is not currently supported */ if (pshared != 0) 4000f3dc: 80 a6 a0 00 cmp %i2, 0 4000f3e0: 22 80 00 06 be,a 4000f3f8 <_POSIX_Semaphore_Create_support+0x20> 4000f3e4: 03 10 00 8f sethi %hi(0x40023c00), %g1 rtems_set_errno_and_return_minus_one( ENOSYS ); 4000f3e8: 40 00 09 88 call 40011a08 <__errno> 4000f3ec: 01 00 00 00 nop 4000f3f0: 10 80 00 10 b 4000f430 <_POSIX_Semaphore_Create_support+0x58> 4000f3f4: 82 10 20 58 mov 0x58, %g1 ! 58 * * This rountine increments the thread dispatch level */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_increment_disable_level(void) { uint32_t level = _Thread_Dispatch_disable_level; 4000f3f8: c4 00 62 80 ld [ %g1 + 0x280 ], %g2 ++level; 4000f3fc: 84 00 a0 01 inc %g2 _Thread_Dispatch_disable_level = level; 4000f400: c4 20 62 80 st %g2, [ %g1 + 0x280 ] * _POSIX_Semaphore_Allocate */ RTEMS_INLINE_ROUTINE POSIX_Semaphore_Control *_POSIX_Semaphore_Allocate( void ) { return (POSIX_Semaphore_Control *) 4000f404: 21 10 00 90 sethi %hi(0x40024000), %l0 4000f408: 7f ff ef 4a call 4000b130 <_Objects_Allocate> 4000f40c: 90 14 21 44 or %l0, 0x144, %o0 ! 40024144 <_POSIX_Semaphore_Information> _Thread_Disable_dispatch(); the_semaphore = _POSIX_Semaphore_Allocate(); if ( !the_semaphore ) { 4000f410: ba 92 20 00 orcc %o0, 0, %i5 4000f414: 12 80 00 0a bne 4000f43c <_POSIX_Semaphore_Create_support+0x64> 4000f418: 80 a6 20 00 cmp %i0, 0 _Thread_Enable_dispatch(); 4000f41c: 7f ff f4 45 call 4000c530 <_Thread_Enable_dispatch> 4000f420: 01 00 00 00 nop rtems_set_errno_and_return_minus_one( ENOSPC ); 4000f424: 40 00 09 79 call 40011a08 <__errno> 4000f428: 01 00 00 00 nop 4000f42c: 82 10 20 1c mov 0x1c, %g1 ! 1c 4000f430: c2 22 00 00 st %g1, [ %o0 ] 4000f434: 81 c7 e0 08 ret 4000f438: 91 e8 3f ff restore %g0, -1, %o0 /* * Make a copy of the user's string for name just in case it was * dynamically constructed. */ if ( name_arg != NULL ) { 4000f43c: 02 80 00 10 be 4000f47c <_POSIX_Semaphore_Create_support+0xa4> 4000f440: 90 10 00 18 mov %i0, %o0 name = _Workspace_String_duplicate( name_arg, name_len ); 4000f444: 40 00 03 ca call 4001036c <_Workspace_String_duplicate> 4000f448: 92 10 00 19 mov %i1, %o1 if ( !name ) { 4000f44c: b4 92 20 00 orcc %o0, 0, %i2 4000f450: 12 80 00 0d bne 4000f484 <_POSIX_Semaphore_Create_support+0xac><== ALWAYS TAKEN 4000f454: 80 a6 a0 00 cmp %i2, 0 RTEMS_INLINE_ROUTINE void _POSIX_Semaphore_Free ( POSIX_Semaphore_Control *the_semaphore ) { _Objects_Free( &_POSIX_Semaphore_Information, &the_semaphore->Object ); 4000f458: 90 14 21 44 or %l0, 0x144, %o0 <== NOT EXECUTED 4000f45c: 7f ff f0 14 call 4000b4ac <_Objects_Free> <== NOT EXECUTED 4000f460: 92 10 00 1d mov %i5, %o1 <== NOT EXECUTED _POSIX_Semaphore_Free( the_semaphore ); _Thread_Enable_dispatch(); 4000f464: 7f ff f4 33 call 4000c530 <_Thread_Enable_dispatch> <== NOT EXECUTED 4000f468: 01 00 00 00 nop <== NOT EXECUTED rtems_set_errno_and_return_minus_one( ENOMEM ); 4000f46c: 40 00 09 67 call 40011a08 <__errno> <== NOT EXECUTED 4000f470: 01 00 00 00 nop <== NOT EXECUTED 4000f474: 10 bf ff ef b 4000f430 <_POSIX_Semaphore_Create_support+0x58><== NOT EXECUTED 4000f478: 82 10 20 0c mov 0xc, %g1 ! c <== NOT EXECUTED } } else { name = NULL; 4000f47c: b4 10 20 00 clr %i2 } the_semaphore->process_shared = pshared; if ( name ) { 4000f480: 80 a6 a0 00 cmp %i2, 0 4000f484: 02 80 00 08 be 4000f4a4 <_POSIX_Semaphore_Create_support+0xcc> 4000f488: c0 27 60 10 clr [ %i5 + 0x10 ] the_semaphore->named = true; 4000f48c: 82 10 20 01 mov 1, %g1 4000f490: c2 2f 60 14 stb %g1, [ %i5 + 0x14 ] the_semaphore->open_count = 1; 4000f494: 82 10 20 01 mov 1, %g1 4000f498: c2 27 60 18 st %g1, [ %i5 + 0x18 ] the_semaphore->linked = true; 4000f49c: 10 80 00 05 b 4000f4b0 <_POSIX_Semaphore_Create_support+0xd8> 4000f4a0: c2 2f 60 15 stb %g1, [ %i5 + 0x15 ] } else { the_semaphore->named = false; 4000f4a4: c0 2f 60 14 clrb [ %i5 + 0x14 ] the_semaphore->open_count = 0; 4000f4a8: c0 27 60 18 clr [ %i5 + 0x18 ] the_semaphore->linked = false; 4000f4ac: c0 2f 60 15 clrb [ %i5 + 0x15 ] the_sem_attr->discipline = CORE_SEMAPHORE_DISCIPLINES_FIFO; /* * This effectively disables limit checking. */ the_sem_attr->maximum_count = 0xFFFFFFFF; 4000f4b0: 82 10 3f ff mov -1, %g1 _CORE_semaphore_Initialize( &the_semaphore->Semaphore, the_sem_attr, value ); 4000f4b4: 90 07 60 1c add %i5, 0x1c, %o0 the_sem_attr->discipline = CORE_SEMAPHORE_DISCIPLINES_FIFO; /* * This effectively disables limit checking. */ the_sem_attr->maximum_count = 0xFFFFFFFF; 4000f4b8: c2 27 60 5c st %g1, [ %i5 + 0x5c ] _CORE_semaphore_Initialize( &the_semaphore->Semaphore, the_sem_attr, value ); 4000f4bc: 92 07 60 5c add %i5, 0x5c, %o1 4000f4c0: 94 10 00 1b mov %i3, %o2 4000f4c4: 7f ff ed 90 call 4000ab04 <_CORE_semaphore_Initialize> 4000f4c8: c0 27 60 60 clr [ %i5 + 0x60 ] Objects_Information *information, Objects_Control *the_object, const char *name ) { _Objects_Set_local_object( 4000f4cc: c2 17 60 0a lduh [ %i5 + 0xa ], %g1 #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 4000f4d0: 05 10 00 90 sethi %hi(0x40024000), %g2 4000f4d4: c4 00 a1 60 ld [ %g2 + 0x160 ], %g2 ! 40024160 <_POSIX_Semaphore_Information+0x1c> 4000f4d8: 83 28 60 02 sll %g1, 2, %g1 4000f4dc: fa 20 80 01 st %i5, [ %g2 + %g1 ] the_object ); #if defined(RTEMS_SCORE_OBJECT_ENABLE_STRING_NAMES) /* ASSERT: information->is_string */ the_object->name.name_p = name; 4000f4e0: f4 27 60 0c st %i2, [ %i5 + 0xc ] &_POSIX_Semaphore_Information, &the_semaphore->Object, name ); *the_sem = the_semaphore; 4000f4e4: fa 27 00 00 st %i5, [ %i4 ] _Thread_Enable_dispatch(); 4000f4e8: 7f ff f4 12 call 4000c530 <_Thread_Enable_dispatch> 4000f4ec: b0 10 20 00 clr %i0 return 0; } 4000f4f0: 81 c7 e0 08 ret 4000f4f4: 81 e8 00 00 restore =============================================================================== 4000cae0 <_POSIX_Thread_Evaluate_cancellation_and_enable_dispatch>: Thread_Control *the_thread ) { POSIX_API_Control *thread_support; thread_support = the_thread->API_Extensions[ THREAD_API_POSIX ]; 4000cae0: c2 02 21 50 ld [ %o0 + 0x150 ], %g1 if ( thread_support->cancelability_state == PTHREAD_CANCEL_ENABLE && 4000cae4: c4 00 60 d8 ld [ %g1 + 0xd8 ], %g2 4000cae8: 80 a0 a0 00 cmp %g2, 0 4000caec: 12 80 00 12 bne 4000cb34 <_POSIX_Thread_Evaluate_cancellation_and_enable_dispatch+0x54><== NEVER TAKEN 4000caf0: 01 00 00 00 nop 4000caf4: c4 00 60 dc ld [ %g1 + 0xdc ], %g2 4000caf8: 80 a0 a0 01 cmp %g2, 1 4000cafc: 12 80 00 0e bne 4000cb34 <_POSIX_Thread_Evaluate_cancellation_and_enable_dispatch+0x54> 4000cb00: 01 00 00 00 nop thread_support->cancelability_type == PTHREAD_CANCEL_ASYNCHRONOUS && 4000cb04: c2 00 60 e0 ld [ %g1 + 0xe0 ], %g1 4000cb08: 80 a0 60 00 cmp %g1, 0 4000cb0c: 02 80 00 0a be 4000cb34 <_POSIX_Thread_Evaluate_cancellation_and_enable_dispatch+0x54> 4000cb10: 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; 4000cb14: 03 10 00 60 sethi %hi(0x40018000), %g1 4000cb18: c4 00 62 50 ld [ %g1 + 0x250 ], %g2 ! 40018250 <_Thread_Dispatch_disable_level> thread_support->cancelation_requested ) { _Thread_Unnest_dispatch(); _POSIX_Thread_Exit( the_thread, PTHREAD_CANCELED ); 4000cb1c: 92 10 3f ff mov -1, %o1 --level; 4000cb20: 84 00 bf ff add %g2, -1, %g2 _Thread_Dispatch_disable_level = level; 4000cb24: c4 20 62 50 st %g2, [ %g1 + 0x250 ] 4000cb28: 82 13 c0 00 mov %o7, %g1 4000cb2c: 40 00 01 b5 call 4000d200 <_POSIX_Thread_Exit> 4000cb30: 9e 10 40 00 mov %g1, %o7 } else _Thread_Enable_dispatch(); 4000cb34: 82 13 c0 00 mov %o7, %g1 4000cb38: 7f ff f6 b3 call 4000a604 <_Thread_Enable_dispatch> 4000cb3c: 9e 10 40 00 mov %g1, %o7 =============================================================================== 4000de90 <_POSIX_Thread_Translate_sched_param>: int policy, struct sched_param *param, Thread_CPU_budget_algorithms *budget_algorithm, Thread_CPU_budget_algorithm_callout *budget_callout ) { 4000de90: 9d e3 bf a0 save %sp, -96, %sp if ( !_POSIX_Priority_Is_valid( param->sched_priority ) ) 4000de94: 7f ff ff f4 call 4000de64 <_POSIX_Priority_Is_valid> 4000de98: d0 06 40 00 ld [ %i1 ], %o0 4000de9c: 80 8a 20 ff btst 0xff, %o0 4000dea0: 32 80 00 04 bne,a 4000deb0 <_POSIX_Thread_Translate_sched_param+0x20><== ALWAYS TAKEN 4000dea4: c0 26 80 00 clr [ %i2 ] return EINVAL; 4000dea8: 81 c7 e0 08 ret 4000deac: 91 e8 20 16 restore %g0, 0x16, %o0 *budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_NONE; *budget_callout = NULL; if ( policy == SCHED_OTHER ) { 4000deb0: 80 a6 20 00 cmp %i0, 0 4000deb4: 12 80 00 06 bne 4000decc <_POSIX_Thread_Translate_sched_param+0x3c> 4000deb8: c0 26 c0 00 clr [ %i3 ] *budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE; 4000debc: 82 10 20 01 mov 1, %g1 4000dec0: c2 26 80 00 st %g1, [ %i2 ] return 0; 4000dec4: 81 c7 e0 08 ret 4000dec8: 81 e8 00 00 restore } if ( policy == SCHED_FIFO ) { 4000decc: 80 a6 20 01 cmp %i0, 1 4000ded0: 02 80 00 29 be 4000df74 <_POSIX_Thread_Translate_sched_param+0xe4> 4000ded4: 80 a6 20 02 cmp %i0, 2 *budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_NONE; return 0; } if ( policy == SCHED_RR ) { 4000ded8: 12 80 00 04 bne 4000dee8 <_POSIX_Thread_Translate_sched_param+0x58> 4000dedc: 80 a6 20 04 cmp %i0, 4 *budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_EXHAUST_TIMESLICE; 4000dee0: 10 80 00 25 b 4000df74 <_POSIX_Thread_Translate_sched_param+0xe4> 4000dee4: f0 26 80 00 st %i0, [ %i2 ] return 0; } if ( policy == SCHED_SPORADIC ) { 4000dee8: 12 bf ff f0 bne 4000dea8 <_POSIX_Thread_Translate_sched_param+0x18> 4000deec: 01 00 00 00 nop if ( (param->sched_ss_repl_period.tv_sec == 0) && 4000def0: c2 06 60 08 ld [ %i1 + 8 ], %g1 4000def4: 80 a0 60 00 cmp %g1, 0 4000def8: 32 80 00 07 bne,a 4000df14 <_POSIX_Thread_Translate_sched_param+0x84> 4000defc: c2 06 60 10 ld [ %i1 + 0x10 ], %g1 4000df00: c2 06 60 0c ld [ %i1 + 0xc ], %g1 4000df04: 80 a0 60 00 cmp %g1, 0 4000df08: 02 bf ff e8 be 4000dea8 <_POSIX_Thread_Translate_sched_param+0x18> 4000df0c: 01 00 00 00 nop (param->sched_ss_repl_period.tv_nsec == 0) ) return EINVAL; if ( (param->sched_ss_init_budget.tv_sec == 0) && 4000df10: c2 06 60 10 ld [ %i1 + 0x10 ], %g1 4000df14: 80 a0 60 00 cmp %g1, 0 4000df18: 12 80 00 06 bne 4000df30 <_POSIX_Thread_Translate_sched_param+0xa0> 4000df1c: 01 00 00 00 nop 4000df20: c2 06 60 14 ld [ %i1 + 0x14 ], %g1 4000df24: 80 a0 60 00 cmp %g1, 0 4000df28: 02 bf ff e0 be 4000dea8 <_POSIX_Thread_Translate_sched_param+0x18> 4000df2c: 01 00 00 00 nop (param->sched_ss_init_budget.tv_nsec == 0) ) return EINVAL; if ( _Timespec_To_ticks( ¶m->sched_ss_repl_period ) < 4000df30: 7f ff f7 b4 call 4000be00 <_Timespec_To_ticks> 4000df34: 90 06 60 08 add %i1, 8, %o0 4000df38: ba 10 00 08 mov %o0, %i5 _Timespec_To_ticks( ¶m->sched_ss_init_budget ) ) 4000df3c: 7f ff f7 b1 call 4000be00 <_Timespec_To_ticks> 4000df40: 90 06 60 10 add %i1, 0x10, %o0 if ( (param->sched_ss_init_budget.tv_sec == 0) && (param->sched_ss_init_budget.tv_nsec == 0) ) return EINVAL; if ( _Timespec_To_ticks( ¶m->sched_ss_repl_period ) < 4000df44: 80 a7 40 08 cmp %i5, %o0 4000df48: 0a bf ff d8 bcs 4000dea8 <_POSIX_Thread_Translate_sched_param+0x18> 4000df4c: 01 00 00 00 nop _Timespec_To_ticks( ¶m->sched_ss_init_budget ) ) return EINVAL; if ( !_POSIX_Priority_Is_valid( param->sched_ss_low_priority ) ) 4000df50: 7f ff ff c5 call 4000de64 <_POSIX_Priority_Is_valid> 4000df54: d0 06 60 04 ld [ %i1 + 4 ], %o0 4000df58: 80 8a 20 ff btst 0xff, %o0 4000df5c: 02 bf ff d3 be 4000dea8 <_POSIX_Thread_Translate_sched_param+0x18> 4000df60: 82 10 20 03 mov 3, %g1 return EINVAL; *budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_CALLOUT; 4000df64: c2 26 80 00 st %g1, [ %i2 ] *budget_callout = _POSIX_Threads_Sporadic_budget_callout; 4000df68: 03 10 00 20 sethi %hi(0x40008000), %g1 4000df6c: 82 10 62 18 or %g1, 0x218, %g1 ! 40008218 <_POSIX_Threads_Sporadic_budget_callout> 4000df70: c2 26 c0 00 st %g1, [ %i3 ] return 0; } return EINVAL; } 4000df74: 81 c7 e0 08 ret 4000df78: 91 e8 20 00 restore %g0, 0, %o0 =============================================================================== 4000d228 <_POSIX_Threads_Delete_extension>: */ static void _POSIX_Threads_Delete_extension( Thread_Control *executing __attribute__((unused)), Thread_Control *deleted ) { 4000d228: 9d e3 bf a0 save %sp, -96, %sp Thread_Control *the_thread; POSIX_API_Control *api; void **value_ptr; api = deleted->API_Extensions[ THREAD_API_POSIX ]; 4000d22c: f0 06 61 50 ld [ %i1 + 0x150 ], %i0 /* * Run the POSIX cancellation handlers */ _POSIX_Threads_cancel_run( deleted ); 4000d230: 40 00 08 28 call 4000f2d0 <_POSIX_Threads_cancel_run> 4000d234: 90 10 00 19 mov %i1, %o0 /* * Run all the key destructors */ _POSIX_Keys_Run_destructors( deleted ); 4000d238: 90 10 00 19 mov %i1, %o0 4000d23c: 40 00 08 3f call 4000f338 <_POSIX_Keys_Run_destructors> 4000d240: ba 06 20 44 add %i0, 0x44, %i5 /* * Wakeup all the tasks which joined with this one */ value_ptr = (void **) deleted->Wait.return_argument; while ( (the_thread = _Thread_queue_Dequeue( &api->Join_List )) ) 4000d244: 10 80 00 03 b 4000d250 <_POSIX_Threads_Delete_extension+0x28> 4000d248: f8 06 60 28 ld [ %i1 + 0x28 ], %i4 *(void **)the_thread->Wait.return_argument = value_ptr; 4000d24c: f8 20 40 00 st %i4, [ %g1 ] <== NOT EXECUTED /* * Wakeup all the tasks which joined with this one */ value_ptr = (void **) deleted->Wait.return_argument; while ( (the_thread = _Thread_queue_Dequeue( &api->Join_List )) ) 4000d250: 7f ff f6 6a call 4000abf8 <_Thread_queue_Dequeue> 4000d254: 90 10 00 1d mov %i5, %o0 4000d258: 80 a2 20 00 cmp %o0, 0 4000d25c: 32 bf ff fc bne,a 4000d24c <_POSIX_Threads_Delete_extension+0x24><== NEVER TAKEN 4000d260: c2 02 20 28 ld [ %o0 + 0x28 ], %g1 <== NOT EXECUTED *(void **)the_thread->Wait.return_argument = value_ptr; if ( api->schedpolicy == SCHED_SPORADIC ) 4000d264: c2 06 20 84 ld [ %i0 + 0x84 ], %g1 4000d268: 80 a0 60 04 cmp %g1, 4 4000d26c: 32 80 00 05 bne,a 4000d280 <_POSIX_Threads_Delete_extension+0x58> 4000d270: c0 26 61 50 clr [ %i1 + 0x150 ] (void) _Watchdog_Remove( &api->Sporadic_timer ); 4000d274: 7f ff f8 f0 call 4000b634 <_Watchdog_Remove> 4000d278: 90 06 20 a8 add %i0, 0xa8, %o0 deleted->API_Extensions[ THREAD_API_POSIX ] = NULL; 4000d27c: c0 26 61 50 clr [ %i1 + 0x150 ] _Workspace_Free( api ); 4000d280: 7f ff f9 8e call 4000b8b8 <_Workspace_Free> 4000d284: 81 e8 00 00 restore =============================================================================== 40007f74 <_POSIX_Threads_Initialize_user_threads_body>: #include #include #include void _POSIX_Threads_Initialize_user_threads_body(void) { 40007f74: 9d e3 bf 58 save %sp, -168, %sp uint32_t maximum; posix_initialization_threads_table *user_threads; pthread_t thread_id; pthread_attr_t attr; user_threads = Configuration_POSIX_API.User_initialization_threads_table; 40007f78: 03 10 00 7c sethi %hi(0x4001f000), %g1 40007f7c: 82 10 61 34 or %g1, 0x134, %g1 ! 4001f134 maximum = Configuration_POSIX_API.number_of_initialization_threads; 40007f80: f6 00 60 30 ld [ %g1 + 0x30 ], %i3 if ( !user_threads || maximum == 0 ) 40007f84: 80 a6 e0 00 cmp %i3, 0 40007f88: 02 80 00 1d be 40007ffc <_POSIX_Threads_Initialize_user_threads_body+0x88><== NEVER TAKEN 40007f8c: fa 00 60 34 ld [ %g1 + 0x34 ], %i5 40007f90: 80 a7 60 00 cmp %i5, 0 40007f94: 02 80 00 1a be 40007ffc <_POSIX_Threads_Initialize_user_threads_body+0x88><== NEVER TAKEN 40007f98: b8 10 20 00 clr %i4 for ( index=0 ; index < maximum ; index++ ) { /* * There is no way for these calls to fail in this situation. */ (void) pthread_attr_init( &attr ); 40007f9c: 40 00 17 f8 call 4000df7c 40007fa0: 90 07 bf c0 add %fp, -64, %o0 (void) pthread_attr_setinheritsched( &attr, PTHREAD_EXPLICIT_SCHED ); 40007fa4: 92 10 20 02 mov 2, %o1 40007fa8: 40 00 18 01 call 4000dfac 40007fac: 90 07 bf c0 add %fp, -64, %o0 (void) pthread_attr_setstacksize(&attr, user_threads[ index ].stack_size); 40007fb0: d2 07 60 04 ld [ %i5 + 4 ], %o1 40007fb4: 40 00 18 0d call 4000dfe8 40007fb8: 90 07 bf c0 add %fp, -64, %o0 status = pthread_create( 40007fbc: d4 07 40 00 ld [ %i5 ], %o2 40007fc0: 90 07 bf bc add %fp, -68, %o0 40007fc4: 92 07 bf c0 add %fp, -64, %o1 40007fc8: 96 10 20 00 clr %o3 40007fcc: 7f ff ff 18 call 40007c2c 40007fd0: ba 07 60 08 add %i5, 8, %i5 &thread_id, &attr, user_threads[ index ].thread_entry, NULL ); if ( status ) 40007fd4: 80 a2 20 00 cmp %o0, 0 40007fd8: 02 80 00 05 be 40007fec <_POSIX_Threads_Initialize_user_threads_body+0x78> 40007fdc: 94 10 00 08 mov %o0, %o2 _Internal_error_Occurred( INTERNAL_ERROR_POSIX_API, true, status ); 40007fe0: 90 10 20 02 mov 2, %o0 40007fe4: 40 00 07 f8 call 40009fc4 <_Internal_error_Occurred> 40007fe8: 92 10 20 01 mov 1, %o1 * * Setting the attributes explicitly is critical, since we don't want * to inherit the idle tasks attributes. */ for ( index=0 ; index < maximum ; index++ ) { 40007fec: b8 07 20 01 inc %i4 40007ff0: 80 a7 00 1b cmp %i4, %i3 40007ff4: 12 bf ff ea bne 40007f9c <_POSIX_Threads_Initialize_user_threads_body+0x28><== NEVER TAKEN 40007ff8: 01 00 00 00 nop 40007ffc: 81 c7 e0 08 ret 40008000: 81 e8 00 00 restore =============================================================================== 4000d37c <_POSIX_Threads_Sporadic_budget_TSR>: */ void _POSIX_Threads_Sporadic_budget_TSR( Objects_Id id __attribute__((unused)), void *argument ) { 4000d37c: 9d e3 bf a0 save %sp, -96, %sp Thread_Control *the_thread; POSIX_API_Control *api; the_thread = argument; api = the_thread->API_Extensions[ THREAD_API_POSIX ]; 4000d380: fa 06 61 50 ld [ %i1 + 0x150 ], %i5 /* ticks is guaranteed to be at least one */ ticks = _Timespec_To_ticks( &api->schedparam.sched_ss_init_budget ); 4000d384: 40 00 03 82 call 4000e18c <_Timespec_To_ticks> 4000d388: 90 07 60 98 add %i5, 0x98, %o0 RTEMS_INLINE_ROUTINE Priority_Control _POSIX_Priority_To_core( int priority ) { return (Priority_Control) (POSIX_SCHEDULER_MAXIMUM_PRIORITY - priority + 1); 4000d38c: 03 10 00 79 sethi %hi(0x4001e400), %g1 4000d390: d2 08 62 ac ldub [ %g1 + 0x2ac ], %o1 ! 4001e6ac 4000d394: c2 07 60 88 ld [ %i5 + 0x88 ], %g1 the_thread->cpu_time_budget = ticks; 4000d398: d0 26 60 74 st %o0, [ %i1 + 0x74 ] 4000d39c: 92 22 40 01 sub %o1, %g1, %o1 */ #if 0 printk( "TSR %d %d %d\n", the_thread->resource_count, the_thread->current_priority, new_priority ); #endif if ( the_thread->resource_count == 0 ) { 4000d3a0: c2 06 60 1c ld [ %i1 + 0x1c ], %g1 4000d3a4: 80 a0 60 00 cmp %g1, 0 4000d3a8: 12 80 00 09 bne 4000d3cc <_POSIX_Threads_Sporadic_budget_TSR+0x50><== NEVER TAKEN 4000d3ac: d2 26 60 18 st %o1, [ %i1 + 0x18 ] /* * If this would make them less important, then do not change it. */ if ( the_thread->current_priority > new_priority ) { 4000d3b0: c2 06 60 14 ld [ %i1 + 0x14 ], %g1 4000d3b4: 80 a0 40 09 cmp %g1, %o1 4000d3b8: 08 80 00 06 bleu 4000d3d0 <_POSIX_Threads_Sporadic_budget_TSR+0x54> 4000d3bc: 90 07 60 90 add %i5, 0x90, %o0 _Thread_Change_priority( the_thread, new_priority, true ); 4000d3c0: 90 10 00 19 mov %i1, %o0 4000d3c4: 7f ff f4 1b call 4000a430 <_Thread_Change_priority> 4000d3c8: 94 10 20 01 mov 1, %o2 #endif } } /* ticks is guaranteed to be at least one */ ticks = _Timespec_To_ticks( &api->schedparam.sched_ss_repl_period ); 4000d3cc: 90 07 60 90 add %i5, 0x90, %o0 4000d3d0: 40 00 03 6f call 4000e18c <_Timespec_To_ticks> 4000d3d4: 31 10 00 7d sethi %hi(0x4001f400), %i0 ) { the_watchdog->initial = units; _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 4000d3d8: b0 16 21 18 or %i0, 0x118, %i0 ! 4001f518 <_Watchdog_Ticks_chain> Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 4000d3dc: d0 27 60 b4 st %o0, [ %i5 + 0xb4 ] _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 4000d3e0: 7f ff f8 3d call 4000b4d4 <_Watchdog_Insert> 4000d3e4: 93 ef 60 a8 restore %i5, 0xa8, %o1 =============================================================================== 4000d3e8 <_POSIX_Threads_Sporadic_budget_callout>: ) { POSIX_API_Control *api; uint32_t new_priority; api = the_thread->API_Extensions[ THREAD_API_POSIX ]; 4000d3e8: c4 02 21 50 ld [ %o0 + 0x150 ], %g2 /* * This will prevent the thread from consuming its entire "budget" * while at low priority. */ the_thread->cpu_time_budget = 0xFFFFFFFF; /* XXX should be based on MAX_U32 */ 4000d3ec: 86 10 3f ff mov -1, %g3 4000d3f0: c4 00 a0 8c ld [ %g2 + 0x8c ], %g2 4000d3f4: c6 22 20 74 st %g3, [ %o0 + 0x74 ] 4000d3f8: 07 10 00 79 sethi %hi(0x4001e400), %g3 4000d3fc: d2 08 e2 ac ldub [ %g3 + 0x2ac ], %o1 ! 4001e6ac 4000d400: 92 22 40 02 sub %o1, %g2, %o1 */ #if 0 printk( "callout %d %d %d\n", the_thread->resource_count, the_thread->current_priority, new_priority ); #endif if ( the_thread->resource_count == 0 ) { 4000d404: c4 02 20 1c ld [ %o0 + 0x1c ], %g2 4000d408: 80 a0 a0 00 cmp %g2, 0 4000d40c: 12 80 00 09 bne 4000d430 <_POSIX_Threads_Sporadic_budget_callout+0x48><== NEVER TAKEN 4000d410: d2 22 20 18 st %o1, [ %o0 + 0x18 ] /* * Make sure we are actually lowering it. If they have lowered it * to logically lower than sched_ss_low_priority, then we do not want to * change it. */ if ( the_thread->current_priority < new_priority ) { 4000d414: c2 02 20 14 ld [ %o0 + 0x14 ], %g1 4000d418: 80 a0 40 09 cmp %g1, %o1 4000d41c: 1a 80 00 05 bcc 4000d430 <_POSIX_Threads_Sporadic_budget_callout+0x48><== NEVER TAKEN 4000d420: 94 10 20 01 mov 1, %o2 _Thread_Change_priority( the_thread, new_priority, true ); 4000d424: 82 13 c0 00 mov %o7, %g1 4000d428: 7f ff f4 02 call 4000a430 <_Thread_Change_priority> 4000d42c: 9e 10 40 00 mov %g1, %o7 4000d430: 81 c3 e0 08 retl <== NOT EXECUTED =============================================================================== 40007d2c <_POSIX_Timer_TSR>: * This is the operation that is run when a timer expires */ void _POSIX_Timer_TSR( Objects_Id timer __attribute__((unused)), void *data) { 40007d2c: 9d e3 bf 98 save %sp, -104, %sp bool activated; ptimer = (POSIX_Timer_Control *)data; /* Increment the number of expirations. */ ptimer->overrun = ptimer->overrun + 1; 40007d30: c2 06 60 68 ld [ %i1 + 0x68 ], %g1 40007d34: 82 00 60 01 inc %g1 40007d38: c2 26 60 68 st %g1, [ %i1 + 0x68 ] /* The timer must be reprogrammed */ if ( ( ptimer->timer_data.it_interval.tv_sec != 0 ) || 40007d3c: c2 06 60 54 ld [ %i1 + 0x54 ], %g1 40007d40: 80 a0 60 00 cmp %g1, 0 40007d44: 32 80 00 07 bne,a 40007d60 <_POSIX_Timer_TSR+0x34> 40007d48: d2 06 60 64 ld [ %i1 + 0x64 ], %o1 40007d4c: c2 06 60 58 ld [ %i1 + 0x58 ], %g1 40007d50: 80 a0 60 00 cmp %g1, 0 40007d54: 02 80 00 1f be 40007dd0 <_POSIX_Timer_TSR+0xa4> <== NEVER TAKEN 40007d58: 82 10 20 04 mov 4, %g1 ( ptimer->timer_data.it_interval.tv_nsec != 0 ) ) { activated = _POSIX_Timer_Insert_helper( 40007d5c: d2 06 60 64 ld [ %i1 + 0x64 ], %o1 40007d60: d4 06 60 08 ld [ %i1 + 8 ], %o2 40007d64: 90 06 60 10 add %i1, 0x10, %o0 40007d68: 17 10 00 1f sethi %hi(0x40007c00), %o3 40007d6c: 98 10 00 19 mov %i1, %o4 40007d70: 40 00 17 ca call 4000dc98 <_POSIX_Timer_Insert_helper> 40007d74: 96 12 e1 2c or %o3, 0x12c, %o3 ptimer->ticks, ptimer->Object.id, _POSIX_Timer_TSR, ptimer ); if ( !activated ) 40007d78: 80 8a 20 ff btst 0xff, %o0 40007d7c: 02 80 00 1a be 40007de4 <_POSIX_Timer_TSR+0xb8> <== NEVER TAKEN 40007d80: 90 07 bf f8 add %fp, -8, %o0 40007d84: 13 10 00 7f sethi %hi(0x4001fc00), %o1 40007d88: 40 00 05 ed call 4000953c <_TOD_Get_with_nanoseconds> 40007d8c: 92 12 62 28 or %o1, 0x228, %o1 ! 4001fe28 <_TOD> /* After the signal handler returns, the count of expirations of the * timer must be set to 0. */ ptimer->overrun = 0; } 40007d90: f8 1a 00 00 ldd [ %o0 ], %i4 static inline void _Timestamp64_implementation_To_timespec( const Timestamp64_Control *_timestamp, struct timespec *_timespec ) { _timespec->tv_sec = (time_t) (*_timestamp / 1000000000L); 40007d94: 94 10 20 00 clr %o2 40007d98: 90 10 00 1c mov %i4, %o0 40007d9c: 92 10 00 1d mov %i5, %o1 40007da0: 17 0e e6 b2 sethi %hi(0x3b9ac800), %o3 40007da4: 40 00 48 0b call 40019dd0 <__divdi3> 40007da8: 96 12 e2 00 or %o3, 0x200, %o3 ! 3b9aca00 _timespec->tv_nsec = (long) (*_timestamp % 1000000000L); 40007dac: 90 10 00 1c mov %i4, %o0 static inline void _Timestamp64_implementation_To_timespec( const Timestamp64_Control *_timestamp, struct timespec *_timespec ) { _timespec->tv_sec = (time_t) (*_timestamp / 1000000000L); 40007db0: d2 26 60 6c st %o1, [ %i1 + 0x6c ] _timespec->tv_nsec = (long) (*_timestamp % 1000000000L); 40007db4: 94 10 20 00 clr %o2 40007db8: 92 10 00 1d mov %i5, %o1 40007dbc: 17 0e e6 b2 sethi %hi(0x3b9ac800), %o3 40007dc0: 40 00 48 ef call 4001a17c <__moddi3> 40007dc4: 96 12 e2 00 or %o3, 0x200, %o3 ! 3b9aca00 /* Store the time when the timer was started again */ _TOD_Get( &ptimer->time ); /* The state really did not change but just to be safe */ ptimer->state = POSIX_TIMER_STATE_CREATE_RUN; 40007dc8: 82 10 20 03 mov 3, %g1 40007dcc: d2 26 60 70 st %o1, [ %i1 + 0x70 ] /* * The sending of the signal to the process running the handling function * specified for that signal is simulated */ if ( pthread_kill ( ptimer->thread_id, ptimer->inf.sigev_signo ) ) { 40007dd0: d0 06 60 38 ld [ %i1 + 0x38 ], %o0 40007dd4: d2 06 60 44 ld [ %i1 + 0x44 ], %o1 40007dd8: 40 00 16 9f call 4000d854 40007ddc: c2 2e 60 3c stb %g1, [ %i1 + 0x3c ] } /* After the signal handler returns, the count of expirations of the * timer must be set to 0. */ ptimer->overrun = 0; 40007de0: c0 26 60 68 clr [ %i1 + 0x68 ] 40007de4: 81 c7 e0 08 ret 40007de8: 81 e8 00 00 restore =============================================================================== 4000f3f4 <_POSIX_signals_Check_signal>: bool _POSIX_signals_Check_signal( POSIX_API_Control *api, int signo, bool is_global ) { 4000f3f4: 9d e3 bf 68 save %sp, -152, %sp siginfo_t siginfo_struct; sigset_t saved_signals_blocked; Thread_Wait_information stored_thread_wait_information; if ( ! _POSIX_signals_Clear_signals( api, signo, &siginfo_struct, 4000f3f8: 98 10 20 01 mov 1, %o4 4000f3fc: 90 10 00 18 mov %i0, %o0 4000f400: 92 10 00 19 mov %i1, %o1 4000f404: 94 07 bf cc add %fp, -52, %o2 4000f408: 40 00 00 2e call 4000f4c0 <_POSIX_signals_Clear_signals> 4000f40c: 96 10 00 1a mov %i2, %o3 4000f410: 80 8a 20 ff btst 0xff, %o0 4000f414: 02 80 00 28 be 4000f4b4 <_POSIX_signals_Check_signal+0xc0> 4000f418: 82 10 20 00 clr %g1 #endif /* * Just to prevent sending a signal which is currently being ignored. */ if ( _POSIX_signals_Vectors[ signo ].sa_handler == SIG_IGN ) 4000f41c: 85 2e 60 02 sll %i1, 2, %g2 4000f420: 35 10 00 7e sethi %hi(0x4001f800), %i2 4000f424: b7 2e 60 04 sll %i1, 4, %i3 4000f428: b4 16 a1 f0 or %i2, 0x1f0, %i2 4000f42c: b6 26 c0 02 sub %i3, %g2, %i3 4000f430: 84 06 80 1b add %i2, %i3, %g2 4000f434: fa 00 a0 08 ld [ %g2 + 8 ], %i5 4000f438: 80 a7 60 01 cmp %i5, 1 4000f43c: 02 80 00 1e be 4000f4b4 <_POSIX_signals_Check_signal+0xc0><== NEVER TAKEN 4000f440: 90 07 bf d8 add %fp, -40, %o0 return false; /* * Block the signals requested in sa_mask */ saved_signals_blocked = api->signals_blocked; 4000f444: f8 06 20 d0 ld [ %i0 + 0xd0 ], %i4 api->signals_blocked |= _POSIX_signals_Vectors[ signo ].sa_mask; 4000f448: c2 00 a0 04 ld [ %g2 + 4 ], %g1 4000f44c: 82 10 40 1c or %g1, %i4, %g1 4000f450: c2 26 20 d0 st %g1, [ %i0 + 0xd0 ] /* * We have to save the blocking information of the current wait queue * because the signal handler may subsequently go on and put the thread * on a wait queue, for its own purposes. */ memcpy( &stored_thread_wait_information, &_Thread_Executing->Wait, 4000f454: 03 10 00 7e sethi %hi(0x4001f800), %g1 4000f458: d2 00 61 a0 ld [ %g1 + 0x1a0 ], %o1 ! 4001f9a0 <_Per_CPU_Information+0x10> 4000f45c: 94 10 20 28 mov 0x28, %o2 4000f460: 40 00 03 f2 call 40010428 4000f464: 92 02 60 20 add %o1, 0x20, %o1 sizeof( Thread_Wait_information )); /* * Here, the signal handler function executes */ switch ( _POSIX_signals_Vectors[ signo ].sa_flags ) { 4000f468: c2 06 80 1b ld [ %i2 + %i3 ], %g1 4000f46c: 80 a0 60 02 cmp %g1, 2 4000f470: 12 80 00 07 bne 4000f48c <_POSIX_signals_Check_signal+0x98> 4000f474: 90 10 00 19 mov %i1, %o0 case SA_SIGINFO: (*_POSIX_signals_Vectors[ signo ].sa_sigaction)( 4000f478: 92 07 bf cc add %fp, -52, %o1 4000f47c: 9f c7 40 00 call %i5 4000f480: 94 10 20 00 clr %o2 signo, &siginfo_struct, NULL /* context is undefined per 1003.1b-1993, p. 66 */ ); break; 4000f484: 10 80 00 05 b 4000f498 <_POSIX_signals_Check_signal+0xa4> 4000f488: 03 10 00 7e sethi %hi(0x4001f800), %g1 default: (*_POSIX_signals_Vectors[ signo ].sa_handler)( signo ); 4000f48c: 9f c7 40 00 call %i5 4000f490: 01 00 00 00 nop } /* * Restore the blocking information */ memcpy( &_Thread_Executing->Wait, &stored_thread_wait_information, 4000f494: 03 10 00 7e sethi %hi(0x4001f800), %g1 4000f498: d0 00 61 a0 ld [ %g1 + 0x1a0 ], %o0 ! 4001f9a0 <_Per_CPU_Information+0x10> 4000f49c: 92 07 bf d8 add %fp, -40, %o1 4000f4a0: 90 02 20 20 add %o0, 0x20, %o0 4000f4a4: 40 00 03 e1 call 40010428 4000f4a8: 94 10 20 28 mov 0x28, %o2 /* * Restore the previous set of blocked signals */ api->signals_blocked = saved_signals_blocked; return true; 4000f4ac: 82 10 20 01 mov 1, %g1 sizeof( Thread_Wait_information )); /* * Restore the previous set of blocked signals */ api->signals_blocked = saved_signals_blocked; 4000f4b0: f8 26 20 d0 st %i4, [ %i0 + 0xd0 ] return true; } 4000f4b4: b0 08 60 01 and %g1, 1, %i0 4000f4b8: 81 c7 e0 08 ret 4000f4bc: 81 e8 00 00 restore =============================================================================== 4000fa40 <_POSIX_signals_Clear_process_signals>: */ void _POSIX_signals_Clear_process_signals( int signo ) { 4000fa40: 9d e3 bf a0 save %sp, -96, %sp 4000fa44: 82 06 3f ff add %i0, -1, %g1 4000fa48: ba 10 20 01 mov 1, %i5 clear_signal = true; mask = signo_to_mask( signo ); ISR_Level level; _ISR_Disable( level ); 4000fa4c: 7f ff ca 7f call 40002448 4000fa50: bb 2f 40 01 sll %i5, %g1, %i5 if ( _POSIX_signals_Vectors[ signo ].sa_flags == SA_SIGINFO ) { 4000fa54: 05 10 00 7e sethi %hi(0x4001f800), %g2 4000fa58: 83 2e 20 02 sll %i0, 2, %g1 4000fa5c: 84 10 a1 f0 or %g2, 0x1f0, %g2 4000fa60: b1 2e 20 04 sll %i0, 4, %i0 4000fa64: 82 26 00 01 sub %i0, %g1, %g1 4000fa68: c4 00 80 01 ld [ %g2 + %g1 ], %g2 4000fa6c: 80 a0 a0 02 cmp %g2, 2 4000fa70: 32 80 00 0c bne,a 4000faa0 <_POSIX_signals_Clear_process_signals+0x60> 4000fa74: 03 10 00 7e sethi %hi(0x4001f800), %g1 if ( !_Chain_Is_empty( &_POSIX_signals_Siginfo[ signo ] ) ) 4000fa78: 05 10 00 7e sethi %hi(0x4001f800), %g2 4000fa7c: 84 10 a3 e8 or %g2, 0x3e8, %g2 ! 4001fbe8 <_POSIX_signals_Siginfo> 4000fa80: 86 00 40 02 add %g1, %g2, %g3 4000fa84: c2 00 40 02 ld [ %g1 + %g2 ], %g1 RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( const Chain_Control *the_chain ) { return _Chain_Immutable_first( the_chain ) == _Chain_Immutable_tail( the_chain ); 4000fa88: 86 00 e0 04 add %g3, 4, %g3 4000fa8c: 80 a0 40 03 cmp %g1, %g3 4000fa90: 02 80 00 04 be 4000faa0 <_POSIX_signals_Clear_process_signals+0x60><== ALWAYS TAKEN 4000fa94: 03 10 00 7e sethi %hi(0x4001f800), %g1 clear_signal = false; } if ( clear_signal ) { _POSIX_signals_Pending &= ~mask; } _ISR_Enable( level ); 4000fa98: 7f ff ca 70 call 40002458 4000fa9c: 91 e8 00 08 restore %g0, %o0, %o0 if ( _POSIX_signals_Vectors[ signo ].sa_flags == SA_SIGINFO ) { if ( !_Chain_Is_empty( &_POSIX_signals_Siginfo[ signo ] ) ) clear_signal = false; } if ( clear_signal ) { _POSIX_signals_Pending &= ~mask; 4000faa0: c4 00 63 e4 ld [ %g1 + 0x3e4 ], %g2 4000faa4: ba 28 80 1d andn %g2, %i5, %i5 4000faa8: 10 bf ff fc b 4000fa98 <_POSIX_signals_Clear_process_signals+0x58> 4000faac: fa 20 63 e4 st %i5, [ %g1 + 0x3e4 ] =============================================================================== 40008824 <_POSIX_signals_Get_lowest>: sigset_t set ) { int signo; for ( signo = SIGRTMIN ; signo <= SIGRTMAX ; signo++ ) { 40008824: 82 10 20 1b mov 0x1b, %g1 40008828: 84 10 20 01 mov 1, %g2 #include #include #include #include static int _POSIX_signals_Get_lowest( 4000882c: 86 00 7f ff add %g1, -1, %g3 40008830: 87 28 80 03 sll %g2, %g3, %g3 ) { int signo; for ( signo = SIGRTMIN ; signo <= SIGRTMAX ; signo++ ) { if ( set & signo_to_mask( signo ) ) { 40008834: 80 88 c0 08 btst %g3, %o0 40008838: 12 80 00 11 bne 4000887c <_POSIX_signals_Get_lowest+0x58> <== NEVER TAKEN 4000883c: 01 00 00 00 nop sigset_t set ) { int signo; for ( signo = SIGRTMIN ; signo <= SIGRTMAX ; signo++ ) { 40008840: 82 00 60 01 inc %g1 40008844: 80 a0 60 20 cmp %g1, 0x20 40008848: 12 bf ff fa bne 40008830 <_POSIX_signals_Get_lowest+0xc> 4000884c: 86 00 7f ff add %g1, -1, %g3 40008850: 82 10 20 01 mov 1, %g1 40008854: 84 10 20 01 mov 1, %g2 #include #include #include #include static int _POSIX_signals_Get_lowest( 40008858: 86 00 7f ff add %g1, -1, %g3 4000885c: 87 28 80 03 sll %g2, %g3, %g3 #if (SIGHUP != 1) #error "Assumption that SIGHUP==1 violated!!" #endif for ( signo = SIGHUP ; signo <= __SIGLASTNOTRT ; signo++ ) { if ( set & signo_to_mask( signo ) ) { 40008860: 80 88 c0 08 btst %g3, %o0 40008864: 12 80 00 06 bne 4000887c <_POSIX_signals_Get_lowest+0x58> 40008868: 01 00 00 00 nop */ #if (SIGHUP != 1) #error "Assumption that SIGHUP==1 violated!!" #endif for ( signo = SIGHUP ; signo <= __SIGLASTNOTRT ; signo++ ) { 4000886c: 82 00 60 01 inc %g1 40008870: 80 a0 60 1b cmp %g1, 0x1b 40008874: 12 bf ff fa bne 4000885c <_POSIX_signals_Get_lowest+0x38> <== ALWAYS TAKEN 40008878: 86 00 7f ff add %g1, -1, %g3 * a return 0. This routine will NOT be called unless a signal * is pending in the set passed in. */ found_it: return signo; } 4000887c: 81 c3 e0 08 retl 40008880: 90 10 00 01 mov %g1, %o0 =============================================================================== 4000cfb4 <_POSIX_signals_Post_switch_hook>: */ static void _POSIX_signals_Post_switch_hook( Thread_Control *the_thread ) { 4000cfb4: 9d e3 bf a0 save %sp, -96, %sp /* * We need to ensure that if the signal handler executes a call * which overwrites the unblocking status, we restore it. */ hold_errno = _Thread_Executing->Wait.return_code; 4000cfb8: 03 10 00 7e sethi %hi(0x4001f800), %g1 POSIX_API_Control *api; int signo; ISR_Level level; int hold_errno; api = the_thread->API_Extensions[ THREAD_API_POSIX ]; 4000cfbc: fa 06 21 50 ld [ %i0 + 0x150 ], %i5 /* * We need to ensure that if the signal handler executes a call * which overwrites the unblocking status, we restore it. */ hold_errno = _Thread_Executing->Wait.return_code; 4000cfc0: c2 00 61 a0 ld [ %g1 + 0x1a0 ], %g1 /* * api may be NULL in case of a thread close in progress */ if ( !api ) 4000cfc4: 80 a7 60 00 cmp %i5, 0 4000cfc8: 02 80 00 11 be 4000d00c <_POSIX_signals_Post_switch_hook+0x58><== NEVER TAKEN 4000cfcc: f6 00 60 34 ld [ %g1 + 0x34 ], %i3 * processed at all. No point in doing this loop otherwise. */ while (1) { _ISR_Disable( level ); if ( !(~api->signals_blocked & (api->signals_pending | _POSIX_signals_Pending)) ) { 4000cfd0: 35 10 00 7e sethi %hi(0x4001f800), %i2 * * The first thing done is to check there are any signals to be * processed at all. No point in doing this loop otherwise. */ while (1) { _ISR_Disable( level ); 4000cfd4: 7f ff d5 1d call 40002448 4000cfd8: 01 00 00 00 nop if ( !(~api->signals_blocked & (api->signals_pending | _POSIX_signals_Pending)) ) { 4000cfdc: c4 06 a3 e4 ld [ %i2 + 0x3e4 ], %g2 4000cfe0: c2 07 60 d4 ld [ %i5 + 0xd4 ], %g1 4000cfe4: 82 10 80 01 or %g2, %g1, %g1 * The first thing done is to check there are any signals to be * processed at all. No point in doing this loop otherwise. */ while (1) { _ISR_Disable( level ); if ( !(~api->signals_blocked & 4000cfe8: c4 07 60 d0 ld [ %i5 + 0xd0 ], %g2 4000cfec: 80 a8 40 02 andncc %g1, %g2, %g0 4000cff0: 12 80 00 09 bne 4000d014 <_POSIX_signals_Post_switch_hook+0x60> 4000cff4: 01 00 00 00 nop (api->signals_pending | _POSIX_signals_Pending)) ) { _ISR_Enable( level ); 4000cff8: 7f ff d5 18 call 40002458 4000cffc: 01 00 00 00 nop _POSIX_signals_Check_signal( api, signo, false ); _POSIX_signals_Check_signal( api, signo, true ); } } _Thread_Executing->Wait.return_code = hold_errno; 4000d000: 03 10 00 7e sethi %hi(0x4001f800), %g1 4000d004: c2 00 61 a0 ld [ %g1 + 0x1a0 ], %g1 ! 4001f9a0 <_Per_CPU_Information+0x10> 4000d008: f6 20 60 34 st %i3, [ %g1 + 0x34 ] 4000d00c: 81 c7 e0 08 ret 4000d010: 81 e8 00 00 restore if ( !(~api->signals_blocked & (api->signals_pending | _POSIX_signals_Pending)) ) { _ISR_Enable( level ); break; } _ISR_Enable( level ); 4000d014: 7f ff d5 11 call 40002458 4000d018: b8 10 20 1b mov 0x1b, %i4 for ( signo = SIGRTMIN ; signo <= SIGRTMAX ; signo++ ) { _POSIX_signals_Check_signal( api, signo, false ); 4000d01c: 92 10 00 1c mov %i4, %o1 4000d020: 94 10 20 00 clr %o2 4000d024: 40 00 08 f4 call 4000f3f4 <_POSIX_signals_Check_signal> 4000d028: 90 10 00 1d mov %i5, %o0 _POSIX_signals_Check_signal( api, signo, true ); 4000d02c: 92 10 00 1c mov %i4, %o1 4000d030: 90 10 00 1d mov %i5, %o0 4000d034: 40 00 08 f0 call 4000f3f4 <_POSIX_signals_Check_signal> 4000d038: 94 10 20 01 mov 1, %o2 _ISR_Enable( level ); break; } _ISR_Enable( level ); for ( signo = SIGRTMIN ; signo <= SIGRTMAX ; signo++ ) { 4000d03c: b8 07 20 01 inc %i4 4000d040: 80 a7 20 20 cmp %i4, 0x20 4000d044: 12 bf ff f7 bne 4000d020 <_POSIX_signals_Post_switch_hook+0x6c> 4000d048: 92 10 00 1c mov %i4, %o1 4000d04c: b8 10 20 01 mov 1, %i4 _POSIX_signals_Check_signal( api, signo, true ); } /* Unfortunately - nothing like __SIGFIRSTNOTRT in newlib signal .h */ for ( signo = SIGHUP ; signo <= __SIGLASTNOTRT ; signo++ ) { _POSIX_signals_Check_signal( api, signo, false ); 4000d050: 92 10 00 1c mov %i4, %o1 4000d054: 94 10 20 00 clr %o2 4000d058: 40 00 08 e7 call 4000f3f4 <_POSIX_signals_Check_signal> 4000d05c: 90 10 00 1d mov %i5, %o0 _POSIX_signals_Check_signal( api, signo, true ); 4000d060: 92 10 00 1c mov %i4, %o1 4000d064: 90 10 00 1d mov %i5, %o0 4000d068: 40 00 08 e3 call 4000f3f4 <_POSIX_signals_Check_signal> 4000d06c: 94 10 20 01 mov 1, %o2 _POSIX_signals_Check_signal( api, signo, false ); _POSIX_signals_Check_signal( api, signo, true ); } /* Unfortunately - nothing like __SIGFIRSTNOTRT in newlib signal .h */ for ( signo = SIGHUP ; signo <= __SIGLASTNOTRT ; signo++ ) { 4000d070: b8 07 20 01 inc %i4 4000d074: 80 a7 20 1b cmp %i4, 0x1b 4000d078: 12 bf ff f7 bne 4000d054 <_POSIX_signals_Post_switch_hook+0xa0> 4000d07c: 92 10 00 1c mov %i4, %o1 4000d080: 30 bf ff d5 b,a 4000cfd4 <_POSIX_signals_Post_switch_hook+0x20> =============================================================================== 4001c0c8 <_POSIX_signals_Unblock_thread>: bool _POSIX_signals_Unblock_thread( Thread_Control *the_thread, int signo, siginfo_t *info ) { 4001c0c8: 9d e3 bf a0 save %sp, -96, %sp /* * Is the thread is specifically waiting for a signal? */ if ( _States_Is_interruptible_signal( the_thread->current_state ) ) { 4001c0cc: c2 06 20 10 ld [ %i0 + 0x10 ], %g1 4001c0d0: 3b 04 00 20 sethi %hi(0x10008000), %i5 4001c0d4: 84 06 7f ff add %i1, -1, %g2 4001c0d8: 86 10 20 01 mov 1, %g3 4001c0dc: b8 08 40 1d and %g1, %i5, %i4 { POSIX_API_Control *api; sigset_t mask; siginfo_t *the_info = NULL; api = the_thread->API_Extensions[ THREAD_API_POSIX ]; 4001c0e0: c8 06 21 50 ld [ %i0 + 0x150 ], %g4 /* * Is the thread is specifically waiting for a signal? */ if ( _States_Is_interruptible_signal( the_thread->current_state ) ) { 4001c0e4: 80 a7 00 1d cmp %i4, %i5 4001c0e8: 12 80 00 1e bne 4001c160 <_POSIX_signals_Unblock_thread+0x98> 4001c0ec: 85 28 c0 02 sll %g3, %g2, %g2 if ( (the_thread->Wait.option & mask) || (~api->signals_blocked & mask) ) { 4001c0f0: c2 06 20 30 ld [ %i0 + 0x30 ], %g1 4001c0f4: 80 88 80 01 btst %g2, %g1 4001c0f8: 12 80 00 08 bne 4001c118 <_POSIX_signals_Unblock_thread+0x50> 4001c0fc: 82 10 20 04 mov 4, %g1 4001c100: c2 01 20 d0 ld [ %g4 + 0xd0 ], %g1 4001c104: 80 a8 80 01 andncc %g2, %g1, %g0 4001c108: 32 80 00 04 bne,a 4001c118 <_POSIX_signals_Unblock_thread+0x50> 4001c10c: 82 10 20 04 mov 4, %g1 } else if ( the_thread->current_state == STATES_READY ) { if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) ) _Thread_Dispatch_necessary = true; } } return false; 4001c110: 10 80 00 3d b 4001c204 <_POSIX_signals_Unblock_thread+0x13c> 4001c114: b0 10 20 00 clr %i0 */ if ( _States_Is_interruptible_signal( the_thread->current_state ) ) { if ( (the_thread->Wait.option & mask) || (~api->signals_blocked & mask) ) { the_thread->Wait.return_code = EINTR; 4001c118: c2 26 20 34 st %g1, [ %i0 + 0x34 ] the_info = (siginfo_t *) the_thread->Wait.return_argument; if ( !info ) { 4001c11c: 80 a6 a0 00 cmp %i2, 0 4001c120: 12 80 00 07 bne 4001c13c <_POSIX_signals_Unblock_thread+0x74> 4001c124: d0 06 20 28 ld [ %i0 + 0x28 ], %o0 the_info->si_signo = signo; the_info->si_code = SI_USER; 4001c128: 82 10 20 01 mov 1, %g1 the_thread->Wait.return_code = EINTR; the_info = (siginfo_t *) the_thread->Wait.return_argument; if ( !info ) { the_info->si_signo = signo; 4001c12c: f2 22 00 00 st %i1, [ %o0 ] the_info->si_code = SI_USER; 4001c130: c2 22 20 04 st %g1, [ %o0 + 4 ] the_info->si_value.sival_int = 0; 4001c134: 10 80 00 05 b 4001c148 <_POSIX_signals_Unblock_thread+0x80> 4001c138: c0 22 20 08 clr [ %o0 + 8 ] } else { *the_info = *info; 4001c13c: 92 10 00 1a mov %i2, %o1 4001c140: 7f ff d0 ba call 40010428 4001c144: 94 10 20 0c mov 0xc, %o2 } _Thread_queue_Extract_with_proxy( the_thread ); 4001c148: 90 10 00 18 mov %i0, %o0 4001c14c: 7f ff bb 98 call 4000afac <_Thread_queue_Extract_with_proxy> 4001c150: b0 10 20 01 mov 1, %i0 4001c154: b0 0e 20 01 and %i0, 1, %i0 4001c158: 81 c7 e0 08 ret 4001c15c: 81 e8 00 00 restore } /* * Thread is not waiting due to a sigwait. */ if ( ~api->signals_blocked & mask ) { 4001c160: c8 01 20 d0 ld [ %g4 + 0xd0 ], %g4 4001c164: 80 a8 80 04 andncc %g2, %g4, %g0 4001c168: 02 80 00 26 be 4001c200 <_POSIX_signals_Unblock_thread+0x138> 4001c16c: 05 04 00 00 sethi %hi(0x10000000), %g2 * it is not blocked, THEN * we need to dispatch at the end of this ISR. * + Any other combination, do nothing. */ if ( _States_Is_interruptible_by_signal( the_thread->current_state ) ) { 4001c170: 80 88 40 02 btst %g1, %g2 4001c174: 02 80 00 17 be 4001c1d0 <_POSIX_signals_Unblock_thread+0x108> 4001c178: 80 a0 60 00 cmp %g1, 0 the_thread->Wait.return_code = EINTR; 4001c17c: 84 10 20 04 mov 4, %g2 4001c180: c4 26 20 34 st %g2, [ %i0 + 0x34 ] /* * In pthread_cond_wait, a thread will be blocking on a thread * queue, but is also interruptible by a POSIX signal. */ if ( _States_Is_waiting_on_thread_queue(the_thread->current_state) ) 4001c184: 05 00 00 ef sethi %hi(0x3bc00), %g2 4001c188: 84 10 a2 e0 or %g2, 0x2e0, %g2 ! 3bee0 4001c18c: 80 88 40 02 btst %g1, %g2 4001c190: 02 80 00 06 be 4001c1a8 <_POSIX_signals_Unblock_thread+0xe0> 4001c194: 80 88 60 08 btst 8, %g1 _Thread_queue_Extract_with_proxy( the_thread ); 4001c198: 7f ff bb 85 call 4000afac <_Thread_queue_Extract_with_proxy> 4001c19c: 90 10 00 18 mov %i0, %o0 } else if ( the_thread->current_state == STATES_READY ) { if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) ) _Thread_Dispatch_necessary = true; } } return false; 4001c1a0: 10 80 00 19 b 4001c204 <_POSIX_signals_Unblock_thread+0x13c> 4001c1a4: b0 10 20 00 clr %i0 * In pthread_cond_wait, a thread will be blocking on a thread * queue, but is also interruptible by a POSIX signal. */ if ( _States_Is_waiting_on_thread_queue(the_thread->current_state) ) _Thread_queue_Extract_with_proxy( the_thread ); else if ( _States_Is_delaying(the_thread->current_state) ) { 4001c1a8: 22 80 00 17 be,a 4001c204 <_POSIX_signals_Unblock_thread+0x13c><== NEVER TAKEN 4001c1ac: b0 10 20 00 clr %i0 <== NOT EXECUTED (void) _Watchdog_Remove( &the_thread->Timer ); 4001c1b0: 7f ff bd 21 call 4000b634 <_Watchdog_Remove> 4001c1b4: 90 06 20 48 add %i0, 0x48, %o0 RTEMS_INLINE_ROUTINE void _Thread_Unblock ( Thread_Control *the_thread ) { _Thread_Clear_state( the_thread, STATES_BLOCKED ); 4001c1b8: 90 10 00 18 mov %i0, %o0 4001c1bc: 13 04 01 ff sethi %hi(0x1007fc00), %o1 4001c1c0: 7f ff b8 e0 call 4000a540 <_Thread_Clear_state> 4001c1c4: 92 12 63 f8 or %o1, 0x3f8, %o1 ! 1007fff8 } else if ( the_thread->current_state == STATES_READY ) { if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) ) _Thread_Dispatch_necessary = true; } } return false; 4001c1c8: 10 80 00 0f b 4001c204 <_POSIX_signals_Unblock_thread+0x13c> 4001c1cc: b0 10 20 00 clr %i0 else if ( _States_Is_delaying(the_thread->current_state) ) { (void) _Watchdog_Remove( &the_thread->Timer ); _Thread_Unblock( the_thread ); } } else if ( the_thread->current_state == STATES_READY ) { 4001c1d0: 32 80 00 0d bne,a 4001c204 <_POSIX_signals_Unblock_thread+0x13c><== NEVER TAKEN 4001c1d4: b0 10 20 00 clr %i0 <== NOT EXECUTED if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) ) 4001c1d8: 03 10 00 7e sethi %hi(0x4001f800), %g1 4001c1dc: 82 10 61 90 or %g1, 0x190, %g1 ! 4001f990 <_Per_CPU_Information> 4001c1e0: c4 00 60 08 ld [ %g1 + 8 ], %g2 4001c1e4: 80 a0 a0 00 cmp %g2, 0 4001c1e8: 22 80 00 07 be,a 4001c204 <_POSIX_signals_Unblock_thread+0x13c> 4001c1ec: b0 10 20 00 clr %i0 4001c1f0: c4 00 60 10 ld [ %g1 + 0x10 ], %g2 4001c1f4: 80 a6 00 02 cmp %i0, %g2 4001c1f8: 22 80 00 02 be,a 4001c200 <_POSIX_signals_Unblock_thread+0x138><== ALWAYS TAKEN 4001c1fc: c6 28 60 0c stb %g3, [ %g1 + 0xc ] _Thread_Dispatch_necessary = true; } } return false; 4001c200: b0 10 20 00 clr %i0 } 4001c204: b0 0e 20 01 and %i0, 1, %i0 4001c208: 81 c7 e0 08 ret 4001c20c: 81 e8 00 00 restore =============================================================================== 4000a750 <_RBTree_Extract_unprotected>: */ void _RBTree_Extract_unprotected( RBTree_Control *the_rbtree, RBTree_Node *the_node ) { 4000a750: 9d e3 bf a0 save %sp, -96, %sp RBTree_Node *leaf, *target; RBTree_Color victim_color; RBTree_Direction dir; if (!the_node) return; 4000a754: 80 a6 60 00 cmp %i1, 0 4000a758: 02 80 00 69 be 4000a8fc <_RBTree_Extract_unprotected+0x1ac> 4000a75c: 01 00 00 00 nop /* check if min needs to be updated */ if (the_node == the_rbtree->first[RBT_LEFT]) { 4000a760: c2 06 20 08 ld [ %i0 + 8 ], %g1 4000a764: 80 a6 40 01 cmp %i1, %g1 4000a768: 32 80 00 07 bne,a 4000a784 <_RBTree_Extract_unprotected+0x34> 4000a76c: 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 ); 4000a770: 90 10 00 19 mov %i1, %o0 4000a774: 40 00 01 31 call 4000ac38 <_RBTree_Next_unprotected> 4000a778: 92 10 20 01 mov 1, %o1 RBTree_Node *next; next = _RBTree_Successor_unprotected(the_node); the_rbtree->first[RBT_LEFT] = next; 4000a77c: 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]) { 4000a780: c2 06 20 0c ld [ %i0 + 0xc ], %g1 4000a784: 80 a6 40 01 cmp %i1, %g1 4000a788: 32 80 00 07 bne,a 4000a7a4 <_RBTree_Extract_unprotected+0x54> 4000a78c: 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 ); 4000a790: 90 10 00 19 mov %i1, %o0 4000a794: 40 00 01 29 call 4000ac38 <_RBTree_Next_unprotected> 4000a798: 92 10 20 00 clr %o1 RBTree_Node *previous; previous = _RBTree_Predecessor_unprotected(the_node); the_rbtree->first[RBT_RIGHT] = previous; 4000a79c: 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]) { 4000a7a0: fa 06 60 04 ld [ %i1 + 4 ], %i5 4000a7a4: 80 a7 60 00 cmp %i5, 0 4000a7a8: 02 80 00 36 be 4000a880 <_RBTree_Extract_unprotected+0x130> 4000a7ac: f8 06 60 08 ld [ %i1 + 8 ], %i4 4000a7b0: 80 a7 20 00 cmp %i4, 0 4000a7b4: 32 80 00 05 bne,a 4000a7c8 <_RBTree_Extract_unprotected+0x78> 4000a7b8: c2 07 60 08 ld [ %i5 + 8 ], %g1 4000a7bc: 10 80 00 35 b 4000a890 <_RBTree_Extract_unprotected+0x140> 4000a7c0: 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]; 4000a7c4: c2 07 60 08 ld [ %i5 + 8 ], %g1 4000a7c8: 80 a0 60 00 cmp %g1, 0 4000a7cc: 32 bf ff fe bne,a 4000a7c4 <_RBTree_Extract_unprotected+0x74> 4000a7d0: 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]; 4000a7d4: f8 07 60 04 ld [ %i5 + 4 ], %i4 if(leaf) { 4000a7d8: 80 a7 20 00 cmp %i4, 0 4000a7dc: 02 80 00 05 be 4000a7f0 <_RBTree_Extract_unprotected+0xa0> 4000a7e0: 01 00 00 00 nop leaf->parent = target->parent; 4000a7e4: c2 07 40 00 ld [ %i5 ], %g1 4000a7e8: 10 80 00 04 b 4000a7f8 <_RBTree_Extract_unprotected+0xa8> 4000a7ec: c2 27 00 00 st %g1, [ %i4 ] } else { /* fix the tree here if the child is a null leaf. */ _RBTree_Extract_validate_unprotected(target); 4000a7f0: 7f ff ff 73 call 4000a5bc <_RBTree_Extract_validate_unprotected> 4000a7f4: 90 10 00 1d mov %i5, %o0 } victim_color = target->color; dir = target != target->parent->child[0]; 4000a7f8: 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; 4000a7fc: c2 07 60 0c ld [ %i5 + 0xc ], %g1 dir = target != target->parent->child[0]; 4000a800: c6 00 a0 04 ld [ %g2 + 4 ], %g3 4000a804: 86 1f 40 03 xor %i5, %g3, %g3 4000a808: 80 a0 00 03 cmp %g0, %g3 4000a80c: 86 40 20 00 addx %g0, 0, %g3 target->parent->child[dir] = leaf; 4000a810: 87 28 e0 02 sll %g3, 2, %g3 4000a814: 84 00 80 03 add %g2, %g3, %g2 4000a818: f8 20 a0 04 st %i4, [ %g2 + 4 ] /* now replace the_node with target */ dir = the_node != the_node->parent->child[0]; 4000a81c: c4 06 40 00 ld [ %i1 ], %g2 4000a820: c6 00 a0 04 ld [ %g2 + 4 ], %g3 4000a824: 86 1e 40 03 xor %i1, %g3, %g3 4000a828: 80 a0 00 03 cmp %g0, %g3 4000a82c: 86 40 20 00 addx %g0, 0, %g3 the_node->parent->child[dir] = target; 4000a830: 87 28 e0 02 sll %g3, 2, %g3 4000a834: 84 00 80 03 add %g2, %g3, %g2 4000a838: 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]; 4000a83c: c4 06 60 08 ld [ %i1 + 8 ], %g2 4000a840: c4 27 60 08 st %g2, [ %i5 + 8 ] if (the_node->child[RBT_RIGHT]) 4000a844: c4 06 60 08 ld [ %i1 + 8 ], %g2 4000a848: 80 a0 a0 00 cmp %g2, 0 4000a84c: 32 80 00 02 bne,a 4000a854 <_RBTree_Extract_unprotected+0x104><== ALWAYS TAKEN 4000a850: fa 20 80 00 st %i5, [ %g2 ] the_node->child[RBT_RIGHT]->parent = target; target->child[RBT_LEFT] = the_node->child[RBT_LEFT]; 4000a854: c4 06 60 04 ld [ %i1 + 4 ], %g2 4000a858: c4 27 60 04 st %g2, [ %i5 + 4 ] if (the_node->child[RBT_LEFT]) 4000a85c: c4 06 60 04 ld [ %i1 + 4 ], %g2 4000a860: 80 a0 a0 00 cmp %g2, 0 4000a864: 32 80 00 02 bne,a 4000a86c <_RBTree_Extract_unprotected+0x11c> 4000a868: 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; 4000a86c: c4 06 40 00 ld [ %i1 ], %g2 4000a870: c4 27 40 00 st %g2, [ %i5 ] target->color = the_node->color; 4000a874: c4 06 60 0c ld [ %i1 + 0xc ], %g2 4000a878: 10 80 00 14 b 4000a8c8 <_RBTree_Extract_unprotected+0x178> 4000a87c: 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 ) { 4000a880: 80 a7 20 00 cmp %i4, 0 4000a884: 32 80 00 04 bne,a 4000a894 <_RBTree_Extract_unprotected+0x144> 4000a888: c2 06 40 00 ld [ %i1 ], %g1 4000a88c: 30 80 00 04 b,a 4000a89c <_RBTree_Extract_unprotected+0x14c> leaf->parent = the_node->parent; 4000a890: c2 06 40 00 ld [ %i1 ], %g1 4000a894: 10 80 00 04 b 4000a8a4 <_RBTree_Extract_unprotected+0x154> 4000a898: 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); 4000a89c: 7f ff ff 48 call 4000a5bc <_RBTree_Extract_validate_unprotected> 4000a8a0: 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]; 4000a8a4: 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; 4000a8a8: c2 06 60 0c ld [ %i1 + 0xc ], %g1 /* remove the_node from the tree */ dir = the_node != the_node->parent->child[0]; 4000a8ac: c6 00 a0 04 ld [ %g2 + 4 ], %g3 4000a8b0: 86 1e 40 03 xor %i1, %g3, %g3 4000a8b4: 80 a0 00 03 cmp %g0, %g3 4000a8b8: 86 40 20 00 addx %g0, 0, %g3 the_node->parent->child[dir] = leaf; 4000a8bc: 87 28 e0 02 sll %g3, 2, %g3 4000a8c0: 84 00 80 03 add %g2, %g3, %g2 4000a8c4: 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 */ 4000a8c8: 80 a0 60 00 cmp %g1, 0 4000a8cc: 32 80 00 06 bne,a 4000a8e4 <_RBTree_Extract_unprotected+0x194> 4000a8d0: c2 06 20 04 ld [ %i0 + 4 ], %g1 if (leaf) { 4000a8d4: 80 a7 20 00 cmp %i4, 0 4000a8d8: 32 80 00 02 bne,a 4000a8e0 <_RBTree_Extract_unprotected+0x190> 4000a8dc: 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; 4000a8e0: 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; 4000a8e4: c0 26 60 08 clr [ %i1 + 8 ] 4000a8e8: c0 26 60 04 clr [ %i1 + 4 ] 4000a8ec: 80 a0 60 00 cmp %g1, 0 4000a8f0: 02 80 00 03 be 4000a8fc <_RBTree_Extract_unprotected+0x1ac> 4000a8f4: c0 26 40 00 clr [ %i1 ] 4000a8f8: c0 20 60 0c clr [ %g1 + 0xc ] 4000a8fc: 81 c7 e0 08 ret 4000a900: 81 e8 00 00 restore =============================================================================== 4000bbd0 <_RBTree_Initialize>: void *starting_address, size_t number_nodes, size_t node_size, bool is_unique ) { 4000bbd0: 9d e3 bf a0 save %sp, -96, %sp size_t count; RBTree_Node *next; /* TODO: Error message? */ if (!the_rbtree) return; 4000bbd4: 80 a6 20 00 cmp %i0, 0 4000bbd8: 02 80 00 10 be 4000bc18 <_RBTree_Initialize+0x48> <== NEVER TAKEN 4000bbdc: 01 00 00 00 nop RBTree_Control *the_rbtree, RBTree_Compare_function compare_function, bool is_unique ) { the_rbtree->permanent_null = NULL; 4000bbe0: c0 26 00 00 clr [ %i0 ] the_rbtree->root = NULL; 4000bbe4: c0 26 20 04 clr [ %i0 + 4 ] the_rbtree->first[0] = NULL; 4000bbe8: c0 26 20 08 clr [ %i0 + 8 ] the_rbtree->first[1] = NULL; 4000bbec: c0 26 20 0c clr [ %i0 + 0xc ] the_rbtree->compare_function = compare_function; 4000bbf0: 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-- ) { 4000bbf4: 10 80 00 06 b 4000bc0c <_RBTree_Initialize+0x3c> 4000bbf8: fa 2e 20 14 stb %i5, [ %i0 + 0x14 ] _RBTree_Insert_unprotected(the_rbtree, next); 4000bbfc: 90 10 00 18 mov %i0, %o0 4000bc00: 7f ff ff 2e call 4000b8b8 <_RBTree_Insert_unprotected> 4000bc04: b4 06 80 1c add %i2, %i4, %i2 4000bc08: 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-- ) { 4000bc0c: 80 a6 e0 00 cmp %i3, 0 4000bc10: 12 bf ff fb bne 4000bbfc <_RBTree_Initialize+0x2c> 4000bc14: 92 10 00 1a mov %i2, %o1 4000bc18: 81 c7 e0 08 ret 4000bc1c: 81 e8 00 00 restore =============================================================================== 4000a9a4 <_RBTree_Insert_unprotected>: */ RBTree_Node *_RBTree_Insert_unprotected( RBTree_Control *the_rbtree, RBTree_Node *the_node ) { 4000a9a4: 9d e3 bf a0 save %sp, -96, %sp if(!the_node) return (RBTree_Node*)-1; 4000a9a8: 80 a6 60 00 cmp %i1, 0 4000a9ac: 02 80 00 7c be 4000ab9c <_RBTree_Insert_unprotected+0x1f8> 4000a9b0: ba 10 00 18 mov %i0, %i5 RBTree_Node *iter_node = the_rbtree->root; 4000a9b4: f0 06 20 04 ld [ %i0 + 4 ], %i0 int compare_result; if (!iter_node) { /* special case: first node inserted */ 4000a9b8: b6 96 20 00 orcc %i0, 0, %i3 4000a9bc: 32 80 00 0c bne,a 4000a9ec <_RBTree_Insert_unprotected+0x48> 4000a9c0: c2 07 60 10 ld [ %i5 + 0x10 ], %g1 the_node->color = RBT_BLACK; 4000a9c4: c0 26 60 0c clr [ %i1 + 0xc ] the_rbtree->root = the_node; 4000a9c8: f2 27 60 04 st %i1, [ %i5 + 4 ] the_rbtree->first[0] = the_rbtree->first[1] = the_node; 4000a9cc: f2 27 60 0c st %i1, [ %i5 + 0xc ] 4000a9d0: f2 27 60 08 st %i1, [ %i5 + 8 ] the_node->parent = (RBTree_Node *) the_rbtree; 4000a9d4: fa 26 40 00 st %i5, [ %i1 ] the_node->child[RBT_LEFT] = the_node->child[RBT_RIGHT] = NULL; 4000a9d8: c0 26 60 08 clr [ %i1 + 8 ] 4000a9dc: c0 26 60 04 clr [ %i1 + 4 ] 4000a9e0: 81 c7 e0 08 ret 4000a9e4: 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); 4000a9e8: c2 07 60 10 ld [ %i5 + 0x10 ], %g1 4000a9ec: 90 10 00 19 mov %i1, %o0 4000a9f0: 9f c0 40 00 call %g1 4000a9f4: 92 10 00 18 mov %i0, %o1 if ( the_rbtree->is_unique && _RBTree_Is_equal( compare_result ) ) 4000a9f8: c2 0f 60 14 ldub [ %i5 + 0x14 ], %g1 4000a9fc: 80 a0 60 00 cmp %g1, 0 4000aa00: 02 80 00 05 be 4000aa14 <_RBTree_Insert_unprotected+0x70> 4000aa04: b8 38 00 08 xnor %g0, %o0, %i4 4000aa08: 80 a2 20 00 cmp %o0, 0 4000aa0c: 02 80 00 65 be 4000aba0 <_RBTree_Insert_unprotected+0x1fc> 4000aa10: 01 00 00 00 nop return iter_node; RBTree_Direction dir = !_RBTree_Is_lesser( compare_result ); 4000aa14: b9 37 20 1f srl %i4, 0x1f, %i4 if (!iter_node->child[dir]) { 4000aa18: 83 2f 20 02 sll %i4, 2, %g1 4000aa1c: 82 06 00 01 add %i0, %g1, %g1 4000aa20: f0 00 60 04 ld [ %g1 + 4 ], %i0 4000aa24: 80 a6 20 00 cmp %i0, 0 4000aa28: 32 bf ff f0 bne,a 4000a9e8 <_RBTree_Insert_unprotected+0x44> 4000aa2c: b6 10 00 18 mov %i0, %i3 the_node->child[RBT_LEFT] = the_node->child[RBT_RIGHT] = NULL; 4000aa30: c0 26 60 08 clr [ %i1 + 8 ] 4000aa34: c0 26 60 04 clr [ %i1 + 4 ] the_node->color = RBT_RED; 4000aa38: 84 10 20 01 mov 1, %g2 iter_node->child[dir] = the_node; 4000aa3c: 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; 4000aa40: c4 26 60 0c st %g2, [ %i1 + 0xc ] iter_node->child[dir] = the_node; the_node->parent = iter_node; 4000aa44: f6 26 40 00 st %i3, [ %i1 ] /* update min/max */ compare_result = the_rbtree->compare_function( 4000aa48: 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]; 4000aa4c: b6 07 20 02 add %i4, 2, %i3 4000aa50: 85 2e e0 02 sll %i3, 2, %g2 4000aa54: d2 07 40 02 ld [ %i5 + %g2 ], %o1 4000aa58: 9f c0 40 00 call %g1 4000aa5c: 90 10 00 19 mov %i1, %o0 the_node, _RBTree_First(the_rbtree, dir) ); if ( (!dir && _RBTree_Is_lesser(compare_result)) || 4000aa60: 80 a7 20 00 cmp %i4, 0 4000aa64: 12 80 00 06 bne 4000aa7c <_RBTree_Insert_unprotected+0xd8> 4000aa68: 80 a2 20 00 cmp %o0, 0 4000aa6c: 36 80 00 3c bge,a 4000ab5c <_RBTree_Insert_unprotected+0x1b8> 4000aa70: d0 06 40 00 ld [ %i1 ], %o0 (dir && _RBTree_Is_greater(compare_result)) ) { the_rbtree->first[dir] = the_node; 4000aa74: 10 80 00 04 b 4000aa84 <_RBTree_Insert_unprotected+0xe0> 4000aa78: 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)) ) { 4000aa7c: 04 80 00 37 ble 4000ab58 <_RBTree_Insert_unprotected+0x1b4> 4000aa80: b7 2e e0 02 sll %i3, 2, %i3 the_rbtree->first[dir] = the_node; 4000aa84: 10 80 00 35 b 4000ab58 <_RBTree_Insert_unprotected+0x1b4> 4000aa88: 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; 4000aa8c: 02 80 00 13 be 4000aad8 <_RBTree_Insert_unprotected+0x134><== NEVER TAKEN 4000aa90: 82 10 20 00 clr %g1 if(!(the_node->parent->parent->parent)) return NULL; 4000aa94: c2 07 40 00 ld [ %i5 ], %g1 4000aa98: 80 a0 60 00 cmp %g1, 0 4000aa9c: 02 80 00 0f be 4000aad8 <_RBTree_Insert_unprotected+0x134><== NEVER TAKEN 4000aaa0: 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]) 4000aaa4: c2 07 60 04 ld [ %i5 + 4 ], %g1 4000aaa8: 80 a2 00 01 cmp %o0, %g1 4000aaac: 22 80 00 02 be,a 4000aab4 <_RBTree_Insert_unprotected+0x110> 4000aab0: 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); 4000aab4: 80 a0 60 00 cmp %g1, 0 4000aab8: 02 80 00 09 be 4000aadc <_RBTree_Insert_unprotected+0x138> 4000aabc: 84 10 20 00 clr %g2 4000aac0: c4 00 60 0c ld [ %g1 + 0xc ], %g2 4000aac4: 80 a0 a0 01 cmp %g2, 1 4000aac8: 32 80 00 05 bne,a 4000aadc <_RBTree_Insert_unprotected+0x138> 4000aacc: 84 10 20 00 clr %g2 4000aad0: 10 80 00 03 b 4000aadc <_RBTree_Insert_unprotected+0x138> 4000aad4: 84 10 20 01 mov 1, %g2 4000aad8: 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)) { 4000aadc: 80 a0 a0 00 cmp %g2, 0 4000aae0: 22 80 00 08 be,a 4000ab00 <_RBTree_Insert_unprotected+0x15c> 4000aae4: c2 07 60 04 ld [ %i5 + 4 ], %g1 the_node->parent->color = RBT_BLACK; 4000aae8: c0 22 20 0c clr [ %o0 + 0xc ] u->color = RBT_BLACK; 4000aaec: c0 20 60 0c clr [ %g1 + 0xc ] g->color = RBT_RED; 4000aaf0: b2 10 00 1d mov %i5, %i1 4000aaf4: 82 10 20 01 mov 1, %g1 4000aaf8: 10 80 00 18 b 4000ab58 <_RBTree_Insert_unprotected+0x1b4> 4000aafc: 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]; 4000ab00: 82 1a 00 01 xor %o0, %g1, %g1 4000ab04: 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]; 4000ab08: c2 02 20 04 ld [ %o0 + 4 ], %g1 RBTree_Direction pdir = the_node->parent != g->child[0]; 4000ab0c: 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]; 4000ab10: 82 1e 40 01 xor %i1, %g1, %g1 4000ab14: 80 a0 00 01 cmp %g0, %g1 4000ab18: 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) { 4000ab1c: 80 a0 40 1c cmp %g1, %i4 4000ab20: 22 80 00 08 be,a 4000ab40 <_RBTree_Insert_unprotected+0x19c> 4000ab24: c2 06 40 00 ld [ %i1 ], %g1 _RBTree_Rotate(the_node->parent, pdir); 4000ab28: 7f ff ff 80 call 4000a928 <_RBTree_Rotate> 4000ab2c: 92 10 00 1c mov %i4, %o1 the_node = the_node->child[pdir]; 4000ab30: 83 2f 20 02 sll %i4, 2, %g1 4000ab34: b2 06 40 01 add %i1, %g1, %i1 4000ab38: f2 06 60 04 ld [ %i1 + 4 ], %i1 } the_node->parent->color = RBT_BLACK; 4000ab3c: c2 06 40 00 ld [ %i1 ], %g1 g->color = RBT_RED; 4000ab40: 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; 4000ab44: c0 20 60 0c clr [ %g1 + 0xc ] g->color = RBT_RED; 4000ab48: d2 27 60 0c st %o1, [ %i5 + 0xc ] /* now rotate grandparent in the other branch direction (toward uncle) */ _RBTree_Rotate(g, (1-pdir)); 4000ab4c: 90 10 00 1d mov %i5, %o0 4000ab50: 7f ff ff 76 call 4000a928 <_RBTree_Rotate> 4000ab54: 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; 4000ab58: d0 06 40 00 ld [ %i1 ], %o0 4000ab5c: fa 02 00 00 ld [ %o0 ], %i5 4000ab60: 80 a7 60 00 cmp %i5, 0 4000ab64: 22 80 00 06 be,a 4000ab7c <_RBTree_Insert_unprotected+0x1d8> 4000ab68: 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); 4000ab6c: c2 02 20 0c ld [ %o0 + 0xc ], %g1 4000ab70: 82 18 60 01 xor %g1, 1, %g1 4000ab74: 80 a0 00 01 cmp %g0, %g1 4000ab78: 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))) { 4000ab7c: 80 a0 60 00 cmp %g1, 0 4000ab80: 12 bf ff c3 bne 4000aa8c <_RBTree_Insert_unprotected+0xe8> 4000ab84: 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; 4000ab88: 12 80 00 06 bne 4000aba0 <_RBTree_Insert_unprotected+0x1fc> 4000ab8c: 01 00 00 00 nop 4000ab90: c0 26 60 0c clr [ %i1 + 0xc ] 4000ab94: 81 c7 e0 08 ret 4000ab98: 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; 4000ab9c: b0 10 3f ff mov -1, %i0 /* verify red-black properties */ _RBTree_Validate_insert_unprotected(the_node); } return (RBTree_Node*)0; } 4000aba0: 81 c7 e0 08 ret 4000aba4: 81 e8 00 00 restore =============================================================================== 4000abd8 <_RBTree_Iterate_unprotected>: const RBTree_Control *rbtree, RBTree_Direction dir, RBTree_Visitor visitor, void *visitor_arg ) { 4000abd8: 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; 4000abdc: b8 10 20 00 clr %i4 */ RTEMS_INLINE_ROUTINE RBTree_Direction _RBTree_Opposite_direction( RBTree_Direction the_dir ) { return (RBTree_Direction) !((int) the_dir); 4000abe0: 80 a0 00 19 cmp %g0, %i1 4000abe4: 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]; 4000abe8: 82 00 60 02 add %g1, 2, %g1 4000abec: 83 28 60 02 sll %g1, 2, %g1 while ( !stop && current != NULL ) { 4000abf0: 10 80 00 0a b 4000ac18 <_RBTree_Iterate_unprotected+0x40> 4000abf4: fa 06 00 01 ld [ %i0 + %g1 ], %i5 stop = (*visitor)( current, dir, visitor_arg ); 4000abf8: 92 10 00 19 mov %i1, %o1 4000abfc: 9f c6 80 00 call %i2 4000ac00: 94 10 00 1b mov %i3, %o2 current = _RBTree_Next_unprotected( current, dir ); 4000ac04: 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 ); 4000ac08: b8 10 00 08 mov %o0, %i4 current = _RBTree_Next_unprotected( current, dir ); 4000ac0c: 40 00 00 0b call 4000ac38 <_RBTree_Next_unprotected> 4000ac10: 90 10 00 1d mov %i5, %o0 4000ac14: 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 ) { 4000ac18: 80 a7 60 00 cmp %i5, 0 4000ac1c: 02 80 00 05 be 4000ac30 <_RBTree_Iterate_unprotected+0x58> 4000ac20: b8 1f 20 01 xor %i4, 1, %i4 4000ac24: 80 8f 20 ff btst 0xff, %i4 4000ac28: 12 bf ff f4 bne 4000abf8 <_RBTree_Iterate_unprotected+0x20><== ALWAYS TAKEN 4000ac2c: 90 10 00 1d mov %i5, %o0 4000ac30: 81 c7 e0 08 ret 4000ac34: 81 e8 00 00 restore =============================================================================== 4000a540 <_RBTree_Rotate>: RBTree_Node *the_node, RBTree_Direction dir ) { RBTree_Node *c; if (the_node == NULL) return; 4000a540: 80 a2 20 00 cmp %o0, 0 4000a544: 02 80 00 1c be 4000a5b4 <_RBTree_Rotate+0x74> <== NEVER TAKEN 4000a548: 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); 4000a54c: 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; 4000a550: 87 28 e0 02 sll %g3, 2, %g3 4000a554: 86 02 00 03 add %o0, %g3, %g3 4000a558: c2 00 e0 04 ld [ %g3 + 4 ], %g1 4000a55c: 80 a0 60 00 cmp %g1, 0 4000a560: 02 80 00 15 be 4000a5b4 <_RBTree_Rotate+0x74> <== NEVER TAKEN 4000a564: 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]; 4000a568: 84 00 40 09 add %g1, %o1, %g2 4000a56c: c8 00 a0 04 ld [ %g2 + 4 ], %g4 4000a570: c8 20 e0 04 st %g4, [ %g3 + 4 ] if (c->child[dir]) 4000a574: c4 00 a0 04 ld [ %g2 + 4 ], %g2 4000a578: 80 a0 a0 00 cmp %g2, 0 4000a57c: 32 80 00 02 bne,a 4000a584 <_RBTree_Rotate+0x44> 4000a580: 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; 4000a584: 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; 4000a588: 92 00 40 09 add %g1, %o1, %o1 4000a58c: d0 22 60 04 st %o0, [ %o1 + 4 ] the_node->parent->child[the_node != the_node->parent->child[0]] = c; 4000a590: c6 00 a0 04 ld [ %g2 + 4 ], %g3 c->parent = the_node->parent; 4000a594: 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; 4000a598: 86 1a 00 03 xor %o0, %g3, %g3 c->parent = the_node->parent; the_node->parent = c; 4000a59c: 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; 4000a5a0: 80 a0 00 03 cmp %g0, %g3 4000a5a4: 86 40 20 00 addx %g0, 0, %g3 4000a5a8: 87 28 e0 02 sll %g3, 2, %g3 4000a5ac: 86 00 80 03 add %g2, %g3, %g3 4000a5b0: c2 20 e0 04 st %g1, [ %g3 + 4 ] 4000a5b4: 81 c3 e0 08 retl =============================================================================== 4000a4f0 <_RBTree_Sibling>: */ RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_Sibling( const RBTree_Node *the_node ) { if(!the_node) return NULL; 4000a4f0: 80 a2 20 00 cmp %o0, 0 4000a4f4: 02 80 00 10 be 4000a534 <_RBTree_Sibling+0x44> <== NEVER TAKEN 4000a4f8: 82 10 20 00 clr %g1 if(!(the_node->parent)) return NULL; 4000a4fc: c4 02 00 00 ld [ %o0 ], %g2 4000a500: 80 a0 a0 00 cmp %g2, 0 4000a504: 22 80 00 0d be,a 4000a538 <_RBTree_Sibling+0x48> <== NEVER TAKEN 4000a508: 90 10 00 01 mov %g1, %o0 <== NOT EXECUTED if(!(the_node->parent->parent)) return NULL; 4000a50c: c2 00 80 00 ld [ %g2 ], %g1 4000a510: 80 a0 60 00 cmp %g1, 0 4000a514: 02 80 00 08 be 4000a534 <_RBTree_Sibling+0x44> 4000a518: 82 10 20 00 clr %g1 if(the_node == the_node->parent->child[RBT_LEFT]) 4000a51c: c2 00 a0 04 ld [ %g2 + 4 ], %g1 4000a520: 80 a2 00 01 cmp %o0, %g1 4000a524: 22 80 00 04 be,a 4000a534 <_RBTree_Sibling+0x44> 4000a528: c2 00 a0 08 ld [ %g2 + 8 ], %g1 return the_node->parent->child[RBT_RIGHT]; 4000a52c: 81 c3 e0 08 retl 4000a530: 90 10 00 01 mov %g1, %o0 else return the_node->parent->child[RBT_LEFT]; } 4000a534: 90 10 00 01 mov %g1, %o0 4000a538: 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 =============================================================================== 40033688 <_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 ) { 40033688: 9d e3 bf 98 save %sp, -104, %sp */ static inline void _TOD_Get_uptime( Timestamp_Control *time ) { _TOD_Get_with_nanoseconds( time, &_TOD.uptime ); 4003368c: 13 10 01 90 sethi %hi(0x40064000), %o1 #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ Timestamp_Control uptime; #endif Thread_Control *owning_thread = the_period->owner; 40033690: f6 06 20 40 ld [ %i0 + 0x40 ], %i3 40033694: 90 07 bf f8 add %fp, -8, %o0 40033698: 7f ff 54 a7 call 40008934 <_TOD_Get_with_nanoseconds> 4003369c: 92 12 63 80 or %o1, 0x380, %o1 /* * Determine elapsed wall time since period initiated. */ #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ _TOD_Get_uptime( &uptime ); _Timestamp_Subtract( 400336a0: c4 1f bf f8 ldd [ %fp + -8 ], %g2 const Timestamp64_Control *_start, const Timestamp64_Control *_end, Timestamp64_Control *_result ) { *_result = *_end - *_start; 400336a4: 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) { 400336a8: 09 10 01 92 sethi %hi(0x40064800), %g4 400336ac: ba a0 c0 1d subcc %g3, %i5, %i5 400336b0: 88 11 21 40 or %g4, 0x140, %g4 400336b4: b8 60 80 1c subx %g2, %i4, %i4 400336b8: f8 3e 40 00 std %i4, [ %i1 ] 400336bc: fa 01 20 10 ld [ %g4 + 0x10 ], %i5 #endif /* * Determine cpu usage since period initiated. */ used = owning_thread->cpu_time_used; 400336c0: d8 1e e0 80 ldd [ %i3 + 0x80 ], %o4 #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ if (owning_thread == _Thread_Executing) { 400336c4: 80 a6 c0 1d cmp %i3, %i5 400336c8: 12 80 00 15 bne 4003371c <_Rate_monotonic_Get_status+0x94> 400336cc: 82 10 20 01 mov 1, %g1 400336d0: f8 19 20 20 ldd [ %g4 + 0x20 ], %i4 400336d4: 86 a0 c0 1d subcc %g3, %i5, %g3 400336d8: 84 60 80 1c subx %g2, %i4, %g2 static inline void _Timestamp64_implementation_Add_to( Timestamp64_Control *_time, const Timestamp64_Control *_add ) { *_time += *_add; 400336dc: ba 83 40 03 addcc %o5, %g3, %i5 400336e0: b8 43 00 02 addx %o4, %g2, %i4 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 400336e4: 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)) 400336e8: 80 a0 80 1c cmp %g2, %i4 400336ec: 34 80 00 0c bg,a 4003371c <_Rate_monotonic_Get_status+0x94><== NEVER TAKEN 400336f0: 82 10 20 00 clr %g1 <== NOT EXECUTED 400336f4: 32 80 00 06 bne,a 4003370c <_Rate_monotonic_Get_status+0x84> 400336f8: 86 a7 40 03 subcc %i5, %g3, %g3 400336fc: 80 a0 c0 1d cmp %g3, %i5 40033700: 18 80 00 06 bgu 40033718 <_Rate_monotonic_Get_status+0x90> 40033704: 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; 40033708: 82 10 20 01 mov 1, %g1 const Timestamp64_Control *_start, const Timestamp64_Control *_end, Timestamp64_Control *_result ) { *_result = *_end - *_start; 4003370c: 84 67 00 02 subx %i4, %g2, %g2 40033710: 10 80 00 03 b 4003371c <_Rate_monotonic_Get_status+0x94> 40033714: 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; 40033718: 82 10 20 00 clr %g1 return false; *cpu_since_last_period = used - the_period->cpu_usage_period_initiated; #endif return true; } 4003371c: b0 08 60 01 and %g1, 1, %i0 40033720: 81 c7 e0 08 ret 40033724: 81 e8 00 00 restore =============================================================================== 40033a90 <_Rate_monotonic_Timeout>: void _Rate_monotonic_Timeout( Objects_Id id, void *ignored ) { 40033a90: 9d e3 bf 98 save %sp, -104, %sp 40033a94: 11 10 01 93 sethi %hi(0x40064c00), %o0 40033a98: 92 10 00 18 mov %i0, %o1 40033a9c: 90 12 23 08 or %o0, 0x308, %o0 40033aa0: 7f ff 56 4c call 400093d0 <_Objects_Get> 40033aa4: 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 ) { 40033aa8: c2 07 bf fc ld [ %fp + -4 ], %g1 40033aac: 80 a0 60 00 cmp %g1, 0 40033ab0: 12 80 00 24 bne 40033b40 <_Rate_monotonic_Timeout+0xb0> <== NEVER TAKEN 40033ab4: ba 10 00 08 mov %o0, %i5 case OBJECTS_LOCAL: the_thread = the_period->owner; 40033ab8: d0 02 20 40 ld [ %o0 + 0x40 ], %o0 if ( _States_Is_waiting_for_period( the_thread->current_state ) && 40033abc: 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); 40033ac0: c4 02 20 10 ld [ %o0 + 0x10 ], %g2 40033ac4: 80 88 80 01 btst %g2, %g1 40033ac8: 22 80 00 0b be,a 40033af4 <_Rate_monotonic_Timeout+0x64> 40033acc: c2 07 60 38 ld [ %i5 + 0x38 ], %g1 40033ad0: c4 02 20 20 ld [ %o0 + 0x20 ], %g2 40033ad4: c2 07 60 08 ld [ %i5 + 8 ], %g1 40033ad8: 80 a0 80 01 cmp %g2, %g1 40033adc: 32 80 00 06 bne,a 40033af4 <_Rate_monotonic_Timeout+0x64> 40033ae0: 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 ); 40033ae4: 13 04 01 ff sethi %hi(0x1007fc00), %o1 40033ae8: 7f ff 58 e5 call 40009e7c <_Thread_Clear_state> 40033aec: 92 12 63 f8 or %o1, 0x3f8, %o1 ! 1007fff8 40033af0: 30 80 00 06 b,a 40033b08 <_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 ) { 40033af4: 80 a0 60 01 cmp %g1, 1 40033af8: 12 80 00 0d bne 40033b2c <_Rate_monotonic_Timeout+0x9c> 40033afc: 82 10 20 04 mov 4, %g1 the_period->state = RATE_MONOTONIC_EXPIRED_WHILE_BLOCKING; 40033b00: 82 10 20 03 mov 3, %g1 40033b04: c2 27 60 38 st %g1, [ %i5 + 0x38 ] _Rate_monotonic_Initiate_statistics( the_period ); 40033b08: 7f ff ff 51 call 4003384c <_Rate_monotonic_Initiate_statistics> 40033b0c: 90 10 00 1d mov %i5, %o0 Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 40033b10: c2 07 60 3c ld [ %i5 + 0x3c ], %g1 _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 40033b14: 11 10 01 91 sethi %hi(0x40064400), %o0 Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 40033b18: c2 27 60 1c st %g1, [ %i5 + 0x1c ] _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 40033b1c: 90 12 20 c8 or %o0, 0xc8, %o0 40033b20: 7f ff 5c bc call 4000ae10 <_Watchdog_Insert> 40033b24: 92 07 60 10 add %i5, 0x10, %o1 40033b28: 30 80 00 02 b,a 40033b30 <_Rate_monotonic_Timeout+0xa0> _Watchdog_Insert_ticks( &the_period->Timer, the_period->next_length ); } else the_period->state = RATE_MONOTONIC_EXPIRED; 40033b2c: 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; 40033b30: 03 10 01 91 sethi %hi(0x40064400), %g1 40033b34: c4 00 60 30 ld [ %g1 + 0x30 ], %g2 ! 40064430 <_Thread_Dispatch_disable_level> --level; 40033b38: 84 00 bf ff add %g2, -1, %g2 _Thread_Dispatch_disable_level = level; 40033b3c: c4 20 60 30 st %g2, [ %g1 + 0x30 ] 40033b40: 81 c7 e0 08 ret 40033b44: 81 e8 00 00 restore =============================================================================== 40033728 <_Rate_monotonic_Update_statistics>: } static void _Rate_monotonic_Update_statistics( Rate_monotonic_Control *the_period ) { 40033728: 9d e3 bf 90 save %sp, -112, %sp /* * Update the counts. */ stats = &the_period->Statistics; stats->count++; 4003372c: c2 06 20 58 ld [ %i0 + 0x58 ], %g1 40033730: 82 00 60 01 inc %g1 40033734: c2 26 20 58 st %g1, [ %i0 + 0x58 ] if ( the_period->state == RATE_MONOTONIC_EXPIRED ) 40033738: c2 06 20 38 ld [ %i0 + 0x38 ], %g1 4003373c: 80 a0 60 04 cmp %g1, 4 40033740: 12 80 00 05 bne 40033754 <_Rate_monotonic_Update_statistics+0x2c> 40033744: 90 10 00 18 mov %i0, %o0 stats->missed_count++; 40033748: c2 06 20 5c ld [ %i0 + 0x5c ], %g1 4003374c: 82 00 60 01 inc %g1 40033750: c2 26 20 5c st %g1, [ %i0 + 0x5c ] /* * Grab status for time statistics. */ valid_status = 40033754: 92 07 bf f8 add %fp, -8, %o1 40033758: 7f ff ff cc call 40033688 <_Rate_monotonic_Get_status> 4003375c: 94 07 bf f0 add %fp, -16, %o2 _Rate_monotonic_Get_status( the_period, &since_last_period, &executed ); if (!valid_status) 40033760: 80 8a 20 ff btst 0xff, %o0 40033764: 02 80 00 38 be 40033844 <_Rate_monotonic_Update_statistics+0x11c> 40033768: c4 1f bf f0 ldd [ %fp + -16 ], %g2 static inline void _Timestamp64_implementation_Add_to( Timestamp64_Control *_time, const Timestamp64_Control *_add ) { *_time += *_add; 4003376c: 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 ) ) 40033770: c2 06 20 60 ld [ %i0 + 0x60 ], %g1 40033774: b6 87 40 03 addcc %i5, %g3, %i3 40033778: b4 47 00 02 addx %i4, %g2, %i2 4003377c: 80 a0 40 02 cmp %g1, %g2 40033780: 14 80 00 09 bg 400337a4 <_Rate_monotonic_Update_statistics+0x7c> 40033784: f4 3e 20 70 std %i2, [ %i0 + 0x70 ] 40033788: 80 a0 40 02 cmp %g1, %g2 4003378c: 32 80 00 08 bne,a 400337ac <_Rate_monotonic_Update_statistics+0x84><== NEVER TAKEN 40033790: c2 06 20 68 ld [ %i0 + 0x68 ], %g1 <== NOT EXECUTED 40033794: c2 06 20 64 ld [ %i0 + 0x64 ], %g1 40033798: 80 a0 40 03 cmp %g1, %g3 4003379c: 28 80 00 04 bleu,a 400337ac <_Rate_monotonic_Update_statistics+0x84> 400337a0: c2 06 20 68 ld [ %i0 + 0x68 ], %g1 stats->min_cpu_time = executed; 400337a4: c4 3e 20 60 std %g2, [ %i0 + 0x60 ] if ( _Timestamp_Greater_than( &executed, &stats->max_cpu_time ) ) 400337a8: c2 06 20 68 ld [ %i0 + 0x68 ], %g1 400337ac: 80 a0 40 02 cmp %g1, %g2 400337b0: 26 80 00 0a bl,a 400337d8 <_Rate_monotonic_Update_statistics+0xb0><== NEVER TAKEN 400337b4: c4 3e 20 68 std %g2, [ %i0 + 0x68 ] <== NOT EXECUTED 400337b8: 80 a0 40 02 cmp %g1, %g2 400337bc: 32 80 00 08 bne,a 400337dc <_Rate_monotonic_Update_statistics+0xb4><== NEVER TAKEN 400337c0: c4 1f bf f8 ldd [ %fp + -8 ], %g2 <== NOT EXECUTED 400337c4: c2 06 20 6c ld [ %i0 + 0x6c ], %g1 400337c8: 80 a0 40 03 cmp %g1, %g3 400337cc: 3a 80 00 04 bcc,a 400337dc <_Rate_monotonic_Update_statistics+0xb4> 400337d0: c4 1f bf f8 ldd [ %fp + -8 ], %g2 stats->max_cpu_time = executed; 400337d4: 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 ); 400337d8: c4 1f bf f8 ldd [ %fp + -8 ], %g2 400337dc: f8 1e 20 88 ldd [ %i0 + 0x88 ], %i4 if ( _Timestamp_Less_than( &since_last_period, &stats->min_wall_time ) ) 400337e0: c2 06 20 78 ld [ %i0 + 0x78 ], %g1 400337e4: b6 87 40 03 addcc %i5, %g3, %i3 400337e8: b4 47 00 02 addx %i4, %g2, %i2 400337ec: 80 a0 40 02 cmp %g1, %g2 400337f0: 14 80 00 09 bg 40033814 <_Rate_monotonic_Update_statistics+0xec> 400337f4: f4 3e 20 88 std %i2, [ %i0 + 0x88 ] 400337f8: 80 a0 40 02 cmp %g1, %g2 400337fc: 32 80 00 08 bne,a 4003381c <_Rate_monotonic_Update_statistics+0xf4><== NEVER TAKEN 40033800: c2 06 20 80 ld [ %i0 + 0x80 ], %g1 <== NOT EXECUTED 40033804: c2 06 20 7c ld [ %i0 + 0x7c ], %g1 40033808: 80 a0 40 03 cmp %g1, %g3 4003380c: 28 80 00 04 bleu,a 4003381c <_Rate_monotonic_Update_statistics+0xf4> 40033810: c2 06 20 80 ld [ %i0 + 0x80 ], %g1 stats->min_wall_time = since_last_period; 40033814: c4 3e 20 78 std %g2, [ %i0 + 0x78 ] if ( _Timestamp_Greater_than( &since_last_period, &stats->max_wall_time ) ) 40033818: c2 06 20 80 ld [ %i0 + 0x80 ], %g1 4003381c: 80 a0 40 02 cmp %g1, %g2 40033820: 26 80 00 09 bl,a 40033844 <_Rate_monotonic_Update_statistics+0x11c><== NEVER TAKEN 40033824: c4 3e 20 80 std %g2, [ %i0 + 0x80 ] <== NOT EXECUTED 40033828: 80 a0 40 02 cmp %g1, %g2 4003382c: 12 80 00 06 bne 40033844 <_Rate_monotonic_Update_statistics+0x11c><== NEVER TAKEN 40033830: 01 00 00 00 nop 40033834: c2 06 20 84 ld [ %i0 + 0x84 ], %g1 40033838: 80 a0 40 03 cmp %g1, %g3 4003383c: 2a 80 00 02 bcs,a 40033844 <_Rate_monotonic_Update_statistics+0x11c> 40033840: c4 3e 20 80 std %g2, [ %i0 + 0x80 ] 40033844: 81 c7 e0 08 ret 40033848: 81 e8 00 00 restore =============================================================================== 4000a8a0 <_Scheduler_CBS_Allocate>: #include void *_Scheduler_CBS_Allocate( Thread_Control *the_thread ) { 4000a8a0: 9d e3 bf a0 save %sp, -96, %sp void *sched; Scheduler_CBS_Per_thread *schinfo; sched = _Workspace_Allocate(sizeof(Scheduler_CBS_Per_thread)); 4000a8a4: 40 00 06 8d call 4000c2d8 <_Workspace_Allocate> 4000a8a8: 90 10 20 1c mov 0x1c, %o0 if ( sched ) { 4000a8ac: 80 a2 20 00 cmp %o0, 0 4000a8b0: 02 80 00 06 be 4000a8c8 <_Scheduler_CBS_Allocate+0x28> <== NEVER TAKEN 4000a8b4: 82 10 20 02 mov 2, %g1 the_thread->scheduler_info = sched; 4000a8b8: d0 26 20 88 st %o0, [ %i0 + 0x88 ] schinfo = (Scheduler_CBS_Per_thread *)(the_thread->scheduler_info); schinfo->edf_per_thread.thread = the_thread; 4000a8bc: f0 22 00 00 st %i0, [ %o0 ] schinfo->edf_per_thread.queue_state = SCHEDULER_EDF_QUEUE_STATE_NEVER_HAS_BEEN; 4000a8c0: c2 22 20 14 st %g1, [ %o0 + 0x14 ] schinfo->cbs_server = NULL; 4000a8c4: c0 22 20 18 clr [ %o0 + 0x18 ] } return sched; } 4000a8c8: 81 c7 e0 08 ret 4000a8cc: 91 e8 00 08 restore %g0, %o0, %o0 =============================================================================== 4000bbe0 <_Scheduler_CBS_Budget_callout>: Scheduler_CBS_Server **_Scheduler_CBS_Server_list; void _Scheduler_CBS_Budget_callout( Thread_Control *the_thread ) { 4000bbe0: 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; 4000bbe4: d2 06 20 ac ld [ %i0 + 0xac ], %o1 if ( the_thread->real_priority != new_priority ) 4000bbe8: c2 06 20 18 ld [ %i0 + 0x18 ], %g1 4000bbec: 80 a0 40 09 cmp %g1, %o1 4000bbf0: 32 80 00 02 bne,a 4000bbf8 <_Scheduler_CBS_Budget_callout+0x18><== ALWAYS TAKEN 4000bbf4: d2 26 20 18 st %o1, [ %i0 + 0x18 ] the_thread->real_priority = new_priority; if ( the_thread->current_priority != new_priority ) 4000bbf8: c2 06 20 14 ld [ %i0 + 0x14 ], %g1 4000bbfc: 80 a0 40 09 cmp %g1, %o1 4000bc00: 02 80 00 04 be 4000bc10 <_Scheduler_CBS_Budget_callout+0x30><== NEVER TAKEN 4000bc04: 90 10 00 18 mov %i0, %o0 _Thread_Change_priority(the_thread, new_priority, true); 4000bc08: 40 00 01 83 call 4000c214 <_Thread_Change_priority> 4000bc0c: 94 10 20 01 mov 1, %o2 /* Invoke callback function if any. */ sched_info = (Scheduler_CBS_Per_thread *) the_thread->scheduler_info; 4000bc10: fa 06 20 88 ld [ %i0 + 0x88 ], %i5 if ( sched_info->cbs_server->cbs_budget_overrun ) { 4000bc14: c2 07 60 18 ld [ %i5 + 0x18 ], %g1 4000bc18: c4 00 60 0c ld [ %g1 + 0xc ], %g2 4000bc1c: 80 a0 a0 00 cmp %g2, 0 4000bc20: 02 80 00 09 be 4000bc44 <_Scheduler_CBS_Budget_callout+0x64><== NEVER TAKEN 4000bc24: 01 00 00 00 nop _Scheduler_CBS_Get_server_id( 4000bc28: d0 00 40 00 ld [ %g1 ], %o0 4000bc2c: 7f ff ff d7 call 4000bb88 <_Scheduler_CBS_Get_server_id> 4000bc30: 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 ); 4000bc34: c2 07 60 18 ld [ %i5 + 0x18 ], %g1 4000bc38: c2 00 60 0c ld [ %g1 + 0xc ], %g1 4000bc3c: 9f c0 40 00 call %g1 4000bc40: d0 07 bf fc ld [ %fp + -4 ], %o0 4000bc44: 81 c7 e0 08 ret 4000bc48: 81 e8 00 00 restore =============================================================================== 4000b7e8 <_Scheduler_CBS_Create_server>: int _Scheduler_CBS_Create_server ( Scheduler_CBS_Parameters *params, Scheduler_CBS_Budget_overrun budget_overrun_callback, rtems_id *server_id ) { 4000b7e8: 9d e3 bf a0 save %sp, -96, %sp unsigned int i; Scheduler_CBS_Server *the_server; if ( params->budget <= 0 || 4000b7ec: c2 06 20 04 ld [ %i0 + 4 ], %g1 4000b7f0: 80 a0 60 00 cmp %g1, 0 4000b7f4: 04 80 00 1d ble 4000b868 <_Scheduler_CBS_Create_server+0x80> 4000b7f8: 01 00 00 00 nop 4000b7fc: c2 06 00 00 ld [ %i0 ], %g1 4000b800: 80 a0 60 00 cmp %g1, 0 4000b804: 04 80 00 19 ble 4000b868 <_Scheduler_CBS_Create_server+0x80> 4000b808: 03 10 00 87 sethi %hi(0x40021c00), %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++ ) { 4000b80c: c4 00 62 00 ld [ %g1 + 0x200 ], %g2 ! 40021e00 <_Scheduler_CBS_Maximum_servers> if ( !_Scheduler_CBS_Server_list[i] ) 4000b810: 03 10 00 8c sethi %hi(0x40023000), %g1 4000b814: c6 00 61 08 ld [ %g1 + 0x108 ], %g3 ! 40023108 <_Scheduler_CBS_Server_list> 4000b818: 10 80 00 07 b 4000b834 <_Scheduler_CBS_Create_server+0x4c> 4000b81c: 82 10 20 00 clr %g1 4000b820: c8 00 c0 1c ld [ %g3 + %i4 ], %g4 4000b824: 80 a1 20 00 cmp %g4, 0 4000b828: 02 80 00 14 be 4000b878 <_Scheduler_CBS_Create_server+0x90> 4000b82c: 3b 10 00 8c sethi %hi(0x40023000), %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++ ) { 4000b830: 82 00 60 01 inc %g1 4000b834: 80 a0 40 02 cmp %g1, %g2 4000b838: 12 bf ff fa bne 4000b820 <_Scheduler_CBS_Create_server+0x38> 4000b83c: 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; 4000b840: 81 c7 e0 08 ret 4000b844: 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; 4000b848: c4 20 60 04 st %g2, [ %g1 + 4 ] 4000b84c: c4 06 20 04 ld [ %i0 + 4 ], %g2 the_server->task_id = -1; the_server->cbs_budget_overrun = budget_overrun_callback; 4000b850: 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; 4000b854: c4 20 60 08 st %g2, [ %g1 + 8 ] the_server->task_id = -1; 4000b858: 84 10 3f ff mov -1, %g2 4000b85c: c4 20 40 00 st %g2, [ %g1 ] the_server->cbs_budget_overrun = budget_overrun_callback; return SCHEDULER_CBS_OK; 4000b860: 81 c7 e0 08 ret 4000b864: 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; 4000b868: 81 c7 e0 08 ret 4000b86c: 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; 4000b870: 81 c7 e0 08 ret <== NOT EXECUTED 4000b874: 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 *) 4000b878: f6 07 61 08 ld [ %i5 + 0x108 ], %i3 } if ( i == _Scheduler_CBS_Maximum_servers ) return SCHEDULER_CBS_ERROR_FULL; *server_id = i; 4000b87c: c2 26 80 00 st %g1, [ %i2 ] _Scheduler_CBS_Server_list[*server_id] = (Scheduler_CBS_Server *) _Workspace_Allocate( sizeof(Scheduler_CBS_Server) ); 4000b880: 40 00 07 7f call 4000d67c <_Workspace_Allocate> 4000b884: 90 10 20 10 mov 0x10, %o0 the_server = _Scheduler_CBS_Server_list[*server_id]; 4000b888: 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 *) 4000b88c: d0 26 c0 1c st %o0, [ %i3 + %i4 ] _Workspace_Allocate( sizeof(Scheduler_CBS_Server) ); the_server = _Scheduler_CBS_Server_list[*server_id]; 4000b890: c4 07 61 08 ld [ %i5 + 0x108 ], %g2 4000b894: 83 28 60 02 sll %g1, 2, %g1 4000b898: c2 00 80 01 ld [ %g2 + %g1 ], %g1 if ( !the_server ) 4000b89c: 80 a0 60 00 cmp %g1, 0 4000b8a0: 32 bf ff ea bne,a 4000b848 <_Scheduler_CBS_Create_server+0x60><== ALWAYS TAKEN 4000b8a4: c4 06 00 00 ld [ %i0 ], %g2 4000b8a8: 30 bf ff f2 b,a 4000b870 <_Scheduler_CBS_Create_server+0x88><== NOT EXECUTED =============================================================================== 4000b920 <_Scheduler_CBS_Detach_thread>: int _Scheduler_CBS_Detach_thread ( Scheduler_CBS_Server_id server_id, rtems_id task_id ) { 4000b920: 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); 4000b924: 90 10 00 19 mov %i1, %o0 4000b928: 40 00 03 61 call 4000c6ac <_Thread_Get> 4000b92c: 92 07 bf fc add %fp, -4, %o1 /* The routine _Thread_Get may disable dispatch and not enable again. */ if ( the_thread ) { 4000b930: ba 92 20 00 orcc %o0, 0, %i5 4000b934: 02 80 00 05 be 4000b948 <_Scheduler_CBS_Detach_thread+0x28> 4000b938: 03 10 00 87 sethi %hi(0x40021c00), %g1 _Thread_Enable_dispatch(); 4000b93c: 40 00 03 50 call 4000c67c <_Thread_Enable_dispatch> 4000b940: 01 00 00 00 nop } if ( server_id >= _Scheduler_CBS_Maximum_servers ) 4000b944: 03 10 00 87 sethi %hi(0x40021c00), %g1 4000b948: c2 00 62 00 ld [ %g1 + 0x200 ], %g1 ! 40021e00 <_Scheduler_CBS_Maximum_servers> 4000b94c: 80 a6 00 01 cmp %i0, %g1 4000b950: 1a 80 00 1b bcc 4000b9bc <_Scheduler_CBS_Detach_thread+0x9c> 4000b954: 80 a7 60 00 cmp %i5, 0 return SCHEDULER_CBS_ERROR_INVALID_PARAMETER; if ( !the_thread ) 4000b958: 02 80 00 19 be 4000b9bc <_Scheduler_CBS_Detach_thread+0x9c> 4000b95c: 03 10 00 8c sethi %hi(0x40023000), %g1 return SCHEDULER_CBS_ERROR_INVALID_PARAMETER; /* Server is not valid. */ if ( !_Scheduler_CBS_Server_list[server_id] ) 4000b960: c2 00 61 08 ld [ %g1 + 0x108 ], %g1 ! 40023108 <_Scheduler_CBS_Server_list> 4000b964: b1 2e 20 02 sll %i0, 2, %i0 4000b968: c2 00 40 18 ld [ %g1 + %i0 ], %g1 4000b96c: 80 a0 60 00 cmp %g1, 0 4000b970: 02 80 00 11 be 4000b9b4 <_Scheduler_CBS_Detach_thread+0x94> 4000b974: 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 ) 4000b978: c4 00 40 00 ld [ %g1 ], %g2 4000b97c: 80 a0 80 19 cmp %g2, %i1 4000b980: 12 80 00 0f bne 4000b9bc <_Scheduler_CBS_Detach_thread+0x9c><== NEVER TAKEN 4000b984: 84 10 3f ff mov -1, %g2 return SCHEDULER_CBS_ERROR_INVALID_PARAMETER; _Scheduler_CBS_Server_list[server_id]->task_id = -1; 4000b988: c4 20 40 00 st %g2, [ %g1 ] sched_info = (Scheduler_CBS_Per_thread *) the_thread->scheduler_info; sched_info->cbs_server = NULL; 4000b98c: c2 07 60 88 ld [ %i5 + 0x88 ], %g1 4000b990: c0 20 60 18 clr [ %g1 + 0x18 ] the_thread->budget_algorithm = the_thread->Start.budget_algorithm; 4000b994: c2 07 60 a0 ld [ %i5 + 0xa0 ], %g1 4000b998: c2 27 60 78 st %g1, [ %i5 + 0x78 ] the_thread->budget_callout = the_thread->Start.budget_callout; 4000b99c: c2 07 60 a4 ld [ %i5 + 0xa4 ], %g1 4000b9a0: c2 27 60 7c st %g1, [ %i5 + 0x7c ] the_thread->is_preemptible = the_thread->Start.is_preemptible; 4000b9a4: c2 0f 60 9c ldub [ %i5 + 0x9c ], %g1 4000b9a8: c2 2f 60 70 stb %g1, [ %i5 + 0x70 ] return SCHEDULER_CBS_OK; 4000b9ac: 81 c7 e0 08 ret 4000b9b0: 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; 4000b9b4: 81 c7 e0 08 ret 4000b9b8: 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; } 4000b9bc: 81 c7 e0 08 ret 4000b9c0: 91 e8 3f ee restore %g0, -18, %o0 =============================================================================== 4000bc4c <_Scheduler_CBS_Initialize>: } } int _Scheduler_CBS_Initialize(void) { 4000bc4c: 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*) ); 4000bc50: 3b 10 00 87 sethi %hi(0x40021c00), %i5 4000bc54: d0 07 62 00 ld [ %i5 + 0x200 ], %o0 ! 40021e00 <_Scheduler_CBS_Maximum_servers> } int _Scheduler_CBS_Initialize(void) { unsigned int i; _Scheduler_CBS_Server_list = (Scheduler_CBS_Server **) _Workspace_Allocate( 4000bc58: 40 00 06 89 call 4000d67c <_Workspace_Allocate> 4000bc5c: 91 2a 20 02 sll %o0, 2, %o0 4000bc60: 05 10 00 8c sethi %hi(0x40023000), %g2 _Scheduler_CBS_Maximum_servers * sizeof(Scheduler_CBS_Server*) ); if ( !_Scheduler_CBS_Server_list ) 4000bc64: 80 a2 20 00 cmp %o0, 0 4000bc68: 02 80 00 0d be 4000bc9c <_Scheduler_CBS_Initialize+0x50> <== NEVER TAKEN 4000bc6c: d0 20 a1 08 st %o0, [ %g2 + 0x108 ] return SCHEDULER_CBS_ERROR_NO_MEMORY; for (i = 0; i<_Scheduler_CBS_Maximum_servers; i++) { 4000bc70: c6 07 62 00 ld [ %i5 + 0x200 ], %g3 4000bc74: 10 80 00 05 b 4000bc88 <_Scheduler_CBS_Initialize+0x3c> 4000bc78: 82 10 20 00 clr %g1 _Scheduler_CBS_Server_list[i] = NULL; 4000bc7c: 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++) { 4000bc80: 82 00 60 01 inc %g1 _Scheduler_CBS_Server_list[i] = NULL; 4000bc84: 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++) { 4000bc88: 80 a0 40 03 cmp %g1, %g3 4000bc8c: 12 bf ff fc bne 4000bc7c <_Scheduler_CBS_Initialize+0x30> 4000bc90: fa 00 a1 08 ld [ %g2 + 0x108 ], %i5 _Scheduler_CBS_Server_list[i] = NULL; } return SCHEDULER_CBS_OK; 4000bc94: 81 c7 e0 08 ret 4000bc98: 91 e8 20 00 restore %g0, 0, %o0 } 4000bc9c: 81 c7 e0 08 ret <== NOT EXECUTED 4000bca0: 91 e8 3f ef restore %g0, -17, %o0 <== NOT EXECUTED =============================================================================== 4000a8d0 <_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; 4000a8d0: c2 02 20 88 ld [ %o0 + 0x88 ], %g1 if (deadline) { 4000a8d4: 80 a2 60 00 cmp %o1, 0 4000a8d8: 02 80 00 10 be 4000a918 <_Scheduler_CBS_Release_job+0x48> 4000a8dc: c2 00 60 18 ld [ %g1 + 0x18 ], %g1 /* Initializing or shifting deadline. */ if (serv_info) 4000a8e0: 80 a0 60 00 cmp %g1, 0 4000a8e4: 02 80 00 08 be 4000a904 <_Scheduler_CBS_Release_job+0x34> 4000a8e8: 05 10 00 84 sethi %hi(0x40021000), %g2 new_priority = (_Watchdog_Ticks_since_boot + serv_info->parameters.deadline) 4000a8ec: d2 00 a1 68 ld [ %g2 + 0x168 ], %o1 ! 40021168 <_Watchdog_Ticks_since_boot> 4000a8f0: c4 00 60 04 ld [ %g1 + 4 ], %g2 4000a8f4: 92 02 40 02 add %o1, %g2, %o1 4000a8f8: 05 20 00 00 sethi %hi(0x80000000), %g2 4000a8fc: 10 80 00 0a b 4000a924 <_Scheduler_CBS_Release_job+0x54> 4000a900: 92 2a 40 02 andn %o1, %g2, %o1 & ~SCHEDULER_EDF_PRIO_MSB; else new_priority = (_Watchdog_Ticks_since_boot + deadline) 4000a904: c2 00 a1 68 ld [ %g2 + 0x168 ], %g1 4000a908: 92 02 40 01 add %o1, %g1, %o1 4000a90c: 03 20 00 00 sethi %hi(0x80000000), %g1 4000a910: 10 80 00 07 b 4000a92c <_Scheduler_CBS_Release_job+0x5c> 4000a914: 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) 4000a918: 80 a0 60 00 cmp %g1, 0 4000a91c: 02 80 00 04 be 4000a92c <_Scheduler_CBS_Release_job+0x5c> <== NEVER TAKEN 4000a920: d2 02 20 ac ld [ %o0 + 0xac ], %o1 the_thread->cpu_time_budget = serv_info->parameters.budget; 4000a924: c2 00 60 08 ld [ %g1 + 8 ], %g1 4000a928: c2 22 20 74 st %g1, [ %o0 + 0x74 ] the_thread->real_priority = new_priority; 4000a92c: d2 22 20 18 st %o1, [ %o0 + 0x18 ] _Thread_Change_priority(the_thread, new_priority, true); 4000a930: 94 10 20 01 mov 1, %o2 4000a934: 82 13 c0 00 mov %o7, %g1 4000a938: 40 00 01 26 call 4000add0 <_Thread_Change_priority> 4000a93c: 9e 10 40 00 mov %g1, %o7 =============================================================================== 4000a940 <_Scheduler_CBS_Unblock>: #include void _Scheduler_CBS_Unblock( Thread_Control *the_thread ) { 4000a940: 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); 4000a944: 40 00 00 4c call 4000aa74 <_Scheduler_EDF_Enqueue> 4000a948: 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; 4000a94c: c2 06 20 88 ld [ %i0 + 0x88 ], %g1 4000a950: 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) { 4000a954: 80 a7 60 00 cmp %i5, 0 4000a958: 02 80 00 18 be 4000a9b8 <_Scheduler_CBS_Unblock+0x78> 4000a95c: 03 10 00 84 sethi %hi(0x40021000), %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 ) { 4000a960: 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 - 4000a964: d0 00 61 68 ld [ %g1 + 0x168 ], %o0 4000a968: f8 06 20 18 ld [ %i0 + 0x18 ], %i4 _Watchdog_Ticks_since_boot; if ( deadline*budget_left > budget*deadline_left ) { 4000a96c: 40 00 3e fa call 4001a554 <.umul> 4000a970: 90 27 00 08 sub %i4, %o0, %o0 4000a974: d2 06 20 74 ld [ %i0 + 0x74 ], %o1 4000a978: b6 10 00 08 mov %o0, %i3 4000a97c: 40 00 3e f6 call 4001a554 <.umul> 4000a980: d0 07 60 08 ld [ %i5 + 8 ], %o0 4000a984: 80 a6 c0 08 cmp %i3, %o0 4000a988: 24 80 00 0d ble,a 4000a9bc <_Scheduler_CBS_Unblock+0x7c> 4000a98c: 3b 10 00 85 sethi %hi(0x40021400), %i5 /* Put late unblocked task to background until the end of period. */ new_priority = the_thread->Start.initial_priority; 4000a990: d2 06 20 ac ld [ %i0 + 0xac ], %o1 if ( the_thread->real_priority != new_priority ) 4000a994: 80 a7 00 09 cmp %i4, %o1 4000a998: 32 80 00 02 bne,a 4000a9a0 <_Scheduler_CBS_Unblock+0x60> 4000a99c: d2 26 20 18 st %o1, [ %i0 + 0x18 ] the_thread->real_priority = new_priority; if ( the_thread->current_priority != new_priority ) 4000a9a0: c2 06 20 14 ld [ %i0 + 0x14 ], %g1 4000a9a4: 80 a0 40 09 cmp %g1, %o1 4000a9a8: 02 80 00 04 be 4000a9b8 <_Scheduler_CBS_Unblock+0x78> 4000a9ac: 90 10 00 18 mov %i0, %o0 _Thread_Change_priority(the_thread, new_priority, true); 4000a9b0: 40 00 01 08 call 4000add0 <_Thread_Change_priority> 4000a9b4: 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, 4000a9b8: 3b 10 00 85 sethi %hi(0x40021400), %i5 4000a9bc: ba 17 61 90 or %i5, 0x190, %i5 ! 40021590 <_Per_CPU_Information> 4000a9c0: c4 07 60 14 ld [ %i5 + 0x14 ], %g2 4000a9c4: 03 10 00 80 sethi %hi(0x40020000), %g1 4000a9c8: d0 06 20 14 ld [ %i0 + 0x14 ], %o0 4000a9cc: c2 00 62 e4 ld [ %g1 + 0x2e4 ], %g1 4000a9d0: 9f c0 40 00 call %g1 4000a9d4: d2 00 a0 14 ld [ %g2 + 0x14 ], %o1 4000a9d8: 80 a2 20 00 cmp %o0, 0 4000a9dc: 04 80 00 0f ble 4000aa18 <_Scheduler_CBS_Unblock+0xd8> 4000a9e0: 01 00 00 00 nop _Thread_Heir->current_priority)) { _Thread_Heir = the_thread; if ( _Thread_Executing->is_preemptible || 4000a9e4: 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; 4000a9e8: f0 27 60 14 st %i0, [ %i5 + 0x14 ] if ( _Thread_Executing->is_preemptible || 4000a9ec: c2 08 60 70 ldub [ %g1 + 0x70 ], %g1 4000a9f0: 80 a0 60 00 cmp %g1, 0 4000a9f4: 12 80 00 06 bne 4000aa0c <_Scheduler_CBS_Unblock+0xcc> 4000a9f8: 84 10 20 01 mov 1, %g2 4000a9fc: c2 06 20 14 ld [ %i0 + 0x14 ], %g1 4000aa00: 80 a0 60 00 cmp %g1, 0 4000aa04: 12 80 00 05 bne 4000aa18 <_Scheduler_CBS_Unblock+0xd8> <== ALWAYS TAKEN 4000aa08: 01 00 00 00 nop the_thread->current_priority == 0 ) _Thread_Dispatch_necessary = true; 4000aa0c: 03 10 00 85 sethi %hi(0x40021400), %g1 4000aa10: 82 10 61 90 or %g1, 0x190, %g1 ! 40021590 <_Per_CPU_Information> 4000aa14: c4 28 60 0c stb %g2, [ %g1 + 0xc ] 4000aa18: 81 c7 e0 08 ret 4000aa1c: 81 e8 00 00 restore =============================================================================== 4000a8a0 <_Scheduler_EDF_Allocate>: #include void *_Scheduler_EDF_Allocate( Thread_Control *the_thread ) { 4000a8a0: 9d e3 bf a0 save %sp, -96, %sp void *sched; Scheduler_EDF_Per_thread *schinfo; sched = _Workspace_Allocate( sizeof(Scheduler_EDF_Per_thread) ); 4000a8a4: 40 00 06 62 call 4000c22c <_Workspace_Allocate> 4000a8a8: 90 10 20 18 mov 0x18, %o0 if ( sched ) { 4000a8ac: 80 a2 20 00 cmp %o0, 0 4000a8b0: 02 80 00 05 be 4000a8c4 <_Scheduler_EDF_Allocate+0x24> <== NEVER TAKEN 4000a8b4: 82 10 20 02 mov 2, %g1 the_thread->scheduler_info = sched; 4000a8b8: d0 26 20 88 st %o0, [ %i0 + 0x88 ] schinfo = (Scheduler_EDF_Per_thread *)(the_thread->scheduler_info); schinfo->thread = the_thread; 4000a8bc: f0 22 00 00 st %i0, [ %o0 ] schinfo->queue_state = SCHEDULER_EDF_QUEUE_STATE_NEVER_HAS_BEEN; 4000a8c0: c2 22 20 14 st %g1, [ %o0 + 0x14 ] } return sched; } 4000a8c4: 81 c7 e0 08 ret 4000a8c8: 91 e8 00 08 restore %g0, %o0, %o0 =============================================================================== 4000aa68 <_Scheduler_EDF_Unblock>: #include void _Scheduler_EDF_Unblock( Thread_Control *the_thread ) { 4000aa68: 9d e3 bf a0 save %sp, -96, %sp _Scheduler_EDF_Enqueue(the_thread); 4000aa6c: 7f ff ff ad call 4000a920 <_Scheduler_EDF_Enqueue> 4000aa70: 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( 4000aa74: 3b 10 00 85 sethi %hi(0x40021400), %i5 4000aa78: ba 17 60 e0 or %i5, 0xe0, %i5 ! 400214e0 <_Per_CPU_Information> 4000aa7c: c4 07 60 14 ld [ %i5 + 0x14 ], %g2 4000aa80: 03 10 00 80 sethi %hi(0x40020000), %g1 4000aa84: d0 00 a0 14 ld [ %g2 + 0x14 ], %o0 4000aa88: c2 00 62 34 ld [ %g1 + 0x234 ], %g1 4000aa8c: 9f c0 40 00 call %g1 4000aa90: d2 06 20 14 ld [ %i0 + 0x14 ], %o1 4000aa94: 80 a2 20 00 cmp %o0, 0 4000aa98: 16 80 00 0f bge 4000aad4 <_Scheduler_EDF_Unblock+0x6c> 4000aa9c: 01 00 00 00 nop _Thread_Heir->current_priority, the_thread->current_priority )) { _Thread_Heir = the_thread; if ( _Thread_Executing->is_preemptible || 4000aaa0: 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; 4000aaa4: f0 27 60 14 st %i0, [ %i5 + 0x14 ] if ( _Thread_Executing->is_preemptible || 4000aaa8: c2 08 60 70 ldub [ %g1 + 0x70 ], %g1 4000aaac: 80 a0 60 00 cmp %g1, 0 4000aab0: 12 80 00 06 bne 4000aac8 <_Scheduler_EDF_Unblock+0x60> 4000aab4: 84 10 20 01 mov 1, %g2 4000aab8: c2 06 20 14 ld [ %i0 + 0x14 ], %g1 4000aabc: 80 a0 60 00 cmp %g1, 0 4000aac0: 12 80 00 05 bne 4000aad4 <_Scheduler_EDF_Unblock+0x6c> <== ALWAYS TAKEN 4000aac4: 01 00 00 00 nop the_thread->current_priority == 0 ) _Thread_Dispatch_necessary = true; 4000aac8: 03 10 00 85 sethi %hi(0x40021400), %g1 4000aacc: 82 10 60 e0 or %g1, 0xe0, %g1 ! 400214e0 <_Per_CPU_Information> 4000aad0: c4 28 60 0c stb %g2, [ %g1 + 0xc ] 4000aad4: 81 c7 e0 08 ret 4000aad8: 81 e8 00 00 restore =============================================================================== 4000a174 <_Scheduler_priority_Tick>: #include #include void _Scheduler_priority_Tick( void ) { 4000a174: 9d e3 bf a0 save %sp, -96, %sp Thread_Control *executing; executing = _Thread_Executing; 4000a178: 03 10 00 7e sethi %hi(0x4001f800), %g1 4000a17c: fa 00 61 a0 ld [ %g1 + 0x1a0 ], %i5 ! 4001f9a0 <_Per_CPU_Information+0x10> /* * If the thread is not preemptible or is not ready, then * just return. */ if ( !executing->is_preemptible ) 4000a180: c2 0f 60 70 ldub [ %i5 + 0x70 ], %g1 4000a184: 80 a0 60 00 cmp %g1, 0 4000a188: 02 80 00 25 be 4000a21c <_Scheduler_priority_Tick+0xa8> 4000a18c: 01 00 00 00 nop return; if ( !_States_Is_ready( executing->current_state ) ) 4000a190: c2 07 60 10 ld [ %i5 + 0x10 ], %g1 4000a194: 80 a0 60 00 cmp %g1, 0 4000a198: 12 80 00 21 bne 4000a21c <_Scheduler_priority_Tick+0xa8> 4000a19c: 01 00 00 00 nop /* * The cpu budget algorithm determines what happens next. */ switch ( executing->budget_algorithm ) { 4000a1a0: c2 07 60 78 ld [ %i5 + 0x78 ], %g1 4000a1a4: 80 a0 60 01 cmp %g1, 1 4000a1a8: 0a 80 00 14 bcs 4000a1f8 <_Scheduler_priority_Tick+0x84> 4000a1ac: 80 a0 60 02 cmp %g1, 2 4000a1b0: 28 80 00 07 bleu,a 4000a1cc <_Scheduler_priority_Tick+0x58> 4000a1b4: c2 07 60 74 ld [ %i5 + 0x74 ], %g1 4000a1b8: 80 a0 60 03 cmp %g1, 3 4000a1bc: 12 80 00 18 bne 4000a21c <_Scheduler_priority_Tick+0xa8> <== NEVER TAKEN 4000a1c0: 01 00 00 00 nop } break; #if defined(RTEMS_SCORE_THREAD_ENABLE_SCHEDULER_CALLOUT) case THREAD_CPU_BUDGET_ALGORITHM_CALLOUT: if ( --executing->cpu_time_budget == 0 ) 4000a1c4: 10 80 00 0f b 4000a200 <_Scheduler_priority_Tick+0x8c> 4000a1c8: c2 07 60 74 ld [ %i5 + 0x74 ], %g1 case THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE: #if defined(RTEMS_SCORE_THREAD_ENABLE_EXHAUST_TIMESLICE) case THREAD_CPU_BUDGET_ALGORITHM_EXHAUST_TIMESLICE: #endif if ( (int)(--executing->cpu_time_budget) <= 0 ) { 4000a1cc: 82 00 7f ff add %g1, -1, %g1 4000a1d0: 80 a0 60 00 cmp %g1, 0 4000a1d4: 14 80 00 09 bg 4000a1f8 <_Scheduler_priority_Tick+0x84> 4000a1d8: c2 27 60 74 st %g1, [ %i5 + 0x74 ] * always operates on the scheduler that 'owns' the currently executing * thread. */ RTEMS_INLINE_ROUTINE void _Scheduler_Yield( void ) { _Scheduler.Operations.yield(); 4000a1dc: 03 10 00 79 sethi %hi(0x4001e400), %g1 4000a1e0: c2 00 63 40 ld [ %g1 + 0x340 ], %g1 ! 4001e740 <_Scheduler+0xc> 4000a1e4: 9f c0 40 00 call %g1 4000a1e8: 01 00 00 00 nop * executing thread's timeslice is reset. Otherwise, the * currently executing thread is placed at the rear of the * FIFO for this priority and a new heir is selected. */ _Scheduler_Yield(); executing->cpu_time_budget = _Thread_Ticks_per_timeslice; 4000a1ec: 03 10 00 7c sethi %hi(0x4001f000), %g1 4000a1f0: c2 00 63 e0 ld [ %g1 + 0x3e0 ], %g1 ! 4001f3e0 <_Thread_Ticks_per_timeslice> 4000a1f4: c2 27 60 74 st %g1, [ %i5 + 0x74 ] 4000a1f8: 81 c7 e0 08 ret 4000a1fc: 81 e8 00 00 restore } break; #if defined(RTEMS_SCORE_THREAD_ENABLE_SCHEDULER_CALLOUT) case THREAD_CPU_BUDGET_ALGORITHM_CALLOUT: if ( --executing->cpu_time_budget == 0 ) 4000a200: 82 00 7f ff add %g1, -1, %g1 4000a204: 80 a0 60 00 cmp %g1, 0 4000a208: 12 bf ff fc bne 4000a1f8 <_Scheduler_priority_Tick+0x84> 4000a20c: c2 27 60 74 st %g1, [ %i5 + 0x74 ] (*executing->budget_callout)( executing ); 4000a210: c2 07 60 7c ld [ %i5 + 0x7c ], %g1 4000a214: 9f c0 40 00 call %g1 4000a218: 90 10 00 1d mov %i5, %o0 4000a21c: 81 c7 e0 08 ret 4000a220: 81 e8 00 00 restore =============================================================================== 40008db4 <_TOD_Validate>: }; bool _TOD_Validate( const rtems_time_of_day *the_tod ) { 40008db4: 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 / 40008db8: 03 10 00 7a sethi %hi(0x4001e800), %g1 40008dbc: d2 00 62 5c ld [ %g1 + 0x25c ], %o1 ! 4001ea5c 40008dc0: 11 00 03 d0 sethi %hi(0xf4000), %o0 40008dc4: 40 00 48 2b call 4001ae70 <.udiv> 40008dc8: 90 12 22 40 or %o0, 0x240, %o0 ! f4240 rtems_configuration_get_microseconds_per_tick(); if ((!the_tod) || 40008dcc: 80 a6 20 00 cmp %i0, 0 40008dd0: 02 80 00 28 be 40008e70 <_TOD_Validate+0xbc> <== NEVER TAKEN 40008dd4: 84 10 20 00 clr %g2 40008dd8: c2 06 20 18 ld [ %i0 + 0x18 ], %g1 40008ddc: 80 a0 40 08 cmp %g1, %o0 40008de0: 3a 80 00 25 bcc,a 40008e74 <_TOD_Validate+0xc0> 40008de4: b0 08 a0 01 and %g2, 1, %i0 (the_tod->ticks >= ticks_per_second) || 40008de8: c2 06 20 14 ld [ %i0 + 0x14 ], %g1 40008dec: 80 a0 60 3b cmp %g1, 0x3b 40008df0: 38 80 00 21 bgu,a 40008e74 <_TOD_Validate+0xc0> 40008df4: b0 08 a0 01 and %g2, 1, %i0 (the_tod->second >= TOD_SECONDS_PER_MINUTE) || 40008df8: c2 06 20 10 ld [ %i0 + 0x10 ], %g1 40008dfc: 80 a0 60 3b cmp %g1, 0x3b 40008e00: 38 80 00 1d bgu,a 40008e74 <_TOD_Validate+0xc0> 40008e04: b0 08 a0 01 and %g2, 1, %i0 (the_tod->minute >= TOD_MINUTES_PER_HOUR) || 40008e08: c2 06 20 0c ld [ %i0 + 0xc ], %g1 40008e0c: 80 a0 60 17 cmp %g1, 0x17 40008e10: 38 80 00 19 bgu,a 40008e74 <_TOD_Validate+0xc0> 40008e14: b0 08 a0 01 and %g2, 1, %i0 (the_tod->hour >= TOD_HOURS_PER_DAY) || (the_tod->month == 0) || 40008e18: 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) || 40008e1c: 80 a0 60 00 cmp %g1, 0 40008e20: 02 80 00 14 be 40008e70 <_TOD_Validate+0xbc> <== NEVER TAKEN 40008e24: 80 a0 60 0c cmp %g1, 0xc (the_tod->month == 0) || 40008e28: 38 80 00 13 bgu,a 40008e74 <_TOD_Validate+0xc0> 40008e2c: b0 08 a0 01 and %g2, 1, %i0 (the_tod->month > TOD_MONTHS_PER_YEAR) || (the_tod->year < TOD_BASE_YEAR) || 40008e30: 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) || 40008e34: 80 a1 27 c3 cmp %g4, 0x7c3 40008e38: 28 80 00 0f bleu,a 40008e74 <_TOD_Validate+0xc0> 40008e3c: b0 08 a0 01 and %g2, 1, %i0 (the_tod->year < TOD_BASE_YEAR) || (the_tod->day == 0) ) 40008e40: 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) || 40008e44: 80 a0 e0 00 cmp %g3, 0 40008e48: 02 80 00 0a be 40008e70 <_TOD_Validate+0xbc> <== NEVER TAKEN 40008e4c: 80 89 20 03 btst 3, %g4 40008e50: 05 10 00 7e sethi %hi(0x4001f800), %g2 (the_tod->day == 0) ) return false; if ( (the_tod->year % 4) == 0 ) 40008e54: 12 80 00 03 bne 40008e60 <_TOD_Validate+0xac> 40008e58: 84 10 a3 58 or %g2, 0x358, %g2 ! 4001fb58 <_TOD_Days_per_month> days_in_month = _TOD_Days_per_month[ 1 ][ the_tod->month ]; 40008e5c: 82 00 60 0d add %g1, 0xd, %g1 else days_in_month = _TOD_Days_per_month[ 0 ][ the_tod->month ]; 40008e60: 83 28 60 02 sll %g1, 2, %g1 40008e64: c2 00 80 01 ld [ %g2 + %g1 ], %g1 if ( the_tod->day > days_in_month ) 40008e68: 80 a0 40 03 cmp %g1, %g3 40008e6c: 84 60 3f ff subx %g0, -1, %g2 return false; return true; } 40008e70: b0 08 a0 01 and %g2, 1, %i0 40008e74: 81 c7 e0 08 ret 40008e78: 81 e8 00 00 restore =============================================================================== 4000a430 <_Thread_Change_priority>: void _Thread_Change_priority( Thread_Control *the_thread, Priority_Control new_priority, bool prepend_it ) { 4000a430: 9d e3 bf a0 save %sp, -96, %sp 4000a434: ba 10 00 18 mov %i0, %i5 States_Control state, original_state; /* * Save original state */ original_state = the_thread->current_state; 4000a438: 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 ); 4000a43c: 40 00 03 51 call 4000b180 <_Thread_Set_transient> 4000a440: 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 ) 4000a444: c2 07 60 14 ld [ %i5 + 0x14 ], %g1 4000a448: 80 a0 40 19 cmp %g1, %i1 4000a44c: 02 80 00 04 be 4000a45c <_Thread_Change_priority+0x2c> 4000a450: 90 10 00 1d mov %i5, %o0 _Thread_Set_priority( the_thread, new_priority ); 4000a454: 40 00 03 32 call 4000b11c <_Thread_Set_priority> 4000a458: 92 10 00 19 mov %i1, %o1 _ISR_Disable( level ); 4000a45c: 7f ff df fb call 40002448 4000a460: 01 00 00 00 nop 4000a464: 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; 4000a468: f8 07 60 10 ld [ %i5 + 0x10 ], %i4 if ( state != STATES_TRANSIENT ) { 4000a46c: 80 a7 20 04 cmp %i4, 4 4000a470: 02 80 00 10 be 4000a4b0 <_Thread_Change_priority+0x80> 4000a474: 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 ) ) 4000a478: 80 a0 60 00 cmp %g1, 0 4000a47c: 12 80 00 03 bne 4000a488 <_Thread_Change_priority+0x58> <== NEVER TAKEN 4000a480: 82 0f 3f fb and %i4, -5, %g1 the_thread->current_state = _States_Clear( STATES_TRANSIENT, state ); 4000a484: c2 27 60 10 st %g1, [ %i5 + 0x10 ] _ISR_Enable( level ); 4000a488: 7f ff df f4 call 40002458 4000a48c: 90 10 00 1b mov %i3, %o0 if ( _States_Is_waiting_on_thread_queue( state ) ) { 4000a490: 03 00 00 ef sethi %hi(0x3bc00), %g1 4000a494: 82 10 62 e0 or %g1, 0x2e0, %g1 ! 3bee0 4000a498: 80 8f 00 01 btst %i4, %g1 4000a49c: 02 80 00 27 be 4000a538 <_Thread_Change_priority+0x108> 4000a4a0: 01 00 00 00 nop _Thread_queue_Requeue( the_thread->Wait.queue, the_thread ); 4000a4a4: f0 07 60 44 ld [ %i5 + 0x44 ], %i0 4000a4a8: 40 00 02 f0 call 4000b068 <_Thread_queue_Requeue> 4000a4ac: 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 ) ) { 4000a4b0: 80 a0 60 00 cmp %g1, 0 4000a4b4: 12 80 00 0b bne 4000a4e0 <_Thread_Change_priority+0xb0> <== NEVER TAKEN 4000a4b8: 03 10 00 79 sethi %hi(0x4001e400), %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 ); 4000a4bc: c0 27 60 10 clr [ %i5 + 0x10 ] if ( prepend_it ) 4000a4c0: 80 a6 a0 00 cmp %i2, 0 4000a4c4: 02 80 00 04 be 4000a4d4 <_Thread_Change_priority+0xa4> 4000a4c8: 82 10 63 34 or %g1, 0x334, %g1 */ RTEMS_INLINE_ROUTINE void _Scheduler_Enqueue_first( Thread_Control *the_thread ) { _Scheduler.Operations.enqueue_first( the_thread ); 4000a4cc: 10 80 00 03 b 4000a4d8 <_Thread_Change_priority+0xa8> 4000a4d0: c2 00 60 28 ld [ %g1 + 0x28 ], %g1 */ RTEMS_INLINE_ROUTINE void _Scheduler_Enqueue( Thread_Control *the_thread ) { _Scheduler.Operations.enqueue( the_thread ); 4000a4d4: c2 00 60 24 ld [ %g1 + 0x24 ], %g1 4000a4d8: 9f c0 40 00 call %g1 4000a4dc: 90 10 00 1d mov %i5, %o0 _Scheduler_Enqueue_first( the_thread ); else _Scheduler_Enqueue( the_thread ); } _ISR_Flash( level ); 4000a4e0: 7f ff df de call 40002458 4000a4e4: 90 10 00 1b mov %i3, %o0 4000a4e8: 7f ff df d8 call 40002448 4000a4ec: 01 00 00 00 nop 4000a4f0: 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(); 4000a4f4: 03 10 00 79 sethi %hi(0x4001e400), %g1 4000a4f8: c2 00 63 3c ld [ %g1 + 0x33c ], %g1 ! 4001e73c <_Scheduler+0x8> 4000a4fc: 9f c0 40 00 call %g1 4000a500: 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 ); 4000a504: 03 10 00 7e sethi %hi(0x4001f800), %g1 4000a508: 82 10 61 90 or %g1, 0x190, %g1 ! 4001f990 <_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() && 4000a50c: c4 18 60 10 ldd [ %g1 + 0x10 ], %g2 4000a510: 80 a0 80 03 cmp %g2, %g3 4000a514: 02 80 00 07 be 4000a530 <_Thread_Change_priority+0x100> 4000a518: 01 00 00 00 nop 4000a51c: c4 08 a0 70 ldub [ %g2 + 0x70 ], %g2 4000a520: 80 a0 a0 00 cmp %g2, 0 4000a524: 02 80 00 03 be 4000a530 <_Thread_Change_priority+0x100> 4000a528: 84 10 20 01 mov 1, %g2 _Thread_Executing->is_preemptible ) _Thread_Dispatch_necessary = true; 4000a52c: c4 28 60 0c stb %g2, [ %g1 + 0xc ] _ISR_Enable( level ); 4000a530: 7f ff df ca call 40002458 4000a534: 81 e8 00 00 restore 4000a538: 81 c7 e0 08 ret 4000a53c: 81 e8 00 00 restore =============================================================================== 4000a700 <_Thread_Delay_ended>: void _Thread_Delay_ended( Objects_Id id, void *ignored __attribute__((unused)) ) { 4000a700: 9d e3 bf 98 save %sp, -104, %sp Thread_Control *the_thread; Objects_Locations location; the_thread = _Thread_Get( id, &location ); 4000a704: 90 10 00 18 mov %i0, %o0 4000a708: 40 00 00 70 call 4000a8c8 <_Thread_Get> 4000a70c: 92 07 bf fc add %fp, -4, %o1 switch ( location ) { 4000a710: c2 07 bf fc ld [ %fp + -4 ], %g1 4000a714: 80 a0 60 00 cmp %g1, 0 4000a718: 12 80 00 08 bne 4000a738 <_Thread_Delay_ended+0x38> <== NEVER TAKEN 4000a71c: 13 04 00 00 sethi %hi(0x10000000), %o1 #if defined(RTEMS_MULTIPROCESSING) case OBJECTS_REMOTE: /* impossible */ #endif break; case OBJECTS_LOCAL: _Thread_Clear_state( 4000a720: 7f ff ff 88 call 4000a540 <_Thread_Clear_state> 4000a724: 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; 4000a728: 03 10 00 7d sethi %hi(0x4001f400), %g1 4000a72c: c4 00 60 80 ld [ %g1 + 0x80 ], %g2 ! 4001f480 <_Thread_Dispatch_disable_level> --level; 4000a730: 84 00 bf ff add %g2, -1, %g2 _Thread_Dispatch_disable_level = level; 4000a734: c4 20 60 80 st %g2, [ %g1 + 0x80 ] 4000a738: 81 c7 e0 08 ret 4000a73c: 81 e8 00 00 restore =============================================================================== 4000a740 <_Thread_Dispatch>: #if defined(RTEMS_SMP) #include #endif void _Thread_Dispatch( void ) { 4000a740: 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; 4000a744: 35 10 00 7e sethi %hi(0x4001f800), %i2 4000a748: 82 16 a1 90 or %i2, 0x190, %g1 ! 4001f990 <_Per_CPU_Information> _ISR_Disable( level ); 4000a74c: 7f ff df 3f call 40002448 4000a750: f6 00 60 10 ld [ %g1 + 0x10 ], %i3 */ static inline void _TOD_Get_uptime( Timestamp_Control *time ) { _TOD_Get_with_nanoseconds( time, &_TOD.uptime ); 4000a754: 21 10 00 7c sethi %hi(0x4001f000), %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 ) { 4000a758: 27 10 00 7a sethi %hi(0x4001e800), %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; 4000a75c: 33 10 00 7d sethi %hi(0x4001f400), %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; 4000a760: 31 10 00 7c sethi %hi(0x4001f000), %i0 4000a764: a0 14 23 d0 or %l0, 0x3d0, %l0 #endif /* * Switch libc's task specific data. */ if ( _Thread_libc_reent ) { 4000a768: 23 10 00 7d sethi %hi(0x4001f400), %l1 */ RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_first( const Chain_Control *the_chain ) { return _Chain_Immutable_head( the_chain )->next; 4000a76c: 25 10 00 7a sethi %hi(0x4001e800), %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 ) { 4000a770: 10 80 00 3b b 4000a85c <_Thread_Dispatch+0x11c> 4000a774: a6 14 e0 64 or %l3, 0x64, %l3 4000a778: 84 10 20 01 mov 1, %g2 4000a77c: c4 26 60 80 st %g2, [ %i1 + 0x80 ] heir = _Thread_Heir; #ifndef RTEMS_SMP _Thread_Dispatch_set_disable_level( 1 ); #endif _Thread_Dispatch_necessary = false; 4000a780: 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 ) 4000a784: 80 a5 00 1b cmp %l4, %i3 4000a788: 12 80 00 0a bne 4000a7b0 <_Thread_Dispatch+0x70> 4000a78c: e8 20 60 10 st %l4, [ %g1 + 0x10 ] 4000a790: 03 10 00 7d sethi %hi(0x4001f400), %g1 4000a794: c0 20 60 80 clr [ %g1 + 0x80 ] ! 4001f480 <_Thread_Dispatch_disable_level> post_switch: #ifndef RTEMS_SMP _Thread_Dispatch_set_disable_level( 0 ); #endif _ISR_Enable( level ); 4000a798: 7f ff df 30 call 40002458 4000a79c: 39 10 00 7d sethi %hi(0x4001f400), %i4 4000a7a0: 03 10 00 7d sethi %hi(0x4001f400), %g1 4000a7a4: fa 00 60 f0 ld [ %g1 + 0xf0 ], %i5 ! 4001f4f0 <_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 ) { 4000a7a8: 10 80 00 37 b 4000a884 <_Thread_Dispatch+0x144> 4000a7ac: b8 17 20 f4 or %i4, 0xf4, %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 ) 4000a7b0: c2 05 20 78 ld [ %l4 + 0x78 ], %g1 4000a7b4: 80 a0 60 01 cmp %g1, 1 4000a7b8: 12 80 00 03 bne 4000a7c4 <_Thread_Dispatch+0x84> 4000a7bc: c2 06 23 e0 ld [ %i0 + 0x3e0 ], %g1 heir->cpu_time_budget = _Thread_Ticks_per_timeslice; 4000a7c0: c2 25 20 74 st %g1, [ %l4 + 0x74 ] _ISR_Enable( level ); 4000a7c4: 7f ff df 25 call 40002458 4000a7c8: 01 00 00 00 nop 4000a7cc: 90 07 bf f8 add %fp, -8, %o0 4000a7d0: 7f ff f9 e0 call 40008f50 <_TOD_Get_with_nanoseconds> 4000a7d4: 92 10 00 10 mov %l0, %o1 #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ { Timestamp_Control uptime, ran; _TOD_Get_uptime( &uptime ); _Timestamp_Subtract( 4000a7d8: c4 1f bf f8 ldd [ %fp + -8 ], %g2 4000a7dc: 82 16 a1 90 or %i2, 0x190, %g1 const Timestamp64_Control *_start, const Timestamp64_Control *_end, Timestamp64_Control *_result ) { *_result = *_end - *_start; 4000a7e0: f8 18 60 20 ldd [ %g1 + 0x20 ], %i4 4000a7e4: 96 a0 c0 1d subcc %g3, %i5, %o3 4000a7e8: 94 60 80 1c subx %g2, %i4, %o2 static inline void _Timestamp64_implementation_Add_to( Timestamp64_Control *_time, const Timestamp64_Control *_add ) { *_time += *_add; 4000a7ec: f8 1e e0 80 ldd [ %i3 + 0x80 ], %i4 4000a7f0: 9a 87 40 0b addcc %i5, %o3, %o5 4000a7f4: 98 47 00 0a addx %i4, %o2, %o4 4000a7f8: 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; 4000a7fc: c4 38 60 20 std %g2, [ %g1 + 0x20 ] #endif /* * Switch libc's task specific data. */ if ( _Thread_libc_reent ) { 4000a800: c2 04 60 ec ld [ %l1 + 0xec ], %g1 4000a804: 80 a0 60 00 cmp %g1, 0 4000a808: 22 80 00 0c be,a 4000a838 <_Thread_Dispatch+0xf8> <== NEVER TAKEN 4000a80c: fa 04 a0 60 ld [ %l2 + 0x60 ], %i5 <== NOT EXECUTED executing->libc_reent = *_Thread_libc_reent; 4000a810: c4 00 40 00 ld [ %g1 ], %g2 4000a814: c4 26 e1 48 st %g2, [ %i3 + 0x148 ] *_Thread_libc_reent = heir->libc_reent; 4000a818: c4 05 21 48 ld [ %l4 + 0x148 ], %g2 4000a81c: c4 20 40 00 st %g2, [ %g1 ] 4000a820: 10 80 00 06 b 4000a838 <_Thread_Dispatch+0xf8> 4000a824: fa 04 a0 60 ld [ %l2 + 0x60 ], %i5 const User_extensions_Switch_control *extension = (const User_extensions_Switch_control *) node; (*extension->thread_switch)( executing, heir ); 4000a828: 90 10 00 1b mov %i3, %o0 4000a82c: 9f c0 40 00 call %g1 4000a830: 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; 4000a834: 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 ) { 4000a838: 80 a7 40 13 cmp %i5, %l3 4000a83c: 32 bf ff fb bne,a 4000a828 <_Thread_Dispatch+0xe8> 4000a840: 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 ); 4000a844: 90 06 e0 c0 add %i3, 0xc0, %o0 4000a848: 40 00 04 30 call 4000b908 <_CPU_Context_switch> 4000a84c: 92 05 20 c0 add %l4, 0xc0, %o1 if ( executing->fp_context != NULL ) _Context_Restore_fp( &executing->fp_context ); #endif #endif executing = _Thread_Executing; 4000a850: 82 16 a1 90 or %i2, 0x190, %g1 _ISR_Disable( level ); 4000a854: 7f ff de fd call 40002448 4000a858: 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 ) { 4000a85c: 82 16 a1 90 or %i2, 0x190, %g1 4000a860: c4 08 60 0c ldub [ %g1 + 0xc ], %g2 4000a864: 80 a0 a0 00 cmp %g2, 0 4000a868: 32 bf ff c4 bne,a 4000a778 <_Thread_Dispatch+0x38> 4000a86c: e8 00 60 14 ld [ %g1 + 0x14 ], %l4 4000a870: 10 bf ff c9 b 4000a794 <_Thread_Dispatch+0x54> 4000a874: 03 10 00 7d sethi %hi(0x4001f400), %g1 const API_extensions_Post_switch_control *post_switch = (const API_extensions_Post_switch_control *) node; (*post_switch->hook)( executing ); 4000a878: 9f c0 40 00 call %g1 4000a87c: 90 10 00 1b mov %i3, %o0 4000a880: 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 ) { 4000a884: 80 a7 40 1c cmp %i5, %i4 4000a888: 32 bf ff fc bne,a 4000a878 <_Thread_Dispatch+0x138> 4000a88c: c2 07 60 08 ld [ %i5 + 8 ], %g1 #ifdef RTEMS_SMP _Thread_Unnest_dispatch(); #endif _API_extensions_Run_post_switch( executing ); } 4000a890: 81 c7 e0 08 ret 4000a894: 81 e8 00 00 restore =============================================================================== 4000f8c0 <_Thread_Handler>: #define INIT_NAME __main #define EXECUTE_GLOBAL_CONSTRUCTORS #endif void _Thread_Handler( void ) { 4000f8c0: 9d e3 bf a0 save %sp, -96, %sp #if defined(EXECUTE_GLOBAL_CONSTRUCTORS) static bool doneConstructors; bool doCons; #endif executing = _Thread_Executing; 4000f8c4: 03 10 00 7e sethi %hi(0x4001f800), %g1 4000f8c8: fa 00 61 a0 ld [ %g1 + 0x1a0 ], %i5 ! 4001f9a0 <_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(); 4000f8cc: 3f 10 00 3e sethi %hi(0x4000f800), %i7 4000f8d0: be 17 e0 c0 or %i7, 0xc0, %i7 ! 4000f8c0 <_Thread_Handler> /* * have to put level into a register for those cpu's that use * inline asm here */ level = executing->Start.isr_level; 4000f8d4: d0 07 60 a8 ld [ %i5 + 0xa8 ], %o0 _ISR_Set_level(level); 4000f8d8: 7f ff ca e0 call 40002458 4000f8dc: 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; 4000f8e0: 03 10 00 7c sethi %hi(0x4001f000), %g1 doneConstructors = true; 4000f8e4: 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; 4000f8e8: f8 08 60 10 ldub [ %g1 + 0x10 ], %i4 ); } static inline void _User_extensions_Thread_begin( Thread_Control *executing ) { _User_extensions_Iterate( 4000f8ec: 90 10 00 1d mov %i5, %o0 4000f8f0: 13 10 00 2c sethi %hi(0x4000b000), %o1 4000f8f4: 92 12 63 60 or %o1, 0x360, %o1 ! 4000b360 <_User_extensions_Thread_begin_visitor> 4000f8f8: 7f ff ee b7 call 4000b3d4 <_User_extensions_Iterate> 4000f8fc: c4 28 60 10 stb %g2, [ %g1 + 0x10 ] _User_extensions_Thread_begin( executing ); /* * At this point, the dispatch disable level BETTER be 1. */ _Thread_Enable_dispatch(); 4000f900: 7f ff eb e6 call 4000a898 <_Thread_Enable_dispatch> 4000f904: 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) */ { 4000f908: 80 8f 20 ff btst 0xff, %i4 4000f90c: 32 80 00 05 bne,a 4000f920 <_Thread_Handler+0x60> 4000f910: c2 07 60 90 ld [ %i5 + 0x90 ], %g1 INIT_NAME (); 4000f914: 40 00 3b 55 call 4001e668 <_init> 4000f918: 01 00 00 00 nop _Thread_Enable_dispatch(); #endif } #endif if ( executing->Start.prototype == THREAD_START_NUMERIC ) { 4000f91c: c2 07 60 90 ld [ %i5 + 0x90 ], %g1 4000f920: 80 a0 60 00 cmp %g1, 0 4000f924: 12 80 00 05 bne 4000f938 <_Thread_Handler+0x78> 4000f928: 80 a0 60 01 cmp %g1, 1 executing->Wait.return_argument = (*(Thread_Entry_numeric) executing->Start.entry_point)( 4000f92c: c2 07 60 8c ld [ %i5 + 0x8c ], %g1 4000f930: 10 80 00 06 b 4000f948 <_Thread_Handler+0x88> 4000f934: d0 07 60 98 ld [ %i5 + 0x98 ], %o0 executing->Start.numeric_argument ); } #if defined(RTEMS_POSIX_API) else if ( executing->Start.prototype == THREAD_START_POINTER ) { 4000f938: 12 80 00 08 bne 4000f958 <_Thread_Handler+0x98> <== NEVER TAKEN 4000f93c: 90 10 00 1d mov %i5, %o0 executing->Wait.return_argument = (*(Thread_Entry_pointer) executing->Start.entry_point)( 4000f940: c2 07 60 8c ld [ %i5 + 0x8c ], %g1 4000f944: d0 07 60 94 ld [ %i5 + 0x94 ], %o0 4000f948: 9f c0 40 00 call %g1 4000f94c: 01 00 00 00 nop executing->Start.numeric_argument ); } #if defined(RTEMS_POSIX_API) else if ( executing->Start.prototype == THREAD_START_POINTER ) { executing->Wait.return_argument = 4000f950: d0 27 60 28 st %o0, [ %i5 + 0x28 ] } } static inline void _User_extensions_Thread_exitted( Thread_Control *executing ) { _User_extensions_Iterate( 4000f954: 90 10 00 1d mov %i5, %o0 4000f958: 13 10 00 2c sethi %hi(0x4000b000), %o1 4000f95c: 7f ff ee 9e call 4000b3d4 <_User_extensions_Iterate> 4000f960: 92 12 63 84 or %o1, 0x384, %o1 ! 4000b384 <_User_extensions_Thread_exitted_visitor> * able to fit in a (void *). */ _User_extensions_Thread_exitted( executing ); _Internal_error_Occurred( 4000f964: 90 10 20 00 clr %o0 4000f968: 92 10 20 01 mov 1, %o1 4000f96c: 7f ff e6 ad call 40009420 <_Internal_error_Occurred> 4000f970: 94 10 20 05 mov 5, %o2 =============================================================================== 4000ab50 <_Thread_Handler_initialization>: #if defined(RTEMS_SMP) #include #endif void _Thread_Handler_initialization(void) { 4000ab50: 9d e3 bf 98 save %sp, -104, %sp uint32_t ticks_per_timeslice = 4000ab54: 03 10 00 71 sethi %hi(0x4001c400), %g1 4000ab58: 82 10 63 d8 or %g1, 0x3d8, %g1 ! 4001c7d8 #if defined(RTEMS_MULTIPROCESSING) uint32_t maximum_proxies = _Configuration_MP_table->maximum_proxies; #endif if ( rtems_configuration_get_stack_allocate_hook() == NULL || 4000ab5c: c6 00 60 28 ld [ %g1 + 0x28 ], %g3 #include #endif void _Thread_Handler_initialization(void) { uint32_t ticks_per_timeslice = 4000ab60: fa 00 60 14 ld [ %g1 + 0x14 ], %i5 rtems_configuration_get_ticks_per_timeslice(); uint32_t maximum_extensions = 4000ab64: 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 || 4000ab68: 80 a0 e0 00 cmp %g3, 0 4000ab6c: 02 80 00 06 be 4000ab84 <_Thread_Handler_initialization+0x34><== NEVER TAKEN 4000ab70: c4 00 60 24 ld [ %g1 + 0x24 ], %g2 4000ab74: c6 00 60 2c ld [ %g1 + 0x2c ], %g3 4000ab78: 80 a0 e0 00 cmp %g3, 0 4000ab7c: 12 80 00 06 bne 4000ab94 <_Thread_Handler_initialization+0x44> 4000ab80: 80 a0 a0 00 cmp %g2, 0 rtems_configuration_get_stack_free_hook() == NULL) _Internal_error_Occurred( 4000ab84: 90 10 20 00 clr %o0 4000ab88: 92 10 20 01 mov 1, %o1 4000ab8c: 7f ff fa 25 call 40009420 <_Internal_error_Occurred> 4000ab90: 94 10 20 0e mov 0xe, %o2 INTERNAL_ERROR_CORE, true, INTERNAL_ERROR_BAD_STACK_HOOK ); if ( stack_allocate_init_hook != NULL ) 4000ab94: 22 80 00 05 be,a 4000aba8 <_Thread_Handler_initialization+0x58> 4000ab98: 03 10 00 7e sethi %hi(0x4001f800), %g1 (*stack_allocate_init_hook)( rtems_configuration_get_stack_space_size() ); 4000ab9c: 9f c0 80 00 call %g2 4000aba0: d0 00 60 04 ld [ %g1 + 4 ], %o0 ! 4001f804 <_POSIX_Barrier_Information> _Thread_Dispatch_necessary = false; 4000aba4: 03 10 00 7e sethi %hi(0x4001f800), %g1 4000aba8: 82 10 61 90 or %g1, 0x190, %g1 ! 4001f990 <_Per_CPU_Information> 4000abac: c0 28 60 0c clrb [ %g1 + 0xc ] _Thread_Executing = NULL; 4000abb0: c0 20 60 10 clr [ %g1 + 0x10 ] _Thread_Heir = NULL; 4000abb4: 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; 4000abb8: 03 10 00 7d sethi %hi(0x4001f400), %g1 4000abbc: f8 20 60 fc st %i4, [ %g1 + 0xfc ] ! 4001f4fc <_Thread_Maximum_extensions> _Thread_Ticks_per_timeslice = ticks_per_timeslice; 4000abc0: 03 10 00 7c sethi %hi(0x4001f000), %g1 4000abc4: fa 20 63 e0 st %i5, [ %g1 + 0x3e0 ] ! 4001f3e0 <_Thread_Ticks_per_timeslice> #if defined(RTEMS_MULTIPROCESSING) if ( _System_state_Is_multiprocessing ) maximum_internal_threads += 1; #endif _Objects_Initialize_information( 4000abc8: 82 10 20 08 mov 8, %g1 4000abcc: 11 10 00 7d sethi %hi(0x4001f400), %o0 4000abd0: c2 23 a0 5c st %g1, [ %sp + 0x5c ] 4000abd4: 90 12 21 70 or %o0, 0x170, %o0 4000abd8: 92 10 20 01 mov 1, %o1 4000abdc: 94 10 20 01 mov 1, %o2 4000abe0: 96 10 20 01 mov 1, %o3 4000abe4: 98 10 21 60 mov 0x160, %o4 4000abe8: 7f ff fb 9e call 40009a60 <_Objects_Initialize_information> 4000abec: 9a 10 20 00 clr %o5 4000abf0: 81 c7 e0 08 ret 4000abf4: 81 e8 00 00 restore =============================================================================== 4000a978 <_Thread_Initialize>: Thread_CPU_budget_algorithms budget_algorithm, Thread_CPU_budget_algorithm_callout budget_callout, uint32_t isr_level, Objects_Name name ) { 4000a978: 9d e3 bf 98 save %sp, -104, %sp 4000a97c: c2 07 a0 6c ld [ %fp + 0x6c ], %g1 /* * Zero out all the allocated memory fields */ for ( i=0 ; i <= THREAD_API_LAST ; i++ ) the_thread->API_Extensions[i] = NULL; 4000a980: c0 26 61 4c clr [ %i1 + 0x14c ] 4000a984: c0 26 61 50 clr [ %i1 + 0x150 ] extensions_area = NULL; the_thread->libc_reent = NULL; 4000a988: c0 26 61 48 clr [ %i1 + 0x148 ] Thread_CPU_budget_algorithms budget_algorithm, Thread_CPU_budget_algorithm_callout budget_callout, uint32_t isr_level, Objects_Name name ) { 4000a98c: e0 07 a0 60 ld [ %fp + 0x60 ], %l0 4000a990: e2 00 40 00 ld [ %g1 ], %l1 if ( !actual_stack_size || actual_stack_size < stack_size ) return false; /* stack allocation failed */ stack = the_thread->Start.stack; #else if ( !stack_area ) { 4000a994: 80 a6 a0 00 cmp %i2, 0 4000a998: 12 80 00 0d bne 4000a9cc <_Thread_Initialize+0x54> 4000a99c: e4 0f a0 5f ldub [ %fp + 0x5f ], %l2 actual_stack_size = _Thread_Stack_Allocate( the_thread, stack_size ); 4000a9a0: 90 10 00 19 mov %i1, %o0 4000a9a4: 40 00 02 06 call 4000b1bc <_Thread_Stack_Allocate> 4000a9a8: 92 10 00 1b mov %i3, %o1 if ( !actual_stack_size || actual_stack_size < stack_size ) 4000a9ac: 80 a2 00 1b cmp %o0, %i3 4000a9b0: 0a 80 00 64 bcs 4000ab40 <_Thread_Initialize+0x1c8> 4000a9b4: 80 a2 20 00 cmp %o0, 0 4000a9b8: 02 80 00 62 be 4000ab40 <_Thread_Initialize+0x1c8> <== NEVER TAKEN 4000a9bc: 82 10 20 01 mov 1, %g1 return false; /* stack allocation failed */ stack = the_thread->Start.stack; 4000a9c0: f4 06 60 bc ld [ %i1 + 0xbc ], %i2 the_thread->Start.core_allocated_stack = true; 4000a9c4: 10 80 00 04 b 4000a9d4 <_Thread_Initialize+0x5c> 4000a9c8: c2 2e 60 b0 stb %g1, [ %i1 + 0xb0 ] } else { stack = stack_area; actual_stack_size = stack_size; the_thread->Start.core_allocated_stack = false; 4000a9cc: c0 2e 60 b0 clrb [ %i1 + 0xb0 ] 4000a9d0: 90 10 00 1b mov %i3, %o0 void *starting_address, size_t size ) { the_stack->area = starting_address; the_stack->size = size; 4000a9d4: d0 26 60 b4 st %o0, [ %i1 + 0xb4 ] #endif /* * Allocate the extensions area for this thread */ if ( _Thread_Maximum_extensions ) { 4000a9d8: 03 10 00 7d sethi %hi(0x4001f400), %g1 4000a9dc: d0 00 60 fc ld [ %g1 + 0xfc ], %o0 ! 4001f4fc <_Thread_Maximum_extensions> Stack_Control *the_stack, void *starting_address, size_t size ) { the_stack->area = starting_address; 4000a9e0: f4 26 60 b8 st %i2, [ %i1 + 0xb8 ] Watchdog_Service_routine_entry routine, Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; 4000a9e4: c0 26 60 50 clr [ %i1 + 0x50 ] the_watchdog->routine = routine; 4000a9e8: c0 26 60 64 clr [ %i1 + 0x64 ] the_watchdog->id = id; 4000a9ec: c0 26 60 68 clr [ %i1 + 0x68 ] the_watchdog->user_data = user_data; 4000a9f0: c0 26 60 6c clr [ %i1 + 0x6c ] 4000a9f4: 80 a2 20 00 cmp %o0, 0 4000a9f8: 02 80 00 08 be 4000aa18 <_Thread_Initialize+0xa0> 4000a9fc: b8 10 20 00 clr %i4 extensions_area = _Workspace_Allocate( 4000aa00: 90 02 20 01 inc %o0 4000aa04: 40 00 03 a5 call 4000b898 <_Workspace_Allocate> 4000aa08: 91 2a 20 02 sll %o0, 2, %o0 (_Thread_Maximum_extensions + 1) * sizeof( void * ) ); if ( !extensions_area ) 4000aa0c: b8 92 20 00 orcc %o0, 0, %i4 4000aa10: 02 80 00 40 be 4000ab10 <_Thread_Initialize+0x198> 4000aa14: 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 ) { 4000aa18: 80 a7 20 00 cmp %i4, 0 4000aa1c: 12 80 00 0a bne 4000aa44 <_Thread_Initialize+0xcc> 4000aa20: f8 26 61 54 st %i4, [ %i1 + 0x154 ] * General initialization */ the_thread->Start.is_preemptible = is_preemptible; the_thread->Start.budget_algorithm = budget_algorithm; the_thread->Start.budget_callout = budget_callout; 4000aa24: c2 07 a0 64 ld [ %fp + 0x64 ], %g1 /* * General initialization */ the_thread->Start.is_preemptible = is_preemptible; 4000aa28: e4 2e 60 9c stb %l2, [ %i1 + 0x9c ] the_thread->Start.budget_algorithm = budget_algorithm; 4000aa2c: e0 26 60 a0 st %l0, [ %i1 + 0xa0 ] the_thread->Start.budget_callout = budget_callout; switch ( budget_algorithm ) { 4000aa30: 80 a4 20 02 cmp %l0, 2 4000aa34: 12 80 00 12 bne 4000aa7c <_Thread_Initialize+0x104> 4000aa38: c2 26 60 a4 st %g1, [ %i1 + 0xa4 ] case THREAD_CPU_BUDGET_ALGORITHM_NONE: case THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE: break; #if defined(RTEMS_SCORE_THREAD_ENABLE_EXHAUST_TIMESLICE) case THREAD_CPU_BUDGET_ALGORITHM_EXHAUST_TIMESLICE: the_thread->cpu_time_budget = _Thread_Ticks_per_timeslice; 4000aa3c: 10 80 00 0e b 4000aa74 <_Thread_Initialize+0xfc> 4000aa40: 03 10 00 7c sethi %hi(0x4001f000), %g1 * create the extension long after tasks have been created * so they cannot rely on the thread create user extension * call. */ if ( the_thread->extensions ) { for ( i = 0; i <= _Thread_Maximum_extensions ; i++ ) 4000aa44: 03 10 00 7d sethi %hi(0x4001f400), %g1 4000aa48: c4 00 60 fc ld [ %g1 + 0xfc ], %g2 ! 4001f4fc <_Thread_Maximum_extensions> 4000aa4c: 10 80 00 05 b 4000aa60 <_Thread_Initialize+0xe8> 4000aa50: 82 10 20 00 clr %g1 the_thread->extensions[i] = NULL; 4000aa54: 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++ ) 4000aa58: 82 00 60 01 inc %g1 the_thread->extensions[i] = NULL; 4000aa5c: 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++ ) 4000aa60: 80 a0 40 02 cmp %g1, %g2 4000aa64: 28 bf ff fc bleu,a 4000aa54 <_Thread_Initialize+0xdc> 4000aa68: c8 06 61 54 ld [ %i1 + 0x154 ], %g4 * General initialization */ the_thread->Start.is_preemptible = is_preemptible; the_thread->Start.budget_algorithm = budget_algorithm; the_thread->Start.budget_callout = budget_callout; 4000aa6c: 10 bf ff ef b 4000aa28 <_Thread_Initialize+0xb0> 4000aa70: c2 07 a0 64 ld [ %fp + 0x64 ], %g1 case THREAD_CPU_BUDGET_ALGORITHM_NONE: case THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE: break; #if defined(RTEMS_SCORE_THREAD_ENABLE_EXHAUST_TIMESLICE) case THREAD_CPU_BUDGET_ALGORITHM_EXHAUST_TIMESLICE: the_thread->cpu_time_budget = _Thread_Ticks_per_timeslice; 4000aa74: c2 00 63 e0 ld [ %g1 + 0x3e0 ], %g1 4000aa78: c2 26 60 74 st %g1, [ %i1 + 0x74 ] case THREAD_CPU_BUDGET_ALGORITHM_CALLOUT: break; #endif } the_thread->Start.isr_level = isr_level; 4000aa7c: c2 07 a0 68 ld [ %fp + 0x68 ], %g1 the_thread->current_state = STATES_DORMANT; 4000aa80: b4 10 20 01 mov 1, %i2 case THREAD_CPU_BUDGET_ALGORITHM_CALLOUT: break; #endif } the_thread->Start.isr_level = isr_level; 4000aa84: c2 26 60 a8 st %g1, [ %i1 + 0xa8 ] */ RTEMS_INLINE_ROUTINE void* _Scheduler_Allocate( Thread_Control *the_thread ) { return _Scheduler.Operations.allocate( the_thread ); 4000aa88: 03 10 00 79 sethi %hi(0x4001e400), %g1 4000aa8c: c2 00 63 4c ld [ %g1 + 0x34c ], %g1 ! 4001e74c <_Scheduler+0x18> the_thread->current_state = STATES_DORMANT; 4000aa90: f4 26 60 10 st %i2, [ %i1 + 0x10 ] the_thread->Wait.queue = NULL; 4000aa94: c0 26 60 44 clr [ %i1 + 0x44 ] the_thread->resource_count = 0; 4000aa98: c0 26 60 1c clr [ %i1 + 0x1c ] the_thread->real_priority = priority; 4000aa9c: fa 26 60 18 st %i5, [ %i1 + 0x18 ] the_thread->Start.initial_priority = priority; 4000aaa0: fa 26 60 ac st %i5, [ %i1 + 0xac ] 4000aaa4: 9f c0 40 00 call %g1 4000aaa8: 90 10 00 19 mov %i1, %o0 sched =_Scheduler_Allocate( the_thread ); if ( !sched ) 4000aaac: b6 92 20 00 orcc %o0, 0, %i3 4000aab0: 02 80 00 18 be 4000ab10 <_Thread_Initialize+0x198> 4000aab4: 90 10 00 19 mov %i1, %o0 goto failed; _Thread_Set_priority( the_thread, priority ); 4000aab8: 40 00 01 99 call 4000b11c <_Thread_Set_priority> 4000aabc: 92 10 00 1d mov %i5, %o1 #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 4000aac0: c4 06 20 1c ld [ %i0 + 0x1c ], %g2 Objects_Information *information, Objects_Control *the_object, Objects_Name name ) { _Objects_Set_local_object( 4000aac4: c2 16 60 0a lduh [ %i1 + 0xa ], %g1 static inline void _Timestamp64_implementation_Set_to_zero( Timestamp64_Control *_time ) { *_time = 0; 4000aac8: c0 26 60 80 clr [ %i1 + 0x80 ] 4000aacc: c0 26 60 84 clr [ %i1 + 0x84 ] #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 4000aad0: 83 28 60 02 sll %g1, 2, %g1 4000aad4: f2 20 80 01 st %i1, [ %g2 + %g1 ] information, _Objects_Get_index( the_object->id ), the_object ); the_object->name = name; 4000aad8: e2 26 60 0c st %l1, [ %i1 + 0xc ] * @{ */ static inline bool _User_extensions_Thread_create( Thread_Control *created ) { User_extensions_Thread_create_context ctx = { created, true }; 4000aadc: f2 27 bf f8 st %i1, [ %fp + -8 ] 4000aae0: f4 2f bf fc stb %i2, [ %fp + -4 ] _User_extensions_Iterate( &ctx, _User_extensions_Thread_create_visitor ); 4000aae4: 90 07 bf f8 add %fp, -8, %o0 4000aae8: 13 10 00 2c sethi %hi(0x4000b000), %o1 4000aaec: 40 00 02 3a call 4000b3d4 <_User_extensions_Iterate> 4000aaf0: 92 12 62 b0 or %o1, 0x2b0, %o1 ! 4000b2b0 <_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 ) 4000aaf4: c2 0f bf fc ldub [ %fp + -4 ], %g1 4000aaf8: 80 a0 60 00 cmp %g1, 0 4000aafc: 02 80 00 05 be 4000ab10 <_Thread_Initialize+0x198> 4000ab00: b0 10 20 01 mov 1, %i0 4000ab04: b0 0e 20 01 and %i0, 1, %i0 4000ab08: 81 c7 e0 08 ret 4000ab0c: 81 e8 00 00 restore return true; failed: _Workspace_Free( the_thread->libc_reent ); 4000ab10: 40 00 03 6a call 4000b8b8 <_Workspace_Free> 4000ab14: d0 06 61 48 ld [ %i1 + 0x148 ], %o0 for ( i=0 ; i <= THREAD_API_LAST ; i++ ) _Workspace_Free( the_thread->API_Extensions[i] ); 4000ab18: 40 00 03 68 call 4000b8b8 <_Workspace_Free> 4000ab1c: d0 06 61 4c ld [ %i1 + 0x14c ], %o0 4000ab20: 40 00 03 66 call 4000b8b8 <_Workspace_Free> 4000ab24: d0 06 61 50 ld [ %i1 + 0x150 ], %o0 _Workspace_Free( extensions_area ); 4000ab28: 40 00 03 64 call 4000b8b8 <_Workspace_Free> 4000ab2c: 90 10 00 1c mov %i4, %o0 #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) _Workspace_Free( fp_area ); #endif _Workspace_Free( sched ); 4000ab30: 40 00 03 62 call 4000b8b8 <_Workspace_Free> 4000ab34: 90 10 00 1b mov %i3, %o0 _Thread_Stack_Free( the_thread ); 4000ab38: 40 00 01 b1 call 4000b1fc <_Thread_Stack_Free> 4000ab3c: 90 10 00 19 mov %i1, %o0 stack = the_thread->Start.stack; #else if ( !stack_area ) { actual_stack_size = _Thread_Stack_Allocate( the_thread, stack_size ); if ( !actual_stack_size || actual_stack_size < stack_size ) return false; /* stack allocation failed */ 4000ab40: b0 10 20 00 clr %i0 _Workspace_Free( sched ); _Thread_Stack_Free( the_thread ); return false; } 4000ab44: b0 0e 20 01 and %i0, 1, %i0 4000ab48: 81 c7 e0 08 ret 4000ab4c: 81 e8 00 00 restore =============================================================================== 4000b1fc <_Thread_Stack_Free>: #include void _Thread_Stack_Free( Thread_Control *the_thread ) { 4000b1fc: 9d e3 bf a0 save %sp, -96, %sp #if defined(RTEMS_SCORE_THREAD_ENABLE_USER_PROVIDED_STACK_VIA_API) /* * If the API provided the stack space, then don't free it. */ if ( !the_thread->Start.core_allocated_stack ) 4000b200: c4 0e 20 b0 ldub [ %i0 + 0xb0 ], %g2 void _Thread_Stack_Free( Thread_Control *the_thread ) { rtems_stack_free_hook stack_free_hook = 4000b204: 03 10 00 72 sethi %hi(0x4001c800), %g1 #if defined(RTEMS_SCORE_THREAD_ENABLE_USER_PROVIDED_STACK_VIA_API) /* * If the API provided the stack space, then don't free it. */ if ( !the_thread->Start.core_allocated_stack ) 4000b208: 80 a0 a0 00 cmp %g2, 0 4000b20c: 02 80 00 04 be 4000b21c <_Thread_Stack_Free+0x20> <== NEVER TAKEN 4000b210: c2 00 60 04 ld [ %g1 + 4 ], %g1 * Call ONLY the CPU table stack free hook, or the * the RTEMS workspace free. This is so the free * routine properly matches the allocation of the stack. */ (*stack_free_hook)( the_thread->Start.Initial_stack.area ); 4000b214: 9f c0 40 00 call %g1 4000b218: d0 06 20 b8 ld [ %i0 + 0xb8 ], %o0 4000b21c: 81 c7 e0 08 ret 4000b220: 81 e8 00 00 restore =============================================================================== 4000f978 <_Thread_queue_Extract_fifo>: void _Thread_queue_Extract_fifo( Thread_queue_Control *the_thread_queue __attribute__((unused)), Thread_Control *the_thread ) { 4000f978: 9d e3 bf a0 save %sp, -96, %sp <== NOT EXECUTED ISR_Level level; _ISR_Disable( level ); 4000f97c: 7f ff ca b3 call 40002448 <== NOT EXECUTED 4000f980: 01 00 00 00 nop <== NOT EXECUTED 4000f984: b0 10 00 08 mov %o0, %i0 <== NOT EXECUTED 4000f988: c4 06 60 10 ld [ %i1 + 0x10 ], %g2 <== NOT EXECUTED if ( !_States_Is_waiting_on_thread_queue( the_thread->current_state ) ) { 4000f98c: 03 00 00 ef sethi %hi(0x3bc00), %g1 <== NOT EXECUTED 4000f990: 82 10 62 e0 or %g1, 0x2e0, %g1 ! 3bee0 <== NOT EXECUTED 4000f994: 80 88 80 01 btst %g2, %g1 <== NOT EXECUTED 4000f998: 32 80 00 04 bne,a 4000f9a8 <_Thread_queue_Extract_fifo+0x30><== NOT EXECUTED 4000f99c: c2 06 60 04 ld [ %i1 + 4 ], %g1 <== NOT EXECUTED _ISR_Enable( level ); 4000f9a0: 7f ff ca ae call 40002458 <== NOT EXECUTED 4000f9a4: 81 e8 00 00 restore <== NOT EXECUTED ) { Chain_Node *next; Chain_Node *previous; next = the_node->next; 4000f9a8: c4 06 40 00 ld [ %i1 ], %g2 <== NOT EXECUTED previous = the_node->previous; next->previous = previous; 4000f9ac: c2 20 a0 04 st %g1, [ %g2 + 4 ] <== NOT EXECUTED previous->next = next; 4000f9b0: 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 ) ) { 4000f9b4: c2 06 60 50 ld [ %i1 + 0x50 ], %g1 <== NOT EXECUTED 4000f9b8: 80 a0 60 02 cmp %g1, 2 <== NOT EXECUTED 4000f9bc: 02 80 00 06 be 4000f9d4 <_Thread_queue_Extract_fifo+0x5c> <== NOT EXECUTED 4000f9c0: c0 26 60 44 clr [ %i1 + 0x44 ] <== NOT EXECUTED _ISR_Enable( level ); 4000f9c4: 7f ff ca a5 call 40002458 <== NOT EXECUTED 4000f9c8: b0 10 00 19 mov %i1, %i0 <== NOT EXECUTED 4000f9cc: 10 80 00 09 b 4000f9f0 <_Thread_queue_Extract_fifo+0x78> <== NOT EXECUTED 4000f9d0: 33 04 01 ff sethi %hi(0x1007fc00), %i1 <== NOT EXECUTED 4000f9d4: 82 10 20 03 mov 3, %g1 <== NOT EXECUTED 4000f9d8: c2 26 60 50 st %g1, [ %i1 + 0x50 ] <== NOT EXECUTED } else { _Watchdog_Deactivate( &the_thread->Timer ); _ISR_Enable( level ); 4000f9dc: 7f ff ca 9f call 40002458 <== NOT EXECUTED 4000f9e0: b0 10 00 19 mov %i1, %i0 <== NOT EXECUTED (void) _Watchdog_Remove( &the_thread->Timer ); 4000f9e4: 7f ff ef 14 call 4000b634 <_Watchdog_Remove> <== NOT EXECUTED 4000f9e8: 90 06 60 48 add %i1, 0x48, %o0 <== NOT EXECUTED 4000f9ec: 33 04 01 ff sethi %hi(0x1007fc00), %i1 <== NOT EXECUTED 4000f9f0: b2 16 63 f8 or %i1, 0x3f8, %i1 ! 1007fff8 <== NOT EXECUTED 4000f9f4: 7f ff ea d3 call 4000a540 <_Thread_Clear_state> <== NOT EXECUTED 4000f9f8: 81 e8 00 00 restore <== NOT EXECUTED =============================================================================== 4000b068 <_Thread_queue_Requeue>: void _Thread_queue_Requeue( Thread_queue_Control *the_thread_queue, Thread_Control *the_thread ) { 4000b068: 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 ) 4000b06c: 80 a6 20 00 cmp %i0, 0 4000b070: 02 80 00 19 be 4000b0d4 <_Thread_queue_Requeue+0x6c> <== NEVER TAKEN 4000b074: 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 ) { 4000b078: fa 06 20 34 ld [ %i0 + 0x34 ], %i5 4000b07c: 80 a7 60 01 cmp %i5, 1 4000b080: 12 80 00 15 bne 4000b0d4 <_Thread_queue_Requeue+0x6c> <== NEVER TAKEN 4000b084: 01 00 00 00 nop Thread_queue_Control *tq = the_thread_queue; ISR_Level level; ISR_Level level_ignored; _ISR_Disable( level ); 4000b088: 7f ff dc f0 call 40002448 4000b08c: 01 00 00 00 nop 4000b090: b8 10 00 08 mov %o0, %i4 4000b094: c4 06 60 10 ld [ %i1 + 0x10 ], %g2 if ( _States_Is_waiting_on_thread_queue( the_thread->current_state ) ) { 4000b098: 03 00 00 ef sethi %hi(0x3bc00), %g1 4000b09c: 82 10 62 e0 or %g1, 0x2e0, %g1 ! 3bee0 4000b0a0: 80 88 80 01 btst %g2, %g1 4000b0a4: 02 80 00 0a be 4000b0cc <_Thread_queue_Requeue+0x64> <== NEVER TAKEN 4000b0a8: 90 10 00 18 mov %i0, %o0 _Thread_queue_Enter_critical_section( tq ); _Thread_queue_Extract_priority_helper( tq, the_thread, true ); 4000b0ac: 92 10 00 19 mov %i1, %o1 4000b0b0: 94 10 20 01 mov 1, %o2 4000b0b4: 40 00 0b db call 4000e020 <_Thread_queue_Extract_priority_helper> 4000b0b8: fa 26 20 30 st %i5, [ %i0 + 0x30 ] (void) _Thread_queue_Enqueue_priority( tq, the_thread, &level_ignored ); 4000b0bc: 90 10 00 18 mov %i0, %o0 4000b0c0: 92 10 00 19 mov %i1, %o1 4000b0c4: 7f ff ff 50 call 4000ae04 <_Thread_queue_Enqueue_priority> 4000b0c8: 94 07 bf fc add %fp, -4, %o2 } _ISR_Enable( level ); 4000b0cc: 7f ff dc e3 call 40002458 4000b0d0: 90 10 00 1c mov %i4, %o0 4000b0d4: 81 c7 e0 08 ret 4000b0d8: 81 e8 00 00 restore =============================================================================== 4000b0dc <_Thread_queue_Timeout>: void _Thread_queue_Timeout( Objects_Id id, void *ignored __attribute__((unused)) ) { 4000b0dc: 9d e3 bf 98 save %sp, -104, %sp Thread_Control *the_thread; Objects_Locations location; the_thread = _Thread_Get( id, &location ); 4000b0e0: 90 10 00 18 mov %i0, %o0 4000b0e4: 7f ff fd f9 call 4000a8c8 <_Thread_Get> 4000b0e8: 92 07 bf fc add %fp, -4, %o1 switch ( location ) { 4000b0ec: c2 07 bf fc ld [ %fp + -4 ], %g1 4000b0f0: 80 a0 60 00 cmp %g1, 0 4000b0f4: 12 80 00 08 bne 4000b114 <_Thread_queue_Timeout+0x38> <== NEVER TAKEN 4000b0f8: 01 00 00 00 nop #if defined(RTEMS_MULTIPROCESSING) case OBJECTS_REMOTE: /* impossible */ #endif break; case OBJECTS_LOCAL: _Thread_queue_Process_timeout( the_thread ); 4000b0fc: 40 00 0c 00 call 4000e0fc <_Thread_queue_Process_timeout> 4000b100: 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; 4000b104: 03 10 00 7d sethi %hi(0x4001f400), %g1 4000b108: c4 00 60 80 ld [ %g1 + 0x80 ], %g2 ! 4001f480 <_Thread_Dispatch_disable_level> --level; 4000b10c: 84 00 bf ff add %g2, -1, %g2 _Thread_Dispatch_disable_level = level; 4000b110: c4 20 60 80 st %g2, [ %g1 + 0x80 ] 4000b114: 81 c7 e0 08 ret 4000b118: 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 fa sethi %hi(0x4003e800), %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 f9 sethi %hi(0x4003e400), %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 e0 f8 ld [ %l3 + 0xf8 ], %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 79 call 4001d940 <_Watchdog_Adjust_to_chain> 40019360: 94 10 00 1c mov %i4, %o2 40019364: d0 1d 23 58 ldd [ %l4 + 0x358 ], %o0 40019368: 94 10 20 00 clr %o2 4001936c: 17 0e e6 b2 sethi %hi(0x3b9ac800), %o3 40019370: 40 00 4f 75 call 4002d144 <__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 6c call 4001d940 <_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 11 3e call 4001d8a0 <_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 f4 call 40019f88 <_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 80 call 4001d9e8 <_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 fa sethi %hi(0x4003e800), %g1 40019490: c4 00 60 10 ld [ %g1 + 0x10 ], %g2 ! 4003e810 <_Thread_Dispatch_disable_level> ++level; 40019494: 84 00 a0 01 inc %g2 _Thread_Dispatch_disable_level = level; 40019498: c4 20 60 10 st %g2, [ %g1 + 0x10 ] /* * 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 10 1a call 4001d508 <_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 ce call 4001cbf0 <_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 9f call 4001db48 <_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 9d call 4001db48 <_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 fa sethi %hi(0x4003e800), %g1 400194f8: c4 00 60 10 ld [ %g1 + 0x10 ], %g2 ! 4003e810 <_Thread_Dispatch_disable_level> ++level; 400194fc: 84 00 a0 01 inc %g2 _Thread_Dispatch_disable_level = level; 40019500: c4 20 60 10 st %g2, [ %g1 + 0x10 ] * 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 fa sethi %hi(0x4003e800), %g1 40019520: c4 00 60 f8 ld [ %g1 + 0xf8 ], %g2 ! 4003e8f8 <_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 11 21 call 4001d9e8 <_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 f9 sethi %hi(0x4003e400), %g1 400195a0: d0 18 63 58 ldd [ %g1 + 0x358 ], %o0 ! 4003e758 <_TOD> 400195a4: 94 10 20 00 clr %o2 400195a8: 17 0e e6 b2 sethi %hi(0x3b9ac800), %o3 400195ac: 40 00 4e e6 call 4002d144 <__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 f8 call 4001d9e8 <_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 72 call 4001cbf0 <_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 49 call 40019f58 <_Chain_Append> 40019638: 81 e8 00 00 restore =============================================================================== 4000cba4 <_Timestamp64_Divide>: const Timestamp64_Control *_lhs, const Timestamp64_Control *_rhs, uint32_t *_ival_percentage, uint32_t *_fval_percentage ) { 4000cba4: 9d e3 bf a0 save %sp, -96, %sp Timestamp64_Control answer; if ( *_rhs == 0 ) { 4000cba8: d4 1e 40 00 ldd [ %i1 ], %o2 4000cbac: 80 92 80 0b orcc %o2, %o3, %g0 4000cbb0: 32 80 00 06 bne,a 4000cbc8 <_Timestamp64_Divide+0x24> <== ALWAYS TAKEN 4000cbb4: d8 1e 00 00 ldd [ %i0 ], %o4 *_ival_percentage = 0; 4000cbb8: c0 26 80 00 clr [ %i2 ] <== NOT EXECUTED *_fval_percentage = 0; 4000cbbc: c0 26 c0 00 clr [ %i3 ] <== NOT EXECUTED return; 4000cbc0: 81 c7 e0 08 ret <== NOT EXECUTED 4000cbc4: 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; 4000cbc8: 83 2b 20 02 sll %o4, 2, %g1 4000cbcc: 87 2b 60 02 sll %o5, 2, %g3 4000cbd0: 89 33 60 1e srl %o5, 0x1e, %g4 4000cbd4: bb 28 e0 05 sll %g3, 5, %i5 4000cbd8: 84 11 00 01 or %g4, %g1, %g2 4000cbdc: 83 30 e0 1b srl %g3, 0x1b, %g1 4000cbe0: b9 28 a0 05 sll %g2, 5, %i4 4000cbe4: 86 a7 40 03 subcc %i5, %g3, %g3 4000cbe8: b8 10 40 1c or %g1, %i4, %i4 4000cbec: 84 67 00 02 subx %i4, %g2, %g2 4000cbf0: b2 80 c0 0d addcc %g3, %o5, %i1 4000cbf4: b0 40 80 0c addx %g2, %o4, %i0 4000cbf8: 83 36 60 1e srl %i1, 0x1e, %g1 4000cbfc: 87 2e 60 02 sll %i1, 2, %g3 4000cc00: 85 2e 20 02 sll %i0, 2, %g2 4000cc04: 84 10 40 02 or %g1, %g2, %g2 4000cc08: ba 86 40 03 addcc %i1, %g3, %i5 4000cc0c: b8 46 00 02 addx %i0, %g2, %i4 4000cc10: 83 37 60 1e srl %i5, 0x1e, %g1 4000cc14: 87 2f 60 02 sll %i5, 2, %g3 4000cc18: 85 2f 20 02 sll %i4, 2, %g2 4000cc1c: 84 10 40 02 or %g1, %g2, %g2 4000cc20: 92 87 40 03 addcc %i5, %g3, %o1 4000cc24: 90 47 00 02 addx %i4, %g2, %o0 4000cc28: 87 32 60 1b srl %o1, 0x1b, %g3 4000cc2c: 85 2a 20 05 sll %o0, 5, %g2 4000cc30: 83 2a 60 05 sll %o1, 5, %g1 4000cc34: 90 10 c0 02 or %g3, %g2, %o0 4000cc38: 40 00 39 e6 call 4001b3d0 <__divdi3> 4000cc3c: 92 10 00 01 mov %g1, %o1 *_ival_percentage = answer / 1000; 4000cc40: 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; 4000cc44: b8 10 00 08 mov %o0, %i4 4000cc48: ba 10 00 09 mov %o1, %i5 *_ival_percentage = answer / 1000; 4000cc4c: 40 00 39 e1 call 4001b3d0 <__divdi3> 4000cc50: 96 10 23 e8 mov 0x3e8, %o3 *_fval_percentage = answer % 1000; 4000cc54: 90 10 00 1c mov %i4, %o0 * TODO: Rounding on the last digit of the fval. */ answer = (*_lhs * 100000) / *_rhs; *_ival_percentage = answer / 1000; 4000cc58: d2 26 80 00 st %o1, [ %i2 ] *_fval_percentage = answer % 1000; 4000cc5c: 94 10 20 00 clr %o2 4000cc60: 92 10 00 1d mov %i5, %o1 4000cc64: 40 00 3a c6 call 4001b77c <__moddi3> 4000cc68: 96 10 23 e8 mov 0x3e8, %o3 4000cc6c: d2 26 c0 00 st %o1, [ %i3 ] 4000cc70: 81 c7 e0 08 ret 4000cc74: 81 e8 00 00 restore =============================================================================== 4000b494 <_User_extensions_Handler_initialization>: } } void _User_extensions_Handler_initialization(void) { 4000b494: 9d e3 bf 98 save %sp, -104, %sp uint32_t number_of_initial_extensions = 4000b498: 03 10 00 72 sethi %hi(0x4001c800), %g1 4000b49c: c2 00 60 18 ld [ %g1 + 0x18 ], %g1 ! 4001c818 rtems_configuration_get_number_of_initial_extensions(); if ( number_of_initial_extensions > 0 ) { 4000b4a0: 80 a0 60 00 cmp %g1, 0 4000b4a4: 02 80 00 0a be 4000b4cc <_User_extensions_Handler_initialization+0x38><== NEVER TAKEN 4000b4a8: 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 ) 4000b4ac: 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 = 4000b4b0: 40 00 01 08 call 4000b8d0 <_Workspace_Allocate_or_fatal_error> 4000b4b4: 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 ); 4000b4b8: 13 10 00 2d sethi %hi(0x4000b400), %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 }; 4000b4bc: d0 27 bf fc st %o0, [ %fp + -4 ] _User_extensions_Iterate( &ctx, _User_extensions_Switch_visitor ); 4000b4c0: 92 12 60 50 or %o1, 0x50, %o1 4000b4c4: 7f ff ff c4 call 4000b3d4 <_User_extensions_Iterate> 4000b4c8: 90 07 bf fc add %fp, -4, %o0 4000b4cc: 81 c7 e0 08 ret 4000b4d0: 81 e8 00 00 restore =============================================================================== 4000cedc <_Watchdog_Adjust>: void _Watchdog_Adjust( Chain_Control *header, Watchdog_Adjust_directions direction, Watchdog_Interval units ) { 4000cedc: 9d e3 bf a0 save %sp, -96, %sp ISR_Level level; _ISR_Disable( level ); 4000cee0: 7f ff d8 ec call 40003290 4000cee4: 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; 4000cee8: 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 ); 4000ceec: 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 ) ) { 4000cef0: 80 a0 40 1c cmp %g1, %i4 4000cef4: 02 80 00 20 be 4000cf74 <_Watchdog_Adjust+0x98> 4000cef8: 80 a6 60 00 cmp %i1, 0 switch ( direction ) { 4000cefc: 02 80 00 1b be 4000cf68 <_Watchdog_Adjust+0x8c> 4000cf00: b6 10 20 01 mov 1, %i3 4000cf04: 80 a6 60 01 cmp %i1, 1 4000cf08: 12 80 00 1b bne 4000cf74 <_Watchdog_Adjust+0x98> <== NEVER TAKEN 4000cf0c: 01 00 00 00 nop case WATCHDOG_BACKWARD: _Watchdog_First( header )->delta_interval += units; 4000cf10: c4 00 60 10 ld [ %g1 + 0x10 ], %g2 4000cf14: 10 80 00 07 b 4000cf30 <_Watchdog_Adjust+0x54> 4000cf18: b4 00 80 1a add %g2, %i2, %i2 break; case WATCHDOG_FORWARD: while ( units ) { if ( units < _Watchdog_First( header )->delta_interval ) { 4000cf1c: c4 00 60 10 ld [ %g1 + 0x10 ], %g2 4000cf20: 80 a6 80 02 cmp %i2, %g2 4000cf24: 3a 80 00 05 bcc,a 4000cf38 <_Watchdog_Adjust+0x5c> 4000cf28: f6 20 60 10 st %i3, [ %g1 + 0x10 ] _Watchdog_First( header )->delta_interval -= units; 4000cf2c: b4 20 80 1a sub %g2, %i2, %i2 break; 4000cf30: 10 80 00 11 b 4000cf74 <_Watchdog_Adjust+0x98> 4000cf34: f4 20 60 10 st %i2, [ %g1 + 0x10 ] } else { units -= _Watchdog_First( header )->delta_interval; 4000cf38: b4 26 80 02 sub %i2, %g2, %i2 _Watchdog_First( header )->delta_interval = 1; _ISR_Enable( level ); 4000cf3c: 7f ff d8 d9 call 400032a0 4000cf40: 01 00 00 00 nop _Watchdog_Tickle( header ); 4000cf44: 40 00 00 90 call 4000d184 <_Watchdog_Tickle> 4000cf48: 90 10 00 18 mov %i0, %o0 _ISR_Disable( level ); 4000cf4c: 7f ff d8 d1 call 40003290 4000cf50: 01 00 00 00 nop if ( _Chain_Is_empty( header ) ) 4000cf54: c2 06 00 00 ld [ %i0 ], %g1 4000cf58: 80 a0 40 1c cmp %g1, %i4 4000cf5c: 12 80 00 04 bne 4000cf6c <_Watchdog_Adjust+0x90> 4000cf60: 80 a6 a0 00 cmp %i2, 0 4000cf64: 30 80 00 04 b,a 4000cf74 <_Watchdog_Adjust+0x98> switch ( direction ) { case WATCHDOG_BACKWARD: _Watchdog_First( header )->delta_interval += units; break; case WATCHDOG_FORWARD: while ( units ) { 4000cf68: 80 a6 a0 00 cmp %i2, 0 4000cf6c: 32 bf ff ec bne,a 4000cf1c <_Watchdog_Adjust+0x40> <== ALWAYS TAKEN 4000cf70: c2 06 00 00 ld [ %i0 ], %g1 } break; } } _ISR_Enable( level ); 4000cf74: 7f ff d8 cb call 400032a0 4000cf78: 91 e8 00 08 restore %g0, %o0, %o0 =============================================================================== 4000b634 <_Watchdog_Remove>: #include Watchdog_States _Watchdog_Remove( Watchdog_Control *the_watchdog ) { 4000b634: 9d e3 bf a0 save %sp, -96, %sp ISR_Level level; Watchdog_States previous_state; Watchdog_Control *next_watchdog; _ISR_Disable( level ); 4000b638: 7f ff db 84 call 40002448 4000b63c: ba 10 00 18 mov %i0, %i5 previous_state = the_watchdog->state; 4000b640: f0 06 20 08 ld [ %i0 + 8 ], %i0 switch ( previous_state ) { 4000b644: 80 a6 20 01 cmp %i0, 1 4000b648: 22 80 00 1e be,a 4000b6c0 <_Watchdog_Remove+0x8c> 4000b64c: c0 27 60 08 clr [ %i5 + 8 ] 4000b650: 0a 80 00 1d bcs 4000b6c4 <_Watchdog_Remove+0x90> 4000b654: 03 10 00 7d sethi %hi(0x4001f400), %g1 4000b658: 80 a6 20 03 cmp %i0, 3 4000b65c: 18 80 00 1a bgu 4000b6c4 <_Watchdog_Remove+0x90> <== NEVER TAKEN 4000b660: 01 00 00 00 nop RTEMS_INLINE_ROUTINE Watchdog_Control *_Watchdog_Next( Watchdog_Control *the_watchdog ) { return ( (Watchdog_Control *) the_watchdog->Node.next ); 4000b664: 10 80 00 02 b 4000b66c <_Watchdog_Remove+0x38> 4000b668: c2 07 40 00 ld [ %i5 ], %g1 break; case WATCHDOG_ACTIVE: case WATCHDOG_REMOVE_IT: the_watchdog->state = WATCHDOG_INACTIVE; 4000b66c: c0 27 60 08 clr [ %i5 + 8 ] next_watchdog = _Watchdog_Next( the_watchdog ); if ( _Watchdog_Next(next_watchdog) ) 4000b670: c4 00 40 00 ld [ %g1 ], %g2 4000b674: 80 a0 a0 00 cmp %g2, 0 4000b678: 02 80 00 07 be 4000b694 <_Watchdog_Remove+0x60> 4000b67c: 05 10 00 7d sethi %hi(0x4001f400), %g2 next_watchdog->delta_interval += the_watchdog->delta_interval; 4000b680: c6 00 60 10 ld [ %g1 + 0x10 ], %g3 4000b684: c4 07 60 10 ld [ %i5 + 0x10 ], %g2 4000b688: 84 00 c0 02 add %g3, %g2, %g2 4000b68c: c4 20 60 10 st %g2, [ %g1 + 0x10 ] if ( _Watchdog_Sync_count ) 4000b690: 05 10 00 7d sethi %hi(0x4001f400), %g2 4000b694: c4 00 a1 64 ld [ %g2 + 0x164 ], %g2 ! 4001f564 <_Watchdog_Sync_count> 4000b698: 80 a0 a0 00 cmp %g2, 0 4000b69c: 22 80 00 07 be,a 4000b6b8 <_Watchdog_Remove+0x84> 4000b6a0: c4 07 60 04 ld [ %i5 + 4 ], %g2 _Watchdog_Sync_level = _ISR_Nest_level; 4000b6a4: 05 10 00 7e sethi %hi(0x4001f800), %g2 4000b6a8: c6 00 a1 98 ld [ %g2 + 0x198 ], %g3 ! 4001f998 <_Per_CPU_Information+0x8> 4000b6ac: 05 10 00 7d sethi %hi(0x4001f400), %g2 4000b6b0: c6 20 a1 04 st %g3, [ %g2 + 0x104 ] ! 4001f504 <_Watchdog_Sync_level> { Chain_Node *next; Chain_Node *previous; next = the_node->next; previous = the_node->previous; 4000b6b4: c4 07 60 04 ld [ %i5 + 4 ], %g2 next->previous = previous; 4000b6b8: c4 20 60 04 st %g2, [ %g1 + 4 ] previous->next = next; 4000b6bc: c2 20 80 00 st %g1, [ %g2 ] _Chain_Extract_unprotected( &the_watchdog->Node ); break; } the_watchdog->stop_time = _Watchdog_Ticks_since_boot; 4000b6c0: 03 10 00 7d sethi %hi(0x4001f400), %g1 4000b6c4: c2 00 61 68 ld [ %g1 + 0x168 ], %g1 ! 4001f568 <_Watchdog_Ticks_since_boot> 4000b6c8: c2 27 60 18 st %g1, [ %i5 + 0x18 ] _ISR_Enable( level ); 4000b6cc: 7f ff db 63 call 40002458 4000b6d0: 01 00 00 00 nop return( previous_state ); } 4000b6d4: 81 c7 e0 08 ret 4000b6d8: 81 e8 00 00 restore =============================================================================== 4000c888 <_Watchdog_Report_chain>: void _Watchdog_Report_chain( const char *name, Chain_Control *header ) { 4000c888: 9d e3 bf a0 save %sp, -96, %sp ISR_Level level; Chain_Node *node; _ISR_Disable( level ); 4000c88c: 7f ff d9 5e call 40002e04 4000c890: b8 10 00 18 mov %i0, %i4 4000c894: b0 10 00 08 mov %o0, %i0 printk( "Watchdog Chain: %s %p\n", name, header ); 4000c898: 11 10 00 7c sethi %hi(0x4001f000), %o0 4000c89c: 94 10 00 19 mov %i1, %o2 4000c8a0: 90 12 23 d8 or %o0, 0x3d8, %o0 4000c8a4: 7f ff e3 dd call 40005818 4000c8a8: 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; 4000c8ac: 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 ); 4000c8b0: b2 06 60 04 add %i1, 4, %i1 if ( !_Chain_Is_empty( header ) ) { 4000c8b4: 80 a7 40 19 cmp %i5, %i1 4000c8b8: 12 80 00 04 bne 4000c8c8 <_Watchdog_Report_chain+0x40> 4000c8bc: 92 10 00 1d mov %i5, %o1 _Watchdog_Report( NULL, watch ); } printk( "== end of %s \n", name ); } else { printk( "Chain is empty\n" ); 4000c8c0: 10 80 00 0d b 4000c8f4 <_Watchdog_Report_chain+0x6c> 4000c8c4: 11 10 00 7d sethi %hi(0x4001f400), %o0 node != _Chain_Tail(header) ; node = node->next ) { Watchdog_Control *watch = (Watchdog_Control *) node; _Watchdog_Report( NULL, watch ); 4000c8c8: 40 00 00 0f call 4000c904 <_Watchdog_Report> 4000c8cc: 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 ) 4000c8d0: 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 ) ; 4000c8d4: 80 a7 40 19 cmp %i5, %i1 4000c8d8: 12 bf ff fc bne 4000c8c8 <_Watchdog_Report_chain+0x40> <== NEVER TAKEN 4000c8dc: 92 10 00 1d mov %i5, %o1 { Watchdog_Control *watch = (Watchdog_Control *) node; _Watchdog_Report( NULL, watch ); } printk( "== end of %s \n", name ); 4000c8e0: 11 10 00 7c sethi %hi(0x4001f000), %o0 4000c8e4: 92 10 00 1c mov %i4, %o1 4000c8e8: 7f ff e3 cc call 40005818 4000c8ec: 90 12 23 f0 or %o0, 0x3f0, %o0 4000c8f0: 30 80 00 03 b,a 4000c8fc <_Watchdog_Report_chain+0x74> } else { printk( "Chain is empty\n" ); 4000c8f4: 7f ff e3 c9 call 40005818 4000c8f8: 90 12 20 00 mov %o0, %o0 } _ISR_Enable( level ); 4000c8fc: 7f ff d9 46 call 40002e14 4000c900: 81 e8 00 00 restore =============================================================================== 4000b6dc <_Watchdog_Tickle>: #include void _Watchdog_Tickle( Chain_Control *header ) { 4000b6dc: 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 ); 4000b6e0: 7f ff db 5a call 40002448 4000b6e4: b8 10 00 18 mov %i0, %i4 4000b6e8: 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; 4000b6ec: 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 ); 4000b6f0: b6 07 20 04 add %i4, 4, %i3 if ( _Chain_Is_empty( header ) ) 4000b6f4: 80 a7 40 1b cmp %i5, %i3 4000b6f8: 02 80 00 1f be 4000b774 <_Watchdog_Tickle+0x98> 4000b6fc: 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) { 4000b700: c2 07 60 10 ld [ %i5 + 0x10 ], %g1 4000b704: 80 a0 60 00 cmp %g1, 0 4000b708: 02 80 00 06 be 4000b720 <_Watchdog_Tickle+0x44> <== NEVER TAKEN 4000b70c: 82 00 7f ff add %g1, -1, %g1 the_watchdog->delta_interval--; 4000b710: c2 27 60 10 st %g1, [ %i5 + 0x10 ] if ( the_watchdog->delta_interval != 0 ) 4000b714: 80 a0 60 00 cmp %g1, 0 4000b718: 12 80 00 17 bne 4000b774 <_Watchdog_Tickle+0x98> 4000b71c: 01 00 00 00 nop goto leave; } do { watchdog_state = _Watchdog_Remove( the_watchdog ); 4000b720: 7f ff ff c5 call 4000b634 <_Watchdog_Remove> 4000b724: 90 10 00 1d mov %i5, %o0 4000b728: b4 10 00 08 mov %o0, %i2 _ISR_Enable( level ); 4000b72c: 7f ff db 4b call 40002458 4000b730: 90 10 00 18 mov %i0, %o0 switch( watchdog_state ) { 4000b734: 80 a6 a0 02 cmp %i2, 2 4000b738: 12 80 00 06 bne 4000b750 <_Watchdog_Tickle+0x74> 4000b73c: 01 00 00 00 nop case WATCHDOG_ACTIVE: (*the_watchdog->routine)( 4000b740: c2 07 60 1c ld [ %i5 + 0x1c ], %g1 4000b744: d0 07 60 20 ld [ %i5 + 0x20 ], %o0 4000b748: 9f c0 40 00 call %g1 4000b74c: d2 07 60 24 ld [ %i5 + 0x24 ], %o1 case WATCHDOG_REMOVE_IT: break; } _ISR_Disable( level ); 4000b750: 7f ff db 3e call 40002448 4000b754: 01 00 00 00 nop 4000b758: b0 10 00 08 mov %o0, %i0 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_First( Chain_Control *the_chain ) { return _Chain_Head( the_chain )->next; 4000b75c: fa 07 00 00 ld [ %i4 ], %i5 the_watchdog = _Watchdog_First( header ); } while ( !_Chain_Is_empty( header ) && (the_watchdog->delta_interval == 0) ); 4000b760: 80 a7 40 1b cmp %i5, %i3 4000b764: 02 80 00 04 be 4000b774 <_Watchdog_Tickle+0x98> 4000b768: 01 00 00 00 nop } _ISR_Disable( level ); the_watchdog = _Watchdog_First( header ); } while ( !_Chain_Is_empty( header ) && 4000b76c: 10 bf ff ea b 4000b714 <_Watchdog_Tickle+0x38> 4000b770: c2 07 60 10 ld [ %i5 + 0x10 ], %g1 (the_watchdog->delta_interval == 0) ); leave: _ISR_Enable(level); 4000b774: 7f ff db 39 call 40002458 4000b778: 81 e8 00 00 restore =============================================================================== 4000b77c <_Workspace_Handler_initialization>: void _Workspace_Handler_initialization( Heap_Area *areas, size_t area_count, Heap_Initialization_or_extend_handler extend ) { 4000b77c: 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(); 4000b780: 05 10 00 71 sethi %hi(0x4001c400), %g2 4000b784: 82 10 a3 d8 or %g2, 0x3d8, %g1 ! 4001c7d8 4000b788: c6 08 60 32 ldub [ %g1 + 0x32 ], %g3 4000b78c: fa 00 a3 d8 ld [ %g2 + 0x3d8 ], %i5 4000b790: 80 a0 e0 00 cmp %g3, 0 4000b794: 12 80 00 03 bne 4000b7a0 <_Workspace_Handler_initialization+0x24> 4000b798: 84 10 20 00 clr %g2 4000b79c: 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; 4000b7a0: 21 10 00 24 sethi %hi(0x40009000), %l0 } else { size = 0; } } space_available = (*init_or_extend)( 4000b7a4: 27 10 00 7d sethi %hi(0x4001f400), %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(); 4000b7a8: 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) { 4000b7ac: 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; 4000b7b0: a0 14 21 d4 or %l0, 0x1d4, %l0 size_t i; for (i = 0; i < area_count; ++i) { Heap_Area *area = &areas [i]; if ( do_zero ) { 4000b7b4: e2 08 60 30 ldub [ %g1 + 0x30 ], %l1 if ( area->size > overhead ) { uintptr_t space_available; uintptr_t size; if ( unified ) { 4000b7b8: 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) { 4000b7bc: 10 80 00 2c b 4000b86c <_Workspace_Handler_initialization+0xf0> 4000b7c0: a6 14 e0 90 or %l3, 0x90, %l3 Heap_Area *area = &areas [i]; if ( do_zero ) { 4000b7c4: 22 80 00 07 be,a 4000b7e0 <_Workspace_Handler_initialization+0x64> 4000b7c8: f8 06 20 04 ld [ %i0 + 4 ], %i4 memset( area->begin, 0, area->size ); 4000b7cc: d0 06 00 00 ld [ %i0 ], %o0 4000b7d0: d4 06 20 04 ld [ %i0 + 4 ], %o2 4000b7d4: 40 00 13 52 call 4001051c 4000b7d8: 92 10 20 00 clr %o1 } if ( area->size > overhead ) { 4000b7dc: f8 06 20 04 ld [ %i0 + 4 ], %i4 4000b7e0: 80 a7 20 16 cmp %i4, 0x16 4000b7e4: 28 80 00 21 bleu,a 4000b868 <_Workspace_Handler_initialization+0xec> 4000b7e8: b6 06 e0 01 inc %i3 uintptr_t space_available; uintptr_t size; if ( unified ) { 4000b7ec: 80 a4 a0 00 cmp %l2, 0 4000b7f0: 32 80 00 0c bne,a 4000b820 <_Workspace_Handler_initialization+0xa4> 4000b7f4: d2 06 00 00 ld [ %i0 ], %o1 size = area->size; } else { if ( remaining > 0 ) { 4000b7f8: 80 a7 60 00 cmp %i5, 0 4000b7fc: 22 80 00 08 be,a 4000b81c <_Workspace_Handler_initialization+0xa0><== NEVER TAKEN 4000b800: b8 10 20 00 clr %i4 <== NOT EXECUTED size = remaining < area->size - overhead ? 4000b804: 82 07 3f ea add %i4, -22, %g1 remaining + overhead : area->size; 4000b808: 80 a7 40 01 cmp %i5, %g1 4000b80c: 2a 80 00 04 bcs,a 4000b81c <_Workspace_Handler_initialization+0xa0><== ALWAYS TAKEN 4000b810: b8 07 60 16 add %i5, 0x16, %i4 } else { size = 0; } } space_available = (*init_or_extend)( 4000b814: 10 80 00 03 b 4000b820 <_Workspace_Handler_initialization+0xa4><== NOT EXECUTED 4000b818: d2 06 00 00 ld [ %i0 ], %o1 <== NOT EXECUTED 4000b81c: d2 06 00 00 ld [ %i0 ], %o1 4000b820: 94 10 00 1c mov %i4, %o2 4000b824: 90 10 00 13 mov %l3, %o0 4000b828: 9f c4 00 00 call %l0 4000b82c: 96 10 20 08 mov 8, %o3 area->begin, size, page_size ); area->begin = (char *) area->begin + size; 4000b830: c2 06 00 00 ld [ %i0 ], %g1 area->size -= size; if ( space_available < remaining ) { 4000b834: 80 a2 00 1d cmp %o0, %i5 area->begin, size, page_size ); area->begin = (char *) area->begin + size; 4000b838: 82 00 40 1c add %g1, %i4, %g1 4000b83c: c2 26 00 00 st %g1, [ %i0 ] area->size -= size; 4000b840: c2 06 20 04 ld [ %i0 + 4 ], %g1 4000b844: b8 20 40 1c sub %g1, %i4, %i4 if ( space_available < remaining ) { 4000b848: 1a 80 00 05 bcc 4000b85c <_Workspace_Handler_initialization+0xe0><== ALWAYS TAKEN 4000b84c: f8 26 20 04 st %i4, [ %i0 + 4 ] remaining -= space_available; 4000b850: ba 27 40 08 sub %i5, %o0, %i5 <== NOT EXECUTED } else { remaining = 0; } init_or_extend = extend; 4000b854: 10 80 00 04 b 4000b864 <_Workspace_Handler_initialization+0xe8><== NOT EXECUTED 4000b858: a0 10 00 1a mov %i2, %l0 <== NOT EXECUTED 4000b85c: a0 10 00 1a mov %i2, %l0 area->size -= size; if ( space_available < remaining ) { remaining -= space_available; } else { remaining = 0; 4000b860: 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) { 4000b864: b6 06 e0 01 inc %i3 4000b868: b0 06 20 08 add %i0, 8, %i0 4000b86c: 80 a6 c0 19 cmp %i3, %i1 4000b870: 12 bf ff d5 bne 4000b7c4 <_Workspace_Handler_initialization+0x48> 4000b874: 80 a4 60 00 cmp %l1, 0 init_or_extend = extend; } } if ( remaining > 0 ) { 4000b878: 80 a7 60 00 cmp %i5, 0 4000b87c: 02 80 00 05 be 4000b890 <_Workspace_Handler_initialization+0x114> 4000b880: 90 10 20 00 clr %o0 _Internal_error_Occurred( 4000b884: 92 10 20 01 mov 1, %o1 4000b888: 7f ff f6 e6 call 40009420 <_Internal_error_Occurred> 4000b88c: 94 10 20 02 mov 2, %o2 4000b890: 81 c7 e0 08 ret 4000b894: 81 e8 00 00 restore =============================================================================== 4001b8cc <_calloc_r>: struct _reent *ignored __attribute__((unused)), size_t elements, size_t size ) { return calloc( elements, size ); 4001b8cc: 90 10 00 09 mov %o1, %o0 <== NOT EXECUTED 4001b8d0: 92 10 00 0a mov %o2, %o1 <== NOT EXECUTED 4001b8d4: 82 13 c0 00 mov %o7, %g1 <== NOT EXECUTED 4001b8d8: 7f ff a1 20 call 40003d58 <== NOT EXECUTED 4001b8dc: 9e 10 40 00 mov %g1, %o7 <== NOT EXECUTED =============================================================================== 4001b954 <_close_r>: int _close_r( struct _reent *ptr __attribute__((unused)), int fd ) { return close( fd ); 4001b954: 90 10 00 09 mov %o1, %o0 4001b958: 82 13 c0 00 mov %o7, %g1 4001b95c: 7f ff ff e1 call 4001b8e0 4001b960: 9e 10 40 00 mov %g1, %o7 =============================================================================== 4001354c <_fat_block_read>: uint32_t start, uint32_t offset, uint32_t count, void *buff ) { 4001354c: 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) 40013550: 10 80 00 17 b 400135ac <_fat_block_read+0x60> 40013554: ba 10 20 00 clr %i5 { rc = fat_buf_access(fs_info, sec_num, FAT_OP_TYPE_READ, &sec_buf); 40013558: 92 10 00 19 mov %i1, %o1 4001355c: 94 10 20 01 mov 1, %o2 40013560: 7f ff ff cc call 40013490 40013564: 96 07 bf fc add %fp, -4, %o3 if (rc != RC_OK) 40013568: 80 a2 20 00 cmp %o0, 0 4001356c: 32 80 00 15 bne,a 400135c0 <_fat_block_read+0x74> <== NEVER TAKEN 40013570: ba 10 3f ff mov -1, %i5 <== NOT EXECUTED return -1; c = MIN(count, (fs_info->vol.bps - ofs)); 40013574: e0 16 00 00 lduh [ %i0 ], %l0 40013578: a0 24 00 1a sub %l0, %i2, %l0 4001357c: 80 a4 00 1b cmp %l0, %i3 40013580: 38 80 00 02 bgu,a 40013588 <_fat_block_read+0x3c> 40013584: a0 10 00 1b mov %i3, %l0 memcpy((buff + cmpltd), (sec_buf + ofs), c); 40013588: d2 07 bf fc ld [ %fp + -4 ], %o1 4001358c: 90 07 00 1d add %i4, %i5, %o0 40013590: 92 02 40 1a add %o1, %i2, %o1 40013594: 94 10 00 10 mov %l0, %o2 40013598: 40 00 23 90 call 4001c3d8 4001359c: b6 26 c0 10 sub %i3, %l0, %i3 count -= c; cmpltd += c; 400135a0: ba 04 00 1d add %l0, %i5, %i5 sec_num++; 400135a4: b2 06 60 01 inc %i1 ofs = 0; 400135a8: 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) 400135ac: 80 a6 e0 00 cmp %i3, 0 400135b0: 12 bf ff ea bne 40013558 <_fat_block_read+0xc> 400135b4: 90 10 00 18 mov %i0, %o0 cmpltd += c; sec_num++; ofs = 0; } return cmpltd; } 400135b8: 81 c7 e0 08 ret 400135bc: 91 e8 00 1d restore %g0, %i5, %o0 400135c0: b0 10 00 1d mov %i5, %i0 <== NOT EXECUTED 400135c4: 81 c7 e0 08 ret <== NOT EXECUTED 400135c8: 81 e8 00 00 restore <== 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 =============================================================================== 40007d74 : #include #include #include int aio_cancel(int fildes, struct aiocb *aiocbp) { 40007d74: 9d e3 bf a0 save %sp, -96, %sp rtems_aio_request_chain *r_chain; int result; pthread_mutex_lock (&aio_request_queue.mutex); 40007d78: 3b 10 00 65 sethi %hi(0x40019400), %i5 40007d7c: 40 00 04 68 call 40008f1c 40007d80: 90 17 60 cc or %i5, 0xcc, %o0 ! 400194cc if (fcntl (fildes, F_GETFD) < 0) { 40007d84: 90 10 00 18 mov %i0, %o0 40007d88: 40 00 1a 1d call 4000e5fc 40007d8c: 92 10 20 01 mov 1, %o1 40007d90: 80 a2 20 00 cmp %o0, 0 40007d94: 16 80 00 08 bge 40007db4 40007d98: 80 a6 60 00 cmp %i1, 0 pthread_mutex_unlock(&aio_request_queue.mutex); 40007d9c: 40 00 04 81 call 40008fa0 40007da0: 90 17 60 cc or %i5, 0xcc, %o0 rtems_set_errno_and_return_minus_one (EBADF); 40007da4: 40 00 27 4d call 40011ad8 <__errno> 40007da8: 01 00 00 00 nop 40007dac: 10 80 00 54 b 40007efc 40007db0: 82 10 20 09 mov 9, %g1 ! 9 } /* if aiocbp is NULL remove all request for given file descriptor */ if (aiocbp == NULL) { 40007db4: 32 80 00 35 bne,a 40007e88 40007db8: f8 06 40 00 ld [ %i1 ], %i4 AIO_printf ("Cancel all requests\n"); r_chain = rtems_aio_search_fd (&aio_request_queue.work_req, fildes, 0); 40007dbc: 11 10 00 65 sethi %hi(0x40019400), %o0 40007dc0: 92 10 00 18 mov %i0, %o1 40007dc4: 90 12 21 14 or %o0, 0x114, %o0 40007dc8: 40 00 01 71 call 4000838c 40007dcc: 94 10 20 00 clr %o2 if (r_chain == NULL) { 40007dd0: b8 92 20 00 orcc %o0, 0, %i4 40007dd4: 12 80 00 20 bne 40007e54 40007dd8: b6 07 20 1c add %i4, 0x1c, %i3 */ RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_first( const Chain_Control *the_chain ) { return _Chain_Immutable_head( the_chain )->next; 40007ddc: ba 17 60 cc or %i5, 0xcc, %i5 AIO_printf ("Request chain not on [WQ]\n"); if (!rtems_chain_is_empty (&aio_request_queue.idle_req)) { 40007de0: c4 07 60 54 ld [ %i5 + 0x54 ], %g2 40007de4: 82 07 60 58 add %i5, 0x58, %g1 40007de8: 80 a0 80 01 cmp %g2, %g1 40007dec: 02 80 00 08 be 40007e0c <== NEVER TAKEN 40007df0: 92 10 00 18 mov %i0, %o1 r_chain = rtems_aio_search_fd (&aio_request_queue.idle_req, fildes, 0); 40007df4: 90 07 60 54 add %i5, 0x54, %o0 40007df8: 40 00 01 65 call 4000838c 40007dfc: 94 10 20 00 clr %o2 if (r_chain == NULL) { 40007e00: b8 92 20 00 orcc %o0, 0, %i4 40007e04: 12 80 00 08 bne 40007e24 40007e08: 01 00 00 00 nop pthread_mutex_unlock(&aio_request_queue.mutex); 40007e0c: 11 10 00 65 sethi %hi(0x40019400), %o0 return AIO_ALLDONE; 40007e10: b0 10 20 02 mov 2, %i0 AIO_printf ("Request chain not on [WQ]\n"); if (!rtems_chain_is_empty (&aio_request_queue.idle_req)) { r_chain = rtems_aio_search_fd (&aio_request_queue.idle_req, fildes, 0); if (r_chain == NULL) { pthread_mutex_unlock(&aio_request_queue.mutex); 40007e14: 40 00 04 63 call 40008fa0 40007e18: 90 12 20 cc or %o0, 0xcc, %o0 return AIO_ALLDONE; 40007e1c: 81 c7 e0 08 ret 40007e20: 81 e8 00 00 restore */ RTEMS_INLINE_ROUTINE void rtems_chain_extract( rtems_chain_node *the_node ) { _Chain_Extract( the_node ); 40007e24: 40 00 0a cf call 4000a960 <_Chain_Extract> 40007e28: b6 07 20 1c add %i4, 0x1c, %i3 } AIO_printf ("Request chain on [IQ]\n"); rtems_chain_extract (&r_chain->next_fd); rtems_aio_remove_fd (r_chain); 40007e2c: 40 00 01 80 call 4000842c 40007e30: 90 10 00 1c mov %i4, %o0 pthread_mutex_destroy (&r_chain->mutex); 40007e34: 40 00 03 8d call 40008c68 40007e38: 90 10 00 1b mov %i3, %o0 pthread_cond_destroy (&r_chain->mutex); 40007e3c: 40 00 02 ae call 400088f4 40007e40: 90 10 00 1b mov %i3, %o0 free (r_chain); 40007e44: 7f ff f1 3d call 40004338 40007e48: 90 10 00 1c mov %i4, %o0 pthread_mutex_unlock (&aio_request_queue.mutex); 40007e4c: 10 80 00 0b b 40007e78 40007e50: 90 10 00 1d mov %i5, %o0 return AIO_ALLDONE; } AIO_printf ("Request chain on [WQ]\n"); pthread_mutex_lock (&r_chain->mutex); 40007e54: 40 00 04 32 call 40008f1c 40007e58: 90 10 00 1b mov %i3, %o0 40007e5c: 40 00 0a c1 call 4000a960 <_Chain_Extract> 40007e60: 90 10 00 1c mov %i4, %o0 rtems_chain_extract (&r_chain->next_fd); rtems_aio_remove_fd (r_chain); 40007e64: 40 00 01 72 call 4000842c 40007e68: 90 10 00 1c mov %i4, %o0 pthread_mutex_unlock (&r_chain->mutex); 40007e6c: 40 00 04 4d call 40008fa0 40007e70: 90 10 00 1b mov %i3, %o0 pthread_mutex_unlock (&aio_request_queue.mutex); 40007e74: 90 17 60 cc or %i5, 0xcc, %o0 40007e78: 40 00 04 4a call 40008fa0 40007e7c: b0 10 20 00 clr %i0 return AIO_CANCELED; 40007e80: 81 c7 e0 08 ret 40007e84: 81 e8 00 00 restore } else { AIO_printf ("Cancel request\n"); if (aiocbp->aio_fildes != fildes) { 40007e88: 80 a7 00 18 cmp %i4, %i0 40007e8c: 12 80 00 17 bne 40007ee8 40007e90: 90 17 60 cc or %i5, 0xcc, %o0 pthread_mutex_unlock (&aio_request_queue.mutex); rtems_set_errno_and_return_minus_one (EINVAL); } r_chain = rtems_aio_search_fd (&aio_request_queue.work_req, fildes, 0); 40007e94: 11 10 00 65 sethi %hi(0x40019400), %o0 40007e98: 92 10 00 1c mov %i4, %o1 40007e9c: 90 12 21 14 or %o0, 0x114, %o0 40007ea0: 40 00 01 3b call 4000838c 40007ea4: 94 10 20 00 clr %o2 if (r_chain == NULL) { 40007ea8: b6 92 20 00 orcc %o0, 0, %i3 40007eac: 32 80 00 1c bne,a 40007f1c 40007eb0: b8 06 e0 1c add %i3, 0x1c, %i4 40007eb4: ba 17 60 cc or %i5, 0xcc, %i5 if (!rtems_chain_is_empty (&aio_request_queue.idle_req)) { 40007eb8: c4 07 60 54 ld [ %i5 + 0x54 ], %g2 40007ebc: 82 07 60 58 add %i5, 0x58, %g1 40007ec0: 80 a0 80 01 cmp %g2, %g1 40007ec4: 02 bf ff d2 be 40007e0c <== NEVER TAKEN 40007ec8: 92 10 00 1c mov %i4, %o1 r_chain = rtems_aio_search_fd (&aio_request_queue.idle_req, fildes, 0); 40007ecc: 90 07 60 54 add %i5, 0x54, %o0 40007ed0: 40 00 01 2f call 4000838c 40007ed4: 94 10 20 00 clr %o2 if (r_chain == NULL) { 40007ed8: 80 a2 20 00 cmp %o0, 0 40007edc: 12 80 00 0b bne 40007f08 40007ee0: 90 02 20 08 add %o0, 8, %o0 pthread_mutex_unlock (&aio_request_queue.mutex); 40007ee4: 90 10 00 1d mov %i5, %o0 40007ee8: 40 00 04 2e call 40008fa0 40007eec: 01 00 00 00 nop rtems_set_errno_and_return_minus_one (EINVAL); 40007ef0: 40 00 26 fa call 40011ad8 <__errno> 40007ef4: 01 00 00 00 nop 40007ef8: 82 10 20 16 mov 0x16, %g1 ! 16 40007efc: c2 22 00 00 st %g1, [ %o0 ] 40007f00: 81 c7 e0 08 ret 40007f04: 91 e8 3f ff restore %g0, -1, %o0 } AIO_printf ("Request on [IQ]\n"); result = rtems_aio_remove_req (&r_chain->perfd, aiocbp); 40007f08: 40 00 01 5d call 4000847c 40007f0c: 92 10 00 19 mov %i1, %o1 40007f10: b0 10 00 08 mov %o0, %i0 pthread_mutex_unlock (&aio_request_queue.mutex); 40007f14: 10 80 00 0b b 40007f40 40007f18: 90 10 00 1d mov %i5, %o0 return AIO_ALLDONE; } } AIO_printf ("Request on [WQ]\n"); pthread_mutex_lock (&r_chain->mutex); 40007f1c: 40 00 04 00 call 40008f1c 40007f20: 90 10 00 1c mov %i4, %o0 result = rtems_aio_remove_req (&r_chain->perfd, aiocbp); 40007f24: 92 10 00 19 mov %i1, %o1 40007f28: 40 00 01 55 call 4000847c 40007f2c: 90 06 e0 08 add %i3, 8, %o0 40007f30: b0 10 00 08 mov %o0, %i0 pthread_mutex_unlock (&r_chain->mutex); 40007f34: 40 00 04 1b call 40008fa0 40007f38: 90 10 00 1c mov %i4, %o0 pthread_mutex_unlock (&aio_request_queue.mutex); 40007f3c: 90 17 60 cc or %i5, 0xcc, %o0 40007f40: 40 00 04 18 call 40008fa0 40007f44: 01 00 00 00 nop return result; } return AIO_ALLDONE; } 40007f48: 81 c7 e0 08 ret 40007f4c: 81 e8 00 00 restore =============================================================================== 40007f58 : int aio_fsync( int op, struct aiocb *aiocbp ) { 40007f58: 9d e3 bf a0 save %sp, -96, %sp rtems_aio_request *req; int mode; if (op != O_SYNC) 40007f5c: 03 00 00 08 sethi %hi(0x2000), %g1 40007f60: 80 a6 00 01 cmp %i0, %g1 40007f64: 12 80 00 10 bne 40007fa4 40007f68: ba 10 20 16 mov 0x16, %i5 rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp); mode = fcntl (aiocbp->aio_fildes, F_GETFL); 40007f6c: d0 06 40 00 ld [ %i1 ], %o0 40007f70: 40 00 19 a3 call 4000e5fc 40007f74: 92 10 20 03 mov 3, %o1 if (!(((mode & O_ACCMODE) == O_WRONLY) || ((mode & O_ACCMODE) == O_RDWR))) 40007f78: 90 0a 20 03 and %o0, 3, %o0 40007f7c: 90 02 3f ff add %o0, -1, %o0 40007f80: 80 a2 20 01 cmp %o0, 1 40007f84: 18 80 00 08 bgu 40007fa4 40007f88: ba 10 20 09 mov 9, %i5 rtems_aio_set_errno_return_minus_one (EBADF, aiocbp); req = malloc (sizeof (rtems_aio_request)); 40007f8c: 7f ff f2 0b call 400047b8 40007f90: 90 10 20 18 mov 0x18, %o0 if (req == NULL) 40007f94: b0 92 20 00 orcc %o0, 0, %i0 40007f98: 32 80 00 09 bne,a 40007fbc <== ALWAYS TAKEN 40007f9c: f2 26 20 14 st %i1, [ %i0 + 0x14 ] rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp); 40007fa0: ba 10 20 0b mov 0xb, %i5 <== NOT EXECUTED 40007fa4: 82 10 3f ff mov -1, %g1 40007fa8: fa 26 60 34 st %i5, [ %i1 + 0x34 ] 40007fac: 40 00 26 cb call 40011ad8 <__errno> 40007fb0: c2 26 60 38 st %g1, [ %i1 + 0x38 ] 40007fb4: 10 80 00 06 b 40007fcc 40007fb8: fa 22 00 00 st %i5, [ %o0 ] req->aiocbp = aiocbp; req->aiocbp->aio_lio_opcode = LIO_SYNC; 40007fbc: 82 10 20 03 mov 3, %g1 40007fc0: c2 26 60 30 st %g1, [ %i1 + 0x30 ] return rtems_aio_enqueue (req); 40007fc4: 40 00 01 4e call 400084fc 40007fc8: 81 e8 00 00 restore } 40007fcc: 81 c7 e0 08 ret 40007fd0: 91 e8 3f ff restore %g0, -1, %o0 =============================================================================== 40008714 : * 0 - otherwise */ int aio_read (struct aiocb *aiocbp) { 40008714: 9d e3 bf a0 save %sp, -96, %sp rtems_aio_request *req; int mode; mode = fcntl (aiocbp->aio_fildes, F_GETFL); 40008718: d0 06 00 00 ld [ %i0 ], %o0 4000871c: 92 10 20 03 mov 3, %o1 40008720: 40 00 17 b7 call 4000e5fc 40008724: ba 10 00 18 mov %i0, %i5 if (!(((mode & O_ACCMODE) == O_RDONLY) || ((mode & O_ACCMODE) == O_RDWR))) 40008728: 80 8a 20 01 btst 1, %o0 4000872c: 12 80 00 11 bne 40008770 40008730: b8 10 20 09 mov 9, %i4 rtems_aio_set_errno_return_minus_one (EBADF, aiocbp); if (aiocbp->aio_reqprio < 0 || aiocbp->aio_reqprio > AIO_PRIO_DELTA_MAX) 40008734: c2 06 20 18 ld [ %i0 + 0x18 ], %g1 40008738: 80 a0 60 00 cmp %g1, 0 4000873c: 22 80 00 04 be,a 4000874c 40008740: c2 06 20 08 ld [ %i0 + 8 ], %g1 rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp); if (aiocbp->aio_offset < 0) rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp); 40008744: 10 80 00 0b b 40008770 40008748: b8 10 20 16 mov 0x16, %i4 rtems_aio_set_errno_return_minus_one (EBADF, aiocbp); if (aiocbp->aio_reqprio < 0 || aiocbp->aio_reqprio > AIO_PRIO_DELTA_MAX) rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp); if (aiocbp->aio_offset < 0) 4000874c: 80 a0 60 00 cmp %g1, 0 40008750: 06 80 00 08 bl 40008770 40008754: b8 10 20 16 mov 0x16, %i4 rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp); req = malloc (sizeof (rtems_aio_request)); 40008758: 7f ff f0 18 call 400047b8 4000875c: 90 10 20 18 mov 0x18, %o0 if (req == NULL) 40008760: b0 92 20 00 orcc %o0, 0, %i0 40008764: 32 80 00 09 bne,a 40008788 <== ALWAYS TAKEN 40008768: fa 26 20 14 st %i5, [ %i0 + 0x14 ] rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp); 4000876c: b8 10 20 0b mov 0xb, %i4 <== NOT EXECUTED 40008770: 82 10 3f ff mov -1, %g1 40008774: f8 27 60 34 st %i4, [ %i5 + 0x34 ] 40008778: 40 00 24 d8 call 40011ad8 <__errno> 4000877c: c2 27 60 38 st %g1, [ %i5 + 0x38 ] 40008780: 10 80 00 06 b 40008798 40008784: f8 22 00 00 st %i4, [ %o0 ] req->aiocbp = aiocbp; req->aiocbp->aio_lio_opcode = LIO_READ; 40008788: 82 10 20 01 mov 1, %g1 4000878c: c2 27 60 30 st %g1, [ %i5 + 0x30 ] return rtems_aio_enqueue (req); 40008790: 7f ff ff 5b call 400084fc 40008794: 81 e8 00 00 restore } 40008798: 81 c7 e0 08 ret 4000879c: 91 e8 3f ff restore %g0, -1, %o0 =============================================================================== 400087a8 : * 0 - otherwise */ int aio_write (struct aiocb *aiocbp) { 400087a8: 9d e3 bf a0 save %sp, -96, %sp rtems_aio_request *req; int mode; mode = fcntl (aiocbp->aio_fildes, F_GETFL); 400087ac: d0 06 00 00 ld [ %i0 ], %o0 400087b0: 40 00 17 93 call 4000e5fc 400087b4: 92 10 20 03 mov 3, %o1 * 0 - otherwise */ int aio_write (struct aiocb *aiocbp) { 400087b8: ba 10 00 18 mov %i0, %i5 rtems_aio_request *req; int mode; mode = fcntl (aiocbp->aio_fildes, F_GETFL); if (!(((mode & O_ACCMODE) == O_WRONLY) || ((mode & O_ACCMODE) == O_RDWR))) 400087bc: 90 0a 20 03 and %o0, 3, %o0 400087c0: 90 02 3f ff add %o0, -1, %o0 400087c4: 80 a2 20 01 cmp %o0, 1 400087c8: 18 80 00 11 bgu 4000880c 400087cc: b8 10 20 09 mov 9, %i4 rtems_aio_set_errno_return_minus_one (EBADF, aiocbp); if (aiocbp->aio_reqprio < 0 || aiocbp->aio_reqprio > AIO_PRIO_DELTA_MAX) 400087d0: c2 06 20 18 ld [ %i0 + 0x18 ], %g1 400087d4: 80 a0 60 00 cmp %g1, 0 400087d8: 22 80 00 04 be,a 400087e8 400087dc: c2 06 20 08 ld [ %i0 + 8 ], %g1 rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp); if (aiocbp->aio_offset < 0) rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp); 400087e0: 10 80 00 0b b 4000880c 400087e4: b8 10 20 16 mov 0x16, %i4 rtems_aio_set_errno_return_minus_one (EBADF, aiocbp); if (aiocbp->aio_reqprio < 0 || aiocbp->aio_reqprio > AIO_PRIO_DELTA_MAX) rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp); if (aiocbp->aio_offset < 0) 400087e8: 80 a0 60 00 cmp %g1, 0 400087ec: 06 80 00 08 bl 4000880c 400087f0: b8 10 20 16 mov 0x16, %i4 rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp); req = malloc (sizeof (rtems_aio_request)); 400087f4: 7f ff ef f1 call 400047b8 400087f8: 90 10 20 18 mov 0x18, %o0 if (req == NULL) 400087fc: b0 92 20 00 orcc %o0, 0, %i0 40008800: 32 80 00 09 bne,a 40008824 <== ALWAYS TAKEN 40008804: fa 26 20 14 st %i5, [ %i0 + 0x14 ] rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp); 40008808: b8 10 20 0b mov 0xb, %i4 <== NOT EXECUTED 4000880c: 82 10 3f ff mov -1, %g1 40008810: f8 27 60 34 st %i4, [ %i5 + 0x34 ] 40008814: 40 00 24 b1 call 40011ad8 <__errno> 40008818: c2 27 60 38 st %g1, [ %i5 + 0x38 ] 4000881c: 10 80 00 06 b 40008834 40008820: f8 22 00 00 st %i4, [ %o0 ] req->aiocbp = aiocbp; req->aiocbp->aio_lio_opcode = LIO_WRITE; 40008824: 82 10 20 02 mov 2, %g1 40008828: c2 27 60 30 st %g1, [ %i5 + 0x30 ] return rtems_aio_enqueue (req); 4000882c: 7f ff ff 34 call 400084fc 40008830: 81 e8 00 00 restore } 40008834: 81 c7 e0 08 ret 40008838: 91 e8 3f ff restore %g0, -1, %o0 =============================================================================== 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 4a sethi %hi(0x40012800), %o3 400047e8: 96 12 e3 a0 or %o3, 0x3a0, %o3 ! 40012ba0 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 49 sethi %hi(0x40012400), %i4 40004810: b8 17 20 64 or %i4, 0x64, %i4 ! 40012464 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 4a sethi %hi(0x40012800), %i4 40004860: d0 07 23 98 ld [ %i4 + 0x398 ], %o0 ! 40012b98 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 98 ld [ %i4 + 0x398 ], %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 1f 6b call 4000c638 <__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 1f 64 call 4000c638 <__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 =============================================================================== 40007990 : int clock_gettime( clockid_t clock_id, struct timespec *tp ) { 40007990: 9d e3 bf 98 save %sp, -104, %sp if ( !tp ) 40007994: 80 a6 60 00 cmp %i1, 0 40007998: 02 80 00 26 be 40007a30 4000799c: 80 a6 20 01 cmp %i0, 1 rtems_set_errno_and_return_minus_one( EINVAL ); if ( clock_id == CLOCK_REALTIME ) { 400079a0: 12 80 00 16 bne 400079f8 400079a4: 80 a6 20 04 cmp %i0, 4 ) { Timestamp_Control tod_as_timestamp; Timestamp_Control *tod_as_timestamp_ptr; tod_as_timestamp_ptr = 400079a8: 90 07 bf f8 add %fp, -8, %o0 400079ac: 13 10 00 6a sethi %hi(0x4001a800), %o1 400079b0: 40 00 08 1d call 40009a24 <_TOD_Get_with_nanoseconds> 400079b4: 92 12 60 48 or %o1, 0x48, %o1 ! 4001a848 <_TOD> #endif rtems_set_errno_and_return_minus_one( EINVAL ); return 0; } 400079b8: f8 1a 00 00 ldd [ %o0 ], %i4 static inline void _Timestamp64_implementation_To_timespec( const Timestamp64_Control *_timestamp, struct timespec *_timespec ) { _timespec->tv_sec = (time_t) (*_timestamp / 1000000000L); 400079bc: 94 10 20 00 clr %o2 400079c0: 90 10 00 1c mov %i4, %o0 400079c4: 92 10 00 1d mov %i5, %o1 400079c8: 17 0e e6 b2 sethi %hi(0x3b9ac800), %o3 400079cc: 40 00 3c 14 call 40016a1c <__divdi3> 400079d0: 96 12 e2 00 or %o3, 0x200, %o3 ! 3b9aca00 _timespec->tv_nsec = (long) (*_timestamp % 1000000000L); 400079d4: 90 10 00 1c mov %i4, %o0 static inline void _Timestamp64_implementation_To_timespec( const Timestamp64_Control *_timestamp, struct timespec *_timespec ) { _timespec->tv_sec = (time_t) (*_timestamp / 1000000000L); 400079d8: d2 26 40 00 st %o1, [ %i1 ] _timespec->tv_nsec = (long) (*_timestamp % 1000000000L); 400079dc: 94 10 20 00 clr %o2 400079e0: 92 10 00 1d mov %i5, %o1 400079e4: 17 0e e6 b2 sethi %hi(0x3b9ac800), %o3 400079e8: 40 00 3c f8 call 40016dc8 <__moddi3> 400079ec: 96 12 e2 00 or %o3, 0x200, %o3 ! 3b9aca00 400079f0: 10 80 00 06 b 40007a08 400079f4: d2 26 60 04 st %o1, [ %i1 + 4 ] if ( clock_id == CLOCK_REALTIME ) { _TOD_Get(tp); return 0; } #ifdef CLOCK_MONOTONIC if ( clock_id == CLOCK_MONOTONIC ) { 400079f8: 12 80 00 06 bne 40007a10 <== ALWAYS TAKEN 400079fc: 80 a6 20 02 cmp %i0, 2 _TOD_Get_uptime_as_timespec( tp ); 40007a00: 40 00 08 1a call 40009a68 <_TOD_Get_uptime_as_timespec> 40007a04: 90 10 00 19 mov %i1, %o0 return 0; 40007a08: 81 c7 e0 08 ret 40007a0c: 91 e8 20 00 restore %g0, 0, %o0 } #endif #ifdef _POSIX_CPUTIME if ( clock_id == CLOCK_PROCESS_CPUTIME_ID ) { 40007a10: 02 bf ff fc be 40007a00 40007a14: 80 a6 20 03 cmp %i0, 3 return 0; } #endif #ifdef _POSIX_THREAD_CPUTIME if ( clock_id == CLOCK_THREAD_CPUTIME_ID ) 40007a18: 12 80 00 06 bne 40007a30 40007a1c: 01 00 00 00 nop rtems_set_errno_and_return_minus_one( ENOSYS ); 40007a20: 40 00 23 6d call 400107d4 <__errno> 40007a24: 01 00 00 00 nop 40007a28: 10 80 00 05 b 40007a3c 40007a2c: 82 10 20 58 mov 0x58, %g1 ! 58 #endif rtems_set_errno_and_return_minus_one( EINVAL ); 40007a30: 40 00 23 69 call 400107d4 <__errno> 40007a34: 01 00 00 00 nop 40007a38: 82 10 20 16 mov 0x16, %g1 ! 16 40007a3c: c2 22 00 00 st %g1, [ %o0 ] return 0; } 40007a40: 81 c7 e0 08 ret 40007a44: 91 e8 3f ff restore %g0, -1, %o0 =============================================================================== 40025ef4 : int clock_settime( clockid_t clock_id, const struct timespec *tp ) { 40025ef4: 9d e3 bf 98 save %sp, -104, %sp if ( !tp ) 40025ef8: 82 96 60 00 orcc %i1, 0, %g1 40025efc: 02 80 00 4b be 40026028 <== NEVER TAKEN 40025f00: 80 a6 20 01 cmp %i0, 1 rtems_set_errno_and_return_minus_one( EINVAL ); if ( clock_id == CLOCK_REALTIME ) { 40025f04: 12 80 00 41 bne 40026008 40025f08: 80 a6 20 02 cmp %i0, 2 if ( tp->tv_sec < TOD_SECONDS_1970_THROUGH_1988 ) 40025f0c: c6 00 40 00 ld [ %g1 ], %g3 40025f10: 05 08 76 b9 sethi %hi(0x21dae400), %g2 40025f14: 84 10 a0 ff or %g2, 0xff, %g2 ! 21dae4ff 40025f18: 80 a0 c0 02 cmp %g3, %g2 40025f1c: 08 80 00 43 bleu 40026028 40025f20: 05 10 01 91 sethi %hi(0x40064400), %g2 * * This rountine increments the thread dispatch level */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_increment_disable_level(void) { uint32_t level = _Thread_Dispatch_disable_level; 40025f24: c6 00 a0 30 ld [ %g2 + 0x30 ], %g3 ! 40064430 <_Thread_Dispatch_disable_level> ++level; 40025f28: 86 00 e0 01 inc %g3 _Thread_Dispatch_disable_level = level; 40025f2c: c6 20 a0 30 st %g3, [ %g2 + 0x30 ] const struct timespec *tod_as_timespec ) { Timestamp_Control tod_as_timestamp; _Timestamp_Set( 40025f30: c6 00 40 00 ld [ %g1 ], %g3 &tod_as_timestamp, tod_as_timespec->tv_sec, tod_as_timespec->tv_nsec ); _TOD_Set_with_timestamp( &tod_as_timestamp ); 40025f34: 90 07 bf f8 add %fp, -8, %o0 const struct timespec *tod_as_timespec ) { Timestamp_Control tod_as_timestamp; _Timestamp_Set( 40025f38: 85 38 e0 1f sra %g3, 0x1f, %g2 Timestamp64_Control *_time, Timestamp64_Control _seconds, Timestamp64_Control _nanoseconds ) { *_time = _seconds * 1000000000L + _nanoseconds; 40025f3c: 89 28 a0 03 sll %g2, 3, %g4 40025f40: bb 28 e0 03 sll %g3, 3, %i5 40025f44: b7 30 e0 1d srl %g3, 0x1d, %i3 40025f48: b8 16 c0 04 or %i3, %g4, %i4 40025f4c: 89 37 60 1b srl %i5, 0x1b, %g4 40025f50: b5 2f 20 05 sll %i4, 5, %i2 40025f54: b7 2f 60 05 sll %i5, 5, %i3 40025f58: b4 11 00 1a or %g4, %i2, %i2 40025f5c: ba a6 c0 1d subcc %i3, %i5, %i5 40025f60: 89 37 60 1a srl %i5, 0x1a, %g4 40025f64: b8 66 80 1c subx %i2, %i4, %i4 40025f68: b7 2f 60 06 sll %i5, 6, %i3 40025f6c: b5 2f 20 06 sll %i4, 6, %i2 40025f70: b6 a6 c0 1d subcc %i3, %i5, %i3 40025f74: b4 11 00 1a or %g4, %i2, %i2 40025f78: b4 66 80 1c subx %i2, %i4, %i2 40025f7c: b2 86 c0 03 addcc %i3, %g3, %i1 40025f80: b0 46 80 02 addx %i2, %g2, %i0 40025f84: 89 36 60 1e srl %i1, 0x1e, %g4 40025f88: 85 2e 20 02 sll %i0, 2, %g2 40025f8c: 84 11 00 02 or %g4, %g2, %g2 40025f90: 87 2e 60 02 sll %i1, 2, %g3 40025f94: ba 86 40 03 addcc %i1, %g3, %i5 40025f98: b8 46 00 02 addx %i0, %g2, %i4 40025f9c: 89 37 60 1e srl %i5, 0x1e, %g4 40025fa0: 85 2f 20 02 sll %i4, 2, %g2 40025fa4: 84 11 00 02 or %g4, %g2, %g2 40025fa8: 87 2f 60 02 sll %i5, 2, %g3 40025fac: b6 87 40 03 addcc %i5, %g3, %i3 40025fb0: b4 47 00 02 addx %i4, %g2, %i2 40025fb4: bb 2e e0 02 sll %i3, 2, %i5 40025fb8: 85 36 e0 1e srl %i3, 0x1e, %g2 40025fbc: 86 86 c0 1d addcc %i3, %i5, %g3 40025fc0: b9 2e a0 02 sll %i2, 2, %i4 40025fc4: b8 10 80 1c or %g2, %i4, %i4 40025fc8: 84 46 80 1c addx %i2, %i4, %g2 40025fcc: bb 28 a0 09 sll %g2, 9, %i5 40025fd0: b9 30 e0 17 srl %g3, 0x17, %i4 40025fd4: 84 17 00 1d or %i4, %i5, %g2 40025fd8: fa 00 60 04 ld [ %g1 + 4 ], %i5 40025fdc: 89 28 e0 09 sll %g3, 9, %g4 40025fe0: b6 81 00 1d addcc %g4, %i5, %i3 40025fe4: b9 3f 60 1f sra %i5, 0x1f, %i4 rtems_set_errno_and_return_minus_one( ENOSYS ); #endif else rtems_set_errno_and_return_minus_one( EINVAL ); return 0; 40025fe8: b0 10 20 00 clr %i0 40025fec: b4 40 80 1c addx %g2, %i4, %i2 &tod_as_timestamp, tod_as_timespec->tv_sec, tod_as_timespec->tv_nsec ); _TOD_Set_with_timestamp( &tod_as_timestamp ); 40025ff0: 40 00 04 4d call 40027124 <_TOD_Set_with_timestamp> 40025ff4: f4 3f bf f8 std %i2, [ %fp + -8 ] if ( tp->tv_sec < TOD_SECONDS_1970_THROUGH_1988 ) rtems_set_errno_and_return_minus_one( EINVAL ); _Thread_Disable_dispatch(); _TOD_Set( tp ); _Thread_Enable_dispatch(); 40025ff8: 7f ff 90 77 call 4000a1d4 <_Thread_Enable_dispatch> 40025ffc: 01 00 00 00 nop rtems_set_errno_and_return_minus_one( ENOSYS ); #endif else rtems_set_errno_and_return_minus_one( EINVAL ); return 0; 40026000: 81 c7 e0 08 ret 40026004: 81 e8 00 00 restore _Thread_Disable_dispatch(); _TOD_Set( tp ); _Thread_Enable_dispatch(); } #ifdef _POSIX_CPUTIME else if ( clock_id == CLOCK_PROCESS_CPUTIME_ID ) 40026008: 02 80 00 04 be 40026018 4002600c: 80 a6 20 03 cmp %i0, 3 rtems_set_errno_and_return_minus_one( ENOSYS ); #endif #ifdef _POSIX_THREAD_CPUTIME else if ( clock_id == CLOCK_THREAD_CPUTIME_ID ) 40026010: 12 80 00 06 bne 40026028 40026014: 01 00 00 00 nop rtems_set_errno_and_return_minus_one( ENOSYS ); 40026018: 40 00 44 a0 call 40037298 <__errno> 4002601c: 01 00 00 00 nop 40026020: 10 80 00 05 b 40026034 40026024: 82 10 20 58 mov 0x58, %g1 ! 58 #endif else rtems_set_errno_and_return_minus_one( EINVAL ); 40026028: 40 00 44 9c call 40037298 <__errno> 4002602c: 01 00 00 00 nop 40026030: 82 10 20 16 mov 0x16, %g1 ! 16 40026034: c2 22 00 00 st %g1, [ %o0 ] return 0; } 40026038: 81 c7 e0 08 ret 4002603c: 91 e8 3f ff restore %g0, -1, %o0 =============================================================================== 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 6c sethi %hi(0x4001b000), %g1 400041d8: e0 00 63 10 ld [ %g1 + 0x310 ], %l0 ! 4001b310 400041dc: 80 a6 00 10 cmp %i0, %l0 400041e0: 0a 80 00 16 bcs 40004238 400041e4: 03 10 00 6c sethi %hi(0x4001b000), %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 42 35 call 40014af0 <== NOT EXECUTED 40004220: 95 2a a0 03 sll %o2, 3, %o2 <== NOT EXECUTED disktab = table; 40004224: 03 10 00 6c sethi %hi(0x4001b000), %g1 <== NOT EXECUTED 40004228: e2 20 63 14 st %l1, [ %g1 + 0x314 ] ! 4001b314 <== NOT EXECUTED disktab_size = new_size; 4000422c: 03 10 00 6c sethi %hi(0x4001b000), %g1 <== NOT EXECUTED 40004230: fa 20 63 10 st %i5, [ %g1 + 0x310 ] ! 4001b310 <== NOT EXECUTED } if (disktab [major].minor == NULL || minor >= disktab[major].size) { 40004234: 03 10 00 6c sethi %hi(0x4001b000), %g1 <== NOT EXECUTED 40004238: e4 00 63 14 ld [ %g1 + 0x314 ], %l2 ! 4001b314 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 42 15 call 40014af0 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 42 d9 call 40014e58 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 41 ba call 40015a58 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 41 b3 call 40015a58 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 94 sethi %hi(0x40025000), %o0 400053b4: 92 0e e0 ff and %i3, 0xff, %o1 400053b8: 90 12 22 80 or %o0, 0x280, %o0 400053bc: 40 00 41 39 call 400158a0 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 4e sethi %hi(0x40013800), %g1 40003468: c2 00 62 5c ld [ %g1 + 0x25c ], %g1 ! 40013a5c if (rootloc->mt_entry->ops == &devFS_ops) { 4000346c: 05 10 00 4b sethi %hi(0x40012c00), %g2 40003470: c2 00 60 04 ld [ %g1 + 4 ], %g1 40003474: 84 10 a0 e4 or %g2, 0xe4, %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 4b sethi %hi(0x40012c00), %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 4b sethi %hi(0x40012c00), %i0 } printk( 40003494: 21 10 00 4b sethi %hi(0x40012c00), %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 61 38 or %i1, 0x138, %i1 for (j = 0; j < m; ++j) { printk("%c", current->name [j]); 400034a8: b0 16 21 40 or %i0, 0x140, %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 21 48 or %l0, 0x148, %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 =============================================================================== 4000d24c : } void devFS_eval_path( rtems_filesystem_eval_path_context_t *ctx ) { 4000d24c: 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; 4000d250: 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; 4000d254: f2 06 00 00 ld [ %i0 ], %i1 4000d258: 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; 4000d25c: 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; 4000d260: e2 00 60 04 ld [ %g1 + 4 ], %l1 4000d264: fa 00 40 00 ld [ %g1 ], %i5 devFS_node *nodes = data->nodes; devFS_node *node = NULL; 4000d268: b8 10 20 00 clr %i4 devFS_node *free_node = NULL; 4000d26c: 82 10 20 00 clr %g1 for (i = 0; (free_node == NULL || node == NULL) && i < n; ++i) { 4000d270: 10 80 00 12 b 4000d2b8 4000d274: b4 10 20 00 clr %i2 devFS_node *current = nodes + i; if (current->name != NULL) { 4000d278: 80 a2 20 00 cmp %o0, 0 4000d27c: 02 80 00 0c be 4000d2ac 4000d280: a0 10 00 1d mov %i5, %l0 if ( 4000d284: c4 07 60 04 ld [ %i5 + 4 ], %g2 4000d288: 80 a0 80 1b cmp %g2, %i3 4000d28c: 12 80 00 08 bne 4000d2ac 4000d290: a0 10 00 01 mov %g1, %l0 current->namelen == pathlen && memcmp(current->name, path, pathlen) == 0 4000d294: 92 10 00 19 mov %i1, %o1 4000d298: 40 00 0c 6f call 40010454 4000d29c: 94 10 00 1b mov %i3, %o2 4000d2a0: 80 a2 20 00 cmp %o0, 0 4000d2a4: 22 80 00 02 be,a 4000d2ac 4000d2a8: 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) { 4000d2ac: b4 06 a0 01 inc %i2 4000d2b0: ba 07 60 14 add %i5, 0x14, %i5 4000d2b4: 82 10 00 10 mov %l0, %g1 4000d2b8: 80 a7 20 00 cmp %i4, 0 4000d2bc: 02 80 00 0a be 4000d2e4 4000d2c0: 80 a6 80 11 cmp %i2, %l1 4000d2c4: 80 a0 60 00 cmp %g1, 0 4000d2c8: 02 80 00 07 be 4000d2e4 <== NEVER TAKEN 4000d2cc: 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) { 4000d2d0: 80 a7 20 00 cmp %i4, 0 4000d2d4: 12 80 00 08 bne 4000d2f4 4000d2d8: 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) { 4000d2dc: 10 80 00 0b b 4000d308 4000d2e0: 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) { 4000d2e4: 32 bf ff e5 bne,a 4000d278 4000d2e8: 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) { 4000d2ec: 10 bf ff fa b 4000d2d4 4000d2f0: 80 a7 20 00 cmp %i4, 0 if ((eval_flags & RTEMS_FS_EXCLUSIVE) == 0) { 4000d2f4: 80 88 a0 40 btst 0x40, %g2 4000d2f8: 12 80 00 12 bne 4000d340 4000d2fc: b2 10 20 11 mov 0x11, %i1 currentloc->node_access = node; 4000d300: 10 80 00 0a b 4000d328 4000d304: 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) { 4000d308: 02 80 00 0d be 4000d33c <== NEVER TAKEN 4000d30c: 80 a0 60 00 cmp %g1, 0 if (free_node != NULL) { 4000d310: 02 80 00 09 be 4000d334 4000d314: 84 10 21 ff mov 0x1ff, %g2 free_node->mode = S_IRWXU | S_IRWXG | S_IRWXO; 4000d318: c4 20 60 10 st %g2, [ %g1 + 0x10 ] currentloc->node_access = free_node; 4000d31c: c2 26 20 20 st %g1, [ %i0 + 0x20 ] rtems_filesystem_eval_path_context_t *ctx, const char *token, size_t tokenlen ) { ctx->token = token; 4000d320: f2 26 20 08 st %i1, [ %i0 + 8 ] ctx->tokenlen = tokenlen; 4000d324: 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; 4000d328: c0 26 20 04 clr [ %i0 + 4 ] 4000d32c: 81 c7 e0 08 ret 4000d330: 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); 4000d334: 10 80 00 03 b 4000d340 4000d338: b2 10 20 1c mov 0x1c, %i1 } } else { rtems_filesystem_eval_path_error(ctx, ENOENT); 4000d33c: b2 10 20 02 mov 2, %i1 <== NOT EXECUTED 4000d340: 7f ff e3 b6 call 40006218 4000d344: 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 2d 1f call 400104fc 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 29 16 call 4000f4e8 <__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 29 0d call 4000f4e8 <__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 6c sethi %hi(0x4001b000), %g1 40004168: d0 00 63 0c ld [ %g1 + 0x30c ], %o0 ! 4001b30c 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 6c sethi %hi(0x4001b000), %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 6c sethi %hi(0x4001b000), %g1 400041a4: c0 28 63 08 clrb [ %g1 + 0x308 ] ! 4001b308 sc = rtems_semaphore_release(diskdevs_mutex); 400041a8: 03 10 00 6c sethi %hi(0x4001b000), %g1 400041ac: 40 00 14 f3 call 40009578 400041b0: d0 00 63 0c ld [ %g1 + 0x30c ], %o0 ! 4001b30c 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 58 call 40009b20 <== 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 28 call 4000875c <== 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 <__umoddi3+0x2d8> <== NOT EXECUTED 40004518: 40 00 46 98 call 40015f78 <_CPU_cache_invalidate_entire_instruction+0x8><== 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 <_isatty_r+0x8> <== NOT EXECUTED 40004528: 40 00 46 f0 call 400160e8 <_exit+0xc> <== NOT EXECUTED 4000452c: 40 00 46 f0 call 400160ec <_exit+0x10> <== NOT EXECUTED 40004530: 40 00 46 f0 call 400160f0 <_exit+0x14> <== NOT EXECUTED 40004534: 40 00 46 f0 call 400160f4 <_exit+0x18> <== NOT EXECUTED 40004538: 40 00 46 f0 call 400160f8 <_exit+0x1c> <== 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 7a sethi %hi(0x4001e800), %g1 iscntrl(c) && (c != '\t') && (c != '\n')) { 40006884: c2 00 61 30 ld [ %g1 + 0x130 ], %g1 ! 4001e930 <__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 =============================================================================== 40024df8 : } void endgrent(void) { if (group_fp != NULL) 40024df8: 03 10 01 8f sethi %hi(0x40063c00), %g1 40024dfc: d0 00 61 08 ld [ %g1 + 0x108 ], %o0 ! 40063d08 40024e00: 80 a2 20 00 cmp %o0, 0 40024e04: 02 80 00 05 be 40024e18 <== NEVER TAKEN 40024e08: 01 00 00 00 nop fclose(group_fp); 40024e0c: 82 13 c0 00 mov %o7, %g1 40024e10: 40 00 49 74 call 400373e0 40024e14: 9e 10 40 00 mov %g1, %o7 40024e18: 81 c3 e0 08 retl <== NOT EXECUTED =============================================================================== 40024c54 : } void endpwent(void) { if (passwd_fp != NULL) 40024c54: 03 10 01 8f sethi %hi(0x40063c00), %g1 40024c58: d0 00 60 28 ld [ %g1 + 0x28 ], %o0 ! 40063c28 40024c5c: 80 a2 20 00 cmp %o0, 0 40024c60: 02 80 00 05 be 40024c74 <== NEVER TAKEN 40024c64: 01 00 00 00 nop fclose(passwd_fp); 40024c68: 82 13 c0 00 mov %o7, %g1 40024c6c: 40 00 49 dd call 400373e0 40024c70: 9e 10 40 00 mov %g1, %o7 40024c74: 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 74 sethi %hi(0x4001d000), %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 7a sethi %hi(0x4001e800), %i3 /* * Back up over the tab */ while (tty->column > col) { rtems_termios_puts ("\b", 1, tty); 40006904: 31 10 00 74 sethi %hi(0x4001d000), %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 a3 28 or %i2, 0x328, %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 23 20 or %i0, 0x320, %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 e1 30 ld [ %i3 + 0x130 ], %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 e1 30 ld [ %i3 + 0x130 ], %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 e1 30 ld [ %i3 + 0x130 ], %g1 40006a08: 80 88 62 00 btst 0x200, %g1 <== NOT EXECUTED 40006a0c: 02 80 00 0d be 40006a40 <== NOT EXECUTED 40006a10: c2 06 e1 30 ld [ %i3 + 0x130 ], %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 e1 30 ld [ %i3 + 0x130 ], %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 e1 30 ld [ %i3 + 0x130 ], %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 2d 24 call 4001051c 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 2a 71 call 4000fae4 <__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 1d 05 call 4000c560 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 =============================================================================== 40013490 : int fat_buf_access(fat_fs_info_t *fs_info, const uint32_t sec_num, const int op_type, uint8_t **sec_buf) { 40013490: 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); 40013494: c2 0e 20 02 ldub [ %i0 + 2 ], %g1 40013498: c4 0e 20 0c ldub [ %i0 + 0xc ], %g2 4001349c: 84 20 80 01 sub %g2, %g1, %g2 400134a0: 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); 400134a4: 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 - 400134a8: 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); 400134ac: 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) 400134b0: c2 0e 20 89 ldub [ %i0 + 0x89 ], %g1 400134b4: 80 a0 60 00 cmp %g1, 0 400134b8: 02 80 00 06 be 400134d0 400134bc: 01 00 00 00 nop 400134c0: c2 06 20 84 ld [ %i0 + 0x84 ], %g1 400134c4: 80 a0 40 19 cmp %g1, %i1 400134c8: 22 80 00 1c be,a 40013538 400134cc: c2 06 20 8c ld [ %i0 + 0x8c ], %g1 { fat_buf_release(fs_info); 400134d0: 7f ff ff 7c call 400132c0 400134d4: 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); 400134d8: 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) 400134dc: 80 a6 a0 01 cmp %i2, 1 400134e0: d0 06 20 64 ld [ %i0 + 0x64 ], %o0 400134e4: 12 80 00 06 bne 400134fc 400134e8: 94 06 20 8c add %i0, 0x8c, %o2 sc = rtems_bdbuf_read(fs_info->vol.dd, blk, &fs_info->c.buf); 400134ec: 7f ff f7 ae call 400113a4 400134f0: 01 00 00 00 nop else sc = rtems_bdbuf_get(fs_info->vol.dd, blk, &fs_info->c.buf); if (sc != RTEMS_SUCCESSFUL) 400134f4: 10 80 00 05 b 40013508 400134f8: 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); 400134fc: 7f ff f7 79 call 400112e0 40013500: 01 00 00 00 nop if (sc != RTEMS_SUCCESSFUL) 40013504: 80 a2 20 00 cmp %o0, 0 40013508: 02 80 00 08 be 40013528 <== ALWAYS TAKEN 4001350c: 82 10 20 01 mov 1, %g1 rtems_set_errno_and_return_minus_one(EIO); 40013510: 40 00 21 0d call 4001b944 <__errno> <== NOT EXECUTED 40013514: b0 10 3f ff mov -1, %i0 <== NOT EXECUTED 40013518: 82 10 20 05 mov 5, %g1 <== NOT EXECUTED 4001351c: c2 22 00 00 st %g1, [ %o0 ] <== NOT EXECUTED 40013520: 81 c7 e0 08 ret <== NOT EXECUTED 40013524: 81 e8 00 00 restore <== NOT EXECUTED fs_info->c.blk_num = sec_num; 40013528: f2 26 20 84 st %i1, [ %i0 + 0x84 ] fs_info->c.modified = 0; 4001352c: c0 2e 20 88 clrb [ %i0 + 0x88 ] fs_info->c.state = FAT_CACHE_ACTUAL; 40013530: c2 2e 20 89 stb %g1, [ %i0 + 0x89 ] } *sec_buf = &fs_info->c.buf->buffer[blk_ofs]; 40013534: c2 06 20 8c ld [ %i0 + 0x8c ], %g1 40013538: c2 00 60 1c ld [ %g1 + 0x1c ], %g1 4001353c: b8 00 40 1c add %g1, %i4, %i4 40013540: f8 26 c0 00 st %i4, [ %i3 ] return RC_OK; } 40013544: 81 c7 e0 08 ret 40013548: 91 e8 20 00 restore %g0, 0, %o0 =============================================================================== 400132c0 : return RC_OK; } int fat_buf_release(fat_fs_info_t *fs_info) { 400132c0: 9d e3 bf 98 save %sp, -104, %sp rtems_status_code sc = RTEMS_SUCCESSFUL; if (fs_info->c.state == FAT_CACHE_EMPTY) 400132c4: c2 0e 20 89 ldub [ %i0 + 0x89 ], %g1 return RC_OK; } int fat_buf_release(fat_fs_info_t *fs_info) { 400132c8: ba 10 00 18 mov %i0, %i5 rtems_status_code sc = RTEMS_SUCCESSFUL; if (fs_info->c.state == FAT_CACHE_EMPTY) 400132cc: 80 a0 60 00 cmp %g1, 0 400132d0: 02 80 00 6e be 40013488 400132d4: b0 10 20 00 clr %i0 return RC_OK; if (fs_info->c.modified) 400132d8: c2 0f 60 88 ldub [ %i5 + 0x88 ], %g1 400132dc: 80 a0 60 00 cmp %g1, 0 400132e0: 02 80 00 5d be 40013454 400132e4: 01 00 00 00 nop { uint32_t sec_num = fs_info->c.blk_num; 400132e8: c2 07 60 84 ld [ %i5 + 0x84 ], %g1 bool sec_of_fat = ((sec_num >= fs_info->vol.fat_loc) && 400132ec: c4 17 60 18 lduh [ %i5 + 0x18 ], %g2 400132f0: 80 a0 40 02 cmp %g1, %g2 400132f4: 0a 80 00 05 bcs 40013308 400132f8: b8 10 20 00 clr %i4 400132fc: c4 07 60 20 ld [ %i5 + 0x20 ], %g2 40013300: 80 a0 40 02 cmp %g1, %g2 40013304: b8 40 20 00 addx %g0, 0, %i4 uint32_t ino ) { return (ino >= fs_info->uino_base); } 40013308: 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) 4001330c: 80 8f 20 ff btst 0xff, %i4 40013310: 02 80 00 12 be 40013358 40013314: c6 0f 60 0c ldub [ %i5 + 0xc ], %g3 40013318: c8 0f 60 54 ldub [ %i5 + 0x54 ], %g4 4001331c: 80 a1 20 00 cmp %g4, 0 40013320: 12 80 00 0e bne 40013358 <== NEVER TAKEN 40013324: 84 08 a0 ff and %g2, 0xff, %g2 memcpy(fs_info->sec_buf, fs_info->c.buf->buffer + blk_ofs, 40013328: 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, 4001332c: d0 07 60 90 ld [ %i5 + 0x90 ], %o0 40013330: d2 01 20 1c ld [ %g4 + 0x1c ], %o1 40013334: d4 17 40 00 lduh [ %i5 ], %o2 40013338: 86 08 e0 ff and %g3, 0xff, %g3 4001333c: 86 20 c0 02 sub %g3, %g2, %g3 40013340: 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); 40013344: 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 - 40013348: 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); 4001334c: 85 28 40 02 sll %g1, %g2, %g2 40013350: 40 00 24 22 call 4001c3d8 40013354: 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); 40013358: 7f ff f8 c4 call 40011668 4001335c: d0 07 60 8c ld [ %i5 + 0x8c ], %o0 if (sc != RTEMS_SUCCESSFUL) 40013360: 80 a2 20 00 cmp %o0, 0 40013364: 12 80 00 41 bne 40013468 <== NEVER TAKEN 40013368: 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) 4001336c: 02 80 00 45 be 40013480 40013370: c0 2f 60 88 clrb [ %i5 + 0x88 ] 40013374: c2 0f 60 54 ldub [ %i5 + 0x54 ], %g1 40013378: 80 a0 60 00 cmp %g1, 0 4001337c: 22 80 00 2f be,a 40013438 <== ALWAYS TAKEN 40013380: 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; 40013384: 10 80 00 40 b 40013484 <== NOT EXECUTED 40013388: 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, 4001338c: 7f ff bc b1 call 40002650 <.umul> 40013390: d2 07 60 1c ld [ %i5 + 0x1c ], %o1 40013394: 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); 40013398: c2 0f 60 02 ldub [ %i5 + 2 ], %g1 4001339c: 90 02 00 1b add %o0, %i3, %o0 400133a0: f6 0f 60 0c ldub [ %i5 + 0xc ], %i3 400133a4: b6 26 c0 01 sub %i3, %g1, %i3 400133a8: 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); 400133ac: 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 - 400133b0: 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); 400133b4: 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 400133b8: 80 a6 e0 00 cmp %i3, 0 400133bc: 12 80 00 0b bne 400133e8 400133c0: d0 07 60 64 ld [ %i5 + 0x64 ], %o0 && fs_info->vol.bps == fs_info->vol.bytes_per_block) 400133c4: c4 17 40 00 lduh [ %i5 ], %g2 400133c8: c2 17 60 0a lduh [ %i5 + 0xa ], %g1 400133cc: 80 a0 80 01 cmp %g2, %g1 400133d0: 12 80 00 06 bne 400133e8 400133d4: 01 00 00 00 nop { sc = rtems_bdbuf_get(fs_info->vol.dd, blk, &bd); 400133d8: 7f ff f7 c2 call 400112e0 400133dc: 94 07 bf fc add %fp, -4, %o2 } else { sc = rtems_bdbuf_read(fs_info->vol.dd, blk, &bd); } if ( sc != RTEMS_SUCCESSFUL) 400133e0: 10 80 00 05 b 400133f4 400133e4: 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); 400133e8: 7f ff f7 ef call 400113a4 400133ec: 94 07 bf fc add %fp, -4, %o2 } if ( sc != RTEMS_SUCCESSFUL) 400133f0: 80 a2 20 00 cmp %o0, 0 400133f4: 22 80 00 03 be,a 40013400 <== ALWAYS TAKEN 400133f8: c2 07 bf fc ld [ %fp + -4 ], %g1 400133fc: 30 80 00 0b b,a 40013428 <== NOT EXECUTED rtems_set_errno_and_return_minus_one(ENOMEM); memcpy(bd->buffer + blk_ofs, fs_info->sec_buf, fs_info->vol.bps); 40013400: d2 07 60 90 ld [ %i5 + 0x90 ], %o1 40013404: d0 00 60 1c ld [ %g1 + 0x1c ], %o0 40013408: d4 17 40 00 lduh [ %i5 ], %o2 4001340c: 40 00 23 f3 call 4001c3d8 40013410: 90 02 00 1b add %o0, %i3, %o0 sc = rtems_bdbuf_release_modified(bd); 40013414: 7f ff f8 95 call 40011668 40013418: d0 07 bf fc ld [ %fp + -4 ], %o0 if ( sc != RTEMS_SUCCESSFUL) 4001341c: 80 a2 20 00 cmp %o0, 0 40013420: 22 80 00 06 be,a 40013438 <== ALWAYS TAKEN 40013424: b8 07 20 01 inc %i4 rtems_set_errno_and_return_minus_one(ENOMEM); 40013428: 40 00 21 47 call 4001b944 <__errno> <== NOT EXECUTED 4001342c: 01 00 00 00 nop <== NOT EXECUTED 40013430: 10 80 00 11 b 40013474 <== NOT EXECUTED 40013434: 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++) 40013438: c2 0f 60 0d ldub [ %i5 + 0xd ], %g1 4001343c: 90 0f 20 ff and %i4, 0xff, %o0 40013440: 80 a2 00 01 cmp %o0, %g1 40013444: 0a bf ff d2 bcs 4001338c 40013448: 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; 4001344c: 10 80 00 0e b 40013484 40013450: c0 2f 60 89 clrb [ %i5 + 0x89 ] } } } else { sc = rtems_bdbuf_release(fs_info->c.buf); 40013454: 7f ff f8 50 call 40011594 40013458: d0 07 60 8c ld [ %i5 + 0x8c ], %o0 if (sc != RTEMS_SUCCESSFUL) 4001345c: 80 a2 20 00 cmp %o0, 0 40013460: 22 80 00 09 be,a 40013484 <== ALWAYS TAKEN 40013464: c0 2f 60 89 clrb [ %i5 + 0x89 ] rtems_set_errno_and_return_minus_one(EIO); 40013468: 40 00 21 37 call 4001b944 <__errno> <== NOT EXECUTED 4001346c: 01 00 00 00 nop <== NOT EXECUTED 40013470: 82 10 20 05 mov 5, %g1 ! 5 <== NOT EXECUTED 40013474: c2 22 00 00 st %g1, [ %o0 ] <== NOT EXECUTED 40013478: 81 c7 e0 08 ret <== NOT EXECUTED 4001347c: 91 e8 3f ff restore %g0, -1, %o0 <== NOT EXECUTED } fs_info->c.state = FAT_CACHE_EMPTY; 40013480: c0 2f 60 89 clrb [ %i5 + 0x89 ] return RC_OK; 40013484: b0 10 20 00 clr %i0 } 40013488: 81 c7 e0 08 ret 4001348c: 81 e8 00 00 restore =============================================================================== 40013264 : 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)) ) 40013264: 80 a2 60 00 cmp %o1, 0 40013268: 32 80 00 0c bne,a 40013298 4001326c: c2 0a 20 0c ldub [ %o0 + 0xc ], %g1 40013270: c2 0a 20 0e ldub [ %o0 + 0xe ], %g1 40013274: 80 88 60 03 btst 3, %g1 40013278: 22 80 00 08 be,a 40013298 <== NEVER TAKEN 4001327c: 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); 40013280: c4 0a 20 0c ldub [ %o0 + 0xc ], %g2 40013284: c2 0a 20 02 ldub [ %o0 + 2 ], %g1 40013288: d0 02 20 20 ld [ %o0 + 0x20 ], %o0 4001328c: 82 20 80 01 sub %g2, %g1, %g1 40013290: 81 c3 e0 08 retl 40013294: 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); 40013298: 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; 4001329c: 92 02 7f fe add %o1, -2, %o1 blk = cln << (fs_info->vol.bpc_log2 - fs_info->vol.bytes_per_block_log2); 400132a0: 84 20 80 01 sub %g2, %g1, %g2 400132a4: 93 2a 40 02 sll %o1, %g2, %o1 400132a8: c4 0a 20 02 ldub [ %o0 + 2 ], %g2 400132ac: d0 02 20 34 ld [ %o0 + 0x34 ], %o0 400132b0: 82 20 40 02 sub %g1, %g2, %g1 400132b4: 91 32 00 01 srl %o0, %g1, %o0 blk += fat_sector_num_to_block_num(fs_info, fs_info->vol.data_fsec); } return blk; } 400132b8: 81 c3 e0 08 retl 400132bc: 90 02 00 09 add %o0, %o1, %o0 =============================================================================== 400125c0 : 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)) ) 400125c0: 80 a2 60 00 cmp %o1, 0 400125c4: 32 80 00 08 bne,a 400125e4 400125c8: c2 0a 20 05 ldub [ %o0 + 5 ], %g1 400125cc: c2 0a 20 0e ldub [ %o0 + 0xe ], %g1 400125d0: 80 88 60 03 btst 3, %g1 400125d4: 22 80 00 04 be,a 400125e4 <== NEVER TAKEN 400125d8: c2 0a 20 05 ldub [ %o0 + 5 ], %g1 <== NOT EXECUTED return fs_info->vol.rdir_loc; 400125dc: 81 c3 e0 08 retl 400125e0: d0 02 20 20 ld [ %o0 + 0x20 ], %o0 return (((cln - FAT_RSRVD_CLN) << fs_info->vol.spc_log2) + 400125e4: 92 02 7f fe add %o1, -2, %o1 400125e8: 93 2a 40 01 sll %o1, %g1, %o1 400125ec: c2 02 20 34 ld [ %o0 + 0x34 ], %g1 fs_info->vol.data_fsec); } 400125f0: 81 c3 e0 08 retl 400125f4: 90 02 40 01 add %o1, %g1, %o0 =============================================================================== 40013664 : fat_fs_info_t *fs_info, const uint32_t start_cln, const uint32_t offset, const uint32_t count, const uint8_t pattern) { 40013664: 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)); 40013668: c2 16 20 06 lduh [ %i0 + 6 ], %g1 4001366c: 82 20 40 1a sub %g1, %i2, %g1 40013670: 80 a6 c0 01 cmp %i3, %g1 40013674: 38 80 00 02 bgu,a 4001367c <== NEVER TAKEN 40013678: b6 10 00 01 mov %g1, %i3 <== NOT EXECUTED uint32_t cur_blk = fat_cluster_num_to_block_num(fs_info, start_cln); 4001367c: 90 10 00 18 mov %i0, %o0 40013680: 7f ff fe f9 call 40013264 40013684: 92 10 00 19 mov %i1, %o1 uint32_t blocks_in_offset = offset >> fs_info->vol.bytes_per_block_log2; 40013688: 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; 4001368c: 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; 40013690: a3 36 80 01 srl %i2, %g1, %l1 uint32_t ofs_blk = offset - (blocks_in_offset << fs_info->vol.bytes_per_block_log2); 40013694: 83 2c 40 01 sll %l1, %g1, %g1 40013698: a4 10 20 01 mov 1, %l2 4001369c: b4 26 80 01 sub %i2, %g1, %i2 ssize_t bytes_written = 0; ssize_t ret; cur_blk += blocks_in_offset; 400136a0: a2 02 00 11 add %o0, %l1, %l1 while ( (RC_OK == rc) 400136a4: 10 80 00 2a b 4001374c 400136a8: 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)); 400136ac: 82 20 80 1a sub %g2, %i2, %g1 400136b0: 80 a0 40 1b cmp %g1, %i3 400136b4: 08 80 00 03 bleu 400136c0 <== ALWAYS TAKEN 400136b8: ba 10 00 01 mov %g1, %i5 400136bc: 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)); 400136c0: 80 a7 40 01 cmp %i5, %g1 400136c4: 08 80 00 03 bleu 400136d0 <== ALWAYS TAKEN 400136c8: b2 10 00 1d mov %i5, %i1 400136cc: b2 10 00 01 mov %g1, %i1 <== NOT EXECUTED uint32_t ino ) { return (ino >= fs_info->uino_base); } 400136d0: 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) 400136d4: 80 a6 60 00 cmp %i1, 0 400136d8: 02 80 00 27 be 40013774 <== NEVER TAKEN 400136dc: 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); 400136e0: 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); 400136e4: 90 10 00 18 mov %i0, %o0 400136e8: 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) 400136ec: 80 a6 40 02 cmp %i1, %g2 400136f0: 02 80 00 03 be 400136fc 400136f4: 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); 400136f8: 94 10 20 01 mov 1, %o2 400136fc: 7f ff ff 65 call 40013490 40013700: 96 07 bf fc add %fp, -4, %o3 if (RC_OK == rc) 40013704: 80 a2 20 00 cmp %o0, 0 40013708: 12 80 00 0a bne 40013730 <== NEVER TAKEN 4001370c: 80 a7 40 08 cmp %i5, %o0 { memset(blk_buf + offset, pattern, bytes_to_write); 40013710: d0 07 bf fc ld [ %fp + -4 ], %o0 40013714: 92 10 00 1c mov %i4, %o1 40013718: 90 02 00 1a add %o0, %i2, %o0 4001371c: 40 00 23 6c call 4001c4cc 40013720: 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; 40013724: 10 80 00 14 b 40013774 40013728: e4 2e 20 88 stb %l2, [ %i0 + 0x88 ] fs_info, cur_blk, ofs_blk, c, pattern); if (c != ret) 4001372c: 80 a7 40 08 cmp %i5, %o0 40013730: 12 80 00 06 bne 40013748 <== NEVER TAKEN 40013734: 82 10 3f ff mov -1, %g1 rc = -1; else { bytes_to_write -= ret; 40013738: b6 26 c0 1d sub %i3, %i5, %i3 bytes_written += ret; 4001373c: a0 04 00 1d add %l0, %i5, %l0 ++cur_blk; 40013740: a2 04 60 01 inc %l1 40013744: 82 10 20 00 clr %g1 40013748: b4 10 20 00 clr %i2 ssize_t bytes_written = 0; ssize_t ret; cur_blk += blocks_in_offset; while ( (RC_OK == rc) 4001374c: 80 a6 e0 00 cmp %i3, 0 40013750: 02 80 00 04 be 40013760 40013754: 80 a0 60 00 cmp %g1, 0 40013758: 22 bf ff d5 be,a 400136ac <== ALWAYS TAKEN 4001375c: c4 16 20 0a lduh [ %i0 + 0xa ], %g2 bytes_written += ret; ++cur_blk; } ofs_blk = 0; } if (RC_OK != rc) 40013760: 80 a0 60 00 cmp %g1, 0 40013764: 12 80 00 06 bne 4001377c <== NEVER TAKEN 40013768: b0 10 3f ff mov -1, %i0 4001376c: 81 c7 e0 08 ret 40013770: 91 e8 00 10 restore %g0, %l0, %o0 } } if (RC_OK != rc) return rc; else return bytes_to_write; 40013774: 10 bf ff ee b 4001372c 40013778: 90 10 00 19 mov %i1, %o0 } if (RC_OK != rc) return rc; else return bytes_written; } 4001377c: 81 c7 e0 08 ret <== NOT EXECUTED 40013780: 81 e8 00 00 restore <== NOT EXECUTED =============================================================================== 40013784 : const uint32_t start_cln, const uint32_t offset, const uint32_t count, const void *buff, const bool overwrite_cluster) { 40013784: 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)); 40013788: c2 16 20 06 lduh [ %i0 + 6 ], %g1 4001378c: 82 20 40 1a sub %g1, %i2, %g1 40013790: 80 a6 c0 01 cmp %i3, %g1 40013794: 38 80 00 02 bgu,a 4001379c <== NEVER TAKEN 40013798: b6 10 00 01 mov %g1, %i3 <== NOT EXECUTED uint32_t cur_blk = fat_cluster_num_to_block_num(fs_info, start_cln); 4001379c: 90 10 00 18 mov %i0, %o0 400137a0: 7f ff fe b1 call 40013264 400137a4: 92 10 00 19 mov %i1, %o1 uint32_t blocks_in_offset = (offset >> fs_info->vol.bytes_per_block_log2); 400137a8: 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; 400137ac: 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); 400137b0: a5 36 80 01 srl %i2, %g1, %l2 uint32_t ofs_blk = offset - (blocks_in_offset << fs_info->vol.bytes_per_block_log2); 400137b4: 83 2c 80 01 sll %l2, %g1, %g1 400137b8: a6 10 20 01 mov 1, %l3 400137bc: 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; 400137c0: a4 02 00 12 add %o0, %l2, %l2 while ( (RC_OK == rc) 400137c4: 10 80 00 2d b 40013878 400137c8: 82 10 20 00 clr %g1 && (0 < bytes_to_write)) { c = MIN(bytes_to_write, (fs_info->vol.bytes_per_block - ofs_blk)); 400137cc: 82 20 80 1a sub %g2, %i2, %g1 400137d0: 80 a0 40 1b cmp %g1, %i3 400137d4: 08 80 00 03 bleu 400137e0 400137d8: b2 10 00 01 mov %g1, %i1 400137dc: 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)); 400137e0: 80 a6 40 01 cmp %i1, %g1 400137e4: 08 80 00 03 bleu 400137f0 <== ALWAYS TAKEN 400137e8: a0 10 00 19 mov %i1, %l0 400137ec: a0 10 00 01 mov %g1, %l0 <== NOT EXECUTED uint32_t ino ) { return (ino >= fs_info->uino_base); } 400137f0: 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) 400137f4: 80 a4 20 00 cmp %l0, 0 400137f8: 02 80 00 2a be 400138a0 <== NEVER TAKEN 400137fc: 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); 40013800: 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); 40013804: 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 40013808: 80 a7 60 00 cmp %i5, 0 4001380c: 12 80 00 05 bne 40013820 40013810: 93 2c 80 09 sll %l2, %o1, %o1 || (bytes_to_write == fs_info->vol.bytes_per_block)) 40013814: 80 a4 00 02 cmp %l0, %g2 40013818: 12 80 00 04 bne 40013828 4001381c: 94 10 20 01 mov 1, %o2 { rc = fat_buf_access(fs_info, sec_num, FAT_OP_TYPE_GET, &blk_buf); 40013820: 10 80 00 02 b 40013828 40013824: 94 10 20 02 mov 2, %o2 } else rc = fat_buf_access(fs_info, sec_num, FAT_OP_TYPE_READ, &blk_buf); 40013828: 7f ff ff 1a call 40013490 4001382c: 96 07 bf fc add %fp, -4, %o3 if (RC_OK == rc) 40013830: 80 a2 20 00 cmp %o0, 0 40013834: 12 80 00 0a bne 4001385c <== NEVER TAKEN 40013838: 80 a6 40 08 cmp %i1, %o0 { memcpy(blk_buf + offset, buf, bytes_to_write); 4001383c: d0 07 bf fc ld [ %fp + -4 ], %o0 40013840: 92 07 00 11 add %i4, %l1, %o1 40013844: 90 02 00 1a add %o0, %i2, %o0 40013848: 40 00 22 e4 call 4001c3d8 4001384c: 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; 40013850: 10 80 00 14 b 400138a0 40013854: e6 2e 20 88 stb %l3, [ %i0 + 0x88 ] cur_blk, ofs_blk, c, &buffer[bytes_written], overwrite_cluster); if (c != ret) 40013858: 80 a6 40 08 cmp %i1, %o0 4001385c: 12 80 00 06 bne 40013874 <== NEVER TAKEN 40013860: 82 10 3f ff mov -1, %g1 rc = -1; else { bytes_to_write -= ret; 40013864: b6 26 c0 19 sub %i3, %i1, %i3 bytes_written += ret; 40013868: a2 04 40 19 add %l1, %i1, %l1 ++cur_blk; 4001386c: a4 04 a0 01 inc %l2 40013870: 82 10 20 00 clr %g1 40013874: b4 10 20 00 clr %i2 ssize_t ret; uint32_t c; cur_blk += blocks_in_offset; while ( (RC_OK == rc) 40013878: 80 a6 e0 00 cmp %i3, 0 4001387c: 02 80 00 04 be 4001388c 40013880: 80 a0 60 00 cmp %g1, 0 40013884: 22 bf ff d2 be,a 400137cc <== ALWAYS TAKEN 40013888: c4 16 20 0a lduh [ %i0 + 0xa ], %g2 bytes_written += ret; ++cur_blk; } ofs_blk = 0; } if (RC_OK != rc) 4001388c: 80 a0 60 00 cmp %g1, 0 40013890: 12 80 00 06 bne 400138a8 <== NEVER TAKEN 40013894: b0 10 3f ff mov -1, %i0 40013898: 81 c7 e0 08 ret 4001389c: 91 e8 00 11 restore %g0, %l1, %o0 } } if (RC_OK != rc) return rc; else return bytes_to_write; 400138a0: 10 bf ff ee b 40013858 400138a4: 90 10 00 10 mov %l0, %o0 } if (RC_OK != rc) return rc; else return bytes_written; } 400138a8: 81 c7 e0 08 ret <== NOT EXECUTED 400138ac: 81 e8 00 00 restore <== NOT EXECUTED =============================================================================== 40012b2c : int fat_file_close( fat_fs_info_t *fs_info, fat_file_fd_t *fat_fd ) { 40012b2c: 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) 40012b30: c2 06 60 08 ld [ %i1 + 8 ], %g1 40012b34: 80 a0 60 01 cmp %g1, 1 40012b38: 08 80 00 05 bleu 40012b4c 40012b3c: 82 00 7f ff add %g1, -1, %g1 { fat_fd->links_num--; return rc; 40012b40: 90 10 20 00 clr %o0 40012b44: 10 80 00 25 b 40012bd8 40012b48: 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) 40012b4c: c2 0e 60 30 ldub [ %i1 + 0x30 ], %g1 40012b50: 80 88 60 01 btst 1, %g1 40012b54: 02 80 00 14 be 40012ba4 40012b58: 90 10 00 18 mov %i0, %o0 { rc = fat_file_truncate(fs_info, fat_fd, 0); 40012b5c: 92 10 00 19 mov %i1, %o1 40012b60: 7f ff ff ae call 40012a18 40012b64: 94 10 20 00 clr %o2 if ( rc != RC_OK ) 40012b68: 80 a2 20 00 cmp %o0, 0 40012b6c: 12 80 00 1b bne 40012bd8 <== NEVER TAKEN 40012b70: 01 00 00 00 nop */ RTEMS_INLINE_ROUTINE void rtems_chain_extract( rtems_chain_node *the_node ) { _Chain_Extract( the_node ); 40012b74: 40 00 0e 6d call 40016528 <_Chain_Extract> 40012b78: 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) ) 40012b7c: d2 06 60 0c ld [ %i1 + 0xc ], %o1 40012b80: 40 00 06 01 call 40014384 40012b84: 90 10 00 18 mov %i0, %o0 40012b88: 80 8a 20 ff btst 0xff, %o0 40012b8c: 02 80 00 0f be 40012bc8 <== ALWAYS TAKEN 40012b90: 01 00 00 00 nop fat_free_unique_ino(fs_info, fat_fd->ino); 40012b94: d2 06 60 0c ld [ %i1 + 0xc ], %o1 <== NOT EXECUTED 40012b98: 40 00 05 f0 call 40014358 <== NOT EXECUTED 40012b9c: 90 10 00 18 mov %i0, %o0 <== NOT EXECUTED 40012ba0: 30 80 00 0a b,a 40012bc8 <== NOT EXECUTED free(fat_fd); } else { if (fat_ino_is_unique(fs_info, fat_fd->ino)) 40012ba4: 40 00 05 f8 call 40014384 40012ba8: d2 06 60 0c ld [ %i1 + 0xc ], %o1 40012bac: 80 8a 20 ff btst 0xff, %o0 40012bb0: 02 80 00 04 be 40012bc0 40012bb4: 01 00 00 00 nop { fat_fd->links_num = 0; 40012bb8: 10 80 00 06 b 40012bd0 40012bbc: c0 26 60 08 clr [ %i1 + 8 ] 40012bc0: 40 00 0e 5a call 40016528 <_Chain_Extract> 40012bc4: 90 10 00 19 mov %i1, %o0 } else { _hash_delete(fs_info->vhash, key, fat_fd->ino, fat_fd); free(fat_fd); 40012bc8: 7f ff cb e4 call 40005b58 40012bcc: 90 10 00 19 mov %i1, %o0 } } /* * flush any modified "cached" buffer back to disk */ rc = fat_buf_release(fs_info); 40012bd0: 40 00 01 bc call 400132c0 40012bd4: 81 e8 00 00 restore return rc; } 40012bd8: 81 c7 e0 08 ret 40012bdc: 91 e8 00 08 restore %g0, %o0, %o0 =============================================================================== 40012cb0 : fat_file_fd_t *fat_fd, bool zero_fill, uint32_t new_length, uint32_t *a_length ) { 40012cb0: 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; 40012cb4: f6 27 00 00 st %i3, [ %i4 ] if (new_length <= fat_fd->fat_file_size) 40012cb8: c2 06 60 18 ld [ %i1 + 0x18 ], %g1 uint32_t new_length, uint32_t *a_length ) { int rc = RC_OK; uint32_t chain = 0; 40012cbc: 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; 40012cc0: 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) 40012cc4: 80 a6 c0 01 cmp %i3, %g1 40012cc8: 18 80 00 04 bgu 40012cd8 40012ccc: ba 10 00 18 mov %i0, %i5 return RC_OK; 40012cd0: 81 c7 e0 08 ret 40012cd4: 91 e8 20 00 restore %g0, 0, %o0 if ((FAT_FD_OF_ROOT_DIR(fat_fd)) && 40012cd8: c4 06 60 20 ld [ %i1 + 0x20 ], %g2 40012cdc: 80 a0 a0 01 cmp %g2, 1 40012ce0: 32 80 00 0b bne,a 40012d0c 40012ce4: e0 17 60 06 lduh [ %i5 + 6 ], %l0 40012ce8: c4 06 60 24 ld [ %i1 + 0x24 ], %g2 40012cec: 80 a0 a0 00 cmp %g2, 0 40012cf0: 32 80 00 07 bne,a 40012d0c <== NEVER TAKEN 40012cf4: e0 17 60 06 lduh [ %i5 + 6 ], %l0 <== NOT EXECUTED (fs_info->vol.type & (FAT_FAT12 | FAT_FAT16))) 40012cf8: 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)) && 40012cfc: 80 88 a0 03 btst 3, %g2 40012d00: 22 80 00 03 be,a 40012d0c <== NEVER TAKEN 40012d04: e0 17 60 06 lduh [ %i5 + 6 ], %l0 <== NOT EXECUTED 40012d08: 30 80 00 34 b,a 40012dd8 (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))) & 40012d0c: 84 04 3f ff add %l0, -1, %g2 40012d10: 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 - 40012d14: a0 24 00 12 sub %l0, %l2, %l0 40012d18: 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; 40012d1c: 84 26 c0 01 sub %i3, %g1, %g2 if (bytes2add > bytes_remain) 40012d20: 80 a0 80 10 cmp %g2, %l0 40012d24: 08 80 00 03 bleu 40012d30 40012d28: a2 10 20 00 clr %l1 bytes2add -= bytes_remain; 40012d2c: a2 20 80 10 sub %g2, %l0, %l1 else bytes2add = 0; if (zero_fill && bytes_remain > 0) { 40012d30: 80 a4 20 00 cmp %l0, 0 40012d34: 02 80 00 17 be 40012d90 40012d38: 80 a4 60 00 cmp %l1, 0 40012d3c: 80 a6 a0 00 cmp %i2, 0 40012d40: 02 80 00 14 be 40012d90 40012d44: 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; 40012d48: 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); 40012d4c: 90 10 00 1d mov %i5, %o0 40012d50: 92 10 00 19 mov %i1, %o1 40012d54: 95 30 40 0a srl %g1, %o2, %o2 40012d58: 7f ff fe 39 call 4001263c 40012d5c: 96 07 bf fc add %fp, -4, %o3 if (rc != RC_OK) 40012d60: b0 92 60 00 orcc %o1, 0, %i0 40012d64: 12 80 00 21 bne 40012de8 <== NEVER TAKEN 40012d68: d2 07 bf fc ld [ %fp + -4 ], %o1 return rc; bytes_written = fat_cluster_set (fs_info, cur_cln, ofs, bytes_remain, 0); 40012d6c: 90 10 00 1d mov %i5, %o0 40012d70: 94 10 00 12 mov %l2, %o2 40012d74: 96 10 00 10 mov %l0, %o3 40012d78: 98 10 20 00 clr %o4 40012d7c: 40 00 02 3a call 40013664 40012d80: b0 10 3f ff mov -1, %i0 if (bytes_remain != bytes_written) 40012d84: 80 a4 00 08 cmp %l0, %o0 40012d88: 12 80 00 18 bne 40012de8 <== NEVER TAKEN 40012d8c: 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) 40012d90: 02 bf ff d0 be 40012cd0 40012d94: a4 04 7f ff add %l1, -1, %l2 return RC_OK; cls2add = ((bytes2add - 1) >> fs_info->vol.bpc_log2) + 1; 40012d98: c2 0f 60 08 ldub [ %i5 + 8 ], %g1 rc = fat_scan_fat_for_free_clusters(fs_info, &chain, cls2add, 40012d9c: 90 10 00 1d mov %i5, %o0 * file ) - return */ if (bytes2add == 0) return RC_OK; cls2add = ((bytes2add - 1) >> fs_info->vol.bpc_log2) + 1; 40012da0: a5 34 80 01 srl %l2, %g1, %l2 rc = fat_scan_fat_for_free_clusters(fs_info, &chain, cls2add, 40012da4: 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; 40012da8: a4 04 a0 01 inc %l2 rc = fat_scan_fat_for_free_clusters(fs_info, &chain, cls2add, 40012dac: 96 07 bf fc add %fp, -4, %o3 40012db0: 94 10 00 12 mov %l2, %o2 40012db4: 98 07 bf f8 add %fp, -8, %o4 40012db8: 40 00 1c 38 call 40019e98 40012dbc: 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) 40012dc0: b0 92 20 00 orcc %o0, 0, %i0 40012dc4: 12 80 00 09 bne 40012de8 <== NEVER TAKEN 40012dc8: 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)) 40012dcc: 80 94 00 01 orcc %l0, %g1, %g0 40012dd0: 12 80 00 08 bne 40012df0 <== ALWAYS TAKEN 40012dd4: 80 a4 80 01 cmp %l2, %g1 rtems_set_errno_and_return_minus_one(ENOSPC); 40012dd8: 40 00 22 db call 4001b944 <__errno> 40012ddc: b0 10 3f ff mov -1, %i0 40012de0: 82 10 20 1c mov 0x1c, %g1 40012de4: c2 22 00 00 st %g1, [ %o0 ] 40012de8: 81 c7 e0 08 ret 40012dec: 81 e8 00 00 restore /* check wether we satisfied request for 'cls2add' clusters */ if (cls2add != cls_added) 40012df0: 02 80 00 09 be 40012e14 <== ALWAYS TAKEN 40012df4: 82 24 80 01 sub %l2, %g1, %g1 { new_length -= bytes2add & (fs_info->vol.bpc - 1); 40012df8: c4 17 60 06 lduh [ %i5 + 6 ], %g2 <== NOT EXECUTED 40012dfc: 84 00 bf ff add %g2, -1, %g2 <== NOT EXECUTED 40012e00: a2 0c 40 02 and %l1, %g2, %l1 <== NOT EXECUTED new_length -= (cls2add - cls_added) << fs_info->vol.bpc_log2; 40012e04: 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); 40012e08: b6 26 c0 11 sub %i3, %l1, %i3 <== NOT EXECUTED new_length -= (cls2add - cls_added) << fs_info->vol.bpc_log2; 40012e0c: 83 28 40 02 sll %g1, %g2, %g1 <== NOT EXECUTED 40012e10: 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 ) 40012e14: d6 06 60 18 ld [ %i1 + 0x18 ], %o3 40012e18: 80 a2 e0 00 cmp %o3, 0 40012e1c: 32 80 00 07 bne,a 40012e38 40012e20: c2 06 60 3c ld [ %i1 + 0x3c ], %g1 { fat_fd->map.disk_cln = fat_fd->cln = chain; 40012e24: c2 07 bf f0 ld [ %fp + -16 ], %g1 fat_fd->map.file_cln = 0; 40012e28: 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; 40012e2c: c2 26 60 1c st %g1, [ %i1 + 0x1c ] 40012e30: 10 80 00 1d b 40012ea4 40012e34: c2 26 60 38 st %g1, [ %i1 + 0x38 ] fat_fd->map.file_cln = 0; } else { if (fat_fd->map.last_cln != FAT_UNDEFINED_VALUE) 40012e38: 80 a0 7f ff cmp %g1, -1 40012e3c: 22 80 00 04 be,a 40012e4c <== NEVER TAKEN 40012e40: 90 10 00 1d mov %i5, %o0 <== NOT EXECUTED { old_last_cl = fat_fd->map.last_cln; 40012e44: 10 80 00 0c b 40012e74 40012e48: c2 27 bf f4 st %g1, [ %fp + -12 ] } else { rc = fat_file_ioctl(fs_info, fat_fd, F_CLU_NUM, 40012e4c: 92 10 00 19 mov %i1, %o1 <== NOT EXECUTED 40012e50: 94 10 20 01 mov 1, %o2 <== NOT EXECUTED 40012e54: 96 02 ff ff add %o3, -1, %o3 <== NOT EXECUTED 40012e58: 7f ff ff 62 call 40012be0 <== NOT EXECUTED 40012e5c: 98 07 bf f4 add %fp, -12, %o4 <== NOT EXECUTED (fat_fd->fat_file_size - 1), &old_last_cl); if ( rc != RC_OK ) 40012e60: b4 92 20 00 orcc %o0, 0, %i2 <== NOT EXECUTED 40012e64: 02 80 00 05 be 40012e78 <== NOT EXECUTED 40012e68: 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); 40012e6c: 10 80 00 1f b 40012ee8 <== NOT EXECUTED 40012e70: 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); 40012e74: d2 07 bf f4 ld [ %fp + -12 ], %o1 40012e78: d4 07 bf f0 ld [ %fp + -16 ], %o2 40012e7c: 40 00 1b 37 call 40019b58 40012e80: 90 10 00 1d mov %i5, %o0 40012e84: b4 10 00 08 mov %o0, %i2 if ( rc != RC_OK ) 40012e88: 80 a6 a0 00 cmp %i2, 0 40012e8c: 02 80 00 04 be 40012e9c <== ALWAYS TAKEN 40012e90: 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); 40012e94: 10 80 00 16 b 40012eec <== NOT EXECUTED 40012e98: 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); 40012e9c: 40 00 01 09 call 400132c0 40012ea0: 01 00 00 00 nop } /* update number of the last cluster of the file if it changed */ if (cls_added != 0) 40012ea4: c2 07 bf fc ld [ %fp + -4 ], %g1 40012ea8: 80 a0 60 00 cmp %g1, 0 40012eac: 22 80 00 14 be,a 40012efc <== NEVER TAKEN 40012eb0: f6 27 00 00 st %i3, [ %i4 ] <== NOT EXECUTED { fat_fd->map.last_cln = last_cl; 40012eb4: c2 07 bf f8 ld [ %fp + -8 ], %g1 40012eb8: c2 26 60 3c st %g1, [ %i1 + 0x3c ] if (fat_fd->fat_file_type == FAT_DIRECTORY) 40012ebc: c2 06 60 10 ld [ %i1 + 0x10 ], %g1 40012ec0: 80 a0 60 00 cmp %g1, 0 40012ec4: 32 80 00 0e bne,a 40012efc 40012ec8: f6 27 00 00 st %i3, [ %i4 ] { rc = fat_init_clusters_chain(fs_info, chain); 40012ecc: d2 07 bf f0 ld [ %fp + -16 ], %o1 40012ed0: 40 00 04 d4 call 40014220 40012ed4: 90 10 00 1d mov %i5, %o0 if ( rc != RC_OK ) 40012ed8: b4 92 20 00 orcc %o0, 0, %i2 40012edc: 22 80 00 08 be,a 40012efc <== ALWAYS TAKEN 40012ee0: f6 27 00 00 st %i3, [ %i4 ] { fat_free_fat_clusters_chain(fs_info, chain); 40012ee4: 90 10 00 1d mov %i5, %o0 <== NOT EXECUTED 40012ee8: d2 07 bf f0 ld [ %fp + -16 ], %o1 <== NOT EXECUTED 40012eec: 40 00 1b bc call 40019ddc <== NOT EXECUTED 40012ef0: b0 10 00 1a mov %i2, %i0 <== NOT EXECUTED 40012ef4: 81 c7 e0 08 ret <== NOT EXECUTED 40012ef8: 81 e8 00 00 restore <== NOT EXECUTED } } } *a_length = new_length; fat_fd->fat_file_size = new_length; 40012efc: f6 26 60 18 st %i3, [ %i1 + 0x18 ] return RC_OK; } 40012f00: 81 c7 e0 08 ret 40012f04: 81 e8 00 00 restore =============================================================================== 40012be0 : fat_file_ioctl( fat_fs_info_t *fs_info, fat_file_fd_t *fat_fd, int cmd, ...) { 40012be0: 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); 40012be4: 82 07 a0 50 add %fp, 0x50, %g1 40012be8: f6 27 a0 50 st %i3, [ %fp + 0x50 ] 40012bec: f8 27 a0 54 st %i4, [ %fp + 0x54 ] 40012bf0: 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; 40012bf4: c0 27 bf f8 clr [ %fp + -8 ] uint32_t *ret; va_list ap; va_start(ap, cmd); switch (cmd) 40012bf8: 80 a6 a0 01 cmp %i2, 1 40012bfc: 12 80 00 26 bne 40012c94 <== NEVER TAKEN 40012c00: c2 27 bf fc st %g1, [ %fp + -4 ] { case F_CLU_NUM: pos = va_arg(ap, uint32_t); ret = va_arg(ap, uint32_t *); 40012c04: 82 07 a0 58 add %fp, 0x58, %g1 40012c08: c2 27 bf fc st %g1, [ %fp + -4 ] /* sanity check */ if ( pos >= fat_fd->fat_file_size ) { 40012c0c: c2 06 60 18 ld [ %i1 + 0x18 ], %g1 40012c10: 80 a6 c0 01 cmp %i3, %g1 40012c14: 0a 80 00 06 bcs 40012c2c <== ALWAYS TAKEN 40012c18: ba 10 00 1c mov %i4, %i5 va_end(ap); rtems_set_errno_and_return_minus_one( EIO ); 40012c1c: 40 00 23 4a call 4001b944 <__errno> <== NOT EXECUTED 40012c20: 01 00 00 00 nop <== NOT EXECUTED 40012c24: 10 80 00 1f b 40012ca0 <== NOT EXECUTED 40012c28: 82 10 20 05 mov 5, %g1 ! 5 <== NOT EXECUTED } if ((FAT_FD_OF_ROOT_DIR(fat_fd)) && 40012c2c: c2 06 60 20 ld [ %i1 + 0x20 ], %g1 40012c30: 80 a0 60 01 cmp %g1, 1 40012c34: 32 80 00 0d bne,a 40012c68 40012c38: d4 0e 20 08 ldub [ %i0 + 8 ], %o2 40012c3c: c2 06 60 24 ld [ %i1 + 0x24 ], %g1 40012c40: 80 a0 60 00 cmp %g1, 0 40012c44: 32 80 00 09 bne,a 40012c68 <== NEVER TAKEN 40012c48: d4 0e 20 08 ldub [ %i0 + 8 ], %o2 <== NOT EXECUTED (fs_info->vol.type & (FAT_FAT12 | FAT_FAT16))) 40012c4c: 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)) && 40012c50: 80 88 60 03 btst 3, %g1 40012c54: 22 80 00 05 be,a 40012c68 40012c58: 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; 40012c5c: c0 27 00 00 clr [ %i4 ] rc = RC_OK; break; 40012c60: 81 c7 e0 08 ret 40012c64: 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); 40012c68: 90 10 00 18 mov %i0, %o0 40012c6c: 92 10 00 19 mov %i1, %o1 40012c70: 95 36 c0 0a srl %i3, %o2, %o2 40012c74: 7f ff fe 72 call 4001263c 40012c78: 96 07 bf f8 add %fp, -8, %o3 if ( rc != RC_OK ) 40012c7c: b0 92 60 00 orcc %o1, 0, %i0 40012c80: 12 80 00 03 bne 40012c8c <== NEVER TAKEN 40012c84: c2 07 bf f8 ld [ %fp + -8 ], %g1 break; *ret = cur_cln; 40012c88: c2 27 40 00 st %g1, [ %i5 ] break; 40012c8c: 81 c7 e0 08 ret 40012c90: 81 e8 00 00 restore default: errno = EINVAL; 40012c94: 40 00 23 2c call 4001b944 <__errno> <== NOT EXECUTED 40012c98: 01 00 00 00 nop <== NOT EXECUTED 40012c9c: 82 10 20 16 mov 0x16, %g1 ! 16 <== NOT EXECUTED 40012ca0: c2 22 00 00 st %g1, [ %o0 ] <== NOT EXECUTED rc = -1; 40012ca4: b0 10 3f ff mov -1, %i0 <== NOT EXECUTED break; } va_end(ap); return rc; } 40012ca8: 81 c7 e0 08 ret <== NOT EXECUTED 40012cac: 81 e8 00 00 restore <== NOT EXECUTED =============================================================================== 4001263c : fat_fs_info_t *fs_info, fat_file_fd_t *fat_fd, uint32_t file_cln, uint32_t *disk_cln ) { 4001263c: 9d e3 bf 98 save %sp, -104, %sp int rc = RC_OK; if (file_cln == fat_fd->map.file_cln) 40012640: c2 06 60 34 ld [ %i1 + 0x34 ], %g1 40012644: 80 a6 80 01 cmp %i2, %g1 40012648: 12 80 00 05 bne 4001265c 4001264c: 01 00 00 00 nop *disk_cln = fat_fd->map.disk_cln; 40012650: c2 06 60 38 ld [ %i1 + 0x38 ], %g1 40012654: 10 80 00 1b b 400126c0 40012658: 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) 4001265c: 28 80 00 06 bleu,a 40012674 40012660: c2 06 60 1c ld [ %i1 + 0x1c ], %g1 { cur_cln = fat_fd->map.disk_cln; 40012664: c4 06 60 38 ld [ %i1 + 0x38 ], %g2 count = file_cln - fat_fd->map.file_cln; 40012668: 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; 4001266c: 10 80 00 04 b 4001267c 40012670: c4 27 bf fc st %g2, [ %fp + -4 ] count = file_cln - fat_fd->map.file_cln; } else { cur_cln = fat_fd->cln; 40012674: b8 10 00 1a mov %i2, %i4 40012678: c2 27 bf fc st %g1, [ %fp + -4 ] count = file_cln; } /* skip over the clusters */ for (i = 0; i < count; i++) 4001267c: 10 80 00 0b b 400126a8 40012680: ba 10 20 00 clr %i5 { rc = fat_get_fat_cluster(fs_info, cur_cln, &cur_cln); 40012684: 90 10 00 18 mov %i0, %o0 40012688: 40 00 1c c2 call 40019990 4001268c: 94 07 bf fc add %fp, -4, %o2 if ( rc != RC_OK ) 40012690: 80 a2 20 00 cmp %o0, 0 40012694: 22 80 00 05 be,a 400126a8 <== ALWAYS TAKEN 40012698: ba 07 60 01 inc %i5 return rc; 4001269c: 86 10 00 08 mov %o0, %g3 <== NOT EXECUTED 400126a0: 10 80 00 0a b 400126c8 <== NOT EXECUTED 400126a4: 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++) 400126a8: 80 a7 40 1c cmp %i5, %i4 400126ac: 12 bf ff f6 bne 40012684 400126b0: d2 07 bf fc ld [ %fp + -4 ], %o1 if ( rc != RC_OK ) return rc; } /* update cache */ fat_fd->map.file_cln = file_cln; 400126b4: f4 26 60 34 st %i2, [ %i1 + 0x34 ] fat_fd->map.disk_cln = cur_cln; 400126b8: d2 26 60 38 st %o1, [ %i1 + 0x38 ] *disk_cln = cur_cln; 400126bc: d2 26 c0 00 st %o1, [ %i3 ] } return RC_OK; 400126c0: 84 10 20 00 clr %g2 400126c4: 86 10 20 00 clr %g3 } 400126c8: b0 10 00 02 mov %g2, %i0 400126cc: 81 c7 e0 08 ret 400126d0: 93 e8 00 03 restore %g0, %g3, %o1 =============================================================================== 400126d4 : fat_file_open( fat_fs_info_t *fs_info, fat_dir_pos_t *dir_pos, fat_file_fd_t **fat_fd ) { 400126d4: 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); 400126d8: 90 10 00 18 mov %i0, %o0 400126dc: 7f ff ff c7 call 400125f8 400126e0: 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; 400126e4: 82 0a 20 01 and %o0, 1, %g1 rtems_chain_node *the_node = rtems_chain_first(hash + mod); 400126e8: 85 28 60 02 sll %g1, 2, %g2 400126ec: b7 28 60 04 sll %g1, 4, %i3 400126f0: c2 06 20 6c ld [ %i0 + 0x6c ], %g1 400126f4: 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); 400126f8: 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); 400126fc: 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; 40012700: 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 )); 40012704: 10 80 00 0c b 40012734 40012708: 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); 4001270c: 7f ff ff bb call 400125f8 40012710: 92 07 60 20 add %i5, 0x20, %o1 if ( (key1) == ck) 40012714: 80 a7 00 08 cmp %i4, %o0 40012718: 32 80 00 07 bne,a 40012734 4001271c: 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++; 40012720: 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; 40012724: fa 26 80 00 st %i5, [ %i2 ] lfat_fd->links_num++; 40012728: 82 00 60 01 inc %g1 4001272c: 10 80 00 42 b 40012834 40012730: 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) ; ) 40012734: 80 a7 40 10 cmp %i5, %l0 40012738: 12 bf ff f5 bne 4001270c 4001273c: 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); 40012740: 10 80 00 3f b 4001283c 40012744: 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); 40012748: 7f ff ff ac call 400125f8 <== NOT EXECUTED 4001274c: 92 07 60 20 add %i5, 0x20, %o1 <== NOT EXECUTED if ( (key1) == ck) 40012750: 80 a7 00 08 cmp %i4, %o0 <== NOT EXECUTED 40012754: 32 80 00 0a bne,a 4001277c <== NOT EXECUTED 40012758: fa 07 40 00 ld [ %i5 ], %i5 <== NOT EXECUTED { if ( ((key2) == 0) || ((key2) == ffd->ino) ) 4001275c: 80 a7 20 00 cmp %i4, 0 <== NOT EXECUTED 40012760: 22 80 00 0b be,a 4001278c <== NOT EXECUTED 40012764: a0 10 20 00 clr %l0 <== NOT EXECUTED 40012768: c2 07 60 0c ld [ %i5 + 0xc ], %g1 <== NOT EXECUTED 4001276c: 80 a7 00 01 cmp %i4, %g1 <== NOT EXECUTED 40012770: 22 80 00 07 be,a 4001278c <== NOT EXECUTED 40012774: a0 10 20 00 clr %l0 <== NOT EXECUTED { *ret = (void *)the_node; return 0; } } the_node = the_node->next; 40012778: 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) ; ) 4001277c: 80 a7 40 10 cmp %i5, %l0 40012780: 12 bf ff f2 bne 40012748 <== NEVER TAKEN 40012784: 90 10 00 18 mov %i0, %o0 40012788: 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)); 4001278c: 7f ff ce 3d call 40006080 40012790: 90 10 20 44 mov 0x44, %o0 40012794: d0 26 80 00 st %o0, [ %i2 ] if ( lfat_fd == NULL ) 40012798: 80 a2 20 00 cmp %o0, 0 4001279c: 02 80 00 1c be 4001280c <== NEVER TAKEN 400127a0: ba 10 00 08 mov %o0, %i5 rtems_set_errno_and_return_minus_one( ENOMEM ); memset(lfat_fd, 0, sizeof(fat_file_fd_t)); 400127a4: 92 10 20 00 clr %o1 400127a8: 40 00 27 49 call 4001c4cc 400127ac: 94 10 20 44 mov 0x44, %o2 lfat_fd->links_num = 1; 400127b0: 82 10 20 01 mov 1, %g1 400127b4: c2 27 60 08 st %g1, [ %i5 + 8 ] lfat_fd->flags &= ~FAT_FILE_REMOVED; 400127b8: c2 0f 60 30 ldub [ %i5 + 0x30 ], %g1 lfat_fd->map.last_cln = FAT_UNDEFINED_VALUE; lfat_fd->dir_pos = *dir_pos; 400127bc: 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; 400127c0: 82 08 7f fe and %g1, -2, %g1 400127c4: c2 2f 60 30 stb %g1, [ %i5 + 0x30 ] lfat_fd->map.last_cln = FAT_UNDEFINED_VALUE; 400127c8: 82 10 3f ff mov -1, %g1 lfat_fd->dir_pos = *dir_pos; 400127cc: 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; 400127d0: c2 27 60 3c st %g1, [ %i5 + 0x3c ] lfat_fd->dir_pos = *dir_pos; 400127d4: 40 00 27 01 call 4001c3d8 400127d8: 94 10 20 10 mov 0x10, %o2 if ( rc != RC_OK ) 400127dc: 80 a4 20 00 cmp %l0, 0 400127e0: 02 80 00 04 be 400127f0 <== NEVER TAKEN 400127e4: 01 00 00 00 nop lfat_fd->ino = key; 400127e8: 10 80 00 0f b 40012824 400127ec: f8 27 60 0c st %i4, [ %i5 + 0xc ] else { lfat_fd->ino = fat_get_unique_ino(fs_info); 400127f0: 40 00 06 aa call 40014298 <== NOT EXECUTED 400127f4: 90 10 00 18 mov %i0, %o0 <== NOT EXECUTED if ( lfat_fd->ino == 0 ) 400127f8: 80 a2 20 00 cmp %o0, 0 <== NOT EXECUTED 400127fc: 12 80 00 0a bne 40012824 <== NOT EXECUTED 40012800: d0 27 60 0c st %o0, [ %i5 + 0xc ] <== NOT EXECUTED { free((*fat_fd)); 40012804: 7f ff cc d5 call 40005b58 <== NOT EXECUTED 40012808: 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 ); 4001280c: 40 00 24 4e call 4001b944 <__errno> <== NOT EXECUTED 40012810: b0 10 3f ff mov -1, %i0 <== NOT EXECUTED 40012814: 82 10 20 0c mov 0xc, %g1 <== NOT EXECUTED 40012818: c2 22 00 00 st %g1, [ %o0 ] <== NOT EXECUTED 4001281c: 81 c7 e0 08 ret <== NOT EXECUTED 40012820: 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); 40012824: 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 ); 40012828: 92 10 00 1d mov %i5, %o1 4001282c: 7f ff e0 a4 call 4000aabc <_Chain_Append> 40012830: 90 02 00 1b add %o0, %i3, %o0 /* * other fields of fat-file descriptor will be initialized on upper * level */ return RC_OK; 40012834: 81 c7 e0 08 ret 40012838: 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); 4001283c: 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; 40012840: 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 )); 40012844: 10 bf ff ce b 4001277c 40012848: a0 04 20 04 add %l0, 4, %l0 =============================================================================== 40012860 : fat_file_fd_t *fat_fd, uint32_t start, uint32_t count, uint8_t *buf ) { 40012860: 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; 40012864: c0 27 bf fc clr [ %fp + -4 ] fat_file_fd_t *fat_fd, uint32_t start, uint32_t count, uint8_t *buf ) { 40012868: 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) 4001286c: 80 a6 e0 00 cmp %i3, 0 40012870: 02 80 00 68 be 40012a10 <== NEVER TAKEN 40012874: 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 ) 40012878: c2 06 60 18 ld [ %i1 + 0x18 ], %g1 4001287c: 80 a6 80 01 cmp %i2, %g1 40012880: 1a 80 00 64 bcc 40012a10 40012884: 80 a6 c0 01 cmp %i3, %g1 return FAT_EOF; if ((count > fat_fd->fat_file_size) || 40012888: 38 80 00 07 bgu,a 400128a4 <== NEVER TAKEN 4001288c: b6 20 40 1a sub %g1, %i2, %i3 <== NOT EXECUTED (start > fat_fd->fat_file_size - count)) 40012890: 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) || 40012894: 80 a6 80 02 cmp %i2, %g2 40012898: 28 80 00 04 bleu,a 400128a8 4001289c: c2 06 60 20 ld [ %i1 + 0x20 ], %g1 (start > fat_fd->fat_file_size - count)) count = fat_fd->fat_file_size - start; 400128a0: b6 20 40 1a sub %g1, %i2, %i3 if ((FAT_FD_OF_ROOT_DIR(fat_fd)) && 400128a4: c2 06 60 20 ld [ %i1 + 0x20 ], %g1 400128a8: 80 a0 60 01 cmp %g1, 1 400128ac: 32 80 00 1c bne,a 4001291c 400128b0: e4 0f 60 08 ldub [ %i5 + 8 ], %l2 400128b4: c2 06 60 24 ld [ %i1 + 0x24 ], %g1 400128b8: 80 a0 60 00 cmp %g1, 0 400128bc: 32 80 00 18 bne,a 4001291c <== NEVER TAKEN 400128c0: e4 0f 60 08 ldub [ %i5 + 8 ], %l2 <== NOT EXECUTED (fs_info->vol.type & (FAT_FAT12 | FAT_FAT16))) 400128c4: 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)) && 400128c8: 80 88 60 03 btst 3, %g1 400128cc: 22 80 00 14 be,a 4001291c 400128d0: 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); 400128d4: d2 06 60 1c ld [ %i1 + 0x1c ], %o1 400128d8: 7f ff ff 3a call 400125c0 400128dc: 90 10 00 1d mov %i5, %o0 sec += (start >> fs_info->vol.sec_log2); 400128e0: d2 0f 60 02 ldub [ %i5 + 2 ], %o1 byte = start & (fs_info->vol.bps - 1); 400128e4: 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); 400128e8: 93 36 80 09 srl %i2, %o1, %o1 byte = start & (fs_info->vol.bps - 1); 400128ec: 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); 400128f0: 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); 400128f4: 94 0e 80 0a and %i2, %o2, %o2 400128f8: 90 10 00 1d mov %i5, %o0 400128fc: 96 10 00 1b mov %i3, %o3 40012900: 40 00 03 13 call 4001354c <_fat_block_read> 40012904: 98 10 00 1c mov %i4, %o4 if ( ret < 0 ) 40012908: 80 a2 20 00 cmp %o0, 0 4001290c: 16 80 00 41 bge 40012a10 <== ALWAYS TAKEN 40012910: 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; 40012914: 10 80 00 3f b 40012a10 <== NOT EXECUTED 40012918: 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); 4001291c: f0 17 60 06 lduh [ %i5 + 6 ], %i0 return -1; return ret; } cl_start = start >> fs_info->vol.bpc_log2; 40012920: 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); 40012924: a6 07 bf fc add %fp, -4, %l3 40012928: 90 10 00 1d mov %i5, %o0 4001292c: 92 10 00 19 mov %i1, %o1 40012930: 94 10 00 12 mov %l2, %o2 40012934: 7f ff ff 42 call 4001263c 40012938: 96 10 00 13 mov %l3, %o3 if (rc != RC_OK) 4001293c: 90 92 60 00 orcc %o1, 0, %o0 40012940: 12 80 00 34 bne 40012a10 <== NEVER TAKEN 40012944: 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); 40012948: b1 2e 20 10 sll %i0, 0x10, %i0 4001294c: b1 36 20 10 srl %i0, 0x10, %i0 40012950: b0 06 3f ff add %i0, -1, %i0 40012954: b4 0e 80 18 and %i2, %i0, %i2 40012958: b0 10 20 00 clr %i0 4001295c: 10 80 00 20 b 400129dc 40012960: a2 10 00 1a mov %i2, %l1 if (rc != RC_OK) return rc; while (count > 0) { c = MIN(count, (fs_info->vol.bpc - ofs)); 40012964: a0 24 00 11 sub %l0, %l1, %l0 40012968: 80 a4 00 1b cmp %l0, %i3 4001296c: 38 80 00 02 bgu,a 40012974 40012970: a0 10 00 1b mov %i3, %l0 sec = fat_cluster_num_to_sector_num(fs_info, cur_cln); 40012974: d2 07 bf fc ld [ %fp + -4 ], %o1 40012978: 7f ff ff 12 call 400125c0 4001297c: 90 10 00 1d mov %i5, %o0 sec += (ofs >> fs_info->vol.sec_log2); 40012980: d2 0f 60 02 ldub [ %i5 + 2 ], %o1 byte = ofs & (fs_info->vol.bps - 1); 40012984: 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); 40012988: 93 34 40 09 srl %l1, %o1, %o1 byte = ofs & (fs_info->vol.bps - 1); 4001298c: 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); 40012990: 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); 40012994: 94 0c 40 0a and %l1, %o2, %o2 40012998: 90 10 00 1d mov %i5, %o0 4001299c: 96 10 00 10 mov %l0, %o3 400129a0: 40 00 02 eb call 4001354c <_fat_block_read> 400129a4: 98 07 00 18 add %i4, %i0, %o4 if ( ret < 0 ) 400129a8: 80 a2 20 00 cmp %o0, 0 400129ac: 06 80 00 18 bl 40012a0c <== NEVER TAKEN 400129b0: b6 26 c0 10 sub %i3, %l0, %i3 return -1; count -= c; cmpltd += c; 400129b4: b0 06 00 10 add %i0, %l0, %i0 save_cln = cur_cln; 400129b8: e0 07 bf fc ld [ %fp + -4 ], %l0 rc = fat_get_fat_cluster(fs_info, cur_cln, &cur_cln); 400129bc: 90 10 00 1d mov %i5, %o0 400129c0: 92 10 00 10 mov %l0, %o1 400129c4: 94 10 00 13 mov %l3, %o2 400129c8: 40 00 1b f2 call 40019990 400129cc: a2 10 20 00 clr %l1 if ( rc != RC_OK ) 400129d0: 80 a2 20 00 cmp %o0, 0 400129d4: 12 80 00 0f bne 40012a10 <== NEVER TAKEN 400129d8: 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) 400129dc: 80 a6 e0 00 cmp %i3, 0 400129e0: 32 bf ff e1 bne,a 40012964 400129e4: 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); 400129e8: c2 0f 60 08 ldub [ %i5 + 8 ], %g1 400129ec: b4 06 bf ff add %i2, -1, %i2 fat_fd->map.disk_cln = save_cln; 400129f0: 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); 400129f4: b4 06 80 18 add %i2, %i0, %i2 fat_fd->map.disk_cln = save_cln; return cmpltd; 400129f8: 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); 400129fc: 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 + 40012a00: a4 06 80 12 add %i2, %l2, %l2 40012a04: 10 80 00 03 b 40012a10 40012a08: 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; 40012a0c: 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; } 40012a10: 81 c7 e0 08 ret 40012a14: 91 e8 00 08 restore %g0, %o0, %o0 =============================================================================== 40013188 : int fat_file_size( fat_fs_info_t *fs_info, fat_file_fd_t *fat_fd ) { 40013188: 9d e3 bf 98 save %sp, -104, %sp int rc = RC_OK; uint32_t cur_cln = fat_fd->cln; 4001318c: c2 06 60 1c ld [ %i1 + 0x1c ], %g1 40013190: 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)) && 40013194: c2 06 60 20 ld [ %i1 + 0x20 ], %g1 40013198: 80 a0 60 01 cmp %g1, 1 4001319c: 12 80 00 0d bne 400131d0 400131a0: ba 10 00 18 mov %i0, %i5 400131a4: c2 06 60 24 ld [ %i1 + 0x24 ], %g1 400131a8: 80 a0 60 00 cmp %g1, 0 400131ac: 32 80 00 0a bne,a 400131d4 <== NEVER TAKEN 400131b0: c0 26 60 18 clr [ %i1 + 0x18 ] <== NOT EXECUTED (fs_info->vol.type & (FAT_FAT12 | FAT_FAT16))) 400131b4: 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)) && 400131b8: 80 88 60 03 btst 3, %g1 400131bc: 22 80 00 06 be,a 400131d4 <== ALWAYS TAKEN 400131c0: 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; 400131c4: c2 06 20 2c ld [ %i0 + 0x2c ], %g1 <== NOT EXECUTED 400131c8: 10 80 00 18 b 40013228 <== NOT EXECUTED 400131cc: c2 26 60 18 st %g1, [ %i1 + 0x18 ] <== NOT EXECUTED return rc; } fat_fd->fat_file_size = 0; 400131d0: c0 26 60 18 clr [ %i1 + 0x18 ] while ((cur_cln & fs_info->vol.mask) < fs_info->vol.eoc_val) 400131d4: 10 80 00 0d b 40013208 400131d8: 82 10 20 00 clr %g1 { save_cln = cur_cln; rc = fat_get_fat_cluster(fs_info, cur_cln, &cur_cln); 400131dc: 92 10 00 1c mov %i4, %o1 400131e0: 40 00 19 ec call 40019990 400131e4: 94 07 bf fc add %fp, -4, %o2 if ( rc != RC_OK ) 400131e8: b0 92 20 00 orcc %o0, 0, %i0 400131ec: 12 80 00 10 bne 4001322c <== NEVER TAKEN 400131f0: 01 00 00 00 nop return rc; fat_fd->fat_file_size += fs_info->vol.bpc; 400131f4: c2 17 60 06 lduh [ %i5 + 6 ], %g1 400131f8: c4 06 60 18 ld [ %i1 + 0x18 ], %g2 400131fc: 82 00 80 01 add %g2, %g1, %g1 40013200: 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; 40013204: 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) 40013208: f8 07 bf fc ld [ %fp + -4 ], %i4 4001320c: c6 07 60 10 ld [ %i5 + 0x10 ], %g3 40013210: c4 07 60 14 ld [ %i5 + 0x14 ], %g2 40013214: 86 0f 00 03 and %i4, %g3, %g3 40013218: 80 a0 c0 02 cmp %g3, %g2 4001321c: 0a bf ff f0 bcs 400131dc 40013220: 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; 40013224: c2 26 60 3c st %g1, [ %i1 + 0x3c ] 40013228: b0 10 20 00 clr %i0 return rc; } 4001322c: 81 c7 e0 08 ret 40013230: 81 e8 00 00 restore =============================================================================== 40012a18 : fat_file_truncate( fat_fs_info_t *fs_info, fat_file_fd_t *fat_fd, uint32_t new_length ) { 40012a18: 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; 40012a1c: 82 10 3f ff mov -1, %g1 40012a20: c2 27 bf fc st %g1, [ %fp + -4 ] if ( new_length >= fat_fd->fat_file_size ) 40012a24: c2 06 60 18 ld [ %i1 + 0x18 ], %g1 40012a28: 80 a6 80 01 cmp %i2, %g1 40012a2c: 0a 80 00 04 bcs 40012a3c 40012a30: c0 27 bf f8 clr [ %fp + -8 ] return rc; 40012a34: 10 80 00 3b b 40012b20 40012a38: 92 10 20 00 clr %o1 assert(fat_fd->fat_file_size); 40012a3c: 80 a0 60 00 cmp %g1, 0 40012a40: 32 80 00 0a bne,a 40012a68 <== ALWAYS TAKEN 40012a44: c4 0e 20 08 ldub [ %i0 + 8 ], %g2 40012a48: 11 10 00 b0 sethi %hi(0x4002c000), %o0 <== NOT EXECUTED 40012a4c: 15 10 00 b0 sethi %hi(0x4002c000), %o2 <== NOT EXECUTED 40012a50: 17 10 00 b0 sethi %hi(0x4002c000), %o3 <== NOT EXECUTED 40012a54: 90 12 23 18 or %o0, 0x318, %o0 <== NOT EXECUTED 40012a58: 92 10 22 d1 mov 0x2d1, %o1 <== NOT EXECUTED 40012a5c: 94 12 a3 78 or %o2, 0x378, %o2 <== NOT EXECUTED 40012a60: 7f ff cb d8 call 400059c0 <__assert_func> <== NOT EXECUTED 40012a64: 96 12 e3 60 or %o3, 0x360, %o3 <== NOT EXECUTED cl_start = (new_length + fs_info->vol.bpc - 1) >> fs_info->vol.bpc_log2; 40012a68: c6 16 20 06 lduh [ %i0 + 6 ], %g3 40012a6c: 86 00 ff ff add %g3, -1, %g3 40012a70: b4 00 c0 1a add %g3, %i2, %i2 40012a74: b5 36 80 02 srl %i2, %g2, %i2 if ((cl_start << fs_info->vol.bpc_log2) >= fat_fd->fat_file_size) 40012a78: 85 2e 80 02 sll %i2, %g2, %g2 40012a7c: 80 a0 80 01 cmp %g2, %g1 40012a80: 1a bf ff ed bcc 40012a34 40012a84: 80 a6 a0 00 cmp %i2, 0 return RC_OK; if (cl_start != 0) 40012a88: 12 80 00 0b bne 40012ab4 40012a8c: 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); 40012a90: 92 10 00 19 mov %i1, %o1 40012a94: 94 10 00 1a mov %i2, %o2 40012a98: 7f ff fe e9 call 4001263c 40012a9c: 96 07 bf f8 add %fp, -8, %o3 if (rc != RC_OK) 40012aa0: 80 a2 60 00 cmp %o1, 0 40012aa4: 32 80 00 20 bne,a 40012b24 <== NEVER TAKEN 40012aa8: b0 10 00 09 mov %o1, %i0 <== NOT EXECUTED return rc; rc = fat_free_fat_clusters_chain(fs_info, cur_cln); 40012aac: 10 80 00 0b b 40012ad8 40012ab0: 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); 40012ab4: 92 10 00 19 mov %i1, %o1 40012ab8: 94 06 bf ff add %i2, -1, %o2 40012abc: 7f ff fe e0 call 4001263c 40012ac0: 96 07 bf fc add %fp, -4, %o3 if (rc != RC_OK) 40012ac4: 80 a2 60 00 cmp %o1, 0 40012ac8: 02 bf ff f2 be 40012a90 <== ALWAYS TAKEN 40012acc: 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; } 40012ad0: 81 c7 e0 08 ret <== NOT EXECUTED 40012ad4: 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); 40012ad8: 40 00 1c c1 call 40019ddc 40012adc: 90 10 00 18 mov %i0, %o0 if (rc != RC_OK) 40012ae0: 92 92 20 00 orcc %o0, 0, %o1 40012ae4: 12 80 00 0f bne 40012b20 <== NEVER TAKEN 40012ae8: 80 a6 a0 00 cmp %i2, 0 return rc; if (cl_start != 0) 40012aec: 02 80 00 0d be 40012b20 40012af0: 92 10 20 00 clr %o1 { rc = fat_set_fat_cluster(fs_info, new_last_cln, FAT_GENFAT_EOC); 40012af4: d2 07 bf fc ld [ %fp + -4 ], %o1 40012af8: 90 10 00 18 mov %i0, %o0 40012afc: 40 00 1c 17 call 40019b58 40012b00: 94 10 3f ff mov -1, %o2 if ( rc != RC_OK ) 40012b04: 92 92 20 00 orcc %o0, 0, %o1 40012b08: 12 80 00 06 bne 40012b20 <== NEVER TAKEN 40012b0c: c2 07 bf fc ld [ %fp + -4 ], %g1 return rc; fat_fd->map.file_cln = cl_start - 1; 40012b10: b4 06 bf ff add %i2, -1, %i2 fat_fd->map.disk_cln = new_last_cln; 40012b14: 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; 40012b18: f4 26 60 34 st %i2, [ %i1 + 0x34 ] fat_fd->map.disk_cln = new_last_cln; fat_fd->map.last_cln = new_last_cln; 40012b1c: c2 26 60 3c st %g1, [ %i1 + 0x3c ] } return RC_OK; } 40012b20: b0 10 00 09 mov %o1, %i0 40012b24: 81 c7 e0 08 ret 40012b28: 81 e8 00 00 restore =============================================================================== 40012f08 : fat_file_fd_t *fat_fd, uint32_t start, uint32_t count, const uint8_t *buf ) { 40012f08: 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; 40012f0c: c0 27 bf f8 clr [ %fp + -8 ] fat_file_fd_t *fat_fd, uint32_t start, uint32_t count, const uint8_t *buf ) { 40012f10: 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; 40012f14: c2 06 60 18 ld [ %i1 + 0x18 ], %g1 uint32_t file_cln_initial = fat_fd->map.file_cln; 40012f18: e6 06 60 34 ld [ %i1 + 0x34 ], %l3 uint32_t cln; if ( count == 0 ) 40012f1c: 80 a6 e0 00 cmp %i3, 0 40012f20: 02 80 00 84 be 40013130 <== NEVER TAKEN 40012f24: 90 10 20 00 clr %o0 return cmpltd; if (start >= fat_fd->size_limit) 40012f28: fa 06 60 14 ld [ %i1 + 0x14 ], %i5 40012f2c: 80 a6 80 1d cmp %i2, %i5 40012f30: 2a 80 00 07 bcs,a 40012f4c <== ALWAYS TAKEN 40012f34: ba 27 40 1a sub %i5, %i2, %i5 rtems_set_errno_and_return_minus_one(EFBIG); 40012f38: 40 00 22 83 call 4001b944 <__errno> <== NOT EXECUTED 40012f3c: 01 00 00 00 nop <== NOT EXECUTED 40012f40: 82 10 20 1b mov 0x1b, %g1 ! 1b <== NOT EXECUTED 40012f44: 10 80 00 30 b 40013004 <== NOT EXECUTED 40012f48: c2 22 00 00 st %g1, [ %o0 ] <== NOT EXECUTED 40012f4c: 80 a7 40 1b cmp %i5, %i3 40012f50: 38 80 00 02 bgu,a 40012f58 <== ALWAYS TAKEN 40012f54: 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; 40012f58: 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); 40012f5c: b6 07 40 1a add %i5, %i2, %i3 40012f60: 94 40 20 00 addx %g0, 0, %o2 40012f64: 90 10 00 10 mov %l0, %o0 40012f68: 92 10 00 19 mov %i1, %o1 40012f6c: 96 10 00 1b mov %i3, %o3 40012f70: 7f ff ff 50 call 40012cb0 40012f74: 98 07 bf f8 add %fp, -8, %o4 if (RC_OK == rc) 40012f78: 80 a2 20 00 cmp %o0, 0 40012f7c: 12 80 00 6d bne 40013130 40012f80: 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)) 40012f84: 80 a0 40 1b cmp %g1, %i3 40012f88: 32 80 00 02 bne,a 40012f90 <== NEVER TAKEN 40012f8c: 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)); 40012f90: 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)) 40012f94: 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)); 40012f98: 80 a0 e0 01 cmp %g3, 1 40012f9c: 12 80 00 09 bne 40012fc0 40012fa0: 82 10 20 00 clr %g1 40012fa4: c6 06 60 24 ld [ %i1 + 0x24 ], %g3 40012fa8: 80 a0 e0 00 cmp %g3, 0 40012fac: 12 80 00 06 bne 40012fc4 <== NEVER TAKEN 40012fb0: 80 a0 60 00 cmp %g1, 0 40012fb4: 82 08 a0 03 and %g2, 3, %g1 40012fb8: 80 a0 00 01 cmp %g0, %g1 40012fbc: 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)) 40012fc0: 80 a0 60 00 cmp %g1, 0 40012fc4: 02 80 00 12 be 4001300c 40012fc8: f6 0c 20 08 ldub [ %l0 + 8 ], %i3 { cln = fat_fd->cln; 40012fcc: d2 06 60 1c ld [ %i1 + 0x1c ], %o1 cln += (start >> fs_info->vol.bpc_log2); byte = start & (fs_info->vol.bpc -1); 40012fd0: 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); 40012fd4: b7 36 80 1b srl %i2, %i3, %i3 byte = start & (fs_info->vol.bpc -1); 40012fd8: 94 02 bf ff add %o2, -1, %o2 ret = fat_cluster_write(fs_info, 40012fdc: 90 10 00 10 mov %l0, %o0 40012fe0: 92 06 c0 09 add %i3, %o1, %o1 40012fe4: 94 0e 80 0a and %i2, %o2, %o2 40012fe8: 96 10 00 1d mov %i5, %o3 40012fec: 98 10 00 1c mov %i4, %o4 40012ff0: 40 00 01 e5 call 40013784 40012ff4: 9a 10 20 00 clr %o5 cln, byte, count, buf, false); if (0 > ret) 40012ff8: 80 a2 20 00 cmp %o0, 0 40012ffc: 16 80 00 4d bge 40013130 <== ALWAYS TAKEN 40013000: 01 00 00 00 nop rc = -1; 40013004: 10 80 00 4b b 40013130 <== NOT EXECUTED 40013008: 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; 4001300c: 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; 40013010: 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); 40013014: 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; 40013018: 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); 4001301c: 90 10 00 10 mov %l0, %o0 40013020: 92 10 00 19 mov %i1, %o1 40013024: 94 10 00 11 mov %l1, %o2 40013028: 7f ff fd 85 call 4001263c 4001302c: 96 10 00 15 mov %l5, %o3 if (RC_OK == rc) 40013030: 80 a2 60 00 cmp %o1, 0 40013034: 12 80 00 34 bne 40013104 <== NEVER TAKEN 40013038: b7 2c 40 1b sll %l1, %i3, %i3 { file_cln_cnt = cur_cln - fat_fd->cln; 4001303c: c2 06 60 1c ld [ %i1 + 0x1c ], %g1 40013040: e4 07 bf fc ld [ %fp + -4 ], %l2 40013044: 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); 40013048: 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; 4001304c: 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); 40013050: 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; 40013054: 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 */ 40013058: 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; 4001305c: 10 80 00 1a b 400130c4 40013060: 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)); 40013064: 96 22 c0 18 sub %o3, %i0, %o3 40013068: 80 a2 c0 1d cmp %o3, %i5 4001306c: 38 80 00 02 bgu,a 40013074 40013070: 96 10 00 1d mov %i5, %o3 if (file_cln_initial < file_cln_cnt) 40013074: 80 a4 c0 12 cmp %l3, %l2 40013078: 2a 80 00 02 bcs,a 40013080 4001307c: a8 10 20 01 mov 1, %l4 overwrite_cluster = true; ret = fat_cluster_write(fs_info, 40013080: d2 07 bf fc ld [ %fp + -4 ], %o1 40013084: 90 10 00 10 mov %l0, %o0 40013088: 94 10 00 18 mov %i0, %o2 4001308c: 98 07 00 1b add %i4, %i3, %o4 40013090: 40 00 01 bd call 40013784 40013094: 9a 0d 20 01 and %l4, 1, %o5 40013098: 82 10 00 08 mov %o0, %g1 cur_cln, ofs_cln, c, &buf[cmpltd], overwrite_cluster); if (0 > ret) 4001309c: 80 a0 60 00 cmp %g1, 0 400130a0: 16 80 00 1d bge 40013114 <== ALWAYS TAKEN 400130a4: 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) 400130a8: 10 80 00 08 b 400130c8 <== NOT EXECUTED 400130ac: 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); 400130b0: 90 10 00 10 mov %l0, %o0 400130b4: 92 10 00 16 mov %l6, %o1 400130b8: 40 00 1a 36 call 40019990 400130bc: 94 10 00 15 mov %l5, %o2 ofs_cln = 0; 400130c0: 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) 400130c4: 80 a7 60 00 cmp %i5, 0 400130c8: 02 80 00 04 be 400130d8 400130cc: 80 a2 20 00 cmp %o0, 0 400130d0: 22 bf ff e5 be,a 40013064 <== ALWAYS TAKEN 400130d4: 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); 400130d8: c2 0c 20 08 ldub [ %l0 + 8 ], %g1 400130dc: b4 06 bf ff add %i2, -1, %i2 fat_fd->map.disk_cln = save_cln; 400130e0: 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); 400130e4: b4 06 80 1b add %i2, %i3, %i2 400130e8: b5 36 80 01 srl %i2, %g1, %i2 } } /* update cache */ /* XXX: check this - I'm not sure :( */ fat_fd->map.file_cln = start_cln + 400130ec: 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) 400130f0: 92 92 20 00 orcc %o0, 0, %o1 400130f4: 12 80 00 03 bne 40013100 <== NEVER TAKEN 400130f8: e2 26 60 34 st %l1, [ %i1 + 0x34 ] return rc; else return cmpltd; 400130fc: 92 10 00 1b mov %i3, %o1 fat_fd, start, count, buf, file_cln_initial); if (0 > ret) 40013100: 80 a2 60 00 cmp %o1, 0 40013104: 16 80 00 0b bge 40013130 <== ALWAYS TAKEN 40013108: 90 10 00 09 mov %o1, %o0 4001310c: 10 80 00 09 b 40013130 <== NOT EXECUTED 40013110: 90 10 3f ff mov -1, %o0 <== NOT EXECUTED if (0 > ret) rc = -1; if (RC_OK == rc) { ++file_cln_cnt; 40013114: a4 04 a0 01 inc %l2 bytes_to_write -= ret; cmpltd += ret; 40013118: b6 06 c0 01 add %i3, %g1, %i3 save_cln = cur_cln; if (0 < bytes_to_write) 4001311c: ba a7 40 01 subcc %i5, %g1, %i5 40013120: 12 bf ff e4 bne 400130b0 40013124: ec 07 bf fc ld [ %fp + -4 ], %l6 40013128: 10 bf ff e6 b 400130c0 4001312c: 90 10 20 00 clr %o0 } if (RC_OK != rc) return rc; else return cmpltd; } 40013130: 81 c7 e0 08 ret 40013134: 91 e8 00 08 restore %g0, %o0, %o0 =============================================================================== 40019ddc : int fat_free_fat_clusters_chain( fat_fs_info_t *fs_info, uint32_t chain ) { 40019ddc: 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; 40019de0: b8 10 20 00 clr %i4 int fat_free_fat_clusters_chain( fat_fs_info_t *fs_info, uint32_t chain ) { 40019de4: ba 10 00 18 mov %i0, %i5 int rc = RC_OK, rc1 = RC_OK; uint32_t cur_cln = chain; uint32_t next_cln = 0; 40019de8: 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; 40019dec: 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) 40019df0: 10 80 00 19 b 40019e54 40019df4: b4 10 20 00 clr %i2 { rc = fat_get_fat_cluster(fs_info, cur_cln, &next_cln); 40019df8: 92 10 00 1b mov %i3, %o1 40019dfc: 7f ff fe e5 call 40019990 40019e00: 94 07 bf fc add %fp, -4, %o2 if ( rc != RC_OK ) 40019e04: b0 92 20 00 orcc %o0, 0, %i0 40019e08: 02 80 00 0b be 40019e34 <== ALWAYS TAKEN 40019e0c: 90 10 00 1d mov %i5, %o0 { if(fs_info->vol.free_cls != FAT_UNDEFINED_VALUE) 40019e10: c2 07 60 44 ld [ %i5 + 0x44 ], %g1 <== NOT EXECUTED 40019e14: 80 a0 7f ff cmp %g1, -1 <== NOT EXECUTED 40019e18: 02 80 00 03 be 40019e24 <== NOT EXECUTED 40019e1c: b8 07 00 01 add %i4, %g1, %i4 <== NOT EXECUTED fs_info->vol.free_cls += freed_cls_cnt; 40019e20: f8 27 60 44 st %i4, [ %i5 + 0x44 ] <== NOT EXECUTED fat_buf_release(fs_info); 40019e24: 7f ff e5 27 call 400132c0 <== NOT EXECUTED 40019e28: 90 10 00 1d mov %i5, %o0 <== NOT EXECUTED 40019e2c: 81 c7 e0 08 ret <== NOT EXECUTED 40019e30: 81 e8 00 00 restore <== NOT EXECUTED return rc; } rc = fat_set_fat_cluster(fs_info, cur_cln, FAT_GENFAT_FREE); 40019e34: 92 10 00 1b mov %i3, %o1 40019e38: 7f ff ff 48 call 40019b58 40019e3c: 94 10 20 00 clr %o2 if ( rc != RC_OK ) 40019e40: 80 a2 20 00 cmp %o0, 0 40019e44: 32 80 00 02 bne,a 40019e4c <== NEVER TAKEN 40019e48: b4 10 00 08 mov %o0, %i2 <== NOT EXECUTED rc1 = rc; freed_cls_cnt++; cur_cln = next_cln; 40019e4c: 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++; 40019e50: 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) 40019e54: c4 07 60 10 ld [ %i5 + 0x10 ], %g2 40019e58: c2 07 60 14 ld [ %i5 + 0x14 ], %g1 40019e5c: 84 0e c0 02 and %i3, %g2, %g2 40019e60: 80 a0 80 01 cmp %g2, %g1 40019e64: 0a bf ff e5 bcs 40019df8 40019e68: 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) 40019e6c: c2 07 60 44 ld [ %i5 + 0x44 ], %g1 40019e70: 80 a0 7f ff cmp %g1, -1 40019e74: 02 80 00 05 be 40019e88 <== ALWAYS TAKEN 40019e78: f2 27 60 4c st %i1, [ %i5 + 0x4c ] fs_info->vol.free_cls += freed_cls_cnt; 40019e7c: b8 07 00 01 add %i4, %g1, %i4 <== NOT EXECUTED 40019e80: f8 27 60 44 st %i4, [ %i5 + 0x44 ] <== NOT EXECUTED fat_buf_release(fs_info); 40019e84: 90 10 00 1d mov %i5, %o0 <== NOT EXECUTED 40019e88: 7f ff e5 0e call 400132c0 40019e8c: b0 10 00 1a mov %i2, %i0 if (rc1 != RC_OK) return rc1; return RC_OK; } 40019e90: 81 c7 e0 08 ret 40019e94: 81 e8 00 00 restore =============================================================================== 40014358 : 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); 40014358: c2 02 20 80 ld [ %o0 + 0x80 ], %g1 <== NOT EXECUTED 4001435c: c4 02 20 74 ld [ %o0 + 0x74 ], %g2 <== NOT EXECUTED 40014360: 86 10 20 01 mov 1, %g3 <== NOT EXECUTED 40014364: 92 22 40 01 sub %o1, %g1, %o1 <== NOT EXECUTED 40014368: 83 32 60 03 srl %o1, 3, %g1 <== NOT EXECUTED 4001436c: 92 0a 60 07 and %o1, 7, %o1 <== NOT EXECUTED 40014370: 93 28 c0 09 sll %g3, %o1, %o1 <== NOT EXECUTED 40014374: c6 08 80 01 ldub [ %g2 + %g1 ], %g3 <== NOT EXECUTED 40014378: 92 28 c0 09 andn %g3, %o1, %o1 <== NOT EXECUTED 4001437c: 81 c3 e0 08 retl <== NOT EXECUTED 40014380: d2 28 80 01 stb %o1, [ %g2 + %g1 ] <== NOT EXECUTED =============================================================================== 40019990 : fat_get_fat_cluster( fat_fs_info_t *fs_info, uint32_t cln, uint32_t *ret_val ) { 40019990: 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)) ) 40019994: 80 a6 60 01 cmp %i1, 1 40019998: 08 80 00 67 bleu 40019b34 <== NEVER TAKEN 4001999c: ba 10 00 18 mov %i0, %i5 400199a0: c2 06 20 38 ld [ %i0 + 0x38 ], %g1 400199a4: 82 00 60 01 inc %g1 400199a8: 80 a6 40 01 cmp %i1, %g1 400199ac: 28 80 00 03 bleu,a 400199b8 <== ALWAYS TAKEN 400199b0: c2 0e 20 0e ldub [ %i0 + 0xe ], %g1 400199b4: 30 80 00 60 b,a 40019b34 <== NOT EXECUTED rtems_set_errno_and_return_minus_one(EIO); sec = (FAT_FAT_OFFSET(fs_info->vol.type, cln) >> fs_info->vol.sec_log2) + 400199b8: 86 08 60 01 and %g1, 1, %g3 400199bc: 80 88 e0 ff btst 0xff, %g3 400199c0: 02 80 00 05 be 400199d4 400199c4: 88 08 60 02 and %g1, 2, %g4 400199c8: 85 36 60 01 srl %i1, 1, %g2 400199cc: 10 80 00 06 b 400199e4 400199d0: 84 00 80 19 add %g2, %i1, %g2 400199d4: 80 89 20 ff btst 0xff, %g4 400199d8: 02 80 00 03 be 400199e4 400199dc: 85 2e 60 02 sll %i1, 2, %g2 400199e0: 85 2e 60 01 sll %i1, 1, %g2 400199e4: f6 0f 60 02 ldub [ %i5 + 2 ], %i3 400199e8: c8 07 60 58 ld [ %i5 + 0x58 ], %g4 400199ec: 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); 400199f0: 80 88 e0 ff btst 0xff, %g3 400199f4: 02 80 00 05 be 40019a08 400199f8: b6 00 80 04 add %g2, %g4, %i3 400199fc: b9 36 60 01 srl %i1, 1, %i4 40019a00: 10 80 00 07 b 40019a1c 40019a04: b8 07 00 19 add %i4, %i1, %i4 40019a08: 82 08 60 02 and %g1, 2, %g1 40019a0c: 80 88 60 ff btst 0xff, %g1 40019a10: 02 80 00 03 be 40019a1c 40019a14: b9 2e 60 02 sll %i1, 2, %i4 40019a18: b9 2e 60 01 sll %i1, 1, %i4 40019a1c: e0 17 40 00 lduh [ %i5 ], %l0 rc = fat_buf_access(fs_info, sec, FAT_OP_TYPE_READ, &sec_buf); 40019a20: 90 10 00 1d mov %i5, %o0 40019a24: 92 10 00 1b mov %i3, %o1 40019a28: 94 10 20 01 mov 1, %o2 40019a2c: 7f ff e6 99 call 40013490 40019a30: 96 07 bf fc add %fp, -4, %o3 if (rc != RC_OK) 40019a34: b0 92 20 00 orcc %o0, 0, %i0 40019a38: 12 80 00 37 bne 40019b14 <== NEVER TAKEN 40019a3c: 83 2c 20 10 sll %l0, 0x10, %g1 return rc; switch ( fs_info->vol.type ) 40019a40: c4 0f 60 0e ldub [ %i5 + 0xe ], %g2 40019a44: 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); 40019a48: 83 30 60 10 srl %g1, 0x10, %g1 40019a4c: 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 ) 40019a50: 02 80 00 27 be 40019aec 40019a54: 82 0f 00 01 and %i4, %g1, %g1 40019a58: 80 a0 a0 04 cmp %g2, 4 40019a5c: 02 80 00 30 be 40019b1c 40019a60: 80 a0 a0 01 cmp %g2, 1 40019a64: 12 80 00 34 bne 40019b34 <== NEVER TAKEN 40019a68: 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) ) 40019a6c: 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)); 40019a70: c4 08 c0 01 ldub [ %g3 + %g1 ], %g2 if ( ofs == (fs_info->vol.bps - 1) ) 40019a74: 88 01 3f ff add %g4, -1, %g4 40019a78: 80 a0 40 04 cmp %g1, %g4 40019a7c: 12 80 00 10 bne 40019abc <== ALWAYS TAKEN 40019a80: c4 26 80 00 st %g2, [ %i2 ] { rc = fat_buf_access(fs_info, sec + 1, FAT_OP_TYPE_READ, 40019a84: 90 10 00 1d mov %i5, %o0 <== NOT EXECUTED 40019a88: 92 06 e0 01 add %i3, 1, %o1 <== NOT EXECUTED 40019a8c: 94 10 20 01 mov 1, %o2 <== NOT EXECUTED 40019a90: 7f ff e6 80 call 40013490 <== NOT EXECUTED 40019a94: 96 07 bf fc add %fp, -4, %o3 <== NOT EXECUTED &sec_buf); if (rc != RC_OK) 40019a98: 80 a2 20 00 cmp %o0, 0 <== NOT EXECUTED 40019a9c: 12 80 00 2c bne 40019b4c <== NOT EXECUTED 40019aa0: c2 07 bf fc ld [ %fp + -4 ], %g1 <== NOT EXECUTED return rc; *ret_val |= *sec_buf << 8; 40019aa4: c4 06 80 00 ld [ %i2 ], %g2 <== NOT EXECUTED 40019aa8: c2 08 40 00 ldub [ %g1 ], %g1 <== NOT EXECUTED 40019aac: 83 28 60 08 sll %g1, 8, %g1 <== NOT EXECUTED 40019ab0: 82 10 80 01 or %g2, %g1, %g1 <== NOT EXECUTED 40019ab4: 10 80 00 07 b 40019ad0 <== NOT EXECUTED 40019ab8: c2 26 80 00 st %g1, [ %i2 ] <== NOT EXECUTED } else { *ret_val |= *(sec_buf + ofs + 1) << 8; 40019abc: 82 00 c0 01 add %g3, %g1, %g1 40019ac0: c2 08 60 01 ldub [ %g1 + 1 ], %g1 40019ac4: 83 28 60 08 sll %g1, 8, %g1 40019ac8: 84 10 40 02 or %g1, %g2, %g2 40019acc: c4 26 80 00 st %g2, [ %i2 ] } if ( FAT_CLUSTER_IS_ODD(cln) ) 40019ad0: 80 8e 60 01 btst 1, %i1 40019ad4: 02 80 00 04 be 40019ae4 40019ad8: c2 06 80 00 ld [ %i2 ], %g1 *ret_val = (*ret_val) >> FAT12_SHIFT; 40019adc: 10 80 00 0d b 40019b10 40019ae0: 83 30 60 04 srl %g1, 4, %g1 else *ret_val = (*ret_val) & FAT_FAT12_MASK; 40019ae4: 10 80 00 0b b 40019b10 40019ae8: 82 08 6f ff and %g1, 0xfff, %g1 break; case FAT_FAT16: *ret_val = *((uint16_t *)(sec_buf + ofs)); 40019aec: c4 07 bf fc ld [ %fp + -4 ], %g2 *ret_val = CF_LE_W(*ret_val); 40019af0: 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)); 40019af4: c2 10 80 01 lduh [ %g2 + %g1 ], %g1 *ret_val = CF_LE_W(*ret_val); 40019af8: 86 10 e3 ff or %g3, 0x3ff, %g3 40019afc: 83 28 60 10 sll %g1, 0x10, %g1 40019b00: 85 30 60 18 srl %g1, 0x18, %g2 40019b04: 83 30 60 08 srl %g1, 8, %g1 40019b08: 82 08 40 03 and %g1, %g3, %g1 40019b0c: 82 10 80 01 or %g2, %g1, %g1 40019b10: c2 26 80 00 st %g1, [ %i2 ] break; 40019b14: 81 c7 e0 08 ret 40019b18: 81 e8 00 00 restore case FAT_FAT32: *ret_val = *((uint32_t *)(sec_buf + ofs)); *ret_val = CF_LE_L(*ret_val); 40019b1c: c4 07 bf fc ld [ %fp + -4 ], %g2 40019b20: 7f ff ff 90 call 40019960 40019b24: d0 00 80 01 ld [ %g2 + %g1 ], %o0 40019b28: d0 26 80 00 st %o0, [ %i2 ] break; 40019b2c: 81 c7 e0 08 ret 40019b30: 81 e8 00 00 restore default: rtems_set_errno_and_return_minus_one(EIO); 40019b34: 40 00 07 84 call 4001b944 <__errno> <== NOT EXECUTED 40019b38: b0 10 3f ff mov -1, %i0 <== NOT EXECUTED 40019b3c: 82 10 20 05 mov 5, %g1 <== NOT EXECUTED 40019b40: c2 22 00 00 st %g1, [ %o0 ] <== NOT EXECUTED 40019b44: 81 c7 e0 08 ret <== NOT EXECUTED 40019b48: 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) 40019b4c: b0 10 00 08 mov %o0, %i0 <== NOT EXECUTED rtems_set_errno_and_return_minus_one(EIO); break; } return RC_OK; } 40019b50: 81 c7 e0 08 ret <== NOT EXECUTED 40019b54: 81 e8 00 00 restore <== NOT EXECUTED =============================================================================== 40014298 : * 0 means FAILED !!! * */ uint32_t fat_get_unique_ino(fat_fs_info_t *fs_info) { 40014298: 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)) 4001429c: 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) 400142a0: 10 80 00 2b b 4001434c <== NOT EXECUTED 400142a4: 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)) 400142a8: c2 06 20 78 ld [ %i0 + 0x78 ], %g1 <== NOT EXECUTED 400142ac: 85 30 60 03 srl %g1, 3, %g2 <== NOT EXECUTED 400142b0: b6 00 c0 02 add %g3, %g2, %i3 <== NOT EXECUTED 400142b4: f4 08 c0 02 ldub [ %g3 + %g2 ], %i2 <== NOT EXECUTED 400142b8: c4 48 c0 02 ldsb [ %g3 + %g2 ], %g2 <== NOT EXECUTED 400142bc: ba 08 60 07 and %g1, 7, %i5 <== NOT EXECUTED 400142c0: 85 38 80 1d sra %g2, %i5, %g2 <== NOT EXECUTED 400142c4: 80 88 a0 01 btst 1, %g2 <== NOT EXECUTED 400142c8: 12 80 00 0a bne 400142f0 <== NOT EXECUTED 400142cc: 82 00 60 01 inc %g1 <== NOT EXECUTED { FAT_SET_UNIQ_INO_BUSY(fs_info->index, fs_info->uino); 400142d0: 82 10 20 01 mov 1, %g1 <== NOT EXECUTED 400142d4: bb 28 40 1d sll %g1, %i5, %i5 <== NOT EXECUTED 400142d8: ba 17 40 1a or %i5, %i2, %i5 <== NOT EXECUTED 400142dc: fa 2e c0 00 stb %i5, [ %i3 ] <== NOT EXECUTED return (fs_info->uino_base + fs_info->index); 400142e0: c4 06 20 78 ld [ %i0 + 0x78 ], %g2 <== NOT EXECUTED 400142e4: c2 06 20 80 ld [ %i0 + 0x80 ], %g1 <== NOT EXECUTED 400142e8: 81 c7 e0 08 ret <== NOT EXECUTED 400142ec: 91 e8 80 01 restore %g2, %g1, %o0 <== NOT EXECUTED } fs_info->index++; if (fs_info->index >= fs_info->uino_pool_size) 400142f0: 80 a0 40 04 cmp %g1, %g4 <== NOT EXECUTED 400142f4: 3a 80 00 03 bcc,a 40014300 <== NOT EXECUTED 400142f8: c0 26 20 78 clr [ %i0 + 0x78 ] <== NOT EXECUTED 400142fc: 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++) 40014300: 92 02 60 01 inc %o1 <== NOT EXECUTED 40014304: 80 a2 40 04 cmp %o1, %g4 <== NOT EXECUTED 40014308: 32 bf ff e8 bne,a 400142a8 <== NOT EXECUTED 4001430c: 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)) 40014310: c2 06 20 80 ld [ %i0 + 0x80 ], %g1 <== NOT EXECUTED 40014314: 93 2a 60 01 sll %o1, 1, %o1 <== NOT EXECUTED 40014318: 82 27 00 01 sub %i4, %g1, %g1 <== NOT EXECUTED 4001431c: 80 a2 40 01 cmp %o1, %g1 <== NOT EXECUTED 40014320: 2a 80 00 04 bcs,a 40014330 <== NOT EXECUTED 40014324: d0 06 20 74 ld [ %i0 + 0x74 ], %o0 <== NOT EXECUTED resrc_unsuff = true; } else resrc_unsuff = true; } return 0; 40014328: 81 c7 e0 08 ret <== NOT EXECUTED 4001432c: 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); 40014330: 7f ff c9 f6 call 40006b08 <== NOT EXECUTED 40014334: d2 26 20 7c st %o1, [ %i0 + 0x7c ] <== NOT EXECUTED if (fs_info->uino != NULL) 40014338: 80 a2 20 00 cmp %o0, 0 <== NOT EXECUTED 4001433c: 02 bf ff fb be 40014328 <== NOT EXECUTED 40014340: d0 26 20 74 st %o0, [ %i0 + 0x74 ] <== NOT EXECUTED fs_info->index = fs_info->uino_pool_size; 40014344: c2 06 20 7c ld [ %i0 + 0x7c ], %g1 <== NOT EXECUTED 40014348: 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++) 4001434c: c8 06 20 7c ld [ %i0 + 0x7c ], %g4 <== NOT EXECUTED 40014350: 10 bf ff ed b 40014304 <== NOT EXECUTED 40014354: 92 10 20 00 clr %o1 <== NOT EXECUTED =============================================================================== 40014220 : int fat_init_clusters_chain( fat_fs_info_t *fs_info, uint32_t start_cln ) { 40014220: 9d e3 bf 98 save %sp, -104, %sp 40014224: 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) 40014228: 10 80 00 10 b 40014268 4001422c: f2 27 bf fc st %i1, [ %fp + -4 ] { ret = fat_cluster_set(fs_info, cur_cln, 0, fs_info->vol.bpc, 0); 40014230: 90 10 00 1d mov %i5, %o0 40014234: 94 10 20 00 clr %o2 40014238: 7f ff fd 0b call 40013664 4001423c: 98 10 20 00 clr %o4 if ( ret != fs_info->vol.bpc ) 40014240: c2 17 60 06 lduh [ %i5 + 6 ], %g1 40014244: 80 a2 00 01 cmp %o0, %g1 40014248: 12 80 00 11 bne 4001428c <== NEVER TAKEN 4001424c: d2 07 bf fc ld [ %fp + -4 ], %o1 { return -1; } rc = fat_get_fat_cluster(fs_info, cur_cln, &cur_cln); 40014250: 90 10 00 1d mov %i5, %o0 40014254: 40 00 15 cf call 40019990 40014258: 94 07 bf fc add %fp, -4, %o2 if ( rc != RC_OK ) 4001425c: b0 92 20 00 orcc %o0, 0, %i0 40014260: 12 80 00 0c bne 40014290 <== NEVER TAKEN 40014264: 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) 40014268: d2 07 bf fc ld [ %fp + -4 ], %o1 4001426c: c4 07 60 10 ld [ %i5 + 0x10 ], %g2 40014270: c2 07 60 14 ld [ %i5 + 0x14 ], %g1 40014274: 84 0a 40 02 and %o1, %g2, %g2 40014278: 80 a0 80 01 cmp %g2, %g1 4001427c: 2a bf ff ed bcs,a 40014230 40014280: d6 17 60 06 lduh [ %i5 + 6 ], %o3 return rc; } } return rc; 40014284: 81 c7 e0 08 ret 40014288: 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; 4001428c: b0 10 3f ff mov -1, %i0 <== NOT EXECUTED } } return rc; } 40014290: 81 c7 e0 08 ret <== NOT EXECUTED 40014294: 81 e8 00 00 restore <== NOT EXECUTED =============================================================================== 400138b0 : * 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) { 400138b0: 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); 400138b4: 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) { 400138b8: 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; 400138bc: c0 27 bf a4 clr [ %fp + -92 ] vol->fd = open(device, O_RDWR); 400138c0: 7f ff cb f7 call 4000689c 400138c4: 90 10 00 19 mov %i1, %o0 if (vol->fd < 0) 400138c8: 80 a2 20 00 cmp %o0, 0 400138cc: 06 80 00 17 bl 40013928 <== NEVER TAKEN 400138d0: d0 26 e0 60 st %o0, [ %i3 + 0x60 ] { rtems_set_errno_and_return_minus_one(ENXIO); } rc = fstat(vol->fd, &stat_buf); 400138d4: 7f ff c8 cb call 40005c00 400138d8: 92 07 bf b8 add %fp, -72, %o1 if (rc != 0) 400138dc: 80 a2 20 00 cmp %o0, 0 400138e0: 12 80 00 10 bne 40013920 <== NEVER TAKEN 400138e4: 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)) 400138e8: c6 07 bf c4 ld [ %fp + -60 ], %g3 400138ec: 05 00 00 3c sethi %hi(0xf000), %g2 400138f0: 86 08 c0 02 and %g3, %g2, %g3 400138f4: 05 00 00 18 sethi %hi(0x6000), %g2 400138f8: 80 a0 c0 02 cmp %g3, %g2 400138fc: 12 80 00 09 bne 40013920 <== NEVER TAKEN 40013900: 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); 40013904: 94 06 20 64 add %i0, 0x64, %o2 40013908: 40 00 05 5e call 40014e80 4001390c: 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) { 40013910: 80 a2 20 00 cmp %o0, 0 40013914: 22 80 00 09 be,a 40013938 <== ALWAYS TAKEN 40013918: d0 06 20 64 ld [ %i0 + 0x64 ], %o0 close(vol->fd); 4001391c: d0 06 20 60 ld [ %i0 + 0x60 ], %o0 <== NOT EXECUTED 40013920: 7f ff c8 6d call 40005ad4 <== NOT EXECUTED 40013924: 01 00 00 00 nop <== NOT EXECUTED rtems_set_errno_and_return_minus_one(ENXIO); 40013928: 40 00 20 07 call 4001b944 <__errno> <== NOT EXECUTED 4001392c: 01 00 00 00 nop <== NOT EXECUTED 40013930: 10 80 01 af b 40013fec <== NOT EXECUTED 40013934: 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); 40013938: 92 10 20 00 clr %o1 4001393c: 7f ff f6 9a call 400113a4 40013940: 94 07 bf a4 add %fp, -92, %o2 if (sc != RTEMS_SUCCESSFUL) 40013944: 80 a2 20 00 cmp %o0, 0 40013948: 22 80 00 03 be,a 40013954 <== ALWAYS TAKEN 4001394c: d0 07 bf a4 ld [ %fp + -92 ], %o0 40013950: 30 80 00 32 b,a 40013a18 <== NOT EXECUTED { close(vol->fd); rtems_set_errno_and_return_minus_one( EIO); } memcpy( boot_rec, block->buffer, FAT_MAX_BPB_SIZE); 40013954: c6 02 20 1c ld [ %o0 + 0x1c ], %g3 40013958: c2 08 e0 20 ldub [ %g3 + 0x20 ], %g1 4001395c: c4 08 e0 0b ldub [ %g3 + 0xb ], %g2 40013960: c2 2f bf 9a stb %g1, [ %fp + -102 ] 40013964: c2 08 e0 22 ldub [ %g3 + 0x22 ], %g1 40013968: d2 08 e0 0c ldub [ %g3 + 0xc ], %o1 4001396c: c2 2f bf 9b stb %g1, [ %fp + -101 ] 40013970: c2 08 e0 23 ldub [ %g3 + 0x23 ], %g1 40013974: d8 08 e0 0e ldub [ %g3 + 0xe ], %o4 40013978: c2 2f bf 8f stb %g1, [ %fp + -113 ] 4001397c: c2 08 e0 2c ldub [ %g3 + 0x2c ], %g1 40013980: d6 08 e0 0f ldub [ %g3 + 0xf ], %o3 40013984: c2 2f bf 9e stb %g1, [ %fp + -98 ] 40013988: c2 08 e0 2d ldub [ %g3 + 0x2d ], %g1 4001398c: c8 08 e0 11 ldub [ %g3 + 0x11 ], %g4 40013990: c2 2f bf 9d stb %g1, [ %fp + -99 ] 40013994: c2 08 e0 2e ldub [ %g3 + 0x2e ], %g1 40013998: da 08 e0 12 ldub [ %g3 + 0x12 ], %o5 4001399c: c2 2f bf 9c stb %g1, [ %fp + -100 ] 400139a0: c2 08 e0 2f ldub [ %g3 + 0x2f ], %g1 400139a4: fa 08 e0 0d ldub [ %g3 + 0xd ], %i5 400139a8: f4 08 e0 10 ldub [ %g3 + 0x10 ], %i2 400139ac: e2 08 e0 13 ldub [ %g3 + 0x13 ], %l1 400139b0: e4 08 e0 14 ldub [ %g3 + 0x14 ], %l2 400139b4: ee 08 e0 16 ldub [ %g3 + 0x16 ], %l7 400139b8: f0 08 e0 17 ldub [ %g3 + 0x17 ], %i0 400139bc: e0 08 e0 21 ldub [ %g3 + 0x21 ], %l0 400139c0: e8 08 e0 24 ldub [ %g3 + 0x24 ], %l4 400139c4: ec 08 e0 25 ldub [ %g3 + 0x25 ], %l6 400139c8: ea 08 e0 26 ldub [ %g3 + 0x26 ], %l5 400139cc: e6 08 e0 27 ldub [ %g3 + 0x27 ], %l3 400139d0: f8 08 e0 28 ldub [ %g3 + 0x28 ], %i4 400139d4: c2 2f bf 97 stb %g1, [ %fp + -105 ] 400139d8: c2 08 e0 30 ldub [ %g3 + 0x30 ], %g1 400139dc: f2 08 e0 31 ldub [ %g3 + 0x31 ], %i1 400139e0: c2 2f bf 9f stb %g1, [ %fp + -97 ] sc = rtems_bdbuf_release( block); 400139e4: c4 27 bf 80 st %g2, [ %fp + -128 ] 400139e8: c8 27 bf 7c st %g4, [ %fp + -132 ] 400139ec: d2 27 bf 78 st %o1, [ %fp + -136 ] 400139f0: d6 27 bf 74 st %o3, [ %fp + -140 ] 400139f4: 7f ff f6 e8 call 40011594 400139f8: d8 3f bf 68 std %o4, [ %fp + -152 ] if (sc != RTEMS_SUCCESSFUL) 400139fc: c4 07 bf 80 ld [ %fp + -128 ], %g2 40013a00: 80 a2 20 00 cmp %o0, 0 40013a04: c8 07 bf 7c ld [ %fp + -132 ], %g4 40013a08: d2 07 bf 78 ld [ %fp + -136 ], %o1 40013a0c: d6 07 bf 74 ld [ %fp + -140 ], %o3 40013a10: 02 80 00 08 be 40013a30 <== ALWAYS TAKEN 40013a14: d8 1f bf 68 ldd [ %fp + -152 ], %o4 { close(vol->fd); 40013a18: 7f ff c8 2f call 40005ad4 <== NOT EXECUTED 40013a1c: d0 06 e0 60 ld [ %i3 + 0x60 ], %o0 <== NOT EXECUTED rtems_set_errno_and_return_minus_one( EIO ); 40013a20: 40 00 1f c9 call 4001b944 <__errno> <== NOT EXECUTED 40013a24: 01 00 00 00 nop <== NOT EXECUTED 40013a28: 10 80 01 71 b 40013fec <== NOT EXECUTED 40013a2c: 82 10 20 05 mov 5, %g1 ! 5 <== NOT EXECUTED } /* Evaluate boot record */ vol->bps = FAT_GET_BR_BYTES_PER_SECTOR(boot_rec); 40013a30: 84 08 a0 ff and %g2, 0xff, %g2 40013a34: 92 0a 60 ff and %o1, 0xff, %o1 40013a38: 93 2a 60 08 sll %o1, 8, %o1 40013a3c: 92 12 40 02 or %o1, %g2, %o1 40013a40: d2 36 c0 00 sth %o1, [ %i3 ] if ( (vol->bps != 512) && 40013a44: 85 2a 60 10 sll %o1, 0x10, %g2 40013a48: 85 30 a0 10 srl %g2, 0x10, %g2 40013a4c: 80 a0 a4 00 cmp %g2, 0x400 40013a50: 02 80 00 0c be 40013a80 <== NEVER TAKEN 40013a54: 86 10 00 09 mov %o1, %g3 40013a58: 80 a0 a2 00 cmp %g2, 0x200 40013a5c: 22 80 00 0a be,a 40013a84 <== ALWAYS TAKEN 40013a60: 85 2a 60 10 sll %o1, 0x10, %g2 (vol->bps != 1024) && 40013a64: 80 a0 a8 00 cmp %g2, 0x800 <== NOT EXECUTED 40013a68: 02 80 00 06 be 40013a80 <== NOT EXECUTED 40013a6c: 1f 00 00 04 sethi %hi(0x1000), %o7 <== NOT EXECUTED (vol->bps != 2048) && 40013a70: 80 a0 80 0f cmp %g2, %o7 <== NOT EXECUTED 40013a74: 02 80 00 04 be 40013a84 <== NOT EXECUTED 40013a78: 85 2a 60 10 sll %o1, 0x10, %g2 <== NOT EXECUTED 40013a7c: 30 80 00 d6 b,a 40013dd4 <== 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; 40013a80: 85 2a 60 10 sll %o1, 0x10, %g2 <== NOT EXECUTED 40013a84: c0 2e e0 03 clrb [ %i3 + 3 ] 40013a88: 10 80 00 05 b 40013a9c 40013a8c: 85 30 a0 19 srl %g2, 0x19, %g2 i >>= 1, vol->sec_mul++); 40013a90: 85 38 a0 01 sra %g2, 1, %g2 <== NOT EXECUTED 40013a94: 9e 03 e0 01 inc %o7 <== NOT EXECUTED 40013a98: 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; 40013a9c: 80 88 a0 01 btst 1, %g2 40013aa0: 22 bf ff fc be,a 40013a90 <== NEVER TAKEN 40013aa4: 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; 40013aa8: 93 2a 60 10 sll %o1, 0x10, %o1 40013aac: c0 2e e0 02 clrb [ %i3 + 2 ] 40013ab0: 93 32 60 10 srl %o1, 0x10, %o1 40013ab4: 10 80 00 05 b 40013ac8 40013ab8: 9e 10 00 09 mov %o1, %o7 i >>= 1, vol->sec_log2++); 40013abc: 84 00 a0 01 inc %g2 40013ac0: 9f 3b e0 01 sra %o7, 1, %o7 40013ac4: 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; 40013ac8: 80 8b e0 01 btst 1, %o7 40013acc: 02 bf ff fc be 40013abc 40013ad0: c4 0e e0 02 ldub [ %i3 + 2 ], %g2 i >>= 1, vol->sec_log2++); vol->bytes_per_block = vol->bps; 40013ad4: c6 36 e0 0a sth %g3, [ %i3 + 0xa ] vol->bytes_per_block_log2 = vol->sec_log2; 40013ad8: c4 2e e0 0c stb %g2, [ %i3 + 0xc ] vol->sectors_per_block = 1; 40013adc: 86 10 20 01 mov 1, %g3 vol->spc = FAT_GET_BR_SECTORS_PER_CLUSTER(boot_rec); 40013ae0: 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) 40013ae4: 9e 8f 60 ff andcc %i5, 0xff, %o7 40013ae8: 02 80 00 bb be 40013dd4 <== NEVER TAKEN 40013aec: 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; 40013af0: 10 80 00 05 b 40013b04 40013af4: c0 2e e0 05 clrb [ %i3 + 5 ] i >>= 1, vol->spc_log2++); 40013af8: 86 00 e0 01 inc %g3 40013afc: 9f 3b e0 01 sra %o7, 1, %o7 40013b00: 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; 40013b04: 80 8b e0 01 btst 1, %o7 40013b08: 02 bf ff fc be 40013af8 40013b0c: 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) 40013b10: 87 2a 40 03 sll %o1, %g3, %g3 40013b14: 95 28 e0 10 sll %g3, 0x10, %o2 40013b18: 1f 20 00 00 sethi %hi(0x80000000), %o7 40013b1c: 80 a2 80 0f cmp %o2, %o7 40013b20: 18 80 00 ad bgu 40013dd4 <== NEVER TAKEN 40013b24: 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; 40013b28: 1f 00 00 3f sethi %hi(0xfc00), %o7 40013b2c: c0 2e e0 08 clrb [ %i3 + 8 ] 40013b30: 9e 13 e3 ff or %o7, 0x3ff, %o7 40013b34: 10 80 00 05 b 40013b48 40013b38: 86 08 c0 0f and %g3, %o7, %g3 i >>= 1, vol->bpc_log2++); 40013b3c: 87 38 e0 01 sra %g3, 1, %g3 40013b40: 9e 03 e0 01 inc %o7 40013b44: 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; 40013b48: 80 88 e0 01 btst 1, %g3 40013b4c: 22 bf ff fc be,a 40013b3c 40013b50: de 0e e0 08 ldub [ %i3 + 8 ], %o7 i >>= 1, vol->bpc_log2++); vol->fats = FAT_GET_BR_FAT_NUM(boot_rec); 40013b54: 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)) / 40013b58: 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); 40013b5c: 96 0a e0 ff and %o3, 0xff, %o3 40013b60: 98 0b 20 ff and %o4, 0xff, %o4 40013b64: 97 2a e0 08 sll %o3, 8, %o3 vol->rdir_entrs = FAT_GET_BR_FILES_PER_ROOT_DIR(boot_rec); 40013b68: 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); 40013b6c: 98 12 c0 0c or %o3, %o4, %o4 vol->rdir_entrs = FAT_GET_BR_FILES_PER_ROOT_DIR(boot_rec); 40013b70: 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); 40013b74: d8 36 e0 18 sth %o4, [ %i3 + 0x18 ] vol->rdir_entrs = FAT_GET_BR_FILES_PER_ROOT_DIR(boot_rec); 40013b78: 88 09 20 ff and %g4, 0xff, %g4 40013b7c: 88 13 40 04 or %o5, %g4, %g4 40013b80: 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)) / 40013b84: 89 29 20 10 sll %g4, 0x10, %g4 40013b88: c4 27 bf 80 st %g2, [ %fp + -128 ] 40013b8c: 91 31 20 0b srl %g4, 0xb, %o0 40013b90: d8 27 bf 68 st %o4, [ %fp + -152 ] 40013b94: 7f ff ba eb call 40002740 <.div> 40013b98: 90 02 00 03 add %o0, %g3, %o0 vol->bps; vol->rdir_size = vol->rdir_secs << vol->sec_log2; 40013b9c: 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)) / 40013ba0: d0 26 e0 28 st %o0, [ %i3 + 0x28 ] vol->bps; vol->rdir_size = vol->rdir_secs << vol->sec_log2; 40013ba4: 85 2a 00 02 sll %o0, %g2, %g2 40013ba8: c4 26 e0 2c st %g2, [ %i3 + 0x2c ] if ( (FAT_GET_BR_SECTORS_PER_FAT(boot_rec)) != 0) 40013bac: b0 0e 20 ff and %i0, 0xff, %i0 40013bb0: ae 0d e0 ff and %l7, 0xff, %l7 40013bb4: 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)) / 40013bb8: 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) 40013bbc: ae 16 00 17 or %i0, %l7, %l7 40013bc0: af 2d e0 10 sll %l7, 0x10, %l7 40013bc4: 80 a5 e0 00 cmp %l7, 0 40013bc8: 02 80 00 05 be 40013bdc 40013bcc: d8 07 bf 68 ld [ %fp + -152 ], %o4 vol->fat_length = FAT_GET_BR_SECTORS_PER_FAT(boot_rec); 40013bd0: af 35 e0 10 srl %l7, 0x10, %l7 40013bd4: 10 80 00 0c b 40013c04 40013bd8: ee 26 e0 1c st %l7, [ %i3 + 0x1c ] else vol->fat_length = FAT_GET_BR_SECTORS_PER_FAT32(boot_rec); 40013bdc: ac 0d a0 ff and %l6, 0xff, %l6 40013be0: aa 0d 60 ff and %l5, 0xff, %l5 40013be4: ad 2d a0 08 sll %l6, 8, %l6 40013be8: ab 2d 60 10 sll %l5, 0x10, %l5 40013bec: a8 0d 20 ff and %l4, 0xff, %l4 40013bf0: aa 15 80 15 or %l6, %l5, %l5 40013bf4: a7 2c e0 18 sll %l3, 0x18, %l3 40013bf8: a8 15 40 14 or %l5, %l4, %l4 40013bfc: a6 15 00 13 or %l4, %l3, %l3 40013c00: e6 26 e0 1c st %l3, [ %i3 + 0x1c ] vol->data_fsec = vol->fat_loc + vol->fats * vol->fat_length + 40013c04: d2 06 e0 1c ld [ %i3 + 0x1c ], %o1 40013c08: 99 2b 20 10 sll %o4, 0x10, %o4 40013c0c: c6 27 bf 84 st %g3, [ %fp + -124 ] 40013c10: b1 33 20 10 srl %o4, 0x10, %i0 40013c14: 7f ff ba 8f call 40002650 <.umul> 40013c18: 90 0e a0 ff and %i2, 0xff, %o0 40013c1c: c6 07 bf 84 ld [ %fp + -124 ], %g3 40013c20: 90 06 00 08 add %i0, %o0, %o0 40013c24: 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; 40013c28: d0 26 e0 20 st %o0, [ %i3 + 0x20 ] if ( (FAT_GET_BR_TOTAL_SECTORS_NUM16(boot_rec)) != 0) 40013c2c: a4 0c a0 ff and %l2, 0xff, %l2 40013c30: a2 0c 60 ff and %l1, 0xff, %l1 40013c34: a5 2c a0 08 sll %l2, 8, %l2 40013c38: a2 14 80 11 or %l2, %l1, %l1 40013c3c: a3 2c 60 10 sll %l1, 0x10, %l1 40013c40: 80 a4 60 00 cmp %l1, 0 40013c44: 02 80 00 05 be 40013c58 40013c48: c6 26 e0 34 st %g3, [ %i3 + 0x34 ] vol->tot_secs = FAT_GET_BR_TOTAL_SECTORS_NUM16(boot_rec); 40013c4c: a3 34 60 10 srl %l1, 0x10, %l1 40013c50: 10 80 00 0d b 40013c84 40013c54: e2 26 e0 30 st %l1, [ %i3 + 0x30 ] else vol->tot_secs = FAT_GET_BR_TOTAL_SECTORS_NUM32(boot_rec); 40013c58: c8 0f bf 9a ldub [ %fp + -102 ], %g4 40013c5c: c4 0f bf 9b ldub [ %fp + -101 ], %g2 40013c60: c2 0f bf 8f ldub [ %fp + -113 ], %g1 40013c64: a0 0c 20 ff and %l0, 0xff, %l0 40013c68: 85 28 a0 10 sll %g2, 0x10, %g2 40013c6c: a1 2c 20 08 sll %l0, 8, %l0 40013c70: 84 14 00 02 or %l0, %g2, %g2 40013c74: 84 10 80 04 or %g2, %g4, %g2 40013c78: 89 28 60 18 sll %g1, 0x18, %g4 40013c7c: 84 10 80 04 or %g2, %g4, %g2 40013c80: c4 26 e0 30 st %g2, [ %i3 + 0x30 ] data_secs = vol->tot_secs - vol->data_fsec; 40013c84: d0 06 e0 30 ld [ %i3 + 0x30 ], %o0 vol->data_cls = data_secs / vol->spc; 40013c88: 92 0f 60 ff and %i5, 0xff, %o1 40013c8c: 7f ff ba ab call 40002738 <.udiv> 40013c90: 90 22 00 03 sub %o0, %g3, %o0 /* determine FAT type at least */ if ( vol->data_cls < FAT_FAT12_MAX_CLN) 40013c94: 80 a2 2f f4 cmp %o0, 0xff4 40013c98: 18 80 00 08 bgu 40013cb8 40013c9c: d0 26 e0 38 st %o0, [ %i3 + 0x38 ] { vol->type = FAT_FAT12; 40013ca0: 84 10 20 01 mov 1, %g2 40013ca4: c4 2e e0 0e stb %g2, [ %i3 + 0xe ] vol->mask = FAT_FAT12_MASK; 40013ca8: 84 10 2f ff mov 0xfff, %g2 40013cac: c4 26 e0 10 st %g2, [ %i3 + 0x10 ] vol->eoc_val = FAT_FAT12_EOC; 40013cb0: 10 80 00 0f b 40013cec 40013cb4: 84 10 2f f8 mov 0xff8, %g2 } else { if ( vol->data_cls < FAT_FAT16_MAX_CLN) 40013cb8: 05 00 00 3f sethi %hi(0xfc00), %g2 40013cbc: 86 10 a3 f4 or %g2, 0x3f4, %g3 ! fff4 40013cc0: 80 a2 00 03 cmp %o0, %g3 40013cc4: 38 80 00 05 bgu,a 40013cd8 40013cc8: 84 10 20 04 mov 4, %g2 { vol->type = FAT_FAT16; 40013ccc: 86 10 20 02 mov 2, %g3 40013cd0: 10 80 00 04 b 40013ce0 40013cd4: c6 2e e0 0e stb %g3, [ %i3 + 0xe ] vol->mask = FAT_FAT16_MASK; vol->eoc_val = FAT_FAT16_EOC; } else { vol->type = FAT_FAT32; 40013cd8: c4 2e e0 0e stb %g2, [ %i3 + 0xe ] vol->mask = FAT_FAT32_MASK; 40013cdc: 05 03 ff ff sethi %hi(0xffffc00), %g2 40013ce0: 86 10 a3 ff or %g2, 0x3ff, %g3 ! fffffff vol->eoc_val = FAT_FAT32_EOC; 40013ce4: 84 10 a3 f8 or %g2, 0x3f8, %g2 vol->eoc_val = FAT_FAT16_EOC; } else { vol->type = FAT_FAT32; vol->mask = FAT_FAT32_MASK; 40013ce8: c6 26 e0 10 st %g3, [ %i3 + 0x10 ] vol->eoc_val = FAT_FAT32_EOC; 40013cec: c4 26 e0 14 st %g2, [ %i3 + 0x14 ] } } if (vol->type == FAT_FAT32) 40013cf0: c4 0e e0 0e ldub [ %i3 + 0xe ], %g2 40013cf4: 80 a0 a0 04 cmp %g2, 4 40013cf8: 12 80 00 63 bne 40013e84 40013cfc: 82 10 3f ff mov -1, %g1 { vol->rdir_cl = FAT_GET_BR_FAT32_ROOT_CLUSTER(boot_rec); 40013d00: c6 0f bf 9d ldub [ %fp + -99 ], %g3 40013d04: c4 0f bf 9c ldub [ %fp + -100 ], %g2 40013d08: 87 28 e0 08 sll %g3, 8, %g3 40013d0c: 85 28 a0 10 sll %g2, 0x10, %g2 40013d10: c2 0f bf 97 ldub [ %fp + -105 ], %g1 40013d14: 84 10 c0 02 or %g3, %g2, %g2 40013d18: c6 0f bf 9e ldub [ %fp + -98 ], %g3 40013d1c: 84 10 80 03 or %g2, %g3, %g2 40013d20: 87 28 60 18 sll %g1, 0x18, %g3 40013d24: 84 10 80 03 or %g2, %g3, %g2 40013d28: c4 26 e0 3c st %g2, [ %i3 + 0x3c ] vol->mirror = FAT_GET_BR_EXT_FLAGS(boot_rec) & FAT_BR_EXT_FLAGS_MIRROR; 40013d2c: 84 0f 3f 80 and %i4, -128, %g2 if (vol->mirror) 40013d30: 80 88 a0 80 btst 0x80, %g2 40013d34: 02 80 00 05 be 40013d48 <== ALWAYS TAKEN 40013d38: c4 2e e0 54 stb %g2, [ %i3 + 0x54 ] vol->afat = FAT_GET_BR_EXT_FLAGS(boot_rec) & FAT_BR_EXT_FLAGS_FAT_NUM; 40013d3c: b8 0f 20 0f and %i4, 0xf, %i4 <== NOT EXECUTED 40013d40: 10 80 00 03 b 40013d4c <== NOT EXECUTED 40013d44: f8 2e e0 5c stb %i4, [ %i3 + 0x5c ] <== NOT EXECUTED else vol->afat = 0; 40013d48: c0 2e e0 5c clrb [ %i3 + 0x5c ] vol->info_sec = FAT_GET_BR_FAT32_FS_INFO_SECTOR(boot_rec); 40013d4c: f4 0f bf 9f ldub [ %fp + -97 ], %i2 40013d50: b2 0e 60 ff and %i1, 0xff, %i1 40013d54: b3 2e 60 08 sll %i1, 8, %i1 40013d58: b4 16 40 1a or %i1, %i2, %i2 40013d5c: f4 36 e0 40 sth %i2, [ %i3 + 0x40 ] if( vol->info_sec == 0 ) 40013d60: b5 2e a0 10 sll %i2, 0x10, %i2 40013d64: 93 36 a0 10 srl %i2, 0x10, %o1 40013d68: 80 a2 60 00 cmp %o1, 0 40013d6c: 32 80 00 03 bne,a 40013d78 <== ALWAYS TAKEN 40013d70: 90 10 00 1b mov %i3, %o0 40013d74: 30 80 00 18 b,a 40013dd4 <== NOT EXECUTED close(vol->fd); rtems_set_errno_and_return_minus_one( EINVAL ); } else { ret = _fat_block_read(fs_info, vol->info_sec , 0, 40013d78: 94 10 20 00 clr %o2 40013d7c: 96 10 20 04 mov 4, %o3 40013d80: 7f ff fd f3 call 4001354c <_fat_block_read> 40013d84: 98 07 bf a8 add %fp, -88, %o4 FAT_FSI_LEADSIG_SIZE, fs_info_sector); if ( ret < 0 ) 40013d88: 80 a2 20 00 cmp %o0, 0 40013d8c: 06 80 00 22 bl 40013e14 <== NEVER TAKEN 40013d90: c4 0f bf aa ldub [ %fp + -86 ], %g2 { close(vol->fd); return -1; } if (FAT_GET_FSINFO_LEAD_SIGNATURE(fs_info_sector) != 40013d94: c6 0f bf a9 ldub [ %fp + -87 ], %g3 40013d98: 85 28 a0 10 sll %g2, 0x10, %g2 40013d9c: 87 28 e0 08 sll %g3, 8, %g3 40013da0: 86 10 c0 02 or %g3, %g2, %g3 40013da4: c4 0f bf a8 ldub [ %fp + -88 ], %g2 40013da8: 86 10 c0 02 or %g3, %g2, %g3 40013dac: c4 0f bf ab ldub [ %fp + -85 ], %g2 40013db0: 85 28 a0 18 sll %g2, 0x18, %g2 40013db4: 86 10 c0 02 or %g3, %g2, %g3 40013db8: 05 10 58 54 sethi %hi(0x41615000), %g2 40013dbc: 84 10 a2 52 or %g2, 0x252, %g2 ! 41615252 40013dc0: 80 a0 c0 02 cmp %g3, %g2 40013dc4: 02 80 00 0a be 40013dec <== ALWAYS TAKEN 40013dc8: 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); 40013dcc: 7f ff fd 3d call 400132c0 <== NOT EXECUTED 40013dd0: 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); 40013dd4: 7f ff c7 40 call 40005ad4 <== NOT EXECUTED 40013dd8: d0 06 e0 60 ld [ %i3 + 0x60 ], %o0 <== NOT EXECUTED rtems_set_errno_and_return_minus_one( EINVAL ); 40013ddc: 40 00 1e da call 4001b944 <__errno> <== NOT EXECUTED 40013de0: 01 00 00 00 nop <== NOT EXECUTED 40013de4: 10 80 00 82 b 40013fec <== NOT EXECUTED 40013de8: 82 10 20 16 mov 0x16, %g1 ! 16 <== NOT EXECUTED } else { ret = _fat_block_read(fs_info, vol->info_sec , FAT_FSI_INFO, 40013dec: d2 16 e0 40 lduh [ %i3 + 0x40 ], %o1 40013df0: 94 10 21 e4 mov 0x1e4, %o2 40013df4: 96 10 20 0c mov 0xc, %o3 40013df8: 7f ff fd d5 call 4001354c <_fat_block_read> 40013dfc: 98 07 bf a8 add %fp, -88, %o4 FAT_USEFUL_INFO_SIZE, fs_info_sector); if ( ret < 0 ) 40013e00: 80 a2 20 00 cmp %o0, 0 40013e04: 16 80 00 08 bge 40013e24 <== ALWAYS TAKEN 40013e08: 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); 40013e0c: 7f ff fd 2d call 400132c0 <== NOT EXECUTED 40013e10: 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); 40013e14: 7f ff c7 30 call 40005ad4 <== NOT EXECUTED 40013e18: 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 ); 40013e1c: 81 c7 e0 08 ret <== NOT EXECUTED 40013e20: 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); 40013e24: c4 0f bf ae ldub [ %fp + -82 ], %g2 40013e28: 87 28 e0 08 sll %g3, 8, %g3 40013e2c: 85 28 a0 10 sll %g2, 0x10, %g2 40013e30: 84 10 c0 02 or %g3, %g2, %g2 40013e34: c6 0f bf ac ldub [ %fp + -84 ], %g3 40013e38: 84 10 80 03 or %g2, %g3, %g2 40013e3c: c6 0f bf af ldub [ %fp + -81 ], %g3 40013e40: 87 28 e0 18 sll %g3, 0x18, %g3 40013e44: 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); 40013e48: c6 0f bf b1 ldub [ %fp + -79 ], %g3 _fat_block_release(fs_info); close(vol->fd); return -1; } vol->free_cls_in_fs_info = 40013e4c: 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; 40013e50: c4 26 e0 44 st %g2, [ %i3 + 0x44 ] vol->next_cl_in_fs_info = FAT_GET_FSINFO_NEXT_FREE_CLUSTER(fs_info_sector); 40013e54: c4 0f bf b2 ldub [ %fp + -78 ], %g2 40013e58: 87 28 e0 08 sll %g3, 8, %g3 40013e5c: 85 28 a0 10 sll %g2, 0x10, %g2 40013e60: 84 10 c0 02 or %g3, %g2, %g2 40013e64: c6 0f bf b0 ldub [ %fp + -80 ], %g3 40013e68: 84 10 80 03 or %g2, %g3, %g2 40013e6c: c6 0f bf b3 ldub [ %fp + -77 ], %g3 40013e70: 87 28 e0 18 sll %g3, 0x18, %g3 40013e74: 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 = 40013e78: 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; 40013e7c: 10 80 00 07 b 40013e98 40013e80: c4 26 e0 4c st %g2, [ %i3 + 0x4c ] } } } else { vol->rdir_cl = 0; 40013e84: c0 26 e0 3c clr [ %i3 + 0x3c ] vol->mirror = 0; 40013e88: c0 2e e0 54 clrb [ %i3 + 0x54 ] vol->afat = 0; 40013e8c: c0 2e e0 5c clrb [ %i3 + 0x5c ] vol->free_cls = FAT_UNDEFINED_VALUE; 40013e90: c2 26 e0 44 st %g1, [ %i3 + 0x44 ] vol->next_cl = FAT_UNDEFINED_VALUE; 40013e94: 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); 40013e98: 7f ff fd 0a call 400132c0 40013e9c: 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; 40013ea0: d2 06 e0 1c ld [ %i3 + 0x1c ], %o1 40013ea4: 7f ff b9 eb call 40002650 <.umul> 40013ea8: d0 0e e0 5c ldub [ %i3 + 0x5c ], %o0 40013eac: 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)); 40013eb0: 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; 40013eb4: 90 02 00 02 add %o0, %g2, %o0 40013eb8: 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)); 40013ebc: 7f ff c6 ef call 40005a78 40013ec0: 90 10 20 02 mov 2, %o0 if ( fs_info->vhash == NULL ) 40013ec4: 80 a2 20 00 cmp %o0, 0 40013ec8: 02 80 00 12 be 40013f10 <== NEVER TAKEN 40013ecc: 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 ); 40013ed0: 84 02 20 04 add %o0, 4, %g2 40013ed4: 86 02 20 10 add %o0, 0x10, %g3 head->next = tail; 40013ed8: 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 ); 40013edc: 84 02 20 0c add %o0, 0xc, %g2 head->next = tail; head->previous = NULL; 40013ee0: c0 22 20 04 clr [ %o0 + 4 ] tail->previous = head; 40013ee4: 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; 40013ee8: c6 22 20 0c st %g3, [ %o0 + 0xc ] head->previous = NULL; 40013eec: c0 22 20 10 clr [ %o0 + 0x10 ] tail->previous = head; 40013ef0: 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)); 40013ef4: 92 10 20 0c mov 0xc, %o1 40013ef8: 7f ff c6 e0 call 40005a78 40013efc: 90 10 20 02 mov 2, %o0 if ( fs_info->rhash == NULL ) 40013f00: 80 a2 20 00 cmp %o0, 0 40013f04: 12 80 00 06 bne 40013f1c <== ALWAYS TAKEN 40013f08: d0 26 e0 70 st %o0, [ %i3 + 0x70 ] 40013f0c: 30 80 00 1c b,a 40013f7c <== 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); 40013f10: 7f ff c6 f1 call 40005ad4 <== NOT EXECUTED 40013f14: d0 06 e0 60 ld [ %i3 + 0x60 ], %o0 <== NOT EXECUTED 40013f18: 30 80 00 32 b,a 40013fe0 <== 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 ); 40013f1c: 84 02 20 04 add %o0, 4, %g2 head->next = tail; 40013f20: 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 ); 40013f24: 84 02 20 0c add %o0, 0xc, %g2 head->next = tail; head->previous = NULL; 40013f28: c0 22 20 04 clr [ %o0 + 4 ] tail->previous = head; 40013f2c: c4 22 20 14 st %g2, [ %o0 + 0x14 ] 40013f30: 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; 40013f34: 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 ); 40013f38: 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; 40013f3c: 84 10 21 00 mov 0x100, %g2 head->next = tail; 40013f40: c6 22 20 0c st %g3, [ %o0 + 0xc ] 40013f44: c4 26 e0 7c st %g2, [ %i3 + 0x7c ] fs_info->uino_base = (vol->tot_secs << vol->sec_mul) << 4; 40013f48: c6 06 e0 30 ld [ %i3 + 0x30 ], %g3 40013f4c: c4 0e e0 03 ldub [ %i3 + 3 ], %g2 fs_info->index = 0; 40013f50: 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; 40013f54: 85 28 c0 02 sll %g3, %g2, %g2 40013f58: 85 28 a0 04 sll %g2, 4, %g2 fs_info->index = 0; fs_info->uino = (char *)calloc(fs_info->uino_pool_size, sizeof(char)); 40013f5c: 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; 40013f60: c4 26 e0 80 st %g2, [ %i3 + 0x80 ] fs_info->index = 0; fs_info->uino = (char *)calloc(fs_info->uino_pool_size, sizeof(char)); 40013f64: 7f ff c6 c5 call 40005a78 40013f68: 92 10 20 01 mov 1, %o1 if ( fs_info->uino == NULL ) 40013f6c: 80 a2 20 00 cmp %o0, 0 40013f70: 12 80 00 0d bne 40013fa4 <== ALWAYS TAKEN 40013f74: d0 26 e0 74 st %o0, [ %i3 + 0x74 ] 40013f78: 30 80 00 05 b,a 40013f8c <== 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); 40013f7c: 7f ff c6 d6 call 40005ad4 <== NOT EXECUTED 40013f80: d0 06 e0 60 ld [ %i3 + 0x60 ], %o0 <== NOT EXECUTED free(fs_info->vhash); 40013f84: 10 80 00 15 b 40013fd8 <== NOT EXECUTED 40013f88: 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); 40013f8c: 7f ff c6 d2 call 40005ad4 <== NOT EXECUTED 40013f90: d0 06 e0 60 ld [ %i3 + 0x60 ], %o0 <== NOT EXECUTED free(fs_info->vhash); 40013f94: 7f ff c6 f1 call 40005b58 <== NOT EXECUTED 40013f98: d0 06 e0 6c ld [ %i3 + 0x6c ], %o0 <== NOT EXECUTED free(fs_info->rhash); 40013f9c: 10 80 00 0f b 40013fd8 <== NOT EXECUTED 40013fa0: 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)); 40013fa4: d0 16 c0 00 lduh [ %i3 ], %o0 40013fa8: 7f ff c6 b4 call 40005a78 40013fac: 92 10 20 01 mov 1, %o1 if (fs_info->sec_buf == NULL) 40013fb0: 80 a2 20 00 cmp %o0, 0 40013fb4: 12 80 00 11 bne 40013ff8 <== ALWAYS TAKEN 40013fb8: d0 26 e0 90 st %o0, [ %i3 + 0x90 ] { close(vol->fd); 40013fbc: 7f ff c6 c6 call 40005ad4 <== NOT EXECUTED 40013fc0: d0 06 e0 60 ld [ %i3 + 0x60 ], %o0 <== NOT EXECUTED free(fs_info->vhash); 40013fc4: 7f ff c6 e5 call 40005b58 <== NOT EXECUTED 40013fc8: d0 06 e0 6c ld [ %i3 + 0x6c ], %o0 <== NOT EXECUTED free(fs_info->rhash); 40013fcc: 7f ff c6 e3 call 40005b58 <== NOT EXECUTED 40013fd0: d0 06 e0 70 ld [ %i3 + 0x70 ], %o0 <== NOT EXECUTED free(fs_info->uino); 40013fd4: d0 06 e0 74 ld [ %i3 + 0x74 ], %o0 <== NOT EXECUTED 40013fd8: 7f ff c6 e0 call 40005b58 <== NOT EXECUTED 40013fdc: 01 00 00 00 nop <== NOT EXECUTED rtems_set_errno_and_return_minus_one( ENOMEM ); 40013fe0: 40 00 1e 59 call 4001b944 <__errno> <== NOT EXECUTED 40013fe4: 01 00 00 00 nop <== NOT EXECUTED 40013fe8: 82 10 20 0c mov 0xc, %g1 ! c <== NOT EXECUTED 40013fec: c2 22 00 00 st %g1, [ %o0 ] <== NOT EXECUTED 40013ff0: 81 c7 e0 08 ret <== NOT EXECUTED 40013ff4: 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; 40013ff8: c4 0e e0 04 ldub [ %i3 + 4 ], %g2 40013ffc: c6 06 e0 34 ld [ %i3 + 0x34 ], %g3 40014000: 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) 40014004: 80 88 80 03 btst %g2, %g3 40014008: 22 80 00 04 be,a 40014018 <== ALWAYS TAKEN 4001400c: 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; 40014010: 81 c7 e0 08 ret <== NOT EXECUTED 40014014: 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))) 40014018: 80 a0 e0 04 cmp %g3, 4 4001401c: 22 80 00 07 be,a 40014038 40014020: 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; 40014024: 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))) 40014028: 80 88 80 03 btst %g2, %g3 4001402c: 12 80 00 0f bne 40014068 <== NEVER TAKEN 40014030: b0 10 20 00 clr %i0 { sc = rtems_bdbuf_set_block_size (vol->dd, vol->bpc, true); 40014034: d0 06 e0 64 ld [ %i3 + 0x64 ], %o0 40014038: d2 16 e0 06 lduh [ %i3 + 6 ], %o1 4001403c: 7f ff f6 78 call 40011a1c 40014040: 94 10 20 01 mov 1, %o2 if (sc == RTEMS_SUCCESSFUL) 40014044: 80 a2 20 00 cmp %o0, 0 40014048: 12 80 00 08 bne 40014068 <== NEVER TAKEN 4001404c: b0 10 20 00 clr %i0 { vol->bytes_per_block = vol->bpc; 40014050: c4 16 e0 06 lduh [ %i3 + 6 ], %g2 40014054: c4 36 e0 0a sth %g2, [ %i3 + 0xa ] vol->bytes_per_block_log2 = vol->bpc_log2; 40014058: c4 0e e0 08 ldub [ %i3 + 8 ], %g2 4001405c: c4 2e e0 0c stb %g2, [ %i3 + 0xc ] vol->sectors_per_block = vol->spc; 40014060: c4 0e e0 04 ldub [ %i3 + 4 ], %g2 40014064: c4 2e e0 09 stb %g2, [ %i3 + 9 ] } } return RC_OK; } 40014068: 81 c7 e0 08 ret 4001406c: 81 e8 00 00 restore =============================================================================== 40019e98 : uint32_t count, uint32_t *cls_added, uint32_t *last_cl, bool zero_fill ) { 40019e98: 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; 40019e9c: e8 06 20 38 ld [ %i0 + 0x38 ], %l4 bool zero_fill ) { int rc = RC_OK; uint32_t cl4find = 2; uint32_t next_cln = 0; 40019ea0: 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; 40019ea4: c0 26 c0 00 clr [ %i3 ] if (count == 0) 40019ea8: 80 a6 a0 00 cmp %i2, 0 40019eac: 02 80 00 7e be 4001a0a4 <== NEVER TAKEN 40019eb0: a2 10 20 00 clr %l1 return rc; if (fs_info->vol.next_cl != FAT_UNDEFINED_VALUE) 40019eb4: e0 06 20 4c ld [ %i0 + 0x4c ], %l0 40019eb8: 80 a4 3f ff cmp %l0, -1 40019ebc: 22 80 00 02 be,a 40019ec4 40019ec0: 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; 40019ec4: a8 05 20 02 add %l4, 2, %l4 40019ec8: a6 10 20 02 mov 2, %l3 40019ecc: 10 80 00 5a b 4001a034 40019ed0: 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); 40019ed4: 92 10 00 10 mov %l0, %o1 40019ed8: 7f ff fe ae call 40019990 40019edc: 94 07 bf fc add %fp, -4, %o2 if ( rc != RC_OK ) 40019ee0: a2 92 20 00 orcc %o0, 0, %l1 40019ee4: 02 80 00 0b be 40019f10 <== ALWAYS TAKEN 40019ee8: c2 07 bf fc ld [ %fp + -4 ], %g1 { if (*cls_added != 0) 40019eec: c2 06 c0 00 ld [ %i3 ], %g1 <== NOT EXECUTED 40019ef0: 80 a0 60 00 cmp %g1, 0 <== NOT EXECUTED 40019ef4: 22 80 00 6d be,a 4001a0a8 <== NOT EXECUTED 40019ef8: b0 10 00 11 mov %l1, %i0 <== NOT EXECUTED fat_free_fat_clusters_chain(fs_info, (*chain)); 40019efc: d2 06 40 00 ld [ %i1 ], %o1 <== NOT EXECUTED 40019f00: 7f ff ff b7 call 40019ddc <== NOT EXECUTED 40019f04: 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; } 40019f08: 81 c7 e0 08 ret <== NOT EXECUTED 40019f0c: 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) 40019f10: 80 a0 60 00 cmp %g1, 0 40019f14: 32 80 00 44 bne,a 4001a024 40019f18: 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) 40019f1c: c2 06 c0 00 ld [ %i3 ], %g1 40019f20: 80 a0 60 00 cmp %g1, 0 40019f24: 12 80 00 0e bne 40019f5c 40019f28: 90 10 00 18 mov %i0, %o0 { *chain = cl4find; 40019f2c: e0 26 40 00 st %l0, [ %i1 ] rc = fat_set_fat_cluster(fs_info, cl4find, FAT_GENFAT_EOC); 40019f30: 92 10 00 10 mov %l0, %o1 40019f34: 7f ff ff 09 call 40019b58 40019f38: 94 10 3f ff mov -1, %o2 if ( rc != RC_OK ) 40019f3c: 80 a2 20 00 cmp %o0, 0 40019f40: 32 80 00 59 bne,a 4001a0a4 <== NEVER TAKEN 40019f44: 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) 40019f48: 80 a7 60 00 cmp %i5, 0 40019f4c: 22 80 00 18 be,a 40019fac 40019f50: c2 06 c0 00 ld [ %i3 ], %g1 { bytes_written = fat_cluster_set (fs_info, cl4find, 0, fs_info->vol.bpc, 0); 40019f54: 10 80 00 1c b 40019fc4 40019f58: 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); 40019f5c: 92 10 00 10 mov %l0, %o1 40019f60: 7f ff fe fe call 40019b58 40019f64: 94 10 3f ff mov -1, %o2 40019f68: aa 10 00 08 mov %o0, %l5 if ( rc != RC_OK ) 40019f6c: 80 a5 60 00 cmp %l5, 0 40019f70: 02 80 00 07 be 40019f8c <== ALWAYS TAKEN 40019f74: 90 10 00 18 mov %i0, %o0 { /* cleanup activity */ fat_free_fat_clusters_chain(fs_info, (*chain)); 40019f78: d2 06 40 00 ld [ %i1 ], %o1 <== NOT EXECUTED 40019f7c: 7f ff ff 98 call 40019ddc <== NOT EXECUTED 40019f80: 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; } 40019f84: 81 c7 e0 08 ret <== NOT EXECUTED 40019f88: 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); 40019f8c: 92 10 00 12 mov %l2, %o1 40019f90: 7f ff fe f2 call 40019b58 40019f94: 94 10 00 10 mov %l0, %o2 if ( rc != RC_OK ) 40019f98: a4 92 20 00 orcc %o0, 0, %l2 40019f9c: 02 bf ff ec be 40019f4c <== ALWAYS TAKEN 40019fa0: 80 a7 60 00 cmp %i5, 0 return RC_OK; cleanup: /* cleanup activity */ fat_free_fat_clusters_chain(fs_info, (*chain)); 40019fa4: 10 80 00 35 b 4001a078 <== NOT EXECUTED 40019fa8: d2 06 40 00 ld [ %i1 ], %o1 <== NOT EXECUTED goto cleanup; } } save_cln = cl4find; (*cls_added)++; 40019fac: 82 00 60 01 inc %g1 /* have we satisfied request ? */ if (*cls_added == count) 40019fb0: 80 a0 40 1a cmp %g1, %i2 40019fb4: 02 80 00 0f be 40019ff0 40019fb8: c2 26 c0 00 st %g1, [ %i3 ] 40019fbc: 10 80 00 19 b 4001a020 40019fc0: 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); 40019fc4: 90 10 00 18 mov %i0, %o0 40019fc8: 92 10 00 10 mov %l0, %o1 40019fcc: 94 10 20 00 clr %o2 40019fd0: 7f ff e5 a5 call 40013664 40019fd4: 98 10 20 00 clr %o4 if (fs_info->vol.bpc != bytes_written) 40019fd8: c2 16 20 06 lduh [ %i0 + 6 ], %g1 40019fdc: 80 a0 40 08 cmp %g1, %o0 40019fe0: 22 bf ff f3 be,a 40019fac <== ALWAYS TAKEN 40019fe4: c2 06 c0 00 ld [ %i3 ], %g1 { rc = -1; 40019fe8: 10 80 00 23 b 4001a074 <== NOT EXECUTED 40019fec: 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) 40019ff0: c2 06 20 44 ld [ %i0 + 0x44 ], %g1 40019ff4: 80 a0 7f ff cmp %g1, -1 40019ff8: 02 80 00 05 be 4001a00c <== ALWAYS TAKEN 40019ffc: e0 26 20 4c st %l0, [ %i0 + 0x4c ] fs_info->vol.free_cls -= (*cls_added); 4001a000: c4 06 c0 00 ld [ %i3 ], %g2 <== NOT EXECUTED 4001a004: 82 20 40 02 sub %g1, %g2, %g1 <== NOT EXECUTED 4001a008: c2 26 20 44 st %g1, [ %i0 + 0x44 ] <== NOT EXECUTED *last_cl = save_cln; 4001a00c: e0 27 00 00 st %l0, [ %i4 ] fat_buf_release(fs_info); 4001a010: 7f ff e4 ac call 400132c0 4001a014: 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; } 4001a018: 81 c7 e0 08 ret 4001a01c: 91 e8 00 11 restore %g0, %l1, %o0 fat_buf_release(fs_info); return rc; } } i++; cl4find++; 4001a020: a0 04 20 01 inc %l0 if (cl4find >= data_cls_val) 4001a024: 80 a4 00 14 cmp %l0, %l4 4001a028: 0a 80 00 03 bcs 4001a034 <== ALWAYS TAKEN 4001a02c: a6 04 e0 01 inc %l3 cl4find = 2; 4001a030: 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) 4001a034: 80 a4 c0 14 cmp %l3, %l4 4001a038: 0a bf ff a7 bcs 40019ed4 <== ALWAYS TAKEN 4001a03c: 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) 4001a040: c2 06 20 44 ld [ %i0 + 0x44 ], %g1 <== NOT EXECUTED 4001a044: 80 a0 7f ff cmp %g1, -1 <== NOT EXECUTED 4001a048: 02 80 00 05 be 4001a05c <== NOT EXECUTED 4001a04c: e4 26 20 4c st %l2, [ %i0 + 0x4c ] <== NOT EXECUTED fs_info->vol.free_cls -= (*cls_added); 4001a050: c4 06 c0 00 ld [ %i3 ], %g2 <== NOT EXECUTED 4001a054: 82 20 40 02 sub %g1, %g2, %g1 <== NOT EXECUTED 4001a058: c2 26 20 44 st %g1, [ %i0 + 0x44 ] <== NOT EXECUTED *last_cl = save_cln; 4001a05c: e4 27 00 00 st %l2, [ %i4 ] <== NOT EXECUTED fat_buf_release(fs_info); 4001a060: 90 10 00 18 mov %i0, %o0 <== NOT EXECUTED 4001a064: 7f ff e4 97 call 400132c0 <== NOT EXECUTED 4001a068: 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; } 4001a06c: 81 c7 e0 08 ret <== NOT EXECUTED 4001a070: 91 e8 00 11 restore %g0, %l1, %o0 <== NOT EXECUTED return RC_OK; cleanup: /* cleanup activity */ fat_free_fat_clusters_chain(fs_info, (*chain)); 4001a074: d2 06 40 00 ld [ %i1 ], %o1 <== NOT EXECUTED 4001a078: 7f ff ff 59 call 40019ddc <== NOT EXECUTED 4001a07c: 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); 4001a080: 92 10 00 10 mov %l0, %o1 <== NOT EXECUTED 4001a084: 94 10 20 00 clr %o2 <== NOT EXECUTED 4001a088: 7f ff fe b4 call 40019b58 <== NOT EXECUTED 4001a08c: 90 10 00 18 mov %i0, %o0 <== NOT EXECUTED fat_buf_release(fs_info); 4001a090: 90 10 00 18 mov %i0, %o0 <== NOT EXECUTED 4001a094: 7f ff e4 8b call 400132c0 <== NOT EXECUTED 4001a098: a2 10 00 12 mov %l2, %l1 <== NOT EXECUTED return rc; } 4001a09c: 81 c7 e0 08 ret <== NOT EXECUTED 4001a0a0: 91 e8 00 11 restore %g0, %l1, %o0 <== NOT EXECUTED 4001a0a4: b0 10 00 11 mov %l1, %i0 <== NOT EXECUTED 4001a0a8: 81 c7 e0 08 ret <== NOT EXECUTED 4001a0ac: 81 e8 00 00 restore <== NOT EXECUTED =============================================================================== 400135cc : fat_fs_info_t *fs_info, uint32_t start, uint32_t offset, uint32_t count, const void *buff) { 400135cc: 9d e3 bf 98 save %sp, -104, %sp int rc = RC_OK; ssize_t cmpltd = 0; 400135d0: 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) 400135d4: 10 80 00 1b b 40013640 400135d8: a2 10 20 01 mov 1, %l1 { c = MIN(count, (fs_info->vol.bps - ofs)); 400135dc: ba 27 40 1a sub %i5, %i2, %i5 400135e0: 80 a7 40 1b cmp %i5, %i3 400135e4: 38 80 00 02 bgu,a 400135ec 400135e8: ba 10 00 1b mov %i3, %i5 if (c == fs_info->vol.bytes_per_block) 400135ec: c2 16 20 0a lduh [ %i0 + 0xa ], %g1 rc = fat_buf_access(fs_info, sec_num, FAT_OP_TYPE_GET, &sec_buf); 400135f0: 90 10 00 18 mov %i0, %o0 400135f4: 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) 400135f8: 80 a7 40 01 cmp %i5, %g1 400135fc: 02 80 00 03 be 40013608 <== NEVER TAKEN 40013600: 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); 40013604: 94 10 20 01 mov 1, %o2 40013608: 7f ff ff a2 call 40013490 4001360c: 96 07 bf fc add %fp, -4, %o3 if (rc != RC_OK) 40013610: 80 a2 20 00 cmp %o0, 0 40013614: 12 80 00 10 bne 40013654 <== NEVER TAKEN 40013618: d0 07 bf fc ld [ %fp + -4 ], %o0 return -1; memcpy((sec_buf + ofs), (buff + cmpltd), c); 4001361c: 92 07 00 10 add %i4, %l0, %o1 40013620: 90 02 00 1a add %o0, %i2, %o0 40013624: 94 10 00 1d mov %i5, %o2 40013628: 40 00 23 6c call 4001c3d8 4001362c: b6 26 c0 1d sub %i3, %i5, %i3 fat_buf_mark_modified(fs_info); count -= c; cmpltd +=c; 40013630: 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; 40013634: e2 2e 20 88 stb %l1, [ %i0 + 0x88 ] sec_num++; 40013638: b2 06 60 01 inc %i1 ofs = 0; 4001363c: 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) 40013640: 80 a6 e0 00 cmp %i3, 0 40013644: 32 bf ff e6 bne,a 400135dc 40013648: fa 16 00 00 lduh [ %i0 ], %i5 cmpltd +=c; sec_num++; ofs = 0; } return cmpltd; } 4001364c: 81 c7 e0 08 ret 40013650: 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; 40013654: a0 10 3f ff mov -1, %l0 <== NOT EXECUTED cmpltd +=c; sec_num++; ofs = 0; } return cmpltd; } 40013658: b0 10 00 10 mov %l0, %i0 <== NOT EXECUTED 4001365c: 81 c7 e0 08 ret <== NOT EXECUTED 40013660: 81 e8 00 00 restore <== NOT EXECUTED =============================================================================== 40019b58 : fat_set_fat_cluster( fat_fs_info_t *fs_info, uint32_t cln, uint32_t in_val ) { 40019b58: 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; 40019b5c: c0 27 bf fc clr [ %fp + -4 ] /* sanity check */ if ( (cln < 2) || (cln > (fs_info->vol.data_cls + 1)) ) 40019b60: 80 a6 60 01 cmp %i1, 1 40019b64: 08 80 00 98 bleu 40019dc4 <== NEVER TAKEN 40019b68: ba 10 00 18 mov %i0, %i5 40019b6c: c2 06 20 38 ld [ %i0 + 0x38 ], %g1 40019b70: 82 00 60 01 inc %g1 40019b74: 80 a6 40 01 cmp %i1, %g1 40019b78: 28 80 00 03 bleu,a 40019b84 <== ALWAYS TAKEN 40019b7c: c2 0e 20 0e ldub [ %i0 + 0xe ], %g1 40019b80: 30 80 00 91 b,a 40019dc4 <== NOT EXECUTED rtems_set_errno_and_return_minus_one(EIO); sec = (FAT_FAT_OFFSET(fs_info->vol.type, cln) >> fs_info->vol.sec_log2) + 40019b84: 84 08 60 01 and %g1, 1, %g2 40019b88: 80 88 a0 ff btst 0xff, %g2 40019b8c: 02 80 00 05 be 40019ba0 40019b90: 86 08 60 02 and %g1, 2, %g3 40019b94: a1 36 60 01 srl %i1, 1, %l0 40019b98: 10 80 00 06 b 40019bb0 40019b9c: a0 04 00 19 add %l0, %i1, %l0 40019ba0: 80 88 e0 ff btst 0xff, %g3 40019ba4: 02 80 00 03 be 40019bb0 40019ba8: a1 2e 60 02 sll %i1, 2, %l0 40019bac: a1 2e 60 01 sll %i1, 1, %l0 40019bb0: 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); 40019bb4: 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) + 40019bb8: a1 34 00 03 srl %l0, %g3, %l0 40019bbc: 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); 40019bc0: 02 80 00 05 be 40019bd4 40019bc4: a0 04 00 03 add %l0, %g3, %l0 40019bc8: b7 36 60 01 srl %i1, 1, %i3 40019bcc: 10 80 00 07 b 40019be8 40019bd0: b6 06 c0 19 add %i3, %i1, %i3 40019bd4: 82 08 60 02 and %g1, 2, %g1 40019bd8: 80 88 60 ff btst 0xff, %g1 40019bdc: 02 80 00 03 be 40019be8 40019be0: b7 2e 60 02 sll %i1, 2, %i3 40019be4: b7 2e 60 01 sll %i1, 1, %i3 40019be8: f8 17 40 00 lduh [ %i5 ], %i4 rc = fat_buf_access(fs_info, sec, FAT_OP_TYPE_READ, &sec_buf); 40019bec: 90 10 00 1d mov %i5, %o0 40019bf0: 92 10 00 10 mov %l0, %o1 40019bf4: 94 10 20 01 mov 1, %o2 40019bf8: 7f ff e6 26 call 40013490 40019bfc: 96 07 bf fc add %fp, -4, %o3 if (rc != RC_OK) 40019c00: b0 92 20 00 orcc %o0, 0, %i0 40019c04: 12 80 00 4c bne 40019d34 <== NEVER TAKEN 40019c08: 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); 40019c0c: b9 37 20 10 srl %i4, 0x10, %i4 40019c10: b8 07 3f ff add %i4, -1, %i4 40019c14: 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 ) 40019c18: f6 0f 60 0e ldub [ %i5 + 0xe ], %i3 40019c1c: 80 a6 e0 02 cmp %i3, 2 40019c20: 02 80 00 53 be 40019d6c 40019c24: 80 a6 e0 04 cmp %i3, 4 40019c28: 02 80 00 5b be 40019d94 40019c2c: 80 a6 e0 01 cmp %i3, 1 40019c30: 12 80 00 65 bne 40019dc4 <== NEVER TAKEN 40019c34: 80 8e 60 01 btst 1, %i1 { case FAT_FAT12: if ( FAT_CLUSTER_IS_ODD(cln) ) 40019c38: 02 80 00 23 be 40019cc4 40019c3c: c2 07 bf fc ld [ %fp + -4 ], %g1 { fat16_clv = ((uint16_t )in_val) << FAT_FAT12_SHIFT; *(sec_buf + ofs) &= 0x0F; 40019c40: c4 08 40 1c ldub [ %g1 + %i4 ], %g2 40019c44: 84 08 a0 0f and %g2, 0xf, %g2 40019c48: c4 28 40 1c stb %g2, [ %g1 + %i4 ] *(sec_buf + ofs) |= (uint8_t)(fat16_clv & 0x00F0); 40019c4c: c2 07 bf fc ld [ %fp + -4 ], %g1 40019c50: 85 2e a0 04 sll %i2, 4, %g2 40019c54: c6 08 40 1c ldub [ %g1 + %i4 ], %g3 40019c58: 84 10 c0 02 or %g3, %g2, %g2 40019c5c: c4 28 40 1c stb %g2, [ %g1 + %i4 ] fat_buf_mark_modified(fs_info); if ( ofs == (fs_info->vol.bps - 1) ) 40019c60: c2 17 40 00 lduh [ %i5 ], %g1 40019c64: 82 00 7f ff add %g1, -1, %g1 40019c68: 80 a7 00 01 cmp %i4, %g1 40019c6c: 12 80 00 0f bne 40019ca8 <== ALWAYS TAKEN 40019c70: f6 2f 60 88 stb %i3, [ %i5 + 0x88 ] { rc = fat_buf_access(fs_info, sec + 1, FAT_OP_TYPE_READ, 40019c74: 90 10 00 1d mov %i5, %o0 <== NOT EXECUTED 40019c78: 92 04 20 01 add %l0, 1, %o1 <== NOT EXECUTED 40019c7c: 94 10 20 01 mov 1, %o2 <== NOT EXECUTED 40019c80: 7f ff e6 04 call 40013490 <== NOT EXECUTED 40019c84: 96 07 bf fc add %fp, -4, %o3 <== NOT EXECUTED &sec_buf); if (rc != RC_OK) 40019c88: b0 92 20 00 orcc %o0, 0, %i0 <== NOT EXECUTED 40019c8c: 12 80 00 2a bne 40019d34 <== NOT EXECUTED 40019c90: c2 07 bf fc ld [ %fp + -4 ], %g1 <== NOT EXECUTED return rc; *sec_buf &= 0x00; *sec_buf |= (uint8_t)((fat16_clv & 0xFF00)>>8); 40019c94: 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; 40019c98: c0 28 40 00 clrb [ %g1 ] <== NOT EXECUTED *sec_buf |= (uint8_t)((fat16_clv & 0xFF00)>>8); 40019c9c: b5 36 a0 18 srl %i2, 0x18, %i2 <== NOT EXECUTED 40019ca0: 10 80 00 21 b 40019d24 <== NOT EXECUTED 40019ca4: c2 07 bf fc ld [ %fp + -4 ], %g1 <== NOT EXECUTED fat_buf_mark_modified(fs_info); } else { *(sec_buf + ofs + 1) &= 0x00; 40019ca8: c2 07 bf fc ld [ %fp + -4 ], %g1 40019cac: b8 07 20 01 inc %i4 *(sec_buf + ofs + 1) |= (uint8_t )((fat16_clv & 0xFF00)>>8); 40019cb0: b5 2e a0 14 sll %i2, 0x14, %i2 fat_buf_mark_modified(fs_info); } else { *(sec_buf + ofs + 1) &= 0x00; 40019cb4: c0 28 40 1c clrb [ %g1 + %i4 ] *(sec_buf + ofs + 1) |= (uint8_t )((fat16_clv & 0xFF00)>>8); 40019cb8: b5 36 a0 18 srl %i2, 0x18, %i2 40019cbc: 10 80 00 27 b 40019d58 40019cc0: c2 07 bf fc ld [ %fp + -4 ], %g1 } } else { fat16_clv = ((uint16_t )in_val) & FAT_FAT12_MASK; *(sec_buf + ofs) &= 0x00; 40019cc4: c0 28 40 1c clrb [ %g1 + %i4 ] *(sec_buf + ofs) |= (uint8_t)(fat16_clv & 0x00FF); 40019cc8: 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; 40019ccc: b4 0e af ff and %i2, 0xfff, %i2 *(sec_buf + ofs) &= 0x00; *(sec_buf + ofs) |= (uint8_t)(fat16_clv & 0x00FF); 40019cd0: c4 08 40 1c ldub [ %g1 + %i4 ], %g2 40019cd4: 84 10 80 1a or %g2, %i2, %g2 40019cd8: c4 28 40 1c stb %g2, [ %g1 + %i4 ] fat_buf_mark_modified(fs_info); if ( ofs == (fs_info->vol.bps - 1) ) 40019cdc: c2 17 40 00 lduh [ %i5 ], %g1 40019ce0: 82 00 7f ff add %g1, -1, %g1 40019ce4: 80 a7 00 01 cmp %i4, %g1 40019ce8: 12 80 00 15 bne 40019d3c <== ALWAYS TAKEN 40019cec: f6 2f 60 88 stb %i3, [ %i5 + 0x88 ] { rc = fat_buf_access(fs_info, sec + 1, FAT_OP_TYPE_READ, 40019cf0: 90 10 00 1d mov %i5, %o0 <== NOT EXECUTED 40019cf4: 92 04 20 01 add %l0, 1, %o1 <== NOT EXECUTED 40019cf8: 94 10 20 01 mov 1, %o2 <== NOT EXECUTED 40019cfc: 7f ff e5 e5 call 40013490 <== NOT EXECUTED 40019d00: 96 07 bf fc add %fp, -4, %o3 <== NOT EXECUTED &sec_buf); if (rc != RC_OK) 40019d04: b0 92 20 00 orcc %o0, 0, %i0 <== NOT EXECUTED 40019d08: 12 80 00 0b bne 40019d34 <== NOT EXECUTED 40019d0c: c2 07 bf fc ld [ %fp + -4 ], %g1 <== NOT EXECUTED return rc; *sec_buf &= 0xF0; *sec_buf |= (uint8_t)((fat16_clv & 0xFF00)>>8); 40019d10: 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; 40019d14: c4 08 40 00 ldub [ %g1 ], %g2 <== NOT EXECUTED 40019d18: 84 08 bf f0 and %g2, -16, %g2 <== NOT EXECUTED 40019d1c: c4 28 40 00 stb %g2, [ %g1 ] <== NOT EXECUTED *sec_buf |= (uint8_t)((fat16_clv & 0xFF00)>>8); 40019d20: c2 07 bf fc ld [ %fp + -4 ], %g1 <== NOT EXECUTED 40019d24: c4 08 40 00 ldub [ %g1 ], %g2 <== NOT EXECUTED 40019d28: b4 16 80 02 or %i2, %g2, %i2 <== NOT EXECUTED 40019d2c: 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; 40019d30: f6 2f 60 88 stb %i3, [ %i5 + 0x88 ] <== NOT EXECUTED 40019d34: 81 c7 e0 08 ret <== NOT EXECUTED 40019d38: 81 e8 00 00 restore <== NOT EXECUTED fat_buf_mark_modified(fs_info); } else { *(sec_buf + ofs + 1) &= 0xF0; 40019d3c: c2 07 bf fc ld [ %fp + -4 ], %g1 40019d40: b8 07 20 01 inc %i4 40019d44: c4 08 40 1c ldub [ %g1 + %i4 ], %g2 *(sec_buf + ofs+1) |= (uint8_t)((fat16_clv & 0xFF00)>>8); 40019d48: b5 36 a0 08 srl %i2, 8, %i2 fat_buf_mark_modified(fs_info); } else { *(sec_buf + ofs + 1) &= 0xF0; 40019d4c: 84 08 bf f0 and %g2, -16, %g2 40019d50: c4 28 40 1c stb %g2, [ %g1 + %i4 ] *(sec_buf + ofs+1) |= (uint8_t)((fat16_clv & 0xFF00)>>8); 40019d54: c2 07 bf fc ld [ %fp + -4 ], %g1 40019d58: c4 08 40 1c ldub [ %g1 + %i4 ], %g2 40019d5c: b4 10 80 1a or %g2, %i2, %i2 40019d60: f4 28 40 1c stb %i2, [ %g1 + %i4 ] 40019d64: 81 c7 e0 08 ret 40019d68: 81 e8 00 00 restore break; } return RC_OK; } 40019d6c: 03 00 00 3f sethi %hi(0xfc00), %g1 40019d70: 82 10 63 ff or %g1, 0x3ff, %g1 ! ffff 40019d74: 82 0e 80 01 and %i2, %g1, %g1 } break; case FAT_FAT16: *((uint16_t *)(sec_buf + ofs)) = (uint16_t )(CT_LE_W(in_val)); 40019d78: 83 28 60 08 sll %g1, 8, %g1 40019d7c: b5 2e a0 10 sll %i2, 0x10, %i2 40019d80: b5 36 a0 18 srl %i2, 0x18, %i2 40019d84: b4 10 40 1a or %g1, %i2, %i2 } } break; case FAT_FAT16: *((uint16_t *)(sec_buf + ofs)) = 40019d88: c2 07 bf fc ld [ %fp + -4 ], %g1 40019d8c: 10 80 00 0a b 40019db4 40019d90: 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)); 40019d94: 11 3c 00 00 sethi %hi(0xf0000000), %o0 40019d98: 7f ff fe f2 call 40019960 40019d9c: 90 2e 80 08 andn %i2, %o0, %o0 *((uint32_t *)(sec_buf + ofs)) &= CT_LE_L(0xF0000000); 40019da0: c2 07 bf fc ld [ %fp + -4 ], %g1 40019da4: c4 00 40 1c ld [ %g1 + %i4 ], %g2 40019da8: 84 08 a0 f0 and %g2, 0xf0, %g2 *((uint32_t *)(sec_buf + ofs)) |= fat32_clv; 40019dac: 90 12 00 02 or %o0, %g2, %o0 40019db0: d0 20 40 1c st %o0, [ %g1 + %i4 ] 40019db4: 82 10 20 01 mov 1, %g1 40019db8: c2 2f 60 88 stb %g1, [ %i5 + 0x88 ] 40019dbc: 81 c7 e0 08 ret 40019dc0: 81 e8 00 00 restore fat_buf_mark_modified(fs_info); break; default: rtems_set_errno_and_return_minus_one(EIO); 40019dc4: 40 00 06 e0 call 4001b944 <__errno> <== NOT EXECUTED 40019dc8: b0 10 3f ff mov -1, %i0 <== NOT EXECUTED 40019dcc: 82 10 20 05 mov 5, %g1 <== NOT EXECUTED 40019dd0: c2 22 00 00 st %g1, [ %o0 ] <== NOT EXECUTED break; } return RC_OK; } 40019dd4: 81 c7 e0 08 ret <== NOT EXECUTED 40019dd8: 81 e8 00 00 restore <== NOT EXECUTED =============================================================================== 40014140 : * RC_OK on success, or -1 if error occured * and errno set appropriately */ int fat_shutdown_drive(fat_fs_info_t *fs_info) { 40014140: 9d e3 bf a0 save %sp, -96, %sp int rc = RC_OK; int i = 0; rc = fat_sync(fs_info); 40014144: 90 10 00 18 mov %i0, %o0 40014148: 7f ff ff ca call 40014070 4001414c: ba 10 00 18 mov %i0, %i5 if ( rc != RC_OK ) 40014150: b0 92 20 00 orcc %o0, 0, %i0 40014154: 32 80 00 02 bne,a 4001415c <== NEVER TAKEN 40014158: b0 10 3f ff mov -1, %i0 <== NOT EXECUTED rc = -1; 4001415c: 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; 40014160: f6 07 60 6c ld [ %i5 + 0x6c ], %i3 while ( (node = rtems_chain_get(the_chain)) != NULL ) 40014164: 10 80 00 04 b 40014174 40014168: b6 06 c0 1c add %i3, %i4, %i3 free(node); 4001416c: 7f ff c6 7b call 40005b58 40014170: 01 00 00 00 nop */ RTEMS_INLINE_ROUTINE rtems_chain_node *rtems_chain_get( rtems_chain_control *the_chain ) { return _Chain_Get( the_chain ); 40014174: 7f ff da 5e call 4000aaec <_Chain_Get> 40014178: 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 ) 4001417c: 80 a2 20 00 cmp %o0, 0 40014180: 12 bf ff fb bne 4001416c 40014184: 01 00 00 00 nop 40014188: 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++) 4001418c: 80 a7 20 18 cmp %i4, 0x18 40014190: 32 bf ff f5 bne,a 40014164 40014194: f6 07 60 6c ld [ %i5 + 0x6c ], %i3 40014198: 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; 4001419c: f6 07 60 70 ld [ %i5 + 0x70 ], %i3 while ( (node = rtems_chain_get(the_chain)) != NULL ) 400141a0: 10 80 00 04 b 400141b0 400141a4: b6 06 c0 1c add %i3, %i4, %i3 free(node); 400141a8: 7f ff c6 6c call 40005b58 <== NOT EXECUTED 400141ac: 01 00 00 00 nop <== NOT EXECUTED 400141b0: 7f ff da 4f call 4000aaec <_Chain_Get> 400141b4: 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 ) 400141b8: 80 a2 20 00 cmp %o0, 0 400141bc: 12 bf ff fb bne 400141a8 <== NEVER TAKEN 400141c0: 01 00 00 00 nop 400141c4: 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++) 400141c8: 80 a7 20 18 cmp %i4, 0x18 400141cc: 32 bf ff f5 bne,a 400141a0 400141d0: f6 07 60 70 ld [ %i5 + 0x70 ], %i3 while ( (node = rtems_chain_get(the_chain)) != NULL ) free(node); } free(fs_info->vhash); 400141d4: 7f ff c6 61 call 40005b58 400141d8: d0 07 60 6c ld [ %i5 + 0x6c ], %o0 free(fs_info->rhash); 400141dc: 7f ff c6 5f call 40005b58 400141e0: d0 07 60 70 ld [ %i5 + 0x70 ], %o0 free(fs_info->uino); 400141e4: 7f ff c6 5d call 40005b58 400141e8: d0 07 60 74 ld [ %i5 + 0x74 ], %o0 free(fs_info->sec_buf); 400141ec: 7f ff c6 5b call 40005b58 400141f0: d0 07 60 90 ld [ %i5 + 0x90 ], %o0 close(fs_info->vol.fd); 400141f4: 7f ff c6 38 call 40005ad4 400141f8: d0 07 60 60 ld [ %i5 + 0x60 ], %o0 if (rc) 400141fc: 80 a6 20 00 cmp %i0, 0 40014200: 02 80 00 06 be 40014218 <== ALWAYS TAKEN 40014204: 01 00 00 00 nop errno = EIO; 40014208: 40 00 1d cf call 4001b944 <__errno> <== NOT EXECUTED 4001420c: 01 00 00 00 nop <== NOT EXECUTED 40014210: 82 10 20 05 mov 5, %g1 ! 5 <== NOT EXECUTED 40014214: c2 22 00 00 st %g1, [ %o0 ] <== NOT EXECUTED return rc; } 40014218: 81 c7 e0 08 ret 4001421c: 81 e8 00 00 restore =============================================================================== 40014070 : return RC_OK; } int fat_sync(fat_fs_info_t *fs_info) { 40014070: 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) 40014074: c4 0e 20 0e ldub [ %i0 + 0xe ], %g2 return RC_OK; } int fat_sync(fat_fs_info_t *fs_info) { 40014078: 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; 4001407c: 90 10 20 00 clr %o0 if (fs_info->vol.type == FAT_FAT32) 40014080: 80 a0 a0 04 cmp %g2, 4 40014084: 12 80 00 20 bne 40014104 40014088: b4 10 20 00 clr %i2 { uint32_t free_count = fs_info->vol.free_cls; 4001408c: 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) 40014090: c2 06 20 48 ld [ %i0 + 0x48 ], %g1 40014094: 80 a6 c0 01 cmp %i3, %g1 40014098: 02 80 00 0d be 400140cc <== ALWAYS TAKEN 4001409c: f8 06 20 4c ld [ %i0 + 0x4c ], %i4 { uint32_t le_free_count = CT_LE_L(free_count); 400140a0: 7f ff fc 65 call 40013234 <== NOT EXECUTED 400140a4: 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, 400140a8: 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); 400140ac: d0 27 bf fc st %o0, [ %fp + -4 ] <== NOT EXECUTED fs_info->vol.free_cls_in_fs_info = free_count; 400140b0: f6 26 20 48 st %i3, [ %i0 + 0x48 ] <== NOT EXECUTED ret1 = fat_sector_write(fs_info, 400140b4: 90 10 00 18 mov %i0, %o0 <== NOT EXECUTED 400140b8: 94 10 21 e8 mov 0x1e8, %o2 <== NOT EXECUTED 400140bc: 96 10 20 04 mov 4, %o3 <== NOT EXECUTED 400140c0: 7f ff fd 43 call 400135cc <== NOT EXECUTED 400140c4: 98 07 bf fc add %fp, -4, %o4 <== NOT EXECUTED 400140c8: 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) 400140cc: c4 07 60 50 ld [ %i5 + 0x50 ], %g2 400140d0: 80 a7 00 02 cmp %i4, %g2 400140d4: 02 80 00 0c be 40014104 <== NEVER TAKEN 400140d8: 90 10 20 00 clr %o0 { uint32_t le_next_free = CT_LE_L(next_free); 400140dc: 7f ff fc 56 call 40013234 400140e0: 90 10 00 1c mov %i4, %o0 fs_info->vol.next_cl_in_fs_info = next_free; ret2 = fat_sector_write(fs_info, 400140e4: 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); 400140e8: d0 27 bf fc st %o0, [ %fp + -4 ] fs_info->vol.next_cl_in_fs_info = next_free; 400140ec: f8 27 60 50 st %i4, [ %i5 + 0x50 ] ret2 = fat_sector_write(fs_info, 400140f0: 90 10 00 1d mov %i5, %o0 400140f4: 94 10 21 ec mov 0x1ec, %o2 400140f8: 96 10 20 04 mov 4, %o3 400140fc: 7f ff fd 34 call 400135cc 40014100: 98 07 bf fc add %fp, -4, %o4 sizeof(le_next_free), &le_next_free); } } if ( (ret1 < 0) || (ret2 < 0) ) 40014104: 80 a2 20 00 cmp %o0, 0 40014108: 06 80 00 04 bl 40014118 <== NEVER TAKEN 4001410c: 80 a6 a0 00 cmp %i2, 0 40014110: 16 80 00 03 bge 4001411c <== ALWAYS TAKEN 40014114: b0 10 20 00 clr %i0 { int rc = RC_OK; rc = fat_fat32_update_fsinfo_sector(fs_info); if ( rc != RC_OK ) rc = -1; 40014118: b0 10 3f ff mov -1, %i0 <== NOT EXECUTED fat_buf_release(fs_info); 4001411c: 7f ff fc 69 call 400132c0 40014120: 90 10 00 1d mov %i5, %o0 if (rtems_bdbuf_syncdev(fs_info->vol.dd) != RTEMS_SUCCESSFUL) 40014124: 7f ff f5 bb call 40011810 40014128: d0 07 60 64 ld [ %i5 + 0x64 ], %o0 4001412c: 80 a2 20 00 cmp %o0, 0 40014130: 32 80 00 02 bne,a 40014138 <== NEVER TAKEN 40014134: b0 10 3f ff mov -1, %i0 <== NOT EXECUTED rc = -1; return rc; } 40014138: 81 c7 e0 08 ret 4001413c: 81 e8 00 00 restore =============================================================================== 40032efc : /** * compatible with SVr4, 4.4BSD and X/OPEN - Change Directory */ int fchdir( int fd ) { 40032efc: 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 ); 40032f00: 03 10 01 7f sethi %hi(0x4005fc00), %g1 <== NOT EXECUTED 40032f04: c2 00 63 c0 ld [ %g1 + 0x3c0 ], %g1 ! 4005ffc0 <== NOT EXECUTED int rv = 0; rtems_libio_t *iop; struct stat st; rtems_filesystem_location_info_t loc; st.st_mode = 0; 40032f08: c0 27 bf c4 clr [ %fp + -60 ] <== NOT EXECUTED st.st_uid = 0; 40032f0c: c0 37 bf ca clrh [ %fp + -54 ] <== NOT EXECUTED st.st_gid = 0; rtems_libio_check_fd( fd ); 40032f10: 80 a6 00 01 cmp %i0, %g1 <== NOT EXECUTED 40032f14: 1a 80 00 0c bcc 40032f44 <== NOT EXECUTED 40032f18: c0 37 bf cc clrh [ %fp + -52 ] <== NOT EXECUTED iop = rtems_libio_iop( fd ); 40032f1c: 83 2e 20 03 sll %i0, 3, %g1 <== NOT EXECUTED 40032f20: b1 2e 20 06 sll %i0, 6, %i0 <== NOT EXECUTED 40032f24: b0 26 00 01 sub %i0, %g1, %i0 <== NOT EXECUTED 40032f28: 03 10 01 90 sethi %hi(0x40064000), %g1 <== NOT EXECUTED 40032f2c: fa 00 62 a0 ld [ %g1 + 0x2a0 ], %i5 ! 400642a0 <== NOT EXECUTED 40032f30: ba 07 40 18 add %i5, %i0, %i5 <== NOT EXECUTED rtems_libio_check_is_open( iop ); 40032f34: c2 07 60 10 ld [ %i5 + 0x10 ], %g1 <== NOT EXECUTED 40032f38: 80 88 61 00 btst 0x100, %g1 <== NOT EXECUTED 40032f3c: 32 80 00 08 bne,a 40032f5c <== NOT EXECUTED 40032f40: d0 07 60 28 ld [ %i5 + 0x28 ], %o0 <== NOT EXECUTED 40032f44: 40 00 10 d5 call 40037298 <__errno> <== NOT EXECUTED 40032f48: b0 10 3f ff mov -1, %i0 <== NOT EXECUTED 40032f4c: 82 10 20 09 mov 9, %g1 <== NOT EXECUTED 40032f50: c2 22 00 00 st %g1, [ %o0 ] <== NOT EXECUTED 40032f54: 81 c7 e0 08 ret <== NOT EXECUTED 40032f58: 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 ); 40032f5c: c2 02 20 0c ld [ %o0 + 0xc ], %g1 <== NOT EXECUTED 40032f60: c2 00 40 00 ld [ %g1 ], %g1 <== NOT EXECUTED 40032f64: 9f c0 40 00 call %g1 <== NOT EXECUTED 40032f68: 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 ); 40032f6c: c2 07 60 24 ld [ %i5 + 0x24 ], %g1 <== NOT EXECUTED 40032f70: 90 10 00 1c mov %i4, %o0 <== NOT EXECUTED 40032f74: c2 00 60 18 ld [ %g1 + 0x18 ], %g1 <== NOT EXECUTED 40032f78: 9f c0 40 00 call %g1 <== NOT EXECUTED 40032f7c: 92 07 bf b8 add %fp, -72, %o1 <== NOT EXECUTED if ( rv == 0 ) { 40032f80: b0 92 20 00 orcc %o0, 0, %i0 <== NOT EXECUTED 40032f84: 32 80 00 13 bne,a 40032fd0 <== NOT EXECUTED 40032f88: d0 07 60 28 ld [ %i5 + 0x28 ], %o0 <== NOT EXECUTED bool access_ok = rtems_filesystem_check_access( 40032f8c: d2 07 bf c4 ld [ %fp + -60 ], %o1 <== NOT EXECUTED 40032f90: d4 17 bf ca lduh [ %fp + -54 ], %o2 <== NOT EXECUTED 40032f94: d6 17 bf cc lduh [ %fp + -52 ], %o3 <== NOT EXECUTED 40032f98: 7f ff 6e 0e call 4000e7d0 <== NOT EXECUTED 40032f9c: 90 10 20 01 mov 1, %o0 <== NOT EXECUTED st.st_mode, st.st_uid, st.st_gid ); if ( access_ok ) { 40032fa0: 80 8a 20 ff btst 0xff, %o0 <== NOT EXECUTED 40032fa4: 02 80 00 06 be 40032fbc <== NOT EXECUTED 40032fa8: 90 07 bf a0 add %fp, -96, %o0 <== NOT EXECUTED rtems_filesystem_location_clone( &loc, &iop->pathinfo ); 40032fac: 7f ff 6c 75 call 4000e180 <== NOT EXECUTED 40032fb0: 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; 40032fb4: 10 80 00 07 b 40032fd0 <== NOT EXECUTED 40032fb8: d0 07 60 28 ld [ %i5 + 0x28 ], %o0 <== NOT EXECUTED } else { errno = EACCES; 40032fbc: 40 00 10 b7 call 40037298 <__errno> <== NOT EXECUTED 40032fc0: b0 10 3f ff mov -1, %i0 <== NOT EXECUTED 40032fc4: 82 10 20 0d mov 0xd, %g1 <== NOT EXECUTED 40032fc8: c2 22 00 00 st %g1, [ %o0 ] <== NOT EXECUTED 40032fcc: d0 07 60 28 ld [ %i5 + 0x28 ], %o0 <== NOT EXECUTED (*mt_entry->ops->unlock_h)( mt_entry ); 40032fd0: c2 02 20 0c ld [ %o0 + 0xc ], %g1 <== NOT EXECUTED 40032fd4: c2 00 60 04 ld [ %g1 + 4 ], %g1 <== NOT EXECUTED 40032fd8: 9f c0 40 00 call %g1 <== NOT EXECUTED 40032fdc: 01 00 00 00 nop <== NOT EXECUTED rv = -1; } } rtems_filesystem_instance_unlock( &iop->pathinfo ); if ( rv == 0 ) { 40032fe0: 80 a6 20 00 cmp %i0, 0 <== NOT EXECUTED 40032fe4: 12 80 00 05 bne 40032ff8 <== NOT EXECUTED 40032fe8: 01 00 00 00 nop <== NOT EXECUTED rv = rtems_filesystem_chdir( &loc ); 40032fec: 7f ff c3 1d call 40023c60 <== NOT EXECUTED 40032ff0: 90 07 bf a0 add %fp, -96, %o0 <== NOT EXECUTED 40032ff4: b0 10 00 08 mov %o0, %i0 <== NOT EXECUTED } return rv; } 40032ff8: 81 c7 e0 08 ret <== NOT EXECUTED 40032ffc: 81 e8 00 00 restore <== NOT EXECUTED 40033000: 40 03 30 a8 call 400ff2a0 <__end+0x9a100> <== NOT EXECUTED 40033004: 40 03 31 84 call 400ff614 <__end+0x9a474> <== NOT EXECUTED 40033008: 40 03 31 90 call 400ff648 <__end+0x9a4a8> <== NOT EXECUTED 4003300c: 40 03 31 a8 call 400ff6ac <__end+0x9a50c> <== NOT EXECUTED 40033010: 40 03 31 b8 call 400ff6f0 <__end+0x9a550> <== NOT EXECUTED 40033014: 40 03 31 dc call 400ff784 <__end+0x9a5e4> <== NOT EXECUTED 40033018: 40 03 31 dc call 400ff788 <__end+0x9a5e8> <== NOT EXECUTED 4003301c: 40 03 31 dc call 400ff78c <__end+0x9a5ec> <== NOT EXECUTED 40033020: 40 03 31 dc call 400ff790 <__end+0x9a5f0> <== NOT EXECUTED 40033024: 40 03 31 dc call 400ff794 <__end+0x9a5f4> <== NOT EXECUTED =============================================================================== 400241b8 : /** * POSIX 1003.1b 5.6.4 - Change File Modes */ int fchmod( int fd, mode_t mode ) { 400241b8: 9d e3 bf a0 save %sp, -96, %sp int rv; rtems_libio_t *iop; rtems_libio_check_fd( fd ); 400241bc: 03 10 01 7f sethi %hi(0x4005fc00), %g1 400241c0: c2 00 63 c0 ld [ %g1 + 0x3c0 ], %g1 ! 4005ffc0 400241c4: 80 a6 00 01 cmp %i0, %g1 400241c8: 2a 80 00 03 bcs,a 400241d4 400241cc: 83 2e 20 03 sll %i0, 3, %g1 400241d0: 30 80 00 0a b,a 400241f8 iop = rtems_libio_iop( fd ); 400241d4: b1 2e 20 06 sll %i0, 6, %i0 400241d8: b0 26 00 01 sub %i0, %g1, %i0 400241dc: 03 10 01 90 sethi %hi(0x40064000), %g1 400241e0: fa 00 62 a0 ld [ %g1 + 0x2a0 ], %i5 ! 400642a0 400241e4: ba 07 40 18 add %i5, %i0, %i5 rtems_libio_check_is_open(iop); 400241e8: c2 07 60 10 ld [ %i5 + 0x10 ], %g1 400241ec: 80 88 61 00 btst 0x100, %g1 400241f0: 32 80 00 06 bne,a 40024208 400241f4: d0 07 60 28 ld [ %i5 + 0x28 ], %o0 400241f8: 40 00 4c 28 call 40037298 <__errno> 400241fc: 01 00 00 00 nop 40024200: 10 80 00 1b b 4002426c 40024204: 82 10 20 09 mov 9, %g1 ! 9 if (iop->pathinfo.mt_entry->writeable) { 40024208: c2 0a 20 29 ldub [ %o0 + 0x29 ], %g1 4002420c: 80 a0 60 00 cmp %g1, 0 40024210: 02 80 00 14 be 40024260 <== NEVER TAKEN 40024214: 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 ); 40024218: c2 02 20 0c ld [ %o0 + 0xc ], %g1 4002421c: c2 00 40 00 ld [ %g1 ], %g1 40024220: 9f c0 40 00 call %g1 40024224: 01 00 00 00 nop rtems_filesystem_instance_lock( &iop->pathinfo ); rv = (*iop->pathinfo.mt_entry->ops->fchmod_h)( &iop->pathinfo, mode ); 40024228: c2 07 60 28 ld [ %i5 + 0x28 ], %g1 4002422c: 90 07 60 14 add %i5, 0x14, %o0 40024230: c2 00 60 0c ld [ %g1 + 0xc ], %g1 40024234: c2 00 60 20 ld [ %g1 + 0x20 ], %g1 40024238: 9f c0 40 00 call %g1 4002423c: 92 10 00 19 mov %i1, %o1 40024240: 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; 40024244: d0 07 60 28 ld [ %i5 + 0x28 ], %o0 (*mt_entry->ops->unlock_h)( mt_entry ); 40024248: c2 02 20 0c ld [ %o0 + 0xc ], %g1 4002424c: c2 00 60 04 ld [ %g1 + 4 ], %g1 40024250: 9f c0 40 00 call %g1 40024254: 01 00 00 00 nop 40024258: 81 c7 e0 08 ret 4002425c: 81 e8 00 00 restore rtems_filesystem_instance_unlock( &iop->pathinfo ); } else { errno = EROFS; 40024260: 40 00 4c 0e call 40037298 <__errno> <== NOT EXECUTED 40024264: 01 00 00 00 nop <== NOT EXECUTED 40024268: 82 10 20 1e mov 0x1e, %g1 ! 1e <== NOT EXECUTED 4002426c: c2 22 00 00 st %g1, [ %o0 ] rv = -1; } return rv; } 40024270: 81 c7 e0 08 ret 40024274: 91 e8 3f ff restore %g0, -1, %o0 =============================================================================== 40024278 : /** * POSIX 1003.1b 5.6.5 - Change Owner and Group of a File */ int fchown( int fd, uid_t owner, gid_t group ) { 40024278: 9d e3 bf a0 save %sp, -96, %sp int rv = 0; rtems_libio_t *iop; rtems_libio_check_fd( fd ); 4002427c: 03 10 01 7f sethi %hi(0x4005fc00), %g1 40024280: c2 00 63 c0 ld [ %g1 + 0x3c0 ], %g1 ! 4005ffc0 40024284: 80 a6 00 01 cmp %i0, %g1 40024288: 2a 80 00 03 bcs,a 40024294 4002428c: 83 2e 20 03 sll %i0, 3, %g1 40024290: 30 80 00 0a b,a 400242b8 iop = rtems_libio_iop( fd ); 40024294: b1 2e 20 06 sll %i0, 6, %i0 40024298: b0 26 00 01 sub %i0, %g1, %i0 4002429c: 03 10 01 90 sethi %hi(0x40064000), %g1 400242a0: fa 00 62 a0 ld [ %g1 + 0x2a0 ], %i5 ! 400642a0 400242a4: ba 07 40 18 add %i5, %i0, %i5 rtems_libio_check_is_open(iop); 400242a8: c2 07 60 10 ld [ %i5 + 0x10 ], %g1 400242ac: 80 88 61 00 btst 0x100, %g1 400242b0: 32 80 00 06 bne,a 400242c8 400242b4: d0 07 60 28 ld [ %i5 + 0x28 ], %o0 400242b8: 40 00 4b f8 call 40037298 <__errno> 400242bc: 01 00 00 00 nop 400242c0: 10 80 00 1c b 40024330 400242c4: 82 10 20 09 mov 9, %g1 ! 9 if (iop->pathinfo.mt_entry->writeable) { 400242c8: c2 0a 20 29 ldub [ %o0 + 0x29 ], %g1 400242cc: 80 a0 60 00 cmp %g1, 0 400242d0: 02 80 00 15 be 40024324 <== NEVER TAKEN 400242d4: 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 ); 400242d8: c2 02 20 0c ld [ %o0 + 0xc ], %g1 400242dc: c2 00 40 00 ld [ %g1 ], %g1 400242e0: 9f c0 40 00 call %g1 400242e4: 01 00 00 00 nop rtems_filesystem_instance_lock( &iop->pathinfo ); rv = (*iop->pathinfo.mt_entry->ops->chown_h)( 400242e8: c2 07 60 28 ld [ %i5 + 0x28 ], %g1 400242ec: 90 07 60 14 add %i5, 0x14, %o0 400242f0: c2 00 60 0c ld [ %g1 + 0xc ], %g1 400242f4: 92 10 00 19 mov %i1, %o1 400242f8: c2 00 60 24 ld [ %g1 + 0x24 ], %g1 400242fc: 9f c0 40 00 call %g1 40024300: 94 10 00 1a mov %i2, %o2 40024304: 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; 40024308: d0 07 60 28 ld [ %i5 + 0x28 ], %o0 (*mt_entry->ops->unlock_h)( mt_entry ); 4002430c: c2 02 20 0c ld [ %o0 + 0xc ], %g1 40024310: c2 00 60 04 ld [ %g1 + 4 ], %g1 40024314: 9f c0 40 00 call %g1 40024318: 01 00 00 00 nop 4002431c: 81 c7 e0 08 ret 40024320: 81 e8 00 00 restore owner, group ); rtems_filesystem_instance_unlock( &iop->pathinfo ); } else { errno = EROFS; 40024324: 40 00 4b dd call 40037298 <__errno> <== NOT EXECUTED 40024328: 01 00 00 00 nop <== NOT EXECUTED 4002432c: 82 10 20 1e mov 0x1e, %g1 ! 1e <== NOT EXECUTED 40024330: c2 22 00 00 st %g1, [ %o0 ] rv = -1; } return rv; } 40024334: 81 c7 e0 08 ret 40024338: 91 e8 3f ff restore %g0, -1, %o0 =============================================================================== 400317b8 : int fcntl( int fd, int cmd, ... ) { 400317b8: 9d e3 bf 98 save %sp, -104, %sp int fd2; int flags; int mask; int ret = 0; rtems_libio_check_fd( fd ); 400317bc: 05 10 00 de sethi %hi(0x40037800), %g2 400317c0: c4 00 a1 fc ld [ %g2 + 0x1fc ], %g2 ! 400379fc ... ) { int ret; va_list ap; va_start( ap, cmd ); 400317c4: 82 07 a0 4c add %fp, 0x4c, %g1 400317c8: f4 27 a0 4c st %i2, [ %fp + 0x4c ] 400317cc: f6 27 a0 50 st %i3, [ %fp + 0x50 ] 400317d0: f8 27 a0 54 st %i4, [ %fp + 0x54 ] 400317d4: fa 27 a0 58 st %i5, [ %fp + 0x58 ] int fd2; int flags; int mask; int ret = 0; rtems_libio_check_fd( fd ); 400317d8: 80 a6 00 02 cmp %i0, %g2 400317dc: 1a 80 00 0c bcc 4003180c 400317e0: c2 27 bf fc st %g1, [ %fp + -4 ] iop = rtems_libio_iop( fd ); 400317e4: 85 2e 20 03 sll %i0, 3, %g2 400317e8: b1 2e 20 06 sll %i0, 6, %i0 400317ec: b0 26 00 02 sub %i0, %g2, %i0 400317f0: 05 10 01 21 sethi %hi(0x40048400), %g2 400317f4: fa 00 a2 e4 ld [ %g2 + 0x2e4 ], %i5 ! 400486e4 400317f8: ba 07 40 18 add %i5, %i0, %i5 rtems_libio_check_is_open(iop); 400317fc: d0 07 60 10 ld [ %i5 + 0x10 ], %o0 40031800: 80 8a 21 00 btst 0x100, %o0 40031804: 12 80 00 06 bne 4003181c 40031808: 80 a6 60 09 cmp %i1, 9 4003180c: 7f ff be 6c call 400211bc <__errno> 40031810: 01 00 00 00 nop 40031814: 10 80 00 5d b 40031988 40031818: 82 10 20 09 mov 9, %g1 ! 9 /* * This switch should contain all the cases from POSIX. */ switch ( cmd ) { 4003181c: 18 80 00 58 bgu 4003197c 40031820: 85 2e 60 02 sll %i1, 2, %g2 40031824: 07 10 00 c5 sethi %hi(0x40031400), %g3 40031828: 86 10 e3 90 or %g3, 0x390, %g3 ! 40031790 <_calloc_r+0x14> 4003182c: c4 00 c0 02 ld [ %g3 + %g2 ], %g2 40031830: 81 c0 80 00 jmp %g2 40031834: 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(); 40031838: 7f ff 5c cd call 40008b6c 4003183c: 01 00 00 00 nop if (diop != NULL) { 40031840: b8 92 20 00 orcc %o0, 0, %i4 40031844: 02 80 00 62 be 400319cc 40031848: b0 10 3f ff mov -1, %i0 int oflag = rtems_libio_to_fcntl_flags( iop->flags ); 4003184c: 7f ff 5c b2 call 40008b14 40031850: d0 07 60 10 ld [ %i5 + 0x10 ], %o0 oflag &= ~O_CREAT; diop->flags |= rtems_libio_fcntl_flags( oflag ); 40031854: 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; 40031858: b6 0a 3d ff and %o0, -513, %i3 diop->flags |= rtems_libio_fcntl_flags( oflag ); 4003185c: 7f ff 5c a1 call 40008ae0 40031860: 90 10 00 1b mov %i3, %o0 40031864: 90 12 00 1a or %o0, %i2, %o0 40031868: 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; 4003186c: d0 07 60 28 ld [ %i5 + 0x28 ], %o0 (*mt_entry->ops->lock_h)( mt_entry ); 40031870: c2 02 20 0c ld [ %o0 + 0xc ], %g1 40031874: c2 00 40 00 ld [ %g1 ], %g1 40031878: 9f c0 40 00 call %g1 4003187c: 01 00 00 00 nop rtems_filesystem_instance_lock( &iop->pathinfo ); rtems_filesystem_location_clone( &diop->pathinfo, &iop->pathinfo ); 40031880: 92 07 60 14 add %i5, 0x14, %o1 40031884: 7f ff 96 15 call 400170d8 40031888: 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; 4003188c: d0 07 60 28 ld [ %i5 + 0x28 ], %o0 (*mt_entry->ops->unlock_h)( mt_entry ); 40031890: c2 02 20 0c ld [ %o0 + 0xc ], %g1 40031894: c2 00 60 04 ld [ %g1 + 4 ], %g1 40031898: 9f c0 40 00 call %g1 4003189c: 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 ); 400318a0: c2 07 20 24 ld [ %i4 + 0x24 ], %g1 400318a4: 90 10 00 1c mov %i4, %o0 400318a8: c2 00 40 00 ld [ %g1 ], %g1 400318ac: 92 10 20 00 clr %o1 400318b0: 94 10 00 1b mov %i3, %o2 400318b4: 9f c0 40 00 call %g1 400318b8: 96 10 20 00 clr %o3 if ( rv == 0 ) { 400318bc: b0 92 20 00 orcc %o0, 0, %i0 400318c0: 12 80 00 11 bne 40031904 <== NEVER TAKEN 400318c4: 03 10 01 21 sethi %hi(0x40048400), %g1 rv = diop - rtems_libio_iops; 400318c8: f0 00 62 e4 ld [ %g1 + 0x2e4 ], %i0 ! 400486e4 400318cc: b8 27 00 18 sub %i4, %i0, %i4 400318d0: b9 3f 20 03 sra %i4, 3, %i4 400318d4: 85 2f 20 03 sll %i4, 3, %g2 400318d8: 83 2f 20 06 sll %i4, 6, %g1 400318dc: 82 00 80 01 add %g2, %g1, %g1 400318e0: 85 28 60 06 sll %g1, 6, %g2 400318e4: 82 00 40 02 add %g1, %g2, %g1 400318e8: 82 00 40 1c add %g1, %i4, %g1 400318ec: b1 28 60 0f sll %g1, 0xf, %i0 400318f0: 82 00 40 18 add %g1, %i0, %g1 400318f4: 83 28 60 03 sll %g1, 3, %g1 400318f8: b8 00 40 1c add %g1, %i4, %i4 400318fc: 10 80 00 25 b 40031990 40031900: b0 20 00 1c neg %i4, %i0 } else { rtems_libio_free( diop ); 40031904: 7f ff 5c b1 call 40008bc8 <== NOT EXECUTED 40031908: 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) { 4003190c: 10 80 00 22 b 40031994 <== NOT EXECUTED 40031910: 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); 40031914: b1 32 20 0b srl %o0, 0xb, %i0 40031918: 10 80 00 21 b 4003199c 4003191c: 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 ) ) 40031920: c2 00 40 00 ld [ %g1 ], %g1 40031924: 80 a0 60 00 cmp %g1, 0 40031928: 22 80 00 0e be,a 40031960 4003192c: 90 0a 37 ff and %o0, -2049, %o0 iop->flags |= LIBIO_FLAGS_CLOSE_ON_EXEC; 40031930: 10 80 00 0c b 40031960 40031934: 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 ); 40031938: 7f ff 5c 77 call 40008b14 4003193c: 01 00 00 00 nop 40031940: 10 80 00 14 b 40031990 40031944: b0 10 00 08 mov %o0, %i0 break; case F_SETFL: flags = rtems_libio_fcntl_flags( va_arg( ap, int ) ); 40031948: 7f ff 5c 66 call 40008ae0 4003194c: 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); 40031950: c2 07 60 10 ld [ %i5 + 0x10 ], %g1 40031954: 90 0a 22 01 and %o0, 0x201, %o0 40031958: 82 08 7d fe and %g1, -514, %g1 4003195c: 90 12 00 01 or %o0, %g1, %o0 40031960: d0 27 60 10 st %o0, [ %i5 + 0x10 ] { rtems_libio_t *iop; int fd2; int flags; int mask; int ret = 0; 40031964: 10 80 00 0e b 4003199c 40031968: b0 10 20 00 clr %i0 errno = ENOTSUP; ret = -1; break; case F_GETOWN: /* for sockets. */ errno = ENOTSUP; 4003196c: 7f ff be 14 call 400211bc <__errno> 40031970: 01 00 00 00 nop 40031974: 10 80 00 05 b 40031988 40031978: 82 10 20 86 mov 0x86, %g1 ! 86 ret = -1; break; default: errno = EINVAL; 4003197c: 7f ff be 10 call 400211bc <__errno> 40031980: 01 00 00 00 nop 40031984: 82 10 20 16 mov 0x16, %g1 ! 16 40031988: 10 80 00 10 b 400319c8 4003198c: 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) { 40031990: 80 a6 20 00 cmp %i0, 0 40031994: 06 80 00 0e bl 400319cc <== NEVER TAKEN 40031998: 01 00 00 00 nop int err = (*iop->pathinfo.handlers->fcntl_h)( iop, cmd ); 4003199c: c2 07 60 24 ld [ %i5 + 0x24 ], %g1 400319a0: 90 10 00 1d mov %i5, %o0 400319a4: c2 00 60 28 ld [ %g1 + 0x28 ], %g1 400319a8: 9f c0 40 00 call %g1 400319ac: 92 10 00 19 mov %i1, %o1 if (err) { 400319b0: ba 92 20 00 orcc %o0, 0, %i5 400319b4: 02 80 00 06 be 400319cc <== ALWAYS TAKEN 400319b8: 01 00 00 00 nop errno = err; 400319bc: 7f ff be 00 call 400211bc <__errno> <== NOT EXECUTED 400319c0: 01 00 00 00 nop <== NOT EXECUTED 400319c4: 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); 400319c8: b0 10 3f ff mov -1, %i0 va_list ap; va_start( ap, cmd ); ret = vfcntl(fd,cmd,ap); va_end(ap); return ret; } 400319cc: 81 c7 e0 08 ret 400319d0: 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 5c sethi %hi(0x40017000), %g1 40004994: c2 00 62 64 ld [ %g1 + 0x264 ], %g1 ! 40017264 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 5f sethi %hi(0x40017c00), %g1 400049b0: d0 00 61 c0 ld [ %g1 + 0x1c0 ], %o0 ! 40017dc0 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 2f 3f call 400106cc <__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 =============================================================================== 4000e0a8 : int fifo_open( pipe_control_t **pipep, rtems_libio_t *iop ) { 4000e0a8: 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) { 4000e0ac: 3b 10 00 8e sethi %hi(0x40023800), %i5 4000e0b0: c2 07 62 d0 ld [ %i5 + 0x2d0 ], %g1 ! 40023ad0 int fifo_open( pipe_control_t **pipep, rtems_libio_t *iop ) { 4000e0b4: b6 10 00 18 mov %i0, %i3 static int pipe_lock(void) { rtems_status_code sc = RTEMS_SUCCESSFUL; if (pipe_semaphore == RTEMS_ID_NONE) { 4000e0b8: 80 a0 60 00 cmp %g1, 0 4000e0bc: 02 80 00 0c be 4000e0ec 4000e0c0: b8 17 62 d0 or %i5, 0x2d0, %i4 rtems_libio_unlock(); } if (sc == RTEMS_SUCCESSFUL) { sc = rtems_semaphore_obtain(pipe_semaphore, RTEMS_WAIT, RTEMS_NO_TIMEOUT); 4000e0c4: 03 10 00 8e sethi %hi(0x40023800), %g1 4000e0c8: d0 00 62 d0 ld [ %g1 + 0x2d0 ], %o0 ! 40023ad0 4000e0cc: 92 10 20 00 clr %o1 4000e0d0: 7f ff ed 2a call 40009578 4000e0d4: 94 10 20 00 clr %o2 } if (sc == RTEMS_SUCCESSFUL) { 4000e0d8: 80 a2 20 00 cmp %o0, 0 4000e0dc: 22 80 01 00 be,a 4000e4dc <== ALWAYS TAKEN 4000e0e0: fa 06 c0 00 ld [ %i3 ], %i5 return 0; } else { return -ENOMEM; 4000e0e4: 81 c7 e0 08 ret <== NOT EXECUTED 4000e0e8: 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 ); 4000e0ec: 03 10 00 8f sethi %hi(0x40023c00), %g1 4000e0f0: d0 00 61 bc ld [ %g1 + 0x1bc ], %o0 ! 40023dbc 4000e0f4: 92 10 20 00 clr %o1 4000e0f8: 7f ff ed 20 call 40009578 4000e0fc: 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) { 4000e100: c2 07 62 d0 ld [ %i5 + 0x2d0 ], %g1 4000e104: 80 a0 60 00 cmp %g1, 0 4000e108: 12 80 00 0a bne 4000e130 <== NEVER TAKEN 4000e10c: ba 10 20 00 clr %i5 sc = rtems_semaphore_create( 4000e110: 11 14 12 54 sethi %hi(0x50495000), %o0 4000e114: 92 10 20 01 mov 1, %o1 4000e118: 90 12 20 45 or %o0, 0x45, %o0 4000e11c: 94 10 20 54 mov 0x54, %o2 4000e120: 96 10 20 00 clr %o3 4000e124: 7f ff ec 78 call 40009304 4000e128: 98 10 00 1c mov %i4, %o4 4000e12c: ba 10 00 08 mov %o0, %i5 } static inline void rtems_libio_unlock( void ) { rtems_semaphore_release( rtems_libio_semaphore ); 4000e130: 03 10 00 8f sethi %hi(0x40023c00), %g1 4000e134: 7f ff ed 5a call 4000969c 4000e138: d0 00 61 bc ld [ %g1 + 0x1bc ], %o0 ! 40023dbc } rtems_libio_unlock(); } if (sc == RTEMS_SUCCESSFUL) { 4000e13c: 80 a7 60 00 cmp %i5, 0 4000e140: 02 bf ff e1 be 4000e0c4 4000e144: b0 10 3f f4 mov -12, %i0 4000e148: 81 c7 e0 08 ret 4000e14c: 81 e8 00 00 restore { static char c = 'a'; pipe_control_t *pipe; int err = -ENOMEM; pipe = malloc(sizeof(pipe_control_t)); 4000e150: 7f ff dc cf call 4000548c 4000e154: 90 10 20 34 mov 0x34, %o0 if (pipe == NULL) 4000e158: ba 92 20 00 orcc %o0, 0, %i5 4000e15c: 02 80 00 e4 be 4000e4ec <== NEVER TAKEN 4000e160: 92 10 20 00 clr %o1 return err; memset(pipe, 0, sizeof(pipe_control_t)); 4000e164: 40 00 12 05 call 40012978 4000e168: 94 10 20 34 mov 0x34, %o2 pipe->Size = PIPE_BUF; 4000e16c: 82 10 22 00 mov 0x200, %g1 pipe->Buffer = malloc(pipe->Size); 4000e170: 90 10 22 00 mov 0x200, %o0 4000e174: 7f ff dc c6 call 4000548c 4000e178: c2 27 60 04 st %g1, [ %i5 + 4 ] if (! pipe->Buffer) 4000e17c: 80 a2 20 00 cmp %o0, 0 4000e180: 02 80 00 40 be 4000e280 <== NEVER TAKEN 4000e184: d0 27 40 00 st %o0, [ %i5 ] goto err_buf; err = -ENOMEM; if (rtems_barrier_create( rtems_build_name ('P', 'I', 'r', c), 4000e188: 39 10 00 8c sethi %hi(0x40023000), %i4 4000e18c: d0 4f 23 40 ldsb [ %i4 + 0x340 ], %o0 ! 40023340 if (! pipe->Buffer) goto err_buf; err = -ENOMEM; if (rtems_barrier_create( 4000e190: 35 14 12 5c sethi %hi(0x50497000), %i2 4000e194: 82 16 a2 00 or %i2, 0x200, %g1 ! 50497200 4000e198: 92 10 20 00 clr %o1 4000e19c: 90 12 00 01 or %o0, %g1, %o0 4000e1a0: 94 10 20 00 clr %o2 4000e1a4: 40 00 05 eb call 4000f950 4000e1a8: 96 07 60 2c add %i5, 0x2c, %o3 4000e1ac: 80 a2 20 00 cmp %o0, 0 4000e1b0: 12 80 00 32 bne 4000e278 4000e1b4: d0 4f 23 40 ldsb [ %i4 + 0x340 ], %o0 rtems_build_name ('P', 'I', 'r', c), RTEMS_BARRIER_MANUAL_RELEASE, 0, &pipe->readBarrier) != RTEMS_SUCCESSFUL) goto err_rbar; if (rtems_barrier_create( 4000e1b8: 03 14 12 5d sethi %hi(0x50497400), %g1 4000e1bc: 82 10 63 00 or %g1, 0x300, %g1 ! 50497700 4000e1c0: 92 10 20 00 clr %o1 4000e1c4: 90 12 00 01 or %o0, %g1, %o0 4000e1c8: 94 10 20 00 clr %o2 4000e1cc: 40 00 05 e1 call 4000f950 4000e1d0: 96 07 60 30 add %i5, 0x30, %o3 4000e1d4: 80 a2 20 00 cmp %o0, 0 4000e1d8: 12 80 00 26 bne 4000e270 4000e1dc: d0 4f 23 40 ldsb [ %i4 + 0x340 ], %o0 rtems_build_name ('P', 'I', 'w', c), RTEMS_BARRIER_MANUAL_RELEASE, 0, &pipe->writeBarrier) != RTEMS_SUCCESSFUL) goto err_wbar; if (rtems_semaphore_create( 4000e1e0: b4 16 a3 00 or %i2, 0x300, %i2 4000e1e4: 92 10 20 01 mov 1, %o1 4000e1e8: 90 12 00 1a or %o0, %i2, %o0 4000e1ec: 94 10 20 10 mov 0x10, %o2 4000e1f0: 96 10 20 00 clr %o3 4000e1f4: 7f ff ec 44 call 40009304 4000e1f8: 98 07 60 28 add %i5, 0x28, %o4 4000e1fc: 80 a2 20 00 cmp %o0, 0 4000e200: 12 80 00 1a bne 4000e268 4000e204: 94 07 bf fc add %fp, -4, %o2 RTEMS_INLINE_ROUTINE Barrier_Control *_Barrier_Get ( Objects_Id id, Objects_Locations *location ) { return (Barrier_Control *) 4000e208: d2 07 60 2c ld [ %i5 + 0x2c ], %o1 4000e20c: 31 10 00 92 sethi %hi(0x40024800), %i0 4000e210: 7f ff f3 6d call 4000afc4 <_Objects_Get> 4000e214: 90 16 20 50 or %i0, 0x50, %o0 ! 40024850 <_Barrier_Information> static void pipe_interruptible(pipe_control_t *pipe) { Objects_Locations location; _Barrier_Get(pipe->readBarrier, &location)->Barrier.Wait_queue.state |= STATES_INTERRUPTIBLE_BY_SIGNAL; 4000e218: c2 02 20 4c ld [ %o0 + 0x4c ], %g1 4000e21c: 35 04 00 00 sethi %hi(0x10000000), %i2 4000e220: 82 10 40 1a or %g1, %i2, %g1 _Thread_Enable_dispatch(); 4000e224: 7f ff f6 e9 call 4000bdc8 <_Thread_Enable_dispatch> 4000e228: c2 22 20 4c st %g1, [ %o0 + 0x4c ] 4000e22c: d2 07 60 30 ld [ %i5 + 0x30 ], %o1 4000e230: 94 07 bf fc add %fp, -4, %o2 4000e234: 7f ff f3 64 call 4000afc4 <_Objects_Get> 4000e238: 90 16 20 50 or %i0, 0x50, %o0 _Barrier_Get(pipe->writeBarrier, &location)->Barrier.Wait_queue.state |= STATES_INTERRUPTIBLE_BY_SIGNAL; 4000e23c: c2 02 20 4c ld [ %o0 + 0x4c ], %g1 4000e240: b4 10 40 1a or %g1, %i2, %i2 _Thread_Enable_dispatch(); 4000e244: 7f ff f6 e1 call 4000bdc8 <_Thread_Enable_dispatch> 4000e248: f4 22 20 4c st %i2, [ %o0 + 0x4c ] #ifdef RTEMS_POSIX_API pipe_interruptible(pipe); #endif *pipep = pipe; if (c ++ == 'z') 4000e24c: c2 0f 23 40 ldub [ %i4 + 0x340 ], %g1 4000e250: c4 4f 23 40 ldsb [ %i4 + 0x340 ], %g2 4000e254: 80 a0 a0 7a cmp %g2, 0x7a 4000e258: 12 80 00 a7 bne 4000e4f4 4000e25c: 82 00 60 01 inc %g1 c = 'a'; 4000e260: 10 80 00 a5 b 4000e4f4 4000e264: 82 10 20 61 mov 0x61, %g1 return 0; err_sem: rtems_barrier_delete(pipe->writeBarrier); 4000e268: 40 00 05 e9 call 4000fa0c 4000e26c: d0 07 60 30 ld [ %i5 + 0x30 ], %o0 err_wbar: rtems_barrier_delete(pipe->readBarrier); 4000e270: 40 00 05 e7 call 4000fa0c 4000e274: d0 07 60 2c ld [ %i5 + 0x2c ], %o0 err_rbar: free(pipe->Buffer); 4000e278: 7f ff db 71 call 4000503c 4000e27c: d0 07 40 00 ld [ %i5 ], %o0 err_buf: free(pipe); 4000e280: 7f ff db 6f call 4000503c 4000e284: 90 10 00 1d mov %i5, %o0 if (err) goto out; } if (! PIPE_LOCK(pipe)) err = -EINTR; 4000e288: 10 80 00 13 b 4000e2d4 4000e28c: b0 10 3f f4 mov -12, %i0 err = pipe_alloc(&pipe); if (err) goto out; } if (! PIPE_LOCK(pipe)) 4000e290: d0 07 60 28 ld [ %i5 + 0x28 ], %o0 4000e294: 92 10 20 00 clr %o1 4000e298: 7f ff ec b8 call 40009578 4000e29c: 94 10 20 00 clr %o2 err = -EINTR; if (*pipep == NULL) { 4000e2a0: c2 06 c0 00 ld [ %i3 ], %g1 err = pipe_alloc(&pipe); if (err) goto out; } if (! PIPE_LOCK(pipe)) 4000e2a4: 80 a0 00 08 cmp %g0, %o0 4000e2a8: b0 60 20 00 subx %g0, 0, %i0 err = -EINTR; if (*pipep == NULL) { 4000e2ac: 80 a0 60 00 cmp %g1, 0 4000e2b0: 12 80 00 09 bne 4000e2d4 4000e2b4: b0 0e 3f fc and %i0, -4, %i0 if (err) 4000e2b8: 80 a6 20 00 cmp %i0, 0 4000e2bc: 22 80 00 06 be,a 4000e2d4 <== ALWAYS TAKEN 4000e2c0: fa 26 c0 00 st %i5, [ %i3 ] pipe_free(pipe); 4000e2c4: 7f ff ff 41 call 4000dfc8 <== NOT EXECUTED 4000e2c8: 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); 4000e2cc: 10 80 00 03 b 4000e2d8 <== NOT EXECUTED 4000e2d0: 03 10 00 8e sethi %hi(0x40023800), %g1 <== NOT EXECUTED 4000e2d4: 03 10 00 8e sethi %hi(0x40023800), %g1 4000e2d8: 7f ff ec f1 call 4000969c 4000e2dc: d0 00 62 d0 ld [ %g1 + 0x2d0 ], %o0 ! 40023ad0 pipe_control_t *pipe; unsigned int prevCounter; int err; err = pipe_new(pipep); if (err) 4000e2e0: 80 a6 20 00 cmp %i0, 0 4000e2e4: 12 80 00 86 bne 4000e4fc 4000e2e8: 01 00 00 00 nop return err; pipe = *pipep; switch (LIBIO_ACCMODE(iop)) { 4000e2ec: c2 06 60 10 ld [ %i1 + 0x10 ], %g1 4000e2f0: 82 08 60 06 and %g1, 6, %g1 4000e2f4: 80 a0 60 04 cmp %g1, 4 4000e2f8: 02 80 00 2e be 4000e3b0 4000e2fc: fa 06 c0 00 ld [ %i3 ], %i5 4000e300: 80 a0 60 06 cmp %g1, 6 4000e304: 02 80 00 56 be 4000e45c 4000e308: 80 a0 60 02 cmp %g1, 2 4000e30c: 12 80 00 6a bne 4000e4b4 <== NEVER TAKEN 4000e310: 01 00 00 00 nop case LIBIO_FLAGS_READ: pipe->readerCounter ++; 4000e314: c2 07 60 20 ld [ %i5 + 0x20 ], %g1 4000e318: 82 00 60 01 inc %g1 4000e31c: c2 27 60 20 st %g1, [ %i5 + 0x20 ] if (pipe->Readers ++ == 0) 4000e320: c2 07 60 10 ld [ %i5 + 0x10 ], %g1 4000e324: 84 00 60 01 add %g1, 1, %g2 4000e328: 80 a0 60 00 cmp %g1, 0 4000e32c: 12 80 00 05 bne 4000e340 <== NEVER TAKEN 4000e330: c4 27 60 10 st %g2, [ %i5 + 0x10 ] PIPE_WAKEUPWRITERS(pipe); 4000e334: d0 07 60 30 ld [ %i5 + 0x30 ], %o0 4000e338: 40 00 05 de call 4000fab0 4000e33c: 92 07 bf f8 add %fp, -8, %o1 if (pipe->Writers == 0) { 4000e340: c2 07 60 14 ld [ %i5 + 0x14 ], %g1 4000e344: 80 a0 60 00 cmp %g1, 0 4000e348: 12 80 00 5b bne 4000e4b4 4000e34c: 01 00 00 00 nop /* Not an error */ if (LIBIO_NODELAY(iop)) 4000e350: c2 06 60 10 ld [ %i1 + 0x10 ], %g1 4000e354: 80 88 60 01 btst 1, %g1 4000e358: 12 80 00 57 bne 4000e4b4 4000e35c: 01 00 00 00 nop break; prevCounter = pipe->writerCounter; 4000e360: f8 07 60 24 ld [ %i5 + 0x24 ], %i4 err = -EINTR; /* Wait until a writer opens the pipe */ do { PIPE_UNLOCK(pipe); 4000e364: 7f ff ec ce call 4000969c 4000e368: d0 07 60 28 ld [ %i5 + 0x28 ], %o0 if (! PIPE_READWAIT(pipe)) 4000e36c: d0 07 60 2c ld [ %i5 + 0x2c ], %o0 4000e370: 40 00 05 e6 call 4000fb08 4000e374: 92 10 20 00 clr %o1 4000e378: 80 a2 20 00 cmp %o0, 0 4000e37c: 12 80 00 52 bne 4000e4c4 <== NEVER TAKEN 4000e380: 92 10 20 00 clr %o1 goto out_error; if (! PIPE_LOCK(pipe)) 4000e384: d0 07 60 28 ld [ %i5 + 0x28 ], %o0 4000e388: 7f ff ec 7c call 40009578 4000e38c: 94 10 20 00 clr %o2 4000e390: 80 a2 20 00 cmp %o0, 0 4000e394: 32 80 00 4d bne,a 4000e4c8 <== NEVER TAKEN 4000e398: b0 10 3f fc mov -4, %i0 <== NOT EXECUTED goto out_error; } while (prevCounter == pipe->writerCounter); 4000e39c: c2 07 60 24 ld [ %i5 + 0x24 ], %g1 4000e3a0: 80 a7 00 01 cmp %i4, %g1 4000e3a4: 02 bf ff f0 be 4000e364 <== NEVER TAKEN 4000e3a8: 01 00 00 00 nop 4000e3ac: 30 80 00 42 b,a 4000e4b4 } break; case LIBIO_FLAGS_WRITE: pipe->writerCounter ++; 4000e3b0: c2 07 60 24 ld [ %i5 + 0x24 ], %g1 4000e3b4: 82 00 60 01 inc %g1 4000e3b8: c2 27 60 24 st %g1, [ %i5 + 0x24 ] if (pipe->Writers ++ == 0) 4000e3bc: c2 07 60 14 ld [ %i5 + 0x14 ], %g1 4000e3c0: 84 00 60 01 add %g1, 1, %g2 4000e3c4: 80 a0 60 00 cmp %g1, 0 4000e3c8: 12 80 00 05 bne 4000e3dc <== NEVER TAKEN 4000e3cc: c4 27 60 14 st %g2, [ %i5 + 0x14 ] PIPE_WAKEUPREADERS(pipe); 4000e3d0: d0 07 60 2c ld [ %i5 + 0x2c ], %o0 4000e3d4: 40 00 05 b7 call 4000fab0 4000e3d8: 92 07 bf f8 add %fp, -8, %o1 if (pipe->Readers == 0 && LIBIO_NODELAY(iop)) { 4000e3dc: c2 07 60 10 ld [ %i5 + 0x10 ], %g1 4000e3e0: 80 a0 60 00 cmp %g1, 0 4000e3e4: 12 80 00 34 bne 4000e4b4 4000e3e8: 01 00 00 00 nop 4000e3ec: c2 06 60 10 ld [ %i1 + 0x10 ], %g1 4000e3f0: 80 88 60 01 btst 1, %g1 4000e3f4: 22 80 00 07 be,a 4000e410 4000e3f8: f8 07 60 20 ld [ %i5 + 0x20 ], %i4 PIPE_UNLOCK(pipe); 4000e3fc: d0 07 60 28 ld [ %i5 + 0x28 ], %o0 4000e400: 7f ff ec a7 call 4000969c 4000e404: b0 10 3f fa mov -6, %i0 err = -ENXIO; goto out_error; 4000e408: 10 80 00 31 b 4000e4cc 4000e40c: 90 10 00 1b mov %i3, %o0 if (pipe->Readers == 0) { prevCounter = pipe->readerCounter; err = -EINTR; do { PIPE_UNLOCK(pipe); 4000e410: 7f ff ec a3 call 4000969c 4000e414: d0 07 60 28 ld [ %i5 + 0x28 ], %o0 if (! PIPE_WRITEWAIT(pipe)) 4000e418: d0 07 60 30 ld [ %i5 + 0x30 ], %o0 4000e41c: 40 00 05 bb call 4000fb08 4000e420: 92 10 20 00 clr %o1 4000e424: 80 a2 20 00 cmp %o0, 0 4000e428: 12 80 00 27 bne 4000e4c4 <== NEVER TAKEN 4000e42c: 92 10 20 00 clr %o1 goto out_error; if (! PIPE_LOCK(pipe)) 4000e430: d0 07 60 28 ld [ %i5 + 0x28 ], %o0 4000e434: 7f ff ec 51 call 40009578 4000e438: 94 10 20 00 clr %o2 4000e43c: 80 a2 20 00 cmp %o0, 0 4000e440: 32 80 00 22 bne,a 4000e4c8 <== NEVER TAKEN 4000e444: b0 10 3f fc mov -4, %i0 <== NOT EXECUTED goto out_error; } while (prevCounter == pipe->readerCounter); 4000e448: c2 07 60 20 ld [ %i5 + 0x20 ], %g1 4000e44c: 80 a7 00 01 cmp %i4, %g1 4000e450: 02 bf ff f0 be 4000e410 <== NEVER TAKEN 4000e454: 01 00 00 00 nop 4000e458: 30 80 00 17 b,a 4000e4b4 } break; case LIBIO_FLAGS_READ_WRITE: pipe->readerCounter ++; 4000e45c: c2 07 60 20 ld [ %i5 + 0x20 ], %g1 4000e460: 82 00 60 01 inc %g1 4000e464: c2 27 60 20 st %g1, [ %i5 + 0x20 ] if (pipe->Readers ++ == 0) 4000e468: c2 07 60 10 ld [ %i5 + 0x10 ], %g1 4000e46c: 84 00 60 01 add %g1, 1, %g2 4000e470: 80 a0 60 00 cmp %g1, 0 4000e474: 12 80 00 05 bne 4000e488 <== NEVER TAKEN 4000e478: c4 27 60 10 st %g2, [ %i5 + 0x10 ] PIPE_WAKEUPWRITERS(pipe); 4000e47c: d0 07 60 30 ld [ %i5 + 0x30 ], %o0 4000e480: 40 00 05 8c call 4000fab0 4000e484: 92 07 bf f8 add %fp, -8, %o1 pipe->writerCounter ++; 4000e488: c2 07 60 24 ld [ %i5 + 0x24 ], %g1 4000e48c: 82 00 60 01 inc %g1 4000e490: c2 27 60 24 st %g1, [ %i5 + 0x24 ] if (pipe->Writers ++ == 0) 4000e494: c2 07 60 14 ld [ %i5 + 0x14 ], %g1 4000e498: 84 00 60 01 add %g1, 1, %g2 4000e49c: 80 a0 60 00 cmp %g1, 0 4000e4a0: 12 80 00 05 bne 4000e4b4 <== NEVER TAKEN 4000e4a4: c4 27 60 14 st %g2, [ %i5 + 0x14 ] PIPE_WAKEUPREADERS(pipe); 4000e4a8: d0 07 60 2c ld [ %i5 + 0x2c ], %o0 4000e4ac: 40 00 05 81 call 4000fab0 4000e4b0: 92 07 bf f8 add %fp, -8, %o1 break; } PIPE_UNLOCK(pipe); 4000e4b4: 7f ff ec 7a call 4000969c 4000e4b8: d0 07 60 28 ld [ %i5 + 0x28 ], %o0 return 0; 4000e4bc: 81 c7 e0 08 ret 4000e4c0: 81 e8 00 00 restore /* Not an error */ if (LIBIO_NODELAY(iop)) break; prevCounter = pipe->writerCounter; err = -EINTR; 4000e4c4: b0 10 3f fc mov -4, %i0 <== NOT EXECUTED PIPE_UNLOCK(pipe); return 0; out_error: pipe_release(pipep, iop); 4000e4c8: 90 10 00 1b mov %i3, %o0 <== NOT EXECUTED 4000e4cc: 7f ff fe ca call 4000dff4 4000e4d0: 92 10 00 19 mov %i1, %o1 return err; 4000e4d4: 81 c7 e0 08 ret 4000e4d8: 81 e8 00 00 restore err = pipe_lock(); if (err) return err; pipe = *pipep; if (pipe == NULL) { 4000e4dc: 80 a7 60 00 cmp %i5, 0 4000e4e0: 32 bf ff 6d bne,a 4000e294 4000e4e4: d0 07 60 28 ld [ %i5 + 0x28 ], %o0 4000e4e8: 30 bf ff 1a b,a 4000e150 if (err) goto out; } if (! PIPE_LOCK(pipe)) err = -EINTR; 4000e4ec: 10 bf ff 7a b 4000e2d4 <== NOT EXECUTED 4000e4f0: b0 10 3f f4 mov -12, %i0 <== NOT EXECUTED #ifdef RTEMS_POSIX_API pipe_interruptible(pipe); #endif *pipep = pipe; if (c ++ == 'z') 4000e4f4: 10 bf ff 67 b 4000e290 4000e4f8: c2 2f 23 40 stb %g1, [ %i4 + 0x340 ] return 0; out_error: pipe_release(pipep, iop); return err; } 4000e4fc: 81 c7 e0 08 ret 4000e500: 81 e8 00 00 restore =============================================================================== 4000a2a8 : */ long fpathconf( int fd, int name ) { 4000a2a8: 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); 4000a2ac: 03 10 00 4a sethi %hi(0x40012800), %g1 4000a2b0: c2 00 63 78 ld [ %g1 + 0x378 ], %g1 ! 40012b78 4000a2b4: 80 a6 00 01 cmp %i0, %g1 4000a2b8: 2a 80 00 03 bcs,a 4000a2c4 4000a2bc: 83 2e 20 03 sll %i0, 3, %g1 4000a2c0: 30 80 00 0a b,a 4000a2e8 iop = rtems_libio_iop(fd); 4000a2c4: b1 2e 20 06 sll %i0, 6, %i0 4000a2c8: b0 26 00 01 sub %i0, %g1, %i0 4000a2cc: 03 10 00 4d sethi %hi(0x40013400), %g1 4000a2d0: c2 00 61 44 ld [ %g1 + 0x144 ], %g1 ! 40013544 4000a2d4: b0 00 40 18 add %g1, %i0, %i0 rtems_libio_check_is_open(iop); 4000a2d8: c2 06 20 10 ld [ %i0 + 0x10 ], %g1 4000a2dc: 80 88 61 00 btst 0x100, %g1 4000a2e0: 32 80 00 06 bne,a 4000a2f8 <== ALWAYS TAKEN 4000a2e4: c2 06 20 28 ld [ %i0 + 0x28 ], %g1 4000a2e8: 40 00 08 d4 call 4000c638 <__errno> 4000a2ec: 01 00 00 00 nop 4000a2f0: 10 80 00 32 b 4000a3b8 4000a2f4: 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 ) { 4000a2f8: 80 a6 60 0b cmp %i1, 0xb 4000a2fc: 18 80 00 2c bgu 4000a3ac 4000a300: c2 00 60 2c ld [ %g1 + 0x2c ], %g1 4000a304: b3 2e 60 02 sll %i1, 2, %i1 4000a308: 05 10 00 28 sethi %hi(0x4000a000), %g2 4000a30c: 84 10 a2 78 or %g2, 0x278, %g2 ! 4000a278 <_close_r+0x10> 4000a310: c4 00 80 19 ld [ %g2 + %i1 ], %g2 4000a314: 81 c0 80 00 jmp %g2 4000a318: 01 00 00 00 nop case _PC_LINK_MAX: return_value = the_limits->link_max; 4000a31c: f0 00 40 00 ld [ %g1 ], %i0 break; 4000a320: 81 c7 e0 08 ret 4000a324: 81 e8 00 00 restore case _PC_MAX_CANON: return_value = the_limits->max_canon; 4000a328: f0 00 60 04 ld [ %g1 + 4 ], %i0 break; 4000a32c: 81 c7 e0 08 ret 4000a330: 81 e8 00 00 restore case _PC_MAX_INPUT: return_value = the_limits->max_input; 4000a334: f0 00 60 08 ld [ %g1 + 8 ], %i0 break; 4000a338: 81 c7 e0 08 ret 4000a33c: 81 e8 00 00 restore case _PC_NAME_MAX: return_value = the_limits->name_max; 4000a340: f0 00 60 0c ld [ %g1 + 0xc ], %i0 break; 4000a344: 81 c7 e0 08 ret 4000a348: 81 e8 00 00 restore case _PC_PATH_MAX: return_value = the_limits->path_max; 4000a34c: f0 00 60 10 ld [ %g1 + 0x10 ], %i0 break; 4000a350: 81 c7 e0 08 ret 4000a354: 81 e8 00 00 restore case _PC_PIPE_BUF: return_value = the_limits->pipe_buf; 4000a358: f0 00 60 14 ld [ %g1 + 0x14 ], %i0 break; 4000a35c: 81 c7 e0 08 ret 4000a360: 81 e8 00 00 restore case _PC_CHOWN_RESTRICTED: return_value = the_limits->posix_chown_restrictions; 4000a364: f0 00 60 1c ld [ %g1 + 0x1c ], %i0 break; 4000a368: 81 c7 e0 08 ret 4000a36c: 81 e8 00 00 restore case _PC_NO_TRUNC: return_value = the_limits->posix_no_trunc; 4000a370: f0 00 60 20 ld [ %g1 + 0x20 ], %i0 break; 4000a374: 81 c7 e0 08 ret 4000a378: 81 e8 00 00 restore case _PC_VDISABLE: return_value = the_limits->posix_vdisable; 4000a37c: f0 00 60 2c ld [ %g1 + 0x2c ], %i0 break; 4000a380: 81 c7 e0 08 ret 4000a384: 81 e8 00 00 restore case _PC_ASYNC_IO: return_value = the_limits->posix_async_io; 4000a388: f0 00 60 18 ld [ %g1 + 0x18 ], %i0 break; 4000a38c: 81 c7 e0 08 ret 4000a390: 81 e8 00 00 restore case _PC_PRIO_IO: return_value = the_limits->posix_prio_io; 4000a394: f0 00 60 24 ld [ %g1 + 0x24 ], %i0 break; 4000a398: 81 c7 e0 08 ret 4000a39c: 81 e8 00 00 restore case _PC_SYNC_IO: return_value = the_limits->posix_sync_io; 4000a3a0: f0 00 60 28 ld [ %g1 + 0x28 ], %i0 break; 4000a3a4: 81 c7 e0 08 ret 4000a3a8: 81 e8 00 00 restore default: rtems_set_errno_and_return_minus_one( EINVAL ); 4000a3ac: 40 00 08 a3 call 4000c638 <__errno> 4000a3b0: 01 00 00 00 nop 4000a3b4: 82 10 20 16 mov 0x16, %g1 ! 16 4000a3b8: c2 22 00 00 st %g1, [ %o0 ] break; } return return_value; } 4000a3bc: 81 c7 e0 08 ret 4000a3c0: 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 7c sethi %hi(0x4001f000), %g1 4000402c: 82 10 63 00 or %g1, 0x300, %g1 ! 4001f300 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 7e sethi %hi(0x4001f800), %g1 4000404c: c2 00 61 88 ld [ %g1 + 0x188 ], %g1 ! 4001f988 <_System_state_Current> 40004050: 80 a0 60 03 cmp %g1, 3 40004054: 12 80 00 09 bne 40004078 <== NEVER TAKEN 40004058: 03 10 00 7b sethi %hi(0x4001ec00), %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 7b sethi %hi(0x4001ec00), %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 62 60 ld [ %g1 + 0x260 ], %g1 4000407c: 80 a0 60 00 cmp %g1, 0 40004080: 02 80 00 06 be 40004098 40004084: 3b 10 00 79 sethi %hi(0x4001e400), %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 79 sethi %hi(0x4001e400), %i5 40004098: d0 07 63 30 ld [ %i5 + 0x330 ], %o0 ! 4001e730 4000409c: 40 00 17 1e call 40009d14 <_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 63 30 ld [ %i5 + 0x330 ], %g1 printk( "Program heap: free of bad pointer %p -- range %p - %p \n", 400040b0: 31 10 00 74 sethi %hi(0x4001d000), %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 20 e8 restore %i0, 0xe8, %o0 400040c4: 81 c7 e0 08 ret 400040c8: 81 e8 00 00 restore =============================================================================== 4001b974 : int fstat( int fd, struct stat *sbuf ) { 4001b974: 9d e3 bf a0 save %sp, -96, %sp rtems_libio_t *iop; /* * Check to see if we were passed a valid pointer. */ if ( !sbuf ) 4001b978: 80 a6 60 00 cmp %i1, 0 4001b97c: 32 80 00 06 bne,a 4001b994 <== ALWAYS TAKEN 4001b980: 03 10 00 79 sethi %hi(0x4001e400), %g1 rtems_set_errno_and_return_minus_one( EFAULT ); 4001b984: 7f ff d0 58 call 4000fae4 <__errno> <== NOT EXECUTED 4001b988: 01 00 00 00 nop <== NOT EXECUTED 4001b98c: 10 80 00 12 b 4001b9d4 <== NOT EXECUTED 4001b990: 82 10 20 0e mov 0xe, %g1 ! e <== NOT EXECUTED /* * Now process the stat() request. */ iop = rtems_libio_iop( fd ); 4001b994: c2 00 63 74 ld [ %g1 + 0x374 ], %g1 4001b998: 80 a6 00 01 cmp %i0, %g1 4001b99c: 1a 80 00 0b bcc 4001b9c8 4001b9a0: 83 2e 20 03 sll %i0, 3, %g1 4001b9a4: b1 2e 20 06 sll %i0, 6, %i0 4001b9a8: b0 26 00 01 sub %i0, %g1, %i0 4001b9ac: 03 10 00 7c sethi %hi(0x4001f000), %g1 4001b9b0: c2 00 62 f4 ld [ %g1 + 0x2f4 ], %g1 ! 4001f2f4 4001b9b4: b0 00 40 18 add %g1, %i0, %i0 rtems_libio_check_fd( fd ); rtems_libio_check_is_open(iop); 4001b9b8: c2 06 20 10 ld [ %i0 + 0x10 ], %g1 4001b9bc: 80 88 61 00 btst 0x100, %g1 4001b9c0: 12 80 00 08 bne 4001b9e0 4001b9c4: 94 10 20 48 mov 0x48, %o2 /* * Now process the stat() request. */ iop = rtems_libio_iop( fd ); rtems_libio_check_fd( fd ); 4001b9c8: 7f ff d0 47 call 4000fae4 <__errno> 4001b9cc: 01 00 00 00 nop 4001b9d0: 82 10 20 09 mov 9, %g1 ! 9 4001b9d4: c2 22 00 00 st %g1, [ %o0 ] 4001b9d8: 81 c7 e0 08 ret 4001b9dc: 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) ); 4001b9e0: 90 10 00 19 mov %i1, %o0 4001b9e4: 7f ff d2 ce call 4001051c 4001b9e8: 92 10 20 00 clr %o1 return (*iop->pathinfo.handlers->fstat_h)( &iop->pathinfo, sbuf ); 4001b9ec: c2 06 20 24 ld [ %i0 + 0x24 ], %g1 4001b9f0: 90 06 20 14 add %i0, 0x14, %o0 4001b9f4: c2 00 60 18 ld [ %g1 + 0x18 ], %g1 4001b9f8: 9f c0 40 00 call %g1 4001b9fc: 92 10 00 19 mov %i1, %o1 } 4001ba00: 81 c7 e0 08 ret 4001ba04: 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 6c sethi %hi(0x4001b000), %g1 40004078: c2 00 63 10 ld [ %g1 + 0x310 ], %g1 ! 4001b310 4000407c: 80 a2 00 01 cmp %o0, %g1 40004080: 1a 80 00 1e bcc 400040f8 <== NEVER TAKEN 40004084: 03 10 00 6c sethi %hi(0x4001b000), %g1 40004088: c2 00 63 14 ld [ %g1 + 0x314 ], %g1 ! 4001b314 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 =============================================================================== 400319fc : int getdents( int dd_fd, char *dd_buf, int dd_len ) { 400319fc: 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 ); 40031a00: 03 10 00 de sethi %hi(0x40037800), %g1 40031a04: c2 00 61 fc ld [ %g1 + 0x1fc ], %g1 ! 400379fc 40031a08: 80 a6 00 01 cmp %i0, %g1 40031a0c: 1a 80 00 08 bcc 40031a2c <== NEVER TAKEN 40031a10: ba 10 20 00 clr %i5 40031a14: 83 2e 20 03 sll %i0, 3, %g1 40031a18: b1 2e 20 06 sll %i0, 6, %i0 40031a1c: b0 26 00 01 sub %i0, %g1, %i0 40031a20: 03 10 01 21 sethi %hi(0x40048400), %g1 40031a24: fa 00 62 e4 ld [ %g1 + 0x2e4 ], %i5 ! 400486e4 40031a28: ba 07 40 18 add %i5, %i0, %i5 /* * Make sure we are working on a directory */ type = rtems_filesystem_node_type( &iop->pathinfo ); 40031a2c: 7f ff 63 08 call 4000a64c 40031a30: 90 07 60 14 add %i5, 0x14, %o0 if ( type != RTEMS_FILESYSTEM_DIRECTORY ) 40031a34: 80 a2 20 00 cmp %o0, 0 40031a38: 22 80 00 08 be,a 40031a58 40031a3c: c2 07 60 24 ld [ %i5 + 0x24 ], %g1 rtems_set_errno_and_return_minus_one( ENOTDIR ); 40031a40: 7f ff bd df call 400211bc <__errno> 40031a44: b0 10 3f ff mov -1, %i0 40031a48: 82 10 20 14 mov 0x14, %g1 40031a4c: c2 22 00 00 st %g1, [ %o0 ] 40031a50: 81 c7 e0 08 ret 40031a54: 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 ); 40031a58: 90 10 00 1d mov %i5, %o0 40031a5c: c2 00 60 08 ld [ %g1 + 8 ], %g1 40031a60: 92 10 00 19 mov %i1, %o1 40031a64: 9f c0 40 00 call %g1 40031a68: 94 10 00 1a mov %i2, %o2 } 40031a6c: 81 c7 e0 08 ret 40031a70: 91 e8 00 08 restore %g0, %o0, %o0 =============================================================================== 400248a4 : /** * Initialize useable but dummy databases */ void init_etc_passwd_group(void) { 400248a4: 9d e3 bf a0 save %sp, -96, %sp FILE *fp; static char etc_passwd_initted = 0; if (etc_passwd_initted) 400248a8: 03 10 01 8e sethi %hi(0x40063800), %g1 400248ac: c4 48 63 40 ldsb [ %g1 + 0x340 ], %g2 ! 40063b40 400248b0: 80 a0 a0 00 cmp %g2, 0 400248b4: 12 80 00 2f bne 40024970 400248b8: 84 10 20 01 mov 1, %g2 return; etc_passwd_initted = 1; mkdir("/etc", 0777); 400248bc: 92 10 21 ff mov 0x1ff, %o1 FILE *fp; static char etc_passwd_initted = 0; if (etc_passwd_initted) return; etc_passwd_initted = 1; 400248c0: c4 28 63 40 stb %g2, [ %g1 + 0x340 ] mkdir("/etc", 0777); 400248c4: 11 10 01 6c sethi %hi(0x4005b000), %o0 400248c8: 7f ff 7d b1 call 40003f8c 400248cc: 90 12 21 28 or %o0, 0x128, %o0 ! 4005b128 /* * Initialize /etc/passwd */ if ((fp = fopen("/etc/passwd", "r")) != NULL) { 400248d0: 3b 10 01 6c sethi %hi(0x4005b000), %i5 400248d4: 13 10 01 7e sethi %hi(0x4005f800), %o1 400248d8: 90 17 61 30 or %i5, 0x130, %o0 400248dc: 40 00 4d 1f call 40037d58 400248e0: 92 12 60 40 or %o1, 0x40, %o1 400248e4: 80 a2 20 00 cmp %o0, 0 400248e8: 22 80 00 03 be,a 400248f4 400248ec: 90 17 61 30 or %i5, 0x130, %o0 400248f0: 30 80 00 0b b,a 4002491c fclose(fp); } else if ((fp = fopen("/etc/passwd", "w")) != NULL) { 400248f4: 13 10 01 62 sethi %hi(0x40058800), %o1 400248f8: 40 00 4d 18 call 40037d58 400248fc: 92 12 63 f8 or %o1, 0x3f8, %o1 ! 40058bf8 40024900: ba 92 20 00 orcc %o0, 0, %i5 40024904: 02 80 00 08 be 40024924 <== NEVER TAKEN 40024908: 11 10 01 6c sethi %hi(0x4005b000), %o0 fprintf(fp, "root:*:0:0:root::/:/bin/sh\n" 4002490c: 92 10 00 1d mov %i5, %o1 40024910: 40 00 4d 75 call 40037ee4 40024914: 90 12 21 40 or %o0, 0x140, %o0 "rtems:*:1:1:RTEMS Application::/:/bin/sh\n" "tty:!:2:2:tty owner::/:/bin/false\n" ); fclose(fp); 40024918: 90 10 00 1d mov %i5, %o0 4002491c: 40 00 4a b1 call 400373e0 40024920: 01 00 00 00 nop } /* * Initialize /etc/group */ if ((fp = fopen("/etc/group", "r")) != NULL) { 40024924: 3b 10 01 6c sethi %hi(0x4005b000), %i5 40024928: 13 10 01 7e sethi %hi(0x4005f800), %o1 4002492c: 90 17 61 a8 or %i5, 0x1a8, %o0 40024930: 40 00 4d 0a call 40037d58 40024934: 92 12 60 40 or %o1, 0x40, %o1 40024938: b0 92 20 00 orcc %o0, 0, %i0 4002493c: 12 80 00 0b bne 40024968 40024940: 90 17 61 a8 or %i5, 0x1a8, %o0 fclose(fp); } else if ((fp = fopen("/etc/group", "w")) != NULL) { 40024944: 13 10 01 62 sethi %hi(0x40058800), %o1 40024948: 40 00 4d 04 call 40037d58 4002494c: 92 12 63 f8 or %o1, 0x3f8, %o1 ! 40058bf8 40024950: b0 92 20 00 orcc %o0, 0, %i0 40024954: 02 80 00 07 be 40024970 <== NEVER TAKEN 40024958: 11 10 01 6c sethi %hi(0x4005b000), %o0 fprintf( fp, "root:x:0:root\n" 4002495c: 92 10 00 18 mov %i0, %o1 40024960: 40 00 4d 61 call 40037ee4 40024964: 90 12 21 b8 or %o0, 0x1b8, %o0 "rtems:x:1:rtems\n" "tty:x:2:tty\n" ); fclose(fp); 40024968: 40 00 4a 9e call 400373e0 4002496c: 81 e8 00 00 restore 40024970: 81 c7 e0 08 ret 40024974: 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 7a sethi %hi(0x4001e800), %g2 40006ad0: c4 00 a1 30 ld [ %g2 + 0x130 ], %g2 ! 4001e930 <__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 79 sethi %hi(0x4001e400), %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 79 sethi %hi(0x4001e400), %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 79 sethi %hi(0x4001e400), %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 63 b8 ld [ %g1 + 0x3b8 ], %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 =============================================================================== 4001bdac : int killinfo( pid_t pid, int sig, const union sigval *value ) { 4001bdac: 9d e3 bf 90 save %sp, -112, %sp POSIX_signals_Siginfo_node *psiginfo; /* * Only supported for the "calling process" (i.e. this node). */ if ( pid != getpid() ) 4001bdb0: 7f ff ff 1b call 4001ba1c 4001bdb4: 01 00 00 00 nop 4001bdb8: 80 a6 00 08 cmp %i0, %o0 4001bdbc: 02 80 00 06 be 4001bdd4 4001bdc0: 80 a6 60 00 cmp %i1, 0 rtems_set_errno_and_return_minus_one( ESRCH ); 4001bdc4: 7f ff cf 48 call 4000fae4 <__errno> 4001bdc8: 01 00 00 00 nop 4001bdcc: 10 80 00 a6 b 4001c064 4001bdd0: 82 10 20 03 mov 3, %g1 ! 3 /* * Validate the signal passed. */ if ( !sig ) 4001bdd4: 32 80 00 03 bne,a 4001bde0 4001bdd8: ba 06 7f ff add %i1, -1, %i5 4001bddc: 30 80 00 04 b,a 4001bdec rtems_set_errno_and_return_minus_one( EINVAL ); if ( !is_valid_signo(sig) ) 4001bde0: 80 a7 60 1f cmp %i5, 0x1f 4001bde4: 28 80 00 06 bleu,a 4001bdfc 4001bde8: 83 2e 60 02 sll %i1, 2, %g1 rtems_set_errno_and_return_minus_one( EINVAL ); 4001bdec: 7f ff cf 3e call 4000fae4 <__errno> 4001bdf0: 01 00 00 00 nop 4001bdf4: 10 80 00 9c b 4001c064 4001bdf8: 82 10 20 16 mov 0x16, %g1 ! 16 /* * If the signal is being ignored, then we are out of here. */ if ( _POSIX_signals_Vectors[ sig ].sa_handler == SIG_IGN ) 4001bdfc: 85 2e 60 04 sll %i1, 4, %g2 4001be00: 84 20 80 01 sub %g2, %g1, %g2 4001be04: 03 10 00 7e sethi %hi(0x4001f800), %g1 4001be08: 82 10 61 f0 or %g1, 0x1f0, %g1 ! 4001f9f0 <_POSIX_signals_Vectors> 4001be0c: 82 00 40 02 add %g1, %g2, %g1 4001be10: c2 00 60 08 ld [ %g1 + 8 ], %g1 4001be14: 80 a0 60 01 cmp %g1, 1 4001be18: 02 80 00 9f be 4001c094 4001be1c: 80 a6 60 04 cmp %i1, 4 /* * P1003.1c/Draft 10, p. 33 says that certain signals should always * be directed to the executing thread such as those caused by hardware * faults. */ if ( (sig == SIGFPE) || (sig == SIGILL) || (sig == SIGSEGV ) ) 4001be20: 02 80 00 06 be 4001be38 4001be24: 80 a6 60 08 cmp %i1, 8 4001be28: 02 80 00 04 be 4001be38 4001be2c: 80 a6 60 0b cmp %i1, 0xb 4001be30: 12 80 00 08 bne 4001be50 4001be34: 82 10 20 01 mov 1, %g1 return pthread_kill( pthread_self(), sig ); 4001be38: 40 00 01 33 call 4001c304 4001be3c: 01 00 00 00 nop 4001be40: 40 00 00 f4 call 4001c210 4001be44: 92 10 00 19 mov %i1, %o1 4001be48: 81 c7 e0 08 ret 4001be4c: 91 e8 00 08 restore %g0, %o0, %o0 /* * Build up a siginfo structure */ siginfo = &siginfo_struct; siginfo->si_signo = sig; 4001be50: f2 27 bf f4 st %i1, [ %fp + -12 ] siginfo->si_code = SI_USER; 4001be54: c2 27 bf f8 st %g1, [ %fp + -8 ] if ( !value ) { 4001be58: 80 a6 a0 00 cmp %i2, 0 4001be5c: 12 80 00 04 bne 4001be6c 4001be60: bb 28 40 1d sll %g1, %i5, %i5 siginfo->si_value.sival_int = 0; 4001be64: 10 80 00 04 b 4001be74 4001be68: c0 27 bf fc clr [ %fp + -4 ] } else { siginfo->si_value = *value; 4001be6c: c2 06 80 00 ld [ %i2 ], %g1 4001be70: c2 27 bf fc st %g1, [ %fp + -4 ] * * This rountine increments the thread dispatch level */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_increment_disable_level(void) { uint32_t level = _Thread_Dispatch_disable_level; 4001be74: 03 10 00 7d sethi %hi(0x4001f400), %g1 4001be78: c4 00 60 80 ld [ %g1 + 0x80 ], %g2 ! 4001f480 <_Thread_Dispatch_disable_level> ++level; 4001be7c: 84 00 a0 01 inc %g2 _Thread_Dispatch_disable_level = level; 4001be80: c4 20 60 80 st %g2, [ %g1 + 0x80 ] */ void _POSIX_signals_Manager_Initialization(void); static inline void _POSIX_signals_Add_post_switch_extension(void) { _API_extensions_Add_post_switch( &_POSIX_signals_Post_switch ); 4001be84: 11 10 00 7a sethi %hi(0x4001e800), %o0 4001be88: 7f ff b2 bb call 40008974 <_API_extensions_Add_post_switch> 4001be8c: 90 12 20 7c or %o0, 0x7c, %o0 ! 4001e87c <_POSIX_signals_Post_switch> /* * Is the currently executing thread interested? If so then it will * get it an execute it as soon as the dispatcher executes. */ the_thread = _Thread_Executing; 4001be90: 03 10 00 7e sethi %hi(0x4001f800), %g1 4001be94: d0 00 61 a0 ld [ %g1 + 0x1a0 ], %o0 ! 4001f9a0 <_Per_CPU_Information+0x10> api = the_thread->API_Extensions[ THREAD_API_POSIX ]; if ( _POSIX_signals_Is_interested( api, mask ) ) { 4001be98: c4 02 21 50 ld [ %o0 + 0x150 ], %g2 4001be9c: c4 00 a0 d0 ld [ %g2 + 0xd0 ], %g2 4001bea0: 80 af 40 02 andncc %i5, %g2, %g0 4001bea4: 12 80 00 52 bne 4001bfec 4001bea8: 03 10 00 7e sethi %hi(0x4001f800), %g1 /* XXX violation of visibility -- need to define thread queue support */ the_chain = &_POSIX_signals_Wait_queue.Queues.Fifo; for ( the_node = _Chain_First( the_chain ); 4001beac: 05 10 00 7e sethi %hi(0x4001f800), %g2 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_First( Chain_Control *the_chain ) { return _Chain_Head( the_chain )->next; 4001beb0: c2 00 63 7c ld [ %g1 + 0x37c ], %g1 4001beb4: 10 80 00 0a b 4001bedc 4001beb8: 84 10 a3 80 or %g2, 0x380, %g2 #endif /* * Is this thread is actually blocked waiting for the signal? */ if (the_thread->Wait.option & mask) 4001bebc: 80 8f 40 04 btst %i5, %g4 4001bec0: 12 80 00 4a bne 4001bfe8 4001bec4: c6 00 61 50 ld [ %g1 + 0x150 ], %g3 /* * Is this thread is blocked waiting for another signal but has * not blocked this one? */ if (~api->signals_blocked & mask) 4001bec8: c6 00 e0 d0 ld [ %g3 + 0xd0 ], %g3 4001becc: 80 af 40 03 andncc %i5, %g3, %g0 4001bed0: 12 80 00 47 bne 4001bfec 4001bed4: 90 10 00 01 mov %g1, %o0 the_chain = &_POSIX_signals_Wait_queue.Queues.Fifo; for ( the_node = _Chain_First( the_chain ); !_Chain_Is_tail( the_chain, the_node ) ; the_node = the_node->next ) { 4001bed8: c2 00 40 00 ld [ %g1 ], %g1 /* XXX violation of visibility -- need to define thread queue support */ the_chain = &_POSIX_signals_Wait_queue.Queues.Fifo; for ( the_node = _Chain_First( the_chain ); 4001bedc: 80 a0 40 02 cmp %g1, %g2 4001bee0: 32 bf ff f7 bne,a 4001bebc 4001bee4: c8 00 60 30 ld [ %g1 + 0x30 ], %g4 * NOTES: * * + rtems internal threads do not receive signals. */ interested = NULL; interested_priority = PRIORITY_MAXIMUM + 1; 4001bee8: 03 10 00 79 sethi %hi(0x4001e400), %g1 4001beec: c6 08 62 ac ldub [ %g1 + 0x2ac ], %g3 ! 4001e6ac for (the_api = OBJECTS_CLASSIC_API; the_api <= OBJECTS_APIS_LAST; the_api++) { 4001bef0: b8 10 20 02 mov 2, %i4 * NOTES: * * + rtems internal threads do not receive signals. */ interested = NULL; interested_priority = PRIORITY_MAXIMUM + 1; 4001bef4: 86 00 e0 01 inc %g3 * * NOTES: * * + rtems internal threads do not receive signals. */ interested = NULL; 4001bef8: 82 10 20 00 clr %g1 for (the_api = OBJECTS_CLASSIC_API; the_api <= OBJECTS_APIS_LAST; the_api++) { /* * This can occur when no one is interested and an API is not configured. */ if ( !_Objects_Information_table[ the_api ] ) 4001befc: 1b 10 00 7c sethi %hi(0x4001f000), %o5 */ RTEMS_INLINE_ROUTINE bool _States_Is_interruptible_by_signal ( States_Control the_states ) { return (the_states & STATES_INTERRUPTIBLE_BY_SIGNAL); 4001bf00: 35 04 00 00 sethi %hi(0x10000000), %i2 */ #define _POSIX_signals_Is_interested( _api, _mask ) \ ( ~(_api)->signals_blocked & (_mask) ) int killinfo( 4001bf04: 85 2f 20 02 sll %i4, 2, %g2 for (the_api = OBJECTS_CLASSIC_API; the_api <= OBJECTS_APIS_LAST; the_api++) { /* * This can occur when no one is interested and an API is not configured. */ if ( !_Objects_Information_table[ the_api ] ) 4001bf08: 88 13 63 e4 or %o5, 0x3e4, %g4 4001bf0c: c4 01 00 02 ld [ %g4 + %g2 ], %g2 4001bf10: 80 a0 a0 00 cmp %g2, 0 4001bf14: 22 80 00 2f be,a 4001bfd0 <== NEVER TAKEN 4001bf18: b8 07 20 01 inc %i4 <== NOT EXECUTED continue; the_info = _Objects_Information_table[ the_api ][ 1 ]; 4001bf1c: c4 00 a0 04 ld [ %g2 + 4 ], %g2 #endif maximum = the_info->maximum; object_table = the_info->local_table; for ( index = 1 ; index <= maximum ; index++ ) { 4001bf20: b6 10 20 01 mov 1, %i3 */ if ( !the_info ) continue; #endif maximum = the_info->maximum; 4001bf24: d8 10 a0 10 lduh [ %g2 + 0x10 ], %o4 object_table = the_info->local_table; for ( index = 1 ; index <= maximum ; index++ ) { 4001bf28: 10 80 00 26 b 4001bfc0 4001bf2c: d6 00 a0 1c ld [ %g2 + 0x1c ], %o3 the_thread = (Thread_Control *) object_table[ index ]; 4001bf30: c4 02 c0 02 ld [ %o3 + %g2 ], %g2 if ( !the_thread ) 4001bf34: 80 a0 a0 00 cmp %g2, 0 4001bf38: 22 80 00 22 be,a 4001bfc0 4001bf3c: b6 06 e0 01 inc %i3 /* * If this thread is of lower priority than the interested thread, * go on to the next thread. */ if ( the_thread->current_priority > interested_priority ) 4001bf40: c8 00 a0 14 ld [ %g2 + 0x14 ], %g4 4001bf44: 80 a1 00 03 cmp %g4, %g3 4001bf48: 38 80 00 1e bgu,a 4001bfc0 4001bf4c: b6 06 e0 01 inc %i3 #if defined(RTEMS_DEBUG) if ( !api ) continue; #endif if ( !_POSIX_signals_Is_interested( api, mask ) ) 4001bf50: f0 00 a1 50 ld [ %g2 + 0x150 ], %i0 4001bf54: f0 06 20 d0 ld [ %i0 + 0xd0 ], %i0 4001bf58: 80 af 40 18 andncc %i5, %i0, %g0 4001bf5c: 22 80 00 19 be,a 4001bfc0 4001bf60: b6 06 e0 01 inc %i3 * * NOTE: We initialized interested_priority to PRIORITY_MAXIMUM + 1 * so we never have to worry about deferencing a NULL * interested thread. */ if ( the_thread->current_priority < interested_priority ) { 4001bf64: 80 a1 00 03 cmp %g4, %g3 4001bf68: 2a 80 00 14 bcs,a 4001bfb8 4001bf6c: 86 10 00 04 mov %g4, %g3 * and blocking interruptibutable by signal. * * If the interested thread is ready, don't think about changing. */ if ( interested && !_States_Is_ready( interested->current_state ) ) { 4001bf70: 80 a0 60 00 cmp %g1, 0 4001bf74: 22 80 00 13 be,a 4001bfc0 <== NEVER TAKEN 4001bf78: b6 06 e0 01 inc %i3 <== NOT EXECUTED 4001bf7c: de 00 60 10 ld [ %g1 + 0x10 ], %o7 4001bf80: 80 a3 e0 00 cmp %o7, 0 4001bf84: 22 80 00 0f be,a 4001bfc0 <== NEVER TAKEN 4001bf88: b6 06 e0 01 inc %i3 <== NOT EXECUTED /* preferred ready over blocked */ DEBUG_STEP("5"); if ( _States_Is_ready( the_thread->current_state ) ) { 4001bf8c: f0 00 a0 10 ld [ %g2 + 0x10 ], %i0 4001bf90: 80 a6 20 00 cmp %i0, 0 4001bf94: 22 80 00 09 be,a 4001bfb8 4001bf98: 86 10 00 04 mov %g4, %g3 continue; } DEBUG_STEP("6"); /* prefer blocked/interruptible over blocked/not interruptible */ if ( !_States_Is_interruptible_by_signal(interested->current_state) ) { 4001bf9c: 80 8b c0 1a btst %o7, %i2 4001bfa0: 32 80 00 08 bne,a 4001bfc0 4001bfa4: b6 06 e0 01 inc %i3 DEBUG_STEP("7"); if ( _States_Is_interruptible_by_signal(the_thread->current_state) ) { 4001bfa8: 80 8e 00 1a btst %i0, %i2 4001bfac: 22 80 00 05 be,a 4001bfc0 4001bfb0: b6 06 e0 01 inc %i3 */ if ( interested && !_States_Is_ready( interested->current_state ) ) { /* preferred ready over blocked */ DEBUG_STEP("5"); if ( _States_Is_ready( the_thread->current_state ) ) { 4001bfb4: 86 10 00 04 mov %g4, %g3 4001bfb8: 82 10 00 02 mov %g2, %g1 #endif maximum = the_info->maximum; object_table = the_info->local_table; for ( index = 1 ; index <= maximum ; index++ ) { 4001bfbc: b6 06 e0 01 inc %i3 4001bfc0: 80 a6 c0 0c cmp %i3, %o4 4001bfc4: 08 bf ff db bleu 4001bf30 4001bfc8: 85 2e e0 02 sll %i3, 2, %g2 * + rtems internal threads do not receive signals. */ interested = NULL; interested_priority = PRIORITY_MAXIMUM + 1; for (the_api = OBJECTS_CLASSIC_API; the_api <= OBJECTS_APIS_LAST; the_api++) { 4001bfcc: b8 07 20 01 inc %i4 4001bfd0: 80 a7 20 04 cmp %i4, 4 4001bfd4: 12 bf ff cd bne 4001bf08 4001bfd8: 85 2f 20 02 sll %i4, 2, %g2 } } } } if ( interested ) { 4001bfdc: 80 a0 60 00 cmp %g1, 0 4001bfe0: 02 80 00 0c be 4001c010 4001bfe4: 01 00 00 00 nop /* * Is this thread is blocked waiting for another signal but has * not blocked this one? */ if (~api->signals_blocked & mask) 4001bfe8: 90 10 00 01 mov %g1, %o0 /* * Returns true if the signal was synchronously given to a thread * blocked waiting for the signal. */ if ( _POSIX_signals_Unblock_thread( the_thread, sig, siginfo ) ) { 4001bfec: 92 10 00 19 mov %i1, %o1 4001bff0: 40 00 00 36 call 4001c0c8 <_POSIX_signals_Unblock_thread> 4001bff4: 94 07 bf f4 add %fp, -12, %o2 4001bff8: 80 8a 20 ff btst 0xff, %o0 4001bffc: 02 80 00 05 be 4001c010 4001c000: 01 00 00 00 nop _Thread_Enable_dispatch(); 4001c004: 7f ff ba 25 call 4000a898 <_Thread_Enable_dispatch> 4001c008: b0 10 20 00 clr %i0 ! 0 4001c00c: 30 80 00 23 b,a 4001c098 /* * We may have woken up a thread but we definitely need to post the * signal to the process wide information set. */ _POSIX_signals_Set_process_signals( mask ); 4001c010: 40 00 00 24 call 4001c0a0 <_POSIX_signals_Set_process_signals> 4001c014: 90 10 00 1d mov %i5, %o0 if ( _POSIX_signals_Vectors[ sig ].sa_flags == SA_SIGINFO ) { 4001c018: 83 2e 60 02 sll %i1, 2, %g1 4001c01c: b3 2e 60 04 sll %i1, 4, %i1 4001c020: b2 26 40 01 sub %i1, %g1, %i1 4001c024: 03 10 00 7e sethi %hi(0x4001f800), %g1 4001c028: 82 10 61 f0 or %g1, 0x1f0, %g1 ! 4001f9f0 <_POSIX_signals_Vectors> 4001c02c: c2 00 40 19 ld [ %g1 + %i1 ], %g1 4001c030: 80 a0 60 02 cmp %g1, 2 4001c034: 12 bf ff f4 bne 4001c004 4001c038: 11 10 00 7e sethi %hi(0x4001f800), %o0 psiginfo = (POSIX_signals_Siginfo_node *) 4001c03c: 7f ff b2 b3 call 40008b08 <_Chain_Get> 4001c040: 90 12 23 70 or %o0, 0x370, %o0 ! 4001fb70 <_POSIX_signals_Inactive_siginfo> _Chain_Get( &_POSIX_signals_Inactive_siginfo ); if ( !psiginfo ) { 4001c044: ba 92 20 00 orcc %o0, 0, %i5 4001c048: 12 80 00 0a bne 4001c070 4001c04c: 92 07 bf f4 add %fp, -12, %o1 _Thread_Enable_dispatch(); 4001c050: 7f ff ba 12 call 4000a898 <_Thread_Enable_dispatch> 4001c054: 01 00 00 00 nop rtems_set_errno_and_return_minus_one( EAGAIN ); 4001c058: 7f ff ce a3 call 4000fae4 <__errno> 4001c05c: 01 00 00 00 nop 4001c060: 82 10 20 0b mov 0xb, %g1 ! b 4001c064: c2 22 00 00 st %g1, [ %o0 ] 4001c068: 81 c7 e0 08 ret 4001c06c: 91 e8 3f ff restore %g0, -1, %o0 } psiginfo->Info = *siginfo; 4001c070: 90 07 60 08 add %i5, 8, %o0 4001c074: 7f ff d0 ed call 40010428 4001c078: 94 10 20 0c mov 0xc, %o2 _Chain_Append( &_POSIX_signals_Siginfo[ sig ], &psiginfo->Node ); 4001c07c: 11 10 00 7e sethi %hi(0x4001f800), %o0 4001c080: 92 10 00 1d mov %i5, %o1 4001c084: 90 12 23 e8 or %o0, 0x3e8, %o0 4001c088: 7f ff b2 94 call 40008ad8 <_Chain_Append> 4001c08c: 90 02 00 19 add %o0, %i1, %o0 4001c090: 30 bf ff dd b,a 4001c004 /* * If the signal is being ignored, then we are out of here. */ if ( _POSIX_signals_Vectors[ sig ].sa_handler == SIG_IGN ) return 0; 4001c094: b0 10 20 00 clr %i0 } DEBUG_STEP("\n"); _Thread_Enable_dispatch(); return 0; } 4001c098: 81 c7 e0 08 ret 4001c09c: 81 e8 00 00 restore =============================================================================== 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 7e sethi %hi(0x4001f800), %g1 400048ac: c2 00 61 88 ld [ %g1 + 0x188 ], %g1 ! 4001f988 <_System_state_Current> 400048b0: 80 a0 60 03 cmp %g1, 3 400048b4: 12 80 00 16 bne 4000490c <== NEVER TAKEN 400048b8: 03 10 00 77 sethi %hi(0x4001dc00), %g1 /* * This was already done if the user called exit() directly . _wrapup_reent(0); */ if (_REENT != _global_impure_ptr) { 400048bc: 39 10 00 7a sethi %hi(0x4001e800), %i4 400048c0: fa 00 60 78 ld [ %g1 + 0x78 ], %i5 400048c4: c2 07 21 38 ld [ %i4 + 0x138 ], %g1 400048c8: 80 a0 40 1d cmp %g1, %i5 400048cc: 22 80 00 06 be,a 400048e4 400048d0: 3b 10 00 7a sethi %hi(0x4001e800), %i5 _wrapup_reent(_global_impure_ptr); 400048d4: 40 00 2f b3 call 400107a0 <_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 21 38 st %i5, [ %i4 + 0x138 ] * * Should this be changed to do *all* file streams? * _fwalk (_REENT, fclose); */ fclose (stdin); 400048e0: 3b 10 00 7a sethi %hi(0x4001e800), %i5 400048e4: c2 07 61 38 ld [ %i5 + 0x138 ], %g1 ! 4001e938 <_impure_ptr> 400048e8: 40 00 2c d1 call 4000fc2c 400048ec: d0 00 60 04 ld [ %g1 + 4 ], %o0 fclose (stdout); 400048f0: c2 07 61 38 ld [ %i5 + 0x138 ], %g1 400048f4: 40 00 2c ce call 4000fc2c 400048f8: d0 00 60 08 ld [ %g1 + 8 ], %o0 fclose (stderr); 400048fc: c2 07 61 38 ld [ %i5 + 0x138 ], %g1 40004900: f0 00 60 0c ld [ %g1 + 0xc ], %i0 40004904: 40 00 2c ca call 4000fc2c 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 7c sethi %hi(0x4001f000), %g1 4000437c: 82 10 63 00 or %g1, 0x300, %g1 ! 4001f300 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 7e sethi %hi(0x4001f800), %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 88 ld [ %g1 + 0x188 ], %g1 400043a8: 80 a0 60 03 cmp %g1, 3 400043ac: 02 80 00 0c be 400043dc 400043b0: 39 10 00 79 sethi %hi(0x4001e400), %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 23 30 ld [ %i4 + 0x330 ], %o0 ! 4001e730 400043b8: 92 10 00 18 mov %i0, %o1 400043bc: 94 10 20 00 clr %o2 400043c0: 40 00 16 47 call 40009cdc <_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 7b sethi %hi(0x4001ec00), %g1 return_this = (*rtems_malloc_extend_handler)( RTEMS_Malloc_Heap, size ); 400043d4: 10 80 00 09 b 400043f8 400043d8: d0 07 23 30 ld [ %i4 + 0x330 ], %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 72 sethi %hi(0x4001c800), %g1 400043fc: c2 00 60 20 ld [ %g1 + 0x20 ], %g1 ! 4001c820 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 7b sethi %hi(0x4001ec00), %g1 errno = ENOMEM; 40004414: 40 00 2d b4 call 4000fae4 <__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 62 5c ld [ %g1 + 0x25c ], %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 7b sethi %hi(0x4001ec00), %g1 40004448: c2 00 62 60 ld [ %g1 + 0x260 ], %g1 ! 4001ee60 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 =============================================================================== 4000e23c : * Allocate a block for an in-memory file. */ int memfile_blocks_allocated = 0; void *memfile_alloc_block(void) { 4000e23c: 9d e3 bf a0 save %sp, -96, %sp void *memory; memory = (void *)calloc(1, IMFS_MEMFILE_BYTES_PER_BLOCK); 4000e240: 03 10 00 7b sethi %hi(0x4001ec00), %g1 4000e244: d2 00 62 f8 ld [ %g1 + 0x2f8 ], %o1 ! 4001eef8 4000e248: 7f ff d6 c4 call 40003d58 4000e24c: 90 10 20 01 mov 1, %o0 if ( memory ) 4000e250: b0 92 20 00 orcc %o0, 0, %i0 4000e254: 02 80 00 05 be 4000e268 <== NEVER TAKEN 4000e258: 03 10 00 7c sethi %hi(0x4001f000), %g1 memfile_blocks_allocated++; 4000e25c: c4 00 60 0c ld [ %g1 + 0xc ], %g2 ! 4001f00c 4000e260: 84 00 a0 01 inc %g2 4000e264: c4 20 60 0c st %g2, [ %g1 + 0xc ] return memory; } 4000e268: 81 c7 e0 08 ret 4000e26c: 81 e8 00 00 restore =============================================================================== 4000ed64 : int memfile_ftruncate( rtems_libio_t *iop, off_t length ) { 4000ed64: 9d e3 bf 98 save %sp, -104, %sp <== NOT EXECUTED IMFS_jnode_t *the_jnode; the_jnode = iop->pathinfo.node_access; 4000ed68: 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 ) 4000ed6c: c2 07 60 50 ld [ %i5 + 0x50 ], %g1 <== NOT EXECUTED 4000ed70: 80 a0 40 19 cmp %g1, %i1 <== NOT EXECUTED 4000ed74: 06 80 00 09 bl 4000ed98 <== NOT EXECUTED 4000ed78: 90 10 00 1d mov %i5, %o0 <== NOT EXECUTED 4000ed7c: 32 80 00 0d bne,a 4000edb0 <== NOT EXECUTED 4000ed80: f2 27 60 50 st %i1, [ %i5 + 0x50 ] <== NOT EXECUTED 4000ed84: c2 07 60 54 ld [ %i5 + 0x54 ], %g1 <== NOT EXECUTED 4000ed88: 80 a0 40 1a cmp %g1, %i2 <== NOT EXECUTED 4000ed8c: 3a 80 00 09 bcc,a 4000edb0 <== NOT EXECUTED 4000ed90: f2 27 60 50 st %i1, [ %i5 + 0x50 ] <== NOT EXECUTED return IMFS_memfile_extend( the_jnode, true, length ); 4000ed94: 90 10 00 1d mov %i5, %o0 <== NOT EXECUTED 4000ed98: 92 10 20 01 mov 1, %o1 <== NOT EXECUTED 4000ed9c: 94 10 00 19 mov %i1, %o2 <== NOT EXECUTED 4000eda0: 7f ff fe df call 4000e91c <== NOT EXECUTED 4000eda4: 96 10 00 1a mov %i2, %o3 <== NOT EXECUTED 4000eda8: 81 c7 e0 08 ret <== NOT EXECUTED 4000edac: 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; 4000edb0: f4 27 60 54 st %i2, [ %i5 + 0x54 ] <== NOT EXECUTED IMFS_update_atime( the_jnode ); 4000edb4: 90 07 bf f8 add %fp, -8, %o0 <== NOT EXECUTED 4000edb8: 7f ff d4 c5 call 400040cc <== NOT EXECUTED 4000edbc: 92 10 20 00 clr %o1 <== NOT EXECUTED 4000edc0: c2 07 bf f8 ld [ %fp + -8 ], %g1 <== NOT EXECUTED 4000edc4: c2 27 60 40 st %g1, [ %i5 + 0x40 ] <== NOT EXECUTED return 0; } 4000edc8: 81 c7 e0 08 ret <== NOT EXECUTED 4000edcc: 91 e8 20 00 restore %g0, 0, %o0 <== NOT EXECUTED =============================================================================== 4000ece8 : rtems_libio_t *iop, const char *pathname, int oflag, mode_t mode ) { 4000ece8: 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) 4000ecec: c2 06 20 10 ld [ %i0 + 0x10 ], %g1 4000ecf0: 80 88 60 04 btst 4, %g1 4000ecf4: 12 80 00 04 bne 4000ed04 4000ecf8: d0 06 20 1c ld [ %i0 + 0x1c ], %o0 if ((count != 0) && (IMFS_memfile_write(the_jnode, 0, buffer, count) == -1)) return -1; } return 0; 4000ecfc: 81 c7 e0 08 ret 4000ed00: 91 e8 20 00 restore %g0, 0, %o0 4000ed04: 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)) { 4000ed08: c2 00 40 00 ld [ %g1 ], %g1 4000ed0c: 80 a0 60 05 cmp %g1, 5 4000ed10: 12 bf ff fb bne 4000ecfc <== ALWAYS TAKEN 4000ed14: 03 10 00 75 sethi %hi(0x4001d400), %g1 uint32_t count = the_jnode->info.linearfile.size; 4000ed18: d8 02 20 54 ld [ %o0 + 0x54 ], %o4 <== NOT EXECUTED const unsigned char *buffer = the_jnode->info.linearfile.direct; 4000ed1c: d6 02 20 58 ld [ %o0 + 0x58 ], %o3 <== NOT EXECUTED the_jnode->control = &IMFS_node_control_memfile; the_jnode->info.file.size = 0; 4000ed20: 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; 4000ed24: 82 10 62 a4 or %g1, 0x2a4, %g1 <== NOT EXECUTED the_jnode->info.file.size = 0; 4000ed28: 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; 4000ed2c: c2 22 20 4c st %g1, [ %o0 + 0x4c ] <== NOT EXECUTED the_jnode->info.file.size = 0; the_jnode->info.file.indirect = 0; 4000ed30: c0 22 20 58 clr [ %o0 + 0x58 ] <== NOT EXECUTED the_jnode->info.file.doubly_indirect = 0; 4000ed34: c0 22 20 5c clr [ %o0 + 0x5c ] <== NOT EXECUTED the_jnode->info.file.triply_indirect = 0; if ((count != 0) 4000ed38: 80 a3 20 00 cmp %o4, 0 <== NOT EXECUTED 4000ed3c: 02 bf ff f0 be 4000ecfc <== NOT EXECUTED 4000ed40: c0 22 20 60 clr [ %o0 + 0x60 ] <== NOT EXECUTED && (IMFS_memfile_write(the_jnode, 0, buffer, count) == -1)) 4000ed44: 92 10 20 00 clr %o1 <== NOT EXECUTED 4000ed48: 7f ff ff 5d call 4000eabc <== NOT EXECUTED 4000ed4c: 94 10 20 00 clr %o2 <== NOT EXECUTED return -1; 4000ed50: 90 38 00 08 xnor %g0, %o0, %o0 <== NOT EXECUTED 4000ed54: 80 a0 00 08 cmp %g0, %o0 <== NOT EXECUTED 4000ed58: b0 40 3f ff addx %g0, -1, %i0 <== NOT EXECUTED } return 0; } 4000ed5c: 81 c7 e0 08 ret <== NOT EXECUTED 4000ed60: 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 d1 call 4000c8e4 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 74 sethi %hi(0x4001d000), %l1 400045c0: a2 14 61 20 or %l1, 0x120, %l1 ! 4001d120 size_t filesystemtype_size = strlen( filesystemtype ) + 1; 400045c4: 40 00 32 cf call 40011100 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 32 c9 call 40011100 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 32 c3 call 40011100 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 2f 81 call 40010428 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 2f 78 call 40010428 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 2f 72 call 40010428 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 74 sethi %hi(0x4001d000), %g1 40004674: 82 10 61 24 or %g1, 0x124, %g1 ! 4001d124 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 2a call 40008b44 <_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 7c sethi %hi(0x4001f000), %i4 40004734: d0 07 22 fc ld [ %i4 + 0x2fc ], %o0 ! 4001f2fc 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 79 sethi %hi(0x4001e400), %g1 } static inline void rtems_libio_unlock( void ) { rtems_semaphore_release( rtems_libio_semaphore ); 40004744: d0 07 22 fc ld [ %i4 + 0x2fc ], %o0 40004748: 82 10 63 a0 or %g1, 0x3a0, %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 7c sethi %hi(0x4001f000), %g1 400047a8: d0 00 62 fc ld [ %g1 + 0x2fc ], %o0 ! 4001f2fc 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 79 sethi %hi(0x4001e400), %g2 ) { int rv = 0; rtems_filesystem_mt_lock(); if ( rtems_chain_is_empty( &rtems_filesystem_mount_table ) ) { 400047bc: c6 00 a3 a0 ld [ %g2 + 0x3a0 ], %g3 ! 4001e7a0 400047c0: 82 10 a3 a0 or %g2, 0x3a0, %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 2c be call 4000fae4 <__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 7c sethi %hi(0x4001f000), %g1 40004800: 40 00 0e 43 call 4000810c 40004804: d0 00 62 fc ld [ %g1 + 0x2fc ], %o0 ! 4001f2fc 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 79 sethi %hi(0x4001e400), %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 63 c0 ld [ %i5 + 0x3c0 ], %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 63 c0 ld [ %i5 + 0x3c0 ], %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 2c 9f call 4000fae4 <__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 2c 97 call 4000fae4 <__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 60 65 call 400211bc <__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 =============================================================================== 40017b14 : msdos_node_type_t type, const char *name, int name_len, mode_t mode, const fat_file_fd_t *link_fd) { 40017b14: 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; 40017b18: 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); 40017b1c: 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; 40017b20: 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; 40017b24: 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); 40017b28: 94 10 20 20 mov 0x20, %o2 40017b2c: c2 27 bf 78 st %g1, [ %fp + -136 ] dir_pos->lname.ofs = FAT_FILE_SHORT_NAME; 40017b30: 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; 40017b34: e0 06 20 08 ld [ %i0 + 8 ], %l0 fat_file_fd_t *fat_fd = NULL; 40017b38: c0 27 bf 6c clr [ %fp + -148 ] time_t time_ret = 0; uint16_t time_val = 0; 40017b3c: c0 37 bf 68 clrh [ %fp + -152 ] uint16_t date = 0; 40017b40: 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; 40017b44: c0 27 bf 70 clr [ %fp + -144 ] dir_pos->sname.ofs = 0; 40017b48: 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); 40017b4c: 40 00 12 60 call 4001c4cc 40017b50: 90 07 bf 80 add %fp, -128, %o0 memset(dot_dotdot, 0, MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE * 2); 40017b54: 90 07 bf c0 add %fp, -64, %o0 40017b58: 92 10 20 00 clr %o1 40017b5c: 40 00 12 5c call 4001c4cc 40017b60: 94 10 20 40 mov 0x40, %o2 if (name_len > MSDOS_NAME_MAX_LFN_WITH_DOT) { 40017b64: 80 a6 e1 04 cmp %i3, 0x104 40017b68: 24 80 00 06 ble,a 40017b80 <== ALWAYS TAKEN 40017b6c: 90 10 00 1a mov %i2, %o0 rtems_set_errno_and_return_minus_one(ENAMETOOLONG); 40017b70: 40 00 0f 75 call 4001b944 <__errno> <== NOT EXECUTED 40017b74: 01 00 00 00 nop <== NOT EXECUTED 40017b78: 10 80 00 0c b 40017ba8 <== NOT EXECUTED 40017b7c: 82 10 20 5b mov 0x5b, %g1 ! 5b <== NOT EXECUTED } name_type = msdos_long_to_short (name, name_len, 40017b80: 92 10 00 1b mov %i3, %o1 40017b84: 94 07 bf 80 add %fp, -128, %o2 40017b88: 40 00 01 45 call 4001809c 40017b8c: 96 10 20 0b mov 0xb, %o3 MSDOS_DIR_NAME(short_node), MSDOS_NAME_MAX); if (name_type == MSDOS_NAME_INVALID) { 40017b90: a4 92 20 00 orcc %o0, 0, %l2 40017b94: 32 80 00 08 bne,a 40017bb4 <== ALWAYS TAKEN 40017b98: c0 2f bf 8c clrb [ %fp + -116 ] rtems_set_errno_and_return_minus_one(EINVAL); 40017b9c: 40 00 0f 6a call 4001b944 <__errno> <== NOT EXECUTED 40017ba0: 01 00 00 00 nop <== NOT EXECUTED 40017ba4: 82 10 20 16 mov 0x16, %g1 ! 16 <== NOT EXECUTED 40017ba8: c2 22 00 00 st %g1, [ %o0 ] <== NOT EXECUTED 40017bac: 10 80 00 ce b 40017ee4 <== NOT EXECUTED 40017bb0: 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); 40017bb4: 40 00 21 09 call 4001ffd8