=============================================================================== ffc06e90 : */ static void IMFS_dump_directory( IMFS_jnode_t *the_directory, int level ) { ffc06e90: 94 21 ff c0 stwu r1,-64(r1) ffc06e94: 7c 08 02 a6 mflr r0 ffc06e98: 7d 80 00 26 mfcr r12 ffc06e9c: 90 01 00 44 stw r0,68(r1) ffc06ea0: 93 61 00 2c stw r27,44(r1) */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_First( Chain_Control *the_chain ) { return _Chain_Head( the_chain )->next; ffc06ea4: 83 63 00 50 lwz r27,80(r3) ffc06ea8: 93 41 00 28 stw r26,40(r1) 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 )); ffc06eac: 3b 43 00 54 addi r26,r3,84 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 ); ffc06eb0: 7f 9b d0 00 cmpw cr7,r27,r26 */ static void IMFS_dump_directory( IMFS_jnode_t *the_directory, int level ) { ffc06eb4: 92 81 00 10 stw r20,16(r1) ffc06eb8: 92 a1 00 14 stw r21,20(r1) ffc06ebc: 92 c1 00 18 stw r22,24(r1) ffc06ec0: 92 e1 00 1c stw r23,28(r1) ffc06ec4: 93 01 00 20 stw r24,32(r1) ffc06ec8: 93 21 00 24 stw r25,36(r1) ffc06ecc: 93 81 00 30 stw r28,48(r1) ffc06ed0: 93 a1 00 34 stw r29,52(r1) ffc06ed4: 93 c1 00 38 stw r30,56(r1) ffc06ed8: 93 e1 00 3c stw r31,60(r1) ffc06edc: 91 81 00 0c stw r12,12(r1) 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 ); ffc06ee0: 41 9e 00 c4 beq- cr7,ffc06fa4 ffc06ee4: 2e 04 00 00 cmpwi cr4,r4,0 ffc06ee8: 3f c0 00 00 lis r30,0 ffc06eec: 3f 80 ff c2 lis r28,-62 case IMFS_FIFO: fprintf(stdout, " FIFO not printed\n" ); return; default: fprintf(stdout, " bad type %d\n", IMFS_type( the_jnode ) ); ffc06ef0: 3e 80 ff c2 lis r20,-62 return; } puts(""); ffc06ef4: 3f 20 ff c2 lis r25,-62 case IMFS_SYM_LINK: fprintf(stdout, " links not printed\n" ); return; case IMFS_FIFO: fprintf(stdout, " FIFO not printed\n" ); ffc06ef8: 3e a0 ff c2 lis r21,-62 case IMFS_HARD_LINK: fprintf(stdout, " links not printed\n" ); return; case IMFS_SYM_LINK: fprintf(stdout, " links not printed\n" ); ffc06efc: 3e e0 ff c2 lis r23,-62 the_jnode->info.file.indirect, the_jnode->info.file.doubly_indirect, the_jnode->info.file.triply_indirect ); #else fprintf(stdout, " (file %" PRId32 ")", ffc06f00: 3e c0 ff c2 lis r22,-62 ffc06f04: 7c 9d 23 78 mr r29,r4 ffc06f08: 3b de 27 f0 addi r30,r30,10224 ffc06f0c: 3b 9c 62 80 addi r28,r28,25216 case IMFS_FIFO: fprintf(stdout, " FIFO not printed\n" ); return; default: fprintf(stdout, " bad type %d\n", IMFS_type( the_jnode ) ); ffc06f10: 3a 94 62 e0 addi r20,r20,25312 ) { IMFS_assert( the_jnode ); fprintf(stdout, "%s", the_jnode->name ); switch( IMFS_type( the_jnode ) ) { ffc06f14: 3f 00 ff c2 lis r24,-62 default: fprintf(stdout, " bad type %d\n", IMFS_type( the_jnode ) ); return; } puts(""); ffc06f18: 3b 39 54 f0 addi r25,r25,21744 case IMFS_SYM_LINK: fprintf(stdout, " links not printed\n" ); return; case IMFS_FIFO: fprintf(stdout, " FIFO not printed\n" ); ffc06f1c: 3a b5 62 cc addi r21,r21,25292 case IMFS_HARD_LINK: fprintf(stdout, " links not printed\n" ); return; case IMFS_SYM_LINK: fprintf(stdout, " links not printed\n" ); ffc06f20: 3a f7 62 b8 addi r23,r23,25272 the_jnode->info.file.indirect, the_jnode->info.file.doubly_indirect, the_jnode->info.file.triply_indirect ); #else fprintf(stdout, " (file %" PRId32 ")", ffc06f24: 3a d6 62 ac addi r22,r22,25260 !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++ ) ffc06f28: 41 90 00 2c blt- cr4,ffc06f54 <== NEVER TAKEN ffc06f2c: 3b e0 00 00 li r31,0 fprintf(stdout, "...." ); ffc06f30: 81 3e 00 00 lwz r9,0(r30) ffc06f34: 7f 83 e3 78 mr r3,r28 ffc06f38: 38 80 00 01 li r4,1 ffc06f3c: 80 c9 00 08 lwz r6,8(r9) ffc06f40: 38 a0 00 04 li r5,4 !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++ ) ffc06f44: 3b ff 00 01 addi r31,r31,1 fprintf(stdout, "...." ); ffc06f48: 48 01 0f a1 bl ffc17ee8 !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++ ) ffc06f4c: 7f 9d f8 00 cmpw cr7,r29,r31 ffc06f50: 40 9c ff e0 bge+ cr7,ffc06f30 IMFS_jnode_t *the_jnode ) { IMFS_assert( the_jnode ); fprintf(stdout, "%s", the_jnode->name ); ffc06f54: 81 3e 00 00 lwz r9,0(r30) ffc06f58: 38 7b 00 0c addi r3,r27,12 ffc06f5c: 80 89 00 08 lwz r4,8(r9) ffc06f60: 48 01 01 29 bl ffc17088 rtems_chain_extract_unprotected( &node->Node ); } static inline IMFS_jnode_types_t IMFS_type( const IMFS_jnode_t *node ) { return node->control->imfs_type; ffc06f64: 81 3b 00 4c lwz r9,76(r27) ffc06f68: 80 a9 00 00 lwz r5,0(r9) switch( IMFS_type( the_jnode ) ) { ffc06f6c: 2b 85 00 06 cmplwi cr7,r5,6 ffc06f70: 40 9d 00 7c ble- cr7,ffc06fec <== ALWAYS TAKEN case IMFS_FIFO: fprintf(stdout, " FIFO not printed\n" ); return; default: fprintf(stdout, " bad type %d\n", IMFS_type( the_jnode ) ); ffc06f74: 81 3e 00 00 lwz r9,0(r30) <== NOT EXECUTED ffc06f78: 7e 84 a3 78 mr r4,r20 <== NOT EXECUTED ffc06f7c: 80 69 00 08 lwz r3,8(r9) <== NOT EXECUTED ffc06f80: 4c c6 31 82 crclr 4*cr1+eq <== NOT EXECUTED ffc06f84: 48 00 ff 09 bl ffc16e8c <== NOT EXECUTED } static inline bool IMFS_is_directory( const IMFS_jnode_t *node ) { return node->control->imfs_type == IMFS_DIRECTORY; ffc06f88: 81 3b 00 4c lwz r9,76(r27) 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 ) ) ffc06f8c: 81 29 00 00 lwz r9,0(r9) ffc06f90: 2f 89 00 00 cmpwi cr7,r9,0 ffc06f94: 41 9e 00 98 beq- cr7,ffc0702c 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 ) { ffc06f98: 83 7b 00 00 lwz r27,0(r27) 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 ); ffc06f9c: 7f 9b d0 00 cmpw cr7,r27,r26 ffc06fa0: 40 9e ff 88 bne+ cr7,ffc06f28 fprintf(stdout, "...." ); IMFS_print_jnode( the_jnode ); if ( IMFS_is_directory( the_jnode ) ) IMFS_dump_directory( the_jnode, level + 1 ); } } ffc06fa4: 80 01 00 44 lwz r0,68(r1) ffc06fa8: 81 81 00 0c lwz r12,12(r1) ffc06fac: 7c 08 03 a6 mtlr r0 ffc06fb0: 82 81 00 10 lwz r20,16(r1) ffc06fb4: 82 a1 00 14 lwz r21,20(r1) ffc06fb8: 7d 80 81 20 mtcrf 8,r12 ffc06fbc: 82 c1 00 18 lwz r22,24(r1) ffc06fc0: 82 e1 00 1c lwz r23,28(r1) ffc06fc4: 83 01 00 20 lwz r24,32(r1) ffc06fc8: 83 21 00 24 lwz r25,36(r1) ffc06fcc: 83 41 00 28 lwz r26,40(r1) ffc06fd0: 83 61 00 2c lwz r27,44(r1) ffc06fd4: 83 81 00 30 lwz r28,48(r1) ffc06fd8: 83 a1 00 34 lwz r29,52(r1) ffc06fdc: 83 c1 00 38 lwz r30,56(r1) ffc06fe0: 83 e1 00 3c lwz r31,60(r1) ffc06fe4: 38 21 00 40 addi r1,r1,64 ffc06fe8: 4e 80 00 20 blr ) { IMFS_assert( the_jnode ); fprintf(stdout, "%s", the_jnode->name ); switch( IMFS_type( the_jnode ) ) { ffc06fec: 39 38 62 64 addi r9,r24,25188 ffc06ff0: 54 a5 10 3a rlwinm r5,r5,2,0,29 ffc06ff4: 7d 49 28 2e lwzx r10,r9,r5 ffc06ff8: 7d 2a 4a 14 add r9,r10,r9 ffc06ffc: 7d 29 03 a6 mtctr r9 case IMFS_SYM_LINK: fprintf(stdout, " links not printed\n" ); return; case IMFS_FIFO: fprintf(stdout, " FIFO not printed\n" ); ffc07000: 81 3e 00 00 lwz r9,0(r30) ) { IMFS_assert( the_jnode ); fprintf(stdout, "%s", the_jnode->name ); switch( IMFS_type( the_jnode ) ) { ffc07004: 4e 80 04 20 bctr case IMFS_HARD_LINK: fprintf(stdout, " links not printed\n" ); return; case IMFS_SYM_LINK: fprintf(stdout, " links not printed\n" ); ffc07008: 80 c9 00 08 lwz r6,8(r9) ffc0700c: 7e e3 bb 78 mr r3,r23 ffc07010: 38 80 00 01 li r4,1 ffc07014: 38 a0 00 13 li r5,19 ffc07018: 48 01 0e d1 bl ffc17ee8 ffc0701c: 81 3b 00 4c lwz r9,76(r27) 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 ) ) ffc07020: 81 29 00 00 lwz r9,0(r9) ffc07024: 2f 89 00 00 cmpwi cr7,r9,0 ffc07028: 40 9e ff 70 bne+ cr7,ffc06f98 <== ALWAYS TAKEN IMFS_dump_directory( the_jnode, level + 1 ); ffc0702c: 7f 63 db 78 mr r3,r27 ffc07030: 38 9d 00 01 addi r4,r29,1 ffc07034: 4b ff fe 5d bl ffc06e90 ffc07038: 4b ff ff 60 b ffc06f98 fprintf(stdout, " (device %" PRId32 ", %" PRId32 ")", the_jnode->info.device.major, the_jnode->info.device.minor ); break; case IMFS_LINEAR_FILE: fprintf(stdout, " (file %" PRId32 " %p)", ffc0703c: 3c 80 ff c2 lis r4,-62 ffc07040: 80 69 00 08 lwz r3,8(r9) ffc07044: 80 bb 00 54 lwz r5,84(r27) ffc07048: 38 84 62 9c addi r4,r4,25244 ffc0704c: 80 db 00 58 lwz r6,88(r27) ffc07050: 4c c6 31 82 crclr 4*cr1+eq ffc07054: 48 00 fe 39 bl ffc16e8c default: fprintf(stdout, " bad type %d\n", IMFS_type( the_jnode ) ); return; } puts(""); ffc07058: 7f 23 cb 78 mr r3,r25 ffc0705c: 48 01 21 01 bl ffc1915c ffc07060: 4b ff ff 28 b ffc06f88 case IMFS_DIRECTORY: fprintf(stdout, "/" ); break; case IMFS_DEVICE: fprintf(stdout, " (device %" PRId32 ", %" PRId32 ")", ffc07064: 80 69 00 08 lwz r3,8(r9) ffc07068: 3c 80 ff c2 lis r4,-62 ffc0706c: 80 bb 00 50 lwz r5,80(r27) ffc07070: 38 84 62 88 addi r4,r4,25224 ffc07074: 80 db 00 54 lwz r6,84(r27) ffc07078: 4c c6 31 82 crclr 4*cr1+eq ffc0707c: 48 00 fe 11 bl ffc16e8c ffc07080: 4b ff ff d8 b ffc07058 IMFS_assert( the_jnode ); fprintf(stdout, "%s", the_jnode->name ); switch( IMFS_type( the_jnode ) ) { case IMFS_DIRECTORY: fprintf(stdout, "/" ); ffc07084: 80 89 00 08 lwz r4,8(r9) ffc07088: 38 60 00 2f li r3,47 ffc0708c: 48 00 fe e5 bl ffc16f70 ffc07090: 4b ff ff c8 b ffc07058 case IMFS_SYM_LINK: fprintf(stdout, " links not printed\n" ); return; case IMFS_FIFO: fprintf(stdout, " FIFO not printed\n" ); ffc07094: 80 c9 00 08 lwz r6,8(r9) ffc07098: 7e a3 ab 78 mr r3,r21 ffc0709c: 38 80 00 01 li r4,1 ffc070a0: 38 a0 00 12 li r5,18 ffc070a4: 48 01 0e 45 bl ffc17ee8 ffc070a8: 4b ff fe e0 b ffc06f88 the_jnode->info.file.indirect, the_jnode->info.file.doubly_indirect, the_jnode->info.file.triply_indirect ); #else fprintf(stdout, " (file %" PRId32 ")", ffc070ac: 80 bb 00 54 lwz r5,84(r27) ffc070b0: 7e c4 b3 78 mr r4,r22 ffc070b4: 80 69 00 08 lwz r3,8(r9) ffc070b8: 4c c6 31 82 crclr 4*cr1+eq ffc070bc: 48 00 fd d1 bl ffc16e8c ffc070c0: 4b ff ff 98 b ffc07058 =============================================================================== ffc0e2dc : rtems_filesystem_eval_path_context_t *ctx, void *arg, const char *token, size_t tokenlen ) { ffc0e2dc: 94 21 ff e0 stwu r1,-32(r1) ffc0e2e0: 7c 08 02 a6 mflr r0 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; bool access_ok = rtems_filesystem_eval_path_check_access( ffc0e2e4: 38 80 00 01 li r4,1 rtems_filesystem_eval_path_context_t *ctx, void *arg, const char *token, size_t tokenlen ) { ffc0e2e8: 90 01 00 24 stw r0,36(r1) ffc0e2ec: 93 a1 00 14 stw r29,20(r1) 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; ffc0e2f0: 83 a3 00 20 lwz r29,32(r3) rtems_filesystem_eval_path_context_t *ctx, void *arg, const char *token, size_t tokenlen ) { ffc0e2f4: 93 61 00 0c stw r27,12(r1) ffc0e2f8: 7c bb 2b 78 mr r27,r5 ffc0e2fc: 93 c1 00 18 stw r30,24(r1) ffc0e300: 7c de 33 78 mr r30,r6 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; bool access_ok = rtems_filesystem_eval_path_check_access( ffc0e304: 80 bd 00 30 lwz r5,48(r29) ffc0e308: a0 dd 00 3c lhz r6,60(r29) ffc0e30c: a0 fd 00 3e lhz r7,62(r29) rtems_filesystem_eval_path_context_t *ctx, void *arg, const char *token, size_t tokenlen ) { ffc0e310: 93 81 00 10 stw r28,16(r1) ffc0e314: 7c 7c 1b 78 mr r28,r3 ffc0e318: 93 41 00 08 stw r26,8(r1) ffc0e31c: 93 e1 00 1c stw r31,28(r1) 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; bool access_ok = rtems_filesystem_eval_path_check_access( ffc0e320: 48 00 0f ad bl ffc0f2cc dir->st_mode, dir->st_uid, dir->st_gid ); if ( access_ok ) { ffc0e324: 2f 83 00 00 cmpwi cr7,r3,0 ffc0e328: 40 9e 00 30 bne- cr7,ffc0e358 void *arg, const char *token, size_t tokenlen ) { rtems_filesystem_eval_path_generic_status status = ffc0e32c: 38 60 00 01 li r3,1 status = RTEMS_FILESYSTEM_EVAL_PATH_GENERIC_NO_ENTRY; } } return status; } ffc0e330: 80 01 00 24 lwz r0,36(r1) ffc0e334: 83 41 00 08 lwz r26,8(r1) ffc0e338: 7c 08 03 a6 mtlr r0 ffc0e33c: 83 61 00 0c lwz r27,12(r1) ffc0e340: 83 81 00 10 lwz r28,16(r1) ffc0e344: 83 a1 00 14 lwz r29,20(r1) ffc0e348: 83 c1 00 18 lwz r30,24(r1) ffc0e34c: 83 e1 00 1c lwz r31,28(r1) ffc0e350: 38 21 00 20 addi r1,r1,32 ffc0e354: 4e 80 00 20 blr static inline bool rtems_filesystem_is_current_directory( const char *token, size_t tokenlen ) { return tokenlen == 1 && token [0] == '.'; ffc0e358: 2f 9e 00 01 cmpwi cr7,r30,1 ffc0e35c: 41 9e 01 5c beq- cr7,ffc0e4b8 static inline bool rtems_filesystem_is_parent_directory( const char *token, size_t tokenlen ) { return tokenlen == 2 && token [0] == '.' && token [1] == '.'; ffc0e360: 2f 9e 00 02 cmpwi cr7,r30,2 ffc0e364: 41 9e 00 c8 beq- cr7,ffc0e42c */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_First( Chain_Control *the_chain ) { return _Chain_Head( the_chain )->next; ffc0e368: 83 fd 00 50 lwz r31,80(r29) if ( rtems_filesystem_is_parent_directory( token, tokenlen ) ) { return dir->Parent; } 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 ); ffc0e36c: 3b 5d 00 54 addi r26,r29,84 while ( current != tail ) { ffc0e370: 7f 9f d0 00 cmpw cr7,r31,r26 ffc0e374: 41 9e 00 b0 beq- cr7,ffc0e424 IMFS_jnode_t *entry = (IMFS_jnode_t *) current; bool match = strncmp( entry->name, token, tokenlen ) == 0 ffc0e378: 38 7f 00 0c addi r3,r31,12 ffc0e37c: 7f 64 db 78 mr r4,r27 ffc0e380: 7f c5 f3 78 mr r5,r30 ffc0e384: 48 00 55 e5 bl ffc13968 && entry->name [tokenlen] == '\0'; ffc0e388: 7d 3f f2 14 add r9,r31,r30 ffc0e38c: 2f 83 00 00 cmpwi cr7,r3,0 ffc0e390: 40 9e 00 88 bne- cr7,ffc0e418 ffc0e394: 89 29 00 0c lbz r9,12(r9) ffc0e398: 2f 89 00 00 cmpwi cr7,r9,0 ffc0e39c: 40 9e 00 7c bne- cr7,ffc0e418 rtems_chain_extract_unprotected( &node->Node ); } static inline IMFS_jnode_types_t IMFS_type( const IMFS_jnode_t *node ) { return node->control->imfs_type; ffc0e3a0: 81 3f 00 4c lwz r9,76(r31) static inline void rtems_filesystem_eval_path_clear_token( rtems_filesystem_eval_path_context_t *ctx ) { ctx->tokenlen = 0; ffc0e3a4: 39 40 00 00 li r10,0 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 ); ffc0e3a8: 80 7c 00 04 lwz r3,4(r28) ffc0e3ac: 81 29 00 00 lwz r9,0(r9) ffc0e3b0: 7c 63 00 34 cntlzw r3,r3 }; void IMFS_eval_path( rtems_filesystem_eval_path_context_t *ctx ) { rtems_filesystem_eval_path_generic( ctx, NULL, &IMFS_eval_config ); } ffc0e3b4: 81 1c 00 10 lwz r8,16(r28) 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)) { ffc0e3b8: 2f 89 00 02 cmpwi cr7,r9,2 ffc0e3bc: 91 5c 00 0c stw r10,12(r28) 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 ); ffc0e3c0: 54 63 d9 7e rlwinm r3,r3,27,5,31 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)) { ffc0e3c4: 41 9e 01 08 beq- cr7,ffc0e4cc entry = entry->info.hard_link.link_node; } if ( type == IMFS_SYM_LINK && (follow_sym_link || !terminal)) { ffc0e3c8: 2f 89 00 03 cmpwi cr7,r9,3 ffc0e3cc: 41 9e 00 8c beq- cr7,ffc0e458 IMFS_jnode_types_t type ) { rtems_filesystem_global_location_t **fs_root_ptr = NULL; if ( type == IMFS_DIRECTORY ) { ffc0e3d0: 2f 89 00 00 cmpwi cr7,r9,0 ffc0e3d4: 40 9e 00 94 bne- cr7,ffc0e468 if ( node->info.directory.mt_fs != NULL ) { ffc0e3d8: 83 df 00 5c lwz r30,92(r31) ffc0e3dc: 2f 9e 00 00 cmpwi cr7,r30,0 ffc0e3e0: 41 9e 00 88 beq- cr7,ffc0e468 if ( !terminal ) { status = RTEMS_FILESYSTEM_EVAL_PATH_GENERIC_CONTINUE; } } else { access_ok = rtems_filesystem_eval_path_check_access( ffc0e3e4: 80 bf 00 30 lwz r5,48(r31) ffc0e3e8: 7f 83 e3 78 mr r3,r28 ffc0e3ec: a0 df 00 3c lhz r6,60(r31) ffc0e3f0: 38 80 00 01 li r4,1 ffc0e3f4: a0 ff 00 3e lhz r7,62(r31) ffc0e3f8: 48 00 0e d5 bl ffc0f2cc RTEMS_FS_PERMS_EXEC, entry->st_mode, entry->st_uid, entry->st_gid ); if ( access_ok ) { ffc0e3fc: 2f 83 00 00 cmpwi cr7,r3,0 ffc0e400: 41 9e ff 2c beq+ cr7,ffc0e32c <== NEVER TAKEN rtems_filesystem_eval_path_restart( ctx, fs_root_ptr ); ffc0e404: 7f 83 e3 78 mr r3,r28 ffc0e408: 38 9e 00 24 addi r4,r30,36 ffc0e40c: 4b ff 7f d1 bl ffc063dc void *arg, const char *token, size_t tokenlen ) { rtems_filesystem_eval_path_generic_status status = ffc0e410: 38 60 00 01 li r3,1 ffc0e414: 4b ff ff 1c b ffc0e330 }; void IMFS_eval_path( rtems_filesystem_eval_path_context_t *ctx ) { rtems_filesystem_eval_path_generic( ctx, NULL, &IMFS_eval_config ); } ffc0e418: 83 ff 00 00 lwz r31,0(r31) } 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 ) { ffc0e41c: 7f 9a f8 00 cmpw cr7,r26,r31 ffc0e420: 40 9e ff 58 bne+ cr7,ffc0e378 rtems_filesystem_eval_path_restart( ctx, fs_root_ptr ); } } } } else { status = RTEMS_FILESYSTEM_EVAL_PATH_GENERIC_NO_ENTRY; ffc0e424: 38 60 00 02 li r3,2 ffc0e428: 4b ff ff 08 b ffc0e330 static inline bool rtems_filesystem_is_parent_directory( const char *token, size_t tokenlen ) { return tokenlen == 2 && token [0] == '.' && token [1] == '.'; ffc0e42c: 89 3b 00 00 lbz r9,0(r27) ffc0e430: 2f 89 00 2e cmpwi cr7,r9,46 ffc0e434: 40 9e ff 34 bne+ cr7,ffc0e368 ffc0e438: 89 3b 00 01 lbz r9,1(r27) ffc0e43c: 2f 89 00 2e cmpwi cr7,r9,46 ffc0e440: 40 9e ff 28 bne+ cr7,ffc0e368 <== NEVER TAKEN { if ( rtems_filesystem_is_current_directory( token, tokenlen ) ) { return dir; } else { if ( rtems_filesystem_is_parent_directory( token, tokenlen ) ) { return dir->Parent; ffc0e444: 83 fd 00 08 lwz r31,8(r29) ); if ( access_ok ) { IMFS_jnode_t *entry = IMFS_search_in_directory( dir, token, tokenlen ); if ( entry != NULL ) { ffc0e448: 2f 9f 00 00 cmpwi cr7,r31,0 ffc0e44c: 40 be ff 54 bne- cr7,ffc0e3a0 rtems_filesystem_eval_path_restart( ctx, fs_root_ptr ); } } } } else { status = RTEMS_FILESYSTEM_EVAL_PATH_GENERIC_NO_ENTRY; ffc0e450: 38 60 00 02 li r3,2 ffc0e454: 4b ff fe dc b ffc0e330 if ( type == IMFS_HARD_LINK && (follow_hard_link || !terminal)) { entry = entry->info.hard_link.link_node; } if ( type == IMFS_SYM_LINK && (follow_sym_link || !terminal)) { ffc0e458: 71 09 00 10 andi. r9,r8,16 ffc0e45c: 40 82 00 90 bne- ffc0e4ec ffc0e460: 2f 83 00 00 cmpwi cr7,r3,0 ffc0e464: 41 9e 00 88 beq- cr7,ffc0e4ec } else { rtems_filesystem_global_location_t **fs_root_ptr = IMFS_is_mount_point( entry, type ); if ( fs_root_ptr == NULL ) { --dir->reference_count; ffc0e468: a1 3d 00 34 lhz r9,52(r29) status = RTEMS_FILESYSTEM_EVAL_PATH_GENERIC_NO_ENTRY; } } return status; } ffc0e46c: 80 01 00 24 lwz r0,36(r1) } else { rtems_filesystem_global_location_t **fs_root_ptr = IMFS_is_mount_point( entry, type ); if ( fs_root_ptr == NULL ) { --dir->reference_count; ffc0e470: 39 29 ff ff addi r9,r9,-1 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; ffc0e474: 81 5f 00 4c lwz r10,76(r31) ffc0e478: b1 3d 00 34 sth r9,52(r29) status = RTEMS_FILESYSTEM_EVAL_PATH_GENERIC_NO_ENTRY; } } return status; } ffc0e47c: 7c 08 03 a6 mtlr r0 rtems_filesystem_global_location_t **fs_root_ptr = IMFS_is_mount_point( entry, type ); if ( fs_root_ptr == NULL ) { --dir->reference_count; ++entry->reference_count; ffc0e480: a1 3f 00 34 lhz r9,52(r31) ffc0e484: 81 4a 00 04 lwz r10,4(r10) ffc0e488: 39 29 00 01 addi r9,r9,1 status = RTEMS_FILESYSTEM_EVAL_PATH_GENERIC_NO_ENTRY; } } return status; } ffc0e48c: 83 41 00 08 lwz r26,8(r1) rtems_filesystem_global_location_t **fs_root_ptr = IMFS_is_mount_point( entry, type ); if ( fs_root_ptr == NULL ) { --dir->reference_count; ++entry->reference_count; ffc0e490: b1 3f 00 34 sth r9,52(r31) status = RTEMS_FILESYSTEM_EVAL_PATH_GENERIC_NO_ENTRY; } } return status; } ffc0e494: 83 61 00 0c lwz r27,12(r1) IMFS_is_mount_point( entry, type ); if ( fs_root_ptr == NULL ) { --dir->reference_count; ++entry->reference_count; currentloc->node_access = entry; ffc0e498: 93 fc 00 20 stw r31,32(r28) ffc0e49c: 91 5c 00 28 stw r10,40(r28) status = RTEMS_FILESYSTEM_EVAL_PATH_GENERIC_NO_ENTRY; } } return status; } ffc0e4a0: 83 a1 00 14 lwz r29,20(r1) ffc0e4a4: 83 81 00 10 lwz r28,16(r1) ffc0e4a8: 83 c1 00 18 lwz r30,24(r1) ffc0e4ac: 83 e1 00 1c lwz r31,28(r1) ffc0e4b0: 38 21 00 20 addi r1,r1,32 ffc0e4b4: 4e 80 00 20 blr static inline bool rtems_filesystem_is_current_directory( const char *token, size_t tokenlen ) { return tokenlen == 1 && token [0] == '.'; ffc0e4b8: 89 3b 00 00 lbz r9,0(r27) ffc0e4bc: 2f 89 00 2e cmpwi cr7,r9,46 ffc0e4c0: 40 9e fe a8 bne+ cr7,ffc0e368 ffc0e4c4: 7f bf eb 78 mr r31,r29 ffc0e4c8: 4b ff fe d8 b ffc0e3a0 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)) { ffc0e4cc: 71 09 00 08 andi. r9,r8,8 ffc0e4d0: 41 82 00 0c beq- ffc0e4dc entry = entry->info.hard_link.link_node; ffc0e4d4: 83 ff 00 50 lwz r31,80(r31) ffc0e4d8: 4b ff ff 90 b ffc0e468 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)) { ffc0e4dc: 2f 83 00 00 cmpwi cr7,r3,0 ffc0e4e0: 40 be ff 88 bne- cr7,ffc0e468 <== ALWAYS TAKEN entry = entry->info.hard_link.link_node; ffc0e4e4: 83 ff 00 50 lwz r31,80(r31) <== NOT EXECUTED ffc0e4e8: 4b ff ff 80 b ffc0e468 <== NOT EXECUTED } if ( type == IMFS_SYM_LINK && (follow_sym_link || !terminal)) { const char *target = entry->info.sym_link.name; ffc0e4ec: 83 ff 00 50 lwz r31,80(r31) rtems_filesystem_eval_path_recursive( ctx, target, strlen( target ) ); ffc0e4f0: 7f e3 fb 78 mr r3,r31 ffc0e4f4: 48 00 53 d9 bl ffc138cc ffc0e4f8: 7f e4 fb 78 mr r4,r31 ffc0e4fc: 7c 65 1b 78 mr r5,r3 ffc0e500: 7f 83 e3 78 mr r3,r28 ffc0e504: 4b ff 7f 79 bl ffc0647c ffc0e508: 4b ff fe 24 b ffc0e32c =============================================================================== ffc04bd8 : static ssize_t IMFS_fifo_write( rtems_libio_t *iop, const void *buffer, size_t count ) { ffc04bd8: 94 21 ff e0 stwu r1,-32(r1) ffc04bdc: 7c 08 02 a6 mflr r0 ffc04be0: 7c 66 1b 78 mr r6,r3 ffc04be4: 90 01 00 24 stw r0,36(r1) ffc04be8: 93 c1 00 18 stw r30,24(r1) ffc04bec: 93 e1 00 1c stw r31,28(r1) IMFS_jnode_t *jnode = iop->pathinfo.node_access; ffc04bf0: 83 e3 00 1c lwz r31,28(r3) int err = pipe_write(JNODE2PIPE(jnode), buffer, count, iop); ffc04bf4: 80 7f 00 50 lwz r3,80(r31) ffc04bf8: 48 00 c9 31 bl ffc11528 if (err > 0) { ffc04bfc: 7c 7e 1b 79 mr. r30,r3 ffc04c00: 40 81 00 38 ble- ffc04c38 IMFS_mtime_ctime_update(jnode); ffc04c04: 38 61 00 08 addi r3,r1,8 ffc04c08: 38 80 00 00 li r4,0 ffc04c0c: 48 00 12 19 bl ffc05e24 ffc04c10: 81 21 00 08 lwz r9,8(r1) ffc04c14: 91 3f 00 44 stw r9,68(r31) ffc04c18: 91 3f 00 48 stw r9,72(r31) } IMFS_FIFO_RETURN(err); } ffc04c1c: 80 01 00 24 lwz r0,36(r1) ffc04c20: 7f c3 f3 78 mr r3,r30 ffc04c24: 83 e1 00 1c lwz r31,28(r1) ffc04c28: 7c 08 03 a6 mtlr r0 ffc04c2c: 83 c1 00 18 lwz r30,24(r1) ffc04c30: 38 21 00 20 addi r1,r1,32 ffc04c34: 4e 80 00 20 blr int err = pipe_write(JNODE2PIPE(jnode), buffer, count, iop); if (err > 0) { IMFS_mtime_ctime_update(jnode); } IMFS_FIFO_RETURN(err); ffc04c38: 41 82 ff e4 beq+ ffc04c1c <== NEVER TAKEN ffc04c3c: 7f de 00 d0 neg r30,r30 ffc04c40: 48 00 ef 21 bl ffc13b60 <__errno> ffc04c44: 93 c3 00 00 stw r30,0(r3) ffc04c48: 3b c0 ff ff li r30,-1 ffc04c4c: 4b ff ff d0 b ffc04c1c =============================================================================== ffc0e570 : ((IMFS_jnode_t *)( rtems_chain_head( jnode_get_control( jnode ) )->next)) void IMFS_fsunmount( rtems_filesystem_mount_table_entry_t *temp_mt_entry ) { ffc0e570: 94 21 ff d0 stwu r1,-48(r1) ffc0e574: 7c 08 02 a6 mflr r0 ffc0e578: 90 01 00 34 stw r0,52(r1) /* * Traverse tree that starts at the mt_fs_root and deallocate memory * associated memory space */ loc = temp_mt_entry->mt_fs_root->location; ffc0e57c: 81 03 00 24 lwz r8,36(r3) ((IMFS_jnode_t *)( rtems_chain_head( jnode_get_control( jnode ) )->next)) void IMFS_fsunmount( rtems_filesystem_mount_table_entry_t *temp_mt_entry ) { ffc0e580: 93 e1 00 2c stw r31,44(r1) /* * Traverse tree that starts at the mt_fs_root and deallocate memory * associated memory space */ loc = temp_mt_entry->mt_fs_root->location; ffc0e584: 80 e8 00 08 lwz r7,8(r8) ffc0e588: 81 68 00 00 lwz r11,0(r8) ffc0e58c: 81 27 00 4c lwz r9,76(r7) jnode = (IMFS_jnode_t *)loc.node_access; ffc0e590: 7c ff 3b 78 mr r31,r7 /* * Traverse tree that starts at the mt_fs_root and deallocate memory * associated memory space */ loc = temp_mt_entry->mt_fs_root->location; ffc0e594: 80 68 00 04 lwz r3,4(r8) ffc0e598: 81 49 00 00 lwz r10,0(r9) ffc0e59c: 80 88 00 0c lwz r4,12(r8) ffc0e5a0: 80 a8 00 10 lwz r5,16(r8) ffc0e5a4: 2f 8a 00 00 cmpwi cr7,r10,0 ffc0e5a8: 80 c8 00 14 lwz r6,20(r8) /* * Set this to null to indicate that it is being unmounted. */ temp_mt_entry->mt_fs_root->location.node_access = NULL; ffc0e5ac: 39 40 00 00 li r10,0 ((IMFS_jnode_t *)( rtems_chain_head( jnode_get_control( jnode ) )->next)) void IMFS_fsunmount( rtems_filesystem_mount_table_entry_t *temp_mt_entry ) { ffc0e5b0: 93 c1 00 28 stw r30,40(r1) /* * Traverse tree that starts at the mt_fs_root and deallocate memory * associated memory space */ loc = temp_mt_entry->mt_fs_root->location; ffc0e5b4: 91 61 00 08 stw r11,8(r1) ffc0e5b8: 90 61 00 0c stw r3,12(r1) ffc0e5bc: 90 e1 00 10 stw r7,16(r1) ffc0e5c0: 90 81 00 14 stw r4,20(r1) ffc0e5c4: 90 a1 00 18 stw r5,24(r1) ffc0e5c8: 90 c1 00 1c stw r6,28(r1) /* * Set this to null to indicate that it is being unmounted. */ temp_mt_entry->mt_fs_root->location.node_access = NULL; ffc0e5cc: 91 48 00 08 stw r10,8(r8) ffc0e5d0: 81 29 00 04 lwz r9,4(r9) do { next = jnode->Parent; ffc0e5d4: 83 df 00 08 lwz r30,8(r31) loc.node_access = (void *)jnode; ffc0e5d8: 93 e1 00 10 stw r31,16(r1) ffc0e5dc: 91 21 00 18 stw r9,24(r1) IMFS_Set_handlers( &loc ); if ( !IMFS_is_directory( jnode ) || jnode_has_no_children( jnode ) ) { ffc0e5e0: 40 9e 00 40 bne- cr7,ffc0e620 <== NEVER TAKEN ffc0e5e4: 81 3f 00 50 lwz r9,80(r31) RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( const Chain_Control *the_chain ) { return _Chain_Immutable_first( the_chain ) == _Chain_Immutable_tail( the_chain ); ffc0e5e8: 39 5f 00 54 addi r10,r31,84 ffc0e5ec: 7f 89 50 00 cmpw cr7,r9,r10 ffc0e5f0: 41 9e 00 30 beq- cr7,ffc0e620 */ RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_first( const Chain_Control *the_chain ) { return _Chain_Immutable_head( the_chain )->next; ffc0e5f4: 7d 3f 4b 78 mr r31,r9 if ( IMFS_is_directory( jnode ) ) { if ( jnode_has_children( jnode ) ) jnode = jnode_get_first_child( jnode ); } } } while (jnode != NULL); ffc0e5f8: 2f 9f 00 00 cmpwi cr7,r31,0 ffc0e5fc: 41 9e 00 74 beq- cr7,ffc0e670 <== NEVER TAKEN ffc0e600: 81 3f 00 4c lwz r9,76(r31) */ temp_mt_entry->mt_fs_root->location.node_access = NULL; do { next = jnode->Parent; ffc0e604: 83 df 00 08 lwz r30,8(r31) ffc0e608: 81 49 00 00 lwz r10,0(r9) ffc0e60c: 81 29 00 04 lwz r9,4(r9) ffc0e610: 2f 8a 00 00 cmpwi cr7,r10,0 loc.node_access = (void *)jnode; ffc0e614: 93 e1 00 10 stw r31,16(r1) ffc0e618: 91 21 00 18 stw r9,24(r1) IMFS_Set_handlers( &loc ); if ( !IMFS_is_directory( jnode ) || jnode_has_no_children( jnode ) ) { ffc0e61c: 41 9e ff c8 beq+ cr7,ffc0e5e4 result = IMFS_rmnod( NULL, &loc ); ffc0e620: 38 60 00 00 li r3,0 ffc0e624: 38 81 00 08 addi r4,r1,8 ffc0e628: 4b ff 5e 15 bl ffc0443c if ( result != 0 ) ffc0e62c: 2f 83 00 00 cmpwi cr7,r3,0 ffc0e630: 40 9e 00 58 bne- cr7,ffc0e688 <== NEVER TAKEN rtems_fatal_error_occurred( 0xdeadbeef ); IMFS_node_destroy( jnode ); ffc0e634: 7f e3 fb 78 mr r3,r31 ffc0e638: 4b ff 5a 31 bl ffc04068 jnode = next; } if ( jnode != NULL ) { ffc0e63c: 2f 9e 00 00 cmpwi cr7,r30,0 ffc0e640: 41 9e 00 30 beq- cr7,ffc0e670 ffc0e644: 81 3e 00 4c lwz r9,76(r30) if ( IMFS_is_directory( jnode ) ) { ffc0e648: 7f df f3 78 mr r31,r30 ffc0e64c: 81 49 00 00 lwz r10,0(r9) ffc0e650: 2f 8a 00 00 cmpwi cr7,r10,0 ffc0e654: 40 9e ff 7c bne+ cr7,ffc0e5d0 <== NEVER TAKEN ffc0e658: 83 fe 00 50 lwz r31,80(r30) RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( const Chain_Control *the_chain ) { return _Chain_Immutable_first( the_chain ) == _Chain_Immutable_tail( the_chain ); ffc0e65c: 39 5e 00 54 addi r10,r30,84 if ( jnode_has_children( jnode ) ) ffc0e660: 7f 1f 50 00 cmpw cr6,r31,r10 ffc0e664: 40 ba ff 94 bne- cr6,ffc0e5f8 ffc0e668: 7f df f3 78 mr r31,r30 ffc0e66c: 4b ff ff 64 b ffc0e5d0 jnode = jnode_get_first_child( jnode ); } } } while (jnode != NULL); } ffc0e670: 80 01 00 34 lwz r0,52(r1) ffc0e674: 83 c1 00 28 lwz r30,40(r1) ffc0e678: 7c 08 03 a6 mtlr r0 ffc0e67c: 83 e1 00 2c lwz r31,44(r1) ffc0e680: 38 21 00 30 addi r1,r1,48 ffc0e684: 4e 80 00 20 blr IMFS_Set_handlers( &loc ); if ( !IMFS_is_directory( jnode ) || jnode_has_no_children( jnode ) ) { result = IMFS_rmnod( NULL, &loc ); if ( result != 0 ) rtems_fatal_error_occurred( 0xdeadbeef ); ffc0e688: 3c 60 de ad lis r3,-8531 <== NOT EXECUTED ffc0e68c: 60 63 be ef ori r3,r3,48879 <== NOT EXECUTED ffc0e690: 4b ff bd 09 bl ffc0a398 <== NOT EXECUTED =============================================================================== ffc03f00 : 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] ) { ffc03f00: 94 21 ff e8 stwu r1,-24(r1) ffc03f04: 7c 08 02 a6 mflr r0 ffc03f08: 93 81 00 08 stw r28,8(r1) ffc03f0c: 7c 9c 23 78 mr r28,r4 static int imfs_instance; int rv = 0; IMFS_fs_info_t *fs_info = calloc( 1, sizeof( *fs_info ) ); ffc03f10: 38 80 00 24 li r4,36 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] ) { ffc03f14: 93 a1 00 0c stw r29,12(r1) ffc03f18: 7c 7d 1b 78 mr r29,r3 static int imfs_instance; int rv = 0; IMFS_fs_info_t *fs_info = calloc( 1, sizeof( *fs_info ) ); ffc03f1c: 38 60 00 01 li r3,1 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] ) { ffc03f20: 93 c1 00 10 stw r30,16(r1) ffc03f24: 93 e1 00 14 stw r31,20(r1) ffc03f28: 7c bf 2b 78 mr r31,r5 ffc03f2c: 90 01 00 1c stw r0,28(r1) static int imfs_instance; int rv = 0; IMFS_fs_info_t *fs_info = calloc( 1, sizeof( *fs_info ) ); ffc03f30: 48 00 08 89 bl ffc047b8 if ( fs_info != NULL ) { ffc03f34: 7c 7e 1b 79 mr. r30,r3 ffc03f38: 41 82 01 04 beq- ffc0403c IMFS_jnode_t *root_node; fs_info->instance = imfs_instance++; ffc03f3c: 3d 00 00 00 lis r8,0 ffc03f40: 81 48 28 b8 lwz r10,10424(r8) fs_info->node_controls, node_controls, sizeof( fs_info->node_controls ) ); root_node = IMFS_allocate_node( ffc03f44: 3c a0 ff c2 lis r5,-62 ffc03f48: 38 a5 e0 e4 addi r5,r5,-7964 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++; ffc03f4c: 38 ea 00 01 addi r7,r10,1 ffc03f50: 91 5e 00 00 stw r10,0(r30) fs_info->node_controls, node_controls, sizeof( fs_info->node_controls ) ); root_node = IMFS_allocate_node( ffc03f54: 38 c0 00 00 li r6,0 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++; ffc03f58: 90 e8 28 b8 stw r7,10424(r8) memcpy( ffc03f5c: 80 ff 00 00 lwz r7,0(r31) ffc03f60: 80 9f 00 04 lwz r4,4(r31) ffc03f64: 81 1f 00 08 lwz r8,8(r31) ffc03f68: 81 5f 00 0c lwz r10,12(r31) ffc03f6c: 90 fe 00 08 stw r7,8(r30) fs_info->node_controls, node_controls, sizeof( fs_info->node_controls ) ); root_node = IMFS_allocate_node( ffc03f70: 38 e0 41 ed li r7,16877 if ( fs_info != NULL ) { IMFS_jnode_t *root_node; fs_info->instance = imfs_instance++; memcpy( ffc03f74: 91 1e 00 10 stw r8,16(r30) fs_info->node_controls, node_controls, sizeof( fs_info->node_controls ) ); root_node = IMFS_allocate_node( ffc03f78: 39 00 00 00 li r8,0 if ( fs_info != NULL ) { IMFS_jnode_t *root_node; fs_info->instance = imfs_instance++; memcpy( ffc03f7c: 90 9e 00 0c stw r4,12(r30) ffc03f80: 91 5e 00 14 stw r10,20(r30) ffc03f84: 80 9f 00 14 lwz r4,20(r31) ffc03f88: 81 7f 00 10 lwz r11,16(r31) ffc03f8c: 81 5f 00 18 lwz r10,24(r31) ffc03f90: 90 9e 00 1c stw r4,28(r30) ffc03f94: 91 7e 00 18 stw r11,24(r30) ffc03f98: 91 5e 00 20 stw r10,32(r30) fs_info->node_controls, node_controls, sizeof( fs_info->node_controls ) ); root_node = IMFS_allocate_node( ffc03f9c: 80 9e 00 08 lwz r4,8(r30) ffc03fa0: 48 00 a1 75 bl ffc0e114 "", 0, (S_IFDIR | 0755), NULL ); if ( root_node != NULL ) { ffc03fa4: 2c 03 00 00 cmpwi r3,0 ffc03fa8: 41 82 00 94 beq- ffc0403c <== NEVER TAKEN errno = ENOMEM; rv = -1; } if ( rv == 0 ) { IMFS_determine_bytes_per_block( ffc03fac: 3d 40 00 00 lis r10,0 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; ffc03fb0: 80 e3 00 4c lwz r7,76(r3) ffc03fb4: 81 4a 27 54 lwz r10,10068(r10) NULL ); if ( root_node != NULL ) { mt_entry->fs_info = fs_info; mt_entry->ops = op_table; mt_entry->pathconf_limits_and_options = &IMFS_LIMITS_AND_OPTIONS; ffc03fb8: 3c c0 ff c2 lis r6,-62 ffc03fbc: 80 e7 00 04 lwz r7,4(r7) ffc03fc0: 38 c6 e8 bc addi r6,r6,-5956 /* * 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) { ffc03fc4: 2f 8a 00 10 cmpwi cr7,r10,16 ); if ( root_node != NULL ) { mt_entry->fs_info = fs_info; mt_entry->ops = op_table; mt_entry->pathconf_limits_and_options = &IMFS_LIMITS_AND_OPTIONS; mt_entry->mt_fs_root->location.node_access = root_node; ffc03fc8: 81 1d 00 24 lwz r8,36(r29) 0, (S_IFDIR | 0755), NULL ); if ( root_node != NULL ) { mt_entry->fs_info = fs_info; ffc03fcc: 93 dd 00 08 stw r30,8(r29) mt_entry->ops = op_table; ffc03fd0: 93 9d 00 0c stw r28,12(r29) mt_entry->pathconf_limits_and_options = &IMFS_LIMITS_AND_OPTIONS; ffc03fd4: 90 dd 00 2c stw r6,44(r29) mt_entry->mt_fs_root->location.node_access = root_node; ffc03fd8: 90 68 00 08 stw r3,8(r8) ffc03fdc: 90 e8 00 10 stw r7,16(r8) /* * 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) { ffc03fe0: 41 9e 00 30 beq- cr7,ffc04010 is_valid = true; break; } if(bit_mask > requested_bytes_per_block) ffc03fe4: 2f 8a 00 0f cmpwi cr7,r10,15 ffc03fe8: 40 9d 00 24 ble- cr7,ffc0400c ffc03fec: 39 00 00 05 li r8,5 ffc03ff0: 7d 09 03 a6 mtctr r8 ffc03ff4: 39 20 00 20 li r9,32 /* * 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) { ffc03ff8: 7f 8a 48 00 cmpw cr7,r10,r9 int bit_mask; /* * check, whether requested bytes per block is valid */ for (bit_mask = 16; !is_valid && (bit_mask <= 512); bit_mask <<= 1) { ffc03ffc: 55 29 08 3c rlwinm r9,r9,1,0,30 if (bit_mask == requested_bytes_per_block) { ffc04000: 41 9e 00 10 beq- cr7,ffc04010 is_valid = true; break; } if(bit_mask > requested_bytes_per_block) ffc04004: 41 9c 00 08 blt- cr7,ffc0400c <== NEVER TAKEN int bit_mask; /* * check, whether requested bytes per block is valid */ for (bit_mask = 16; !is_valid && (bit_mask <= 512); bit_mask <<= 1) { ffc04008: 42 00 ff f0 bdnz+ ffc03ff8 if(bit_mask > requested_bytes_per_block) break; } *dest_bytes_per_block = ((is_valid) ? requested_bytes_per_block : default_bytes_per_block); ffc0400c: 39 40 00 80 li r10,128 break; } if(bit_mask > requested_bytes_per_block) break; } *dest_bytes_per_block = ((is_valid) ffc04010: 3d 20 00 00 lis r9,0 ffc04014: 91 49 28 00 stw r10,10240(r9) const IMFS_node_control *const node_controls [IMFS_TYPE_COUNT] ) { static int imfs_instance; int rv = 0; ffc04018: 38 60 00 00 li r3,0 IMFS_MEMFILE_DEFAULT_BYTES_PER_BLOCK ); } return rv; } ffc0401c: 80 01 00 1c lwz r0,28(r1) ffc04020: 83 81 00 08 lwz r28,8(r1) ffc04024: 7c 08 03 a6 mtlr r0 ffc04028: 83 a1 00 0c lwz r29,12(r1) ffc0402c: 83 c1 00 10 lwz r30,16(r1) ffc04030: 83 e1 00 14 lwz r31,20(r1) ffc04034: 38 21 00 18 addi r1,r1,24 ffc04038: 4e 80 00 20 blr } else { errno = ENOMEM; rv = -1; } } else { errno = ENOMEM; ffc0403c: 48 00 e0 3d bl ffc12078 <__errno> ffc04040: 39 20 00 0c li r9,12 ffc04044: 91 23 00 00 stw r9,0(r3) if(bit_mask > requested_bytes_per_block) break; } *dest_bytes_per_block = ((is_valid) ? requested_bytes_per_block : default_bytes_per_block); ffc04048: 38 60 ff ff li r3,-1 ffc0404c: 4b ff ff d0 b ffc0401c =============================================================================== ffc0621c : const char *path, mode_t mode, const IMFS_node_control *node_control, void *context ) { ffc0621c: 94 21 ff 88 stwu r1,-120(r1) ffc06220: 7c 08 02 a6 mflr r0 int rv = 0; mode &= ~rtems_filesystem_umask; ffc06224: 3d 20 00 00 lis r9,0 ffc06228: 81 29 27 50 lwz r9,10064(r9) const char *path, mode_t mode, const IMFS_node_control *node_control, void *context ) { ffc0622c: 90 01 00 7c stw r0,124(r1) ffc06230: 93 e1 00 74 stw r31,116(r1) int rv = 0; mode &= ~rtems_filesystem_umask; ffc06234: 83 e9 00 08 lwz r31,8(r9) const char *path, mode_t mode, const IMFS_node_control *node_control, void *context ) { ffc06238: 93 a1 00 6c stw r29,108(r1) ffc0623c: 7c dd 33 78 mr r29,r6 int rv = 0; mode &= ~rtems_filesystem_umask; ffc06240: 7c 9f f8 78 andc r31,r4,r31 switch (mode & S_IFMT) { ffc06244: 57 e9 04 26 rlwinm r9,r31,0,16,19 const char *path, mode_t mode, const IMFS_node_control *node_control, void *context ) { ffc06248: 93 c1 00 70 stw r30,112(r1) int rv = 0; mode &= ~rtems_filesystem_umask; switch (mode & S_IFMT) { ffc0624c: 2f 89 20 00 cmpwi cr7,r9,8192 const char *path, mode_t mode, const IMFS_node_control *node_control, void *context ) { ffc06250: 93 81 00 68 stw r28,104(r1) ffc06254: 7c be 2b 78 mr r30,r5 int rv = 0; mode &= ~rtems_filesystem_umask; switch (mode & S_IFMT) { ffc06258: 41 9e 00 5c beq- cr7,ffc062b4 ffc0625c: 2b 89 20 00 cmplwi cr7,r9,8192 ffc06260: 41 9d 00 40 bgt- cr7,ffc062a0 <== ALWAYS TAKEN ffc06264: 2f 89 10 00 cmpwi cr7,r9,4096 <== NOT EXECUTED ffc06268: 41 9e 00 4c beq- cr7,ffc062b4 <== NOT EXECUTED rv = -1; } rtems_filesystem_eval_path_cleanup( &ctx ); } else { errno = EINVAL; ffc0626c: 48 01 18 f5 bl ffc17b60 <__errno> rv = -1; } } return rv; } ffc06270: 80 01 00 7c lwz r0,124(r1) } rtems_filesystem_eval_path_cleanup( &ctx ); } else { errno = EINVAL; rv = -1; ffc06274: 3b e0 ff ff li r31,-1 } } return rv; } ffc06278: 83 81 00 68 lwz r28,104(r1) ffc0627c: 7c 08 03 a6 mtlr r0 rv = -1; } rtems_filesystem_eval_path_cleanup( &ctx ); } else { errno = EINVAL; ffc06280: 39 20 00 16 li r9,22 ffc06284: 91 23 00 00 stw r9,0(r3) rv = -1; } } return rv; } ffc06288: 7f e3 fb 78 mr r3,r31 ffc0628c: 83 a1 00 6c lwz r29,108(r1) ffc06290: 83 c1 00 70 lwz r30,112(r1) ffc06294: 83 e1 00 74 lwz r31,116(r1) ffc06298: 38 21 00 78 addi r1,r1,120 ffc0629c: 4e 80 00 20 blr { int rv = 0; mode &= ~rtems_filesystem_umask; switch (mode & S_IFMT) { ffc062a0: 2f 89 60 00 cmpwi cr7,r9,24576 ffc062a4: 41 9e 00 10 beq- cr7,ffc062b4 ffc062a8: 6d 2a ff ff xoris r10,r9,65535 ffc062ac: 2f 8a 80 00 cmpwi cr7,r10,-32768 ffc062b0: 40 9e ff bc bne+ cr7,ffc0626c <== ALWAYS TAKEN rv = -1; break; } if ( rv == 0 ) { if ( node_control->imfs_type == IMFS_GENERIC ) { ffc062b4: 81 3e 00 00 lwz r9,0(r30) ffc062b8: 2f 89 00 07 cmpwi cr7,r9,7 ffc062bc: 40 be ff b0 bne- cr7,ffc0626c 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 = ffc062c0: 7c 64 1b 78 mr r4,r3 ffc062c4: 38 a0 00 78 li r5,120 ffc062c8: 38 61 00 08 addi r3,r1,8 ffc062cc: 48 00 25 29 bl ffc087f4 ffc062d0: 7c 7c 1b 78 mr r28,r3 rtems_filesystem_eval_path_start( &ctx, path, eval_flags ); if ( IMFS_is_imfs_instance( currentloc ) ) { ffc062d4: 4b ff fe d5 bl ffc061a8 ffc062d8: 2f 83 00 00 cmpwi cr7,r3,0 ffc062dc: 40 9e 00 40 bne- cr7,ffc0631c IMFS_update_mtime( parent ); } else { rv = -1; } } else { rtems_filesystem_eval_path_error( &ctx, ENOTSUP ); ffc062e0: 38 61 00 08 addi r3,r1,8 ffc062e4: 38 80 00 86 li r4,134 ffc062e8: 48 00 21 3d bl ffc08424 rv = -1; ffc062ec: 3b e0 ff ff li r31,-1 } rtems_filesystem_eval_path_cleanup( &ctx ); ffc062f0: 38 61 00 08 addi r3,r1,8 ffc062f4: 48 00 26 49 bl ffc0893c rv = -1; } } return rv; } ffc062f8: 80 01 00 7c lwz r0,124(r1) ffc062fc: 7f e3 fb 78 mr r3,r31 ffc06300: 83 81 00 68 lwz r28,104(r1) ffc06304: 7c 08 03 a6 mtlr r0 ffc06308: 83 a1 00 6c lwz r29,108(r1) ffc0630c: 83 c1 00 70 lwz r30,112(r1) ffc06310: 83 e1 00 74 lwz r31,116(r1) ffc06314: 38 21 00 78 addi r1,r1,120 ffc06318: 4e 80 00 20 blr if ( IMFS_is_imfs_instance( currentloc ) ) { IMFS_types_union info; IMFS_jnode_t *new_node; info.generic.context = context; new_node = IMFS_create_node_with_control( ffc0631c: 80 a1 00 10 lwz r5,16(r1) ffc06320: 7f e7 fb 78 mr r7,r31 ffc06324: 80 c1 00 14 lwz r6,20(r1) ffc06328: 7f 83 e3 78 mr r3,r28 ffc0632c: 7f c4 f3 78 mr r4,r30 if ( IMFS_is_imfs_instance( currentloc ) ) { IMFS_types_union info; IMFS_jnode_t *new_node; info.generic.context = context; ffc06330: 93 a1 00 40 stw r29,64(r1) new_node = IMFS_create_node_with_control( ffc06334: 39 01 00 40 addi r8,r1,64 ffc06338: 48 00 d9 01 bl ffc13c38 IMFS_jnode_t *parent = currentloc->node_access; IMFS_update_ctime( parent ); IMFS_update_mtime( parent ); } else { rv = -1; ffc0633c: 3b e0 ff ff li r31,-1 rtems_filesystem_eval_path_get_tokenlen( &ctx ), mode, &info ); if ( new_node != NULL ) { ffc06340: 2f 83 00 00 cmpwi cr7,r3,0 ffc06344: 41 be ff ac beq- cr7,ffc062f0 IMFS_jnode_t *parent = currentloc->node_access; IMFS_update_ctime( parent ); ffc06348: 38 80 00 00 li r4,0 mode, &info ); if ( new_node != NULL ) { IMFS_jnode_t *parent = currentloc->node_access; ffc0634c: 83 dc 00 08 lwz r30,8(r28) IMFS_update_ctime( parent ); ffc06350: 38 61 00 58 addi r3,r1,88 ffc06354: 48 00 09 a5 bl ffc06cf8 ffc06358: 81 21 00 58 lwz r9,88(r1) IMFS_update_mtime( parent ); ffc0635c: 38 61 00 58 addi r3,r1,88 ); if ( new_node != NULL ) { IMFS_jnode_t *parent = currentloc->node_access; IMFS_update_ctime( parent ); ffc06360: 91 3e 00 48 stw r9,72(r30) IMFS_update_mtime( parent ); ffc06364: 38 80 00 00 li r4,0 ffc06368: 3b e0 00 00 li r31,0 ffc0636c: 48 00 09 8d bl ffc06cf8 ffc06370: 81 21 00 58 lwz r9,88(r1) ffc06374: 91 3e 00 44 stw r9,68(r30) ffc06378: 4b ff ff 78 b ffc062f0 =============================================================================== ffc10b84 : */ MEMFILE_STATIC int IMFS_memfile_addblock( IMFS_jnode_t *the_jnode, unsigned int block ) { ffc10b84: 94 21 ff f0 stwu r1,-16(r1) ffc10b88: 7c 08 02 a6 mflr r0 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 ); ffc10b8c: 38 a0 00 01 li r5,1 */ MEMFILE_STATIC int IMFS_memfile_addblock( IMFS_jnode_t *the_jnode, unsigned int block ) { ffc10b90: 93 e1 00 0c stw r31,12(r1) ffc10b94: 90 01 00 14 stw r0,20(r1) 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 ); ffc10b98: 4b ff fa 49 bl ffc105e0 ffc10b9c: 7c 7f 1b 78 mr r31,r3 if ( *block_entry_ptr ) ffc10ba0: 81 23 00 00 lwz r9,0(r3) return 0; ffc10ba4: 38 60 00 00 li r3,0 /* * Obtain the pointer for the specified block number */ block_entry_ptr = IMFS_memfile_get_block_pointer( the_jnode, block, 1 ); if ( *block_entry_ptr ) ffc10ba8: 2f 89 00 00 cmpwi cr7,r9,0 ffc10bac: 41 9e 00 18 beq- cr7,ffc10bc4 if ( !memory ) return 1; *block_entry_ptr = memory; return 0; } ffc10bb0: 80 01 00 14 lwz r0,20(r1) ffc10bb4: 83 e1 00 0c lwz r31,12(r1) ffc10bb8: 7c 08 03 a6 mtlr r0 ffc10bbc: 38 21 00 10 addi r1,r1,16 ffc10bc0: 4e 80 00 20 blr return 0; /* * There is no memory for this block number so allocate it. */ memory = memfile_alloc_block(); ffc10bc4: 4b ff f9 d9 bl ffc1059c if ( !memory ) ffc10bc8: 2c 03 00 00 cmpwi r3,0 ffc10bcc: 41 82 00 10 beq- ffc10bdc <== NEVER TAKEN return 1; *block_entry_ptr = memory; ffc10bd0: 90 7f 00 00 stw r3,0(r31) return 0; ffc10bd4: 38 60 00 00 li r3,0 ffc10bd8: 4b ff ff d8 b ffc10bb0 /* * There is no memory for this block number so allocate it. */ memory = memfile_alloc_block(); if ( !memory ) return 1; ffc10bdc: 38 60 00 01 li r3,1 <== NOT EXECUTED ffc10be0: 4b ff ff d0 b ffc10bb0 <== NOT EXECUTED =============================================================================== ffc10e8c : MEMFILE_STATIC int IMFS_memfile_extend( IMFS_jnode_t *the_jnode, bool zero_fill, off_t new_length ) { ffc10e8c: 94 21 ff b8 stwu r1,-72(r1) IMFS_assert( IMFS_type( the_jnode ) == IMFS_MEMORY_FILE ); /* * Verify new file size is supported */ if ( new_length >= IMFS_MEMFILE_MAXIMUM_SIZE ) ffc10e90: 39 00 00 00 li r8,0 MEMFILE_STATIC int IMFS_memfile_extend( IMFS_jnode_t *the_jnode, bool zero_fill, off_t new_length ) { ffc10e94: 7d 80 00 26 mfcr r12 IMFS_assert( IMFS_type( the_jnode ) == IMFS_MEMORY_FILE ); /* * Verify new file size is supported */ if ( new_length >= IMFS_MEMFILE_MAXIMUM_SIZE ) ffc10e98: 7f 88 28 00 cmpw cr7,r8,r5 MEMFILE_STATIC int IMFS_memfile_extend( IMFS_jnode_t *the_jnode, bool zero_fill, off_t new_length ) { ffc10e9c: 93 21 00 2c stw r25,44(r1) IMFS_assert( IMFS_type( the_jnode ) == IMFS_MEMORY_FILE ); /* * Verify new file size is supported */ if ( new_length >= IMFS_MEMFILE_MAXIMUM_SIZE ) ffc10ea0: 3f 20 00 00 lis r25,0 MEMFILE_STATIC int IMFS_memfile_extend( IMFS_jnode_t *the_jnode, bool zero_fill, off_t new_length ) { ffc10ea4: 7c 08 02 a6 mflr r0 ffc10ea8: 93 e1 00 44 stw r31,68(r1) IMFS_assert( IMFS_type( the_jnode ) == IMFS_MEMORY_FILE ); /* * Verify new file size is supported */ if ( new_length >= IMFS_MEMFILE_MAXIMUM_SIZE ) ffc10eac: 83 f9 28 00 lwz r31,10240(r25) MEMFILE_STATIC int IMFS_memfile_extend( IMFS_jnode_t *the_jnode, bool zero_fill, off_t new_length ) { ffc10eb0: 92 c1 00 20 stw r22,32(r1) ffc10eb4: 7c 96 23 78 mr r22,r4 IMFS_assert( IMFS_type( the_jnode ) == IMFS_MEMORY_FILE ); /* * Verify new file size is supported */ if ( new_length >= IMFS_MEMFILE_MAXIMUM_SIZE ) ffc10eb8: 57 e9 f0 be rlwinm r9,r31,30,2,31 ffc10ebc: 39 49 00 01 addi r10,r9,1 MEMFILE_STATIC int IMFS_memfile_extend( IMFS_jnode_t *the_jnode, bool zero_fill, off_t new_length ) { ffc10ec0: 92 e1 00 24 stw r23,36(r1) IMFS_assert( IMFS_type( the_jnode ) == IMFS_MEMORY_FILE ); /* * Verify new file size is supported */ if ( new_length >= IMFS_MEMFILE_MAXIMUM_SIZE ) ffc10ec4: 7d 4a 49 d6 mullw r10,r10,r9 MEMFILE_STATIC int IMFS_memfile_extend( IMFS_jnode_t *the_jnode, bool zero_fill, off_t new_length ) { ffc10ec8: 93 41 00 30 stw r26,48(r1) ffc10ecc: 7c d7 33 78 mr r23,r6 IMFS_assert( IMFS_type( the_jnode ) == IMFS_MEMORY_FILE ); /* * Verify new file size is supported */ if ( new_length >= IMFS_MEMFILE_MAXIMUM_SIZE ) ffc10ed0: 39 4a 00 01 addi r10,r10,1 MEMFILE_STATIC int IMFS_memfile_extend( IMFS_jnode_t *the_jnode, bool zero_fill, off_t new_length ) { ffc10ed4: 93 c1 00 40 stw r30,64(r1) IMFS_assert( IMFS_type( the_jnode ) == IMFS_MEMORY_FILE ); /* * Verify new file size is supported */ if ( new_length >= IMFS_MEMFILE_MAXIMUM_SIZE ) ffc10ed8: 7d 2a 49 d6 mullw r9,r10,r9 MEMFILE_STATIC int IMFS_memfile_extend( IMFS_jnode_t *the_jnode, bool zero_fill, off_t new_length ) { ffc10edc: 90 01 00 4c stw r0,76(r1) ffc10ee0: 7c ba 2b 78 mr r26,r5 IMFS_assert( IMFS_type( the_jnode ) == IMFS_MEMORY_FILE ); /* * Verify new file size is supported */ if ( new_length >= IMFS_MEMFILE_MAXIMUM_SIZE ) ffc10ee4: 39 29 ff ff addi r9,r9,-1 MEMFILE_STATIC int IMFS_memfile_extend( IMFS_jnode_t *the_jnode, bool zero_fill, off_t new_length ) { ffc10ee8: 93 01 00 28 stw r24,40(r1) ffc10eec: 7c 7e 1b 78 mr r30,r3 ffc10ef0: 93 61 00 34 stw r27,52(r1) IMFS_assert( IMFS_type( the_jnode ) == IMFS_MEMORY_FILE ); /* * Verify new file size is supported */ if ( new_length >= IMFS_MEMFILE_MAXIMUM_SIZE ) ffc10ef4: 7d 29 f9 d6 mullw r9,r9,r31 MEMFILE_STATIC int IMFS_memfile_extend( IMFS_jnode_t *the_jnode, bool zero_fill, off_t new_length ) { ffc10ef8: 93 81 00 38 stw r28,56(r1) ffc10efc: 93 a1 00 3c stw r29,60(r1) ffc10f00: 91 81 00 1c stw r12,28(r1) IMFS_assert( IMFS_type( the_jnode ) == IMFS_MEMORY_FILE ); /* * Verify new file size is supported */ if ( new_length >= IMFS_MEMFILE_MAXIMUM_SIZE ) ffc10f04: 40 9d 01 f8 ble- cr7,ffc110fc <== ALWAYS TAKEN rtems_set_errno_and_return_minus_one( EFBIG ); /* * Verify new file size is actually larger than current size */ if ( new_length <= the_jnode->info.file.size ) ffc10f08: 83 7e 00 50 lwz r27,80(r30) ffc10f0c: 83 1e 00 54 lwz r24,84(r30) ffc10f10: 7f 9a d8 00 cmpw cr7,r26,r27 ffc10f14: 40 9d 01 28 ble- cr7,ffc1103c <== ALWAYS TAKEN return 0; /* * Calculate the number of range of blocks to allocate */ new_blocks = new_length / IMFS_MEMFILE_BYTES_PER_BLOCK; ffc10f18: 7f fc fe 70 srawi r28,r31,31 ffc10f1c: 7f 85 e3 78 mr r5,r28 ffc10f20: 7f e6 fb 78 mr r6,r31 ffc10f24: 7f 43 d3 78 mr r3,r26 ffc10f28: 7e e4 bb 78 mr r4,r23 ffc10f2c: 48 00 a9 65 bl ffc1b890 <__divdi3> old_blocks = the_jnode->info.file.size / IMFS_MEMFILE_BYTES_PER_BLOCK; ffc10f30: 7f 63 db 78 mr r3,r27 return 0; /* * Calculate the number of range of blocks to allocate */ new_blocks = new_length / IMFS_MEMFILE_BYTES_PER_BLOCK; ffc10f34: 7c 9d 23 78 mr r29,r4 old_blocks = the_jnode->info.file.size / IMFS_MEMFILE_BYTES_PER_BLOCK; ffc10f38: 7f 85 e3 78 mr r5,r28 ffc10f3c: 7f e6 fb 78 mr r6,r31 ffc10f40: 7f 04 c3 78 mr r4,r24 ffc10f44: 48 00 a9 4d bl ffc1b890 <__divdi3> /* * Now allocate each of those blocks. */ for ( block=old_blocks ; block<=new_blocks ; block++ ) { if ( !IMFS_memfile_addblock( the_jnode, block ) ) { if ( zero_fill ) { ffc10f48: 2e 16 00 00 cmpwi cr4,r22,0 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++ ) { ffc10f4c: 7f 9d 20 40 cmplw cr7,r29,r4 /* * 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; ffc10f50: 7f 84 f9 d6 mullw r28,r4,r31 /* * 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; ffc10f54: 7c 9b 23 78 mr r27,r4 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++ ) { ffc10f58: 7c 9f 23 78 mr r31,r4 /* * 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; ffc10f5c: 7f 9c c0 50 subf r28,r28,r24 /* * Now allocate each of those blocks. */ for ( block=old_blocks ; block<=new_blocks ; block++ ) { ffc10f60: 40 bc 00 14 bge+ cr7,ffc10f74 <== ALWAYS TAKEN ffc10f64: 48 00 00 64 b ffc10fc8 <== NOT EXECUTED ffc10f68: 3b ff 00 01 addi r31,r31,1 ffc10f6c: 7f 9d f8 40 cmplw cr7,r29,r31 ffc10f70: 41 9c 00 58 blt- cr7,ffc10fc8 if ( !IMFS_memfile_addblock( the_jnode, block ) ) { ffc10f74: 7f e4 fb 78 mr r4,r31 ffc10f78: 7f c3 f3 78 mr r3,r30 ffc10f7c: 4b ff fc 09 bl ffc10b84 ffc10f80: 2f 83 00 00 cmpwi cr7,r3,0 ffc10f84: 40 9e 01 08 bne- cr7,ffc1108c <== NEVER TAKEN if ( zero_fill ) { ffc10f88: 41 92 ff e0 beq+ cr4,ffc10f68 size_t count = IMFS_MEMFILE_BYTES_PER_BLOCK - offset; block_p *block_ptr = ffc10f8c: 7f e4 fb 78 mr r4,r31 * 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; ffc10f90: 83 19 28 00 lwz r24,10240(r25) block_p *block_ptr = ffc10f94: 38 a0 00 00 li r5,0 ffc10f98: 7f c3 f3 78 mr r3,r30 ffc10f9c: 4b ff f6 45 bl ffc105e0 * 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; ffc10fa0: 7f 1c c0 50 subf r24,r28,r24 block_p *block_ptr = IMFS_memfile_get_block_pointer( the_jnode, block, 0 ); memset( &(*block_ptr) [offset], 0, count); ffc10fa4: 80 63 00 00 lwz r3,0(r3) ffc10fa8: 38 80 00 00 li r4,0 ffc10fac: 7f 05 c3 78 mr r5,r24 ffc10fb0: 7c 63 e2 14 add r3,r3,r28 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++ ) { ffc10fb4: 3b ff 00 01 addi r31,r31,1 if ( zero_fill ) { size_t count = IMFS_MEMFILE_BYTES_PER_BLOCK - offset; block_p *block_ptr = IMFS_memfile_get_block_pointer( the_jnode, block, 0 ); memset( &(*block_ptr) [offset], 0, count); ffc10fb8: 48 00 1e b9 bl ffc12e70 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++ ) { ffc10fbc: 7f 9d f8 40 cmplw cr7,r29,r31 size_t count = IMFS_MEMFILE_BYTES_PER_BLOCK - offset; block_p *block_ptr = IMFS_memfile_get_block_pointer( the_jnode, block, 0 ); memset( &(*block_ptr) [offset], 0, count); offset = 0; ffc10fc0: 3b 80 00 00 li r28,0 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++ ) { ffc10fc4: 40 9c ff b0 bge+ cr7,ffc10f74 } /* * Set the new length of the file. */ the_jnode->info.file.size = new_length; ffc10fc8: 93 5e 00 50 stw r26,80(r30) IMFS_update_ctime(the_jnode); ffc10fcc: 38 80 00 00 li r4,0 ffc10fd0: 38 61 00 08 addi r3,r1,8 } /* * Set the new length of the file. */ the_jnode->info.file.size = new_length; ffc10fd4: 92 fe 00 54 stw r23,84(r30) IMFS_update_ctime(the_jnode); ffc10fd8: 4b ff 3c 7d bl ffc04c54 ffc10fdc: 81 21 00 08 lwz r9,8(r1) IMFS_update_mtime(the_jnode); ffc10fe0: 38 61 00 08 addi r3,r1,8 /* * Set the new length of the file. */ the_jnode->info.file.size = new_length; IMFS_update_ctime(the_jnode); ffc10fe4: 91 3e 00 48 stw r9,72(r30) IMFS_update_mtime(the_jnode); ffc10fe8: 38 80 00 00 li r4,0 ffc10fec: 4b ff 3c 69 bl ffc04c54 return 0; } ffc10ff0: 80 01 00 4c lwz r0,76(r1) * Set the new length of the file. */ the_jnode->info.file.size = new_length; IMFS_update_ctime(the_jnode); IMFS_update_mtime(the_jnode); ffc10ff4: 81 21 00 08 lwz r9,8(r1) return 0; ffc10ff8: 38 60 00 00 li r3,0 } ffc10ffc: 7c 08 03 a6 mtlr r0 ffc11000: 81 81 00 1c lwz r12,28(r1) * Set the new length of the file. */ the_jnode->info.file.size = new_length; IMFS_update_ctime(the_jnode); IMFS_update_mtime(the_jnode); ffc11004: 91 3e 00 44 stw r9,68(r30) return 0; } ffc11008: 7d 80 81 20 mtcrf 8,r12 ffc1100c: 82 c1 00 20 lwz r22,32(r1) ffc11010: 82 e1 00 24 lwz r23,36(r1) ffc11014: 83 01 00 28 lwz r24,40(r1) ffc11018: 83 21 00 2c lwz r25,44(r1) ffc1101c: 83 41 00 30 lwz r26,48(r1) ffc11020: 83 61 00 34 lwz r27,52(r1) ffc11024: 83 81 00 38 lwz r28,56(r1) ffc11028: 83 a1 00 3c lwz r29,60(r1) ffc1102c: 83 c1 00 40 lwz r30,64(r1) ffc11030: 83 e1 00 44 lwz r31,68(r1) ffc11034: 38 21 00 48 addi r1,r1,72 ffc11038: 4e 80 00 20 blr rtems_set_errno_and_return_minus_one( EFBIG ); /* * Verify new file size is actually larger than current size */ if ( new_length <= the_jnode->info.file.size ) ffc1103c: 40 9e 00 0c bne- cr7,ffc11048 <== NEVER TAKEN ffc11040: 7f 97 c0 40 cmplw cr7,r23,r24 ffc11044: 41 9d fe d4 bgt+ cr7,ffc10f18 <== ALWAYS TAKEN return 0; ffc11048: 38 60 00 00 li r3,0 <== NOT EXECUTED the_jnode->info.file.size = new_length; IMFS_update_ctime(the_jnode); IMFS_update_mtime(the_jnode); return 0; } ffc1104c: 80 01 00 4c lwz r0,76(r1) ffc11050: 81 81 00 1c lwz r12,28(r1) ffc11054: 7c 08 03 a6 mtlr r0 ffc11058: 82 c1 00 20 lwz r22,32(r1) ffc1105c: 82 e1 00 24 lwz r23,36(r1) ffc11060: 7d 80 81 20 mtcrf 8,r12 ffc11064: 83 01 00 28 lwz r24,40(r1) ffc11068: 83 21 00 2c lwz r25,44(r1) ffc1106c: 83 41 00 30 lwz r26,48(r1) ffc11070: 83 61 00 34 lwz r27,52(r1) ffc11074: 83 81 00 38 lwz r28,56(r1) ffc11078: 83 a1 00 3c lwz r29,60(r1) ffc1107c: 83 c1 00 40 lwz r30,64(r1) ffc11080: 83 e1 00 44 lwz r31,68(r1) ffc11084: 38 21 00 48 addi r1,r1,72 ffc11088: 4e 80 00 20 blr memset( &(*block_ptr) [offset], 0, count); offset = 0; } } else { for ( ; block>=old_blocks ; block-- ) { ffc1108c: 7f 9f d8 40 cmplw cr7,r31,r27 <== NOT EXECUTED ffc11090: 41 9c 00 1c blt- cr7,ffc110ac <== NOT EXECUTED IMFS_memfile_remove_block( the_jnode, block ); ffc11094: 7f e4 fb 78 mr r4,r31 <== NOT EXECUTED ffc11098: 7f c3 f3 78 mr r3,r30 <== NOT EXECUTED memset( &(*block_ptr) [offset], 0, count); offset = 0; } } else { for ( ; block>=old_blocks ; block-- ) { ffc1109c: 3b ff ff ff addi r31,r31,-1 <== NOT EXECUTED IMFS_memfile_remove_block( the_jnode, block ); ffc110a0: 4b ff fd b1 bl ffc10e50 <== NOT EXECUTED memset( &(*block_ptr) [offset], 0, count); offset = 0; } } else { for ( ; block>=old_blocks ; block-- ) { ffc110a4: 7f 9b f8 40 cmplw cr7,r27,r31 <== NOT EXECUTED ffc110a8: 40 9d ff ec ble+ cr7,ffc11094 <== NOT EXECUTED IMFS_memfile_remove_block( the_jnode, block ); } rtems_set_errno_and_return_minus_one( ENOSPC ); ffc110ac: 48 00 0f cd bl ffc12078 <__errno> <== NOT EXECUTED the_jnode->info.file.size = new_length; IMFS_update_ctime(the_jnode); IMFS_update_mtime(the_jnode); return 0; } ffc110b0: 80 01 00 4c lwz r0,76(r1) <== NOT EXECUTED ffc110b4: 81 81 00 1c lwz r12,28(r1) <== NOT EXECUTED } } else { for ( ; block>=old_blocks ; block-- ) { IMFS_memfile_remove_block( the_jnode, block ); } rtems_set_errno_and_return_minus_one( ENOSPC ); ffc110b8: 39 20 00 1c li r9,28 <== NOT EXECUTED the_jnode->info.file.size = new_length; IMFS_update_ctime(the_jnode); IMFS_update_mtime(the_jnode); return 0; } ffc110bc: 7c 08 03 a6 mtlr r0 <== NOT EXECUTED } } else { for ( ; block>=old_blocks ; block-- ) { IMFS_memfile_remove_block( the_jnode, block ); } rtems_set_errno_and_return_minus_one( ENOSPC ); ffc110c0: 91 23 00 00 stw r9,0(r3) <== NOT EXECUTED the_jnode->info.file.size = new_length; IMFS_update_ctime(the_jnode); IMFS_update_mtime(the_jnode); return 0; } ffc110c4: 7d 80 81 20 mtcrf 8,r12 <== NOT EXECUTED } } else { for ( ; block>=old_blocks ; block-- ) { IMFS_memfile_remove_block( the_jnode, block ); } rtems_set_errno_and_return_minus_one( ENOSPC ); ffc110c8: 38 60 ff ff li r3,-1 <== NOT EXECUTED the_jnode->info.file.size = new_length; IMFS_update_ctime(the_jnode); IMFS_update_mtime(the_jnode); return 0; } ffc110cc: 82 c1 00 20 lwz r22,32(r1) <== NOT EXECUTED ffc110d0: 82 e1 00 24 lwz r23,36(r1) <== NOT EXECUTED ffc110d4: 83 01 00 28 lwz r24,40(r1) <== NOT EXECUTED ffc110d8: 83 21 00 2c lwz r25,44(r1) <== NOT EXECUTED ffc110dc: 83 41 00 30 lwz r26,48(r1) <== NOT EXECUTED ffc110e0: 83 61 00 34 lwz r27,52(r1) <== NOT EXECUTED ffc110e4: 83 81 00 38 lwz r28,56(r1) <== NOT EXECUTED ffc110e8: 83 a1 00 3c lwz r29,60(r1) <== NOT EXECUTED ffc110ec: 83 c1 00 40 lwz r30,64(r1) <== NOT EXECUTED ffc110f0: 83 e1 00 44 lwz r31,68(r1) <== NOT EXECUTED ffc110f4: 38 21 00 48 addi r1,r1,72 <== NOT EXECUTED ffc110f8: 4e 80 00 20 blr <== NOT EXECUTED IMFS_assert( IMFS_type( the_jnode ) == IMFS_MEMORY_FILE ); /* * Verify new file size is supported */ if ( new_length >= IMFS_MEMFILE_MAXIMUM_SIZE ) ffc110fc: 40 9e 00 0c bne- cr7,ffc11108 <== NEVER TAKEN ffc11100: 7f 89 30 40 cmplw cr7,r9,r6 ffc11104: 41 9d fe 04 bgt+ cr7,ffc10f08 rtems_set_errno_and_return_minus_one( EFBIG ); ffc11108: 48 00 0f 71 bl ffc12078 <__errno> ffc1110c: 39 20 00 1b li r9,27 ffc11110: 91 23 00 00 stw r9,0(r3) ffc11114: 38 60 ff ff li r3,-1 ffc11118: 4b ff ff 34 b ffc1104c =============================================================================== ffc105e0 : my_block = block; /* * Is the block number in the simple indirect portion? */ if ( my_block <= LAST_INDIRECT ) { ffc105e0: 3d 20 00 00 lis r9,0 #endif IMFS_jnode_t *the_jnode, unsigned int block, int malloc_it ) { ffc105e4: 94 21 ff e0 stwu r1,-32(r1) ffc105e8: 7c 08 02 a6 mflr r0 my_block = block; /* * Is the block number in the simple indirect portion? */ if ( my_block <= LAST_INDIRECT ) { ffc105ec: 81 29 28 00 lwz r9,10240(r9) #endif IMFS_jnode_t *the_jnode, unsigned int block, int malloc_it ) { ffc105f0: 93 e1 00 1c stw r31,28(r1) ffc105f4: 7c 7f 1b 78 mr r31,r3 my_block = block; /* * Is the block number in the simple indirect portion? */ if ( my_block <= LAST_INDIRECT ) { ffc105f8: 55 29 f0 be rlwinm r9,r9,30,2,31 ffc105fc: 39 49 ff ff addi r10,r9,-1 #endif IMFS_jnode_t *the_jnode, unsigned int block, int malloc_it ) { ffc10600: 90 01 00 24 stw r0,36(r1) my_block = block; /* * Is the block number in the simple indirect portion? */ if ( my_block <= LAST_INDIRECT ) { ffc10604: 7f 84 50 40 cmplw cr7,r4,r10 #endif IMFS_jnode_t *the_jnode, unsigned int block, int malloc_it ) { ffc10608: 93 81 00 10 stw r28,16(r1) ffc1060c: 93 a1 00 14 stw r29,20(r1) ffc10610: 93 c1 00 18 stw r30,24(r1) my_block = block; /* * Is the block number in the simple indirect portion? */ if ( my_block <= LAST_INDIRECT ) { ffc10614: 41 9d 00 40 bgt- cr7,ffc10654 p = info->indirect; if ( malloc_it ) { ffc10618: 2f 85 00 00 cmpwi cr7,r5,0 /* * Is the block number in the simple indirect portion? */ if ( my_block <= LAST_INDIRECT ) { p = info->indirect; ffc1061c: 80 63 00 58 lwz r3,88(r3) if ( malloc_it ) { ffc10620: 40 9e 01 3c bne- cr7,ffc1075c info->indirect = p; } return &info->indirect[ my_block ]; } if ( !p ) ffc10624: 2f 83 00 00 cmpwi cr7,r3,0 ffc10628: 41 9e 01 e8 beq- cr7,ffc10810 <== NEVER TAKEN return 0; return &info->indirect[ my_block ]; ffc1062c: 54 84 10 3a rlwinm r4,r4,2,0,29 ffc10630: 7c 63 22 14 add r3,r3,r4 /* * This means the requested block number is out of range. */ return 0; } ffc10634: 80 01 00 24 lwz r0,36(r1) ffc10638: 83 81 00 10 lwz r28,16(r1) ffc1063c: 7c 08 03 a6 mtlr r0 ffc10640: 83 a1 00 14 lwz r29,20(r1) ffc10644: 83 c1 00 18 lwz r30,24(r1) ffc10648: 83 e1 00 1c lwz r31,28(r1) ffc1064c: 38 21 00 20 addi r1,r1,32 ffc10650: 4e 80 00 20 blr /* * Is the block number in the doubly indirect portion? */ if ( my_block <= LAST_DOUBLY_INDIRECT ) { ffc10654: 39 49 00 01 addi r10,r9,1 ffc10658: 7d 4a 49 d6 mullw r10,r10,r9 ffc1065c: 39 0a ff ff addi r8,r10,-1 ffc10660: 7f 84 40 40 cmplw cr7,r4,r8 ffc10664: 40 9d 00 98 ble- cr7,ffc106fc } /* * Is the block number in the triply indirect portion? */ if ( my_block <= LAST_TRIPLY_INDIRECT ) { ffc10668: 39 0a 00 01 addi r8,r10,1 ffc1066c: 7d 08 49 d6 mullw r8,r8,r9 ffc10670: 39 08 ff ff addi r8,r8,-1 ffc10674: 7f 84 40 40 cmplw cr7,r4,r8 ffc10678: 41 9d 01 98 bgt- cr7,ffc10810 <== NEVER TAKEN my_block -= FIRST_TRIPLY_INDIRECT; ffc1067c: 7c 8a 20 50 subf r4,r10,r4 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; p = info->triply_indirect; ffc10680: 80 63 00 60 lwz r3,96(r3) * 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; ffc10684: 7d 04 4b 96 divwu r8,r4,r9 doubly = my_block / IMFS_MEMFILE_BLOCK_SLOTS; triply = doubly / IMFS_MEMFILE_BLOCK_SLOTS; ffc10688: 7f c8 4b 96 divwu r30,r8,r9 doubly %= IMFS_MEMFILE_BLOCK_SLOTS; p = info->triply_indirect; if ( malloc_it ) { ffc1068c: 2f 85 00 00 cmpwi cr7,r5,0 * 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; ffc10690: 7d 48 49 d6 mullw r10,r8,r9 doubly = my_block / IMFS_MEMFILE_BLOCK_SLOTS; triply = doubly / IMFS_MEMFILE_BLOCK_SLOTS; doubly %= IMFS_MEMFILE_BLOCK_SLOTS; ffc10694: 7d 3e 49 d6 mullw r9,r30,r9 * 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; ffc10698: 7f 8a 20 50 subf r28,r10,r4 doubly = my_block / IMFS_MEMFILE_BLOCK_SLOTS; triply = doubly / IMFS_MEMFILE_BLOCK_SLOTS; doubly %= IMFS_MEMFILE_BLOCK_SLOTS; ffc1069c: 7f a9 40 50 subf r29,r9,r8 p = info->triply_indirect; if ( malloc_it ) { ffc106a0: 41 9e 01 20 beq- cr7,ffc107c0 if ( !p ) { ffc106a4: 2f 83 00 00 cmpwi cr7,r3,0 ffc106a8: 41 9e 01 c0 beq- cr7,ffc10868 if ( !p ) return 0; info->triply_indirect = p; } p1 = (block_p *) p[ triply ]; ffc106ac: 57 de 10 3a rlwinm r30,r30,2,0,29 ffc106b0: 7c c3 f0 2e lwzx r6,r3,r30 ffc106b4: 7f c3 f2 14 add r30,r3,r30 if ( !p1 ) { ffc106b8: 2f 86 00 00 cmpwi cr7,r6,0 ffc106bc: 41 9e 01 98 beq- cr7,ffc10854 if ( !p1 ) return 0; p[ triply ] = (block_p) p1; } p2 = (block_p *)p1[ doubly ]; ffc106c0: 57 bd 10 3a rlwinm r29,r29,2,0,29 ffc106c4: 7c e6 e8 2e lwzx r7,r6,r29 ffc106c8: 7f a6 ea 14 add r29,r6,r29 if ( !p2 ) { ffc106cc: 2f 87 00 00 cmpwi cr7,r7,0 ffc106d0: 41 9e 01 5c beq- cr7,ffc1082c /* * This means the requested block number is out of range. */ return 0; } ffc106d4: 80 01 00 24 lwz r0,36(r1) p2 = memfile_alloc_block(); if ( !p2 ) return 0; p1[ doubly ] = (block_p) p2; } return (block_p *)&p2[ singly ]; ffc106d8: 57 83 10 3a rlwinm r3,r28,2,0,29 /* * This means the requested block number is out of range. */ return 0; } ffc106dc: 83 a1 00 14 lwz r29,20(r1) p2 = memfile_alloc_block(); if ( !p2 ) return 0; p1[ doubly ] = (block_p) p2; } return (block_p *)&p2[ singly ]; ffc106e0: 7c 67 1a 14 add r3,r7,r3 /* * This means the requested block number is out of range. */ return 0; } ffc106e4: 7c 08 03 a6 mtlr r0 ffc106e8: 83 81 00 10 lwz r28,16(r1) ffc106ec: 83 c1 00 18 lwz r30,24(r1) ffc106f0: 83 e1 00 1c lwz r31,28(r1) ffc106f4: 38 21 00 20 addi r1,r1,32 ffc106f8: 4e 80 00 20 blr /* * Is the block number in the doubly indirect portion? */ if ( my_block <= LAST_DOUBLY_INDIRECT ) { my_block -= FIRST_DOUBLY_INDIRECT; ffc106fc: 7c 89 20 50 subf r4,r9,r4 singly = my_block % IMFS_MEMFILE_BLOCK_SLOTS; doubly = my_block / IMFS_MEMFILE_BLOCK_SLOTS; p = info->doubly_indirect; ffc10700: 80 63 00 5c lwz r3,92(r3) */ if ( my_block <= LAST_DOUBLY_INDIRECT ) { my_block -= FIRST_DOUBLY_INDIRECT; singly = my_block % IMFS_MEMFILE_BLOCK_SLOTS; ffc10704: 7f c4 4b 96 divwu r30,r4,r9 doubly = my_block / IMFS_MEMFILE_BLOCK_SLOTS; p = info->doubly_indirect; if ( malloc_it ) { ffc10708: 2f 85 00 00 cmpwi cr7,r5,0 */ if ( my_block <= LAST_DOUBLY_INDIRECT ) { my_block -= FIRST_DOUBLY_INDIRECT; singly = my_block % IMFS_MEMFILE_BLOCK_SLOTS; ffc1070c: 7d 3e 49 d6 mullw r9,r30,r9 ffc10710: 7f a9 20 50 subf r29,r9,r4 doubly = my_block / IMFS_MEMFILE_BLOCK_SLOTS; p = info->doubly_indirect; if ( malloc_it ) { ffc10714: 41 9e 00 6c beq- cr7,ffc10780 if ( !p ) { ffc10718: 2f 83 00 00 cmpwi cr7,r3,0 ffc1071c: 41 9e 01 24 beq- cr7,ffc10840 if ( !p ) return 0; info->doubly_indirect = p; } p1 = (block_p *)p[ doubly ]; ffc10720: 57 de 10 3a rlwinm r30,r30,2,0,29 ffc10724: 7d 03 f0 2e lwzx r8,r3,r30 ffc10728: 7f c3 f2 14 add r30,r3,r30 if ( !p1 ) { ffc1072c: 2f 88 00 00 cmpwi cr7,r8,0 ffc10730: 41 9e 00 e8 beq- cr7,ffc10818 /* * This means the requested block number is out of range. */ return 0; } ffc10734: 80 01 00 24 lwz r0,36(r1) if ( !p1 ) return 0; p[ doubly ] = (block_p) p1; } return (block_p *)&p1[ singly ]; ffc10738: 57 a3 10 3a rlwinm r3,r29,2,0,29 /* * This means the requested block number is out of range. */ return 0; } ffc1073c: 83 81 00 10 lwz r28,16(r1) if ( !p1 ) return 0; p[ doubly ] = (block_p) p1; } return (block_p *)&p1[ singly ]; ffc10740: 7c 68 1a 14 add r3,r8,r3 /* * This means the requested block number is out of range. */ return 0; } ffc10744: 7c 08 03 a6 mtlr r0 ffc10748: 83 a1 00 14 lwz r29,20(r1) ffc1074c: 83 c1 00 18 lwz r30,24(r1) ffc10750: 83 e1 00 1c lwz r31,28(r1) ffc10754: 38 21 00 20 addi r1,r1,32 ffc10758: 4e 80 00 20 blr if ( my_block <= LAST_INDIRECT ) { p = info->indirect; if ( malloc_it ) { if ( !p ) { ffc1075c: 2f 83 00 00 cmpwi cr7,r3,0 ffc10760: 40 9e fe cc bne+ cr7,ffc1062c p = memfile_alloc_block(); ffc10764: 90 81 00 08 stw r4,8(r1) ffc10768: 4b ff fe 35 bl ffc1059c if ( !p ) ffc1076c: 2c 03 00 00 cmpwi r3,0 ffc10770: 80 81 00 08 lwz r4,8(r1) ffc10774: 41 82 00 9c beq- ffc10810 <== NEVER TAKEN return 0; info->indirect = p; ffc10778: 90 7f 00 58 stw r3,88(r31) ffc1077c: 4b ff fe b0 b ffc1062c } return (block_p *)&p1[ singly ]; } if ( !p ) ffc10780: 2f 83 00 00 cmpwi cr7,r3,0 ffc10784: 41 9e 00 8c beq- cr7,ffc10810 <== NEVER TAKEN return 0; p = (block_p *)p[ doubly ]; ffc10788: 57 de 10 3a rlwinm r30,r30,2,0,29 ffc1078c: 7d 43 f0 2e lwzx r10,r3,r30 if ( !p ) ffc10790: 2f 8a 00 00 cmpwi cr7,r10,0 ffc10794: 41 9e 00 7c beq- cr7,ffc10810 <== NEVER TAKEN /* * This means the requested block number is out of range. */ return 0; } ffc10798: 80 01 00 24 lwz r0,36(r1) p = (block_p *)p[ doubly ]; if ( !p ) return 0; return (block_p *)&p[ singly ]; ffc1079c: 57 a3 10 3a rlwinm r3,r29,2,0,29 /* * This means the requested block number is out of range. */ return 0; } ffc107a0: 83 81 00 10 lwz r28,16(r1) p = (block_p *)p[ doubly ]; if ( !p ) return 0; return (block_p *)&p[ singly ]; ffc107a4: 7c 6a 1a 14 add r3,r10,r3 /* * This means the requested block number is out of range. */ return 0; } ffc107a8: 7c 08 03 a6 mtlr r0 ffc107ac: 83 a1 00 14 lwz r29,20(r1) ffc107b0: 83 c1 00 18 lwz r30,24(r1) ffc107b4: 83 e1 00 1c lwz r31,28(r1) ffc107b8: 38 21 00 20 addi r1,r1,32 ffc107bc: 4e 80 00 20 blr p1[ doubly ] = (block_p) p2; } return (block_p *)&p2[ singly ]; } if ( !p ) ffc107c0: 2f 83 00 00 cmpwi cr7,r3,0 ffc107c4: 41 9e 00 4c beq- cr7,ffc10810 <== NEVER TAKEN return 0; p1 = (block_p *) p[ triply ]; ffc107c8: 57 de 10 3a rlwinm r30,r30,2,0,29 ffc107cc: 7d 43 f0 2e lwzx r10,r3,r30 if ( !p1 ) ffc107d0: 2f 8a 00 00 cmpwi cr7,r10,0 ffc107d4: 41 9e 00 3c beq- cr7,ffc10810 <== NEVER TAKEN return 0; p2 = (block_p *)p1[ doubly ]; ffc107d8: 57 bd 10 3a rlwinm r29,r29,2,0,29 ffc107dc: 7d 2a e8 2e lwzx r9,r10,r29 if ( !p2 ) ffc107e0: 2f 89 00 00 cmpwi cr7,r9,0 ffc107e4: 41 9e 00 2c beq- cr7,ffc10810 <== NEVER TAKEN /* * This means the requested block number is out of range. */ return 0; } ffc107e8: 80 01 00 24 lwz r0,36(r1) p2 = (block_p *)p1[ doubly ]; if ( !p2 ) return 0; return (block_p *)&p2[ singly ]; ffc107ec: 57 83 10 3a rlwinm r3,r28,2,0,29 /* * This means the requested block number is out of range. */ return 0; } ffc107f0: 83 a1 00 14 lwz r29,20(r1) p2 = (block_p *)p1[ doubly ]; if ( !p2 ) return 0; return (block_p *)&p2[ singly ]; ffc107f4: 7c 69 1a 14 add r3,r9,r3 /* * This means the requested block number is out of range. */ return 0; } ffc107f8: 7c 08 03 a6 mtlr r0 ffc107fc: 83 81 00 10 lwz r28,16(r1) ffc10800: 83 c1 00 18 lwz r30,24(r1) ffc10804: 83 e1 00 1c lwz r31,28(r1) ffc10808: 38 21 00 20 addi r1,r1,32 ffc1080c: 4e 80 00 20 blr if ( malloc_it ) { if ( !p ) { p = memfile_alloc_block(); if ( !p ) return 0; ffc10810: 38 60 00 00 li r3,0 <== NOT EXECUTED ffc10814: 4b ff fe 20 b ffc10634 <== NOT EXECUTED info->doubly_indirect = p; } p1 = (block_p *)p[ doubly ]; if ( !p1 ) { p1 = memfile_alloc_block(); ffc10818: 4b ff fd 85 bl ffc1059c if ( !p1 ) ffc1081c: 7c 68 1b 79 mr. r8,r3 ffc10820: 41 a2 ff f0 beq- ffc10810 <== NEVER TAKEN return 0; p[ doubly ] = (block_p) p1; ffc10824: 91 1e 00 00 stw r8,0(r30) ffc10828: 4b ff ff 0c b ffc10734 p[ triply ] = (block_p) p1; } p2 = (block_p *)p1[ doubly ]; if ( !p2 ) { p2 = memfile_alloc_block(); ffc1082c: 4b ff fd 71 bl ffc1059c if ( !p2 ) ffc10830: 7c 67 1b 79 mr. r7,r3 ffc10834: 41 a2 ff dc beq- ffc10810 <== NEVER TAKEN return 0; p1[ doubly ] = (block_p) p2; ffc10838: 90 fd 00 00 stw r7,0(r29) ffc1083c: 4b ff fe 98 b ffc106d4 p = info->doubly_indirect; if ( malloc_it ) { if ( !p ) { p = memfile_alloc_block(); ffc10840: 4b ff fd 5d bl ffc1059c if ( !p ) ffc10844: 2c 03 00 00 cmpwi r3,0 ffc10848: 41 a2 ff c8 beq- ffc10810 <== NEVER TAKEN return 0; info->doubly_indirect = p; ffc1084c: 90 7f 00 5c stw r3,92(r31) ffc10850: 4b ff fe d0 b ffc10720 info->triply_indirect = p; } p1 = (block_p *) p[ triply ]; if ( !p1 ) { p1 = memfile_alloc_block(); ffc10854: 4b ff fd 49 bl ffc1059c if ( !p1 ) ffc10858: 7c 66 1b 79 mr. r6,r3 ffc1085c: 41 a2 ff b4 beq- ffc10810 <== NEVER TAKEN return 0; p[ triply ] = (block_p) p1; ffc10860: 90 de 00 00 stw r6,0(r30) ffc10864: 4b ff fe 5c b ffc106c0 p = info->triply_indirect; if ( malloc_it ) { if ( !p ) { p = memfile_alloc_block(); ffc10868: 4b ff fd 35 bl ffc1059c if ( !p ) ffc1086c: 2c 03 00 00 cmpwi r3,0 ffc10870: 41 a2 ff a0 beq- ffc10810 <== NEVER TAKEN return 0; info->triply_indirect = p; ffc10874: 90 7f 00 60 stw r3,96(r31) ffc10878: 4b ff fe 34 b ffc106ac =============================================================================== ffc1087c : IMFS_jnode_t *the_jnode, off_t start, unsigned char *destination, unsigned int length ) { ffc1087c: 94 21 ff c0 stwu r1,-64(r1) ffc10880: 7c 08 02 a6 mflr r0 ffc10884: 93 01 00 20 stw r24,32(r1) ffc10888: 7c f8 3b 78 mr r24,r7 ffc1088c: 90 01 00 44 stw r0,68(r1) ffc10890: 93 41 00 28 stw r26,40(r1) ffc10894: 7c 7a 1b 78 mr r26,r3 ffc10898: 93 c1 00 38 stw r30,56(r1) ffc1089c: 7c be 2b 78 mr r30,r5 ffc108a0: 93 e1 00 3c stw r31,60(r1) ffc108a4: 7c df 33 78 mr r31,r6 ffc108a8: 92 e1 00 1c stw r23,28(r1) ffc108ac: 93 21 00 24 stw r25,36(r1) ffc108b0: 93 61 00 2c stw r27,44(r1) ffc108b4: 93 81 00 30 stw r28,48(r1) ffc108b8: 93 a1 00 34 stw r29,52(r1) rtems_chain_extract_unprotected( &node->Node ); } static inline IMFS_jnode_types_t IMFS_type( const IMFS_jnode_t *node ) { return node->control->imfs_type; ffc108bc: 81 23 00 4c lwz r9,76(r3) * 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 ) { ffc108c0: 81 29 00 00 lwz r9,0(r9) ffc108c4: 2f 89 00 05 cmpwi cr7,r9,5 ffc108c8: 41 9e 01 d8 beq- cr7,ffc10aa0 /* * 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 ) ffc108cc: 81 23 00 50 lwz r9,80(r3) ffc108d0: 39 40 00 00 li r10,0 ffc108d4: 83 83 00 54 lwz r28,84(r3) ffc108d8: 7f 8a 48 00 cmpw cr7,r10,r9 /* * 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; ffc108dc: 7c c9 33 78 mr r9,r6 ffc108e0: 7d 48 32 14 add r10,r8,r6 if ( last_byte > the_jnode->info.file.size ) ffc108e4: 40 9d 01 24 ble- cr7,ffc10a08 <== ALWAYS TAKEN my_length = the_jnode->info.file.size - start; ffc108e8: 7f 89 e0 50 subf r28,r9,r28 */ /* * Phase 1: possibly the last part of one block */ start_offset = start % IMFS_MEMFILE_BYTES_PER_BLOCK; ffc108ec: 3f 20 00 00 lis r25,0 ffc108f0: 83 b9 28 00 lwz r29,10240(r25) ffc108f4: 7f e4 fb 78 mr r4,r31 ffc108f8: 7f c3 f3 78 mr r3,r30 ffc108fc: 7f bb fe 70 srawi r27,r29,31 ffc10900: 7f 65 db 78 mr r5,r27 ffc10904: 7f a6 eb 78 mr r6,r29 ffc10908: 48 00 b3 ad bl ffc1bcb4 <__moddi3> block = start / IMFS_MEMFILE_BYTES_PER_BLOCK; ffc1090c: 7f c3 f3 78 mr r3,r30 */ /* * Phase 1: possibly the last part of one block */ start_offset = start % IMFS_MEMFILE_BYTES_PER_BLOCK; ffc10910: 7c 97 23 78 mr r23,r4 block = start / IMFS_MEMFILE_BYTES_PER_BLOCK; ffc10914: 7f 65 db 78 mr r5,r27 ffc10918: 7f e4 fb 78 mr r4,r31 ffc1091c: 7f a6 eb 78 mr r6,r29 ffc10920: 48 00 af 71 bl ffc1b890 <__divdi3> if ( start_offset ) { ffc10924: 2f 97 00 00 cmpwi cr7,r23,0 /* * Phase 1: possibly the last part of one block */ start_offset = start % IMFS_MEMFILE_BYTES_PER_BLOCK; block = start / IMFS_MEMFILE_BYTES_PER_BLOCK; ffc10928: 7c 9f 23 78 mr r31,r4 if ( start_offset ) { ffc1092c: 41 9e 00 e8 beq- cr7,ffc10a14 to_copy = IMFS_MEMFILE_BYTES_PER_BLOCK - start_offset; ffc10930: 7f b7 e8 50 subf r29,r23,r29 ffc10934: 7f 9c e8 40 cmplw cr7,r28,r29 ffc10938: 7f 9b e3 78 mr r27,r28 ffc1093c: 41 9d 01 b4 bgt- cr7,ffc10af0 if ( to_copy > my_length ) to_copy = my_length; block_ptr = IMFS_memfile_get_block_pointer( the_jnode, block, 0 ); ffc10940: 7f 43 d3 78 mr r3,r26 ffc10944: 7f e4 fb 78 mr r4,r31 ffc10948: 38 a0 00 00 li r5,0 ffc1094c: 4b ff fc 95 bl ffc105e0 if ( !block_ptr ) ffc10950: 7c 69 1b 79 mr. r9,r3 return copied; ffc10954: 38 60 00 00 li r3,0 if ( start_offset ) { to_copy = IMFS_MEMFILE_BYTES_PER_BLOCK - start_offset; if ( to_copy > my_length ) to_copy = my_length; block_ptr = IMFS_memfile_get_block_pointer( the_jnode, block, 0 ); if ( !block_ptr ) ffc10958: 41 82 00 7c beq- ffc109d4 <== NEVER TAKEN return copied; memcpy( dest, &(*block_ptr)[ start_offset ], to_copy ); ffc1095c: 80 89 00 00 lwz r4,0(r9) ffc10960: 7f 03 c3 78 mr r3,r24 ffc10964: 7f 65 db 78 mr r5,r27 ffc10968: 7c 84 ba 14 add r4,r4,r23 ffc1096c: 48 00 24 11 bl ffc12d7c ffc10970: 83 b9 28 00 lwz r29,10240(r25) dest += to_copy; ffc10974: 7f d8 da 14 add r30,r24,r27 block++; ffc10978: 3b ff 00 01 addi r31,r31,1 my_length -= to_copy; ffc1097c: 7f 9b e0 50 subf r28,r27,r28 /* * Phase 2: all of zero of more blocks */ to_copy = IMFS_MEMFILE_BYTES_PER_BLOCK; while ( my_length >= IMFS_MEMFILE_BYTES_PER_BLOCK ) { ffc10980: 7f 9c e8 40 cmplw cr7,r28,r29 ffc10984: 40 bc 00 20 bge+ cr7,ffc109a4 ffc10988: 48 00 00 98 b ffc10a20 block_ptr = IMFS_memfile_get_block_pointer( the_jnode, block, 0 ); if ( !block_ptr ) return copied; memcpy( dest, &(*block_ptr)[ 0 ], to_copy ); ffc1098c: 80 89 00 00 lwz r4,0(r9) dest += to_copy; block++; my_length -= to_copy; copied += to_copy; ffc10990: 7f 7b ea 14 add r27,r27,r29 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 ) return copied; memcpy( dest, &(*block_ptr)[ 0 ], to_copy ); ffc10994: 48 00 23 e9 bl ffc12d7c /* * Phase 2: all of zero of more blocks */ to_copy = IMFS_MEMFILE_BYTES_PER_BLOCK; while ( my_length >= IMFS_MEMFILE_BYTES_PER_BLOCK ) { ffc10998: 81 39 28 00 lwz r9,10240(r25) ffc1099c: 7f 89 e0 40 cmplw cr7,r9,r28 ffc109a0: 41 9d 00 80 bgt- cr7,ffc10a20 block_ptr = IMFS_memfile_get_block_pointer( the_jnode, block, 0 ); ffc109a4: 7f e4 fb 78 mr r4,r31 ffc109a8: 38 a0 00 00 li r5,0 ffc109ac: 7f 43 d3 78 mr r3,r26 ffc109b0: 4b ff fc 31 bl ffc105e0 if ( !block_ptr ) return copied; memcpy( dest, &(*block_ptr)[ 0 ], to_copy ); dest += to_copy; block++; my_length -= to_copy; ffc109b4: 7f 9d e0 50 subf r28,r29,r28 * Phase 2: all of zero of more blocks */ 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 ) ffc109b8: 7c 69 1b 79 mr. r9,r3 return copied; memcpy( dest, &(*block_ptr)[ 0 ], to_copy ); ffc109bc: 7f a5 eb 78 mr r5,r29 ffc109c0: 7f c3 f3 78 mr r3,r30 dest += to_copy; block++; ffc109c4: 3b ff 00 01 addi r31,r31,1 while ( my_length >= IMFS_MEMFILE_BYTES_PER_BLOCK ) { block_ptr = IMFS_memfile_get_block_pointer( the_jnode, block, 0 ); if ( !block_ptr ) return copied; memcpy( dest, &(*block_ptr)[ 0 ], to_copy ); dest += to_copy; ffc109c8: 7f de ea 14 add r30,r30,r29 * Phase 2: all of zero of more blocks */ 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 ) ffc109cc: 40 82 ff c0 bne+ ffc1098c <== ALWAYS TAKEN IMFS_assert( my_length < IMFS_MEMFILE_BYTES_PER_BLOCK ); if ( my_length ) { block_ptr = IMFS_memfile_get_block_pointer( the_jnode, block, 0 ); if ( !block_ptr ) return copied; ffc109d0: 7f 63 db 78 mr r3,r27 <== NOT EXECUTED } IMFS_update_atime( the_jnode ); return copied; } ffc109d4: 80 01 00 44 lwz r0,68(r1) <== NOT EXECUTED ffc109d8: 82 e1 00 1c lwz r23,28(r1) <== NOT EXECUTED ffc109dc: 7c 08 03 a6 mtlr r0 <== NOT EXECUTED ffc109e0: 83 01 00 20 lwz r24,32(r1) <== NOT EXECUTED ffc109e4: 83 21 00 24 lwz r25,36(r1) <== NOT EXECUTED ffc109e8: 83 41 00 28 lwz r26,40(r1) <== NOT EXECUTED ffc109ec: 83 61 00 2c lwz r27,44(r1) <== NOT EXECUTED ffc109f0: 83 81 00 30 lwz r28,48(r1) <== NOT EXECUTED ffc109f4: 83 a1 00 34 lwz r29,52(r1) <== NOT EXECUTED ffc109f8: 83 c1 00 38 lwz r30,56(r1) <== NOT EXECUTED ffc109fc: 83 e1 00 3c lwz r31,60(r1) <== NOT EXECUTED ffc10a00: 38 21 00 40 addi r1,r1,64 <== NOT EXECUTED ffc10a04: 4e 80 00 20 blr <== NOT EXECUTED /* * 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 ) ffc10a08: 41 9e 00 f0 beq- cr7,ffc10af8 <== ALWAYS TAKEN /* * Linear files (as created from a tar file are easier to handle * than block files). */ my_length = length; ffc10a0c: 7d 1c 43 78 mr r28,r8 <== NOT EXECUTED ffc10a10: 4b ff fe dc b ffc108ec <== NOT EXECUTED unsigned int last_byte; unsigned int copied; unsigned int start_offset; unsigned char *dest; dest = destination; ffc10a14: 7f 1e c3 78 mr r30,r24 */ last_byte = start + length; if ( last_byte > the_jnode->info.file.size ) my_length = the_jnode->info.file.size - start; copied = 0; ffc10a18: 3b 60 00 00 li r27,0 ffc10a1c: 4b ff ff 64 b ffc10980 /* * Phase 3: possibly the first part of one block */ IMFS_assert( my_length < IMFS_MEMFILE_BYTES_PER_BLOCK ); if ( my_length ) { ffc10a20: 2f 9c 00 00 cmpwi cr7,r28,0 ffc10a24: 41 9e 00 30 beq- cr7,ffc10a54 block_ptr = IMFS_memfile_get_block_pointer( the_jnode, block, 0 ); ffc10a28: 7f 43 d3 78 mr r3,r26 ffc10a2c: 7f e4 fb 78 mr r4,r31 ffc10a30: 38 a0 00 00 li r5,0 ffc10a34: 4b ff fb ad bl ffc105e0 if ( !block_ptr ) ffc10a38: 2c 03 00 00 cmpwi r3,0 ffc10a3c: 41 a2 ff 94 beq- ffc109d0 <== NEVER TAKEN return copied; memcpy( dest, &(*block_ptr)[ 0 ], my_length ); ffc10a40: 80 83 00 00 lwz r4,0(r3) ffc10a44: 7f 85 e3 78 mr r5,r28 ffc10a48: 7f c3 f3 78 mr r3,r30 ffc10a4c: 48 00 23 31 bl ffc12d7c copied += my_length; ffc10a50: 7f 7b e2 14 add r27,r27,r28 } IMFS_update_atime( the_jnode ); ffc10a54: 38 61 00 08 addi r3,r1,8 ffc10a58: 38 80 00 00 li r4,0 ffc10a5c: 4b ff 41 f9 bl ffc04c54 ffc10a60: 81 21 00 08 lwz r9,8(r1) return copied; ffc10a64: 7f 63 db 78 mr r3,r27 return copied; memcpy( dest, &(*block_ptr)[ 0 ], my_length ); copied += my_length; } IMFS_update_atime( the_jnode ); ffc10a68: 91 3a 00 40 stw r9,64(r26) return copied; } ffc10a6c: 80 01 00 44 lwz r0,68(r1) ffc10a70: 82 e1 00 1c lwz r23,28(r1) ffc10a74: 7c 08 03 a6 mtlr r0 ffc10a78: 83 01 00 20 lwz r24,32(r1) ffc10a7c: 83 21 00 24 lwz r25,36(r1) ffc10a80: 83 41 00 28 lwz r26,40(r1) ffc10a84: 83 61 00 2c lwz r27,44(r1) ffc10a88: 83 81 00 30 lwz r28,48(r1) ffc10a8c: 83 a1 00 34 lwz r29,52(r1) ffc10a90: 83 c1 00 38 lwz r30,56(r1) ffc10a94: 83 e1 00 3c lwz r31,60(r1) ffc10a98: 38 21 00 40 addi r1,r1,64 ffc10a9c: 4e 80 00 20 blr if ( IMFS_type( the_jnode ) == IMFS_LINEAR_FILE ) { unsigned char *file_ptr; file_ptr = (unsigned char *)the_jnode->info.linearfile.direct; if (my_length > (the_jnode->info.linearfile.size - start)) ffc10aa0: 81 43 00 50 lwz r10,80(r3) ffc10aa4: 39 20 00 00 li r9,0 ffc10aa8: 81 63 00 54 lwz r11,84(r3) my_length = length; if ( IMFS_type( the_jnode ) == IMFS_LINEAR_FILE ) { unsigned char *file_ptr; file_ptr = (unsigned char *)the_jnode->info.linearfile.direct; ffc10aac: 80 83 00 58 lwz r4,88(r3) if (my_length > (the_jnode->info.linearfile.size - start)) ffc10ab0: 7c ff 58 10 subfc r7,r31,r11 ffc10ab4: 7c de 51 10 subfe r6,r30,r10 ffc10ab8: 7f 89 30 00 cmpw cr7,r9,r6 ffc10abc: 40 9d 00 4c ble- cr7,ffc10b08 <== ALWAYS TAKEN my_length = the_jnode->info.linearfile.size - start; ffc10ac0: 7f 7f 58 50 subf r27,r31,r11 memcpy(dest, &file_ptr[start], my_length); ffc10ac4: 7c 84 fa 14 add r4,r4,r31 ffc10ac8: 7f 65 db 78 mr r5,r27 ffc10acc: 7f 03 c3 78 mr r3,r24 ffc10ad0: 48 00 22 ad bl ffc12d7c return copied; memcpy( dest, &(*block_ptr)[ 0 ], my_length ); copied += my_length; } IMFS_update_atime( the_jnode ); ffc10ad4: 38 61 00 08 addi r3,r1,8 ffc10ad8: 38 80 00 00 li r4,0 ffc10adc: 4b ff 41 79 bl ffc04c54 ffc10ae0: 81 21 00 08 lwz r9,8(r1) return copied; ffc10ae4: 7f 63 db 78 mr r3,r27 return copied; memcpy( dest, &(*block_ptr)[ 0 ], my_length ); copied += my_length; } IMFS_update_atime( the_jnode ); ffc10ae8: 91 3a 00 40 stw r9,64(r26) ffc10aec: 4b ff ff 80 b ffc10a6c ffc10af0: 7f bb eb 78 mr r27,r29 ffc10af4: 4b ff fe 4c b ffc10940 /* * 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 ) ffc10af8: 7f 8a e0 40 cmplw cr7,r10,r28 ffc10afc: 41 bd fd ec bgt- cr7,ffc108e8 /* * Linear files (as created from a tar file are easier to handle * than block files). */ my_length = length; ffc10b00: 7d 1c 43 78 mr r28,r8 ffc10b04: 4b ff fd e8 b ffc108ec if ( IMFS_type( the_jnode ) == IMFS_LINEAR_FILE ) { unsigned char *file_ptr; file_ptr = (unsigned char *)the_jnode->info.linearfile.direct; if (my_length > (the_jnode->info.linearfile.size - start)) ffc10b08: 40 9e 00 0c bne- cr7,ffc10b14 <== NEVER TAKEN ffc10b0c: 7f 88 38 40 cmplw cr7,r8,r7 ffc10b10: 41 9d ff b0 bgt+ cr7,ffc10ac0 <== ALWAYS TAKEN /* * Linear files (as created from a tar file are easier to handle * than block files). */ my_length = length; ffc10b14: 7d 1b 43 78 mr r27,r8 <== NOT EXECUTED ffc10b18: 4b ff ff ac b ffc10ac4 <== NOT EXECUTED =============================================================================== ffc10ca4 : * is better to stick to simple, easy to understand algorithms. */ IMFS_jnode_t *IMFS_memfile_remove( IMFS_jnode_t *the_jnode ) { ffc10ca4: 94 21 ff d8 stwu r1,-40(r1) ffc10ca8: 7c 08 02 a6 mflr r0 ffc10cac: 90 01 00 2c stw r0,44(r1) * + doubly indirect * + triply indirect */ info = &the_jnode->info.file; if ( info->indirect ) { ffc10cb0: 81 23 00 58 lwz r9,88(r3) * is better to stick to simple, easy to understand algorithms. */ IMFS_jnode_t *IMFS_memfile_remove( IMFS_jnode_t *the_jnode ) { ffc10cb4: 93 c1 00 20 stw r30,32(r1) /* * 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; ffc10cb8: 3f c0 00 00 lis r30,0 * + doubly indirect * + triply indirect */ info = &the_jnode->info.file; if ( info->indirect ) { ffc10cbc: 2f 89 00 00 cmpwi cr7,r9,0 * is better to stick to simple, easy to understand algorithms. */ IMFS_jnode_t *IMFS_memfile_remove( IMFS_jnode_t *the_jnode ) { ffc10cc0: 93 a1 00 1c stw r29,28(r1) /* * 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; ffc10cc4: 83 be 28 00 lwz r29,10240(r30) * is better to stick to simple, easy to understand algorithms. */ IMFS_jnode_t *IMFS_memfile_remove( IMFS_jnode_t *the_jnode ) { ffc10cc8: 93 41 00 10 stw r26,16(r1) ffc10ccc: 7c 7a 1b 78 mr r26,r3 /* * 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; ffc10cd0: 57 bd f0 be rlwinm r29,r29,30,2,31 * is better to stick to simple, easy to understand algorithms. */ IMFS_jnode_t *IMFS_memfile_remove( IMFS_jnode_t *the_jnode ) { ffc10cd4: 93 21 00 0c stw r25,12(r1) ffc10cd8: 93 61 00 14 stw r27,20(r1) ffc10cdc: 93 81 00 18 stw r28,24(r1) ffc10ce0: 93 e1 00 24 stw r31,36(r1) * + doubly indirect * + triply indirect */ info = &the_jnode->info.file; if ( info->indirect ) { ffc10ce4: 41 9e 00 10 beq- cr7,ffc10cf4 memfile_free_blocks_in_table( &info->indirect, to_free ); ffc10ce8: 38 63 00 58 addi r3,r3,88 ffc10cec: 7f a4 eb 78 mr r4,r29 ffc10cf0: 4b ff ff 25 bl ffc10c14 } if ( info->doubly_indirect ) { ffc10cf4: 81 3a 00 5c lwz r9,92(r26) ffc10cf8: 2f 89 00 00 cmpwi cr7,r9,0 ffc10cfc: 41 9e 00 68 beq- cr7,ffc10d64 for ( i=0 ; i <== NEVER TAKEN ffc10d0c: 3f 80 00 00 lis r28,0 ffc10d10: 38 60 00 00 li r3,0 ffc10d14: 3b e0 00 00 li r31,0 ffc10d18: 3b 9c 28 00 addi r28,r28,10240 ffc10d1c: 48 00 00 08 b ffc10d24 ffc10d20: 81 3a 00 5c lwz r9,92(r26) if ( info->doubly_indirect[i] ) { ffc10d24: 54 63 10 3a rlwinm r3,r3,2,0,29 ffc10d28: 7d 49 18 2e lwzx r10,r9,r3 if ( info->indirect ) { memfile_free_blocks_in_table( &info->indirect, to_free ); } if ( info->doubly_indirect ) { for ( i=0 ; idoubly_indirect[i] ) { memfile_free_blocks_in_table( ffc10d30: 7f a4 eb 78 mr r4,r29 memfile_free_blocks_in_table( &info->indirect, to_free ); } if ( info->doubly_indirect ) { for ( i=0 ; idoubly_indirect[i] ) { ffc10d34: 2f 8a 00 00 cmpwi cr7,r10,0 ffc10d38: 7c 69 1a 14 add r3,r9,r3 ffc10d3c: 41 9e 00 08 beq- cr7,ffc10d44 <== NEVER TAKEN memfile_free_blocks_in_table( ffc10d40: 4b ff fe d5 bl ffc10c14 if ( info->indirect ) { memfile_free_blocks_in_table( &info->indirect, to_free ); } if ( info->doubly_indirect ) { for ( i=0 ; i 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 ); ffc10d58: 38 7a 00 5c addi r3,r26,92 ffc10d5c: 7f a4 eb 78 mr r4,r29 ffc10d60: 4b ff fe b5 bl ffc10c14 } if ( info->triply_indirect ) { ffc10d64: 80 7a 00 60 lwz r3,96(r26) ffc10d68: 2f 83 00 00 cmpwi cr7,r3,0 ffc10d6c: 41 9e 00 b4 beq- cr7,ffc10e20 for ( i=0 ; i <== NEVER TAKEN p = (block_p *) info->triply_indirect[i]; ffc10d7c: 83 c3 00 00 lwz r30,0(r3) if ( !p ) /* ensure we have a valid pointer */ ffc10d80: 2f 9e 00 00 cmpwi cr7,r30,0 ffc10d84: 41 9e 00 90 beq- cr7,ffc10e14 <== NEVER TAKEN ffc10d88: 3f 80 00 00 lis r28,0 } if ( info->triply_indirect ) { for ( i=0 ; itriply_indirect[i]; ffc10d8c: 3b 20 00 00 li r25,0 if ( !p ) /* ensure we have a valid pointer */ ffc10d90: 3b 60 00 00 li r27,0 ffc10d94: 3b 9c 28 00 addi r28,r28,10240 break; for ( j=0 ; j<== NEVER TAKEN ffc10da0: 39 20 00 00 li r9,0 ffc10da4: 3b e0 00 00 li r31,0 if ( p[j] ) { ffc10da8: 55 29 10 3a rlwinm r9,r9,2,0,29 ffc10dac: 7d 5e 48 2e lwzx r10,r30,r9 if ( info->triply_indirect ) { for ( i=0 ; itriply_indirect[i]; if ( !p ) /* ensure we have a valid pointer */ break; for ( j=0 ; jtriply_indirect[i]; if ( !p ) /* ensure we have a valid pointer */ break; for ( j=0 ; j<== NEVER TAKEN memfile_free_blocks_in_table( (block_p **)&p[j], to_free); ffc10dc4: 4b ff fe 51 bl ffc10c14 if ( info->triply_indirect ) { for ( i=0 ; itriply_indirect[i]; if ( !p ) /* ensure we have a valid pointer */ break; for ( j=0 ; j ffc10ddc: 80 7a 00 60 lwz r3,96(r26) if ( p[j] ) { memfile_free_blocks_in_table( (block_p **)&p[j], to_free); } } memfile_free_blocks_in_table( ffc10de0: 7c 63 ca 14 add r3,r3,r25 ffc10de4: 7f a4 eb 78 mr r4,r29 ffc10de8: 4b ff fe 2d bl ffc10c14 memfile_free_blocks_in_table( &info->doubly_indirect, to_free ); } if ( info->triply_indirect ) { for ( i=0 ; i p = (block_p *) info->triply_indirect[i]; ffc10e00: 80 7a 00 60 lwz r3,96(r26) * 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( ffc10e04: 57 79 10 3a rlwinm r25,r27,2,0,29 } if ( info->triply_indirect ) { for ( i=0 ; itriply_indirect[i]; ffc10e08: 7f c3 c8 2e lwzx r30,r3,r25 if ( !p ) /* ensure we have a valid pointer */ ffc10e0c: 2f 9e 00 00 cmpwi cr7,r30,0 ffc10e10: 40 9e ff 88 bne+ cr7,ffc10d98 <== ALWAYS TAKEN } } memfile_free_blocks_in_table( (block_p **)&info->triply_indirect[i], to_free ); } memfile_free_blocks_in_table( ffc10e14: 38 7a 00 60 addi r3,r26,96 ffc10e18: 7f a4 eb 78 mr r4,r29 ffc10e1c: 4b ff fd f9 bl ffc10c14 (block_p **)&info->triply_indirect, to_free ); } return the_jnode; } ffc10e20: 80 01 00 2c lwz r0,44(r1) ffc10e24: 7f 43 d3 78 mr r3,r26 ffc10e28: 83 21 00 0c lwz r25,12(r1) ffc10e2c: 7c 08 03 a6 mtlr r0 ffc10e30: 83 41 00 10 lwz r26,16(r1) ffc10e34: 83 61 00 14 lwz r27,20(r1) ffc10e38: 83 81 00 18 lwz r28,24(r1) ffc10e3c: 83 a1 00 1c lwz r29,28(r1) ffc10e40: 83 c1 00 20 lwz r30,32(r1) ffc10e44: 83 e1 00 24 lwz r31,36(r1) ffc10e48: 38 21 00 28 addi r1,r1,40 ffc10e4c: 4e 80 00 20 blr =============================================================================== ffc10e50 : */ MEMFILE_STATIC int IMFS_memfile_remove_block( IMFS_jnode_t *the_jnode, unsigned int block ) { ffc10e50: 94 21 ff f8 stwu r1,-8(r1) <== NOT EXECUTED ffc10e54: 7c 08 02 a6 mflr r0 <== NOT EXECUTED block_p *block_ptr; block_p ptr; block_ptr = IMFS_memfile_get_block_pointer( the_jnode, block, 0 ); ffc10e58: 38 a0 00 00 li r5,0 <== NOT EXECUTED */ MEMFILE_STATIC int IMFS_memfile_remove_block( IMFS_jnode_t *the_jnode, unsigned int block ) { ffc10e5c: 90 01 00 0c stw r0,12(r1) <== NOT EXECUTED block_p *block_ptr; block_p ptr; block_ptr = IMFS_memfile_get_block_pointer( the_jnode, block, 0 ); ffc10e60: 4b ff f7 81 bl ffc105e0 <== NOT EXECUTED ffc10e64: 7c 69 1b 78 mr r9,r3 <== NOT EXECUTED IMFS_assert( block_ptr ); ptr = *block_ptr; *block_ptr = 0; ffc10e68: 39 40 00 00 li r10,0 <== NOT EXECUTED block_p ptr; block_ptr = IMFS_memfile_get_block_pointer( the_jnode, block, 0 ); IMFS_assert( block_ptr ); ptr = *block_ptr; ffc10e6c: 80 63 00 00 lwz r3,0(r3) <== NOT EXECUTED *block_ptr = 0; ffc10e70: 91 49 00 00 stw r10,0(r9) <== NOT EXECUTED memfile_free_block( ptr ); ffc10e74: 4b ff fd 71 bl ffc10be4 <== NOT EXECUTED return 1; } ffc10e78: 80 01 00 0c lwz r0,12(r1) <== NOT EXECUTED ffc10e7c: 38 60 00 01 li r3,1 <== NOT EXECUTED ffc10e80: 7c 08 03 a6 mtlr r0 <== NOT EXECUTED ffc10e84: 38 21 00 08 addi r1,r1,8 <== NOT EXECUTED ffc10e88: 4e 80 00 20 blr <== NOT EXECUTED =============================================================================== ffc1111c : IMFS_jnode_t *the_jnode, off_t start, const unsigned char *source, unsigned int length ) { ffc1111c: 94 21 ff c0 stwu r1,-64(r1) ffc11120: 7c 08 02 a6 mflr r0 * 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 ) { ffc11124: 39 40 00 00 li r10,0 IMFS_jnode_t *the_jnode, off_t start, const unsigned char *source, unsigned int length ) { ffc11128: 93 41 00 28 stw r26,40(r1) ffc1112c: 7c 7a 1b 78 mr r26,r3 ffc11130: 93 61 00 2c stw r27,44(r1) ffc11134: 7c bb 2b 78 mr r27,r5 ffc11138: 93 81 00 30 stw r28,48(r1) ffc1113c: 7c fc 3b 78 mr r28,r7 ffc11140: 93 a1 00 34 stw r29,52(r1) ffc11144: 7d 1d 43 78 mr r29,r8 ffc11148: 93 c1 00 38 stw r30,56(r1) ffc1114c: 7c de 33 78 mr r30,r6 /* * 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; ffc11150: 7c c8 32 14 add r6,r8,r6 IMFS_jnode_t *the_jnode, off_t start, const unsigned char *source, unsigned int length ) { ffc11154: 90 01 00 44 stw r0,68(r1) ffc11158: 92 e1 00 1c stw r23,28(r1) ffc1115c: 93 01 00 20 stw r24,32(r1) ffc11160: 93 21 00 24 stw r25,36(r1) ffc11164: 93 e1 00 3c stw r31,60(r1) * 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 ) { ffc11168: 81 23 00 50 lwz r9,80(r3) ffc1116c: 7f 8a 48 00 cmpw cr7,r10,r9 ffc11170: 81 43 00 54 lwz r10,84(r3) ffc11174: 41 9d 01 b8 bgt- cr7,ffc1132c <== NEVER TAKEN ffc11178: 41 9e 01 ac beq- cr7,ffc11324 <== ALWAYS TAKEN */ /* * Phase 1: possibly the last part of one block */ start_offset = start % IMFS_MEMFILE_BYTES_PER_BLOCK; ffc1117c: 3f 20 00 00 lis r25,0 ffc11180: 83 f9 28 00 lwz r31,10240(r25) ffc11184: 7f 63 db 78 mr r3,r27 ffc11188: 7f c4 f3 78 mr r4,r30 ffc1118c: 7f f8 fe 70 srawi r24,r31,31 ffc11190: 7f 05 c3 78 mr r5,r24 ffc11194: 7f e6 fb 78 mr r6,r31 ffc11198: 48 00 ab 1d bl ffc1bcb4 <__moddi3> block = start / IMFS_MEMFILE_BYTES_PER_BLOCK; ffc1119c: 7f 63 db 78 mr r3,r27 */ /* * Phase 1: possibly the last part of one block */ start_offset = start % IMFS_MEMFILE_BYTES_PER_BLOCK; ffc111a0: 7c 97 23 78 mr r23,r4 block = start / IMFS_MEMFILE_BYTES_PER_BLOCK; ffc111a4: 7f 05 c3 78 mr r5,r24 ffc111a8: 7f c4 f3 78 mr r4,r30 ffc111ac: 7f e6 fb 78 mr r6,r31 ffc111b0: 48 00 a6 e1 bl ffc1b890 <__divdi3> if ( start_offset ) { ffc111b4: 2f 97 00 00 cmpwi cr7,r23,0 /* * Phase 1: possibly the last part of one block */ start_offset = start % IMFS_MEMFILE_BYTES_PER_BLOCK; block = start / IMFS_MEMFILE_BYTES_PER_BLOCK; ffc111b8: 7c 9e 23 78 mr r30,r4 status = IMFS_memfile_extend( the_jnode, zero_fill, last_byte ); if ( status ) return status; } copied = 0; ffc111bc: 3b 60 00 00 li r27,0 /* * Phase 1: possibly the last part of one block */ start_offset = start % IMFS_MEMFILE_BYTES_PER_BLOCK; block = start / IMFS_MEMFILE_BYTES_PER_BLOCK; if ( start_offset ) { ffc111c0: 41 9e 00 54 beq- cr7,ffc11214 to_copy = IMFS_MEMFILE_BYTES_PER_BLOCK - start_offset; ffc111c4: 7f 77 f8 50 subf r27,r23,r31 ffc111c8: 7f 9b e8 40 cmplw cr7,r27,r29 ffc111cc: 40 9d 00 08 ble- cr7,ffc111d4 ffc111d0: 7f bb eb 78 mr r27,r29 if ( to_copy > my_length ) to_copy = my_length; block_ptr = IMFS_memfile_get_block_pointer( the_jnode, block, 0 ); ffc111d4: 7f 43 d3 78 mr r3,r26 ffc111d8: 7f c4 f3 78 mr r4,r30 ffc111dc: 38 a0 00 00 li r5,0 ffc111e0: 4b ff f4 01 bl ffc105e0 if ( !block_ptr ) ffc111e4: 7c 69 1b 79 mr. r9,r3 return copied; ffc111e8: 38 60 00 00 li r3,0 if ( start_offset ) { to_copy = IMFS_MEMFILE_BYTES_PER_BLOCK - start_offset; if ( to_copy > my_length ) to_copy = my_length; block_ptr = IMFS_memfile_get_block_pointer( the_jnode, block, 0 ); if ( !block_ptr ) ffc111ec: 41 82 00 7c beq- ffc11268 <== NEVER TAKEN block, to_copy, src ); #endif memcpy( &(*block_ptr)[ start_offset ], src, to_copy ); ffc111f0: 80 69 00 00 lwz r3,0(r9) ffc111f4: 7f 84 e3 78 mr r4,r28 ffc111f8: 7f 65 db 78 mr r5,r27 ffc111fc: 7c 63 ba 14 add r3,r3,r23 ffc11200: 48 00 1b 7d bl ffc12d7c ffc11204: 83 f9 28 00 lwz r31,10240(r25) src += to_copy; ffc11208: 7f 9c da 14 add r28,r28,r27 block++; ffc1120c: 3b de 00 01 addi r30,r30,1 my_length -= to_copy; ffc11210: 7f bb e8 50 subf r29,r27,r29 /* * Phase 2: all of zero of more blocks */ to_copy = IMFS_MEMFILE_BYTES_PER_BLOCK; while ( my_length >= IMFS_MEMFILE_BYTES_PER_BLOCK ) { ffc11214: 7f 9d f8 40 cmplw cr7,r29,r31 ffc11218: 40 bc 00 20 bge+ cr7,ffc11238 ffc1121c: 48 00 00 80 b ffc1129c if ( !block_ptr ) 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 ); ffc11220: 80 63 00 00 lwz r3,0(r3) * 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( ffc11224: 7f 7b fa 14 add r27,r27,r31 if ( !block_ptr ) 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 ); ffc11228: 48 00 1b 55 bl ffc12d7c /* * Phase 2: all of zero of more blocks */ to_copy = IMFS_MEMFILE_BYTES_PER_BLOCK; while ( my_length >= IMFS_MEMFILE_BYTES_PER_BLOCK ) { ffc1122c: 81 39 28 00 lwz r9,10240(r25) ffc11230: 7f 89 e8 40 cmplw cr7,r9,r29 ffc11234: 41 9d 00 68 bgt- cr7,ffc1129c block_ptr = IMFS_memfile_get_block_pointer( the_jnode, block, 0 ); ffc11238: 7f c4 f3 78 mr r4,r30 ffc1123c: 38 a0 00 00 li r5,0 ffc11240: 7f 43 d3 78 mr r3,r26 ffc11244: 4b ff f3 9d bl ffc105e0 fprintf(stdout, "write %d in %d: %*s\n", to_copy, block, to_copy, src ); #endif memcpy( &(*block_ptr)[ 0 ], src, to_copy ); src += to_copy; block++; my_length -= to_copy; ffc11248: 7f bf e8 50 subf r29,r31,r29 */ 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 ) ffc1124c: 2c 03 00 00 cmpwi r3,0 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 ); ffc11250: 7f 84 e3 78 mr r4,r28 ffc11254: 7f e5 fb 78 mr r5,r31 src += to_copy; ffc11258: 7f 9c fa 14 add r28,r28,r31 block++; ffc1125c: 3b de 00 01 addi r30,r30,1 */ 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 ) ffc11260: 40 82 ff c0 bne+ ffc11220 <== ALWAYS TAKEN ffc11264: 7f 63 db 78 mr r3,r27 <== NOT EXECUTED } IMFS_mtime_ctime_update( the_jnode ); return copied; } ffc11268: 80 01 00 44 lwz r0,68(r1) <== NOT EXECUTED ffc1126c: 82 e1 00 1c lwz r23,28(r1) <== NOT EXECUTED ffc11270: 7c 08 03 a6 mtlr r0 <== NOT EXECUTED ffc11274: 83 01 00 20 lwz r24,32(r1) <== NOT EXECUTED ffc11278: 83 21 00 24 lwz r25,36(r1) <== NOT EXECUTED ffc1127c: 83 41 00 28 lwz r26,40(r1) <== NOT EXECUTED ffc11280: 83 61 00 2c lwz r27,44(r1) <== NOT EXECUTED ffc11284: 83 81 00 30 lwz r28,48(r1) <== NOT EXECUTED ffc11288: 83 a1 00 34 lwz r29,52(r1) <== NOT EXECUTED ffc1128c: 83 c1 00 38 lwz r30,56(r1) <== NOT EXECUTED ffc11290: 83 e1 00 3c lwz r31,60(r1) <== NOT EXECUTED ffc11294: 38 21 00 40 addi r1,r1,64 <== NOT EXECUTED ffc11298: 4e 80 00 20 blr <== NOT EXECUTED * 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 ) { ffc1129c: 2f 9d 00 00 cmpwi cr7,r29,0 ffc112a0: 41 9e 00 34 beq- cr7,ffc112d4 block_ptr = IMFS_memfile_get_block_pointer( the_jnode, block, 0 ); ffc112a4: 7f 43 d3 78 mr r3,r26 ffc112a8: 7f c4 f3 78 mr r4,r30 ffc112ac: 38 a0 00 00 li r5,0 ffc112b0: 4b ff f3 31 bl ffc105e0 if ( !block_ptr ) ffc112b4: 7c 69 1b 79 mr. r9,r3 ffc112b8: 7f 63 db 78 mr r3,r27 ffc112bc: 41 a2 ff ac beq- ffc11268 <== NEVER TAKEN 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 ); ffc112c0: 80 69 00 00 lwz r3,0(r9) ffc112c4: 7f 84 e3 78 mr r4,r28 ffc112c8: 7f a5 eb 78 mr r5,r29 ffc112cc: 48 00 1a b1 bl ffc12d7c my_length = 0; copied += to_copy; ffc112d0: 7f 7b ea 14 add r27,r27,r29 } IMFS_mtime_ctime_update( the_jnode ); ffc112d4: 38 61 00 08 addi r3,r1,8 ffc112d8: 38 80 00 00 li r4,0 ffc112dc: 4b ff 39 79 bl ffc04c54 return copied; } ffc112e0: 80 01 00 44 lwz r0,68(r1) memcpy( &(*block_ptr)[ 0 ], src, my_length ); my_length = 0; copied += to_copy; } IMFS_mtime_ctime_update( the_jnode ); ffc112e4: 81 21 00 08 lwz r9,8(r1) return copied; ffc112e8: 7f 63 db 78 mr r3,r27 } ffc112ec: 7c 08 03 a6 mtlr r0 ffc112f0: 82 e1 00 1c lwz r23,28(r1) memcpy( &(*block_ptr)[ 0 ], src, my_length ); my_length = 0; copied += to_copy; } IMFS_mtime_ctime_update( the_jnode ); ffc112f4: 91 3a 00 44 stw r9,68(r26) ffc112f8: 91 3a 00 48 stw r9,72(r26) return copied; } ffc112fc: 83 01 00 20 lwz r24,32(r1) ffc11300: 83 21 00 24 lwz r25,36(r1) ffc11304: 83 41 00 28 lwz r26,40(r1) ffc11308: 83 61 00 2c lwz r27,44(r1) ffc1130c: 83 81 00 30 lwz r28,48(r1) ffc11310: 83 a1 00 34 lwz r29,52(r1) ffc11314: 83 c1 00 38 lwz r30,56(r1) ffc11318: 83 e1 00 3c lwz r31,60(r1) ffc1131c: 38 21 00 40 addi r1,r1,64 ffc11320: 4e 80 00 20 blr * 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 ) { ffc11324: 7f 86 50 40 cmplw cr7,r6,r10 ffc11328: 40 9d fe 54 ble+ cr7,ffc1117c bool zero_fill = start > the_jnode->info.file.size; ffc1132c: 7f 9b 48 00 cmpw cr7,r27,r9 ffc11330: 38 80 00 01 li r4,1 ffc11334: 40 9d 00 50 ble- cr7,ffc11384 <== ALWAYS TAKEN status = IMFS_memfile_extend( the_jnode, zero_fill, last_byte ); ffc11338: 7f 43 d3 78 mr r3,r26 ffc1133c: 54 84 07 fe clrlwi r4,r4,31 ffc11340: 38 a0 00 00 li r5,0 ffc11344: 4b ff fb 49 bl ffc10e8c if ( status ) ffc11348: 2c 03 00 00 cmpwi r3,0 ffc1134c: 41 82 fe 30 beq+ ffc1117c } IMFS_mtime_ctime_update( the_jnode ); return copied; } ffc11350: 80 01 00 44 lwz r0,68(r1) ffc11354: 82 e1 00 1c lwz r23,28(r1) ffc11358: 7c 08 03 a6 mtlr r0 ffc1135c: 83 01 00 20 lwz r24,32(r1) ffc11360: 83 21 00 24 lwz r25,36(r1) ffc11364: 83 41 00 28 lwz r26,40(r1) ffc11368: 83 61 00 2c lwz r27,44(r1) ffc1136c: 83 81 00 30 lwz r28,48(r1) ffc11370: 83 a1 00 34 lwz r29,52(r1) ffc11374: 83 c1 00 38 lwz r30,56(r1) ffc11378: 83 e1 00 3c lwz r31,60(r1) ffc1137c: 38 21 00 40 addi r1,r1,64 ffc11380: 4e 80 00 20 blr * 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; ffc11384: 41 9e 00 24 beq- cr7,ffc113a8 <== ALWAYS TAKEN ffc11388: 38 80 00 00 li r4,0 status = IMFS_memfile_extend( the_jnode, zero_fill, last_byte ); ffc1138c: 7f 43 d3 78 mr r3,r26 ffc11390: 54 84 07 fe clrlwi r4,r4,31 ffc11394: 38 a0 00 00 li r5,0 ffc11398: 4b ff fa f5 bl ffc10e8c if ( status ) ffc1139c: 2c 03 00 00 cmpwi r3,0 ffc113a0: 41 82 fd dc beq+ ffc1117c ffc113a4: 4b ff ff ac b ffc11350 * 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; ffc113a8: 7f 9e 50 40 cmplw cr7,r30,r10 ffc113ac: 41 bd ff 8c bgt- cr7,ffc11338 ffc113b0: 4b ff ff d8 b ffc11388 =============================================================================== ffc04168 : dev_t dev, IMFS_jnode_types_t *type, IMFS_types_union *info ) { if ( S_ISDIR( mode ) ) { ffc04168: 54 c9 04 26 rlwinm r9,r6,0,16,19 const char *name, size_t namelen, mode_t mode, dev_t dev ) { ffc0416c: 94 21 ff d0 stwu r1,-48(r1) dev_t dev, IMFS_jnode_types_t *type, IMFS_types_union *info ) { if ( S_ISDIR( mode ) ) { ffc04170: 2f 89 40 00 cmpwi cr7,r9,16384 const char *name, size_t namelen, mode_t mode, dev_t dev ) { ffc04174: 7c 08 02 a6 mflr r0 ffc04178: 93 e1 00 2c stw r31,44(r1) ffc0417c: 7c ca 33 78 mr r10,r6 ffc04180: 7c 7f 1b 78 mr r31,r3 ffc04184: 90 01 00 34 stw r0,52(r1) ffc04188: 7c 8b 23 78 mr r11,r4 ffc0418c: 7c a6 2b 78 mr r6,r5 dev_t dev, IMFS_jnode_types_t *type, IMFS_types_union *info ) { if ( S_ISDIR( mode ) ) { ffc04190: 41 9e 00 b0 beq- cr7,ffc04240 *type = IMFS_DIRECTORY; } else if ( S_ISREG( mode ) ) { ffc04194: 6d 25 ff ff xoris r5,r9,65535 ffc04198: 2f 85 80 00 cmpwi cr7,r5,-32768 ffc0419c: 41 9e 00 ac beq- cr7,ffc04248 *type = IMFS_MEMORY_FILE; } else if ( S_ISBLK( mode ) || S_ISCHR( mode ) ) { ffc041a0: 2f 89 60 00 cmpwi cr7,r9,24576 ffc041a4: 41 9e 00 8c beq- cr7,ffc04230 ffc041a8: 2f 89 20 00 cmpwi cr7,r9,8192 ffc041ac: 41 9e 00 84 beq- cr7,ffc04230 rtems_filesystem_split_dev_t( dev, info->device.major, info->device.minor ); } else if (S_ISFIFO( mode )) { ffc041b0: 2f 89 10 00 cmpwi cr7,r9,4096 ffc041b4: 40 be 00 08 bne+ cr7,ffc041bc <== NEVER TAKEN *type = IMFS_FIFO; ffc041b8: 38 00 00 06 li r0,6 size_t namelen, mode_t mode, const IMFS_types_union *info ) { const IMFS_fs_info_t *fs_info = ffc041bc: 81 3f 00 14 lwz r9,20(r31) (const IMFS_fs_info_t *) parentloc->mt_entry->fs_info; return IMFS_create_node_with_control( ffc041c0: 54 08 10 3a rlwinm r8,r0,2,0,29 ffc041c4: 7f e3 fb 78 mr r3,r31 ffc041c8: 81 29 00 08 lwz r9,8(r9) ffc041cc: 7d 65 5b 78 mr r5,r11 ffc041d0: 7d 47 53 78 mr r7,r10 ffc041d4: 7d 29 42 14 add r9,r9,r8 ffc041d8: 80 89 00 08 lwz r4,8(r9) ffc041dc: 39 01 00 08 addi r8,r1,8 ffc041e0: 48 00 a0 89 bl ffc0e268 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 ) { ffc041e4: 2f 83 00 00 cmpwi cr7,r3,0 ffc041e8: 41 9e 00 68 beq- cr7,ffc04250 IMFS_jnode_t *parent = parentloc->node_access; IMFS_update_ctime( parent ); ffc041ec: 38 80 00 00 li r4,0 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 ) { IMFS_jnode_t *parent = parentloc->node_access; ffc041f0: 83 ff 00 08 lwz r31,8(r31) IMFS_update_ctime( parent ); ffc041f4: 38 61 00 20 addi r3,r1,32 ffc041f8: 48 00 0a 5d bl ffc04c54 ffc041fc: 81 21 00 20 lwz r9,32(r1) IMFS_update_mtime( parent ); ffc04200: 38 61 00 20 addi r3,r1,32 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 ); ffc04204: 91 3f 00 48 stw r9,72(r31) IMFS_update_mtime( parent ); ffc04208: 38 80 00 00 li r4,0 ffc0420c: 48 00 0a 49 bl ffc04c54 ffc04210: 81 21 00 20 lwz r9,32(r1) size_t namelen, mode_t mode, dev_t dev ) { int rv = 0; ffc04214: 38 60 00 00 li r3,0 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 ); IMFS_update_mtime( parent ); ffc04218: 91 3f 00 44 stw r9,68(r31) } else { rv = -1; } return rv; } ffc0421c: 80 01 00 34 lwz r0,52(r1) ffc04220: 83 e1 00 2c lwz r31,44(r1) ffc04224: 7c 08 03 a6 mtlr r0 ffc04228: 38 21 00 30 addi r1,r1,48 ffc0422c: 4e 80 00 20 blr *type = IMFS_DIRECTORY; } else if ( S_ISREG( mode ) ) { *type = IMFS_MEMORY_FILE; } else if ( S_ISBLK( mode ) || S_ISCHR( mode ) ) { *type = IMFS_DEVICE; rtems_filesystem_split_dev_t( ffc04230: 90 e1 00 08 stw r7,8(r1) 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; ffc04234: 38 00 00 01 li r0,1 rtems_filesystem_split_dev_t( ffc04238: 91 01 00 0c stw r8,12(r1) ffc0423c: 4b ff ff 80 b ffc041bc IMFS_jnode_types_t *type, IMFS_types_union *info ) { if ( S_ISDIR( mode ) ) { *type = IMFS_DIRECTORY; ffc04240: 38 00 00 00 li r0,0 ffc04244: 4b ff ff 78 b ffc041bc } else if ( S_ISREG( mode ) ) { *type = IMFS_MEMORY_FILE; ffc04248: 38 00 00 04 li r0,4 ffc0424c: 4b ff ff 70 b ffc041bc IMFS_jnode_t *parent = parentloc->node_access; IMFS_update_ctime( parent ); IMFS_update_mtime( parent ); } else { rv = -1; ffc04250: 38 60 ff ff li r3,-1 ffc04254: 4b ff ff c8 b ffc0421c =============================================================================== ffc04258 : #endif #include "imfs.h" int IMFS_mount( rtems_filesystem_mount_table_entry_t *mt_entry ) { ffc04258: 94 21 ff f8 stwu r1,-8(r1) ffc0425c: 7c 08 02 a6 mflr r0 ffc04260: 90 01 00 0c stw r0,12(r1) int rv = 0; IMFS_jnode_t *node = mt_entry->mt_point_node->location.node_access; ffc04264: 81 23 00 20 lwz r9,32(r3) ffc04268: 81 29 00 08 lwz r9,8(r9) return node->control->imfs_type; } static inline bool IMFS_is_directory( const IMFS_jnode_t *node ) { return node->control->imfs_type == IMFS_DIRECTORY; ffc0426c: 81 49 00 4c lwz r10,76(r9) if ( IMFS_is_directory( node ) ) { ffc04270: 81 4a 00 00 lwz r10,0(r10) ffc04274: 2f 8a 00 00 cmpwi cr7,r10,0 ffc04278: 40 9e 00 3c bne- cr7,ffc042b4 if ( node->info.directory.mt_fs == NULL ) { ffc0427c: 81 49 00 5c lwz r10,92(r9) ffc04280: 2f 8a 00 00 cmpwi cr7,r10,0 ffc04284: 40 9e 00 1c bne- cr7,ffc042a0 <== NEVER TAKEN node->info.directory.mt_fs = mt_entry; ffc04288: 90 69 00 5c stw r3,92(r9) #include "imfs.h" int IMFS_mount( rtems_filesystem_mount_table_entry_t *mt_entry ) { int rv = 0; ffc0428c: 38 60 00 00 li r3,0 errno = ENOTDIR; rv = -1; } return rv; } ffc04290: 80 01 00 0c lwz r0,12(r1) ffc04294: 38 21 00 08 addi r1,r1,8 ffc04298: 7c 08 03 a6 mtlr r0 ffc0429c: 4e 80 00 20 blr if ( IMFS_is_directory( node ) ) { if ( node->info.directory.mt_fs == NULL ) { node->info.directory.mt_fs = mt_entry; } else { errno = EBUSY; ffc042a0: 48 00 dd d9 bl ffc12078 <__errno> <== NOT EXECUTED ffc042a4: 39 20 00 10 li r9,16 <== NOT EXECUTED ffc042a8: 91 23 00 00 stw r9,0(r3) <== NOT EXECUTED rv = -1; ffc042ac: 38 60 ff ff li r3,-1 <== NOT EXECUTED ffc042b0: 4b ff ff e0 b ffc04290 <== NOT EXECUTED } } else { errno = ENOTDIR; ffc042b4: 48 00 dd c5 bl ffc12078 <__errno> ffc042b8: 39 20 00 14 li r9,20 ffc042bc: 91 23 00 00 stw r9,0(r3) rv = -1; ffc042c0: 38 60 ff ff li r3,-1 ffc042c4: 4b ff ff cc b ffc04290 =============================================================================== ffc0e724 : } static IMFS_jnode_t *IMFS_node_remove_directory( IMFS_jnode_t *node ) { ffc0e724: 94 21 ff f8 stwu r1,-8(r1) ffc0e728: 7c 08 02 a6 mflr r0 RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( const Chain_Control *the_chain ) { return _Chain_Immutable_first( the_chain ) == _Chain_Immutable_tail( the_chain ); ffc0e72c: 39 43 00 54 addi r10,r3,84 ffc0e730: 90 01 00 0c stw r0,12(r1) if ( !rtems_chain_is_empty( &node->info.directory.Entries ) ) { ffc0e734: 81 23 00 50 lwz r9,80(r3) ffc0e738: 7f 89 50 00 cmpw cr7,r9,r10 ffc0e73c: 40 9e 00 20 bne- cr7,ffc0e75c errno = ENOTEMPTY; node = NULL; } else if ( IMFS_is_mount_point( node ) ) { ffc0e740: 81 23 00 5c lwz r9,92(r3) ffc0e744: 2f 89 00 00 cmpwi cr7,r9,0 ffc0e748: 40 9e 00 34 bne- cr7,ffc0e77c <== NEVER TAKEN errno = EBUSY; node = NULL; } return node; } ffc0e74c: 80 01 00 0c lwz r0,12(r1) ffc0e750: 38 21 00 08 addi r1,r1,8 ffc0e754: 7c 08 03 a6 mtlr r0 ffc0e758: 4e 80 00 20 blr static IMFS_jnode_t *IMFS_node_remove_directory( IMFS_jnode_t *node ) { if ( !rtems_chain_is_empty( &node->info.directory.Entries ) ) { errno = ENOTEMPTY; ffc0e75c: 48 00 39 1d bl ffc12078 <__errno> errno = EBUSY; node = NULL; } return node; } ffc0e760: 80 01 00 0c lwz r0,12(r1) static IMFS_jnode_t *IMFS_node_remove_directory( IMFS_jnode_t *node ) { if ( !rtems_chain_is_empty( &node->info.directory.Entries ) ) { errno = ENOTEMPTY; ffc0e764: 39 20 00 5a li r9,90 errno = EBUSY; node = NULL; } return node; } ffc0e768: 7c 08 03 a6 mtlr r0 static IMFS_jnode_t *IMFS_node_remove_directory( IMFS_jnode_t *node ) { if ( !rtems_chain_is_empty( &node->info.directory.Entries ) ) { errno = ENOTEMPTY; ffc0e76c: 91 23 00 00 stw r9,0(r3) node = NULL; ffc0e770: 38 60 00 00 li r3,0 errno = EBUSY; node = NULL; } return node; } ffc0e774: 38 21 00 08 addi r1,r1,8 ffc0e778: 4e 80 00 20 blr { if ( !rtems_chain_is_empty( &node->info.directory.Entries ) ) { errno = ENOTEMPTY; node = NULL; } else if ( IMFS_is_mount_point( node ) ) { errno = EBUSY; ffc0e77c: 48 00 38 fd bl ffc12078 <__errno> <== NOT EXECUTED node = NULL; } return node; } ffc0e780: 80 01 00 0c lwz r0,12(r1) <== NOT EXECUTED { if ( !rtems_chain_is_empty( &node->info.directory.Entries ) ) { errno = ENOTEMPTY; node = NULL; } else if ( IMFS_is_mount_point( node ) ) { errno = EBUSY; ffc0e784: 39 20 00 10 li r9,16 <== NOT EXECUTED node = NULL; } return node; } ffc0e788: 7c 08 03 a6 mtlr r0 <== NOT EXECUTED { if ( !rtems_chain_is_empty( &node->info.directory.Entries ) ) { errno = ENOTEMPTY; node = NULL; } else if ( IMFS_is_mount_point( node ) ) { errno = EBUSY; ffc0e78c: 91 23 00 00 stw r9,0(r3) <== NOT EXECUTED ffc0e790: 38 60 00 00 li r3,0 <== NOT EXECUTED node = NULL; } return node; } ffc0e794: 38 21 00 08 addi r1,r1,8 <== NOT EXECUTED ffc0e798: 4e 80 00 20 blr <== NOT EXECUTED =============================================================================== ffc042c8 : rtems_filesystem_node_types_t IMFS_node_type( const rtems_filesystem_location_info_t *loc ) { const IMFS_jnode_t *node = loc->node_access; ffc042c8: 81 43 00 08 lwz r10,8(r3) rtems_chain_extract_unprotected( &node->Node ); } static inline IMFS_jnode_types_t IMFS_type( const IMFS_jnode_t *node ) { return node->control->imfs_type; ffc042cc: 81 2a 00 4c lwz r9,76(r10) ffc042d0: 81 29 00 00 lwz r9,0(r9) IMFS_jnode_types_t imfs_type = IMFS_type( node ); rtems_filesystem_node_types_t type; switch ( imfs_type ) { ffc042d4: 2f 89 00 02 cmpwi cr7,r9,2 ffc042d8: 41 9e 00 18 beq- cr7,ffc042f0 ffc042dc: 2f 89 00 05 cmpwi cr7,r9,5 case IMFS_HARD_LINK: type = IMFS_type( node->info.hard_link.link_node ); break; case IMFS_LINEAR_FILE: type = RTEMS_FILESYSTEM_MEMORY_FILE; ffc042e0: 38 60 00 04 li r3,4 { const IMFS_jnode_t *node = loc->node_access; IMFS_jnode_types_t imfs_type = IMFS_type( node ); rtems_filesystem_node_types_t type; switch ( imfs_type ) { ffc042e4: 41 9e 00 1c beq- cr7,ffc04300 <== NEVER TAKEN ffc042e8: 7d 23 4b 78 mr r3,r9 type = imfs_type; break; } return type; } ffc042ec: 4e 80 00 20 blr ffc042f0: 81 2a 00 50 lwz r9,80(r10) ffc042f4: 81 29 00 4c lwz r9,76(r9) ffc042f8: 80 69 00 00 lwz r3,0(r9) rtems_filesystem_node_types_t type; switch ( imfs_type ) { case IMFS_HARD_LINK: type = IMFS_type( node->info.hard_link.link_node ); break; ffc042fc: 4e 80 00 20 blr ffc04300: 4e 80 00 20 blr <== NOT EXECUTED =============================================================================== ffc04304 : node = loc->node_access; IMFS_assert( node->control->imfs_type == IMFS_SYM_LINK ); for( i=0; ((iinfo.sym_link.name[i] != '\0')); i++ ) ffc04304: 2c 05 00 00 cmpwi r5,0 ) { IMFS_jnode_t *node; ssize_t i; node = loc->node_access; ffc04308: 81 03 00 08 lwz r8,8(r3) IMFS_assert( node->control->imfs_type == IMFS_SYM_LINK ); for( i=0; ((iinfo.sym_link.name[i] != '\0')); i++ ) ffc0430c: 41 82 00 4c beq- ffc04358 <== NEVER TAKEN ffc04310: 81 28 00 50 lwz r9,80(r8) ffc04314: 89 29 00 00 lbz r9,0(r9) ffc04318: 2f 89 00 00 cmpwi cr7,r9,0 ffc0431c: 41 9e 00 3c beq- cr7,ffc04358 <== NEVER TAKEN ffc04320: 39 40 00 00 li r10,0 ffc04324: 7c a9 03 a6 mtctr r5 ffc04328: 38 60 00 00 li r3,0 ffc0432c: 48 00 00 14 b ffc04340 ffc04330: 81 28 00 50 lwz r9,80(r8) ffc04334: 7d 29 18 ae lbzx r9,r9,r3 ffc04338: 2f 89 00 00 cmpwi cr7,r9,0 ffc0433c: 41 9e 00 18 beq- cr7,ffc04354 ffc04340: 38 63 00 01 addi r3,r3,1 buf[i] = node->info.sym_link.name[i]; ffc04344: 7d 24 51 ae stbx r9,r4,r10 node = loc->node_access; IMFS_assert( node->control->imfs_type == IMFS_SYM_LINK ); for( i=0; ((iinfo.sym_link.name[i] != '\0')); i++ ) ffc04348: 7c 6a 1b 78 mr r10,r3 ffc0434c: 42 00 ff e4 bdnz+ ffc04330 buf[i] = node->info.sym_link.name[i]; return i; } ffc04350: 4e 80 00 20 blr ffc04354: 4e 80 00 20 blr node = loc->node_access; IMFS_assert( node->control->imfs_type == IMFS_SYM_LINK ); for( i=0; ((iinfo.sym_link.name[i] != '\0')); i++ ) ffc04358: 38 60 00 00 li r3,0 <== NOT EXECUTED buf[i] = node->info.sym_link.name[i]; return i; } ffc0435c: 4e 80 00 20 blr <== NOT EXECUTED =============================================================================== ffc04360 : const rtems_filesystem_location_info_t *oldloc, const rtems_filesystem_location_info_t *newparentloc, const char *name, size_t namelen ) { ffc04360: 94 21 ff d8 stwu r1,-40(r1) ffc04364: 7c 08 02 a6 mflr r0 ffc04368: 90 01 00 2c stw r0,44(r1) ffc0436c: 93 e1 00 24 stw r31,36(r1) int rv = 0; IMFS_jnode_t *node = oldloc->node_access; ffc04370: 83 e4 00 08 lwz r31,8(r4) const rtems_filesystem_location_info_t *oldloc, const rtems_filesystem_location_info_t *newparentloc, const char *name, size_t namelen ) { ffc04374: 93 c1 00 20 stw r30,32(r1) /* * FIXME: Due to insufficient checks we can create inaccessible nodes with * this operation. */ if ( node->Parent != NULL ) { ffc04378: 81 3f 00 08 lwz r9,8(r31) const rtems_filesystem_location_info_t *oldloc, const rtems_filesystem_location_info_t *newparentloc, const char *name, size_t namelen ) { ffc0437c: 93 a1 00 1c stw r29,28(r1) /* * FIXME: Due to insufficient checks we can create inaccessible nodes with * this operation. */ if ( node->Parent != NULL ) { ffc04380: 2f 89 00 00 cmpwi cr7,r9,0 size_t namelen ) { int rv = 0; IMFS_jnode_t *node = oldloc->node_access; IMFS_jnode_t *new_parent = newparentloc->node_access; ffc04384: 83 c5 00 08 lwz r30,8(r5) /* * FIXME: Due to insufficient checks we can create inaccessible nodes with * this operation. */ if ( node->Parent != NULL ) { ffc04388: 41 9e 00 a0 beq- cr7,ffc04428 <== NEVER TAKEN if ( namelen < IMFS_NAME_MAX ) { ffc0438c: 2b 87 00 1f cmplwi cr7,r7,31 ffc04390: 7c fd 3b 78 mr r29,r7 ffc04394: 41 9d 00 80 bgt- cr7,ffc04414 <== NEVER TAKEN memcpy( node->name, name, namelen ); ffc04398: 7c c4 33 78 mr r4,r6 ffc0439c: 7c e5 3b 78 mr r5,r7 ffc043a0: 38 7f 00 0c addi r3,r31,12 ffc043a4: 48 00 e9 d9 bl ffc12d7c node->name [namelen] = '\0'; ffc043a8: 7f bf ea 14 add r29,r31,r29 ffc043ac: 39 20 00 00 li r9,0 ffc043b0: 99 3d 00 0c stb r9,12(r29) RTEMS_INLINE_ROUTINE void _Chain_Append_unprotected( Chain_Control *the_chain, Chain_Node *the_node ) { Chain_Node *tail = _Chain_Tail( the_chain ); ffc043b4: 38 fe 00 54 addi r7,r30,84 IMFS_remove_from_directory( node ); IMFS_add_to_directory( new_parent, node ); IMFS_update_ctime( node ); ffc043b8: 38 61 00 08 addi r3,r1,8 ) { Chain_Node *next; Chain_Node *previous; next = the_node->next; ffc043bc: 81 3f 00 00 lwz r9,0(r31) ffc043c0: 38 80 00 00 li r4,0 previous = the_node->previous; ffc043c4: 81 1f 00 04 lwz r8,4(r31) next->previous = previous; ffc043c8: 91 09 00 04 stw r8,4(r9) Chain_Control *the_chain, Chain_Node *the_node ) { Chain_Node *tail = _Chain_Tail( the_chain ); Chain_Node *old_last = tail->previous; ffc043cc: 81 5e 00 58 lwz r10,88(r30) Chain_Node *previous; next = the_node->next; previous = the_node->previous; next->previous = previous; previous->next = next; ffc043d0: 91 28 00 00 stw r9,0(r8) static inline void IMFS_add_to_directory( IMFS_jnode_t *dir, IMFS_jnode_t *node ) { node->Parent = dir; ffc043d4: 93 df 00 08 stw r30,8(r31) ) { Chain_Node *tail = _Chain_Tail( the_chain ); Chain_Node *old_last = tail->previous; the_node->next = tail; ffc043d8: 90 ff 00 00 stw r7,0(r31) tail->previous = the_node; ffc043dc: 93 fe 00 58 stw r31,88(r30) old_last->next = the_node; ffc043e0: 93 ea 00 00 stw r31,0(r10) the_node->previous = old_last; ffc043e4: 91 5f 00 04 stw r10,4(r31) ffc043e8: 48 00 08 6d bl ffc04c54 ffc043ec: 81 21 00 08 lwz r9,8(r1) const rtems_filesystem_location_info_t *newparentloc, const char *name, size_t namelen ) { int rv = 0; ffc043f0: 38 60 00 00 li r3,0 memcpy( node->name, name, namelen ); node->name [namelen] = '\0'; IMFS_remove_from_directory( node ); IMFS_add_to_directory( new_parent, node ); IMFS_update_ctime( node ); ffc043f4: 91 3f 00 48 stw r9,72(r31) errno = EINVAL; rv = -1; } return rv; } ffc043f8: 80 01 00 2c lwz r0,44(r1) ffc043fc: 83 a1 00 1c lwz r29,28(r1) ffc04400: 7c 08 03 a6 mtlr r0 ffc04404: 83 c1 00 20 lwz r30,32(r1) ffc04408: 83 e1 00 24 lwz r31,36(r1) ffc0440c: 38 21 00 28 addi r1,r1,40 ffc04410: 4e 80 00 20 blr IMFS_remove_from_directory( node ); IMFS_add_to_directory( new_parent, node ); IMFS_update_ctime( node ); } else { errno = ENAMETOOLONG; ffc04414: 48 00 dc 65 bl ffc12078 <__errno> <== NOT EXECUTED ffc04418: 39 20 00 5b li r9,91 <== NOT EXECUTED ffc0441c: 91 23 00 00 stw r9,0(r3) <== NOT EXECUTED rv = -1; ffc04420: 38 60 ff ff li r3,-1 <== NOT EXECUTED ffc04424: 4b ff ff d4 b ffc043f8 <== NOT EXECUTED } } else { errno = EINVAL; ffc04428: 48 00 dc 51 bl ffc12078 <__errno> <== NOT EXECUTED ffc0442c: 39 20 00 16 li r9,22 <== NOT EXECUTED ffc04430: 91 23 00 00 stw r9,0(r3) <== NOT EXECUTED rv = -1; ffc04434: 38 60 ff ff li r3,-1 <== NOT EXECUTED ffc04438: 4b ff ff c0 b ffc043f8 <== NOT EXECUTED =============================================================================== ffc04574 : #endif #include "imfs.h" int IMFS_unmount( rtems_filesystem_mount_table_entry_t *mt_entry ) { ffc04574: 94 21 ff f8 stwu r1,-8(r1) ffc04578: 7c 08 02 a6 mflr r0 ffc0457c: 90 01 00 0c stw r0,12(r1) int rv = 0; IMFS_jnode_t *node = mt_entry->mt_point_node->location.node_access; ffc04580: 81 23 00 20 lwz r9,32(r3) ffc04584: 81 29 00 08 lwz r9,8(r9) return node->control->imfs_type; } static inline bool IMFS_is_directory( const IMFS_jnode_t *node ) { return node->control->imfs_type == IMFS_DIRECTORY; ffc04588: 81 49 00 4c lwz r10,76(r9) if ( IMFS_is_directory( node ) ) { ffc0458c: 81 4a 00 00 lwz r10,0(r10) ffc04590: 2f 8a 00 00 cmpwi cr7,r10,0 ffc04594: 40 9e 00 3c bne- cr7,ffc045d0 <== NEVER TAKEN if ( node->info.directory.mt_fs == mt_entry ) { ffc04598: 81 09 00 5c lwz r8,92(r9) ffc0459c: 7f 88 18 00 cmpw cr7,r8,r3 ffc045a0: 40 9e 00 1c bne- cr7,ffc045bc <== NEVER TAKEN node->info.directory.mt_fs = NULL; ffc045a4: 91 49 00 5c stw r10,92(r9) #include "imfs.h" int IMFS_unmount( rtems_filesystem_mount_table_entry_t *mt_entry ) { int rv = 0; ffc045a8: 38 60 00 00 li r3,0 errno = ENOTDIR; rv = -1; } return rv; } ffc045ac: 80 01 00 0c lwz r0,12(r1) ffc045b0: 38 21 00 08 addi r1,r1,8 ffc045b4: 7c 08 03 a6 mtlr r0 ffc045b8: 4e 80 00 20 blr if ( IMFS_is_directory( node ) ) { if ( node->info.directory.mt_fs == mt_entry ) { node->info.directory.mt_fs = NULL; } else { errno = EINVAL; ffc045bc: 48 00 da bd bl ffc12078 <__errno> <== NOT EXECUTED ffc045c0: 39 20 00 16 li r9,22 <== NOT EXECUTED ffc045c4: 91 23 00 00 stw r9,0(r3) <== NOT EXECUTED rv = -1; ffc045c8: 38 60 ff ff li r3,-1 <== NOT EXECUTED ffc045cc: 4b ff ff e0 b ffc045ac <== NOT EXECUTED } } else { errno = ENOTDIR; ffc045d0: 48 00 da a9 bl ffc12078 <__errno> <== NOT EXECUTED ffc045d4: 39 20 00 14 li r9,20 <== NOT EXECUTED ffc045d8: 91 23 00 00 stw r9,0(r3) <== NOT EXECUTED rv = -1; ffc045dc: 38 60 ff ff li r3,-1 <== NOT EXECUTED ffc045e0: 4b ff ff cc b ffc045ac <== NOT EXECUTED =============================================================================== ffc04e84 : Heap_Initialization_or_extend_handler extend ) { Heap_Control *heap = RTEMS_Malloc_Heap; if ( !rtems_configuration_get_unified_work_area() ) { ffc04e84: 3d 20 ff c2 lis r9,-62 void RTEMS_Malloc_Initialize( const Heap_Area *areas, size_t area_count, Heap_Initialization_or_extend_handler extend ) { ffc04e88: 94 21 ff d8 stwu r1,-40(r1) ffc04e8c: 7c 08 02 a6 mflr r0 Heap_Control *heap = RTEMS_Malloc_Heap; ffc04e90: 3d 40 00 00 lis r10,0 if ( !rtems_configuration_get_unified_work_area() ) { ffc04e94: 89 29 d5 69 lbz r9,-10903(r9) void RTEMS_Malloc_Initialize( const Heap_Area *areas, size_t area_count, Heap_Initialization_or_extend_handler extend ) { ffc04e98: 93 81 00 18 stw r28,24(r1) Heap_Control *heap = RTEMS_Malloc_Heap; if ( !rtems_configuration_get_unified_work_area() ) { ffc04e9c: 2f 89 00 00 cmpwi cr7,r9,0 void RTEMS_Malloc_Initialize( const Heap_Area *areas, size_t area_count, Heap_Initialization_or_extend_handler extend ) { ffc04ea0: 90 01 00 2c stw r0,44(r1) ffc04ea4: 93 21 00 0c stw r25,12(r1) ffc04ea8: 93 41 00 10 stw r26,16(r1) ffc04eac: 93 61 00 14 stw r27,20(r1) ffc04eb0: 93 a1 00 1c stw r29,28(r1) ffc04eb4: 93 c1 00 20 stw r30,32(r1) ffc04eb8: 93 e1 00 24 stw r31,36(r1) Heap_Control *heap = RTEMS_Malloc_Heap; ffc04ebc: 83 8a 27 50 lwz r28,10064(r10) if ( !rtems_configuration_get_unified_work_area() ) { ffc04ec0: 40 9e 00 64 bne- cr7,ffc04f24 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) { ffc04ec4: 2f 84 00 00 cmpwi cr7,r4,0 ffc04ec8: 7c 9b 23 78 mr r27,r4 ffc04ecc: 41 9e 00 b8 beq- cr7,ffc04f84 ffc04ed0: 3f 20 ff c1 lis r25,-63 ffc04ed4: 3b 39 b0 08 addi r25,r25,-20472 ffc04ed8: 7c ba 2b 78 mr r26,r5 ffc04edc: 7c 7f 1b 78 mr r31,r3 ffc04ee0: 3b c0 00 00 li r30,0 ffc04ee4: 7f 3d cb 78 mr r29,r25 const Heap_Area *area = &areas [i]; uintptr_t space_available = (*init_or_extend)( ffc04ee8: 7f 83 e3 78 mr r3,r28 ffc04eec: 80 9f 00 00 lwz r4,0(r31) ffc04ef0: 80 bf 00 04 lwz r5,4(r31) ffc04ef4: 38 c0 00 08 li r6,8 ffc04ef8: 7f a9 03 a6 mtctr r29 ffc04efc: 4e 80 04 21 bctrl area->begin, area->size, page_size ); if ( space_available > 0 ) { ffc04f00: 2f 83 00 00 cmpwi cr7,r3,0 ffc04f04: 41 9e 00 08 beq- cr7,ffc04f0c <== NEVER TAKEN init_or_extend = extend; ffc04f08: 7f 5d d3 78 mr r29,r26 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) { ffc04f0c: 3b de 00 01 addi r30,r30,1 ffc04f10: 7f 9e d8 00 cmpw cr7,r30,r27 ffc04f14: 3b ff 00 08 addi r31,r31,8 ffc04f18: 40 9e ff d0 bne+ cr7,ffc04ee8 <== NEVER TAKEN if ( space_available > 0 ) { init_or_extend = extend; } } if ( init_or_extend == _Heap_Initialize ) { ffc04f1c: 7f 9d c8 00 cmpw cr7,r29,r25 ffc04f20: 41 9e 00 64 beq- cr7,ffc04f84 <== NEVER TAKEN } /* * If configured, initialize the statistics support */ if ( rtems_malloc_statistics_helpers != NULL ) { ffc04f24: 3d 20 00 00 lis r9,0 ffc04f28: 81 29 27 c4 lwz r9,10180(r9) ffc04f2c: 2f 89 00 00 cmpwi cr7,r9,0 ffc04f30: 41 9e 00 10 beq- cr7,ffc04f40 (*rtems_malloc_statistics_helpers->initialize)(); ffc04f34: 81 29 00 00 lwz r9,0(r9) ffc04f38: 7d 29 03 a6 mtctr r9 ffc04f3c: 4e 80 04 21 bctrl } MSBUMP( space_available, _Protected_heap_Get_size( heap ) ); ffc04f40: 3f e0 00 00 lis r31,0 ffc04f44: 7f 83 e3 78 mr r3,r28 ffc04f48: 83 df 2b 28 lwz r30,11048(r31) ffc04f4c: 48 00 6e 25 bl ffc0bd70 <_Protected_heap_Get_size> } ffc04f50: 80 01 00 2c lwz r0,44(r1) */ if ( rtems_malloc_statistics_helpers != NULL ) { (*rtems_malloc_statistics_helpers->initialize)(); } MSBUMP( space_available, _Protected_heap_Get_size( heap ) ); ffc04f54: 7c 63 f2 14 add r3,r3,r30 } ffc04f58: 83 21 00 0c lwz r25,12(r1) ffc04f5c: 7c 08 03 a6 mtlr r0 ffc04f60: 83 41 00 10 lwz r26,16(r1) ffc04f64: 83 61 00 14 lwz r27,20(r1) ffc04f68: 83 81 00 18 lwz r28,24(r1) ffc04f6c: 83 a1 00 1c lwz r29,28(r1) ffc04f70: 83 c1 00 20 lwz r30,32(r1) */ if ( rtems_malloc_statistics_helpers != NULL ) { (*rtems_malloc_statistics_helpers->initialize)(); } MSBUMP( space_available, _Protected_heap_Get_size( heap ) ); ffc04f74: 90 7f 2b 28 stw r3,11048(r31) } ffc04f78: 83 e1 00 24 lwz r31,36(r1) ffc04f7c: 38 21 00 28 addi r1,r1,40 ffc04f80: 4e 80 00 20 blr init_or_extend = extend; } } if ( init_or_extend == _Heap_Initialize ) { _Internal_error_Occurred( ffc04f84: 38 60 00 00 li r3,0 ffc04f88: 38 80 00 01 li r4,1 ffc04f8c: 38 a0 00 17 li r5,23 ffc04f90: 48 00 63 89 bl ffc0b318 <_Internal_error_Occurred> =============================================================================== ffc29818 : static rtems_printk_plugin_t print_handler; static void Stack_check_Dump_threads_usage( Thread_Control *the_thread ) { ffc29818: 94 21 ff c0 stwu r1,-64(r1) ffc2981c: 7c 08 02 a6 mflr r0 current = 0; } else #endif { stack = &the_thread->Start.Initial_stack; current = (void *)_CPU_Context_Get_SP( &the_thread->Registers ); ffc29820: 39 43 00 c0 addi r10,r3,192 static rtems_printk_plugin_t print_handler; static void Stack_check_Dump_threads_usage( Thread_Control *the_thread ) { ffc29824: 90 01 00 44 stw r0,68(r1) { uintptr_t clsz = PPC_DEFAULT_CACHE_LINE_SIZE; uintptr_t mask = clsz - 1; uintptr_t addr = (uintptr_t) context; return (ppc_context *) ((addr & ~mask) + clsz); ffc29828: 55 4a 00 34 rlwinm r10,r10,0,0,26 ffc2982c: 93 81 00 30 stw r28,48(r1) stack = &the_thread->Start.Initial_stack; current = (void *)_CPU_Context_Get_SP( &the_thread->Registers ); } low = Stack_check_usable_stack_start(stack); size = Stack_check_usable_stack_size(stack); ffc29830: 83 83 00 b0 lwz r28,176(r3) { stack = &the_thread->Start.Initial_stack; current = (void *)_CPU_Context_Get_SP( &the_thread->Registers ); } low = Stack_check_usable_stack_start(stack); ffc29834: 81 03 00 b4 lwz r8,180(r3) size = Stack_check_usable_stack_size(stack); ffc29838: 3b 9c ff 80 addi r28,r28,-128 static rtems_printk_plugin_t print_handler; static void Stack_check_Dump_threads_usage( Thread_Control *the_thread ) { ffc2983c: 93 41 00 28 stw r26,40(r1) /* * start at lower memory and find first word that does not * match pattern */ base += PATTERN_SIZE_WORDS; ffc29840: 39 28 01 00 addi r9,r8,256 for (ebase = base + length; base < ebase; base++) ffc29844: 57 86 00 3a rlwinm r6,r28,0,0,29 static rtems_printk_plugin_t print_handler; static void Stack_check_Dump_threads_usage( Thread_Control *the_thread ) { ffc29848: 93 e1 00 3c stw r31,60(r1) * start at lower memory and find first word that does not * match pattern */ base += PATTERN_SIZE_WORDS; for (ebase = base + length; base < ebase; base++) ffc2984c: 7c c9 32 14 add r6,r9,r6 ffc29850: 7f 89 30 40 cmplw cr7,r9,r6 static rtems_printk_plugin_t print_handler; static void Stack_check_Dump_threads_usage( Thread_Control *the_thread ) { ffc29854: 92 e1 00 1c stw r23,28(r1) ffc29858: 7c 7f 1b 78 mr r31,r3 ffc2985c: 93 01 00 20 stw r24,32(r1) ffc29860: 93 21 00 24 stw r25,36(r1) ffc29864: 93 61 00 2c stw r27,44(r1) ffc29868: 93 a1 00 34 stw r29,52(r1) ffc2986c: 93 c1 00 38 stw r30,56(r1) current = 0; } else #endif { stack = &the_thread->Start.Initial_stack; current = (void *)_CPU_Context_Get_SP( &the_thread->Registers ); ffc29870: 83 4a 00 20 lwz r26,32(r10) * start at lower memory and find first word that does not * match pattern */ base += PATTERN_SIZE_WORDS; for (ebase = base + length; base < ebase; base++) ffc29874: 40 9c 00 30 bge- cr7,ffc298a4 <== NEVER TAKEN if (*base != U32_PATTERN) ffc29878: 80 a8 01 00 lwz r5,256(r8) ffc2987c: 6c aa 5a 5a xoris r10,r5,23130 ffc29880: 2f 8a a5 a5 cmpwi cr7,r10,-23131 ffc29884: 41 9e 00 14 beq- cr7,ffc29898 <== ALWAYS TAKEN ffc29888: 48 00 00 f8 b ffc29980 <== NOT EXECUTED ffc2988c: 81 49 00 00 lwz r10,0(r9) ffc29890: 7f 8a 28 00 cmpw cr7,r10,r5 ffc29894: 40 9e 00 ec bne- cr7,ffc29980 * start at lower memory and find first word that does not * match pattern */ base += PATTERN_SIZE_WORDS; for (ebase = base + length; base < ebase; base++) ffc29898: 39 29 00 04 addi r9,r9,4 ffc2989c: 7f 86 48 40 cmplw cr7,r6,r9 ffc298a0: 41 9d ff ec bgt+ cr7,ffc2988c <== ALWAYS TAKEN 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; ffc298a4: 3a e0 00 00 li r23,0 <== NOT EXECUTED #if (CPU_ALLOCATE_INTERRUPT_STACK == TRUE) if ( the_thread ) #endif { (*print_handler)( ffc298a8: 3f a0 00 00 lis r29,0 ffc298ac: 83 7f 00 08 lwz r27,8(r31) ffc298b0: 3b dd 5c b0 addi r30,r29,23728 ffc298b4: 83 3d 5c b0 lwz r25,23728(r29) ffc298b8: 83 1e 00 04 lwz r24,4(r30) ffc298bc: 38 80 00 05 li r4,5 ffc298c0: 38 a1 00 08 addi r5,r1,8 ffc298c4: 7f 63 db 78 mr r3,r27 ffc298c8: 4b fe 8b 39 bl ffc12400 ffc298cc: 3c 80 ff c6 lis r4,-58 ffc298d0: 7c 66 1b 78 mr r6,r3 ffc298d4: 7f 29 03 a6 mtctr r25 ffc298d8: 38 84 5e a0 addi r4,r4,24224 ffc298dc: 7f 65 db 78 mr r5,r27 ffc298e0: 7f 03 c3 78 mr r3,r24 ffc298e4: 4c c6 31 82 crclr 4*cr1+eq ffc298e8: 4e 80 04 21 bctrl (*print_handler)( print_context, " %010p - %010p %010p %8" PRId32 " ", stack->area, stack->area + stack->size - 1, ffc298ec: 80 df 00 b0 lwz r6,176(r31) else { (*print_handler)( print_context, "0x%08" PRIx32 " INTR", ~0 ); } #endif (*print_handler)( ffc298f0: 81 5d 5c b0 lwz r10,23728(r29) ffc298f4: 3c 80 ff c6 lis r4,-58 print_context, " %010p - %010p %010p %8" PRId32 " ", stack->area, stack->area + stack->size - 1, ffc298f8: 80 bf 00 b4 lwz r5,180(r31) ffc298fc: 38 c6 ff ff addi r6,r6,-1 else { (*print_handler)( print_context, "0x%08" PRIx32 " INTR", ~0 ); } #endif (*print_handler)( ffc29900: 7d 49 03 a6 mtctr r10 ffc29904: 80 7e 00 04 lwz r3,4(r30) ffc29908: 38 84 5e b0 addi r4,r4,24240 ffc2990c: 7c c5 32 14 add r6,r5,r6 ffc29910: 7f 47 d3 78 mr r7,r26 ffc29914: 7f 88 e3 78 mr r8,r28 ffc29918: 4c c6 31 82 crclr 4*cr1+eq ffc2991c: 4e 80 04 21 bctrl stack->area + stack->size - 1, current, size ); if (Stack_check_Initialized == 0) { ffc29920: 81 5e 00 08 lwz r10,8(r30) (*print_handler)( print_context, "Unavailable\n" ); ffc29924: 81 3d 5c b0 lwz r9,23728(r29) stack->area + stack->size - 1, current, size ); if (Stack_check_Initialized == 0) { ffc29928: 2f 8a 00 00 cmpwi cr7,r10,0 (*print_handler)( print_context, "Unavailable\n" ); ffc2992c: 80 7e 00 04 lwz r3,4(r30) stack->area + stack->size - 1, current, size ); if (Stack_check_Initialized == 0) { ffc29930: 41 9e 00 60 beq- cr7,ffc29990 <== NEVER TAKEN (*print_handler)( print_context, "Unavailable\n" ); } else { (*print_handler)( print_context, "%8" PRId32 "\n", used ); ffc29934: 3c 80 ff c6 lis r4,-58 ffc29938: 7d 29 03 a6 mtctr r9 ffc2993c: 7e e5 bb 78 mr r5,r23 ffc29940: 38 84 5e e0 addi r4,r4,24288 ffc29944: 4c c6 31 82 crclr 4*cr1+eq ffc29948: 4e 80 04 21 bctrl } } ffc2994c: 80 01 00 44 lwz r0,68(r1) ffc29950: 82 e1 00 1c lwz r23,28(r1) ffc29954: 7c 08 03 a6 mtlr r0 ffc29958: 83 01 00 20 lwz r24,32(r1) ffc2995c: 83 21 00 24 lwz r25,36(r1) ffc29960: 83 41 00 28 lwz r26,40(r1) ffc29964: 83 61 00 2c lwz r27,44(r1) ffc29968: 83 81 00 30 lwz r28,48(r1) ffc2996c: 83 a1 00 34 lwz r29,52(r1) ffc29970: 83 c1 00 38 lwz r30,56(r1) ffc29974: 83 e1 00 3c lwz r31,60(r1) ffc29978: 38 21 00 40 addi r1,r1,64 ffc2997c: 4e 80 00 20 blr { stack = &the_thread->Start.Initial_stack; current = (void *)_CPU_Context_Get_SP( &the_thread->Registers ); } low = Stack_check_usable_stack_start(stack); ffc29980: 3a e8 00 80 addi r23,r8,128 size = Stack_check_usable_stack_size(stack); 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 ); ffc29984: 7e f7 e2 14 add r23,r23,r28 ffc29988: 7e e9 b8 50 subf r23,r9,r23 ffc2998c: 4b ff ff 1c b ffc298a8 current, size ); if (Stack_check_Initialized == 0) { (*print_handler)( print_context, "Unavailable\n" ); ffc29990: 3c 80 ff c6 lis r4,-58 <== NOT EXECUTED ffc29994: 7d 29 03 a6 mtctr r9 <== NOT EXECUTED ffc29998: 38 84 5e d0 addi r4,r4,24272 <== NOT EXECUTED ffc2999c: 4c c6 31 82 crclr 4*cr1+eq <== NOT EXECUTED ffc299a0: 4e 80 04 21 bctrl <== NOT EXECUTED } else { (*print_handler)( print_context, "%8" PRId32 "\n", used ); } } ffc299a4: 80 01 00 44 lwz r0,68(r1) <== NOT EXECUTED ffc299a8: 82 e1 00 1c lwz r23,28(r1) <== NOT EXECUTED ffc299ac: 7c 08 03 a6 mtlr r0 <== NOT EXECUTED ffc299b0: 83 01 00 20 lwz r24,32(r1) <== NOT EXECUTED ffc299b4: 83 21 00 24 lwz r25,36(r1) <== NOT EXECUTED ffc299b8: 83 41 00 28 lwz r26,40(r1) <== NOT EXECUTED ffc299bc: 83 61 00 2c lwz r27,44(r1) <== NOT EXECUTED ffc299c0: 83 81 00 30 lwz r28,48(r1) <== NOT EXECUTED ffc299c4: 83 a1 00 34 lwz r29,52(r1) <== NOT EXECUTED ffc299c8: 83 c1 00 38 lwz r30,56(r1) <== NOT EXECUTED ffc299cc: 83 e1 00 3c lwz r31,60(r1) <== NOT EXECUTED ffc299d0: 38 21 00 40 addi r1,r1,64 <== NOT EXECUTED ffc299d4: 4e 80 00 20 blr <== NOT EXECUTED =============================================================================== ffc29aa0 : Thread_Control *running, bool pattern_ok ) RTEMS_COMPILER_NO_RETURN_ATTRIBUTE; void Stack_check_report_blown_task(Thread_Control *running, bool pattern_ok) { ffc29aa0: 94 21 ff c8 stwu r1,-56(r1) ffc29aa4: 7c 08 02 a6 mflr r0 ffc29aa8: 93 e1 00 34 stw r31,52(r1) ffc29aac: 7c 7f 1b 78 mr r31,r3 Stack_Control *stack = &running->Start.Initial_stack; void *pattern_area = Stack_check_Get_pattern(stack); char name[32]; printk("BLOWN STACK!!!\n"); ffc29ab0: 3c 60 ff c6 lis r3,-58 Thread_Control *running, bool pattern_ok ) RTEMS_COMPILER_NO_RETURN_ATTRIBUTE; void Stack_check_report_blown_task(Thread_Control *running, bool pattern_ok) { ffc29ab4: 90 01 00 3c stw r0,60(r1) Stack_Control *stack = &running->Start.Initial_stack; void *pattern_area = Stack_check_Get_pattern(stack); char name[32]; printk("BLOWN STACK!!!\n"); ffc29ab8: 38 63 5e e8 addi r3,r3,24296 Thread_Control *running, bool pattern_ok ) RTEMS_COMPILER_NO_RETURN_ATTRIBUTE; void Stack_check_report_blown_task(Thread_Control *running, bool pattern_ok) { ffc29abc: 93 a1 00 2c stw r29,44(r1) ffc29ac0: 93 c1 00 30 stw r30,48(r1) ffc29ac4: 7c 9e 23 78 mr r30,r4 Stack_Control *stack = &running->Start.Initial_stack; void *pattern_area = Stack_check_Get_pattern(stack); ffc29ac8: 83 bf 00 b4 lwz r29,180(r31) char name[32]; printk("BLOWN STACK!!!\n"); ffc29acc: 4c c6 31 82 crclr 4*cr1+eq ffc29ad0: 4b fd bb 75 bl ffc05644 printk("task control block: 0x%08" PRIxPTR "\n", running); ffc29ad4: 3c 60 ff c6 lis r3,-58 ffc29ad8: 38 63 5e f8 addi r3,r3,24312 ffc29adc: 7f e4 fb 78 mr r4,r31 ffc29ae0: 4c c6 31 82 crclr 4*cr1+eq ffc29ae4: 4b fd bb 61 bl ffc05644 printk("task ID: 0x%08lx\n", (unsigned long) running->Object.id); ffc29ae8: 80 9f 00 08 lwz r4,8(r31) ffc29aec: 3c 60 ff c6 lis r3,-58 ffc29af0: 38 63 5f 14 addi r3,r3,24340 ffc29af4: 4c c6 31 82 crclr 4*cr1+eq ffc29af8: 4b fd bb 4d bl ffc05644 printk( ffc29afc: 80 9f 00 0c lwz r4,12(r31) ffc29b00: 3c 60 ff c6 lis r3,-58 ffc29b04: 38 63 5f 28 addi r3,r3,24360 ffc29b08: 4c c6 31 82 crclr 4*cr1+eq ffc29b0c: 4b fd bb 39 bl ffc05644 "task name: 0x%08" PRIx32 "\n", running->Object.name.name_u32 ); printk( ffc29b10: 80 7f 00 08 lwz r3,8(r31) ffc29b14: 38 a1 00 08 addi r5,r1,8 ffc29b18: 38 80 00 20 li r4,32 ffc29b1c: 4b fe 88 e5 bl ffc12400 ffc29b20: 7c 64 1b 78 mr r4,r3 ffc29b24: 3c 60 ff c6 lis r3,-58 ffc29b28: 38 63 5f 3c addi r3,r3,24380 ffc29b2c: 4c c6 31 82 crclr 4*cr1+eq ffc29b30: 4b fd bb 15 bl ffc05644 ); printk( "task stack area (%lu Bytes): 0x%08" PRIxPTR " .. 0x%08" PRIxPTR "\n", (unsigned long) stack->size, stack->area, ((char *) stack->area + stack->size) ffc29b34: 80 bf 00 b4 lwz r5,180(r31) ffc29b38: 80 9f 00 b0 lwz r4,176(r31) ); printk( "task name string: %s\n", rtems_object_get_name(running->Object.id, sizeof(name), name) ); printk( ffc29b3c: 3c 60 ff c6 lis r3,-58 ffc29b40: 38 63 5f 54 addi r3,r3,24404 ffc29b44: 7c c5 22 14 add r6,r5,r4 ffc29b48: 4c c6 31 82 crclr 4*cr1+eq ffc29b4c: 4b fd ba f9 bl ffc05644 "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) { ffc29b50: 2f 9e 00 00 cmpwi cr7,r30,0 ffc29b54: 41 9e 00 10 beq- cr7,ffc29b64 <== ALWAYS TAKEN rtems_configuration_get_user_multiprocessing_table()->node ); } #endif rtems_fatal( ffc29b58: 80 9f 00 0c lwz r4,12(r31) ffc29b5c: 38 60 00 09 li r3,9 ffc29b60: 4b fe 00 dd bl ffc09c3c (unsigned long) stack->size, stack->area, ((char *) stack->area + stack->size) ); if (!pattern_ok) { printk( ffc29b64: 3c 60 ff c6 lis r3,-58 ffc29b68: 38 63 5f 84 addi r3,r3,24452 ffc29b6c: 38 80 00 80 li r4,128 ffc29b70: 38 bd 00 08 addi r5,r29,8 ffc29b74: 38 dd 00 88 addi r6,r29,136 ffc29b78: 4c c6 31 82 crclr 4*cr1+eq ffc29b7c: 4b fd ba c9 bl ffc05644 ffc29b80: 4b ff ff d8 b ffc29b58 =============================================================================== ffc11694 : /** * We should ensure the ticks not be truncated by integer division. We * need to have it be greater than or equal to the requested time. It * should not be shorter. */ microseconds_per_tick = rtems_configuration_get_microseconds_per_tick(); ffc11694: 3d 20 ff c3 lis r9,-61 ffc11698: 81 49 81 f4 lwz r10,-32268(r9) ticks = microseconds / microseconds_per_tick; ffc1169c: 7d 23 53 96 divwu r9,r3,r10 if ( (microseconds % microseconds_per_tick) != 0 ) ffc116a0: 7d 49 51 d6 mullw r10,r9,r10 ffc116a4: 7f 83 50 00 cmpw cr7,r3,r10 ffc116a8: 41 9e 00 08 beq- cr7,ffc116b0 <== ALWAYS TAKEN ticks += 1; ffc116ac: 39 29 00 01 addi r9,r9,1 <== NOT EXECUTED return ticks; } ffc116b0: 7d 23 4b 78 mr r3,r9 ffc116b4: 4e 80 00 20 blr =============================================================================== ffc0b750 : /** * We should ensure the ticks not be truncated by integer division. We * need to have it be greater than or equal to the requested time. It * should not be shorter. */ milliseconds_per_tick = rtems_configuration_get_milliseconds_per_tick(); ffc0b750: 3d 20 ff c2 lis r9,-62 ffc0b754: 81 29 e9 e4 lwz r9,-5660(r9) ffc0b758: 3d 40 10 62 lis r10,4194 ffc0b75c: 61 4a 4d d3 ori r10,r10,19923 ffc0b760: 7d 49 50 16 mulhwu r10,r9,r10 ffc0b764: 55 4a d1 be rlwinm r10,r10,26,6,31 ticks = milliseconds / milliseconds_per_tick; ffc0b768: 7d 23 53 96 divwu r9,r3,r10 if ( (milliseconds % milliseconds_per_tick) != 0 ) ffc0b76c: 7d 49 51 d6 mullw r10,r9,r10 ffc0b770: 7f 83 50 00 cmpw cr7,r3,r10 ffc0b774: 41 9e 00 08 beq- cr7,ffc0b77c <== ALWAYS TAKEN ticks += 1; ffc0b778: 39 29 00 01 addi r9,r9,1 <== NOT EXECUTED return ticks; } ffc0b77c: 7d 23 4b 78 mr r3,r9 ffc0b780: 4e 80 00 20 blr =============================================================================== ffc0a604 <_API_extensions_Run_postdriver>: } } #endif void _API_extensions_Run_postdriver( void ) { ffc0a604: 94 21 ff f0 stwu r1,-16(r1) */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_First( Chain_Control *the_chain ) { return _Chain_Head( the_chain )->next; ffc0a608: 3d 20 00 00 lis r9,0 ffc0a60c: 7c 08 02 a6 mflr r0 ffc0a610: 93 c1 00 08 stw r30,8(r1) ffc0a614: 3b c9 2d b4 addi r30,r9,11700 Chain_Node *the_node; API_extensions_Control *the_extension; for ( the_node = _Chain_First( &_API_extensions_List ); ffc0a618: 3b de 00 04 addi r30,r30,4 } } #endif void _API_extensions_Run_postdriver( void ) { ffc0a61c: 93 e1 00 0c stw r31,12(r1) ffc0a620: 83 e9 2d b4 lwz r31,11700(r9) ffc0a624: 90 01 00 14 stw r0,20(r1) Chain_Node *the_node; API_extensions_Control *the_extension; for ( the_node = _Chain_First( &_API_extensions_List ); ffc0a628: 7f 9f f0 00 cmpw cr7,r31,r30 ffc0a62c: 41 9e 00 1c beq- cr7,ffc0a648 <_API_extensions_Run_postdriver+0x44><== NEVER TAKEN * Currently all APIs configure this hook so it is always non-NULL. */ #if defined(FUNCTIONALITY_NOT_CURRENTLY_USED_BY_ANY_API) if ( the_extension->postdriver_hook ) #endif (*the_extension->postdriver_hook)(); ffc0a630: 81 3f 00 08 lwz r9,8(r31) ffc0a634: 7d 29 03 a6 mtctr r9 ffc0a638: 4e 80 04 21 bctrl Chain_Node *the_node; API_extensions_Control *the_extension; for ( the_node = _Chain_First( &_API_extensions_List ); !_Chain_Is_tail( &_API_extensions_List, the_node ) ; the_node = the_node->next ) { ffc0a63c: 83 ff 00 00 lwz r31,0(r31) void _API_extensions_Run_postdriver( void ) { Chain_Node *the_node; API_extensions_Control *the_extension; for ( the_node = _Chain_First( &_API_extensions_List ); ffc0a640: 7f 9f f0 00 cmpw cr7,r31,r30 ffc0a644: 40 9e ff ec bne+ cr7,ffc0a630 <_API_extensions_Run_postdriver+0x2c><== NEVER TAKEN #if defined(FUNCTIONALITY_NOT_CURRENTLY_USED_BY_ANY_API) if ( the_extension->postdriver_hook ) #endif (*the_extension->postdriver_hook)(); } } ffc0a648: 80 01 00 14 lwz r0,20(r1) ffc0a64c: 83 c1 00 08 lwz r30,8(r1) ffc0a650: 7c 08 03 a6 mtlr r0 ffc0a654: 83 e1 00 0c lwz r31,12(r1) ffc0a658: 38 21 00 10 addi r1,r1,16 ffc0a65c: 4e 80 00 20 blr =============================================================================== ffc14ecc <_CORE_message_queue_Initialize>: /* * Check if allocated_message_size is aligned to uintptr-size boundary. * If not, it will increase allocated_message_size to multiplicity of pointer * size. */ if (allocated_message_size & (sizeof(uintptr_t) - 1)) { ffc14ecc: 70 c9 00 03 andi. r9,r6,3 CORE_message_queue_Control *the_message_queue, CORE_message_queue_Attributes *the_message_queue_attributes, uint32_t maximum_pending_messages, size_t maximum_message_size ) { ffc14ed0: 94 21 ff e0 stwu r1,-32(r1) ffc14ed4: 7c 08 02 a6 mflr r0 size_t message_buffering_required = 0; size_t allocated_message_size; the_message_queue->maximum_pending_messages = maximum_pending_messages; the_message_queue->number_of_pending_messages = 0; ffc14ed8: 39 20 00 00 li r9,0 CORE_message_queue_Control *the_message_queue, CORE_message_queue_Attributes *the_message_queue_attributes, uint32_t maximum_pending_messages, size_t maximum_message_size ) { ffc14edc: 93 a1 00 14 stw r29,20(r1) ffc14ee0: 7c 9d 23 78 mr r29,r4 ffc14ee4: 93 e1 00 1c stw r31,28(r1) ffc14ee8: 7c 7f 1b 78 mr r31,r3 ffc14eec: 90 01 00 24 stw r0,36(r1) ffc14ef0: 93 c1 00 18 stw r30,24(r1) size_t message_buffering_required = 0; size_t allocated_message_size; the_message_queue->maximum_pending_messages = maximum_pending_messages; ffc14ef4: 90 a3 00 44 stw r5,68(r3) the_message_queue->number_of_pending_messages = 0; ffc14ef8: 91 23 00 48 stw r9,72(r3) the_message_queue->maximum_message_size = maximum_message_size; ffc14efc: 90 c3 00 4c stw r6,76(r3) /* * Check if allocated_message_size is aligned to uintptr-size boundary. * If not, it will increase allocated_message_size to multiplicity of pointer * size. */ if (allocated_message_size & (sizeof(uintptr_t) - 1)) { ffc14f00: 41 82 00 34 beq- ffc14f34 <_CORE_message_queue_Initialize+0x68> allocated_message_size += sizeof(uintptr_t); ffc14f04: 39 26 00 04 addi r9,r6,4 allocated_message_size &= ~(sizeof(uintptr_t) - 1); ffc14f08: 55 29 00 3a rlwinm r9,r9,0,0,29 /* * Check for an overflow. It can occur while increasing allocated_message_size * to multiplicity of uintptr_t above. */ if (allocated_message_size < maximum_message_size) ffc14f0c: 7f 86 48 40 cmplw cr7,r6,r9 ffc14f10: 40 9d 00 28 ble- cr7,ffc14f38 <_CORE_message_queue_Initialize+0x6c> STATES_WAITING_FOR_MESSAGE, CORE_MESSAGE_QUEUE_STATUS_TIMEOUT ); return true; } ffc14f14: 80 01 00 24 lwz r0,36(r1) /* * Check for an overflow. It can occur while increasing allocated_message_size * to multiplicity of uintptr_t above. */ if (allocated_message_size < maximum_message_size) return false; ffc14f18: 38 60 00 00 li r3,0 STATES_WAITING_FOR_MESSAGE, CORE_MESSAGE_QUEUE_STATUS_TIMEOUT ); return true; } ffc14f1c: 83 a1 00 14 lwz r29,20(r1) ffc14f20: 7c 08 03 a6 mtlr r0 ffc14f24: 83 c1 00 18 lwz r30,24(r1) ffc14f28: 83 e1 00 1c lwz r31,28(r1) ffc14f2c: 38 21 00 20 addi r1,r1,32 ffc14f30: 4e 80 00 20 blr /* * Check if allocated_message_size is aligned to uintptr-size boundary. * If not, it will increase allocated_message_size to multiplicity of pointer * size. */ if (allocated_message_size & (sizeof(uintptr_t) - 1)) { ffc14f34: 7c c9 33 78 mr r9,r6 /* * Calculate how much total memory is required for message buffering and * check for overflow on the multiplication. */ if ( !size_t_mult32_with_overflow( ffc14f38: 3b c9 00 10 addi r30,r9,16 size_t a, size_t b, size_t *c ) { long long x = (long long)a*b; ffc14f3c: 7d 45 f0 16 mulhwu r10,r5,r30 ffc14f40: 7d 65 f1 d6 mullw r11,r5,r30 if ( x > SIZE_MAX ) ffc14f44: 2f 8a 00 00 cmpwi cr7,r10,0 ffc14f48: 41 bd ff cc bgt- cr7,ffc14f14 <_CORE_message_queue_Initialize+0x48> /* * Attempt to allocate the message memory */ the_message_queue->message_buffers = (CORE_message_queue_Buffer *) _Workspace_Allocate( message_buffering_required ); ffc14f4c: 7d 63 5b 78 mr r3,r11 ffc14f50: 90 a1 00 08 stw r5,8(r1) ffc14f54: 48 00 3a 11 bl ffc18964 <_Workspace_Allocate> if (the_message_queue->message_buffers == 0) ffc14f58: 2f 83 00 00 cmpwi cr7,r3,0 return false; /* * Attempt to allocate the message memory */ the_message_queue->message_buffers = (CORE_message_queue_Buffer *) ffc14f5c: 90 7f 00 5c stw r3,92(r31) _Workspace_Allocate( message_buffering_required ); ffc14f60: 7c 64 1b 78 mr r4,r3 if (the_message_queue->message_buffers == 0) ffc14f64: 80 a1 00 08 lwz r5,8(r1) ffc14f68: 41 be ff ac beq- cr7,ffc14f14 <_CORE_message_queue_Initialize+0x48><== NEVER TAKEN /* * Initialize the pool of inactive messages, pending messages, * and set of waiting threads. */ _Chain_Initialize ( ffc14f6c: 38 7f 00 60 addi r3,r31,96 ffc14f70: 7f c6 f3 78 mr r6,r30 ffc14f74: 4b ff ff 05 bl ffc14e78 <_Chain_Initialize> */ RTEMS_INLINE_ROUTINE bool _CORE_message_queue_Is_priority( CORE_message_queue_Attributes *the_attribute ) { return ffc14f78: 80 9d 00 00 lwz r4,0(r29) 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 ); ffc14f7c: 39 5f 00 54 addi r10,r31,84 ffc14f80: 39 3f 00 50 addi r9,r31,80 head->next = tail; ffc14f84: 91 5f 00 50 stw r10,80(r31) allocated_message_size + sizeof( CORE_message_queue_Buffer_control ) ); _Chain_Initialize_empty( &the_message_queue->Pending_messages ); _Thread_queue_Initialize( ffc14f88: 68 84 00 01 xori r4,r4,1 head->previous = NULL; ffc14f8c: 39 40 00 00 li r10,0 tail->previous = head; ffc14f90: 91 3f 00 58 stw r9,88(r31) ffc14f94: 7c 84 00 34 cntlzw r4,r4 { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); head->next = tail; head->previous = NULL; ffc14f98: 91 5f 00 54 stw r10,84(r31) ffc14f9c: 7f e3 fb 78 mr r3,r31 ffc14fa0: 54 84 d9 7e rlwinm r4,r4,27,5,31 ffc14fa4: 38 a0 00 80 li r5,128 ffc14fa8: 38 c0 00 06 li r6,6 ffc14fac: 48 00 2e 91 bl ffc17e3c <_Thread_queue_Initialize> STATES_WAITING_FOR_MESSAGE, CORE_MESSAGE_QUEUE_STATUS_TIMEOUT ); return true; } ffc14fb0: 80 01 00 24 lwz r0,36(r1) ffc14fb4: 83 a1 00 14 lwz r29,20(r1) THREAD_QUEUE_DISCIPLINE_PRIORITY : THREAD_QUEUE_DISCIPLINE_FIFO, STATES_WAITING_FOR_MESSAGE, CORE_MESSAGE_QUEUE_STATUS_TIMEOUT ); return true; ffc14fb8: 38 60 00 01 li r3,1 } ffc14fbc: 7c 08 03 a6 mtlr r0 ffc14fc0: 83 c1 00 18 lwz r30,24(r1) ffc14fc4: 83 e1 00 1c lwz r31,28(r1) ffc14fc8: 38 21 00 20 addi r1,r1,32 ffc14fcc: 4e 80 00 20 blr =============================================================================== ffc0a9ec <_CORE_mutex_Seize>: Objects_Id _id, bool _wait, Watchdog_Interval _timeout, ISR_Level _level ) { ffc0a9ec: 94 21 ff d8 stwu r1,-40(r1) ffc0a9f0: 7c 08 02 a6 mflr r0 ffc0a9f4: 93 e1 00 24 stw r31,36(r1) * This routine returns true if thread dispatch indicates * that we are in a critical section. */ RTEMS_INLINE_ROUTINE bool _Thread_Dispatch_in_critical_section(void) { if ( _Thread_Dispatch_disable_level == 0 ) ffc0a9f8: 3f e0 00 00 lis r31,0 ffc0a9fc: 81 3f 28 24 lwz r9,10276(r31) ffc0aa00: 93 61 00 14 stw r27,20(r1) ffc0aa04: 7c db 33 78 mr r27,r6 ffc0aa08: 2f 89 00 00 cmpwi cr7,r9,0 ffc0aa0c: 93 81 00 18 stw r28,24(r1) ffc0aa10: 7c 9c 23 78 mr r28,r4 ffc0aa14: 93 a1 00 1c stw r29,28(r1) ffc0aa18: 7c 7d 1b 78 mr r29,r3 ffc0aa1c: 93 c1 00 20 stw r30,32(r1) ffc0aa20: 7c be 2b 78 mr r30,r5 ffc0aa24: 90 01 00 2c stw r0,44(r1) ffc0aa28: 90 e1 00 08 stw r7,8(r1) ffc0aa2c: 41 9e 00 88 beq- cr7,ffc0aab4 <_CORE_mutex_Seize+0xc8> _CORE_mutex_Seize_body( _the_mutex, _id, _wait, _timeout, _level ); ffc0aa30: 2f 85 00 00 cmpwi cr7,r5,0 ffc0aa34: 41 9e 00 d4 beq- cr7,ffc0ab08 <_CORE_mutex_Seize+0x11c> ffc0aa38: 3d 20 00 00 lis r9,0 ffc0aa3c: 81 29 28 4c lwz r9,10316(r9) ffc0aa40: 2b 89 00 01 cmplwi cr7,r9,1 ffc0aa44: 41 9d 00 d8 bgt- cr7,ffc0ab1c <_CORE_mutex_Seize+0x130> ffc0aa48: 38 81 00 08 addi r4,r1,8 ffc0aa4c: 48 00 52 29 bl ffc0fc74 <_CORE_mutex_Seize_interrupt_trylock> ffc0aa50: 2f 83 00 00 cmpwi cr7,r3,0 ffc0aa54: 41 9e 00 3c beq- cr7,ffc0aa90 <_CORE_mutex_Seize+0xa4> <== ALWAYS TAKEN ffc0aa58: 3d 20 00 00 lis r9,0 * * 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; ffc0aa5c: 81 5f 28 24 lwz r10,10276(r31) ffc0aa60: 81 29 2e 10 lwz r9,11792(r9) RTEMS_INLINE_ROUTINE void _Thread_queue_Enter_critical_section ( Thread_queue_Control *the_thread_queue ) { the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; ffc0aa64: 39 00 00 01 li r8,1 ffc0aa68: 91 1d 00 30 stw r8,48(r29) ++level; ffc0aa6c: 39 4a 00 01 addi r10,r10,1 ffc0aa70: 93 a9 00 44 stw r29,68(r9) ffc0aa74: 93 89 00 20 stw r28,32(r9) _Thread_Dispatch_disable_level = level; ffc0aa78: 91 5f 28 24 stw r10,10276(r31) ffc0aa7c: 81 21 00 08 lwz r9,8(r1) ffc0aa80: 7d 20 01 24 mtmsr r9 ffc0aa84: 7f a3 eb 78 mr r3,r29 ffc0aa88: 7f 64 db 78 mr r4,r27 ffc0aa8c: 4b ff fe 81 bl ffc0a90c <_CORE_mutex_Seize_interrupt_blocking> } ffc0aa90: 80 01 00 2c lwz r0,44(r1) ffc0aa94: 83 61 00 14 lwz r27,20(r1) ffc0aa98: 7c 08 03 a6 mtlr r0 ffc0aa9c: 83 81 00 18 lwz r28,24(r1) ffc0aaa0: 83 a1 00 1c lwz r29,28(r1) ffc0aaa4: 83 c1 00 20 lwz r30,32(r1) ffc0aaa8: 83 e1 00 24 lwz r31,36(r1) ffc0aaac: 38 21 00 28 addi r1,r1,40 ffc0aab0: 4e 80 00 20 blr bool _wait, Watchdog_Interval _timeout, ISR_Level _level ) { _CORE_mutex_Seize_body( _the_mutex, _id, _wait, _timeout, _level ); ffc0aab4: 38 81 00 08 addi r4,r1,8 ffc0aab8: 48 00 51 bd bl ffc0fc74 <_CORE_mutex_Seize_interrupt_trylock> ffc0aabc: 2f 83 00 00 cmpwi cr7,r3,0 ffc0aac0: 41 be ff d0 beq- cr7,ffc0aa90 <_CORE_mutex_Seize+0xa4> ffc0aac4: 2f 9e 00 00 cmpwi cr7,r30,0 ffc0aac8: 40 be ff 90 bne- cr7,ffc0aa58 <_CORE_mutex_Seize+0x6c> ffc0aacc: 81 21 00 08 lwz r9,8(r1) ffc0aad0: 7d 20 01 24 mtmsr r9 } ffc0aad4: 80 01 00 2c lwz r0,44(r1) bool _wait, Watchdog_Interval _timeout, ISR_Level _level ) { _CORE_mutex_Seize_body( _the_mutex, _id, _wait, _timeout, _level ); ffc0aad8: 3d 20 00 00 lis r9,0 ffc0aadc: 81 29 2e 10 lwz r9,11792(r9) ffc0aae0: 39 40 00 01 li r10,1 } ffc0aae4: 7c 08 03 a6 mtlr r0 ffc0aae8: 83 61 00 14 lwz r27,20(r1) ffc0aaec: 83 81 00 18 lwz r28,24(r1) ffc0aaf0: 83 a1 00 1c lwz r29,28(r1) ffc0aaf4: 83 c1 00 20 lwz r30,32(r1) ffc0aaf8: 83 e1 00 24 lwz r31,36(r1) bool _wait, Watchdog_Interval _timeout, ISR_Level _level ) { _CORE_mutex_Seize_body( _the_mutex, _id, _wait, _timeout, _level ); ffc0aafc: 91 49 00 34 stw r10,52(r9) } ffc0ab00: 38 21 00 28 addi r1,r1,40 ffc0ab04: 4e 80 00 20 blr bool _wait, Watchdog_Interval _timeout, ISR_Level _level ) { _CORE_mutex_Seize_body( _the_mutex, _id, _wait, _timeout, _level ); ffc0ab08: 38 81 00 08 addi r4,r1,8 ffc0ab0c: 48 00 51 69 bl ffc0fc74 <_CORE_mutex_Seize_interrupt_trylock> ffc0ab10: 2f 83 00 00 cmpwi cr7,r3,0 ffc0ab14: 40 9e ff b8 bne+ cr7,ffc0aacc <_CORE_mutex_Seize+0xe0> <== NEVER TAKEN ffc0ab18: 4b ff ff 78 b ffc0aa90 <_CORE_mutex_Seize+0xa4> ffc0ab1c: 38 60 00 00 li r3,0 ffc0ab20: 38 80 00 00 li r4,0 ffc0ab24: 38 a0 00 12 li r5,18 ffc0ab28: 48 00 07 f1 bl ffc0b318 <_Internal_error_Occurred> =============================================================================== ffc0acbc <_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 ) { ffc0acbc: 94 21 ff f0 stwu r1,-16(r1) ffc0acc0: 7c 08 02 a6 mflr r0 ffc0acc4: 93 e1 00 0c stw r31,12(r1) ffc0acc8: 7c 7f 1b 78 mr r31,r3 ffc0accc: 90 01 00 14 stw r0,20(r1) ISR_Level level; CORE_semaphore_Status status; status = CORE_SEMAPHORE_STATUS_SUCCESSFUL; if ( (the_thread = _Thread_queue_Dequeue(&the_semaphore->Wait_queue)) ) { ffc0acd0: 48 00 21 65 bl ffc0ce34 <_Thread_queue_Dequeue> ffc0acd4: 2f 83 00 00 cmpwi cr7,r3,0 ffc0acd8: 41 9e 00 1c beq- cr7,ffc0acf4 <_CORE_semaphore_Surrender+0x38> status = CORE_SEMAPHORE_MAXIMUM_COUNT_EXCEEDED; _ISR_Enable( level ); } return status; } ffc0acdc: 80 01 00 14 lwz r0,20(r1) { Thread_Control *the_thread; ISR_Level level; CORE_semaphore_Status status; status = CORE_SEMAPHORE_STATUS_SUCCESSFUL; ffc0ace0: 38 60 00 00 li r3,0 status = CORE_SEMAPHORE_MAXIMUM_COUNT_EXCEEDED; _ISR_Enable( level ); } return status; } ffc0ace4: 83 e1 00 0c lwz r31,12(r1) ffc0ace8: 7c 08 03 a6 mtlr r0 ffc0acec: 38 21 00 10 addi r1,r1,16 ffc0acf0: 4e 80 00 20 blr static inline uint32_t ppc_interrupt_disable( void ) { uint32_t level; uint32_t mask; __asm__ volatile ( ffc0acf4: 7d 00 00 a6 mfmsr r8 ffc0acf8: 7d 30 42 a6 mfsprg r9,0 ffc0acfc: 7d 09 48 78 andc r9,r8,r9 ffc0ad00: 7d 20 01 24 mtmsr r9 (*api_semaphore_mp_support) ( the_thread, id ); #endif } else { _ISR_Disable( level ); if ( the_semaphore->count < the_semaphore->Attributes.maximum_count ) ffc0ad04: 81 3f 00 48 lwz r9,72(r31) the_semaphore->count += 1; else status = CORE_SEMAPHORE_MAXIMUM_COUNT_EXCEEDED; ffc0ad08: 38 60 00 04 li r3,4 (*api_semaphore_mp_support) ( the_thread, id ); #endif } else { _ISR_Disable( level ); if ( the_semaphore->count < the_semaphore->Attributes.maximum_count ) ffc0ad0c: 81 5f 00 40 lwz r10,64(r31) ffc0ad10: 7f 89 50 40 cmplw cr7,r9,r10 ffc0ad14: 40 9c 00 10 bge- cr7,ffc0ad24 <_CORE_semaphore_Surrender+0x68><== NEVER TAKEN the_semaphore->count += 1; ffc0ad18: 39 29 00 01 addi r9,r9,1 ffc0ad1c: 91 3f 00 48 stw r9,72(r31) { Thread_Control *the_thread; ISR_Level level; CORE_semaphore_Status status; status = CORE_SEMAPHORE_STATUS_SUCCESSFUL; ffc0ad20: 38 60 00 00 li r3,0 return level; } static inline void ppc_interrupt_enable( uint32_t level ) { __asm__ volatile ( ffc0ad24: 7d 00 01 24 mtmsr r8 status = CORE_SEMAPHORE_MAXIMUM_COUNT_EXCEEDED; _ISR_Enable( level ); } return status; } ffc0ad28: 80 01 00 14 lwz r0,20(r1) ffc0ad2c: 83 e1 00 0c lwz r31,12(r1) ffc0ad30: 7c 08 03 a6 mtlr r0 ffc0ad34: 38 21 00 10 addi r1,r1,16 ffc0ad38: 4e 80 00 20 blr =============================================================================== ffc0a7e4 <_Chain_Initialize>: Chain_Node *current = head; Chain_Node *next = starting_address; head->previous = NULL; while ( count-- ) { ffc0a7e4: 2f 85 00 00 cmpwi cr7,r5,0 Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); Chain_Node *current = head; Chain_Node *next = starting_address; head->previous = NULL; ffc0a7e8: 39 20 00 00 li r9,0 size_t node_size ) { size_t count = number_nodes; Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); ffc0a7ec: 39 03 00 04 addi r8,r3,4 Chain_Node *current = head; Chain_Node *next = starting_address; head->previous = NULL; ffc0a7f0: 91 23 00 04 stw r9,4(r3) while ( count-- ) { ffc0a7f4: 38 e5 ff ff addi r7,r5,-1 ffc0a7f8: 41 9e 00 38 beq- cr7,ffc0a830 <_Chain_Initialize+0x4c> <== NEVER TAKEN ffc0a7fc: 7c a9 03 a6 mtctr r5 ffc0a800: 7c 89 23 78 mr r9,r4 ffc0a804: 7c 6a 1b 78 mr r10,r3 current->next = next; ffc0a808: 91 2a 00 00 stw r9,0(r10) next->previous = current; ffc0a80c: 91 49 00 04 stw r10,4(r9) ffc0a810: 7d 2a 4b 78 mr r10,r9 current = next; next = (Chain_Node *) ffc0a814: 7d 29 32 14 add r9,r9,r6 Chain_Node *current = head; Chain_Node *next = starting_address; head->previous = NULL; while ( count-- ) { ffc0a818: 42 00 ff f0 bdnz+ ffc0a808 <_Chain_Initialize+0x24> #include #include #include #include void _Chain_Initialize( ffc0a81c: 7c c6 39 d6 mullw r6,r6,r7 ffc0a820: 7c c4 32 14 add r6,r4,r6 current = next; next = (Chain_Node *) _Addresses_Add_offset( (void *) next, node_size ); } current->next = tail; ffc0a824: 91 06 00 00 stw r8,0(r6) tail->previous = current; ffc0a828: 90 c3 00 08 stw r6,8(r3) ffc0a82c: 4e 80 00 20 blr ) { size_t count = number_nodes; Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); Chain_Node *current = head; ffc0a830: 7c 66 1b 78 mr r6,r3 <== NOT EXECUTED ffc0a834: 4b ff ff f0 b ffc0a824 <_Chain_Initialize+0x40> <== NOT EXECUTED =============================================================================== ffc0952c <_Event_Surrender>: rtems_event_set event_in, Event_Control *event, Thread_blocking_operation_States *sync_state, States_Control wait_state ) { ffc0952c: 94 21 ff f0 stwu r1,-16(r1) ffc09530: 7c 08 02 a6 mflr r0 ffc09534: 90 01 00 14 stw r0,20(r1) ffc09538: 93 e1 00 0c stw r31,12(r1) ffc0953c: 7c 7f 1b 78 mr r31,r3 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; ffc09540: 81 63 00 30 lwz r11,48(r3) static inline uint32_t ppc_interrupt_disable( void ) { uint32_t level; uint32_t mask; __asm__ volatile ( ffc09544: 7d 40 00 a6 mfmsr r10 ffc09548: 7d 30 42 a6 mfsprg r9,0 ffc0954c: 7d 49 48 78 andc r9,r10,r9 ffc09550: 7d 20 01 24 mtmsr r9 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; ffc09554: 81 25 00 00 lwz r9,0(r5) ffc09558: 7c 84 4b 78 or r4,r4,r9 ffc0955c: 90 85 00 00 stw r4,0(r5) _ISR_Disable( level ); _Event_sets_Post( event_in, &event->pending_events ); pending_events = event->pending_events; event_condition = the_thread->Wait.count; ffc09560: 81 23 00 24 lwz r9,36(r3) seized_events = _Event_sets_Get( pending_events, event_condition ); /* * No events were seized in this operation */ if ( _Event_sets_Is_empty( seized_events ) ) { ffc09564: 7c 88 48 39 and. r8,r4,r9 ffc09568: 41 82 00 d4 beq- ffc0963c <_Event_Surrender+0x110> /* * 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() && ffc0956c: 3c 60 00 00 lis r3,0 ffc09570: 38 63 2e 00 addi r3,r3,11776 ffc09574: 80 03 00 08 lwz r0,8(r3) ffc09578: 2f 80 00 00 cmpwi cr7,r0,0 ffc0957c: 41 9e 00 10 beq- cr7,ffc0958c <_Event_Surrender+0x60> ffc09580: 80 63 00 10 lwz r3,16(r3) ffc09584: 7f 9f 18 00 cmpw cr7,r31,r3 ffc09588: 41 9e 00 74 beq- cr7,ffc095fc <_Event_Surrender+0xd0> RTEMS_INLINE_ROUTINE bool _States_Are_set ( States_Control the_states, States_Control mask ) { return ( (the_states & mask) != STATES_READY); ffc0958c: 80 df 00 10 lwz r6,16(r31) } /* * Otherwise, this is a normal send to another thread */ if ( _States_Are_set( the_thread->current_state, wait_state ) ) { ffc09590: 7c e3 30 39 and. r3,r7,r6 ffc09594: 41 82 00 a8 beq- ffc0963c <_Event_Surrender+0x110> if ( seized_events == event_condition || _Options_Is_any( option_set ) ) { ffc09598: 7f 89 40 00 cmpw cr7,r9,r8 ffc0959c: 41 9e 00 0c beq- cr7,ffc095a8 <_Event_Surrender+0x7c> ffc095a0: 71 69 00 02 andi. r9,r11,2 ffc095a4: 41 82 00 98 beq- ffc0963c <_Event_Surrender+0x110> <== NEVER TAKEN 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; ffc095a8: 81 3f 00 28 lwz r9,40(r31) 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) ); ffc095ac: 7c 84 40 78 andc r4,r4,r8 if ( seized_events == event_condition || _Options_Is_any( option_set ) ) { event->pending_events = _Event_sets_Clear( pending_events, seized_events ); the_thread->Wait.count = 0; ffc095b0: 38 e0 00 00 li r7,0 /* * 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( ffc095b4: 90 85 00 00 stw r4,0(r5) pending_events, seized_events ); the_thread->Wait.count = 0; ffc095b8: 90 ff 00 24 stw r7,36(r31) *(rtems_event_set *)the_thread->Wait.return_argument = seized_events; ffc095bc: 91 09 00 00 stw r8,0(r9) static inline void ppc_interrupt_flash( uint32_t level ) { uint32_t current_level; __asm__ volatile ( ffc095c0: 7d 20 00 a6 mfmsr r9 ffc095c4: 7d 40 01 24 mtmsr r10 ffc095c8: 7d 20 01 24 mtmsr r9 _ISR_Flash( level ); if ( !_Watchdog_Is_active( &the_thread->Timer ) ) { ffc095cc: 81 3f 00 50 lwz r9,80(r31) ffc095d0: 2f 89 00 02 cmpwi cr7,r9,2 ffc095d4: 41 9e 00 80 beq- cr7,ffc09654 <_Event_Surrender+0x128> return level; } static inline void ppc_interrupt_enable( uint32_t level ) { __asm__ volatile ( ffc095d8: 7d 40 01 24 mtmsr r10 } return; } } _ISR_Enable( level ); } ffc095dc: 80 01 00 14 lwz r0,20(r1) RTEMS_INLINE_ROUTINE void _Thread_Unblock ( Thread_Control *the_thread ) { _Thread_Clear_state( the_thread, STATES_BLOCKED ); ffc095e0: 7f e3 fb 78 mr r3,r31 ffc095e4: 3c 80 10 07 lis r4,4103 ffc095e8: 83 e1 00 0c lwz r31,12(r1) ffc095ec: 7c 08 03 a6 mtlr r0 ffc095f0: 60 84 ff f8 ori r4,r4,65528 ffc095f4: 38 21 00 10 addi r1,r1,16 ffc095f8: 48 00 2f 24 b ffc0c51c <_Thread_Clear_state> * 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 ) && ((*sync_state == THREAD_BLOCKING_OPERATION_TIMEOUT) || ffc095fc: 80 66 00 00 lwz r3,0(r6) ffc09600: 38 63 ff ff addi r3,r3,-1 /* * 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 ) && ffc09604: 2b 83 00 01 cmplwi cr7,r3,1 ffc09608: 41 9d ff 84 bgt+ cr7,ffc0958c <_Event_Surrender+0x60> ((*sync_state == THREAD_BLOCKING_OPERATION_TIMEOUT) || (*sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED)) ) { if ( seized_events == event_condition || _Options_Is_any(option_set) ) { ffc0960c: 7f 89 40 00 cmpw cr7,r9,r8 ffc09610: 41 9e 00 0c beq- cr7,ffc0961c <_Event_Surrender+0xf0> ffc09614: 71 63 00 02 andi. r3,r11,2 ffc09618: 41 82 00 24 beq- ffc0963c <_Event_Surrender+0x110> <== NEVER TAKEN 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; ffc0961c: 81 3f 00 28 lwz r9,40(r31) ffc09620: 7c 84 40 78 andc r4,r4,r8 if ( seized_events == event_condition || _Options_Is_any(option_set) ) { event->pending_events = _Event_sets_Clear( pending_events, seized_events ); the_thread->Wait.count = 0; ffc09624: 38 e0 00 00 li r7,0 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( ffc09628: 90 85 00 00 stw r4,0(r5) pending_events, seized_events ); the_thread->Wait.count = 0; ffc0962c: 90 ff 00 24 stw r7,36(r31) *(rtems_event_set *)the_thread->Wait.return_argument = seized_events; ffc09630: 91 09 00 00 stw r8,0(r9) *sync_state = THREAD_BLOCKING_OPERATION_SATISFIED; ffc09634: 39 20 00 03 li r9,3 ffc09638: 91 26 00 00 stw r9,0(r6) ffc0963c: 7d 40 01 24 mtmsr r10 } return; } } _ISR_Enable( level ); } ffc09640: 80 01 00 14 lwz r0,20(r1) ffc09644: 83 e1 00 0c lwz r31,12(r1) ffc09648: 7c 08 03 a6 mtlr r0 ffc0964c: 38 21 00 10 addi r1,r1,16 ffc09650: 4e 80 00 20 blr RTEMS_INLINE_ROUTINE void _Watchdog_Deactivate( Watchdog_Control *the_watchdog ) { the_watchdog->state = WATCHDOG_REMOVE_IT; ffc09654: 39 20 00 03 li r9,3 ffc09658: 91 3f 00 50 stw r9,80(r31) ffc0965c: 7d 40 01 24 mtmsr r10 _ISR_Enable( level ); _Thread_Unblock( the_thread ); } else { _Watchdog_Deactivate( &the_thread->Timer ); _ISR_Enable( level ); (void) _Watchdog_Remove( &the_thread->Timer ); ffc09660: 38 7f 00 48 addi r3,r31,72 ffc09664: 48 00 45 15 bl ffc0db78 <_Watchdog_Remove> ffc09668: 4b ff ff 74 b ffc095dc <_Event_Surrender+0xb0> =============================================================================== ffc0966c <_Event_Timeout>: void _Event_Timeout( Objects_Id id, void *arg ) { ffc0966c: 94 21 ff e0 stwu r1,-32(r1) ffc09670: 7c 08 02 a6 mflr r0 ffc09674: 93 e1 00 1c stw r31,28(r1) ffc09678: 7c 9f 23 78 mr r31,r4 ISR_Level level; Thread_blocking_operation_States *sync_state; sync_state = arg; the_thread = _Thread_Get( id, &location ); ffc0967c: 38 81 00 08 addi r4,r1,8 void _Event_Timeout( Objects_Id id, void *arg ) { ffc09680: 90 01 00 24 stw r0,36(r1) ISR_Level level; Thread_blocking_operation_States *sync_state; sync_state = arg; the_thread = _Thread_Get( id, &location ); ffc09684: 48 00 33 b5 bl ffc0ca38 <_Thread_Get> switch ( location ) { ffc09688: 81 21 00 08 lwz r9,8(r1) ffc0968c: 2f 89 00 00 cmpwi cr7,r9,0 ffc09690: 40 9e 00 50 bne- cr7,ffc096e0 <_Event_Timeout+0x74> <== NEVER TAKEN static inline uint32_t ppc_interrupt_disable( void ) { uint32_t level; uint32_t mask; __asm__ volatile ( ffc09694: 7d 40 00 a6 mfmsr r10 ffc09698: 7d 10 42 a6 mfsprg r8,0 ffc0969c: 7d 48 40 78 andc r8,r10,r8 ffc096a0: 7d 00 01 24 mtmsr r8 RTEMS_INLINE_ROUTINE bool _Thread_Is_executing ( const Thread_Control *the_thread ) { return ( the_thread == _Thread_Executing ); ffc096a4: 3d 00 00 00 lis r8,0 return; } #endif the_thread->Wait.count = 0; if ( _Thread_Is_executing( the_thread ) ) { ffc096a8: 81 08 2e 10 lwz r8,11792(r8) _ISR_Enable( level ); return; } #endif the_thread->Wait.count = 0; ffc096ac: 91 23 00 24 stw r9,36(r3) if ( _Thread_Is_executing( the_thread ) ) { ffc096b0: 7f 83 40 00 cmpw cr7,r3,r8 ffc096b4: 41 9e 00 40 beq- cr7,ffc096f4 <_Event_Timeout+0x88> if ( *sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED ) *sync_state = THREAD_BLOCKING_OPERATION_TIMEOUT; } the_thread->Wait.return_code = RTEMS_TIMEOUT; ffc096b8: 39 20 00 06 li r9,6 ffc096bc: 91 23 00 34 stw r9,52(r3) return level; } static inline void ppc_interrupt_enable( uint32_t level ) { __asm__ volatile ( ffc096c0: 7d 40 01 24 mtmsr r10 RTEMS_INLINE_ROUTINE void _Thread_Unblock ( Thread_Control *the_thread ) { _Thread_Clear_state( the_thread, STATES_BLOCKED ); ffc096c4: 3c 80 10 07 lis r4,4103 ffc096c8: 60 84 ff f8 ori r4,r4,65528 ffc096cc: 48 00 2e 51 bl ffc0c51c <_Thread_Clear_state> * * 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; ffc096d0: 3d 20 00 00 lis r9,0 ffc096d4: 81 49 28 24 lwz r10,10276(r9) --level; ffc096d8: 39 4a ff ff addi r10,r10,-1 _Thread_Dispatch_disable_level = level; ffc096dc: 91 49 28 24 stw r10,10276(r9) case OBJECTS_REMOTE: /* impossible */ #endif case OBJECTS_ERROR: break; } } ffc096e0: 80 01 00 24 lwz r0,36(r1) ffc096e4: 83 e1 00 1c lwz r31,28(r1) ffc096e8: 7c 08 03 a6 mtlr r0 ffc096ec: 38 21 00 20 addi r1,r1,32 ffc096f0: 4e 80 00 20 blr } #endif the_thread->Wait.count = 0; if ( _Thread_Is_executing( the_thread ) ) { if ( *sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED ) ffc096f4: 81 3f 00 00 lwz r9,0(r31) ffc096f8: 2f 89 00 01 cmpwi cr7,r9,1 ffc096fc: 40 9e ff bc bne+ cr7,ffc096b8 <_Event_Timeout+0x4c> *sync_state = THREAD_BLOCKING_OPERATION_TIMEOUT; ffc09700: 39 20 00 02 li r9,2 ffc09704: 91 3f 00 00 stw r9,0(r31) ffc09708: 4b ff ff b0 b ffc096b8 <_Event_Timeout+0x4c> =============================================================================== ffc0fdb0 <_Heap_Allocate_aligned_with_boundary>: Heap_Control *heap, uintptr_t alloc_size, uintptr_t alignment, uintptr_t boundary ) { ffc0fdb0: 7c 87 23 78 mr r7,r4 ffc0fdb4: 7d 80 00 26 mfcr r12 Heap_Statistics *const stats = &heap->stats; uintptr_t const block_size_floor = alloc_size + HEAP_BLOCK_HEADER_SIZE ffc0fdb8: 38 84 00 04 addi r4,r4,4 Heap_Control *heap, uintptr_t alloc_size, uintptr_t alignment, uintptr_t boundary ) { ffc0fdbc: 94 21 ff e0 stwu r1,-32(r1) Heap_Block *block = NULL; uintptr_t alloc_begin = 0; uint32_t search_count = 0; bool search_again = false; if ( block_size_floor < alloc_size ) { ffc0fdc0: 7f 87 20 40 cmplw cr7,r7,r4 Heap_Control *heap, uintptr_t alloc_size, uintptr_t alignment, uintptr_t boundary ) { ffc0fdc4: 7c 08 02 a6 mflr r0 ffc0fdc8: 93 a1 00 14 stw r29,20(r1) ffc0fdcc: 7c 7d 1b 78 mr r29,r3 ffc0fdd0: 90 01 00 24 stw r0,36(r1) ffc0fdd4: 93 61 00 0c stw r27,12(r1) ffc0fdd8: 93 81 00 10 stw r28,16(r1) ffc0fddc: 93 c1 00 18 stw r30,24(r1) ffc0fde0: 93 e1 00 1c stw r31,28(r1) ffc0fde4: 91 81 00 08 stw r12,8(r1) Heap_Statistics *const stats = &heap->stats; uintptr_t const block_size_floor = alloc_size + HEAP_BLOCK_HEADER_SIZE - HEAP_ALLOC_BONUS; uintptr_t const page_size = heap->page_size; ffc0fde8: 81 63 00 10 lwz r11,16(r3) Heap_Block *block = NULL; uintptr_t alloc_begin = 0; uint32_t search_count = 0; bool search_again = false; if ( block_size_floor < alloc_size ) { ffc0fdec: 41 9d 01 c8 bgt- cr7,ffc0ffb4 <_Heap_Allocate_aligned_with_boundary+0x204> /* Integer overflow occured */ return NULL; } if ( boundary != 0 ) { ffc0fdf0: 2c 06 00 00 cmpwi r6,0 ffc0fdf4: 40 82 01 a8 bne- ffc0ff9c <_Heap_Allocate_aligned_with_boundary+0x1ec> return &heap->free_list; } RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Free_list_first( Heap_Control *heap ) { return _Heap_Free_list_head(heap)->next; ffc0fdf8: 81 3d 00 08 lwz r9,8(r29) do { Heap_Block *const free_list_tail = _Heap_Free_list_tail( heap ); block = _Heap_Free_list_first( heap ); while ( block != free_list_tail ) { ffc0fdfc: 7f 9d 48 00 cmpw cr7,r29,r9 ffc0fe00: 41 9e 01 e4 beq- cr7,ffc0ffe4 <_Heap_Allocate_aligned_with_boundary+0x234> * The HEAP_PREV_BLOCK_USED flag is always set in the block size_and_flag * field. Thus the value is about one unit larger than the real block * size. The greater than operator takes this into account. */ if ( block->size_and_flag > block_size_floor ) { if ( alignment == 0 ) { ffc0fe04: 2c 85 00 00 cmpwi cr1,r5,0 do { Heap_Block *const free_list_tail = _Heap_Free_list_tail( heap ); block = _Heap_Free_list_first( heap ); while ( block != free_list_tail ) { ffc0fe08: 3b c0 00 00 li r30,0 uintptr_t const block_begin = (uintptr_t) block; uintptr_t const block_size = _Heap_Block_size( block ); uintptr_t const block_end = block_begin + block_size; uintptr_t const alloc_begin_floor = _Heap_Alloc_area_of_block( block ); uintptr_t const alloc_begin_ceiling = block_end - min_block_size ffc0fe0c: 3b 6b 00 07 addi r27,r11,7 + HEAP_BLOCK_HEADER_SIZE + page_size - 1; uintptr_t alloc_end = block_end + HEAP_ALLOC_BONUS; ffc0fe10: 23 87 00 04 subfic r28,r7,4 ffc0fe14: 48 00 00 24 b ffc0fe38 <_Heap_Allocate_aligned_with_boundary+0x88> * The HEAP_PREV_BLOCK_USED flag is always set in the block size_and_flag * field. Thus the value is about one unit larger than the real block * size. The greater than operator takes this into account. */ if ( block->size_and_flag > block_size_floor ) { if ( alignment == 0 ) { ffc0fe18: 40 86 00 7c bne- cr1,ffc0fe94 <_Heap_Allocate_aligned_with_boundary+0xe4> RTEMS_INLINE_ROUTINE uintptr_t _Heap_Alloc_area_of_block( const Heap_Block *block ) { return (uintptr_t) block + HEAP_BLOCK_HEADER_SIZE; ffc0fe1c: 3b e9 00 08 addi r31,r9,8 } /* Statistics */ ++search_count; if ( alloc_begin != 0 ) { ffc0fe20: 2f 9f 00 00 cmpwi cr7,r31,0 ); } } /* Statistics */ ++search_count; ffc0fe24: 3b de 00 01 addi r30,r30,1 if ( alloc_begin != 0 ) { ffc0fe28: 40 9e 01 38 bne- cr7,ffc0ff60 <_Heap_Allocate_aligned_with_boundary+0x1b0> break; } block = block->next; ffc0fe2c: 81 29 00 08 lwz r9,8(r9) do { Heap_Block *const free_list_tail = _Heap_Free_list_tail( heap ); block = _Heap_Free_list_first( heap ); while ( block != free_list_tail ) { ffc0fe30: 7f 9d 48 00 cmpw cr7,r29,r9 ffc0fe34: 41 9e 00 20 beq- cr7,ffc0fe54 <_Heap_Allocate_aligned_with_boundary+0xa4> /* * The HEAP_PREV_BLOCK_USED flag is always set in the block size_and_flag * field. Thus the value is about one unit larger than the real block * size. The greater than operator takes this into account. */ if ( block->size_and_flag > block_size_floor ) { ffc0fe38: 81 49 00 04 lwz r10,4(r9) ffc0fe3c: 7f 84 50 40 cmplw cr7,r4,r10 ffc0fe40: 41 bc ff d8 blt- cr7,ffc0fe18 <_Heap_Allocate_aligned_with_boundary+0x68> if ( alloc_begin != 0 ) { break; } block = block->next; ffc0fe44: 81 29 00 08 lwz r9,8(r9) ); } } /* Statistics */ ++search_count; ffc0fe48: 3b de 00 01 addi r30,r30,1 do { Heap_Block *const free_list_tail = _Heap_Free_list_tail( heap ); block = _Heap_Free_list_first( heap ); while ( block != free_list_tail ) { ffc0fe4c: 7f 9d 48 00 cmpw cr7,r29,r9 ffc0fe50: 40 9e ff e8 bne+ cr7,ffc0fe38 <_Heap_Allocate_aligned_with_boundary+0x88> ); } } /* Statistics */ ++search_count; ffc0fe54: 38 60 00 00 li r3,0 boundary ); } /* Statistics */ if ( stats->max_search < search_count ) { ffc0fe58: 81 3d 00 44 lwz r9,68(r29) ffc0fe5c: 7f 89 f0 40 cmplw cr7,r9,r30 ffc0fe60: 40 9c 00 08 bge- cr7,ffc0fe68 <_Heap_Allocate_aligned_with_boundary+0xb8> stats->max_search = search_count; ffc0fe64: 93 dd 00 44 stw r30,68(r29) } return (void *) alloc_begin; } ffc0fe68: 80 01 00 24 lwz r0,36(r1) ffc0fe6c: 81 81 00 08 lwz r12,8(r1) ffc0fe70: 7c 08 03 a6 mtlr r0 ffc0fe74: 83 61 00 0c lwz r27,12(r1) ffc0fe78: 83 81 00 10 lwz r28,16(r1) ffc0fe7c: 7d 80 81 20 mtcrf 8,r12 ffc0fe80: 83 a1 00 14 lwz r29,20(r1) ffc0fe84: 83 c1 00 18 lwz r30,24(r1) ffc0fe88: 83 e1 00 1c lwz r31,28(r1) ffc0fe8c: 38 21 00 20 addi r1,r1,32 ffc0fe90: 4e 80 00 20 blr - 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; ffc0fe94: 55 4a 00 3c rlwinm r10,r10,0,0,30 ffc0fe98: 80 1d 00 14 lwz r0,20(r29) uintptr_t const page_size = heap->page_size; uintptr_t const min_block_size = heap->min_block_size; uintptr_t const block_begin = (uintptr_t) block; uintptr_t const block_size = _Heap_Block_size( block ); uintptr_t const block_end = block_begin + block_size; ffc0fe9c: 7d 49 52 14 add r10,r9,r10 uintptr_t const alloc_begin_floor = _Heap_Alloc_area_of_block( block ); uintptr_t const alloc_begin_ceiling = block_end - min_block_size + HEAP_BLOCK_HEADER_SIZE + page_size - 1; uintptr_t alloc_end = block_end + HEAP_ALLOC_BONUS; uintptr_t alloc_begin = alloc_end - alloc_size; ffc0fea0: 7f fc 52 14 add r31,r28,r10 RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down( uintptr_t value, uintptr_t alignment ) { return value - (value % alignment); ffc0fea4: 7f ff 2b 96 divwu r31,r31,r5 ffc0fea8: 7f ff 29 d6 mullw r31,r31,r5 uintptr_t const block_size = _Heap_Block_size( block ); uintptr_t const block_end = block_begin + block_size; uintptr_t const alloc_begin_floor = _Heap_Alloc_area_of_block( block ); uintptr_t const alloc_begin_ceiling = block_end - min_block_size + HEAP_BLOCK_HEADER_SIZE + page_size - 1; ffc0feac: 7d 00 d8 50 subf r8,r0,r27 uintptr_t const block_begin = (uintptr_t) block; uintptr_t const block_size = _Heap_Block_size( block ); uintptr_t const block_end = block_begin + block_size; uintptr_t const alloc_begin_floor = _Heap_Alloc_area_of_block( block ); uintptr_t const alloc_begin_ceiling = block_end - min_block_size ffc0feb0: 7d 48 52 14 add r10,r8,r10 uintptr_t alloc_begin = alloc_end - alloc_size; alloc_begin = _Heap_Align_down( alloc_begin, alignment ); /* Ensure that the we have a valid new block at the end */ if ( alloc_begin > alloc_begin_ceiling ) { ffc0feb4: 7f 8a f8 40 cmplw cr7,r10,r31 RTEMS_INLINE_ROUTINE uintptr_t _Heap_Alloc_area_of_block( const Heap_Block *block ) { return (uintptr_t) block + HEAP_BLOCK_HEADER_SIZE; ffc0feb8: 39 89 00 08 addi r12,r9,8 ffc0febc: 40 9c 00 0c bge- cr7,ffc0fec8 <_Heap_Allocate_aligned_with_boundary+0x118> RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down( uintptr_t value, uintptr_t alignment ) { return value - (value % alignment); ffc0fec0: 7d 4a 2b 96 divwu r10,r10,r5 ffc0fec4: 7f ea 29 d6 mullw r31,r10,r5 } alloc_end = alloc_begin + alloc_size; /* Ensure boundary constaint */ if ( boundary != 0 ) { ffc0fec8: 41 82 00 60 beq- ffc0ff28 <_Heap_Allocate_aligned_with_boundary+0x178> /* Ensure that the we have a valid new block at the end */ if ( alloc_begin > alloc_begin_ceiling ) { alloc_begin = _Heap_Align_down( alloc_begin_ceiling, alignment ); } alloc_end = alloc_begin + alloc_size; ffc0fecc: 7d 1f 3a 14 add r8,r31,r7 ffc0fed0: 7d 48 33 96 divwu r10,r8,r6 ffc0fed4: 7d 4a 31 d6 mullw r10,r10,r6 /* Ensure boundary constaint */ if ( boundary != 0 ) { uintptr_t const boundary_floor = alloc_begin_floor + alloc_size; ffc0fed8: 7c 6c 3a 14 add r3,r12,r7 uintptr_t boundary_line = _Heap_Align_down( alloc_end, boundary ); while ( alloc_begin < boundary_line && boundary_line < alloc_end ) { ffc0fedc: 7f 9f 50 40 cmplw cr7,r31,r10 ffc0fee0: 40 9c 00 48 bge- cr7,ffc0ff28 <_Heap_Allocate_aligned_with_boundary+0x178> ffc0fee4: 7f 88 50 40 cmplw cr7,r8,r10 ffc0fee8: 40 9d 00 40 ble- cr7,ffc0ff28 <_Heap_Allocate_aligned_with_boundary+0x178> if ( boundary_line < boundary_floor ) { ffc0feec: 7f 83 50 40 cmplw cr7,r3,r10 ffc0fef0: 40 bd 00 10 ble+ cr7,ffc0ff00 <_Heap_Allocate_aligned_with_boundary+0x150> ffc0fef4: 48 00 00 a0 b ffc0ff94 <_Heap_Allocate_aligned_with_boundary+0x1e4> /* Ensure boundary constaint */ if ( boundary != 0 ) { uintptr_t const boundary_floor = alloc_begin_floor + alloc_size; uintptr_t boundary_line = _Heap_Align_down( alloc_end, boundary ); while ( alloc_begin < boundary_line && boundary_line < alloc_end ) { ffc0fef8: 40 91 00 30 ble- cr4,ffc0ff28 <_Heap_Allocate_aligned_with_boundary+0x178> if ( boundary_line < boundary_floor ) { ffc0fefc: 41 99 00 98 bgt- cr6,ffc0ff94 <_Heap_Allocate_aligned_with_boundary+0x1e4><== NEVER TAKEN return 0; } alloc_begin = boundary_line - alloc_size; ffc0ff00: 7f e7 50 50 subf r31,r7,r10 ffc0ff04: 7f ff 2b 96 divwu r31,r31,r5 ffc0ff08: 7f ff 29 d6 mullw r31,r31,r5 alloc_begin = _Heap_Align_down( alloc_begin, alignment ); alloc_end = alloc_begin + alloc_size; ffc0ff0c: 7d 1f 3a 14 add r8,r31,r7 ffc0ff10: 7d 48 33 96 divwu r10,r8,r6 ffc0ff14: 7d 4a 31 d6 mullw r10,r10,r6 /* Ensure boundary constaint */ if ( boundary != 0 ) { uintptr_t const boundary_floor = alloc_begin_floor + alloc_size; uintptr_t boundary_line = _Heap_Align_down( alloc_end, boundary ); while ( alloc_begin < boundary_line && boundary_line < alloc_end ) { ffc0ff18: 7f 9f 50 40 cmplw cr7,r31,r10 ffc0ff1c: 7e 08 50 40 cmplw cr4,r8,r10 if ( boundary_line < boundary_floor ) { ffc0ff20: 7f 03 50 40 cmplw cr6,r3,r10 /* Ensure boundary constaint */ if ( boundary != 0 ) { uintptr_t const boundary_floor = alloc_begin_floor + alloc_size; uintptr_t boundary_line = _Heap_Align_down( alloc_end, boundary ); while ( alloc_begin < boundary_line && boundary_line < alloc_end ) { ffc0ff24: 41 9c ff d4 blt+ cr7,ffc0fef8 <_Heap_Allocate_aligned_with_boundary+0x148> boundary_line = _Heap_Align_down( alloc_end, boundary ); } } /* Ensure that the we have a valid new block at the beginning */ if ( alloc_begin >= alloc_begin_floor ) { ffc0ff28: 7f 8c f8 40 cmplw cr7,r12,r31 ffc0ff2c: 41 9d 00 68 bgt- cr7,ffc0ff94 <_Heap_Allocate_aligned_with_boundary+0x1e4> ffc0ff30: 7d 5f 5b 96 divwu r10,r31,r11 ffc0ff34: 7d 4a 59 d6 mullw r10,r10,r11 ffc0ff38: 21 09 ff f8 subfic r8,r9,-8 uintptr_t const alloc_block_begin = (uintptr_t) _Heap_Block_of_alloc_area( alloc_begin, page_size ); uintptr_t const free_size = alloc_block_begin - block_begin; ffc0ff3c: 7d 48 52 14 add r10,r8,r10 if ( free_size >= min_block_size || free_size == 0 ) { ffc0ff40: 7f 80 50 40 cmplw cr7,r0,r10 ffc0ff44: 40 bd fe dc ble- cr7,ffc0fe20 <_Heap_Allocate_aligned_with_boundary+0x70> uintptr_t const boundary_floor = alloc_begin_floor + alloc_size; uintptr_t boundary_line = _Heap_Align_down( alloc_end, boundary ); while ( alloc_begin < boundary_line && boundary_line < alloc_end ) { if ( boundary_line < boundary_floor ) { return 0; ffc0ff48: 31 4a ff ff addic r10,r10,-1 ffc0ff4c: 7d 4a 51 10 subfe r10,r10,r10 ffc0ff50: 7f ff 50 38 and r31,r31,r10 } /* Statistics */ ++search_count; if ( alloc_begin != 0 ) { ffc0ff54: 2f 9f 00 00 cmpwi cr7,r31,0 ); } } /* Statistics */ ++search_count; ffc0ff58: 3b de 00 01 addi r30,r30,1 if ( alloc_begin != 0 ) { ffc0ff5c: 41 9e fe d0 beq+ cr7,ffc0fe2c <_Heap_Allocate_aligned_with_boundary+0x7c> search_again = _Heap_Protection_free_delayed_blocks( heap, alloc_begin ); } while ( search_again ); if ( alloc_begin != 0 ) { /* Statistics */ ++stats->allocs; ffc0ff60: 81 5d 00 48 lwz r10,72(r29) stats->searches += search_count; block = _Heap_Block_allocate( heap, block, alloc_begin, alloc_size ); ffc0ff64: 7f a3 eb 78 mr r3,r29 } while ( search_again ); if ( alloc_begin != 0 ) { /* Statistics */ ++stats->allocs; stats->searches += search_count; ffc0ff68: 81 1d 00 4c lwz r8,76(r29) block = _Heap_Block_allocate( heap, block, alloc_begin, alloc_size ); ffc0ff6c: 7d 24 4b 78 mr r4,r9 search_again = _Heap_Protection_free_delayed_blocks( heap, alloc_begin ); } while ( search_again ); if ( alloc_begin != 0 ) { /* Statistics */ ++stats->allocs; ffc0ff70: 39 4a 00 01 addi r10,r10,1 stats->searches += search_count; ffc0ff74: 7d 08 f2 14 add r8,r8,r30 search_again = _Heap_Protection_free_delayed_blocks( heap, alloc_begin ); } while ( search_again ); if ( alloc_begin != 0 ) { /* Statistics */ ++stats->allocs; ffc0ff78: 91 5d 00 48 stw r10,72(r29) stats->searches += search_count; block = _Heap_Block_allocate( heap, block, alloc_begin, alloc_size ); ffc0ff7c: 7f e5 fb 78 mr r5,r31 } while ( search_again ); if ( alloc_begin != 0 ) { /* Statistics */ ++stats->allocs; stats->searches += search_count; ffc0ff80: 91 1d 00 4c stw r8,76(r29) block = _Heap_Block_allocate( heap, block, alloc_begin, alloc_size ); ffc0ff84: 7c e6 3b 78 mr r6,r7 ffc0ff88: 4b ff b2 25 bl ffc0b1ac <_Heap_Block_allocate> ffc0ff8c: 7f e3 fb 78 mr r3,r31 ffc0ff90: 4b ff fe c8 b ffc0fe58 <_Heap_Allocate_aligned_with_boundary+0xa8> uintptr_t const boundary_floor = alloc_begin_floor + alloc_size; uintptr_t boundary_line = _Heap_Align_down( alloc_end, boundary ); while ( alloc_begin < boundary_line && boundary_line < alloc_end ) { if ( boundary_line < boundary_floor ) { return 0; ffc0ff94: 3b e0 00 00 li r31,0 ffc0ff98: 4b ff fe 88 b ffc0fe20 <_Heap_Allocate_aligned_with_boundary+0x70> /* Integer overflow occured */ return NULL; } if ( boundary != 0 ) { if ( boundary < alloc_size ) { ffc0ff9c: 7f 87 30 40 cmplw cr7,r7,r6 ffc0ffa0: 41 9d 00 14 bgt- cr7,ffc0ffb4 <_Heap_Allocate_aligned_with_boundary+0x204> return NULL; } if ( alignment == 0 ) { ffc0ffa4: 2f 85 00 00 cmpwi cr7,r5,0 ffc0ffa8: 40 be fe 50 bne- cr7,ffc0fdf8 <_Heap_Allocate_aligned_with_boundary+0x48> alignment = page_size; ffc0ffac: 7d 65 5b 78 mr r5,r11 ffc0ffb0: 4b ff fe 48 b ffc0fdf8 <_Heap_Allocate_aligned_with_boundary+0x48> if ( stats->max_search < search_count ) { stats->max_search = search_count; } return (void *) alloc_begin; } ffc0ffb4: 80 01 00 24 lwz r0,36(r1) uint32_t search_count = 0; bool search_again = false; if ( block_size_floor < alloc_size ) { /* Integer overflow occured */ return NULL; ffc0ffb8: 38 60 00 00 li r3,0 if ( stats->max_search < search_count ) { stats->max_search = search_count; } return (void *) alloc_begin; } ffc0ffbc: 81 81 00 08 lwz r12,8(r1) ffc0ffc0: 7c 08 03 a6 mtlr r0 ffc0ffc4: 83 61 00 0c lwz r27,12(r1) ffc0ffc8: 83 81 00 10 lwz r28,16(r1) ffc0ffcc: 7d 80 81 20 mtcrf 8,r12 ffc0ffd0: 83 a1 00 14 lwz r29,20(r1) ffc0ffd4: 83 c1 00 18 lwz r30,24(r1) ffc0ffd8: 83 e1 00 1c lwz r31,28(r1) ffc0ffdc: 38 21 00 20 addi r1,r1,32 ffc0ffe0: 4e 80 00 20 blr do { Heap_Block *const free_list_tail = _Heap_Free_list_tail( heap ); block = _Heap_Free_list_first( heap ); while ( block != free_list_tail ) { ffc0ffe4: 3b c0 00 00 li r30,0 ffc0ffe8: 4b ff fe 6c b ffc0fe54 <_Heap_Allocate_aligned_with_boundary+0xa4> =============================================================================== ffc0fb44 <_Heap_Extend>: Heap_Control *heap, void *extend_area_begin_ptr, uintptr_t extend_area_size, uintptr_t unused __attribute__((unused)) ) { ffc0fb44: 94 21 ff c0 stwu r1,-64(r1) ffc0fb48: 7d 80 00 26 mfcr r12 ffc0fb4c: 7c 08 02 a6 mflr r0 Heap_Block *start_block = first_block; Heap_Block *merge_below_block = NULL; Heap_Block *merge_above_block = NULL; Heap_Block *link_below_block = NULL; Heap_Block *link_above_block = NULL; Heap_Block *extend_first_block = NULL; ffc0fb50: 39 20 00 00 li r9,0 Heap_Control *heap, void *extend_area_begin_ptr, uintptr_t extend_area_size, uintptr_t unused __attribute__((unused)) ) { ffc0fb54: 93 a1 00 34 stw r29,52(r1) Heap_Block *extend_first_block = NULL; Heap_Block *extend_last_block = NULL; uintptr_t const page_size = heap->page_size; uintptr_t const min_block_size = heap->min_block_size; uintptr_t const extend_area_begin = (uintptr_t) extend_area_begin_ptr; uintptr_t const extend_area_end = extend_area_begin + extend_area_size; ffc0fb58: 7f a4 2a 14 add r29,r4,r5 uintptr_t const free_size = stats->free_size; uintptr_t extend_first_block_size = 0; uintptr_t extended_size = 0; bool extend_area_ok = false; if ( extend_area_end < extend_area_begin ) { ffc0fb5c: 7f 84 e8 40 cmplw cr7,r4,r29 Heap_Control *heap, void *extend_area_begin_ptr, uintptr_t extend_area_size, uintptr_t unused __attribute__((unused)) ) { ffc0fb60: 90 01 00 44 stw r0,68(r1) ffc0fb64: 93 41 00 28 stw r26,40(r1) ffc0fb68: 93 61 00 2c stw r27,44(r1) ffc0fb6c: 93 81 00 30 stw r28,48(r1) ffc0fb70: 93 c1 00 38 stw r30,56(r1) ffc0fb74: 7c 7e 1b 78 mr r30,r3 ffc0fb78: 93 e1 00 3c stw r31,60(r1) ffc0fb7c: 7c 9f 23 78 mr r31,r4 ffc0fb80: 93 01 00 20 stw r24,32(r1) ffc0fb84: 93 21 00 24 stw r25,36(r1) ffc0fb88: 91 81 00 1c stw r12,28(r1) Heap_Statistics *const stats = &heap->stats; Heap_Block *const first_block = heap->first_block; ffc0fb8c: 83 63 00 20 lwz r27,32(r3) Heap_Block *start_block = first_block; Heap_Block *merge_below_block = NULL; Heap_Block *merge_above_block = NULL; Heap_Block *link_below_block = NULL; Heap_Block *link_above_block = NULL; Heap_Block *extend_first_block = NULL; ffc0fb90: 91 21 00 0c stw r9,12(r1) Heap_Block *extend_last_block = NULL; ffc0fb94: 91 21 00 08 stw r9,8(r1) uintptr_t const page_size = heap->page_size; ffc0fb98: 83 83 00 10 lwz r28,16(r3) uintptr_t const min_block_size = heap->min_block_size; ffc0fb9c: 80 c3 00 14 lwz r6,20(r3) uintptr_t const extend_area_begin = (uintptr_t) extend_area_begin_ptr; uintptr_t const extend_area_end = extend_area_begin + extend_area_size; uintptr_t const free_size = stats->free_size; ffc0fba0: 83 43 00 30 lwz r26,48(r3) uintptr_t extend_first_block_size = 0; uintptr_t extended_size = 0; bool extend_area_ok = false; if ( extend_area_end < extend_area_begin ) { ffc0fba4: 40 9d 00 40 ble- cr7,ffc0fbe4 <_Heap_Extend+0xa0> /* Statistics */ stats->size += extended_size; return extended_size; } ffc0fba8: 80 01 00 44 lwz r0,68(r1) uintptr_t extend_first_block_size = 0; uintptr_t extended_size = 0; bool extend_area_ok = false; if ( extend_area_end < extend_area_begin ) { return 0; ffc0fbac: 38 60 00 00 li r3,0 /* Statistics */ stats->size += extended_size; return extended_size; } ffc0fbb0: 81 81 00 1c lwz r12,28(r1) ffc0fbb4: 7c 08 03 a6 mtlr r0 ffc0fbb8: 83 01 00 20 lwz r24,32(r1) ffc0fbbc: 83 21 00 24 lwz r25,36(r1) ffc0fbc0: 7d 80 81 20 mtcrf 8,r12 ffc0fbc4: 83 41 00 28 lwz r26,40(r1) ffc0fbc8: 83 61 00 2c lwz r27,44(r1) ffc0fbcc: 83 81 00 30 lwz r28,48(r1) ffc0fbd0: 83 a1 00 34 lwz r29,52(r1) ffc0fbd4: 83 c1 00 38 lwz r30,56(r1) ffc0fbd8: 83 e1 00 3c lwz r31,60(r1) ffc0fbdc: 38 21 00 40 addi r1,r1,64 ffc0fbe0: 4e 80 00 20 blr if ( extend_area_end < extend_area_begin ) { return 0; } extend_area_ok = _Heap_Get_first_and_last_block( ffc0fbe4: 7c 83 23 78 mr r3,r4 ffc0fbe8: 38 e1 00 0c addi r7,r1,12 ffc0fbec: 7c a4 2b 78 mr r4,r5 ffc0fbf0: 39 01 00 08 addi r8,r1,8 ffc0fbf4: 7f 85 e3 78 mr r5,r28 ffc0fbf8: 4b ff af dd bl ffc0abd4 <_Heap_Get_first_and_last_block> page_size, min_block_size, &extend_first_block, &extend_last_block ); if (!extend_area_ok ) { ffc0fbfc: 2f 83 00 00 cmpwi cr7,r3,0 ffc0fc00: 41 be ff a8 beq- cr7,ffc0fba8 <_Heap_Extend+0x64> ffc0fc04: 7f 69 db 78 mr r9,r27 ffc0fc08: 3b 00 00 00 li r24,0 ffc0fc0c: 38 a0 00 00 li r5,0 ffc0fc10: 3b 20 00 00 li r25,0 ffc0fc14: 38 c0 00 00 li r6,0 ffc0fc18: 48 00 00 38 b ffc0fc50 <_Heap_Extend+0x10c> return 0; } if ( extend_area_end == sub_area_begin ) { merge_below_block = start_block; } else if ( extend_area_end < sub_area_end ) { ffc0fc1c: 7f 9d 50 40 cmplw cr7,r29,r10 ffc0fc20: 40 9c 00 08 bge- cr7,ffc0fc28 <_Heap_Extend+0xe4> ffc0fc24: 7d 25 4b 78 mr r5,r9 link_below_block = start_block; } if ( sub_area_end == extend_area_begin ) { ffc0fc28: 7f 8a f8 00 cmpw cr7,r10,r31 ffc0fc2c: 41 9e 00 64 beq- cr7,ffc0fc90 <_Heap_Extend+0x14c> start_block->prev_size = extend_area_end; merge_above_block = end_block; } else if ( sub_area_end < extend_area_begin ) { ffc0fc30: 7f 9f 50 40 cmplw cr7,r31,r10 ffc0fc34: 40 9d 00 08 ble- cr7,ffc0fc3c <_Heap_Extend+0xf8> RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_of_alloc_area( uintptr_t alloc_begin, uintptr_t page_size ) { return (Heap_Block *) (_Heap_Align_down( alloc_begin, page_size ) ffc0fc38: 7d 18 43 78 mr r24,r8 - 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; ffc0fc3c: 81 28 00 04 lwz r9,4(r8) ffc0fc40: 55 29 00 3c rlwinm r9,r9,0,0,30 RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); ffc0fc44: 7d 29 42 14 add r9,r9,r8 link_above_block = end_block; } start_block = _Heap_Block_at( end_block, _Heap_Block_size( end_block ) ); } while ( start_block != first_block ); ffc0fc48: 7f 9b 48 00 cmpw cr7,r27,r9 ffc0fc4c: 41 9e 00 60 beq- cr7,ffc0fcac <_Heap_Extend+0x168> return 0; } do { uintptr_t const sub_area_begin = (start_block != first_block) ? (uintptr_t) start_block : heap->area_begin; ffc0fc50: 7f 89 d8 00 cmpw cr7,r9,r27 ffc0fc54: 41 9e 01 a4 beq- cr7,ffc0fdf8 <_Heap_Extend+0x2b4> ffc0fc58: 7d 27 4b 78 mr r7,r9 uintptr_t const sub_area_end = start_block->prev_size; ffc0fc5c: 81 49 00 00 lwz r10,0(r9) RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down( uintptr_t value, uintptr_t alignment ) { return value - (value % alignment); ffc0fc60: 7d 0a e3 96 divwu r8,r10,r28 Heap_Block *const end_block = _Heap_Block_of_alloc_area( sub_area_end, page_size ); if ( ffc0fc64: 7f 9f 50 40 cmplw cr7,r31,r10 ffc0fc68: 7d 08 e1 d6 mullw r8,r8,r28 uintptr_t alloc_begin, uintptr_t page_size ) { return (Heap_Block *) (_Heap_Align_down( alloc_begin, page_size ) - HEAP_BLOCK_HEADER_SIZE); ffc0fc6c: 39 08 ff f8 addi r8,r8,-8 ffc0fc70: 40 9c 00 0c bge- cr7,ffc0fc7c <_Heap_Extend+0x138> sub_area_end > extend_area_begin && extend_area_end > sub_area_begin ffc0fc74: 7f 87 e8 40 cmplw cr7,r7,r29 ffc0fc78: 41 bc ff 30 blt- cr7,ffc0fba8 <_Heap_Extend+0x64> ) { return 0; } if ( extend_area_end == sub_area_begin ) { ffc0fc7c: 7f 87 e8 00 cmpw cr7,r7,r29 ffc0fc80: 40 9e ff 9c bne+ cr7,ffc0fc1c <_Heap_Extend+0xd8> merge_below_block = start_block; } else if ( extend_area_end < sub_area_end ) { link_below_block = start_block; } if ( sub_area_end == extend_area_begin ) { ffc0fc84: 7f 8a f8 00 cmpw cr7,r10,r31 sub_area_end > extend_area_begin && extend_area_end > sub_area_begin ) { return 0; } if ( extend_area_end == sub_area_begin ) { ffc0fc88: 7d 26 4b 78 mr r6,r9 merge_below_block = start_block; } else if ( extend_area_end < sub_area_end ) { link_below_block = start_block; } if ( sub_area_end == extend_area_begin ) { ffc0fc8c: 40 9e ff a4 bne+ cr7,ffc0fc30 <_Heap_Extend+0xec> <== ALWAYS TAKEN start_block->prev_size = extend_area_end; ffc0fc90: 93 a9 00 00 stw r29,0(r9) RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_of_alloc_area( uintptr_t alloc_begin, uintptr_t page_size ) { return (Heap_Block *) (_Heap_Align_down( alloc_begin, page_size ) ffc0fc94: 7d 19 43 78 mr r25,r8 - 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; ffc0fc98: 81 28 00 04 lwz r9,4(r8) ffc0fc9c: 55 29 00 3c rlwinm r9,r9,0,0,30 RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); ffc0fca0: 7d 29 42 14 add r9,r9,r8 } else if ( sub_area_end < extend_area_begin ) { link_above_block = end_block; } start_block = _Heap_Block_at( end_block, _Heap_Block_size( end_block ) ); } while ( start_block != first_block ); ffc0fca4: 7f 9b 48 00 cmpw cr7,r27,r9 ffc0fca8: 40 9e ff a8 bne+ cr7,ffc0fc50 <_Heap_Extend+0x10c> <== NEVER TAKEN if ( extend_area_begin < heap->area_begin ) { ffc0fcac: 81 3e 00 18 lwz r9,24(r30) ffc0fcb0: 7f 9f 48 40 cmplw cr7,r31,r9 ffc0fcb4: 41 9c 01 4c blt- cr7,ffc0fe00 <_Heap_Extend+0x2bc> heap->area_begin = extend_area_begin; } else if ( heap->area_end < extend_area_end ) { ffc0fcb8: 81 3e 00 1c lwz r9,28(r30) ffc0fcbc: 7f 9d 48 40 cmplw cr7,r29,r9 ffc0fcc0: 40 9d 00 08 ble- cr7,ffc0fcc8 <_Heap_Extend+0x184> heap->area_end = extend_area_end; ffc0fcc4: 93 be 00 1c stw r29,28(r30) extend_last_block->prev_size = extend_first_block_size; extend_last_block->size_and_flag = 0; _Heap_Protection_block_initialize( heap, extend_last_block ); if ( (uintptr_t) extend_first_block < (uintptr_t) heap->first_block ) { ffc0fcc8: 81 1e 00 20 lwz r8,32(r30) } else if ( heap->area_end < extend_area_end ) { heap->area_end = extend_area_end; } extend_first_block_size = (uintptr_t) extend_last_block - (uintptr_t) extend_first_block; ffc0fccc: 81 21 00 0c lwz r9,12(r1) ffc0fcd0: 81 41 00 08 lwz r10,8(r1) extend_last_block->prev_size = extend_first_block_size; extend_last_block->size_and_flag = 0; _Heap_Protection_block_initialize( heap, extend_last_block ); if ( (uintptr_t) extend_first_block < (uintptr_t) heap->first_block ) { ffc0fcd4: 7f 88 48 40 cmplw cr7,r8,r9 } extend_first_block_size = (uintptr_t) extend_last_block - (uintptr_t) extend_first_block; extend_first_block->prev_size = extend_area_end; ffc0fcd8: 93 a9 00 00 stw r29,0(r9) heap->area_begin = extend_area_begin; } else if ( heap->area_end < extend_area_end ) { heap->area_end = extend_area_end; } extend_first_block_size = ffc0fcdc: 7d 09 50 50 subf r8,r9,r10 (uintptr_t) extend_last_block - (uintptr_t) extend_first_block; extend_first_block->prev_size = extend_area_end; extend_first_block->size_and_flag = extend_first_block_size | HEAP_PREV_BLOCK_USED; ffc0fce0: 61 07 00 01 ori r7,r8,1 _Heap_Protection_block_initialize( heap, extend_first_block ); extend_last_block->prev_size = extend_first_block_size; ffc0fce4: 91 0a 00 00 stw r8,0(r10) extend_first_block_size = (uintptr_t) extend_last_block - (uintptr_t) extend_first_block; extend_first_block->prev_size = extend_area_end; extend_first_block->size_and_flag = ffc0fce8: 90 e9 00 04 stw r7,4(r9) extend_first_block_size | HEAP_PREV_BLOCK_USED; _Heap_Protection_block_initialize( heap, extend_first_block ); extend_last_block->prev_size = extend_first_block_size; extend_last_block->size_and_flag = 0; ffc0fcec: 38 e0 00 00 li r7,0 ffc0fcf0: 90 ea 00 04 stw r7,4(r10) _Heap_Protection_block_initialize( heap, extend_last_block ); if ( (uintptr_t) extend_first_block < (uintptr_t) heap->first_block ) { ffc0fcf4: 40 9d 01 40 ble- cr7,ffc0fe34 <_Heap_Extend+0x2f0> <== ALWAYS TAKEN heap->first_block = extend_first_block; ffc0fcf8: 91 3e 00 20 stw r9,32(r30) } else if ( (uintptr_t) extend_last_block > (uintptr_t) heap->last_block ) { heap->last_block = extend_last_block; } if ( merge_below_block != NULL ) { ffc0fcfc: 2e 06 00 00 cmpwi cr4,r6,0 ffc0fd00: 41 92 01 48 beq- cr4,ffc0fe48 <_Heap_Extend+0x304> Heap_Control *heap, uintptr_t extend_area_begin, Heap_Block *first_block ) { uintptr_t const page_size = heap->page_size; ffc0fd04: 81 3e 00 10 lwz r9,16(r30) uintptr_t const new_first_block_alloc_begin = _Heap_Align_up( extend_area_begin + HEAP_BLOCK_HEADER_SIZE, page_size ); ffc0fd08: 3b ff 00 08 addi r31,r31,8 RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_up( uintptr_t value, uintptr_t alignment ) { uintptr_t remainder = value % alignment; ffc0fd0c: 7d 5f 4b 96 divwu r10,r31,r9 ffc0fd10: 7d 4a 49 d6 mullw r10,r10,r9 if ( remainder != 0 ) { ffc0fd14: 7d 0a f8 51 subf. r8,r10,r31 ffc0fd18: 41 82 00 0c beq- ffc0fd24 <_Heap_Extend+0x1e0> <== NEVER TAKEN return value - remainder + alignment; ffc0fd1c: 7f ff 4a 14 add r31,r31,r9 ffc0fd20: 7f e8 f8 50 subf r31,r8,r31 uintptr_t const new_first_block_begin = ffc0fd24: 38 9f ff f8 addi r4,r31,-8 uintptr_t const first_block_begin = (uintptr_t) first_block; uintptr_t const new_first_block_size = first_block_begin - new_first_block_begin; Heap_Block *const new_first_block = (Heap_Block *) new_first_block_begin; new_first_block->prev_size = first_block->prev_size; ffc0fd28: 81 26 00 00 lwz r9,0(r6) uintptr_t const new_first_block_alloc_begin = _Heap_Align_up( extend_area_begin + HEAP_BLOCK_HEADER_SIZE, page_size ); uintptr_t const new_first_block_begin = new_first_block_alloc_begin - HEAP_BLOCK_HEADER_SIZE; uintptr_t const first_block_begin = (uintptr_t) first_block; uintptr_t const new_first_block_size = ffc0fd2c: 7c c4 30 50 subf r6,r4,r6 first_block_begin - new_first_block_begin; Heap_Block *const new_first_block = (Heap_Block *) new_first_block_begin; new_first_block->prev_size = first_block->prev_size; new_first_block->size_and_flag = new_first_block_size | HEAP_PREV_BLOCK_USED; ffc0fd30: 60 c6 00 01 ori r6,r6,1 uintptr_t const first_block_begin = (uintptr_t) first_block; uintptr_t const new_first_block_size = first_block_begin - new_first_block_begin; Heap_Block *const new_first_block = (Heap_Block *) new_first_block_begin; new_first_block->prev_size = first_block->prev_size; ffc0fd34: 91 3f ff f8 stw r9,-8(r31) new_first_block->size_and_flag = new_first_block_size | HEAP_PREV_BLOCK_USED; _Heap_Free_block( heap, new_first_block ); ffc0fd38: 7f c3 f3 78 mr r3,r30 uintptr_t const new_first_block_size = first_block_begin - new_first_block_begin; Heap_Block *const new_first_block = (Heap_Block *) new_first_block_begin; new_first_block->prev_size = first_block->prev_size; new_first_block->size_and_flag = new_first_block_size | HEAP_PREV_BLOCK_USED; ffc0fd3c: 90 c4 00 04 stw r6,4(r4) _Heap_Free_block( heap, new_first_block ); ffc0fd40: 4b ff fd 95 bl ffc0fad4 <_Heap_Free_block> link_below_block, extend_last_block ); } if ( merge_above_block != NULL ) { ffc0fd44: 2f 99 00 00 cmpwi cr7,r25,0 ffc0fd48: 41 9e 01 18 beq- cr7,ffc0fe60 <_Heap_Extend+0x31c> RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down( uintptr_t value, uintptr_t alignment ) { return value - (value % alignment); ffc0fd4c: 81 5e 00 10 lwz r10,16(r30) ) { uintptr_t const page_size = heap->page_size; uintptr_t const last_block_begin = (uintptr_t) last_block; uintptr_t const last_block_new_size = _Heap_Align_down( extend_area_end - last_block_begin - HEAP_BLOCK_HEADER_SIZE, ffc0fd50: 39 3d ff f8 addi r9,r29,-8 uintptr_t extend_area_end ) { uintptr_t const page_size = heap->page_size; uintptr_t const last_block_begin = (uintptr_t) last_block; uintptr_t const last_block_new_size = _Heap_Align_down( ffc0fd54: 7d 39 48 50 subf r9,r25,r9 ); Heap_Block *const new_last_block = _Heap_Block_at( last_block, last_block_new_size ); new_last_block->size_and_flag = (last_block->size_and_flag - last_block_new_size) ffc0fd58: 81 19 00 04 lwz r8,4(r25) ffc0fd5c: 7d 29 53 96 divwu r9,r9,r10 ffc0fd60: 7d 29 51 d6 mullw r9,r9,r10 | HEAP_PREV_BLOCK_USED; _Heap_Block_set_size( last_block, last_block_new_size ); _Heap_Free_block( heap, last_block ); ffc0fd64: 7f c3 f3 78 mr r3,r30 ); Heap_Block *const new_last_block = _Heap_Block_at( last_block, last_block_new_size ); new_last_block->size_and_flag = (last_block->size_and_flag - last_block_new_size) ffc0fd68: 7d 09 40 50 subf r8,r9,r8 page_size ); Heap_Block *const new_last_block = _Heap_Block_at( last_block, last_block_new_size ); new_last_block->size_and_flag = ffc0fd6c: 7d 49 ca 14 add r10,r9,r25 (last_block->size_and_flag - last_block_new_size) | HEAP_PREV_BLOCK_USED; ffc0fd70: 61 08 00 01 ori r8,r8,1 page_size ); Heap_Block *const new_last_block = _Heap_Block_at( last_block, last_block_new_size ); new_last_block->size_and_flag = ffc0fd74: 91 0a 00 04 stw r8,4(r10) (last_block->size_and_flag - last_block_new_size) | HEAP_PREV_BLOCK_USED; _Heap_Block_set_size( last_block, last_block_new_size ); _Heap_Free_block( heap, last_block ); ffc0fd78: 7f 24 cb 78 mr r4,r25 RTEMS_INLINE_ROUTINE void _Heap_Block_set_size( Heap_Block *block, uintptr_t size ) { uintptr_t flag = block->size_and_flag & HEAP_PREV_BLOCK_USED; ffc0fd7c: 81 59 00 04 lwz r10,4(r25) ffc0fd80: 55 4a 07 fe clrlwi r10,r10,31 block->size_and_flag = size | flag; ffc0fd84: 7d 29 53 78 or r9,r9,r10 ffc0fd88: 91 39 00 04 stw r9,4(r25) ffc0fd8c: 4b ff fd 49 bl ffc0fad4 <_Heap_Free_block> /* Statistics */ stats->size += extended_size; return extended_size; } ffc0fd90: 81 3e 00 24 lwz r9,36(r30) * This feature will be used to terminate the scattered heap area list. See * also _Heap_Extend(). */ RTEMS_INLINE_ROUTINE void _Heap_Set_last_block_size( Heap_Control *heap ) { _Heap_Block_set_size( ffc0fd94: 81 1e 00 20 lwz r8,32(r30) RTEMS_INLINE_ROUTINE void _Heap_Block_set_size( Heap_Block *block, uintptr_t size ) { uintptr_t flag = block->size_and_flag & HEAP_PREV_BLOCK_USED; ffc0fd98: 81 49 00 04 lwz r10,4(r9) * This feature will be used to terminate the scattered heap area list. See * also _Heap_Extend(). */ RTEMS_INLINE_ROUTINE void _Heap_Set_last_block_size( Heap_Control *heap ) { _Heap_Block_set_size( ffc0fd9c: 7d 09 40 50 subf r8,r9,r8 ffc0fda0: 80 01 00 44 lwz r0,68(r1) RTEMS_INLINE_ROUTINE void _Heap_Block_set_size( Heap_Block *block, uintptr_t size ) { uintptr_t flag = block->size_and_flag & HEAP_PREV_BLOCK_USED; ffc0fda4: 55 4a 07 fe clrlwi r10,r10,31 ffc0fda8: 81 81 00 1c lwz r12,28(r1) block->size_and_flag = size | flag; ffc0fdac: 7d 4a 43 78 or r10,r10,r8 ffc0fdb0: 7c 08 03 a6 mtlr r0 ffc0fdb4: 91 49 00 04 stw r10,4(r9) ffc0fdb8: 7d 80 81 20 mtcrf 8,r12 _Heap_Free_block( heap, extend_first_block ); } _Heap_Set_last_block_size( heap ); extended_size = stats->free_size - free_size; ffc0fdbc: 80 7e 00 30 lwz r3,48(r30) /* Statistics */ stats->size += extended_size; ffc0fdc0: 81 3e 00 2c lwz r9,44(r30) _Heap_Free_block( heap, extend_first_block ); } _Heap_Set_last_block_size( heap ); extended_size = stats->free_size - free_size; ffc0fdc4: 7c 7a 18 50 subf r3,r26,r3 /* Statistics */ stats->size += extended_size; return extended_size; } ffc0fdc8: 83 01 00 20 lwz r24,32(r1) _Heap_Set_last_block_size( heap ); extended_size = stats->free_size - free_size; /* Statistics */ stats->size += extended_size; ffc0fdcc: 7d 29 1a 14 add r9,r9,r3 return extended_size; } ffc0fdd0: 83 21 00 24 lwz r25,36(r1) _Heap_Set_last_block_size( heap ); extended_size = stats->free_size - free_size; /* Statistics */ stats->size += extended_size; ffc0fdd4: 91 3e 00 2c stw r9,44(r30) return extended_size; } ffc0fdd8: 83 41 00 28 lwz r26,40(r1) ffc0fddc: 83 61 00 2c lwz r27,44(r1) ffc0fde0: 83 81 00 30 lwz r28,48(r1) ffc0fde4: 83 a1 00 34 lwz r29,52(r1) ffc0fde8: 83 c1 00 38 lwz r30,56(r1) ffc0fdec: 83 e1 00 3c lwz r31,60(r1) ffc0fdf0: 38 21 00 40 addi r1,r1,64 ffc0fdf4: 4e 80 00 20 blr return 0; } do { uintptr_t const sub_area_begin = (start_block != first_block) ? (uintptr_t) start_block : heap->area_begin; ffc0fdf8: 80 fe 00 18 lwz r7,24(r30) ffc0fdfc: 4b ff fe 60 b ffc0fc5c <_Heap_Extend+0x118> extend_last_block->prev_size = extend_first_block_size; extend_last_block->size_and_flag = 0; _Heap_Protection_block_initialize( heap, extend_last_block ); if ( (uintptr_t) extend_first_block < (uintptr_t) heap->first_block ) { ffc0fe00: 81 1e 00 20 lwz r8,32(r30) } else if ( heap->area_end < extend_area_end ) { heap->area_end = extend_area_end; } extend_first_block_size = (uintptr_t) extend_last_block - (uintptr_t) extend_first_block; ffc0fe04: 81 21 00 0c lwz r9,12(r1) ffc0fe08: 81 41 00 08 lwz r10,8(r1) extend_last_block->prev_size = extend_first_block_size; extend_last_block->size_and_flag = 0; _Heap_Protection_block_initialize( heap, extend_last_block ); if ( (uintptr_t) extend_first_block < (uintptr_t) heap->first_block ) { ffc0fe0c: 7f 88 48 40 cmplw cr7,r8,r9 start_block = _Heap_Block_at( end_block, _Heap_Block_size( end_block ) ); } while ( start_block != first_block ); if ( extend_area_begin < heap->area_begin ) { heap->area_begin = extend_area_begin; ffc0fe10: 93 fe 00 18 stw r31,24(r30) } else if ( heap->area_end < extend_area_end ) { heap->area_end = extend_area_end; } extend_first_block_size = ffc0fe14: 7d 09 50 50 subf r8,r9,r10 (uintptr_t) extend_last_block - (uintptr_t) extend_first_block; extend_first_block->prev_size = extend_area_end; extend_first_block->size_and_flag = extend_first_block_size | HEAP_PREV_BLOCK_USED; ffc0fe18: 61 07 00 01 ori r7,r8,1 } extend_first_block_size = (uintptr_t) extend_last_block - (uintptr_t) extend_first_block; extend_first_block->prev_size = extend_area_end; ffc0fe1c: 93 a9 00 00 stw r29,0(r9) extend_first_block->size_and_flag = ffc0fe20: 90 e9 00 04 stw r7,4(r9) extend_first_block_size | HEAP_PREV_BLOCK_USED; _Heap_Protection_block_initialize( heap, extend_first_block ); extend_last_block->prev_size = extend_first_block_size; extend_last_block->size_and_flag = 0; ffc0fe24: 38 e0 00 00 li r7,0 extend_first_block->prev_size = extend_area_end; extend_first_block->size_and_flag = extend_first_block_size | HEAP_PREV_BLOCK_USED; _Heap_Protection_block_initialize( heap, extend_first_block ); extend_last_block->prev_size = extend_first_block_size; ffc0fe28: 91 0a 00 00 stw r8,0(r10) extend_last_block->size_and_flag = 0; ffc0fe2c: 90 ea 00 04 stw r7,4(r10) _Heap_Protection_block_initialize( heap, extend_last_block ); if ( (uintptr_t) extend_first_block < (uintptr_t) heap->first_block ) { ffc0fe30: 41 bd fe c8 bgt- cr7,ffc0fcf8 <_Heap_Extend+0x1b4> <== ALWAYS TAKEN heap->first_block = extend_first_block; } else if ( (uintptr_t) extend_last_block > (uintptr_t) heap->last_block ) { ffc0fe34: 81 3e 00 24 lwz r9,36(r30) ffc0fe38: 7f 89 50 40 cmplw cr7,r9,r10 ffc0fe3c: 40 bc fe c0 bge- cr7,ffc0fcfc <_Heap_Extend+0x1b8> heap->last_block = extend_last_block; ffc0fe40: 91 5e 00 24 stw r10,36(r30) ffc0fe44: 4b ff fe b8 b ffc0fcfc <_Heap_Extend+0x1b8> } if ( merge_below_block != NULL ) { _Heap_Merge_below( heap, extend_area_begin, merge_below_block ); } else if ( link_below_block != NULL ) { ffc0fe48: 2f 85 00 00 cmpwi cr7,r5,0 ffc0fe4c: 41 be fe f8 beq- cr7,ffc0fd44 <_Heap_Extend+0x200> { uintptr_t const last_block_begin = (uintptr_t) last_block; uintptr_t const link_begin = (uintptr_t) link; last_block->size_and_flag = (link_begin - last_block_begin) | HEAP_PREV_BLOCK_USED; ffc0fe50: 7c aa 28 50 subf r5,r10,r5 ffc0fe54: 60 a5 00 01 ori r5,r5,1 ) { uintptr_t const last_block_begin = (uintptr_t) last_block; uintptr_t const link_begin = (uintptr_t) link; last_block->size_and_flag = ffc0fe58: 90 aa 00 04 stw r5,4(r10) ffc0fe5c: 4b ff fe e8 b ffc0fd44 <_Heap_Extend+0x200> ); } if ( merge_above_block != NULL ) { _Heap_Merge_above( heap, merge_above_block, extend_area_end ); } else if ( link_above_block != NULL ) { ffc0fe60: 2f 98 00 00 cmpwi cr7,r24,0 ffc0fe64: 41 9e 00 2c beq- cr7,ffc0fe90 <_Heap_Extend+0x34c> RTEMS_INLINE_ROUTINE void _Heap_Block_set_size( Heap_Block *block, uintptr_t size ) { uintptr_t flag = block->size_and_flag & HEAP_PREV_BLOCK_USED; ffc0fe68: 81 38 00 04 lwz r9,4(r24) ffc0fe6c: 55 2a 07 fe clrlwi r10,r9,31 ) { uintptr_t const link_begin = (uintptr_t) link; uintptr_t const first_block_begin = (uintptr_t) first_block; _Heap_Block_set_size( link, first_block_begin - link_begin ); ffc0fe70: 81 21 00 0c lwz r9,12(r1) ffc0fe74: 7d 38 48 50 subf r9,r24,r9 block->size_and_flag = size | flag; ffc0fe78: 7d 4a 4b 78 or r10,r10,r9 } if ( merge_above_block != NULL ) { _Heap_Merge_above( heap, merge_above_block, extend_area_end ); } else if ( link_above_block != NULL ) { _Heap_Link_above( ffc0fe7c: 81 21 00 08 lwz r9,8(r1) ffc0fe80: 91 58 00 04 stw r10,4(r24) uintptr_t const link_begin = (uintptr_t) link; uintptr_t const first_block_begin = (uintptr_t) first_block; _Heap_Block_set_size( link, first_block_begin - link_begin ); last_block->size_and_flag |= HEAP_PREV_BLOCK_USED; ffc0fe84: 81 49 00 04 lwz r10,4(r9) ffc0fe88: 61 4a 00 01 ori r10,r10,1 ffc0fe8c: 91 49 00 04 stw r10,4(r9) extend_first_block, extend_last_block ); } if ( merge_below_block == NULL && merge_above_block == NULL ) { ffc0fe90: 40 92 ff 00 bne+ cr4,ffc0fd90 <_Heap_Extend+0x24c> _Heap_Free_block( heap, extend_first_block ); ffc0fe94: 80 81 00 0c lwz r4,12(r1) ffc0fe98: 7f c3 f3 78 mr r3,r30 ffc0fe9c: 4b ff fc 39 bl ffc0fad4 <_Heap_Free_block> ffc0fea0: 4b ff fe f0 b ffc0fd90 <_Heap_Extend+0x24c> =============================================================================== ffc0ffec <_Heap_Free>: /* * 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 ) { ffc0ffec: 2c 04 00 00 cmpwi r4,0 return do_free; } #endif bool _Heap_Free( Heap_Control *heap, void *alloc_begin_ptr ) { ffc0fff0: 7c 69 1b 78 mr r9,r3 /* * 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 ) { ffc0fff4: 41 82 00 dc beq- ffc100d0 <_Heap_Free+0xe4> ffc0fff8: 81 03 00 10 lwz r8,16(r3) 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 ffc0fffc: 80 e3 00 20 lwz r7,32(r3) alloc_begin = (uintptr_t) alloc_begin_ptr; block = _Heap_Block_of_alloc_area( alloc_begin, heap->page_size ); if ( !_Heap_Is_block_in_heap( heap, block ) ) { return false; ffc10000: 38 60 00 00 li r3,0 RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down( uintptr_t value, uintptr_t alignment ) { return value - (value % alignment); ffc10004: 7d 44 43 96 divwu r10,r4,r8 ffc10008: 7d 4a 41 d6 mullw r10,r10,r8 uintptr_t alloc_begin, uintptr_t page_size ) { return (Heap_Block *) (_Heap_Align_down( alloc_begin, page_size ) - HEAP_BLOCK_HEADER_SIZE); ffc1000c: 39 4a ff f8 addi r10,r10,-8 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; ffc10010: 7f 8a 38 40 cmplw cr7,r10,r7 ffc10014: 4d 9c 00 20 bltlr cr7 ffc10018: 80 c9 00 24 lwz r6,36(r9) ffc1001c: 7f 8a 30 40 cmplw cr7,r10,r6 ffc10020: 40 9d 00 08 ble- cr7,ffc10028 <_Heap_Free+0x3c> <== ALWAYS TAKEN ffc10024: 4e 80 00 20 blr <== NOT EXECUTED --stats->used_blocks; ++stats->frees; stats->free_size += block_size; return( true ); } ffc10028: 81 6a 00 04 lwz r11,4(r10) - 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; ffc1002c: 55 65 00 3c rlwinm r5,r11,0,0,30 RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); ffc10030: 7d 05 52 14 add r8,r5,r10 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; ffc10034: 7f 87 40 40 cmplw cr7,r7,r8 ffc10038: 41 9d 00 94 bgt- cr7,ffc100cc <_Heap_Free+0xe0> <== NEVER TAKEN ffc1003c: 7f 86 40 40 cmplw cr7,r6,r8 ffc10040: 41 9c 00 88 blt- cr7,ffc100c8 <_Heap_Free+0xdc> <== NEVER TAKEN ffc10044: 80 88 00 04 lwz r4,4(r8) return false; } _Heap_Protection_block_check( heap, next_block ); if ( !_Heap_Is_prev_used( next_block ) ) { ffc10048: 70 80 00 01 andi. r0,r4,1 ffc1004c: 41 82 00 8c beq- ffc100d8 <_Heap_Free+0xec> return true; } next_block_size = _Heap_Block_size( next_block ); next_is_free = next_block != heap->last_block && !_Heap_Is_prev_used( _Heap_Block_at( next_block, next_block_size )); ffc10050: 7f 86 40 00 cmpw cr7,r6,r8 - 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; ffc10054: 54 84 00 3c rlwinm r4,r4,0,0,30 ffc10058: 41 9e 00 84 beq- cr7,ffc100dc <_Heap_Free+0xf0> --stats->used_blocks; ++stats->frees; stats->free_size += block_size; return( true ); } ffc1005c: 7c 68 22 14 add r3,r8,r4 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; ffc10060: 80 63 00 04 lwz r3,4(r3) return true; } next_block_size = _Heap_Block_size( next_block ); next_is_free = next_block != heap->last_block && !_Heap_Is_prev_used( _Heap_Block_at( next_block, next_block_size )); ffc10064: 70 60 00 01 andi. r0,r3,1 ffc10068: 40 82 00 74 bne- ffc100dc <_Heap_Free+0xf0> if ( !_Heap_Is_prev_used( block ) ) { ffc1006c: 71 60 00 01 andi. r0,r11,1 ffc10070: 41 82 01 50 beq- ffc101c0 <_Heap_Free+0x1d4> --stats->used_blocks; ++stats->frees; stats->free_size += block_size; return( true ); } ffc10074: 80 e8 00 08 lwz r7,8(r8) prev_block->size_and_flag = size | HEAP_PREV_BLOCK_USED; next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED; next_block->prev_size = size; } } else if ( next_is_free ) { /* coalesce next */ uintptr_t const size = block_size + next_block_size; ffc10078: 7c 84 2a 14 add r4,r4,r5 --stats->used_blocks; ++stats->frees; stats->free_size += block_size; return( true ); } ffc1007c: 81 08 00 0c lwz r8,12(r8) 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; ffc10080: 60 86 00 01 ori r6,r4,1 ) { Heap_Block *next = old_block->next; Heap_Block *prev = old_block->prev; new_block->next = next; ffc10084: 90 ea 00 08 stw r7,8(r10) new_block->prev = prev; ffc10088: 91 0a 00 0c stw r8,12(r10) next->prev = new_block; prev->next = new_block; ffc1008c: 91 48 00 08 stw r10,8(r8) Heap_Block *prev = old_block->prev; new_block->next = next; new_block->prev = prev; next->prev = new_block; ffc10090: 91 47 00 0c stw r10,12(r7) ffc10094: 90 ca 00 04 stw r6,4(r10) next_block = _Heap_Block_at( block, size ); next_block->prev_size = size; ffc10098: 7c 84 51 2e stwx r4,r4,r10 stats->max_free_blocks = stats->free_blocks; } } /* Statistics */ --stats->used_blocks; ffc1009c: 81 09 00 40 lwz r8,64(r9) ++stats->frees; stats->free_size += block_size; return( true ); ffc100a0: 38 60 00 01 li r3,1 } } /* Statistics */ --stats->used_blocks; ++stats->frees; ffc100a4: 81 49 00 50 lwz r10,80(r9) stats->free_size += block_size; ffc100a8: 80 e9 00 30 lwz r7,48(r9) stats->max_free_blocks = stats->free_blocks; } } /* Statistics */ --stats->used_blocks; ffc100ac: 39 08 ff ff addi r8,r8,-1 ++stats->frees; ffc100b0: 39 4a 00 01 addi r10,r10,1 stats->max_free_blocks = stats->free_blocks; } } /* Statistics */ --stats->used_blocks; ffc100b4: 91 09 00 40 stw r8,64(r9) ++stats->frees; stats->free_size += block_size; ffc100b8: 7c a7 2a 14 add r5,r7,r5 } } /* Statistics */ --stats->used_blocks; ++stats->frees; ffc100bc: 91 49 00 50 stw r10,80(r9) stats->free_size += block_size; ffc100c0: 90 a9 00 30 stw r5,48(r9) return( true ); ffc100c4: 4e 80 00 20 blr ffc100c8: 4e 80 00 20 blr <== NOT EXECUTED ffc100cc: 4e 80 00 20 blr <== NOT EXECUTED * 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; ffc100d0: 38 60 00 01 li r3,1 ffc100d4: 4e 80 00 20 blr ffc100d8: 4e 80 00 20 blr next_block_size = _Heap_Block_size( next_block ); next_is_free = next_block != heap->last_block && !_Heap_Is_prev_used( _Heap_Block_at( next_block, next_block_size )); if ( !_Heap_Is_prev_used( block ) ) { ffc100dc: 71 63 00 01 andi. r3,r11,1 ffc100e0: 40 82 00 28 bne- ffc10108 <_Heap_Free+0x11c> 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 ffc100e4: 39 80 00 00 li r12,0 && !_Heap_Is_prev_used( _Heap_Block_at( next_block, next_block_size )); if ( !_Heap_Is_prev_used( block ) ) { uintptr_t const prev_size = block->prev_size; ffc100e8: 80 0a 00 00 lwz r0,0(r10) alloc_begin = (uintptr_t) alloc_begin_ptr; block = _Heap_Block_of_alloc_area( alloc_begin, heap->page_size ); if ( !_Heap_Is_block_in_heap( heap, block ) ) { return false; ffc100ec: 38 60 00 00 li r3,0 RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); ffc100f0: 7d 60 50 50 subf r11,r0,r10 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; ffc100f4: 7f 87 58 40 cmplw cr7,r7,r11 ffc100f8: 4d 9d 00 20 bgtlr cr7 ffc100fc: 7f 86 58 40 cmplw cr7,r6,r11 ffc10100: 40 9c 00 54 bge- cr7,ffc10154 <_Heap_Free+0x168> <== ALWAYS TAKEN ffc10104: 4e 80 00 20 blr <== NOT EXECUTED 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; ffc10108: 80 e9 00 38 lwz r7,56(r9) 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; ffc1010c: 60 a4 00 01 ori r4,r5,1 next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED; next_block->prev_size = block_size; /* Statistics */ ++stats->free_blocks; if ( stats->max_free_blocks < stats->free_blocks ) { ffc10110: 80 c9 00 3c lwz r6,60(r9) 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; ffc10114: 38 e7 00 01 addi r7,r7,1 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; ffc10118: 90 8a 00 04 stw r4,4(r10) next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED; next_block->prev_size = block_size; /* Statistics */ ++stats->free_blocks; if ( stats->max_free_blocks < stats->free_blocks ) { ffc1011c: 7f 87 30 40 cmplw cr7,r7,r6 } 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; ffc10120: 80 88 00 04 lwz r4,4(r8) RTEMS_INLINE_ROUTINE void _Heap_Free_list_insert_after( Heap_Block *block_before, Heap_Block *new_block ) { Heap_Block *next = block_before->next; ffc10124: 80 c9 00 08 lwz r6,8(r9) ffc10128: 54 84 00 3c rlwinm r4,r4,0,0,30 new_block->next = next; new_block->prev = block_before; ffc1012c: 91 2a 00 0c stw r9,12(r10) Heap_Block *new_block ) { Heap_Block *next = block_before->next; new_block->next = next; ffc10130: 90 ca 00 08 stw r6,8(r10) ffc10134: 90 88 00 04 stw r4,4(r8) new_block->prev = block_before; block_before->next = new_block; next->prev = new_block; ffc10138: 91 46 00 0c stw r10,12(r6) next_block->prev_size = block_size; ffc1013c: 7c a5 51 2e stwx r5,r5,r10 { Heap_Block *next = block_before->next; new_block->next = next; new_block->prev = block_before; block_before->next = new_block; ffc10140: 91 49 00 08 stw r10,8(r9) /* Statistics */ ++stats->free_blocks; ffc10144: 90 e9 00 38 stw r7,56(r9) if ( stats->max_free_blocks < stats->free_blocks ) { ffc10148: 40 bd ff 54 ble- cr7,ffc1009c <_Heap_Free+0xb0> stats->max_free_blocks = stats->free_blocks; ffc1014c: 90 e9 00 3c stw r7,60(r9) ffc10150: 4b ff ff 4c b ffc1009c <_Heap_Free+0xb0> 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; ffc10154: 80 eb 00 04 lwz r7,4(r11) 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) ) { ffc10158: 70 e6 00 01 andi. r6,r7,1 ffc1015c: 41 82 00 60 beq- ffc101bc <_Heap_Free+0x1d0> <== NEVER TAKEN _HAssert( false ); return( false ); } if ( next_is_free ) { /* coalesce both */ ffc10160: 2f 8c 00 00 cmpwi cr7,r12,0 ffc10164: 41 9e 00 38 beq- cr7,ffc1019c <_Heap_Free+0x1b0> uintptr_t const size = block_size + prev_size + next_block_size; _Heap_Free_list_remove( next_block ); stats->free_blocks -= 1; ffc10168: 80 c9 00 38 lwz r6,56(r9) _HAssert( false ); return( false ); } if ( next_is_free ) { /* coalesce both */ uintptr_t const size = block_size + prev_size + next_block_size; ffc1016c: 7c 05 02 14 add r0,r5,r0 --stats->used_blocks; ++stats->frees; stats->free_size += block_size; return( true ); } ffc10170: 80 e8 00 08 lwz r7,8(r8) _HAssert( false ); return( false ); } if ( next_is_free ) { /* coalesce both */ uintptr_t const size = block_size + prev_size + next_block_size; ffc10174: 7c 80 22 14 add r4,r0,r4 --stats->used_blocks; ++stats->frees; stats->free_size += block_size; return( true ); } ffc10178: 81 48 00 0c lwz r10,12(r8) } 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; ffc1017c: 38 c6 ff ff addi r6,r6,-1 prev_block->size_and_flag = size | HEAP_PREV_BLOCK_USED; ffc10180: 60 88 00 01 ori r8,r4,1 RTEMS_INLINE_ROUTINE void _Heap_Free_list_remove( Heap_Block *block ) { Heap_Block *next = block->next; Heap_Block *prev = block->prev; prev->next = next; ffc10184: 90 ea 00 08 stw r7,8(r10) next->prev = prev; ffc10188: 91 47 00 0c stw r10,12(r7) } 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; ffc1018c: 90 c9 00 38 stw r6,56(r9) prev_block->size_and_flag = size | HEAP_PREV_BLOCK_USED; ffc10190: 91 0b 00 04 stw r8,4(r11) next_block = _Heap_Block_at( prev_block, size ); _HAssert(!_Heap_Is_prev_used( next_block)); next_block->prev_size = size; ffc10194: 7c 84 59 2e stwx r4,r4,r11 ffc10198: 4b ff ff 04 b ffc1009c <_Heap_Free+0xb0> } else { /* coalesce prev */ uintptr_t const size = block_size + prev_size; ffc1019c: 7c 05 02 14 add r0,r5,r0 prev_block->size_and_flag = size | HEAP_PREV_BLOCK_USED; ffc101a0: 60 07 00 01 ori r7,r0,1 next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED; next_block->prev_size = size; ffc101a4: 7c 05 51 2e stwx r0,r5,r10 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; ffc101a8: 90 eb 00 04 stw r7,4(r11) next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED; ffc101ac: 80 e8 00 04 lwz r7,4(r8) ffc101b0: 54 e7 00 3c rlwinm r7,r7,0,0,30 ffc101b4: 90 e8 00 04 stw r7,4(r8) ffc101b8: 4b ff fe e4 b ffc1009c <_Heap_Free+0xb0> ffc101bc: 4e 80 00 20 blr <== 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 ffc101c0: 39 80 00 01 li r12,1 ffc101c4: 4b ff ff 24 b ffc100e8 <_Heap_Free+0xfc> =============================================================================== ffc15408 <_Heap_Get_free_information>: return &heap->free_list; } RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Free_list_first( Heap_Control *heap ) { return _Heap_Free_list_head(heap)->next; ffc15408: 81 23 00 08 lwz r9,8(r3) ) { Heap_Block *the_block; Heap_Block *const tail = _Heap_Free_list_tail(the_heap); info->number = 0; ffc1540c: 39 40 00 00 li r10,0 ffc15410: 91 44 00 00 stw r10,0(r4) info->largest = 0; info->total = 0; for(the_block = _Heap_Free_list_first(the_heap); ffc15414: 38 e0 00 01 li r7,1 ffc15418: 7f 83 48 00 cmpw cr7,r3,r9 { Heap_Block *the_block; Heap_Block *const tail = _Heap_Free_list_tail(the_heap); info->number = 0; info->largest = 0; ffc1541c: 91 44 00 04 stw r10,4(r4) info->total = 0; for(the_block = _Heap_Free_list_first(the_heap); ffc15420: 38 c0 00 00 li r6,0 ffc15424: 39 00 00 00 li r8,0 Heap_Block *the_block; Heap_Block *const tail = _Heap_Free_list_tail(the_heap); info->number = 0; info->largest = 0; info->total = 0; ffc15428: 91 44 00 08 stw r10,8(r4) for(the_block = _Heap_Free_list_first(the_heap); ffc1542c: 40 be 00 10 bne+ cr7,ffc1543c <_Heap_Get_free_information+0x34><== ALWAYS TAKEN ffc15430: 4e 80 00 20 blr <== NOT EXECUTED ffc15434: 80 c4 00 04 lwz r6,4(r4) ffc15438: 7c a7 2b 78 mr r7,r5 - 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; ffc1543c: 81 49 00 04 lwz r10,4(r9) ffc15440: 38 a7 00 01 addi r5,r7,1 ffc15444: 55 4a 00 3c rlwinm r10,r10,0,0,30 /* As we always coalesce free blocks, prev block must have been used. */ _HAssert(_Heap_Is_prev_used(the_block)); info->number++; info->total += the_size; if ( info->largest < the_size ) ffc15448: 7f 8a 30 40 cmplw cr7,r10,r6 /* As we always coalesce free blocks, prev block must have been used. */ _HAssert(_Heap_Is_prev_used(the_block)); info->number++; info->total += the_size; ffc1544c: 7d 08 52 14 add r8,r8,r10 if ( info->largest < the_size ) ffc15450: 40 9d 00 08 ble- cr7,ffc15458 <_Heap_Get_free_information+0x50> info->largest = the_size; ffc15454: 91 44 00 04 stw r10,4(r4) info->largest = 0; info->total = 0; for(the_block = _Heap_Free_list_first(the_heap); the_block != tail; the_block = the_block->next) ffc15458: 81 29 00 08 lwz r9,8(r9) info->number = 0; info->largest = 0; info->total = 0; for(the_block = _Heap_Free_list_first(the_heap); ffc1545c: 7f 83 48 00 cmpw cr7,r3,r9 ffc15460: 40 9e ff d4 bne+ cr7,ffc15434 <_Heap_Get_free_information+0x2c> ffc15464: 90 e4 00 00 stw r7,0(r4) ffc15468: 91 04 00 08 stw r8,8(r4) ffc1546c: 4e 80 00 20 blr =============================================================================== ffc0d3f0 <_Heap_Greedy_allocate>: Heap_Block *_Heap_Greedy_allocate( Heap_Control *heap, const uintptr_t *block_sizes, size_t block_count ) { ffc0d3f0: 94 21 ff e0 stwu r1,-32(r1) ffc0d3f4: 7c 08 02 a6 mflr r0 ffc0d3f8: 93 61 00 0c stw r27,12(r1) Heap_Block *allocated_blocks = NULL; Heap_Block *blocks = NULL; Heap_Block *current; size_t i; for (i = 0; i < block_count; ++i) { ffc0d3fc: 7c bb 2b 79 mr. r27,r5 Heap_Block *_Heap_Greedy_allocate( Heap_Control *heap, const uintptr_t *block_sizes, size_t block_count ) { ffc0d400: 93 c1 00 18 stw r30,24(r1) ffc0d404: 7c 7e 1b 78 mr r30,r3 ffc0d408: 90 01 00 24 stw r0,36(r1) ffc0d40c: 93 81 00 10 stw r28,16(r1) ffc0d410: 93 a1 00 14 stw r29,20(r1) ffc0d414: 93 e1 00 1c stw r31,28(r1) Heap_Block *allocated_blocks = NULL; Heap_Block *blocks = NULL; Heap_Block *current; size_t i; for (i = 0; i < block_count; ++i) { ffc0d418: 41 82 00 e0 beq- ffc0d4f8 <_Heap_Greedy_allocate+0x108> #include "config.h" #endif #include Heap_Block *_Heap_Greedy_allocate( ffc0d41c: 3b 84 ff fc addi r28,r4,-4 Heap_Block *allocated_blocks = NULL; Heap_Block *blocks = NULL; Heap_Block *current; size_t i; for (i = 0; i < block_count; ++i) { ffc0d420: 3b e0 00 00 li r31,0 const uintptr_t *block_sizes, size_t block_count ) { Heap_Block *const free_list_tail = _Heap_Free_list_tail( heap ); Heap_Block *allocated_blocks = NULL; ffc0d424: 3b a0 00 00 li r29,0 * @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 ); ffc0d428: 84 9c 00 04 lwzu r4,4(r28) ffc0d42c: 7f c3 f3 78 mr r3,r30 ffc0d430: 38 a0 00 00 li r5,0 ffc0d434: 38 c0 00 00 li r6,0 ffc0d438: 48 00 85 b9 bl ffc159f0 <_Heap_Allocate_aligned_with_boundary> Heap_Block *blocks = NULL; Heap_Block *current; size_t i; for (i = 0; i < block_count; ++i) { ffc0d43c: 3b ff 00 01 addi r31,r31,1 void *next = _Heap_Allocate( heap, block_sizes [i] ); if ( next != NULL ) { ffc0d440: 2c 03 00 00 cmpwi r3,0 Heap_Block *allocated_blocks = NULL; Heap_Block *blocks = NULL; Heap_Block *current; size_t i; for (i = 0; i < block_count; ++i) { ffc0d444: 7f 9f d8 00 cmpw cr7,r31,r27 void *next = _Heap_Allocate( heap, block_sizes [i] ); if ( next != NULL ) { ffc0d448: 41 82 00 1c beq- ffc0d464 <_Heap_Greedy_allocate+0x74> <== NEVER TAKEN RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down( uintptr_t value, uintptr_t alignment ) { return value - (value % alignment); ffc0d44c: 81 3e 00 10 lwz r9,16(r30) ffc0d450: 7c 63 4b 96 divwu r3,r3,r9 ffc0d454: 7d 23 49 d6 mullw r9,r3,r9 Heap_Block *next_block = _Heap_Block_of_alloc_area( (uintptr_t) next, heap->page_size ); next_block->next = allocated_blocks; ffc0d458: 93 a9 00 00 stw r29,0(r9) uintptr_t alloc_begin, uintptr_t page_size ) { return (Heap_Block *) (_Heap_Align_down( alloc_begin, page_size ) - HEAP_BLOCK_HEADER_SIZE); ffc0d45c: 39 29 ff f8 addi r9,r9,-8 ffc0d460: 7d 3d 4b 78 mr r29,r9 Heap_Block *allocated_blocks = NULL; Heap_Block *blocks = NULL; Heap_Block *current; size_t i; for (i = 0; i < block_count; ++i) { ffc0d464: 40 9e ff c4 bne+ cr7,ffc0d428 <_Heap_Greedy_allocate+0x38> return &heap->free_list; } RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Free_list_first( Heap_Control *heap ) { return _Heap_Free_list_head(heap)->next; ffc0d468: 83 fe 00 08 lwz r31,8(r30) next_block->next = allocated_blocks; allocated_blocks = next_block; } } while ( (current = _Heap_Free_list_first( heap )) != free_list_tail ) { ffc0d46c: 7f 9e f8 00 cmpw cr7,r30,r31 ffc0d470: 41 9e 00 90 beq- cr7,ffc0d500 <_Heap_Greedy_allocate+0x110><== NEVER TAKEN ffc0d474: 3b 80 00 00 li r28,0 ffc0d478: 48 00 00 08 b ffc0d480 <_Heap_Greedy_allocate+0x90> ffc0d47c: 7d 3f 4b 78 mr r31,r9 - 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; ffc0d480: 80 df 00 04 lwz r6,4(r31) _Heap_Block_allocate( ffc0d484: 7f e4 fb 78 mr r4,r31 ffc0d488: 38 bf 00 08 addi r5,r31,8 ffc0d48c: 54 c6 00 3c rlwinm r6,r6,0,0,30 ffc0d490: 7f c3 f3 78 mr r3,r30 ffc0d494: 38 c6 ff f8 addi r6,r6,-8 ffc0d498: 48 00 03 e5 bl ffc0d87c <_Heap_Block_allocate> current, _Heap_Alloc_area_of_block( current ), _Heap_Block_size( current ) - HEAP_BLOCK_HEADER_SIZE ); current->next = blocks; ffc0d49c: 93 9f 00 08 stw r28,8(r31) ffc0d4a0: 7f fc fb 78 mr r28,r31 return &heap->free_list; } RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Free_list_first( Heap_Control *heap ) { return _Heap_Free_list_head(heap)->next; ffc0d4a4: 81 3e 00 08 lwz r9,8(r30) next_block->next = allocated_blocks; allocated_blocks = next_block; } } while ( (current = _Heap_Free_list_first( heap )) != free_list_tail ) { ffc0d4a8: 7f 9e 48 00 cmpw cr7,r30,r9 ffc0d4ac: 40 9e ff d0 bne+ cr7,ffc0d47c <_Heap_Greedy_allocate+0x8c> current->next = blocks; blocks = current; } while ( allocated_blocks != NULL ) { ffc0d4b0: 2f 9d 00 00 cmpwi cr7,r29,0 ffc0d4b4: 41 9e 00 1c beq- cr7,ffc0d4d0 <_Heap_Greedy_allocate+0xe0> current = allocated_blocks; allocated_blocks = allocated_blocks->next; ffc0d4b8: 7f a4 eb 78 mr r4,r29 ffc0d4bc: 87 a4 00 08 lwzu r29,8(r4) _Heap_Free( heap, (void *) _Heap_Alloc_area_of_block( current ) ); ffc0d4c0: 7f c3 f3 78 mr r3,r30 ffc0d4c4: 48 00 87 69 bl ffc15c2c <_Heap_Free> current->next = blocks; blocks = current; } while ( allocated_blocks != NULL ) { ffc0d4c8: 2f 9d 00 00 cmpwi cr7,r29,0 ffc0d4cc: 40 9e ff ec bne+ cr7,ffc0d4b8 <_Heap_Greedy_allocate+0xc8> allocated_blocks = allocated_blocks->next; _Heap_Free( heap, (void *) _Heap_Alloc_area_of_block( current ) ); } return blocks; } ffc0d4d0: 80 01 00 24 lwz r0,36(r1) ffc0d4d4: 7f e3 fb 78 mr r3,r31 ffc0d4d8: 83 61 00 0c lwz r27,12(r1) ffc0d4dc: 7c 08 03 a6 mtlr r0 ffc0d4e0: 83 81 00 10 lwz r28,16(r1) ffc0d4e4: 83 a1 00 14 lwz r29,20(r1) ffc0d4e8: 83 c1 00 18 lwz r30,24(r1) ffc0d4ec: 83 e1 00 1c lwz r31,28(r1) ffc0d4f0: 38 21 00 20 addi r1,r1,32 ffc0d4f4: 4e 80 00 20 blr const uintptr_t *block_sizes, size_t block_count ) { Heap_Block *const free_list_tail = _Heap_Free_list_tail( heap ); Heap_Block *allocated_blocks = NULL; ffc0d4f8: 3b a0 00 00 li r29,0 ffc0d4fc: 4b ff ff 6c b ffc0d468 <_Heap_Greedy_allocate+0x78> next_block->next = allocated_blocks; allocated_blocks = next_block; } } while ( (current = _Heap_Free_list_first( heap )) != free_list_tail ) { ffc0d500: 3b e0 00 00 li r31,0 <== NOT EXECUTED ffc0d504: 4b ff ff c4 b ffc0d4c8 <_Heap_Greedy_allocate+0xd8> <== NOT EXECUTED =============================================================================== ffc0d508 <_Heap_Greedy_free>: void _Heap_Greedy_free( Heap_Control *heap, Heap_Block *blocks ) { while ( blocks != NULL ) { ffc0d508: 2c 04 00 00 cmpwi r4,0 void _Heap_Greedy_free( Heap_Control *heap, Heap_Block *blocks ) { ffc0d50c: 94 21 ff f0 stwu r1,-16(r1) ffc0d510: 7c 08 02 a6 mflr r0 ffc0d514: 93 c1 00 08 stw r30,8(r1) ffc0d518: 7c 7e 1b 78 mr r30,r3 ffc0d51c: 90 01 00 14 stw r0,20(r1) ffc0d520: 93 e1 00 0c stw r31,12(r1) while ( blocks != NULL ) { ffc0d524: 41 82 00 1c beq- ffc0d540 <_Heap_Greedy_free+0x38> <== NEVER TAKEN Heap_Block *current = blocks; blocks = blocks->next; ffc0d528: 87 e4 00 08 lwzu r31,8(r4) _Heap_Free( heap, (void *) _Heap_Alloc_area_of_block( current ) ); ffc0d52c: 7f c3 f3 78 mr r3,r30 ffc0d530: 48 00 86 fd bl ffc15c2c <_Heap_Free> void _Heap_Greedy_free( Heap_Control *heap, Heap_Block *blocks ) { while ( blocks != NULL ) { ffc0d534: 2f 9f 00 00 cmpwi cr7,r31,0 ffc0d538: 7f e4 fb 78 mr r4,r31 ffc0d53c: 40 9e ff ec bne+ cr7,ffc0d528 <_Heap_Greedy_free+0x20> Heap_Block *current = blocks; blocks = blocks->next; _Heap_Free( heap, (void *) _Heap_Alloc_area_of_block( current ) ); } } ffc0d540: 80 01 00 14 lwz r0,20(r1) ffc0d544: 83 c1 00 08 lwz r30,8(r1) ffc0d548: 7c 08 03 a6 mtlr r0 ffc0d54c: 83 e1 00 0c lwz r31,12(r1) ffc0d550: 38 21 00 10 addi r1,r1,16 ffc0d554: 4e 80 00 20 blr =============================================================================== ffc154dc <_Heap_Iterate>: void _Heap_Iterate( Heap_Control *heap, Heap_Block_visitor visitor, void *visitor_arg ) { ffc154dc: 94 21 ff e8 stwu r1,-24(r1) ffc154e0: 7c 08 02 a6 mflr r0 ffc154e4: 90 01 00 1c stw r0,28(r1) ffc154e8: 93 c1 00 10 stw r30,16(r1) Heap_Block *current = heap->first_block; ffc154ec: 81 23 00 20 lwz r9,32(r3) Heap_Block *end = heap->last_block; ffc154f0: 83 c3 00 24 lwz r30,36(r3) void _Heap_Iterate( Heap_Control *heap, Heap_Block_visitor visitor, void *visitor_arg ) { ffc154f4: 93 81 00 08 stw r28,8(r1) ffc154f8: 7c 9c 23 78 mr r28,r4 Heap_Block *current = heap->first_block; Heap_Block *end = heap->last_block; bool stop = false; while ( !stop && current != end ) { ffc154fc: 7f 89 f0 00 cmpw cr7,r9,r30 void _Heap_Iterate( Heap_Control *heap, Heap_Block_visitor visitor, void *visitor_arg ) { ffc15500: 93 a1 00 0c stw r29,12(r1) ffc15504: 7c bd 2b 78 mr r29,r5 ffc15508: 93 e1 00 14 stw r31,20(r1) Heap_Block *current = heap->first_block; Heap_Block *end = heap->last_block; bool stop = false; while ( !stop && current != end ) { ffc1550c: 40 be 00 0c bne+ cr7,ffc15518 <_Heap_Iterate+0x3c> <== ALWAYS TAKEN ffc15510: 48 00 00 3c b ffc1554c <_Heap_Iterate+0x70> <== NOT EXECUTED ffc15514: 41 9a 00 38 beq- cr6,ffc1554c <_Heap_Iterate+0x70> ffc15518: 81 49 00 04 lwz r10,4(r9) 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 ); ffc1551c: 7d 23 4b 78 mr r3,r9 ffc15520: 7f a6 eb 78 mr r6,r29 ffc15524: 7f 89 03 a6 mtctr r28 ffc15528: 55 44 00 3c rlwinm r4,r10,0,0,30 RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); ffc1552c: 7f e9 22 14 add r31,r9,r4 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; ffc15530: 80 bf 00 04 lwz r5,4(r31) ffc15534: 54 a5 07 fe clrlwi r5,r5,31 ffc15538: 4e 80 04 21 bctrl ffc1553c: 7f e9 fb 78 mr r9,r31 { Heap_Block *current = heap->first_block; Heap_Block *end = heap->last_block; bool stop = false; while ( !stop && current != end ) { ffc15540: 2f 83 00 00 cmpwi cr7,r3,0 ffc15544: 7f 1e f8 00 cmpw cr6,r30,r31 ffc15548: 41 9e ff cc beq+ cr7,ffc15514 <_Heap_Iterate+0x38> <== ALWAYS TAKEN stop = (*visitor)( current, size, used, visitor_arg ); current = next; } } ffc1554c: 80 01 00 1c lwz r0,28(r1) ffc15550: 83 81 00 08 lwz r28,8(r1) ffc15554: 7c 08 03 a6 mtlr r0 ffc15558: 83 a1 00 0c lwz r29,12(r1) ffc1555c: 83 c1 00 10 lwz r30,16(r1) ffc15560: 83 e1 00 14 lwz r31,20(r1) ffc15564: 38 21 00 18 addi r1,r1,24 ffc15568: 4e 80 00 20 blr =============================================================================== ffc1d2a4 <_Heap_Size_of_alloc_area>: RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down( uintptr_t value, uintptr_t alignment ) { return value - (value % alignment); ffc1d2a4: 81 23 00 10 lwz r9,16(r3) 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 ffc1d2a8: 81 43 00 20 lwz r10,32(r3) RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down( uintptr_t value, uintptr_t alignment ) { return value - (value % alignment); ffc1d2ac: 7d 04 4b 96 divwu r8,r4,r9 ffc1d2b0: 7d 28 49 d6 mullw r9,r8,r9 uintptr_t alloc_begin, uintptr_t page_size ) { return (Heap_Block *) (_Heap_Align_down( alloc_begin, page_size ) - HEAP_BLOCK_HEADER_SIZE); ffc1d2b4: 39 29 ff f8 addi r9,r9,-8 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; ffc1d2b8: 7f 89 50 40 cmplw cr7,r9,r10 ffc1d2bc: 41 9c 00 50 blt- cr7,ffc1d30c <_Heap_Size_of_alloc_area+0x68> ffc1d2c0: 81 03 00 24 lwz r8,36(r3) ffc1d2c4: 7f 89 40 40 cmplw cr7,r9,r8 ffc1d2c8: 41 9d 00 44 bgt- cr7,ffc1d30c <_Heap_Size_of_alloc_area+0x68> - 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; ffc1d2cc: 80 e9 00 04 lwz r7,4(r9) ffc1d2d0: 54 e7 00 3c rlwinm r7,r7,0,0,30 RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); ffc1d2d4: 7d 27 4a 14 add r9,r7,r9 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; ffc1d2d8: 7f 8a 48 40 cmplw cr7,r10,r9 ffc1d2dc: 41 9d 00 30 bgt- cr7,ffc1d30c <_Heap_Size_of_alloc_area+0x68><== NEVER TAKEN ffc1d2e0: 7f 88 48 40 cmplw cr7,r8,r9 ffc1d2e4: 41 9c 00 28 blt- cr7,ffc1d30c <_Heap_Size_of_alloc_area+0x68><== NEVER TAKEN 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; ffc1d2e8: 81 49 00 04 lwz r10,4(r9) Heap_Block *block = _Heap_Block_of_alloc_area( alloc_begin, page_size ); Heap_Block *next_block = NULL; uintptr_t block_size = 0; if ( !_Heap_Is_block_in_heap( heap, block ) ) { return false; ffc1d2ec: 38 60 00 00 li r3,0 block_size = _Heap_Block_size( block ); next_block = _Heap_Block_at( block, block_size ); if ( !_Heap_Is_block_in_heap( heap, next_block ) || !_Heap_Is_prev_used( next_block ) ffc1d2f0: 71 48 00 01 andi. r8,r10,1 ffc1d2f4: 41 82 00 20 beq- ffc1d314 <_Heap_Size_of_alloc_area+0x70><== NEVER TAKEN ) { return false; } *alloc_size = (uintptr_t) next_block + HEAP_ALLOC_BONUS - alloc_begin; ffc1d2f8: 20 84 00 04 subfic r4,r4,4 ffc1d2fc: 7d 24 4a 14 add r9,r4,r9 ffc1d300: 91 25 00 00 stw r9,0(r5) return true; ffc1d304: 38 60 00 01 li r3,1 ffc1d308: 4e 80 00 20 blr Heap_Block *block = _Heap_Block_of_alloc_area( alloc_begin, page_size ); Heap_Block *next_block = NULL; uintptr_t block_size = 0; if ( !_Heap_Is_block_in_heap( heap, block ) ) { return false; ffc1d30c: 38 60 00 00 li r3,0 ffc1d310: 4e 80 00 20 blr } *alloc_size = (uintptr_t) next_block + HEAP_ALLOC_BONUS - alloc_begin; return true; } ffc1d314: 4e 80 00 20 blr <== NOT EXECUTED =============================================================================== ffc0b91c <_Heap_Walk>: uintptr_t const min_block_size = heap->min_block_size; Heap_Block *const first_block = heap->first_block; Heap_Block *const last_block = heap->last_block; Heap_Block *block = first_block; Heap_Walk_printer printer = dump ? _Heap_Walk_print : _Heap_Walk_print_nothing; ffc0b91c: 2f 85 00 00 cmpwi cr7,r5,0 bool _Heap_Walk( Heap_Control *heap, int source, bool dump ) { ffc0b920: 94 21 ff a0 stwu r1,-96(r1) ffc0b924: 7c 08 02 a6 mflr r0 ffc0b928: 91 c1 00 18 stw r14,24(r1) ffc0b92c: 90 01 00 64 stw r0,100(r1) ffc0b930: 92 e1 00 3c stw r23,60(r1) ffc0b934: 93 01 00 40 stw r24,64(r1) ffc0b938: 7c 98 23 78 mr r24,r4 ffc0b93c: 93 41 00 48 stw r26,72(r1) ffc0b940: 93 61 00 4c stw r27,76(r1) ffc0b944: 93 e1 00 5c stw r31,92(r1) ffc0b948: 7c 7f 1b 78 mr r31,r3 ffc0b94c: 91 e1 00 1c stw r15,28(r1) ffc0b950: 92 01 00 20 stw r16,32(r1) ffc0b954: 92 21 00 24 stw r17,36(r1) ffc0b958: 92 41 00 28 stw r18,40(r1) ffc0b95c: 92 61 00 2c stw r19,44(r1) ffc0b960: 92 81 00 30 stw r20,48(r1) ffc0b964: 92 a1 00 34 stw r21,52(r1) ffc0b968: 92 c1 00 38 stw r22,56(r1) ffc0b96c: 93 21 00 44 stw r25,68(r1) ffc0b970: 93 81 00 50 stw r28,80(r1) ffc0b974: 93 a1 00 54 stw r29,84(r1) ffc0b978: 93 c1 00 58 stw r30,88(r1) uintptr_t const page_size = heap->page_size; ffc0b97c: 83 63 00 10 lwz r27,16(r3) uintptr_t const min_block_size = heap->min_block_size; ffc0b980: 81 c3 00 14 lwz r14,20(r3) Heap_Block *const first_block = heap->first_block; ffc0b984: 83 43 00 20 lwz r26,32(r3) Heap_Block *const last_block = heap->last_block; ffc0b988: 82 e3 00 24 lwz r23,36(r3) Heap_Block *block = first_block; Heap_Walk_printer printer = dump ? _Heap_Walk_print : _Heap_Walk_print_nothing; ffc0b98c: 41 9e 00 78 beq- cr7,ffc0ba04 <_Heap_Walk+0xe8> if ( !_System_state_Is_up( _System_state_Get() ) ) { ffc0b990: 3d 20 00 00 lis r9,0 ffc0b994: 81 29 28 08 lwz r9,10248(r9) uintptr_t const min_block_size = heap->min_block_size; Heap_Block *const first_block = heap->first_block; Heap_Block *const last_block = heap->last_block; Heap_Block *block = first_block; Heap_Walk_printer printer = dump ? _Heap_Walk_print : _Heap_Walk_print_nothing; ffc0b998: 3f 20 ff c1 lis r25,-63 ffc0b99c: 3b 39 b8 1c addi r25,r25,-18404 if ( !_System_state_Is_up( _System_state_Get() ) ) { ffc0b9a0: 2f 89 00 03 cmpwi cr7,r9,3 return true; ffc0b9a4: 38 60 00 01 li r3,1 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; if ( !_System_state_Is_up( _System_state_Get() ) ) { ffc0b9a8: 41 9e 00 78 beq- cr7,ffc0ba20 <_Heap_Walk+0x104> <== ALWAYS TAKEN block = next_block; } while ( block != first_block ); return true; } ffc0b9ac: 80 01 00 64 lwz r0,100(r1) ffc0b9b0: 81 c1 00 18 lwz r14,24(r1) ffc0b9b4: 7c 08 03 a6 mtlr r0 ffc0b9b8: 81 e1 00 1c lwz r15,28(r1) ffc0b9bc: 82 01 00 20 lwz r16,32(r1) ffc0b9c0: 82 21 00 24 lwz r17,36(r1) ffc0b9c4: 82 41 00 28 lwz r18,40(r1) ffc0b9c8: 82 61 00 2c lwz r19,44(r1) ffc0b9cc: 82 81 00 30 lwz r20,48(r1) ffc0b9d0: 82 a1 00 34 lwz r21,52(r1) ffc0b9d4: 82 c1 00 38 lwz r22,56(r1) ffc0b9d8: 82 e1 00 3c lwz r23,60(r1) ffc0b9dc: 83 01 00 40 lwz r24,64(r1) ffc0b9e0: 83 21 00 44 lwz r25,68(r1) ffc0b9e4: 83 41 00 48 lwz r26,72(r1) ffc0b9e8: 83 61 00 4c lwz r27,76(r1) ffc0b9ec: 83 81 00 50 lwz r28,80(r1) ffc0b9f0: 83 a1 00 54 lwz r29,84(r1) ffc0b9f4: 83 c1 00 58 lwz r30,88(r1) ffc0b9f8: 83 e1 00 5c lwz r31,92(r1) ffc0b9fc: 38 21 00 60 addi r1,r1,96 ffc0ba00: 4e 80 00 20 blr 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; if ( !_System_state_Is_up( _System_state_Get() ) ) { ffc0ba04: 3d 20 00 00 lis r9,0 ffc0ba08: 81 29 28 08 lwz r9,10248(r9) uintptr_t const min_block_size = heap->min_block_size; Heap_Block *const first_block = heap->first_block; Heap_Block *const last_block = heap->last_block; Heap_Block *block = first_block; Heap_Walk_printer printer = dump ? _Heap_Walk_print : _Heap_Walk_print_nothing; ffc0ba0c: 3f 20 ff c1 lis r25,-63 ffc0ba10: 3b 39 b8 18 addi r25,r25,-18408 if ( !_System_state_Is_up( _System_state_Get() ) ) { ffc0ba14: 2f 89 00 03 cmpwi cr7,r9,3 return true; ffc0ba18: 38 60 00 01 li r3,1 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; if ( !_System_state_Is_up( _System_state_Get() ) ) { ffc0ba1c: 40 9e ff 90 bne+ cr7,ffc0b9ac <_Heap_Walk+0x90> 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)( ffc0ba20: 80 ff 00 08 lwz r7,8(r31) ffc0ba24: 3c a0 ff c2 lis r5,-62 ffc0ba28: 81 5f 00 0c lwz r10,12(r31) ffc0ba2c: 7f 03 c3 78 mr r3,r24 ffc0ba30: 81 1f 00 18 lwz r8,24(r31) ffc0ba34: 38 80 00 00 li r4,0 ffc0ba38: 81 3f 00 1c lwz r9,28(r31) ffc0ba3c: 38 a5 98 ac addi r5,r5,-26452 ffc0ba40: 90 e1 00 0c stw r7,12(r1) ffc0ba44: 7f 66 db 78 mr r6,r27 ffc0ba48: 7d c7 73 78 mr r7,r14 ffc0ba4c: 7f 29 03 a6 mtctr r25 ffc0ba50: 91 41 00 10 stw r10,16(r1) ffc0ba54: 7f 4a d3 78 mr r10,r26 ffc0ba58: 92 e1 00 08 stw r23,8(r1) ffc0ba5c: 4c c6 31 82 crclr 4*cr1+eq ffc0ba60: 4e 80 04 21 bctrl heap->area_begin, heap->area_end, first_block, last_block, first_free_block, last_free_block ); if ( page_size == 0 ) { ffc0ba64: 2f 9b 00 00 cmpwi cr7,r27,0 ffc0ba68: 41 9e 00 a4 beq- cr7,ffc0bb0c <_Heap_Walk+0x1f0> (*printer)( source, true, "page size is zero\n" ); return false; } if ( !_Addresses_Is_aligned( (void *) page_size ) ) { ffc0ba6c: 73 67 00 07 andi. r7,r27,7 ffc0ba70: 40 82 00 c0 bne- ffc0bb30 <_Heap_Walk+0x214> RTEMS_INLINE_ROUTINE bool _Heap_Is_aligned( uintptr_t value, uintptr_t alignment ) { return (value % alignment) == 0; ffc0ba74: 7d 2e db 96 divwu r9,r14,r27 ffc0ba78: 7d 29 d9 d6 mullw r9,r9,r27 ); return false; } if ( !_Heap_Is_aligned( min_block_size, page_size ) ) { ffc0ba7c: 7f 8e 48 00 cmpw cr7,r14,r9 ffc0ba80: 40 9e 00 d8 bne- cr7,ffc0bb58 <_Heap_Walk+0x23c> RTEMS_INLINE_ROUTINE uintptr_t _Heap_Alloc_area_of_block( const Heap_Block *block ) { return (uintptr_t) block + HEAP_BLOCK_HEADER_SIZE; ffc0ba84: 39 3a 00 08 addi r9,r26,8 RTEMS_INLINE_ROUTINE bool _Heap_Is_aligned( uintptr_t value, uintptr_t alignment ) { return (value % alignment) == 0; ffc0ba88: 7d 49 db 96 divwu r10,r9,r27 ffc0ba8c: 7d 4a d9 d6 mullw r10,r10,r27 ); return false; } if ( ffc0ba90: 7f 89 50 00 cmpw cr7,r9,r10 ffc0ba94: 40 9e 00 ec bne- cr7,ffc0bb80 <_Heap_Walk+0x264> block = next_block; } while ( block != first_block ); return true; } ffc0ba98: 83 9a 00 04 lwz r28,4(r26) ); return false; } if ( !_Heap_Is_prev_used( first_block ) ) { ffc0ba9c: 73 90 00 01 andi. r16,r28,1 ffc0baa0: 41 82 01 08 beq- ffc0bba8 <_Heap_Walk+0x28c> - 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; ffc0baa4: 81 37 00 04 lwz r9,4(r23) ffc0baa8: 55 29 00 3c rlwinm r9,r9,0,0,30 RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); ffc0baac: 7d 37 4a 14 add r9,r23,r9 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; ffc0bab0: 81 49 00 04 lwz r10,4(r9) ); return false; } if ( _Heap_Is_free( last_block ) ) { ffc0bab4: 71 47 00 01 andi. r7,r10,1 ffc0bab8: 41 82 00 30 beq- ffc0bae8 <_Heap_Walk+0x1cc> ); return false; } if ( ffc0babc: 7f 9a 48 00 cmpw cr7,r26,r9 ffc0bac0: 41 9e 01 0c beq- cr7,ffc0bbcc <_Heap_Walk+0x2b0> _Heap_Block_at( last_block, _Heap_Block_size( last_block ) ) != first_block ) { (*printer)( ffc0bac4: 3c a0 ff c2 lis r5,-62 ffc0bac8: 7f 29 03 a6 mtctr r25 ffc0bacc: 7f 03 c3 78 mr r3,r24 ffc0bad0: 38 80 00 01 li r4,1 ffc0bad4: 38 a5 9a 14 addi r5,r5,-26092 ffc0bad8: 4c c6 31 82 crclr 4*cr1+eq ffc0badc: 4e 80 04 21 bctrl "block 0x%08x: next block 0x%08x is not a successor\n", block, next_block ); return false; ffc0bae0: 38 60 00 00 li r3,0 ffc0bae4: 4b ff fe c8 b ffc0b9ac <_Heap_Walk+0x90> return false; } if ( _Heap_Is_free( last_block ) ) { (*printer)( ffc0bae8: 3c a0 ff c2 lis r5,-62 ffc0baec: 7f 29 03 a6 mtctr r25 ffc0baf0: 7f 03 c3 78 mr r3,r24 ffc0baf4: 38 80 00 01 li r4,1 ffc0baf8: 38 a5 99 fc addi r5,r5,-26116 ffc0bafc: 4c c6 31 82 crclr 4*cr1+eq ffc0bb00: 4e 80 04 21 bctrl "block 0x%08x: next block 0x%08x is not a successor\n", block, next_block ); return false; ffc0bb04: 38 60 00 00 li r3,0 ffc0bb08: 4b ff fe a4 b ffc0b9ac <_Heap_Walk+0x90> first_block, last_block, first_free_block, last_free_block ); if ( page_size == 0 ) { (*printer)( source, true, "page size is zero\n" ); ffc0bb0c: 3c a0 ff c2 lis r5,-62 ffc0bb10: 7f 29 03 a6 mtctr r25 ffc0bb14: 7f 03 c3 78 mr r3,r24 ffc0bb18: 38 80 00 01 li r4,1 ffc0bb1c: 38 a5 99 40 addi r5,r5,-26304 ffc0bb20: 4c c6 31 82 crclr 4*cr1+eq ffc0bb24: 4e 80 04 21 bctrl "block 0x%08x: next block 0x%08x is not a successor\n", block, next_block ); return false; ffc0bb28: 38 60 00 00 li r3,0 ffc0bb2c: 4b ff fe 80 b ffc0b9ac <_Heap_Walk+0x90> return false; } if ( !_Addresses_Is_aligned( (void *) page_size ) ) { (*printer)( ffc0bb30: 3c a0 ff c2 lis r5,-62 ffc0bb34: 7f 29 03 a6 mtctr r25 ffc0bb38: 7f 03 c3 78 mr r3,r24 ffc0bb3c: 38 80 00 01 li r4,1 ffc0bb40: 38 a5 99 54 addi r5,r5,-26284 ffc0bb44: 7f 66 db 78 mr r6,r27 ffc0bb48: 4c c6 31 82 crclr 4*cr1+eq ffc0bb4c: 4e 80 04 21 bctrl "block 0x%08x: next block 0x%08x is not a successor\n", block, next_block ); return false; ffc0bb50: 38 60 00 00 li r3,0 ffc0bb54: 4b ff fe 58 b ffc0b9ac <_Heap_Walk+0x90> return false; } if ( !_Heap_Is_aligned( min_block_size, page_size ) ) { (*printer)( ffc0bb58: 3c a0 ff c2 lis r5,-62 ffc0bb5c: 7f 29 03 a6 mtctr r25 ffc0bb60: 7f 03 c3 78 mr r3,r24 ffc0bb64: 38 80 00 01 li r4,1 ffc0bb68: 38 a5 99 74 addi r5,r5,-26252 ffc0bb6c: 7d c6 73 78 mr r6,r14 ffc0bb70: 4c c6 31 82 crclr 4*cr1+eq ffc0bb74: 4e 80 04 21 bctrl "block 0x%08x: next block 0x%08x is not a successor\n", block, next_block ); return false; ffc0bb78: 38 60 00 00 li r3,0 ffc0bb7c: 4b ff fe 30 b ffc0b9ac <_Heap_Walk+0x90> } if ( !_Heap_Is_aligned( _Heap_Alloc_area_of_block( first_block ), page_size ) ) { (*printer)( ffc0bb80: 3c a0 ff c2 lis r5,-62 ffc0bb84: 7f 29 03 a6 mtctr r25 ffc0bb88: 7f 03 c3 78 mr r3,r24 ffc0bb8c: 38 80 00 01 li r4,1 ffc0bb90: 38 a5 99 98 addi r5,r5,-26216 ffc0bb94: 7f 46 d3 78 mr r6,r26 ffc0bb98: 4c c6 31 82 crclr 4*cr1+eq ffc0bb9c: 4e 80 04 21 bctrl "block 0x%08x: next block 0x%08x is not a successor\n", block, next_block ); return false; ffc0bba0: 38 60 00 00 li r3,0 ffc0bba4: 4b ff fe 08 b ffc0b9ac <_Heap_Walk+0x90> return false; } if ( !_Heap_Is_prev_used( first_block ) ) { (*printer)( ffc0bba8: 3c a0 ff c2 lis r5,-62 ffc0bbac: 7f 29 03 a6 mtctr r25 ffc0bbb0: 7f 03 c3 78 mr r3,r24 ffc0bbb4: 38 80 00 01 li r4,1 ffc0bbb8: 38 a5 99 cc addi r5,r5,-26164 ffc0bbbc: 4c c6 31 82 crclr 4*cr1+eq ffc0bbc0: 4e 80 04 21 bctrl "block 0x%08x: next block 0x%08x is not a successor\n", block, next_block ); return false; ffc0bbc4: 38 60 00 00 li r3,0 ffc0bbc8: 4b ff fd e4 b ffc0b9ac <_Heap_Walk+0x90> return &heap->free_list; } RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Free_list_first( Heap_Control *heap ) { return _Heap_Free_list_head(heap)->next; ffc0bbcc: 80 df 00 08 lwz r6,8(r31) int source, Heap_Walk_printer printer, Heap_Control *heap ) { uintptr_t const page_size = heap->page_size; ffc0bbd0: 80 9f 00 10 lwz r4,16(r31) 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 ) { ffc0bbd4: 7f 9f 30 00 cmpw cr7,r31,r6 block = next_block; } while ( block != first_block ); return true; } ffc0bbd8: 81 3f 00 20 lwz r9,32(r31) 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 ) { ffc0bbdc: 41 9e 00 30 beq- cr7,ffc0bc0c <_Heap_Walk+0x2f0> 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; ffc0bbe0: 7f 89 30 40 cmplw cr7,r9,r6 ffc0bbe4: 40 9d 03 14 ble- cr7,ffc0bef8 <_Heap_Walk+0x5dc> <== ALWAYS TAKEN if ( !_Heap_Is_block_in_heap( heap, free_block ) ) { (*printer)( ffc0bbe8: 3c a0 ff c2 lis r5,-62 ffc0bbec: 7f 29 03 a6 mtctr r25 ffc0bbf0: 7f 03 c3 78 mr r3,r24 ffc0bbf4: 38 80 00 01 li r4,1 ffc0bbf8: 38 a5 9a 44 addi r5,r5,-26044 ffc0bbfc: 4c c6 31 82 crclr 4*cr1+eq ffc0bc00: 4e 80 04 21 bctrl "block 0x%08x: next block 0x%08x is not a successor\n", block, next_block ); return false; ffc0bc04: 38 60 00 00 li r3,0 ffc0bc08: 4b ff fd a4 b ffc0b9ac <_Heap_Walk+0x90> "block 0x%08x: size %u\n", block, block_size ); } else { (*printer)( ffc0bc0c: 3e 80 ff c2 lis r20,-62 if ( !_Heap_Is_prev_used( next_block ) ) { if ( !_Heap_Walk_check_free_block( source, printer, heap, block ) ) { return false; } } else if (prev_used) { (*printer)( ffc0bc10: 3e a0 ff c2 lis r21,-62 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)( ffc0bc14: 3e 60 ff c2 lis r19,-62 ); return false; } if ( _Heap_Is_used( free_block ) ) { ffc0bc18: 7f 5d d3 78 mr r29,r26 "block 0x%08x: size %u\n", block, block_size ); } else { (*printer)( ffc0bc1c: 3a 94 9c 60 addi r20,r20,-25504 if ( !_Heap_Is_prev_used( next_block ) ) { if ( !_Heap_Walk_check_free_block( source, printer, heap, block ) ) { return false; } } else if (prev_used) { (*printer)( ffc0bc20: 3a b5 9c 48 addi r21,r21,-25528 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)( ffc0bc24: 3a 73 9b a4 addi r19,r19,-25692 ffc0bc28: 3e 20 ff c2 lis r17,-62 " (= first free)" : (block->prev == free_list_head ? " (= head)" : ""), block->next, block->next == last_free_block ? " (= last free)" : (block->next == free_list_tail ? " (= tail)" : "") ffc0bc2c: 3e c0 ff c2 lis r22,-62 ffc0bc30: 3d e0 ff c2 lis r15,-62 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)( ffc0bc34: 3e 40 ff c2 lis r18,-62 - 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; ffc0bc38: 57 9c 00 3c rlwinm r28,r28,0,0,30 RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); ffc0bc3c: 7f dc ea 14 add r30,r28,r29 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; ffc0bc40: 7f 89 f0 40 cmplw cr7,r9,r30 ffc0bc44: 40 9d 00 30 ble- cr7,ffc0bc74 <_Heap_Walk+0x358> <== ALWAYS TAKEN 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; if ( !_Heap_Is_block_in_heap( heap, next_block ) ) { (*printer)( ffc0bc48: 3c a0 ff c2 lis r5,-62 ffc0bc4c: 7f 03 c3 78 mr r3,r24 ffc0bc50: 38 80 00 01 li r4,1 ffc0bc54: 38 a5 9a e4 addi r5,r5,-25884 return false; } if ( next_block_begin <= block_begin && is_not_last_block ) { (*printer)( ffc0bc58: 7f a6 eb 78 mr r6,r29 ffc0bc5c: 7f 29 03 a6 mtctr r25 ffc0bc60: 7f c7 f3 78 mr r7,r30 ffc0bc64: 4c c6 31 82 crclr 4*cr1+eq ffc0bc68: 4e 80 04 21 bctrl "block 0x%08x: next block 0x%08x is not a successor\n", block, next_block ); return false; ffc0bc6c: 38 60 00 00 li r3,0 ffc0bc70: 4b ff fd 3c b ffc0b9ac <_Heap_Walk+0x90> ffc0bc74: 81 3f 00 24 lwz r9,36(r31) ffc0bc78: 7f 89 f0 40 cmplw cr7,r9,r30 ffc0bc7c: 41 bc ff cc blt- cr7,ffc0bc48 <_Heap_Walk+0x32c> RTEMS_INLINE_ROUTINE bool _Heap_Is_aligned( uintptr_t value, uintptr_t alignment ) { return (value % alignment) == 0; ffc0bc80: 7d 5c db 96 divwu r10,r28,r27 ffc0bc84: 7d 4a d9 d6 mullw r10,r10,r27 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; ffc0bc88: 7f a9 ba 78 xor r9,r29,r23 ); return false; } if ( !_Heap_Is_aligned( block_size, page_size ) && is_not_last_block ) { ffc0bc8c: 7f 9c 50 00 cmpw cr7,r28,r10 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; ffc0bc90: 7d 29 00 34 cntlzw r9,r9 ffc0bc94: 55 29 d9 7e rlwinm r9,r9,27,5,31 ffc0bc98: 69 29 00 01 xori r9,r9,1 ); return false; } if ( !_Heap_Is_aligned( block_size, page_size ) && is_not_last_block ) { ffc0bc9c: 41 9e 00 5c beq- cr7,ffc0bcf8 <_Heap_Walk+0x3dc> ffc0bca0: 2f 89 00 00 cmpwi cr7,r9,0 ffc0bca4: 40 9e 02 28 bne- cr7,ffc0becc <_Heap_Walk+0x5b0> 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; ffc0bca8: 81 3e 00 04 lwz r9,4(r30) ); return false; } if ( !_Heap_Is_prev_used( next_block ) ) { ffc0bcac: 71 27 00 01 andi. r7,r9,1 ffc0bcb0: 41 82 00 d4 beq- ffc0bd84 <_Heap_Walk+0x468> if ( !_Heap_Walk_check_free_block( source, printer, heap, block ) ) { return false; } } else if (prev_used) { ffc0bcb4: 2f 90 00 00 cmpwi cr7,r16,0 ffc0bcb8: 41 9e 00 a4 beq- cr7,ffc0bd5c <_Heap_Walk+0x440> (*printer)( ffc0bcbc: 7f 03 c3 78 mr r3,r24 ffc0bcc0: 7f 29 03 a6 mtctr r25 ffc0bcc4: 38 80 00 00 li r4,0 ffc0bcc8: 7e a5 ab 78 mr r5,r21 ffc0bccc: 7f a6 eb 78 mr r6,r29 ffc0bcd0: 7f 87 e3 78 mr r7,r28 ffc0bcd4: 4c c6 31 82 crclr 4*cr1+eq ffc0bcd8: 4e 80 04 21 bctrl block->prev_size ); } block = next_block; } while ( block != first_block ); ffc0bcdc: 7f 9a f0 00 cmpw cr7,r26,r30 ffc0bce0: 41 9e 01 68 beq- cr7,ffc0be48 <_Heap_Walk+0x52c> ffc0bce4: 83 9e 00 04 lwz r28,4(r30) ffc0bce8: 7f dd f3 78 mr r29,r30 ffc0bcec: 81 3f 00 20 lwz r9,32(r31) ffc0bcf0: 57 90 07 fe clrlwi r16,r28,31 ffc0bcf4: 4b ff ff 44 b ffc0bc38 <_Heap_Walk+0x31c> ); return false; } if ( block_size < min_block_size && is_not_last_block ) { ffc0bcf8: 7f 8e e0 40 cmplw cr7,r14,r28 ffc0bcfc: 40 9d 00 3c ble- cr7,ffc0bd38 <_Heap_Walk+0x41c> ffc0bd00: 2f 89 00 00 cmpwi cr7,r9,0 ffc0bd04: 41 9e ff a4 beq+ cr7,ffc0bca8 <_Heap_Walk+0x38c> <== NEVER TAKEN (*printer)( ffc0bd08: 3c a0 ff c2 lis r5,-62 ffc0bd0c: 7f 29 03 a6 mtctr r25 ffc0bd10: 7f 03 c3 78 mr r3,r24 ffc0bd14: 38 80 00 01 li r4,1 ffc0bd18: 38 a5 9b 44 addi r5,r5,-25788 ffc0bd1c: 7f a6 eb 78 mr r6,r29 ffc0bd20: 7f 87 e3 78 mr r7,r28 ffc0bd24: 7d c8 73 78 mr r8,r14 ffc0bd28: 4c c6 31 82 crclr 4*cr1+eq ffc0bd2c: 4e 80 04 21 bctrl block, block_size, min_block_size ); return false; ffc0bd30: 38 60 00 00 li r3,0 ffc0bd34: 4b ff fc 78 b ffc0b9ac <_Heap_Walk+0x90> } if ( next_block_begin <= block_begin && is_not_last_block ) { ffc0bd38: 7f 9d f0 40 cmplw cr7,r29,r30 ffc0bd3c: 41 bc ff 6c blt- cr7,ffc0bca8 <_Heap_Walk+0x38c> ffc0bd40: 2f 89 00 00 cmpwi cr7,r9,0 ffc0bd44: 41 9e ff 64 beq+ cr7,ffc0bca8 <_Heap_Walk+0x38c> (*printer)( ffc0bd48: 3c a0 ff c2 lis r5,-62 ffc0bd4c: 7f 03 c3 78 mr r3,r24 ffc0bd50: 38 80 00 01 li r4,1 ffc0bd54: 38 a5 9b 70 addi r5,r5,-25744 ffc0bd58: 4b ff ff 00 b ffc0bc58 <_Heap_Walk+0x33c> "block 0x%08x: size %u\n", block, block_size ); } else { (*printer)( ffc0bd5c: 7f a6 eb 78 mr r6,r29 ffc0bd60: 81 1d 00 00 lwz r8,0(r29) ffc0bd64: 7f 03 c3 78 mr r3,r24 ffc0bd68: 7f 29 03 a6 mtctr r25 ffc0bd6c: 38 80 00 00 li r4,0 ffc0bd70: 7e 85 a3 78 mr r5,r20 ffc0bd74: 7f 87 e3 78 mr r7,r28 ffc0bd78: 4c c6 31 82 crclr 4*cr1+eq ffc0bd7c: 4e 80 04 21 bctrl ffc0bd80: 4b ff ff 5c b ffc0bcdc <_Heap_Walk+0x3c0> 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 ? ffc0bd84: 81 1d 00 0c lwz r8,12(r29) 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)( ffc0bd88: 81 3f 00 08 lwz r9,8(r31) return _Heap_Free_list_head(heap)->next; } RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Free_list_last( Heap_Control *heap ) { return _Heap_Free_list_tail(heap)->prev; ffc0bd8c: 80 ff 00 0c lwz r7,12(r31) ffc0bd90: 7f 89 40 00 cmpw cr7,r9,r8 ffc0bd94: 41 9e 00 f4 beq- cr7,ffc0be88 <_Heap_Walk+0x56c> block, block_size, block->prev, block->prev == first_free_block ? " (= first free)" : (block->prev == free_list_head ? " (= head)" : ""), ffc0bd98: 7f 9f 40 00 cmpw cr7,r31,r8 ffc0bd9c: 41 9e 00 fc beq- cr7,ffc0be98 <_Heap_Walk+0x57c> ffc0bda0: 39 36 9c 14 addi r9,r22,-25580 block->next, block->next == last_free_block ? ffc0bda4: 81 5d 00 08 lwz r10,8(r29) 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)( ffc0bda8: 7f 87 50 00 cmpw cr7,r7,r10 ffc0bdac: 41 9e 00 d4 beq- cr7,ffc0be80 <_Heap_Walk+0x564> " (= first free)" : (block->prev == free_list_head ? " (= head)" : ""), block->next, block->next == last_free_block ? " (= last free)" : (block->next == free_list_tail ? " (= tail)" : "") ffc0bdb0: 7f 9f 50 00 cmpw cr7,r31,r10 ffc0bdb4: 41 9e 00 dc beq- cr7,ffc0be90 <_Heap_Walk+0x574> ffc0bdb8: 38 f6 9c 14 addi r7,r22,-25580 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)( ffc0bdbc: 90 e1 00 08 stw r7,8(r1) ffc0bdc0: 7f 03 c3 78 mr r3,r24 ffc0bdc4: 38 80 00 00 li r4,0 ffc0bdc8: 7f 29 03 a6 mtctr r25 ffc0bdcc: 7e 65 9b 78 mr r5,r19 ffc0bdd0: 7f a6 eb 78 mr r6,r29 ffc0bdd4: 7f 87 e3 78 mr r7,r28 ffc0bdd8: 4c c6 31 82 crclr 4*cr1+eq ffc0bddc: 4e 80 04 21 bctrl block->next == last_free_block ? " (= last free)" : (block->next == free_list_tail ? " (= tail)" : "") ); if ( block_size != next_block->prev_size ) { ffc0bde0: 81 1e 00 00 lwz r8,0(r30) ffc0bde4: 7f 9c 40 00 cmpw cr7,r28,r8 ffc0bde8: 40 9e 00 68 bne- cr7,ffc0be50 <_Heap_Walk+0x534> ); return false; } if ( !prev_used ) { ffc0bdec: 2f 90 00 00 cmpwi cr7,r16,0 ffc0bdf0: 41 9e 00 b4 beq- cr7,ffc0bea4 <_Heap_Walk+0x588> return &heap->free_list; } RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Free_list_first( Heap_Control *heap ) { return _Heap_Free_list_head(heap)->next; ffc0bdf4: 81 3f 00 08 lwz r9,8(r31) ) { 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 ) { ffc0bdf8: 7f 9f 48 00 cmpw cr7,r31,r9 ffc0bdfc: 41 9e 00 24 beq- cr7,ffc0be20 <_Heap_Walk+0x504> <== NEVER TAKEN if ( free_block == block ) { ffc0be00: 7f 9d 48 00 cmpw cr7,r29,r9 ffc0be04: 40 be 00 0c bne+ cr7,ffc0be10 <_Heap_Walk+0x4f4> ffc0be08: 4b ff fe d4 b ffc0bcdc <_Heap_Walk+0x3c0> ffc0be0c: 41 ba fe d0 beq- cr6,ffc0bcdc <_Heap_Walk+0x3c0> return true; } free_block = free_block->next; ffc0be10: 81 29 00 08 lwz r9,8(r9) ) { 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 ) { ffc0be14: 7f 9f 48 00 cmpw cr7,r31,r9 if ( free_block == block ) { ffc0be18: 7f 1d 48 00 cmpw cr6,r29,r9 ) { 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 ) { ffc0be1c: 40 9e ff f0 bne+ cr7,ffc0be0c <_Heap_Walk+0x4f0> return false; } if ( !_Heap_Walk_is_in_free_list( heap, block ) ) { (*printer)( ffc0be20: 3c a0 ff c2 lis r5,-62 ffc0be24: 7f 29 03 a6 mtctr r25 ffc0be28: 7f 03 c3 78 mr r3,r24 ffc0be2c: 38 80 00 01 li r4,1 ffc0be30: 38 a5 9c 88 addi r5,r5,-25464 ffc0be34: 7f a6 eb 78 mr r6,r29 ffc0be38: 4c c6 31 82 crclr 4*cr1+eq ffc0be3c: 4e 80 04 21 bctrl "block 0x%08x: next block 0x%08x is not a successor\n", block, next_block ); return false; ffc0be40: 38 60 00 00 li r3,0 ffc0be44: 4b ff fb 68 b ffc0b9ac <_Heap_Walk+0x90> } block = next_block; } while ( block != first_block ); return true; ffc0be48: 38 60 00 01 li r3,1 ffc0be4c: 4b ff fb 60 b ffc0b9ac <_Heap_Walk+0x90> " (= last free)" : (block->next == free_list_tail ? " (= tail)" : "") ); if ( block_size != next_block->prev_size ) { (*printer)( ffc0be50: 3c a0 ff c2 lis r5,-62 ffc0be54: 7f 29 03 a6 mtctr r25 ffc0be58: 7f 03 c3 78 mr r3,r24 ffc0be5c: 38 80 00 01 li r4,1 ffc0be60: 38 a5 9b dc addi r5,r5,-25636 ffc0be64: 7f a6 eb 78 mr r6,r29 ffc0be68: 7f 87 e3 78 mr r7,r28 ffc0be6c: 7f c9 f3 78 mr r9,r30 ffc0be70: 4c c6 31 82 crclr 4*cr1+eq ffc0be74: 4e 80 04 21 bctrl "block 0x%08x: next block 0x%08x is not a successor\n", block, next_block ); return false; ffc0be78: 38 60 00 00 li r3,0 ffc0be7c: 4b ff fb 30 b ffc0b9ac <_Heap_Walk+0x90> 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)( ffc0be80: 38 f1 98 90 addi r7,r17,-26480 ffc0be84: 4b ff ff 38 b ffc0bdbc <_Heap_Walk+0x4a0> ffc0be88: 39 32 98 74 addi r9,r18,-26508 ffc0be8c: 4b ff ff 18 b ffc0bda4 <_Heap_Walk+0x488> " (= first free)" : (block->prev == free_list_head ? " (= head)" : ""), block->next, block->next == last_free_block ? " (= last free)" : (block->next == free_list_tail ? " (= tail)" : "") ffc0be90: 38 ef 98 a0 addi r7,r15,-26464 ffc0be94: 4b ff ff 28 b ffc0bdbc <_Heap_Walk+0x4a0> block, block_size, block->prev, block->prev == first_free_block ? " (= first free)" : (block->prev == free_list_head ? " (= head)" : ""), ffc0be98: 3d 40 ff c2 lis r10,-62 ffc0be9c: 39 2a 98 84 addi r9,r10,-26492 ffc0bea0: 4b ff ff 04 b ffc0bda4 <_Heap_Walk+0x488> return false; } if ( !prev_used ) { (*printer)( ffc0bea4: 3c a0 ff c2 lis r5,-62 ffc0bea8: 7f 29 03 a6 mtctr r25 ffc0beac: 7f 03 c3 78 mr r3,r24 ffc0beb0: 38 80 00 01 li r4,1 ffc0beb4: 38 a5 9c 18 addi r5,r5,-25576 ffc0beb8: 7f a6 eb 78 mr r6,r29 ffc0bebc: 4c c6 31 82 crclr 4*cr1+eq ffc0bec0: 4e 80 04 21 bctrl "block 0x%08x: next block 0x%08x is not a successor\n", block, next_block ); return false; ffc0bec4: 38 60 00 00 li r3,0 ffc0bec8: 4b ff fa e4 b ffc0b9ac <_Heap_Walk+0x90> return false; } if ( !_Heap_Is_aligned( block_size, page_size ) && is_not_last_block ) { (*printer)( ffc0becc: 3c a0 ff c2 lis r5,-62 ffc0bed0: 7f 29 03 a6 mtctr r25 ffc0bed4: 7f 03 c3 78 mr r3,r24 ffc0bed8: 38 80 00 01 li r4,1 ffc0bedc: 38 a5 9b 14 addi r5,r5,-25836 ffc0bee0: 7f a6 eb 78 mr r6,r29 ffc0bee4: 7f 87 e3 78 mr r7,r28 ffc0bee8: 4c c6 31 82 crclr 4*cr1+eq ffc0beec: 4e 80 04 21 bctrl "block 0x%08x: block size %u not page aligned\n", block, block_size ); return false; ffc0bef0: 38 60 00 00 li r3,0 ffc0bef4: 4b ff fa b8 b ffc0b9ac <_Heap_Walk+0x90> 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; ffc0bef8: 80 bf 00 24 lwz r5,36(r31) ffc0befc: 7f 85 30 40 cmplw cr7,r5,r6 ffc0bf00: 41 bc fc e8 blt- cr7,ffc0bbe8 <_Heap_Walk+0x2cc> <== NEVER TAKEN RTEMS_INLINE_ROUTINE uintptr_t _Heap_Alloc_area_of_block( const Heap_Block *block ) { return (uintptr_t) block + HEAP_BLOCK_HEADER_SIZE; ffc0bf04: 39 46 00 08 addi r10,r6,8 RTEMS_INLINE_ROUTINE bool _Heap_Is_aligned( uintptr_t value, uintptr_t alignment ) { return (value % alignment) == 0; ffc0bf08: 7d 0a 23 96 divwu r8,r10,r4 ffc0bf0c: 7d 08 21 d6 mullw r8,r8,r4 ); return false; } if ( ffc0bf10: 7f 8a 40 00 cmpw cr7,r10,r8 ffc0bf14: 40 9e 00 cc bne- cr7,ffc0bfe0 <_Heap_Walk+0x6c4> <== NEVER TAKEN - 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; ffc0bf18: 81 46 00 04 lwz r10,4(r6) ffc0bf1c: 55 4a 00 3c rlwinm r10,r10,0,0,30 block = next_block; } while ( block != first_block ); return true; } ffc0bf20: 7d 46 52 14 add r10,r6,r10 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; ffc0bf24: 81 4a 00 04 lwz r10,4(r10) ); return false; } if ( _Heap_Is_used( free_block ) ) { ffc0bf28: 71 47 00 01 andi. r7,r10,1 ffc0bf2c: 40 82 00 90 bne- ffc0bfbc <_Heap_Walk+0x6a0> <== NEVER TAKEN ffc0bf30: 7f e8 fb 78 mr r8,r31 ffc0bf34: 7c c3 33 78 mr r3,r6 ffc0bf38: 48 00 00 54 b ffc0bf8c <_Heap_Walk+0x670> return false; } prev_block = free_block; free_block = free_block->next; ffc0bf3c: 80 c6 00 08 lwz r6,8(r6) 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 ) { ffc0bf40: 7f 9f 30 00 cmpw cr7,r31,r6 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; ffc0bf44: 7f 06 48 40 cmplw cr6,r6,r9 ffc0bf48: 7c 86 28 40 cmplw cr1,r6,r5 ffc0bf4c: 41 be fc c0 beq- cr7,ffc0bc0c <_Heap_Walk+0x2f0> ffc0bf50: 41 b8 fc 98 blt- cr6,ffc0bbe8 <_Heap_Walk+0x2cc> RTEMS_INLINE_ROUTINE uintptr_t _Heap_Alloc_area_of_block( const Heap_Block *block ) { return (uintptr_t) block + HEAP_BLOCK_HEADER_SIZE; ffc0bf54: 39 46 00 08 addi r10,r6,8 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; ffc0bf58: 41 a5 fc 90 bgt- cr1,ffc0bbe8 <_Heap_Walk+0x2cc> <== NEVER TAKEN RTEMS_INLINE_ROUTINE bool _Heap_Is_aligned( uintptr_t value, uintptr_t alignment ) { return (value % alignment) == 0; ffc0bf5c: 7c ea 23 96 divwu r7,r10,r4 ffc0bf60: 7c e7 21 d6 mullw r7,r7,r4 ffc0bf64: 7c 68 1b 78 mr r8,r3 ); return false; } if ( ffc0bf68: 7f 8a 38 00 cmpw cr7,r10,r7 ); return false; } if ( _Heap_Is_used( free_block ) ) { ffc0bf6c: 7c c3 33 78 mr r3,r6 ); return false; } if ( ffc0bf70: 40 9e 00 70 bne- cr7,ffc0bfe0 <_Heap_Walk+0x6c4> - 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; ffc0bf74: 81 46 00 04 lwz r10,4(r6) ffc0bf78: 55 4a 00 3c rlwinm r10,r10,0,0,30 block = next_block; } while ( block != first_block ); return true; } ffc0bf7c: 7d 46 52 14 add r10,r6,r10 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; ffc0bf80: 81 4a 00 04 lwz r10,4(r10) ); return false; } if ( _Heap_Is_used( free_block ) ) { ffc0bf84: 71 47 00 01 andi. r7,r10,1 ffc0bf88: 40 82 00 34 bne- ffc0bfbc <_Heap_Walk+0x6a0> ); return false; } if ( free_block->prev != prev_block ) { ffc0bf8c: 80 e6 00 0c lwz r7,12(r6) ffc0bf90: 7f 87 40 00 cmpw cr7,r7,r8 ffc0bf94: 41 9e ff a8 beq+ cr7,ffc0bf3c <_Heap_Walk+0x620> (*printer)( ffc0bf98: 3c a0 ff c2 lis r5,-62 ffc0bf9c: 7f 29 03 a6 mtctr r25 ffc0bfa0: 7f 03 c3 78 mr r3,r24 ffc0bfa4: 38 80 00 01 li r4,1 ffc0bfa8: 38 a5 9a b0 addi r5,r5,-25936 ffc0bfac: 4c c6 31 82 crclr 4*cr1+eq ffc0bfb0: 4e 80 04 21 bctrl "block 0x%08x: next block 0x%08x is not a successor\n", block, next_block ); return false; ffc0bfb4: 38 60 00 00 li r3,0 ffc0bfb8: 4b ff f9 f4 b ffc0b9ac <_Heap_Walk+0x90> return false; } if ( _Heap_Is_used( free_block ) ) { (*printer)( ffc0bfbc: 3c a0 ff c2 lis r5,-62 ffc0bfc0: 7f 29 03 a6 mtctr r25 ffc0bfc4: 7f 03 c3 78 mr r3,r24 ffc0bfc8: 38 80 00 01 li r4,1 ffc0bfcc: 38 a5 9a 94 addi r5,r5,-25964 ffc0bfd0: 4c c6 31 82 crclr 4*cr1+eq ffc0bfd4: 4e 80 04 21 bctrl "block 0x%08x: next block 0x%08x is not a successor\n", block, next_block ); return false; ffc0bfd8: 38 60 00 00 li r3,0 ffc0bfdc: 4b ff f9 d0 b ffc0b9ac <_Heap_Walk+0x90> } if ( !_Heap_Is_aligned( _Heap_Alloc_area_of_block( free_block ), page_size ) ) { (*printer)( ffc0bfe0: 3c a0 ff c2 lis r5,-62 ffc0bfe4: 7f 29 03 a6 mtctr r25 ffc0bfe8: 7f 03 c3 78 mr r3,r24 ffc0bfec: 38 80 00 01 li r4,1 ffc0bff0: 38 a5 9a 64 addi r5,r5,-26012 ffc0bff4: 4c c6 31 82 crclr 4*cr1+eq ffc0bff8: 4e 80 04 21 bctrl "block 0x%08x: next block 0x%08x is not a successor\n", block, next_block ); return false; ffc0bffc: 38 60 00 00 li r3,0 ffc0c000: 4b ff f9 ac b ffc0b9ac <_Heap_Walk+0x90> =============================================================================== ffc0b81c <_Heap_Walk_print>: /* Do nothing */ } static void _Heap_Walk_print( int source, bool error, const char *fmt, ... ) { ffc0b81c: 94 21 ff 88 stwu r1,-120(r1) ffc0b820: 7c 08 02 a6 mflr r0 ffc0b824: 7c 6b 1b 78 mr r11,r3 ffc0b828: 90 01 00 7c stw r0,124(r1) ffc0b82c: 93 e1 00 74 stw r31,116(r1) ffc0b830: 90 c1 00 1c stw r6,28(r1) ffc0b834: 90 e1 00 20 stw r7,32(r1) ffc0b838: 91 01 00 24 stw r8,36(r1) ffc0b83c: 91 21 00 28 stw r9,40(r1) ffc0b840: 91 41 00 2c stw r10,44(r1) ffc0b844: 40 86 00 24 bne- cr1,ffc0b868 <_Heap_Walk_print+0x4c> <== ALWAYS TAKEN ffc0b848: d8 21 00 30 stfd f1,48(r1) <== NOT EXECUTED ffc0b84c: d8 41 00 38 stfd f2,56(r1) <== NOT EXECUTED ffc0b850: d8 61 00 40 stfd f3,64(r1) <== NOT EXECUTED ffc0b854: d8 81 00 48 stfd f4,72(r1) <== NOT EXECUTED ffc0b858: d8 a1 00 50 stfd f5,80(r1) <== NOT EXECUTED ffc0b85c: d8 c1 00 58 stfd f6,88(r1) <== NOT EXECUTED ffc0b860: d8 e1 00 60 stfd f7,96(r1) <== NOT EXECUTED ffc0b864: d9 01 00 68 stfd f8,104(r1) <== NOT EXECUTED va_list ap; if ( error ) { ffc0b868: 2f 84 00 00 cmpwi cr7,r4,0 { /* Do nothing */ } static void _Heap_Walk_print( int source, bool error, const char *fmt, ... ) { ffc0b86c: 7c bf 2b 78 mr r31,r5 va_list ap; if ( error ) { ffc0b870: 40 9e 00 58 bne- cr7,ffc0b8c8 <_Heap_Walk_print+0xac> printk( "FAIL[%d]: ", source ); } else { printk( "PASS[%d]: ", source ); ffc0b874: 3c 60 ff c2 lis r3,-62 ffc0b878: 7d 64 5b 78 mr r4,r11 ffc0b87c: 38 63 98 68 addi r3,r3,-26520 ffc0b880: 4c c6 31 82 crclr 4*cr1+eq ffc0b884: 4b ff a5 ed bl ffc05e70 } va_start( ap, fmt ); ffc0b888: 39 20 00 03 li r9,3 ffc0b88c: 99 21 00 08 stb r9,8(r1) ffc0b890: 39 20 00 00 li r9,0 vprintk( fmt, ap ); ffc0b894: 7f e3 fb 78 mr r3,r31 printk( "FAIL[%d]: ", source ); } else { printk( "PASS[%d]: ", source ); } va_start( ap, fmt ); ffc0b898: 99 21 00 09 stb r9,9(r1) ffc0b89c: 39 21 00 80 addi r9,r1,128 vprintk( fmt, ap ); ffc0b8a0: 38 81 00 08 addi r4,r1,8 printk( "FAIL[%d]: ", source ); } else { printk( "PASS[%d]: ", source ); } va_start( ap, fmt ); ffc0b8a4: 91 21 00 0c stw r9,12(r1) ffc0b8a8: 39 21 00 10 addi r9,r1,16 ffc0b8ac: 91 21 00 10 stw r9,16(r1) vprintk( fmt, ap ); ffc0b8b0: 4b ff d6 e9 bl ffc08f98 va_end( ap ); } ffc0b8b4: 80 01 00 7c lwz r0,124(r1) ffc0b8b8: 83 e1 00 74 lwz r31,116(r1) ffc0b8bc: 7c 08 03 a6 mtlr r0 ffc0b8c0: 38 21 00 78 addi r1,r1,120 ffc0b8c4: 4e 80 00 20 blr static void _Heap_Walk_print( int source, bool error, const char *fmt, ... ) { va_list ap; if ( error ) { printk( "FAIL[%d]: ", source ); ffc0b8c8: 3c 60 ff c2 lis r3,-62 ffc0b8cc: 7d 64 5b 78 mr r4,r11 ffc0b8d0: 38 63 98 5c addi r3,r3,-26532 ffc0b8d4: 4c c6 31 82 crclr 4*cr1+eq ffc0b8d8: 4b ff a5 99 bl ffc05e70 } else { printk( "PASS[%d]: ", source ); } va_start( ap, fmt ); ffc0b8dc: 39 20 00 03 li r9,3 ffc0b8e0: 99 21 00 08 stb r9,8(r1) ffc0b8e4: 39 20 00 00 li r9,0 vprintk( fmt, ap ); ffc0b8e8: 7f e3 fb 78 mr r3,r31 printk( "FAIL[%d]: ", source ); } else { printk( "PASS[%d]: ", source ); } va_start( ap, fmt ); ffc0b8ec: 99 21 00 09 stb r9,9(r1) ffc0b8f0: 39 21 00 80 addi r9,r1,128 vprintk( fmt, ap ); ffc0b8f4: 38 81 00 08 addi r4,r1,8 printk( "FAIL[%d]: ", source ); } else { printk( "PASS[%d]: ", source ); } va_start( ap, fmt ); ffc0b8f8: 91 21 00 0c stw r9,12(r1) ffc0b8fc: 39 21 00 10 addi r9,r1,16 ffc0b900: 91 21 00 10 stw r9,16(r1) vprintk( fmt, ap ); ffc0b904: 4b ff d6 95 bl ffc08f98 va_end( ap ); } ffc0b908: 80 01 00 7c lwz r0,124(r1) ffc0b90c: 83 e1 00 74 lwz r31,116(r1) ffc0b910: 7c 08 03 a6 mtlr r0 ffc0b914: 38 21 00 78 addi r1,r1,120 ffc0b918: 4e 80 00 20 blr =============================================================================== ffc0a4c8 <_IO_Initialize_all_drivers>: void _IO_Initialize_all_drivers( void ) { ffc0a4c8: 94 21 ff f0 stwu r1,-16(r1) ffc0a4cc: 7c 08 02 a6 mflr r0 ffc0a4d0: 93 c1 00 08 stw r30,8(r1) rtems_device_major_number major; for ( major=0 ; major < _IO_Number_of_drivers ; major ++ ) ffc0a4d4: 3f c0 00 00 lis r30,0 ffc0a4d8: 81 3e 28 5c lwz r9,10332(r30) for ( index = 0 ; index < drivers_in_table ; index++ ) _IO_Driver_address_table[index] = driver_table[index]; } void _IO_Initialize_all_drivers( void ) { ffc0a4dc: 90 01 00 14 stw r0,20(r1) rtems_device_major_number major; for ( major=0 ; major < _IO_Number_of_drivers ; major ++ ) ffc0a4e0: 2f 89 00 00 cmpwi cr7,r9,0 for ( index = 0 ; index < drivers_in_table ; index++ ) _IO_Driver_address_table[index] = driver_table[index]; } void _IO_Initialize_all_drivers( void ) { ffc0a4e4: 93 e1 00 0c stw r31,12(r1) rtems_device_major_number major; for ( major=0 ; major < _IO_Number_of_drivers ; major ++ ) ffc0a4e8: 41 9e 00 2c beq- cr7,ffc0a514 <_IO_Initialize_all_drivers+0x4c><== NEVER TAKEN ffc0a4ec: 3b e0 00 00 li r31,0 ffc0a4f0: 3b de 28 5c addi r30,r30,10332 (void) rtems_io_initialize( major, 0, NULL ); ffc0a4f4: 7f e3 fb 78 mr r3,r31 ffc0a4f8: 38 80 00 00 li r4,0 ffc0a4fc: 38 a0 00 00 li r5,0 ffc0a500: 48 00 57 0d bl ffc0fc0c void _IO_Initialize_all_drivers( void ) { rtems_device_major_number major; for ( major=0 ; major < _IO_Number_of_drivers ; major ++ ) ffc0a504: 81 3e 00 00 lwz r9,0(r30) ffc0a508: 3b ff 00 01 addi r31,r31,1 ffc0a50c: 7f 89 f8 40 cmplw cr7,r9,r31 ffc0a510: 41 9d ff e4 bgt+ cr7,ffc0a4f4 <_IO_Initialize_all_drivers+0x2c> (void) rtems_io_initialize( major, 0, NULL ); } ffc0a514: 80 01 00 14 lwz r0,20(r1) ffc0a518: 83 c1 00 08 lwz r30,8(r1) ffc0a51c: 7c 08 03 a6 mtlr r0 ffc0a520: 83 e1 00 0c lwz r31,12(r1) ffc0a524: 38 21 00 10 addi r1,r1,16 ffc0a528: 4e 80 00 20 blr =============================================================================== ffc0a3b4 <_IO_Manager_initialization>: #include #include void _IO_Manager_initialization(void) { ffc0a3b4: 94 21 ff e0 stwu r1,-32(r1) uint32_t index; rtems_driver_address_table *driver_table; uint32_t drivers_in_table; uint32_t number_of_drivers; driver_table = rtems_configuration_get_device_driver_table(); ffc0a3b8: 3d 20 ff c2 lis r9,-62 ffc0a3bc: 39 29 d5 38 addi r9,r9,-10952 #include #include void _IO_Manager_initialization(void) { ffc0a3c0: 7c 08 02 a6 mflr r0 ffc0a3c4: 93 a1 00 14 stw r29,20(r1) ffc0a3c8: 93 c1 00 18 stw r30,24(r1) uint32_t drivers_in_table; uint32_t number_of_drivers; driver_table = rtems_configuration_get_device_driver_table(); drivers_in_table = rtems_configuration_get_number_of_device_drivers(); number_of_drivers = rtems_configuration_get_maximum_drivers(); ffc0a3cc: 83 a9 00 34 lwz r29,52(r9) rtems_driver_address_table *driver_table; uint32_t drivers_in_table; uint32_t number_of_drivers; driver_table = rtems_configuration_get_device_driver_table(); drivers_in_table = rtems_configuration_get_number_of_device_drivers(); ffc0a3d0: 83 c9 00 38 lwz r30,56(r9) #include #include void _IO_Manager_initialization(void) { ffc0a3d4: 93 e1 00 1c stw r31,28(r1) /* * If the user claims there are less drivers than are actually in * the table, then let's just go with the table's count. */ if ( number_of_drivers <= drivers_in_table ) ffc0a3d8: 7f 9e e8 40 cmplw cr7,r30,r29 #include #include void _IO_Manager_initialization(void) { ffc0a3dc: 90 01 00 24 stw r0,36(r1) ffc0a3e0: 93 61 00 0c stw r27,12(r1) ffc0a3e4: 93 81 00 10 stw r28,16(r1) uint32_t index; rtems_driver_address_table *driver_table; uint32_t drivers_in_table; uint32_t number_of_drivers; driver_table = rtems_configuration_get_device_driver_table(); ffc0a3e8: 83 e9 00 3c lwz r31,60(r9) /* * If the user claims there are less drivers than are actually in * the table, then let's just go with the table's count. */ if ( number_of_drivers <= drivers_in_table ) ffc0a3ec: 40 9c 00 a8 bge- cr7,ffc0a494 <_IO_Manager_initialization+0xe0> * have to allocate a new driver table and copy theirs to it. */ _IO_Driver_address_table = (rtems_driver_address_table *) _Workspace_Allocate_or_fatal_error( sizeof( rtems_driver_address_table ) * ( number_of_drivers ) ffc0a3f0: 1f 7d 00 18 mulli r27,r29,24 * The application requested extra slots in the driver table, so we * have to allocate a new driver table and copy theirs to it. */ _IO_Driver_address_table = (rtems_driver_address_table *) _Workspace_Allocate_or_fatal_error( ffc0a3f4: 7f 63 db 78 mr r3,r27 ffc0a3f8: 48 00 3a e9 bl ffc0dee0 <_Workspace_Allocate_or_fatal_error> /* * The application requested extra slots in the driver table, so we * have to allocate a new driver table and copy theirs to it. */ _IO_Driver_address_table = (rtems_driver_address_table *) ffc0a3fc: 3f 80 00 00 lis r28,0 _Workspace_Allocate_or_fatal_error( sizeof( rtems_driver_address_table ) * ( number_of_drivers ) ); _IO_Number_of_drivers = number_of_drivers; ffc0a400: 3d 20 00 00 lis r9,0 /* * The application requested extra slots in the driver table, so we * have to allocate a new driver table and copy theirs to it. */ _IO_Driver_address_table = (rtems_driver_address_table *) ffc0a404: 90 7c 28 60 stw r3,10336(r28) _Workspace_Allocate_or_fatal_error( sizeof( rtems_driver_address_table ) * ( number_of_drivers ) ); _IO_Number_of_drivers = number_of_drivers; memset( ffc0a408: 38 80 00 00 li r4,0 ffc0a40c: 7f 65 db 78 mr r5,r27 _IO_Driver_address_table = (rtems_driver_address_table *) _Workspace_Allocate_or_fatal_error( sizeof( rtems_driver_address_table ) * ( number_of_drivers ) ); _IO_Number_of_drivers = number_of_drivers; ffc0a410: 93 a9 28 5c stw r29,10332(r9) memset( ffc0a414: 48 00 8a 5d bl ffc12e70 _IO_Driver_address_table, 0, sizeof( rtems_driver_address_table ) * ( number_of_drivers ) ); for ( index = 0 ; index < drivers_in_table ; index++ ) ffc0a418: 2f 9e 00 00 cmpwi cr7,r30,0 ffc0a41c: 41 9e 00 54 beq- cr7,ffc0a470 <_IO_Manager_initialization+0xbc><== NEVER TAKEN ffc0a420: 80 fc 28 60 lwz r7,10336(r28) #include #include #include void _IO_Manager_initialization(void) ffc0a424: 1d 7e 00 18 mulli r11,r30,24 ffc0a428: 39 00 00 00 li r8,0 _IO_Driver_address_table, 0, sizeof( rtems_driver_address_table ) * ( number_of_drivers ) ); for ( index = 0 ; index < drivers_in_table ; index++ ) _IO_Driver_address_table[index] = driver_table[index]; ffc0a42c: 7f e9 fb 78 mr r9,r31 ffc0a430: 7c 69 40 6e lwzux r3,r9,r8 ffc0a434: 7d 47 42 14 add r10,r7,r8 ffc0a438: 80 c9 00 0c lwz r6,12(r9) ffc0a43c: 80 89 00 04 lwz r4,4(r9) ffc0a440: 80 a9 00 08 lwz r5,8(r9) ffc0a444: 7c 67 41 2e stwx r3,r7,r8 ffc0a448: 39 08 00 18 addi r8,r8,24 memset( _IO_Driver_address_table, 0, sizeof( rtems_driver_address_table ) * ( number_of_drivers ) ); for ( index = 0 ; index < drivers_in_table ; index++ ) ffc0a44c: 7f 88 58 00 cmpw cr7,r8,r11 _IO_Driver_address_table[index] = driver_table[index]; ffc0a450: 90 8a 00 04 stw r4,4(r10) ffc0a454: 90 aa 00 08 stw r5,8(r10) ffc0a458: 90 ca 00 0c stw r6,12(r10) ffc0a45c: 80 c9 00 10 lwz r6,16(r9) ffc0a460: 81 29 00 14 lwz r9,20(r9) ffc0a464: 90 ca 00 10 stw r6,16(r10) ffc0a468: 91 2a 00 14 stw r9,20(r10) memset( _IO_Driver_address_table, 0, sizeof( rtems_driver_address_table ) * ( number_of_drivers ) ); for ( index = 0 ; index < drivers_in_table ; index++ ) ffc0a46c: 40 9e ff c0 bne+ cr7,ffc0a42c <_IO_Manager_initialization+0x78> _IO_Driver_address_table[index] = driver_table[index]; } ffc0a470: 80 01 00 24 lwz r0,36(r1) ffc0a474: 83 61 00 0c lwz r27,12(r1) ffc0a478: 7c 08 03 a6 mtlr r0 ffc0a47c: 83 81 00 10 lwz r28,16(r1) ffc0a480: 83 a1 00 14 lwz r29,20(r1) ffc0a484: 83 c1 00 18 lwz r30,24(r1) ffc0a488: 83 e1 00 1c lwz r31,28(r1) ffc0a48c: 38 21 00 20 addi r1,r1,32 ffc0a490: 4e 80 00 20 blr ffc0a494: 80 01 00 24 lwz r0,36(r1) * If the maximum number of driver is the same as the number in the * table, then we do not have to copy the driver table. They can't * register any dynamically. */ if ( number_of_drivers == drivers_in_table ) { _IO_Driver_address_table = driver_table; ffc0a498: 3d 20 00 00 lis r9,0 ffc0a49c: 93 e9 28 60 stw r31,10336(r9) _IO_Number_of_drivers = number_of_drivers; ffc0a4a0: 3d 20 00 00 lis r9,0 sizeof( rtems_driver_address_table ) * ( number_of_drivers ) ); for ( index = 0 ; index < drivers_in_table ; index++ ) _IO_Driver_address_table[index] = driver_table[index]; } ffc0a4a4: 7c 08 03 a6 mtlr r0 ffc0a4a8: 83 61 00 0c lwz r27,12(r1) ffc0a4ac: 83 81 00 10 lwz r28,16(r1) ffc0a4b0: 83 a1 00 14 lwz r29,20(r1) ffc0a4b4: 83 e1 00 1c lwz r31,28(r1) * table, then we do not have to copy the driver table. They can't * register any dynamically. */ if ( number_of_drivers == drivers_in_table ) { _IO_Driver_address_table = driver_table; _IO_Number_of_drivers = number_of_drivers; ffc0a4b8: 93 c9 28 5c stw r30,10332(r9) sizeof( rtems_driver_address_table ) * ( number_of_drivers ) ); for ( index = 0 ; index < drivers_in_table ; index++ ) _IO_Driver_address_table[index] = driver_table[index]; } ffc0a4bc: 83 c1 00 18 lwz r30,24(r1) ffc0a4c0: 38 21 00 20 addi r1,r1,32 ffc0a4c4: 4e 80 00 20 blr =============================================================================== ffc0b318 <_Internal_error_Occurred>: void _Internal_error_Occurred( Internal_errors_Source the_source, bool is_internal, Internal_errors_t the_error ) { ffc0b318: 94 21 ff d8 stwu r1,-40(r1) ffc0b31c: 7c 08 02 a6 mflr r0 ffc0b320: 93 e1 00 24 stw r31,36(r1) ffc0b324: 7c 9f 23 78 mr r31,r4 Internal_errors_t error ) { User_extensions_Fatal_context ctx = { source, is_internal, error }; _User_extensions_Iterate( &ctx, _User_extensions_Fatal_visitor ); ffc0b328: 3c 80 ff c1 lis r4,-63 ffc0b32c: 93 c1 00 20 stw r30,32(r1) ffc0b330: 38 84 d8 34 addi r4,r4,-10188 ffc0b334: 7c 7e 1b 78 mr r30,r3 ffc0b338: 38 61 00 08 addi r3,r1,8 ffc0b33c: 93 a1 00 1c stw r29,28(r1) ffc0b340: 7c bd 2b 78 mr r29,r5 ffc0b344: 90 01 00 2c stw r0,44(r1) Internal_errors_Source source, bool is_internal, Internal_errors_t error ) { User_extensions_Fatal_context ctx = { source, is_internal, error }; ffc0b348: 93 c1 00 08 stw r30,8(r1) ffc0b34c: 9b e1 00 0c stb r31,12(r1) ffc0b350: 90 a1 00 10 stw r5,16(r1) _User_extensions_Iterate( &ctx, _User_extensions_Fatal_visitor ); ffc0b354: 48 00 25 05 bl ffc0d858 <_User_extensions_Iterate> _User_extensions_Fatal( the_source, is_internal, the_error ); _Internal_errors_What_happened.the_source = the_source; ffc0b358: 3d 40 00 00 lis r10,0 ffc0b35c: 39 2a 2d ec addi r9,r10,11756 ffc0b360: 93 ca 2d ec stw r30,11756(r10) _Internal_errors_What_happened.is_internal = is_internal; _Internal_errors_What_happened.the_error = the_error; _System_state_Set( SYSTEM_STATE_FAILED ); _CPU_Fatal_halt( the_error ); ffc0b364: 7f a3 eb 78 mr r3,r29 ) { _User_extensions_Fatal( the_source, is_internal, the_error ); _Internal_errors_What_happened.the_source = the_source; _Internal_errors_What_happened.is_internal = is_internal; ffc0b368: 9b e9 00 04 stb r31,4(r9) RTEMS_INLINE_ROUTINE void _System_state_Set ( System_state_Codes state ) { _System_state_Current = state; ffc0b36c: 39 40 00 05 li r10,5 _Internal_errors_What_happened.the_error = the_error; ffc0b370: 93 a9 00 08 stw r29,8(r9) ffc0b374: 3d 20 00 00 lis r9,0 ffc0b378: 91 49 28 4c stw r10,10316(r9) _System_state_Set( SYSTEM_STATE_FAILED ); _CPU_Fatal_halt( the_error ); ffc0b37c: 4b ff 88 8d bl ffc03c08 <_BSP_Fatal_error> ffc0b380: 48 00 00 00 b ffc0b380 <_Internal_error_Occurred+0x68><== NOT EXECUTED =============================================================================== ffc0b398 <_Objects_Allocate>: #endif Objects_Control *_Objects_Allocate( Objects_Information *information ) { ffc0b398: 94 21 ff f0 stwu r1,-16(r1) ffc0b39c: 7c 08 02 a6 mflr r0 ffc0b3a0: 90 01 00 14 stw r0,20(r1) * 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 ) ffc0b3a4: 81 23 00 18 lwz r9,24(r3) #endif Objects_Control *_Objects_Allocate( Objects_Information *information ) { ffc0b3a8: 93 e1 00 0c stw r31,12(r1) ffc0b3ac: 7c 7f 1b 78 mr r31,r3 * 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 ) ffc0b3b0: 2f 89 00 00 cmpwi cr7,r9,0 #endif Objects_Control *_Objects_Allocate( Objects_Information *information ) { ffc0b3b4: 93 c1 00 08 stw r30,8(r1) * 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 ) ffc0b3b8: 41 9e 00 88 beq- cr7,ffc0b440 <_Objects_Allocate+0xa8> <== NEVER TAKEN /* * 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 ); ffc0b3bc: 3b c3 00 20 addi r30,r3,32 ffc0b3c0: 7f c3 f3 78 mr r3,r30 ffc0b3c4: 4b ff f3 e1 bl ffc0a7a4 <_Chain_Get> if ( information->auto_extend ) { ffc0b3c8: 89 3f 00 12 lbz r9,18(r31) ffc0b3cc: 2f 89 00 00 cmpwi cr7,r9,0 ffc0b3d0: 41 9e 00 40 beq- cr7,ffc0b410 <_Objects_Allocate+0x78> /* * If the list is empty then we are out of objects and need to * extend information base. */ if ( !the_object ) { ffc0b3d4: 2f 83 00 00 cmpwi cr7,r3,0 ffc0b3d8: 41 9e 00 50 beq- cr7,ffc0b428 <_Objects_Allocate+0x90> } if ( the_object ) { uint32_t block; block = (uint32_t) _Objects_Get_index( the_object->id ) - ffc0b3dc: a1 03 00 0a lhz r8,10(r3) ffc0b3e0: a1 3f 00 0a lhz r9,10(r31) _Objects_Get_index( information->minimum_id ); block /= information->allocation_size; ffc0b3e4: a1 5f 00 14 lhz r10,20(r31) } if ( the_object ) { uint32_t block; block = (uint32_t) _Objects_Get_index( the_object->id ) - ffc0b3e8: 7d 29 40 50 subf r9,r9,r8 _Objects_Get_index( information->minimum_id ); block /= information->allocation_size; information->inactive_per_block[ block ]--; information->inactive--; ffc0b3ec: a0 ff 00 2c lhz r7,44(r31) if ( the_object ) { uint32_t block; block = (uint32_t) _Objects_Get_index( the_object->id ) - _Objects_Get_index( information->minimum_id ); block /= information->allocation_size; ffc0b3f0: 7d 29 53 96 divwu r9,r9,r10 information->inactive_per_block[ block ]--; ffc0b3f4: 81 5f 00 30 lwz r10,48(r31) ffc0b3f8: 55 29 10 3a rlwinm r9,r9,2,0,29 ffc0b3fc: 7d 0a 48 2e lwzx r8,r10,r9 information->inactive--; ffc0b400: 38 e7 ff ff addi r7,r7,-1 block = (uint32_t) _Objects_Get_index( the_object->id ) - _Objects_Get_index( information->minimum_id ); block /= information->allocation_size; information->inactive_per_block[ block ]--; ffc0b404: 39 08 ff ff addi r8,r8,-1 ffc0b408: 7d 0a 49 2e stwx r8,r10,r9 information->inactive--; ffc0b40c: b0 ff 00 2c sth r7,44(r31) ); } #endif return the_object; } ffc0b410: 80 01 00 14 lwz r0,20(r1) ffc0b414: 83 c1 00 08 lwz r30,8(r1) ffc0b418: 7c 08 03 a6 mtlr r0 ffc0b41c: 83 e1 00 0c lwz r31,12(r1) ffc0b420: 38 21 00 10 addi r1,r1,16 ffc0b424: 4e 80 00 20 blr * If the list is empty then we are out of objects and need to * extend information base. */ if ( !the_object ) { _Objects_Extend_information( information ); ffc0b428: 7f e3 fb 78 mr r3,r31 ffc0b42c: 48 00 00 49 bl ffc0b474 <_Objects_Extend_information> the_object = (Objects_Control *) _Chain_Get( &information->Inactive ); ffc0b430: 7f c3 f3 78 mr r3,r30 ffc0b434: 4b ff f3 71 bl ffc0a7a4 <_Chain_Get> } if ( the_object ) { ffc0b438: 2c 03 00 00 cmpwi r3,0 ffc0b43c: 40 a2 ff a0 bne- ffc0b3dc <_Objects_Allocate+0x44> ); } #endif return the_object; } ffc0b440: 80 01 00 14 lwz r0,20(r1) * 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 ) return NULL; ffc0b444: 38 60 00 00 li r3,0 ); } #endif return the_object; } ffc0b448: 83 c1 00 08 lwz r30,8(r1) ffc0b44c: 7c 08 03 a6 mtlr r0 ffc0b450: 83 e1 00 0c lwz r31,12(r1) ffc0b454: 38 21 00 10 addi r1,r1,16 ffc0b458: 4e 80 00 20 blr =============================================================================== ffc0b474 <_Objects_Extend_information>: */ void _Objects_Extend_information( Objects_Information *information ) { ffc0b474: 94 21 ff c0 stwu r1,-64(r1) ffc0b478: 7c 08 02 a6 mflr r0 ffc0b47c: 90 01 00 44 stw r0,68(r1) minimum_index = _Objects_Get_index( information->minimum_id ); index_base = minimum_index; block = 0; /* if ( information->maximum < minimum_index ) */ if ( information->object_blocks == NULL ) ffc0b480: 81 23 00 34 lwz r9,52(r3) */ void _Objects_Extend_information( Objects_Information *information ) { ffc0b484: 93 41 00 28 stw r26,40(r1) minimum_index = _Objects_Get_index( information->minimum_id ); index_base = minimum_index; block = 0; /* if ( information->maximum < minimum_index ) */ if ( information->object_blocks == NULL ) ffc0b488: 2f 89 00 00 cmpwi cr7,r9,0 */ void _Objects_Extend_information( Objects_Information *information ) { ffc0b48c: 93 61 00 2c stw r27,44(r1) ffc0b490: 93 e1 00 3c stw r31,60(r1) ffc0b494: 7c 7f 1b 78 mr r31,r3 ffc0b498: 92 c1 00 18 stw r22,24(r1) ffc0b49c: 92 e1 00 1c stw r23,28(r1) ffc0b4a0: 93 01 00 20 stw r24,32(r1) ffc0b4a4: 93 21 00 24 stw r25,36(r1) ffc0b4a8: 93 81 00 30 stw r28,48(r1) ffc0b4ac: 93 a1 00 34 stw r29,52(r1) ffc0b4b0: 93 c1 00 38 stw r30,56(r1) /* * Search for a free block of indexes. If we do NOT need to allocate or * extend the block table, then we will change do_extend. */ do_extend = true; minimum_index = _Objects_Get_index( information->minimum_id ); ffc0b4b4: a3 63 00 0a lhz r27,10(r3) ffc0b4b8: a3 43 00 10 lhz r26,16(r3) index_base = minimum_index; block = 0; /* if ( information->maximum < minimum_index ) */ if ( information->object_blocks == NULL ) ffc0b4bc: 41 9e 02 74 beq- cr7,ffc0b730 <_Objects_Extend_information+0x2bc> block_count = 0; else { block_count = information->maximum / information->allocation_size; ffc0b4c0: a1 03 00 14 lhz r8,20(r3) ffc0b4c4: 7f 9a 43 96 divwu r28,r26,r8 for ( ; block < block_count; block++ ) { ffc0b4c8: 2f 9c 00 00 cmpwi cr7,r28,0 ffc0b4cc: 41 9e 02 bc beq- cr7,ffc0b788 <_Objects_Extend_information+0x314><== NEVER TAKEN if ( information->object_blocks[ block ] == NULL ) { ffc0b4d0: 81 49 00 00 lwz r10,0(r9) ffc0b4d4: 7d 07 43 78 mr r7,r8 /* * Search for a free block of indexes. If we do NOT need to allocate or * extend the block table, then we will change do_extend. */ do_extend = true; minimum_index = _Objects_Get_index( information->minimum_id ); ffc0b4d8: 7f 7e db 78 mr r30,r27 block_count = 0; else { block_count = information->maximum / information->allocation_size; for ( ; block < block_count; block++ ) { if ( information->object_blocks[ block ] == NULL ) { ffc0b4dc: 2f 8a 00 00 cmpwi cr7,r10,0 ffc0b4e0: 41 9e 02 bc beq- cr7,ffc0b79c <_Objects_Extend_information+0x328><== NEVER TAKEN * extend the block table, then we will change do_extend. */ do_extend = true; minimum_index = _Objects_Get_index( information->minimum_id ); index_base = minimum_index; block = 0; ffc0b4e4: 3b a0 00 00 li r29,0 ffc0b4e8: 7f 89 03 a6 mtctr r28 ffc0b4ec: 48 00 00 10 b ffc0b4fc <_Objects_Extend_information+0x88> block_count = 0; else { block_count = information->maximum / information->allocation_size; for ( ; block < block_count; block++ ) { if ( information->object_blocks[ block ] == NULL ) { ffc0b4f0: 85 49 00 04 lwzu r10,4(r9) ffc0b4f4: 2f 8a 00 00 cmpwi cr7,r10,0 ffc0b4f8: 41 9e 02 0c beq- cr7,ffc0b704 <_Objects_Extend_information+0x290> do_extend = false; break; } else index_base += information->allocation_size; ffc0b4fc: 7f de 42 14 add r30,r30,r8 if ( information->object_blocks == NULL ) block_count = 0; else { block_count = information->maximum / information->allocation_size; for ( ; block < block_count; block++ ) { ffc0b500: 3b bd 00 01 addi r29,r29,1 ffc0b504: 42 00 ff ec bdnz+ ffc0b4f0 <_Objects_Extend_information+0x7c> /* * Search for a free block of indexes. If we do NOT need to allocate or * extend the block table, then we will change do_extend. */ do_extend = true; ffc0b508: 3b 20 00 01 li r25,1 } else index_base += information->allocation_size; } } maximum = (uint32_t) information->maximum + information->allocation_size; ffc0b50c: 7f 5a 3a 14 add r26,r26,r7 /* * We need to limit the number of objects to the maximum number * representable in the index portion of the object Id. In the * case of 16-bit Ids, this is only 256 object instances. */ if ( maximum > OBJECTS_ID_FINAL_INDEX ) { ffc0b510: 2b 9a ff ff cmplwi cr7,r26,65535 ffc0b514: 41 9d 01 b8 bgt- cr7,ffc0b6cc <_Objects_Extend_information+0x258> /* * Allocate the name table, and the objects and if it fails either return or * generate a fatal error depending on auto-extending being active. */ block_size = information->allocation_size * information->size; if ( information->auto_extend ) { ffc0b518: 89 3f 00 12 lbz r9,18(r31) /* * Allocate the name table, and the objects and if it fails either return or * generate a fatal error depending on auto-extending being active. */ block_size = information->allocation_size * information->size; ffc0b51c: 80 7f 00 18 lwz r3,24(r31) if ( information->auto_extend ) { ffc0b520: 2f 89 00 00 cmpwi cr7,r9,0 /* * Allocate the name table, and the objects and if it fails either return or * generate a fatal error depending on auto-extending being active. */ block_size = information->allocation_size * information->size; ffc0b524: 7c 67 19 d6 mullw r3,r7,r3 if ( information->auto_extend ) { ffc0b528: 41 9e 01 e4 beq- cr7,ffc0b70c <_Objects_Extend_information+0x298> new_object_block = _Workspace_Allocate( block_size ); ffc0b52c: 48 00 29 8d bl ffc0deb8 <_Workspace_Allocate> if ( !new_object_block ) ffc0b530: 7c 77 1b 79 mr. r23,r3 ffc0b534: 41 82 01 98 beq- ffc0b6cc <_Objects_Extend_information+0x258> } /* * Do we need to grow the tables? */ if ( do_extend ) { ffc0b538: 2f 99 00 00 cmpwi cr7,r25,0 ffc0b53c: 41 9e 01 0c beq- cr7,ffc0b648 <_Objects_Extend_information+0x1d4> * Allocate the tables and break it up. */ block_size = block_count * (sizeof(void *) + sizeof(uint32_t) + sizeof(Objects_Name *)) + ((maximum + minimum_index) * sizeof(Objects_Control *)); if ( information->auto_extend ) { ffc0b540: 89 3f 00 12 lbz r9,18(r31) */ /* * Up the block count and maximum */ block_count++; ffc0b544: 3a dc 00 01 addi r22,r28,1 /* * Allocate the tables and break it up. */ block_size = block_count * (sizeof(void *) + sizeof(uint32_t) + sizeof(Objects_Name *)) + ffc0b548: 1c 76 00 03 mulli r3,r22,3 ((maximum + minimum_index) * sizeof(Objects_Control *)); if ( information->auto_extend ) { ffc0b54c: 2f 89 00 00 cmpwi cr7,r9,0 /* * Allocate the tables and break it up. */ block_size = block_count * (sizeof(void *) + sizeof(uint32_t) + sizeof(Objects_Name *)) + ((maximum + minimum_index) * sizeof(Objects_Control *)); ffc0b550: 7c 7a 1a 14 add r3,r26,r3 /* * Allocate the tables and break it up. */ block_size = block_count * (sizeof(void *) + sizeof(uint32_t) + sizeof(Objects_Name *)) + ffc0b554: 7c 63 da 14 add r3,r3,r27 block_count++; /* * Allocate the tables and break it up. */ block_size = block_count * ffc0b558: 54 63 10 3a rlwinm r3,r3,2,0,29 (sizeof(void *) + sizeof(uint32_t) + sizeof(Objects_Name *)) + ((maximum + minimum_index) * sizeof(Objects_Control *)); if ( information->auto_extend ) { ffc0b55c: 40 9e 01 bc bne- cr7,ffc0b718 <_Objects_Extend_information+0x2a4> if ( !object_blocks ) { _Workspace_Free( new_object_block ); return; } } else { object_blocks = _Workspace_Allocate_or_fatal_error( block_size ); ffc0b560: 48 00 29 81 bl ffc0dee0 <_Workspace_Allocate_or_fatal_error> ffc0b564: 7c 79 1b 78 mr r25,r3 * Take the block count down. Saves all the (block_count - 1) * in the copies. */ block_count--; if ( information->maximum > minimum_index ) { ffc0b568: a1 3f 00 10 lhz r9,16(r31) /* * Break the block into the various sections. */ inactive_per_block = (uint32_t *) _Addresses_Add_offset( object_blocks, block_count * sizeof(void*) ); ffc0b56c: 56 d6 10 3a rlwinm r22,r22,2,0,29 RTEMS_INLINE_ROUTINE void *_Addresses_Add_offset ( const void *base, uintptr_t offset ) { return (void *)((uintptr_t)base + offset); ffc0b570: 7f 19 b2 14 add r24,r25,r22 * Take the block count down. Saves all the (block_count - 1) * in the copies. */ block_count--; if ( information->maximum > minimum_index ) { ffc0b574: 7f 9b 48 40 cmplw cr7,r27,r9 ffc0b578: 7e d8 b2 14 add r22,r24,r22 ffc0b57c: 41 9c 01 cc blt- cr7,ffc0b748 <_Objects_Extend_information+0x2d4> } else { /* * Deal with the special case of the 0 to minimum_index */ for ( index = 0; index < minimum_index; index++ ) { ffc0b580: 2f 9b 00 00 cmpwi cr7,r27,0 ffc0b584: 41 9e 00 28 beq- cr7,ffc0b5ac <_Objects_Extend_information+0x138><== NEVER TAKEN local_table[ index ] = NULL; ffc0b588: 57 68 10 3a rlwinm r8,r27,2,0,29 ffc0b58c: 39 08 ff fc addi r8,r8,-4 ffc0b590: 55 08 f0 be rlwinm r8,r8,30,2,31 ffc0b594: 39 08 00 01 addi r8,r8,1 ffc0b598: 7d 09 03 a6 mtctr r8 * information - object information table * * Output parameters: NONE */ void _Objects_Extend_information( ffc0b59c: 39 36 ff fc addi r9,r22,-4 /* * Deal with the special case of the 0 to minimum_index */ for ( index = 0; index < minimum_index; index++ ) { local_table[ index ] = NULL; ffc0b5a0: 39 40 00 00 li r10,0 ffc0b5a4: 95 49 00 04 stwu r10,4(r9) } else { /* * Deal with the special case of the 0 to minimum_index */ for ( index = 0; index < minimum_index; index++ ) { ffc0b5a8: 42 00 ff fc bdnz+ ffc0b5a4 <_Objects_Extend_information+0x130> ffc0b5ac: 57 9c 10 3a rlwinm r28,r28,2,0,29 */ object_blocks[block_count] = NULL; inactive_per_block[block_count] = 0; for ( index=index_base ; index < ( information->allocation_size + index_base ); ffc0b5b0: a1 5f 00 14 lhz r10,20(r31) } /* * Initialise the new entries in the table. */ object_blocks[block_count] = NULL; ffc0b5b4: 39 20 00 00 li r9,0 ffc0b5b8: 7d 39 e1 2e stwx r9,r25,r28 inactive_per_block[block_count] = 0; for ( index=index_base ; index < ( information->allocation_size + index_base ); ffc0b5bc: 7d 1e 52 14 add r8,r30,r10 * Initialise the new entries in the table. */ object_blocks[block_count] = NULL; inactive_per_block[block_count] = 0; for ( index=index_base ; ffc0b5c0: 7f 9e 40 40 cmplw cr7,r30,r8 /* * Initialise the new entries in the table. */ object_blocks[block_count] = NULL; inactive_per_block[block_count] = 0; ffc0b5c4: 7d 38 e1 2e stwx r9,r24,r28 for ( index=index_base ; ffc0b5c8: 40 9c 00 34 bge- cr7,ffc0b5fc <_Objects_Extend_information+0x188><== NEVER TAKEN * information - object information table * * Output parameters: NONE */ void _Objects_Extend_information( ffc0b5cc: 55 47 10 3a rlwinm r7,r10,2,0,29 inactive_per_block[block_count] = 0; for ( index=index_base ; index < ( information->allocation_size + index_base ); index++ ) { local_table[ index ] = NULL; ffc0b5d0: 38 e7 ff fc addi r7,r7,-4 ffc0b5d4: 54 e7 f0 be rlwinm r7,r7,30,2,31 ffc0b5d8: 38 e7 00 01 addi r7,r7,1 ffc0b5dc: 7c e9 03 a6 mtctr r7 * information - object information table * * Output parameters: NONE */ void _Objects_Extend_information( ffc0b5e0: 57 c8 10 3a rlwinm r8,r30,2,0,29 ffc0b5e4: 7d 16 42 14 add r8,r22,r8 ffc0b5e8: 39 20 00 00 li r9,0 inactive_per_block[block_count] = 0; for ( index=index_base ; index < ( information->allocation_size + index_base ); index++ ) { local_table[ index ] = NULL; ffc0b5ec: 39 40 00 00 li r10,0 ffc0b5f0: 7d 48 49 2e stwx r10,r8,r9 ffc0b5f4: 39 29 00 04 addi r9,r9,4 * Initialise the new entries in the table. */ object_blocks[block_count] = NULL; inactive_per_block[block_count] = 0; for ( index=index_base ; ffc0b5f8: 42 00 ff f8 bdnz+ ffc0b5f0 <_Objects_Extend_information+0x17c> static inline uint32_t ppc_interrupt_disable( void ) { uint32_t level; uint32_t mask; __asm__ volatile ( ffc0b5fc: 7d 40 00 a6 mfmsr r10 ffc0b600: 7d 30 42 a6 mfsprg r9,0 ffc0b604: 7d 49 48 78 andc r9,r10,r9 ffc0b608: 7d 20 01 24 mtmsr r9 uint32_t the_class, uint32_t node, uint32_t index ) { return (( (Objects_Id) the_api ) << OBJECTS_API_START_BIT) | ffc0b60c: 81 3f 00 00 lwz r9,0(r31) information->object_blocks = object_blocks; information->inactive_per_block = inactive_per_block; information->local_table = local_table; information->maximum = (Objects_Maximum) maximum; information->maximum_id = _Objects_Build_id( ffc0b610: a1 1f 00 04 lhz r8,4(r31) ffc0b614: 55 29 c0 0e rlwinm r9,r9,24,0,7 local_table[ index ] = NULL; } _ISR_Disable( level ); old_tables = information->object_blocks; ffc0b618: 80 7f 00 34 lwz r3,52(r31) (( (Objects_Id) the_class ) << OBJECTS_CLASS_START_BIT) | ffc0b61c: 55 08 d8 08 rlwinm r8,r8,27,0,4 information->object_blocks = object_blocks; information->inactive_per_block = inactive_per_block; ffc0b620: 93 1f 00 30 stw r24,48(r31) uint32_t the_class, uint32_t node, uint32_t index ) { return (( (Objects_Id) the_api ) << OBJECTS_API_START_BIT) | ffc0b624: 65 29 00 01 oris r9,r9,1 (( (Objects_Id) the_class ) << OBJECTS_CLASS_START_BIT) | ffc0b628: 7d 29 43 78 or r9,r9,r8 _ISR_Disable( level ); old_tables = information->object_blocks; information->object_blocks = object_blocks; ffc0b62c: 93 3f 00 34 stw r25,52(r31) uint32_t the_class, uint32_t node, uint32_t index ) { return (( (Objects_Id) the_api ) << OBJECTS_API_START_BIT) | ffc0b630: 7d 29 d3 78 or r9,r9,r26 information->inactive_per_block = inactive_per_block; information->local_table = local_table; ffc0b634: 92 df 00 1c stw r22,28(r31) information->maximum = (Objects_Maximum) maximum; ffc0b638: b3 5f 00 10 sth r26,16(r31) information->maximum_id = _Objects_Build_id( ffc0b63c: 91 3f 00 0c stw r9,12(r31) return level; } static inline void ppc_interrupt_enable( uint32_t level ) { __asm__ volatile ( ffc0b640: 7d 40 01 24 mtmsr r10 information->maximum ); _ISR_Enable( level ); _Workspace_Free( old_tables ); ffc0b644: 48 00 28 8d bl ffc0ded0 <_Workspace_Free> } /* * Assign the new object block to the object block table. */ information->object_blocks[ block ] = new_object_block; ffc0b648: 81 3f 00 34 lwz r9,52(r31) ffc0b64c: 57 bd 10 3a rlwinm r29,r29,2,0,29 /* * Initialize objects .. add to a local chain first. */ _Chain_Initialize( ffc0b650: a0 bf 00 14 lhz r5,20(r31) ffc0b654: 38 61 00 08 addi r3,r1,8 } /* * Assign the new object block to the object block table. */ information->object_blocks[ block ] = new_object_block; ffc0b658: 7e e9 e9 2e stwx r23,r9,r29 information->the_class, _Objects_Local_node, index ); _Chain_Append( &information->Inactive, &the_object->Node ); ffc0b65c: 3b 9f 00 20 addi r28,r31,32 information->object_blocks[ block ] = new_object_block; /* * Initialize objects .. add to a local chain first. */ _Chain_Initialize( ffc0b660: 81 3f 00 34 lwz r9,52(r31) ffc0b664: 80 df 00 18 lwz r6,24(r31) ffc0b668: 7c 89 e8 2e lwzx r4,r9,r29 ffc0b66c: 4b ff f1 79 bl ffc0a7e4 <_Chain_Initialize> /* * Move from the local chain, initialise, then append to the inactive chain */ index = index_base; while ((the_object = (Objects_Control *) _Chain_Get( &Inactive )) != NULL ) { ffc0b670: 48 00 00 2c b ffc0b69c <_Objects_Extend_information+0x228> ffc0b674: 81 5f 00 00 lwz r10,0(r31) the_object->id = _Objects_Build_id( ffc0b678: a1 1f 00 04 lhz r8,4(r31) ffc0b67c: 55 4a c0 0e rlwinm r10,r10,24,0,7 ffc0b680: 65 4a 00 01 oris r10,r10,1 (( (Objects_Id) the_class ) << OBJECTS_CLASS_START_BIT) | ffc0b684: 55 08 d8 08 rlwinm r8,r8,27,0,4 ffc0b688: 7d 4a 43 78 or r10,r10,r8 uint32_t the_class, uint32_t node, uint32_t index ) { return (( (Objects_Id) the_api ) << OBJECTS_API_START_BIT) | ffc0b68c: 7d 4a f3 78 or r10,r10,r30 ffc0b690: 91 49 00 08 stw r10,8(r9) index ); _Chain_Append( &information->Inactive, &the_object->Node ); index++; ffc0b694: 3b de 00 01 addi r30,r30,1 information->the_class, _Objects_Local_node, index ); _Chain_Append( &information->Inactive, &the_object->Node ); ffc0b698: 4b ff f0 dd bl ffc0a774 <_Chain_Append> /* * Move from the local chain, initialise, then append to the inactive chain */ index = index_base; while ((the_object = (Objects_Control *) _Chain_Get( &Inactive )) != NULL ) { ffc0b69c: 38 61 00 08 addi r3,r1,8 ffc0b6a0: 4b ff f1 05 bl ffc0a7a4 <_Chain_Get> ffc0b6a4: 7c 69 1b 79 mr. r9,r3 information->the_class, _Objects_Local_node, index ); _Chain_Append( &information->Inactive, &the_object->Node ); ffc0b6a8: 7f 83 e3 78 mr r3,r28 ffc0b6ac: 7d 24 4b 78 mr r4,r9 /* * Move from the local chain, initialise, then append to the inactive chain */ index = index_base; while ((the_object = (Objects_Control *) _Chain_Get( &Inactive )) != NULL ) { ffc0b6b0: 40 82 ff c4 bne+ ffc0b674 <_Objects_Extend_information+0x200> index++; } information->inactive_per_block[ block ] = information->allocation_size; information->inactive = (Objects_Maximum)(information->inactive + information->allocation_size); ffc0b6b4: a1 1f 00 2c lhz r8,44(r31) _Chain_Append( &information->Inactive, &the_object->Node ); index++; } information->inactive_per_block[ block ] = information->allocation_size; ffc0b6b8: a1 3f 00 14 lhz r9,20(r31) ffc0b6bc: 81 5f 00 30 lwz r10,48(r31) information->inactive = (Objects_Maximum)(information->inactive + information->allocation_size); ffc0b6c0: 7d 09 42 14 add r8,r9,r8 _Chain_Append( &information->Inactive, &the_object->Node ); index++; } information->inactive_per_block[ block ] = information->allocation_size; ffc0b6c4: 7d 2a e9 2e stwx r9,r10,r29 information->inactive = ffc0b6c8: b1 1f 00 2c sth r8,44(r31) (Objects_Maximum)(information->inactive + information->allocation_size); } ffc0b6cc: 80 01 00 44 lwz r0,68(r1) ffc0b6d0: 82 c1 00 18 lwz r22,24(r1) ffc0b6d4: 7c 08 03 a6 mtlr r0 ffc0b6d8: 82 e1 00 1c lwz r23,28(r1) ffc0b6dc: 83 01 00 20 lwz r24,32(r1) ffc0b6e0: 83 21 00 24 lwz r25,36(r1) ffc0b6e4: 83 41 00 28 lwz r26,40(r1) ffc0b6e8: 83 61 00 2c lwz r27,44(r1) ffc0b6ec: 83 81 00 30 lwz r28,48(r1) ffc0b6f0: 83 a1 00 34 lwz r29,52(r1) ffc0b6f4: 83 c1 00 38 lwz r30,56(r1) ffc0b6f8: 83 e1 00 3c lwz r31,60(r1) ffc0b6fc: 38 21 00 40 addi r1,r1,64 ffc0b700: 4e 80 00 20 blr else { block_count = information->maximum / information->allocation_size; for ( ; block < block_count; block++ ) { if ( information->object_blocks[ block ] == NULL ) { do_extend = false; ffc0b704: 3b 20 00 00 li r25,0 ffc0b708: 4b ff fe 04 b ffc0b50c <_Objects_Extend_information+0x98> if ( information->auto_extend ) { new_object_block = _Workspace_Allocate( block_size ); if ( !new_object_block ) return; } else { new_object_block = _Workspace_Allocate_or_fatal_error( block_size ); ffc0b70c: 48 00 27 d5 bl ffc0dee0 <_Workspace_Allocate_or_fatal_error> ffc0b710: 7c 77 1b 78 mr r23,r3 ffc0b714: 4b ff fe 24 b ffc0b538 <_Objects_Extend_information+0xc4> */ block_size = block_count * (sizeof(void *) + sizeof(uint32_t) + sizeof(Objects_Name *)) + ((maximum + minimum_index) * sizeof(Objects_Control *)); if ( information->auto_extend ) { object_blocks = _Workspace_Allocate( block_size ); ffc0b718: 48 00 27 a1 bl ffc0deb8 <_Workspace_Allocate> if ( !object_blocks ) { ffc0b71c: 7c 79 1b 79 mr. r25,r3 ffc0b720: 40 82 fe 48 bne+ ffc0b568 <_Objects_Extend_information+0xf4> _Workspace_Free( new_object_block ); ffc0b724: 7e e3 bb 78 mr r3,r23 ffc0b728: 48 00 27 a9 bl ffc0ded0 <_Workspace_Free> ffc0b72c: 4b ff ff a0 b ffc0b6cc <_Objects_Extend_information+0x258> ffc0b730: a0 e3 00 14 lhz r7,20(r3) /* * Search for a free block of indexes. If we do NOT need to allocate or * extend the block table, then we will change do_extend. */ do_extend = true; minimum_index = _Objects_Get_index( information->minimum_id ); ffc0b734: 7f 7e db 78 mr r30,r27 /* * Search for a free block of indexes. If we do NOT need to allocate or * extend the block table, then we will change do_extend. */ do_extend = true; ffc0b738: 3b 20 00 01 li r25,1 minimum_index = _Objects_Get_index( information->minimum_id ); index_base = minimum_index; block = 0; ffc0b73c: 3b a0 00 00 li r29,0 /* if ( information->maximum < minimum_index ) */ if ( information->object_blocks == NULL ) block_count = 0; ffc0b740: 3b 80 00 00 li r28,0 ffc0b744: 4b ff fd c8 b ffc0b50c <_Objects_Extend_information+0x98> * separate parts as size of each block has changed. */ memcpy( object_blocks, information->object_blocks, block_count * sizeof(void*) ); ffc0b748: 57 9c 10 3a rlwinm r28,r28,2,0,29 /* * Copy each section of the table over. This has to be performed as * separate parts as size of each block has changed. */ memcpy( object_blocks, ffc0b74c: 80 9f 00 34 lwz r4,52(r31) ffc0b750: 7f 85 e3 78 mr r5,r28 ffc0b754: 7f 23 cb 78 mr r3,r25 ffc0b758: 48 00 76 25 bl ffc12d7c information->object_blocks, block_count * sizeof(void*) ); memcpy( inactive_per_block, ffc0b75c: 80 9f 00 30 lwz r4,48(r31) ffc0b760: 7f 85 e3 78 mr r5,r28 ffc0b764: 7f 03 c3 78 mr r3,r24 ffc0b768: 48 00 76 15 bl ffc12d7c information->inactive_per_block, block_count * sizeof(uint32_t) ); memcpy( local_table, information->local_table, (information->maximum + minimum_index) * sizeof(Objects_Control *) ); ffc0b76c: a0 bf 00 10 lhz r5,16(r31) information->object_blocks, block_count * sizeof(void*) ); memcpy( inactive_per_block, information->inactive_per_block, block_count * sizeof(uint32_t) ); memcpy( local_table, ffc0b770: 80 9f 00 1c lwz r4,28(r31) ffc0b774: 7e c3 b3 78 mr r3,r22 information->local_table, (information->maximum + minimum_index) * sizeof(Objects_Control *) ); ffc0b778: 7c a5 da 14 add r5,r5,r27 information->object_blocks, block_count * sizeof(void*) ); memcpy( inactive_per_block, information->inactive_per_block, block_count * sizeof(uint32_t) ); memcpy( local_table, ffc0b77c: 54 a5 10 3a rlwinm r5,r5,2,0,29 ffc0b780: 48 00 75 fd bl ffc12d7c ffc0b784: 4b ff fe 2c b ffc0b5b0 <_Objects_Extend_information+0x13c> ffc0b788: 7d 07 43 78 mr r7,r8 <== NOT EXECUTED /* * Search for a free block of indexes. If we do NOT need to allocate or * extend the block table, then we will change do_extend. */ do_extend = true; minimum_index = _Objects_Get_index( information->minimum_id ); ffc0b78c: 7f 7e db 78 mr r30,r27 <== NOT EXECUTED /* * Search for a free block of indexes. If we do NOT need to allocate or * extend the block table, then we will change do_extend. */ do_extend = true; ffc0b790: 3b 20 00 01 li r25,1 <== NOT EXECUTED minimum_index = _Objects_Get_index( information->minimum_id ); index_base = minimum_index; block = 0; ffc0b794: 3b a0 00 00 li r29,0 <== NOT EXECUTED ffc0b798: 4b ff fd 74 b ffc0b50c <_Objects_Extend_information+0x98><== NOT EXECUTED else { block_count = information->maximum / information->allocation_size; for ( ; block < block_count; block++ ) { if ( information->object_blocks[ block ] == NULL ) { do_extend = false; ffc0b79c: 3b 20 00 00 li r25,0 <== NOT EXECUTED * extend the block table, then we will change do_extend. */ do_extend = true; minimum_index = _Objects_Get_index( information->minimum_id ); index_base = minimum_index; block = 0; ffc0b7a0: 3b a0 00 00 li r29,0 <== NOT EXECUTED ffc0b7a4: 4b ff fd 68 b ffc0b50c <_Objects_Extend_information+0x98><== NOT EXECUTED =============================================================================== ffc0b874 <_Objects_Get_information>: Objects_Information *_Objects_Get_information( Objects_APIs the_api, uint16_t the_class ) { ffc0b874: 94 21 ff f0 stwu r1,-16(r1) ffc0b878: 7c 08 02 a6 mflr r0 ffc0b87c: 93 e1 00 0c stw r31,12(r1) Objects_Information *info; int the_class_api_maximum; if ( !the_class ) ffc0b880: 7c 9f 23 79 mr. r31,r4 Objects_Information *_Objects_Get_information( Objects_APIs the_api, uint16_t the_class ) { ffc0b884: 90 01 00 14 stw r0,20(r1) ffc0b888: 93 c1 00 08 stw r30,8(r1) Objects_Information *info; int the_class_api_maximum; if ( !the_class ) ffc0b88c: 41 82 00 68 beq- ffc0b8f4 <_Objects_Get_information+0x80> ffc0b890: 7c 7e 1b 78 mr r30,r3 /* * 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 ); ffc0b894: 48 00 49 35 bl ffc101c8 <_Objects_API_maximum_class> if ( the_class_api_maximum == 0 ) ffc0b898: 2c 03 00 00 cmpwi r3,0 ffc0b89c: 41 82 00 58 beq- ffc0b8f4 <_Objects_Get_information+0x80> return NULL; if ( the_class > (uint32_t) the_class_api_maximum ) ffc0b8a0: 7f 83 f8 40 cmplw cr7,r3,r31 ffc0b8a4: 41 9c 00 50 blt- cr7,ffc0b8f4 <_Objects_Get_information+0x80> return NULL; if ( !_Objects_Information_table[ the_api ] ) ffc0b8a8: 3d 20 00 00 lis r9,0 ffc0b8ac: 57 de 10 3a rlwinm r30,r30,2,0,29 ffc0b8b0: 39 29 2b f8 addi r9,r9,11256 ffc0b8b4: 7d 29 f0 2e lwzx r9,r9,r30 ffc0b8b8: 2f 89 00 00 cmpwi cr7,r9,0 ffc0b8bc: 41 9e 00 38 beq- cr7,ffc0b8f4 <_Objects_Get_information+0x80><== NEVER TAKEN return NULL; info = _Objects_Information_table[ the_api ][ the_class ]; ffc0b8c0: 57 ff 10 3a rlwinm r31,r31,2,0,29 ffc0b8c4: 7c 69 f8 2e lwzx r3,r9,r31 if ( !info ) ffc0b8c8: 2f 83 00 00 cmpwi cr7,r3,0 ffc0b8cc: 41 9e 00 28 beq- cr7,ffc0b8f4 <_Objects_Get_information+0x80><== NEVER TAKEN * 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 ) ffc0b8d0: a1 23 00 10 lhz r9,16(r3) ffc0b8d4: 2f 89 00 00 cmpwi cr7,r9,0 ffc0b8d8: 41 9e 00 1c beq- cr7,ffc0b8f4 <_Objects_Get_information+0x80> return NULL; #endif return info; } ffc0b8dc: 80 01 00 14 lwz r0,20(r1) ffc0b8e0: 83 c1 00 08 lwz r30,8(r1) ffc0b8e4: 7c 08 03 a6 mtlr r0 ffc0b8e8: 83 e1 00 0c lwz r31,12(r1) ffc0b8ec: 38 21 00 10 addi r1,r1,16 ffc0b8f0: 4e 80 00 20 blr ffc0b8f4: 80 01 00 14 lwz r0,20(r1) { Objects_Information *info; int the_class_api_maximum; if ( !the_class ) return NULL; ffc0b8f8: 38 60 00 00 li r3,0 if ( info->maximum == 0 ) return NULL; #endif return info; } ffc0b8fc: 83 c1 00 08 lwz r30,8(r1) ffc0b900: 7c 08 03 a6 mtlr r0 ffc0b904: 83 e1 00 0c lwz r31,12(r1) ffc0b908: 38 21 00 10 addi r1,r1,16 ffc0b90c: 4e 80 00 20 blr =============================================================================== ffc1ad14 <_Objects_Get_name_as_string>: char *_Objects_Get_name_as_string( Objects_Id id, size_t length, char *name ) { ffc1ad14: 94 21 ff d8 stwu r1,-40(r1) ffc1ad18: 7c 08 02 a6 mflr r0 ffc1ad1c: 93 a1 00 1c stw r29,28(r1) char lname[5]; Objects_Control *the_object; Objects_Locations location; Objects_Id tmpId; if ( length == 0 ) ffc1ad20: 7c 9d 23 79 mr. r29,r4 char *_Objects_Get_name_as_string( Objects_Id id, size_t length, char *name ) { ffc1ad24: 90 01 00 2c stw r0,44(r1) ffc1ad28: 93 c1 00 20 stw r30,32(r1) ffc1ad2c: 93 e1 00 24 stw r31,36(r1) char lname[5]; Objects_Control *the_object; Objects_Locations location; Objects_Id tmpId; if ( length == 0 ) ffc1ad30: 41 82 01 04 beq- ffc1ae34 <_Objects_Get_name_as_string+0x120> return NULL; if ( name == NULL ) ffc1ad34: 2f 85 00 00 cmpwi cr7,r5,0 ffc1ad38: 7c bf 2b 78 mr r31,r5 ffc1ad3c: 41 9e 00 f8 beq- cr7,ffc1ae34 <_Objects_Get_name_as_string+0x120> return NULL; tmpId = (id == OBJECTS_ID_OF_SELF) ? _Thread_Executing->Object.id : id; ffc1ad40: 2f 83 00 00 cmpwi cr7,r3,0 ffc1ad44: 7c 7e 1b 78 mr r30,r3 ffc1ad48: 41 9e 00 dc beq- cr7,ffc1ae24 <_Objects_Get_name_as_string+0x110> information = _Objects_Get_information_id( tmpId ); ffc1ad4c: 7f c3 f3 78 mr r3,r30 ffc1ad50: 4b ff 78 c9 bl ffc12618 <_Objects_Get_information_id> if ( !information ) ffc1ad54: 2f 83 00 00 cmpwi cr7,r3,0 ffc1ad58: 41 9e 00 dc beq- cr7,ffc1ae34 <_Objects_Get_name_as_string+0x120> return NULL; the_object = _Objects_Get( information, tmpId, &location ); ffc1ad5c: 7f c4 f3 78 mr r4,r30 ffc1ad60: 38 a1 00 10 addi r5,r1,16 ffc1ad64: 4b ff 79 d1 bl ffc12734 <_Objects_Get> switch ( location ) { ffc1ad68: 81 21 00 10 lwz r9,16(r1) ffc1ad6c: 2f 89 00 00 cmpwi cr7,r9,0 ffc1ad70: 40 9e 00 c4 bne- cr7,ffc1ae34 <_Objects_Get_name_as_string+0x120> s = lname; } d = name; if ( s ) { for ( i=0 ; i<(length-1) && *s ; i++, s++, d++ ) { ffc1ad74: 2f 9d 00 01 cmpwi cr7,r29,1 if ( information->is_string ) { s = the_object->name.name_p; } else #endif { uint32_t u32_name = (uint32_t) the_object->name.name_u32; ffc1ad78: 81 43 00 0c lwz r10,12(r3) lname[ 0 ] = (u32_name >> 24) & 0xff; lname[ 1 ] = (u32_name >> 16) & 0xff; lname[ 2 ] = (u32_name >> 8) & 0xff; lname[ 3 ] = (u32_name >> 0) & 0xff; lname[ 4 ] = '\0'; ffc1ad7c: 99 21 00 0c stb r9,12(r1) #endif { uint32_t u32_name = (uint32_t) the_object->name.name_u32; lname[ 0 ] = (u32_name >> 24) & 0xff; lname[ 1 ] = (u32_name >> 16) & 0xff; ffc1ad80: 55 47 84 3e rlwinm r7,r10,16,16,31 } else #endif { uint32_t u32_name = (uint32_t) the_object->name.name_u32; lname[ 0 ] = (u32_name >> 24) & 0xff; ffc1ad84: 55 49 46 3e rlwinm r9,r10,8,24,31 lname[ 1 ] = (u32_name >> 16) & 0xff; ffc1ad88: 98 e1 00 09 stb r7,9(r1) lname[ 2 ] = (u32_name >> 8) & 0xff; ffc1ad8c: 55 48 c2 3e rlwinm r8,r10,24,8,31 } else #endif { uint32_t u32_name = (uint32_t) the_object->name.name_u32; lname[ 0 ] = (u32_name >> 24) & 0xff; ffc1ad90: 99 21 00 08 stb r9,8(r1) lname[ 1 ] = (u32_name >> 16) & 0xff; lname[ 2 ] = (u32_name >> 8) & 0xff; ffc1ad94: 99 01 00 0a stb r8,10(r1) lname[ 3 ] = (u32_name >> 0) & 0xff; ffc1ad98: 99 41 00 0b stb r10,11(r1) s = lname; } d = name; if ( s ) { for ( i=0 ; i<(length-1) && *s ; i++, s++, d++ ) { ffc1ad9c: 41 9e 00 bc beq- cr7,ffc1ae58 <_Objects_Get_name_as_string+0x144><== NEVER TAKEN ffc1ada0: 2f 89 00 00 cmpwi cr7,r9,0 ffc1ada4: 41 9e 00 b4 beq- cr7,ffc1ae58 <_Objects_Get_name_as_string+0x144> ffc1ada8: 3d 60 00 00 lis r11,0 *d = (isprint((unsigned char)*s)) ? *s : '*'; ffc1adac: 3b bd ff ff addi r29,r29,-1 * This method objects the name of an object and returns its name * in the form of a C string. It attempts to be careful about * overflowing the user's string and about returning unprintable characters. */ char *_Objects_Get_name_as_string( ffc1adb0: 38 e1 00 08 addi r7,r1,8 } d = name; if ( s ) { for ( i=0 ; i<(length-1) && *s ; i++, s++, d++ ) { *d = (isprint((unsigned char)*s)) ? *s : '*'; ffc1adb4: 7f a9 03 a6 mtctr r29 * This method objects the name of an object and returns its name * in the form of a C string. It attempts to be careful about * overflowing the user's string and about returning unprintable characters. */ char *_Objects_Get_name_as_string( ffc1adb8: 7f ea fb 78 mr r10,r31 ffc1adbc: 39 6b 29 64 addi r11,r11,10596 } d = name; if ( s ) { for ( i=0 ; i<(length-1) && *s ; i++, s++, d++ ) { *d = (isprint((unsigned char)*s)) ? *s : '*'; ffc1adc0: 38 c0 ff 97 li r6,-105 ffc1adc4: 48 00 00 10 b ffc1add4 <_Objects_Get_name_as_string+0xc0> s = lname; } d = name; if ( s ) { for ( i=0 ; i<(length-1) && *s ; i++, s++, d++ ) { ffc1adc8: 8d 27 00 01 lbzu r9,1(r7) ffc1adcc: 2f 89 00 00 cmpwi cr7,r9,0 ffc1add0: 41 9e 00 28 beq- cr7,ffc1adf8 <_Objects_Get_name_as_string+0xe4> *d = (isprint((unsigned char)*s)) ? *s : '*'; ffc1add4: 81 0b 00 00 lwz r8,0(r11) ffc1add8: 7d 08 4a 14 add r8,r8,r9 ffc1addc: 89 08 00 01 lbz r8,1(r8) ffc1ade0: 7d 05 30 39 and. r5,r8,r6 ffc1ade4: 40 82 00 08 bne- ffc1adec <_Objects_Get_name_as_string+0xd8> ffc1ade8: 39 20 00 2a li r9,42 ffc1adec: 99 2a 00 00 stb r9,0(r10) s = lname; } d = name; if ( s ) { for ( i=0 ; i<(length-1) && *s ; i++, s++, d++ ) { ffc1adf0: 39 4a 00 01 addi r10,r10,1 ffc1adf4: 42 00 ff d4 bdnz+ ffc1adc8 <_Objects_Get_name_as_string+0xb4> *d = (isprint((unsigned char)*s)) ? *s : '*'; } } *d = '\0'; ffc1adf8: 39 20 00 00 li r9,0 ffc1adfc: 99 2a 00 00 stb r9,0(r10) _Thread_Enable_dispatch(); ffc1ae00: 4b ff 8a 71 bl ffc13870 <_Thread_Enable_dispatch> return name; } return NULL; /* unreachable path */ } ffc1ae04: 80 01 00 2c lwz r0,44(r1) ffc1ae08: 7f e3 fb 78 mr r3,r31 ffc1ae0c: 83 a1 00 1c lwz r29,28(r1) ffc1ae10: 7c 08 03 a6 mtlr r0 ffc1ae14: 83 c1 00 20 lwz r30,32(r1) ffc1ae18: 83 e1 00 24 lwz r31,36(r1) ffc1ae1c: 38 21 00 28 addi r1,r1,40 ffc1ae20: 4e 80 00 20 blr return NULL; if ( name == NULL ) return NULL; tmpId = (id == OBJECTS_ID_OF_SELF) ? _Thread_Executing->Object.id : id; ffc1ae24: 3d 20 00 00 lis r9,0 ffc1ae28: 81 29 37 30 lwz r9,14128(r9) ffc1ae2c: 83 c9 00 08 lwz r30,8(r9) ffc1ae30: 4b ff ff 1c b ffc1ad4c <_Objects_Get_name_as_string+0x38> _Thread_Enable_dispatch(); return name; } return NULL; /* unreachable path */ } ffc1ae34: 80 01 00 2c lwz r0,44(r1) #if defined(RTEMS_MULTIPROCESSING) case OBJECTS_REMOTE: /* not supported */ #endif case OBJECTS_ERROR: return NULL; ffc1ae38: 3b e0 00 00 li r31,0 _Thread_Enable_dispatch(); return name; } return NULL; /* unreachable path */ } ffc1ae3c: 7f e3 fb 78 mr r3,r31 ffc1ae40: 83 a1 00 1c lwz r29,28(r1) ffc1ae44: 7c 08 03 a6 mtlr r0 ffc1ae48: 83 c1 00 20 lwz r30,32(r1) ffc1ae4c: 83 e1 00 24 lwz r31,36(r1) ffc1ae50: 38 21 00 28 addi r1,r1,40 ffc1ae54: 4e 80 00 20 blr s = lname; } d = name; if ( s ) { for ( i=0 ; i<(length-1) && *s ; i++, s++, d++ ) { ffc1ae58: 7f ea fb 78 mr r10,r31 ffc1ae5c: 4b ff ff 9c b ffc1adf8 <_Objects_Get_name_as_string+0xe4> =============================================================================== ffc1dea8 <_Objects_Get_next>: Objects_Information *information, Objects_Id id, Objects_Locations *location_p, Objects_Id *next_id_p ) { ffc1dea8: 94 21 ff e8 stwu r1,-24(r1) ffc1deac: 7c 08 02 a6 mflr r0 ffc1deb0: 93 a1 00 0c stw r29,12(r1) Objects_Control *object; Objects_Id next_id; if ( !information ) ffc1deb4: 7c 7d 1b 79 mr. r29,r3 Objects_Information *information, Objects_Id id, Objects_Locations *location_p, Objects_Id *next_id_p ) { ffc1deb8: 90 01 00 1c stw r0,28(r1) ffc1debc: 93 81 00 08 stw r28,8(r1) ffc1dec0: 93 c1 00 10 stw r30,16(r1) ffc1dec4: 93 e1 00 14 stw r31,20(r1) Objects_Control *object; Objects_Id next_id; if ( !information ) ffc1dec8: 41 82 00 d8 beq- ffc1dfa0 <_Objects_Get_next+0xf8> return NULL; if ( !location_p ) ffc1decc: 2f 85 00 00 cmpwi cr7,r5,0 ffc1ded0: 7c be 2b 78 mr r30,r5 ffc1ded4: 41 9e 00 cc beq- cr7,ffc1dfa0 <_Objects_Get_next+0xf8> return NULL; if ( !next_id_p ) ffc1ded8: 2f 86 00 00 cmpwi cr7,r6,0 ffc1dedc: 7c dc 33 78 mr r28,r6 ffc1dee0: 41 9e 00 c0 beq- cr7,ffc1dfa0 <_Objects_Get_next+0xf8> return NULL; if (_Objects_Get_index(id) == OBJECTS_ID_INITIAL_INDEX) ffc1dee4: 54 89 04 3e clrlwi r9,r4,16 ffc1dee8: 2f 89 00 00 cmpwi cr7,r9,0 next_id = information->minimum_id; else next_id = id; ffc1deec: 7c 9f 23 78 mr r31,r4 return NULL; if ( !next_id_p ) return NULL; if (_Objects_Get_index(id) == OBJECTS_ID_INITIAL_INDEX) ffc1def0: 41 9e 00 58 beq- cr7,ffc1df48 <_Objects_Get_next+0xa0> else next_id = id; do { /* walked off end of list? */ if (_Objects_Get_index(next_id) > information->maximum) ffc1def4: a1 5d 00 10 lhz r10,16(r29) ffc1def8: 57 e9 04 3e clrlwi r9,r31,16 *location_p = OBJECTS_ERROR; goto final; } /* try to grab one */ object = _Objects_Get(information, next_id, location_p); ffc1defc: 7f e4 fb 78 mr r4,r31 else next_id = id; do { /* walked off end of list? */ if (_Objects_Get_index(next_id) > information->maximum) ffc1df00: 7f 8a 48 40 cmplw cr7,r10,r9 *location_p = OBJECTS_ERROR; goto final; } /* try to grab one */ object = _Objects_Get(information, next_id, location_p); ffc1df04: 7f a3 eb 78 mr r3,r29 ffc1df08: 7f c5 f3 78 mr r5,r30 next_id++; ffc1df0c: 3b ff 00 01 addi r31,r31,1 else next_id = id; do { /* walked off end of list? */ if (_Objects_Get_index(next_id) > information->maximum) ffc1df10: 41 9c 00 5c blt- cr7,ffc1df6c <_Objects_Get_next+0xc4> *location_p = OBJECTS_ERROR; goto final; } /* try to grab one */ object = _Objects_Get(information, next_id, location_p); ffc1df14: 4b ff 48 21 bl ffc12734 <_Objects_Get> next_id++; } while (*location_p != OBJECTS_LOCAL); ffc1df18: 81 3e 00 00 lwz r9,0(r30) ffc1df1c: 2f 89 00 00 cmpwi cr7,r9,0 ffc1df20: 40 9e ff d4 bne+ cr7,ffc1def4 <_Objects_Get_next+0x4c> *next_id_p = next_id; ffc1df24: 93 fc 00 00 stw r31,0(r28) return object; final: *next_id_p = OBJECTS_ID_FINAL; return 0; } ffc1df28: 80 01 00 1c lwz r0,28(r1) ffc1df2c: 83 81 00 08 lwz r28,8(r1) ffc1df30: 7c 08 03 a6 mtlr r0 ffc1df34: 83 a1 00 0c lwz r29,12(r1) ffc1df38: 83 c1 00 10 lwz r30,16(r1) ffc1df3c: 83 e1 00 14 lwz r31,20(r1) ffc1df40: 38 21 00 18 addi r1,r1,24 ffc1df44: 4e 80 00 20 blr if ( !next_id_p ) return NULL; if (_Objects_Get_index(id) == OBJECTS_ID_INITIAL_INDEX) next_id = information->minimum_id; ffc1df48: 83 fd 00 08 lwz r31,8(r29) *location_p = OBJECTS_ERROR; goto final; } /* try to grab one */ object = _Objects_Get(information, next_id, location_p); ffc1df4c: 7f a3 eb 78 mr r3,r29 else next_id = id; do { /* walked off end of list? */ if (_Objects_Get_index(next_id) > information->maximum) ffc1df50: a1 5d 00 10 lhz r10,16(r29) *location_p = OBJECTS_ERROR; goto final; } /* try to grab one */ object = _Objects_Get(information, next_id, location_p); ffc1df54: 7f c5 f3 78 mr r5,r30 else next_id = id; do { /* walked off end of list? */ if (_Objects_Get_index(next_id) > information->maximum) ffc1df58: 57 e9 04 3e clrlwi r9,r31,16 ffc1df5c: 7f 8a 48 40 cmplw cr7,r10,r9 *location_p = OBJECTS_ERROR; goto final; } /* try to grab one */ object = _Objects_Get(information, next_id, location_p); ffc1df60: 7f e4 fb 78 mr r4,r31 next_id++; ffc1df64: 3b ff 00 01 addi r31,r31,1 else next_id = id; do { /* walked off end of list? */ if (_Objects_Get_index(next_id) > information->maximum) ffc1df68: 40 9c ff ac bge+ cr7,ffc1df14 <_Objects_Get_next+0x6c> <== ALWAYS TAKEN return object; final: *next_id_p = OBJECTS_ID_FINAL; return 0; } ffc1df6c: 80 01 00 1c lwz r0,28(r1) do { /* walked off end of list? */ if (_Objects_Get_index(next_id) > information->maximum) { *location_p = OBJECTS_ERROR; ffc1df70: 39 20 00 01 li r9,1 ffc1df74: 91 3e 00 00 stw r9,0(r30) *next_id_p = next_id; return object; final: *next_id_p = OBJECTS_ID_FINAL; ffc1df78: 39 20 ff ff li r9,-1 return 0; } ffc1df7c: 7c 08 03 a6 mtlr r0 *next_id_p = next_id; return object; final: *next_id_p = OBJECTS_ID_FINAL; return 0; ffc1df80: 38 60 00 00 li r3,0 *next_id_p = next_id; return object; final: *next_id_p = OBJECTS_ID_FINAL; ffc1df84: 91 3c 00 00 stw r9,0(r28) return 0; } ffc1df88: 83 81 00 08 lwz r28,8(r1) ffc1df8c: 83 a1 00 0c lwz r29,12(r1) ffc1df90: 83 c1 00 10 lwz r30,16(r1) ffc1df94: 83 e1 00 14 lwz r31,20(r1) ffc1df98: 38 21 00 18 addi r1,r1,24 ffc1df9c: 4e 80 00 20 blr { Objects_Control *object; Objects_Id next_id; if ( !information ) return NULL; ffc1dfa0: 38 60 00 00 li r3,0 ffc1dfa4: 4b ff ff 84 b ffc1df28 <_Objects_Get_next+0x80> =============================================================================== ffc207e8 <_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; ffc207e8: 81 23 00 08 lwz r9,8(r3) if ( information->maximum >= index ) { ffc207ec: a1 43 00 10 lhz r10,16(r3) /* * 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; ffc207f0: 21 29 00 01 subfic r9,r9,1 ffc207f4: 7c 89 22 14 add r4,r9,r4 if ( information->maximum >= index ) { ffc207f8: 7f 84 50 40 cmplw cr7,r4,r10 ffc207fc: 41 9d 00 24 bgt- cr7,ffc20820 <_Objects_Get_no_protection+0x38> if ( (the_object = information->local_table[ index ]) != NULL ) { ffc20800: 81 23 00 1c lwz r9,28(r3) ffc20804: 54 84 10 3a rlwinm r4,r4,2,0,29 ffc20808: 7c 69 20 2e lwzx r3,r9,r4 ffc2080c: 2f 83 00 00 cmpwi cr7,r3,0 ffc20810: 41 9e 00 10 beq- cr7,ffc20820 <_Objects_Get_no_protection+0x38><== NEVER TAKEN *location = OBJECTS_LOCAL; ffc20814: 39 20 00 00 li r9,0 ffc20818: 91 25 00 00 stw r9,0(r5) return the_object; ffc2081c: 4e 80 00 20 blr /* * This isn't supported or required yet for Global objects so * if it isn't local, we don't find it. */ *location = OBJECTS_ERROR; ffc20820: 39 20 00 01 li r9,1 ffc20824: 91 25 00 00 stw r9,0(r5) return NULL; ffc20828: 38 60 00 00 li r3,0 } ffc2082c: 4e 80 00 20 blr =============================================================================== ffc127c4 <_Objects_Id_to_name>: /* * Caller is trusted for name != NULL. */ tmpId = (id == OBJECTS_ID_OF_SELF) ? _Thread_Executing->Object.id : id; ffc127c4: 7c 69 1b 79 mr. r9,r3 Objects_Name_or_id_lookup_errors _Objects_Id_to_name ( Objects_Id id, Objects_Name *name ) { ffc127c8: 94 21 ff e0 stwu r1,-32(r1) ffc127cc: 7c 08 02 a6 mflr r0 ffc127d0: 93 e1 00 1c stw r31,28(r1) ffc127d4: 7c 9f 23 78 mr r31,r4 ffc127d8: 90 01 00 24 stw r0,36(r1) /* * Caller is trusted for name != NULL. */ tmpId = (id == OBJECTS_ID_OF_SELF) ? _Thread_Executing->Object.id : id; ffc127dc: 40 82 00 10 bne- ffc127ec <_Objects_Id_to_name+0x28> ffc127e0: 3d 20 00 00 lis r9,0 ffc127e4: 81 29 37 30 lwz r9,14128(r9) ffc127e8: 81 29 00 08 lwz r9,8(r9) */ RTEMS_INLINE_ROUTINE Objects_APIs _Objects_Get_API( Objects_Id id ) { return (Objects_APIs) ((id >> OBJECTS_API_START_BIT) & OBJECTS_API_VALID_BITS); ffc127ec: 55 2a 47 7e rlwinm r10,r9,8,29,31 */ RTEMS_INLINE_ROUTINE bool _Objects_Is_api_valid( uint32_t the_api ) { if ( !the_api || the_api > OBJECTS_APIS_LAST ) ffc127f0: 39 0a ff ff addi r8,r10,-1 ffc127f4: 2b 88 00 02 cmplwi cr7,r8,2 ffc127f8: 41 9d 00 54 bgt- cr7,ffc1284c <_Objects_Id_to_name+0x88> the_api = _Objects_Get_API( tmpId ); if ( !_Objects_Is_api_valid( the_api ) ) return OBJECTS_INVALID_ID; if ( !_Objects_Information_table[ the_api ] ) ffc127fc: 3d 00 00 00 lis r8,0 ffc12800: 55 4a 10 3a rlwinm r10,r10,2,0,29 ffc12804: 39 08 34 d8 addi r8,r8,13528 ffc12808: 7d 48 50 2e lwzx r10,r8,r10 ffc1280c: 2f 8a 00 00 cmpwi cr7,r10,0 ffc12810: 41 9e 00 3c beq- cr7,ffc1284c <_Objects_Id_to_name+0x88> return OBJECTS_INVALID_ID; the_class = _Objects_Get_class( tmpId ); information = _Objects_Information_table[ the_api ][ the_class ]; ffc12814: 55 28 3e 7a rlwinm r8,r9,7,25,29 ffc12818: 7c 6a 40 2e lwzx r3,r10,r8 if ( !information ) ffc1281c: 2f 83 00 00 cmpwi cr7,r3,0 ffc12820: 41 9e 00 2c beq- cr7,ffc1284c <_Objects_Id_to_name+0x88><== NEVER TAKEN #if defined(RTEMS_SCORE_OBJECT_ENABLE_STRING_NAMES) if ( information->is_string ) return OBJECTS_INVALID_ID; #endif the_object = _Objects_Get( information, tmpId, &ignored_location ); ffc12824: 7d 24 4b 78 mr r4,r9 ffc12828: 38 a1 00 08 addi r5,r1,8 ffc1282c: 4b ff ff 09 bl ffc12734 <_Objects_Get> if ( !the_object ) ffc12830: 2c 03 00 00 cmpwi r3,0 ffc12834: 41 82 00 18 beq- ffc1284c <_Objects_Id_to_name+0x88> return OBJECTS_INVALID_ID; *name = the_object->name; ffc12838: 81 23 00 0c lwz r9,12(r3) ffc1283c: 91 3f 00 00 stw r9,0(r31) _Thread_Enable_dispatch(); ffc12840: 48 00 10 31 bl ffc13870 <_Thread_Enable_dispatch> return OBJECTS_NAME_OR_ID_LOOKUP_SUCCESSFUL; ffc12844: 38 60 00 00 li r3,0 ffc12848: 48 00 00 08 b ffc12850 <_Objects_Id_to_name+0x8c> tmpId = (id == OBJECTS_ID_OF_SELF) ? _Thread_Executing->Object.id : id; the_api = _Objects_Get_API( tmpId ); if ( !_Objects_Is_api_valid( the_api ) ) return OBJECTS_INVALID_ID; ffc1284c: 38 60 00 03 li r3,3 return OBJECTS_INVALID_ID; *name = the_object->name; _Thread_Enable_dispatch(); return OBJECTS_NAME_OR_ID_LOOKUP_SUCCESSFUL; } ffc12850: 80 01 00 24 lwz r0,36(r1) ffc12854: 83 e1 00 1c lwz r31,28(r1) ffc12858: 7c 08 03 a6 mtlr r0 ffc1285c: 38 21 00 20 addi r1,r1,32 ffc12860: 4e 80 00 20 blr =============================================================================== ffc0bb80 <_Objects_Shrink_information>: #include void _Objects_Shrink_information( Objects_Information *information ) { ffc0bb80: 94 21 ff e8 stwu r1,-24(r1) ffc0bb84: 7c 08 02 a6 mflr r0 ffc0bb88: 90 01 00 1c stw r0,28(r1) ffc0bb8c: 93 e1 00 14 stw r31,20(r1) /* * Search the list to find block or chunk with all objects inactive. */ index_base = _Objects_Get_index( information->minimum_id ); block_count = (information->maximum - index_base) / ffc0bb90: a0 e3 00 10 lhz r7,16(r3) /* * Search the list to find block or chunk with all objects inactive. */ index_base = _Objects_Get_index( information->minimum_id ); ffc0bb94: a3 e3 00 0a lhz r31,10(r3) block_count = (information->maximum - index_base) / ffc0bb98: a1 43 00 14 lhz r10,20(r3) ffc0bb9c: 7c ff 38 50 subf r7,r31,r7 #include void _Objects_Shrink_information( Objects_Information *information ) { ffc0bba0: 93 81 00 08 stw r28,8(r1) /* * Search the list to find block or chunk with all objects inactive. */ index_base = _Objects_Get_index( information->minimum_id ); block_count = (information->maximum - index_base) / ffc0bba4: 7c e7 53 96 divwu r7,r7,r10 #include void _Objects_Shrink_information( Objects_Information *information ) { ffc0bba8: 93 a1 00 0c stw r29,12(r1) ffc0bbac: 93 c1 00 10 stw r30,16(r1) index_base = _Objects_Get_index( information->minimum_id ); block_count = (information->maximum - index_base) / information->allocation_size; for ( block = 0; block < block_count; block++ ) { ffc0bbb0: 2f 87 00 00 cmpwi cr7,r7,0 #include void _Objects_Shrink_information( Objects_Information *information ) { ffc0bbb4: 7c 7c 1b 78 mr r28,r3 index_base = _Objects_Get_index( information->minimum_id ); block_count = (information->maximum - index_base) / information->allocation_size; for ( block = 0; block < block_count; block++ ) { ffc0bbb8: 41 9e 00 3c beq- cr7,ffc0bbf4 <_Objects_Shrink_information+0x74><== NEVER TAKEN if ( information->inactive_per_block[ block ] == ffc0bbbc: 81 03 00 30 lwz r8,48(r3) ffc0bbc0: 81 28 00 00 lwz r9,0(r8) ffc0bbc4: 7f 8a 48 00 cmpw cr7,r10,r9 ffc0bbc8: 41 9e 00 4c beq- cr7,ffc0bc14 <_Objects_Shrink_information+0x94><== NEVER TAKEN index_base = _Objects_Get_index( information->minimum_id ); block_count = (information->maximum - index_base) / information->allocation_size; for ( block = 0; block < block_count; block++ ) { ffc0bbcc: 39 20 00 00 li r9,0 ffc0bbd0: 7c e9 03 a6 mtctr r7 ffc0bbd4: 48 00 00 14 b ffc0bbe8 <_Objects_Shrink_information+0x68> if ( information->inactive_per_block[ block ] == ffc0bbd8: 84 e8 00 04 lwzu r7,4(r8) #include #include #include #include void _Objects_Shrink_information( ffc0bbdc: 55 3d 10 3a rlwinm r29,r9,2,0,29 index_base = _Objects_Get_index( information->minimum_id ); block_count = (information->maximum - index_base) / information->allocation_size; for ( block = 0; block < block_count; block++ ) { if ( information->inactive_per_block[ block ] == ffc0bbe0: 7f 8a 38 00 cmpw cr7,r10,r7 ffc0bbe4: 41 9e 00 34 beq- cr7,ffc0bc18 <_Objects_Shrink_information+0x98> index_base = _Objects_Get_index( information->minimum_id ); block_count = (information->maximum - index_base) / information->allocation_size; for ( block = 0; block < block_count; block++ ) { ffc0bbe8: 39 29 00 01 addi r9,r9,1 information->inactive -= information->allocation_size; return; } index_base += information->allocation_size; ffc0bbec: 7f ff 52 14 add r31,r31,r10 index_base = _Objects_Get_index( information->minimum_id ); block_count = (information->maximum - index_base) / information->allocation_size; for ( block = 0; block < block_count; block++ ) { ffc0bbf0: 42 00 ff e8 bdnz+ ffc0bbd8 <_Objects_Shrink_information+0x58> return; } index_base += information->allocation_size; } } ffc0bbf4: 80 01 00 1c lwz r0,28(r1) ffc0bbf8: 83 81 00 08 lwz r28,8(r1) ffc0bbfc: 7c 08 03 a6 mtlr r0 ffc0bc00: 83 a1 00 0c lwz r29,12(r1) ffc0bc04: 83 c1 00 10 lwz r30,16(r1) ffc0bc08: 83 e1 00 14 lwz r31,20(r1) ffc0bc0c: 38 21 00 18 addi r1,r1,24 ffc0bc10: 4e 80 00 20 blr index_base = _Objects_Get_index( information->minimum_id ); block_count = (information->maximum - index_base) / information->allocation_size; for ( block = 0; block < block_count; block++ ) { if ( information->inactive_per_block[ block ] == ffc0bc14: 3b a0 00 00 li r29,0 <== NOT EXECUTED */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_First( Chain_Control *the_chain ) { return _Chain_Head( the_chain )->next; ffc0bc18: 80 7c 00 20 lwz r3,32(r28) ffc0bc1c: 48 00 00 10 b ffc0bc2c <_Objects_Shrink_information+0xac> if ((index >= index_base) && (index < (index_base + information->allocation_size))) { _Chain_Extract( &extract_me->Node ); } } while ( the_object ); ffc0bc20: 2f 9e 00 00 cmpwi cr7,r30,0 index = _Objects_Get_index( the_object->id ); /* * Get the next node before the node is extracted */ extract_me = the_object; the_object = (Objects_Control *) the_object->Node.next; ffc0bc24: 7f c3 f3 78 mr r3,r30 if ((index >= index_base) && (index < (index_base + information->allocation_size))) { _Chain_Extract( &extract_me->Node ); } } while ( the_object ); ffc0bc28: 41 9e 00 34 beq- cr7,ffc0bc5c <_Objects_Shrink_information+0xdc> * Assume the Inactive chain is never empty at this point */ the_object = (Objects_Control *) _Chain_First( &information->Inactive ); do { index = _Objects_Get_index( the_object->id ); ffc0bc2c: a1 43 00 0a lhz r10,10(r3) /* * Get the next node before the node is extracted */ extract_me = the_object; the_object = (Objects_Control *) the_object->Node.next; ffc0bc30: 83 c3 00 00 lwz r30,0(r3) if ((index >= index_base) && ffc0bc34: 7f 8a f8 40 cmplw cr7,r10,r31 ffc0bc38: 41 bc ff e8 blt- cr7,ffc0bc20 <_Objects_Shrink_information+0xa0> (index < (index_base + information->allocation_size))) { ffc0bc3c: a1 1c 00 14 lhz r8,20(r28) ffc0bc40: 7d 1f 42 14 add r8,r31,r8 /* * Get the next node before the node is extracted */ extract_me = the_object; the_object = (Objects_Control *) the_object->Node.next; if ((index >= index_base) && ffc0bc44: 7f 8a 40 40 cmplw cr7,r10,r8 ffc0bc48: 40 9c ff d8 bge+ cr7,ffc0bc20 <_Objects_Shrink_information+0xa0> (index < (index_base + information->allocation_size))) { _Chain_Extract( &extract_me->Node ); ffc0bc4c: 48 00 40 01 bl ffc0fc4c <_Chain_Extract> } } while ( the_object ); ffc0bc50: 2f 9e 00 00 cmpwi cr7,r30,0 index = _Objects_Get_index( the_object->id ); /* * Get the next node before the node is extracted */ extract_me = the_object; the_object = (Objects_Control *) the_object->Node.next; ffc0bc54: 7f c3 f3 78 mr r3,r30 if ((index >= index_base) && (index < (index_base + information->allocation_size))) { _Chain_Extract( &extract_me->Node ); } } while ( the_object ); ffc0bc58: 40 9e ff d4 bne+ cr7,ffc0bc2c <_Objects_Shrink_information+0xac><== ALWAYS TAKEN /* * Free the memory and reset the structures in the object' information */ _Workspace_Free( information->object_blocks[ block ] ); ffc0bc5c: 81 3c 00 34 lwz r9,52(r28) ffc0bc60: 7c 69 e8 2e lwzx r3,r9,r29 ffc0bc64: 48 00 22 6d bl ffc0ded0 <_Workspace_Free> information->object_blocks[ block ] = NULL; ffc0bc68: 81 3c 00 34 lwz r9,52(r28) return; } index_base += information->allocation_size; } } ffc0bc6c: 80 01 00 1c lwz r0,28(r1) _Workspace_Free( information->object_blocks[ block ] ); information->object_blocks[ block ] = NULL; information->inactive_per_block[ block ] = 0; information->inactive -= information->allocation_size; ffc0bc70: a1 1c 00 2c lhz r8,44(r28) return; } index_base += information->allocation_size; } } ffc0bc74: 7c 08 03 a6 mtlr r0 /* * Free the memory and reset the structures in the object' information */ _Workspace_Free( information->object_blocks[ block ] ); information->object_blocks[ block ] = NULL; ffc0bc78: 7f c9 e9 2e stwx r30,r9,r29 information->inactive_per_block[ block ] = 0; information->inactive -= information->allocation_size; ffc0bc7c: a1 5c 00 14 lhz r10,20(r28) * Free the memory and reset the structures in the object' information */ _Workspace_Free( information->object_blocks[ block ] ); information->object_blocks[ block ] = NULL; information->inactive_per_block[ block ] = 0; ffc0bc80: 81 3c 00 30 lwz r9,48(r28) information->inactive -= information->allocation_size; ffc0bc84: 7d 4a 40 50 subf r10,r10,r8 return; } index_base += information->allocation_size; } } ffc0bc88: 83 e1 00 14 lwz r31,20(r1) * Free the memory and reset the structures in the object' information */ _Workspace_Free( information->object_blocks[ block ] ); information->object_blocks[ block ] = NULL; information->inactive_per_block[ block ] = 0; ffc0bc8c: 7f c9 e9 2e stwx r30,r9,r29 information->inactive -= information->allocation_size; ffc0bc90: b1 5c 00 2c sth r10,44(r28) return; } index_base += information->allocation_size; } } ffc0bc94: 83 a1 00 0c lwz r29,12(r1) ffc0bc98: 83 81 00 08 lwz r28,8(r1) ffc0bc9c: 83 c1 00 10 lwz r30,16(r1) ffc0bca0: 38 21 00 18 addi r1,r1,24 ffc0bca4: 4e 80 00 20 blr =============================================================================== ffc0c8c0 <_RBTree_Extract_unprotected>: */ void _RBTree_Extract_unprotected( RBTree_Control *the_rbtree, RBTree_Node *the_node ) { ffc0c8c0: 94 21 ff e8 stwu r1,-24(r1) ffc0c8c4: 7c 08 02 a6 mflr r0 ffc0c8c8: 93 c1 00 10 stw r30,16(r1) RBTree_Node *leaf, *target; RBTree_Color victim_color; RBTree_Direction dir; if (!the_node) return; ffc0c8cc: 7c 9e 23 79 mr. r30,r4 */ void _RBTree_Extract_unprotected( RBTree_Control *the_rbtree, RBTree_Node *the_node ) { ffc0c8d0: 90 01 00 1c stw r0,28(r1) ffc0c8d4: 93 81 00 08 stw r28,8(r1) ffc0c8d8: 93 a1 00 0c stw r29,12(r1) ffc0c8dc: 93 e1 00 14 stw r31,20(r1) RBTree_Node *leaf, *target; RBTree_Color victim_color; RBTree_Direction dir; if (!the_node) return; ffc0c8e0: 41 82 01 14 beq- ffc0c9f4 <_RBTree_Extract_unprotected+0x134> /* check if min needs to be updated */ if (the_node == the_rbtree->first[RBT_LEFT]) { ffc0c8e4: 81 23 00 08 lwz r9,8(r3) ffc0c8e8: 7c 7c 1b 78 mr r28,r3 ffc0c8ec: 7f 89 f0 00 cmpw cr7,r9,r30 ffc0c8f0: 41 9e 01 6c beq- cr7,ffc0ca5c <_RBTree_Extract_unprotected+0x19c> the_rbtree->first[RBT_LEFT] = next; } /* 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]) { ffc0c8f4: 81 3c 00 0c lwz r9,12(r28) ffc0c8f8: 7f 89 f0 00 cmpw cr7,r9,r30 ffc0c8fc: 41 9e 01 74 beq- cr7,ffc0ca70 <_RBTree_Extract_unprotected+0x1b0> * 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]) { ffc0c900: 83 fe 00 04 lwz r31,4(r30) ffc0c904: 2f 9f 00 00 cmpwi cr7,r31,0 ffc0c908: 41 9e 01 88 beq- cr7,ffc0ca90 <_RBTree_Extract_unprotected+0x1d0> ffc0c90c: 81 3e 00 08 lwz r9,8(r30) ffc0c910: 2f 89 00 00 cmpwi cr7,r9,0 ffc0c914: 40 be 00 0c bne+ cr7,ffc0c920 <_RBTree_Extract_unprotected+0x60> ffc0c918: 48 00 01 0c b ffc0ca24 <_RBTree_Extract_unprotected+0x164> target = the_node->child[RBT_LEFT]; /* find max in node->child[RBT_LEFT] */ while (target->child[RBT_RIGHT]) target = target->child[RBT_RIGHT]; ffc0c91c: 7d 3f 4b 78 mr r31,r9 ffc0c920: 81 3f 00 08 lwz r9,8(r31) ffc0c924: 2f 89 00 00 cmpwi cr7,r9,0 ffc0c928: 40 9e ff f4 bne+ cr7,ffc0c91c <_RBTree_Extract_unprotected+0x5c> * 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]; ffc0c92c: 83 bf 00 04 lwz r29,4(r31) if(leaf) { ffc0c930: 2f 9d 00 00 cmpwi cr7,r29,0 ffc0c934: 41 9e 01 50 beq- cr7,ffc0ca84 <_RBTree_Extract_unprotected+0x1c4> leaf->parent = target->parent; ffc0c938: 81 3f 00 00 lwz r9,0(r31) ffc0c93c: 91 3d 00 00 stw r9,0(r29) } else { /* fix the tree here if the child is a null leaf. */ _RBTree_Extract_validate_unprotected(target); } victim_color = target->color; dir = target != target->parent->child[0]; ffc0c940: 80 ff 00 00 lwz r7,0(r31) target->parent->child[dir] = leaf; /* now replace the_node with target */ dir = the_node != the_node->parent->child[0]; ffc0c944: 81 1e 00 00 lwz r8,0(r30) } else { /* fix the tree here if the child is a null leaf. */ _RBTree_Extract_validate_unprotected(target); } victim_color = target->color; dir = target != target->parent->child[0]; ffc0c948: 81 27 00 04 lwz r9,4(r7) 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; ffc0c94c: 81 5f 00 0c lwz r10,12(r31) dir = target != target->parent->child[0]; ffc0c950: 7f e9 4a 78 xor r9,r31,r9 ffc0c954: 7d 29 00 34 cntlzw r9,r9 ffc0c958: 55 29 d9 7e rlwinm r9,r9,27,5,31 ffc0c95c: 69 29 00 01 xori r9,r9,1 target->parent->child[dir] = leaf; ffc0c960: 55 29 10 3a rlwinm r9,r9,2,0,29 ffc0c964: 7c e7 4a 14 add r7,r7,r9 ffc0c968: 93 a7 00 04 stw r29,4(r7) /* now replace the_node with target */ dir = the_node != the_node->parent->child[0]; ffc0c96c: 81 28 00 04 lwz r9,4(r8) ffc0c970: 7f c9 4a 78 xor r9,r30,r9 ffc0c974: 7d 29 00 34 cntlzw r9,r9 ffc0c978: 55 29 d9 7e rlwinm r9,r9,27,5,31 ffc0c97c: 69 29 00 01 xori r9,r9,1 the_node->parent->child[dir] = target; ffc0c980: 55 29 10 3a rlwinm r9,r9,2,0,29 ffc0c984: 7d 08 4a 14 add r8,r8,r9 ffc0c988: 93 e8 00 04 stw r31,4(r8) /* set target's new children to the original node's children */ target->child[RBT_RIGHT] = the_node->child[RBT_RIGHT]; ffc0c98c: 81 3e 00 08 lwz r9,8(r30) ffc0c990: 91 3f 00 08 stw r9,8(r31) if (the_node->child[RBT_RIGHT]) ffc0c994: 81 3e 00 08 lwz r9,8(r30) ffc0c998: 2f 89 00 00 cmpwi cr7,r9,0 ffc0c99c: 41 9e 00 08 beq- cr7,ffc0c9a4 <_RBTree_Extract_unprotected+0xe4><== NEVER TAKEN the_node->child[RBT_RIGHT]->parent = target; ffc0c9a0: 93 e9 00 00 stw r31,0(r9) target->child[RBT_LEFT] = the_node->child[RBT_LEFT]; ffc0c9a4: 81 3e 00 04 lwz r9,4(r30) ffc0c9a8: 91 3f 00 04 stw r9,4(r31) if (the_node->child[RBT_LEFT]) ffc0c9ac: 81 3e 00 04 lwz r9,4(r30) ffc0c9b0: 2f 89 00 00 cmpwi cr7,r9,0 ffc0c9b4: 41 9e 00 08 beq- cr7,ffc0c9bc <_RBTree_Extract_unprotected+0xfc> the_node->child[RBT_LEFT]->parent = target; ffc0c9b8: 93 e9 00 00 stw r31,0(r9) /* 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; ffc0c9bc: 81 1e 00 00 lwz r8,0(r30) target->color = the_node->color; ffc0c9c0: 81 3e 00 0c lwz r9,12(r30) /* 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; ffc0c9c4: 91 1f 00 00 stw r8,0(r31) target->color = the_node->color; ffc0c9c8: 91 3f 00 0c stw r9,12(r31) /* 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 */ ffc0c9cc: 2f 8a 00 00 cmpwi cr7,r10,0 ffc0c9d0: 41 9e 00 44 beq- cr7,ffc0ca14 <_RBTree_Extract_unprotected+0x154> /* 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; ffc0c9d4: 81 5c 00 04 lwz r10,4(r28) */ RTEMS_INLINE_ROUTINE void _RBTree_Set_off_rbtree( RBTree_Node *node ) { node->parent = node->child[RBT_LEFT] = node->child[RBT_RIGHT] = NULL; ffc0c9d8: 39 20 00 00 li r9,0 ffc0c9dc: 91 3e 00 08 stw r9,8(r30) ffc0c9e0: 2f 8a 00 00 cmpwi cr7,r10,0 ffc0c9e4: 91 3e 00 04 stw r9,4(r30) ffc0c9e8: 91 3e 00 00 stw r9,0(r30) ffc0c9ec: 41 9e 00 08 beq- cr7,ffc0c9f4 <_RBTree_Extract_unprotected+0x134> ffc0c9f0: 91 2a 00 0c stw r9,12(r10) } ffc0c9f4: 80 01 00 1c lwz r0,28(r1) ffc0c9f8: 83 81 00 08 lwz r28,8(r1) ffc0c9fc: 7c 08 03 a6 mtlr r0 ffc0ca00: 83 a1 00 0c lwz r29,12(r1) ffc0ca04: 83 c1 00 10 lwz r30,16(r1) ffc0ca08: 83 e1 00 14 lwz r31,20(r1) ffc0ca0c: 38 21 00 18 addi r1,r1,24 ffc0ca10: 4e 80 00 20 blr * 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 */ if (leaf) { ffc0ca14: 2f 9d 00 00 cmpwi cr7,r29,0 ffc0ca18: 41 be ff bc beq- cr7,ffc0c9d4 <_RBTree_Extract_unprotected+0x114> leaf->color = RBT_BLACK; /* case 2 */ ffc0ca1c: 91 5d 00 0c stw r10,12(r29) ffc0ca20: 4b ff ff b4 b ffc0c9d4 <_RBTree_Extract_unprotected+0x114> * 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]) { ffc0ca24: 7f fd fb 78 mr r29,r31 * 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 ) { leaf->parent = the_node->parent; ffc0ca28: 81 3e 00 00 lwz r9,0(r30) ffc0ca2c: 91 3d 00 00 stw r9,0(r29) _RBTree_Extract_validate_unprotected(the_node); } victim_color = the_node->color; /* remove the_node from the tree */ dir = the_node != the_node->parent->child[0]; ffc0ca30: 81 1e 00 00 lwz r8,0(r30) 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; ffc0ca34: 81 5e 00 0c lwz r10,12(r30) /* remove the_node from the tree */ dir = the_node != the_node->parent->child[0]; ffc0ca38: 81 28 00 04 lwz r9,4(r8) ffc0ca3c: 7f c9 4a 78 xor r9,r30,r9 ffc0ca40: 7d 29 00 34 cntlzw r9,r9 ffc0ca44: 55 29 d9 7e rlwinm r9,r9,27,5,31 ffc0ca48: 69 29 00 01 xori r9,r9,1 the_node->parent->child[dir] = leaf; ffc0ca4c: 55 29 10 3a rlwinm r9,r9,2,0,29 ffc0ca50: 7d 08 4a 14 add r8,r8,r9 ffc0ca54: 93 a8 00 04 stw r29,4(r8) ffc0ca58: 4b ff ff 74 b ffc0c9cc <_RBTree_Extract_unprotected+0x10c> */ RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_Successor_unprotected( const RBTree_Node *node ) { return _RBTree_Next_unprotected( node, RBT_RIGHT ); ffc0ca5c: 7f c3 f3 78 mr r3,r30 ffc0ca60: 38 80 00 01 li r4,1 ffc0ca64: 48 00 04 99 bl ffc0cefc <_RBTree_Next_unprotected> /* check if min needs to be updated */ if (the_node == the_rbtree->first[RBT_LEFT]) { RBTree_Node *next; next = _RBTree_Successor_unprotected(the_node); the_rbtree->first[RBT_LEFT] = next; ffc0ca68: 90 7c 00 08 stw r3,8(r28) ffc0ca6c: 4b ff fe 88 b ffc0c8f4 <_RBTree_Extract_unprotected+0x34> */ RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_Predecessor_unprotected( const RBTree_Node *node ) { return _RBTree_Next_unprotected( node, RBT_LEFT ); ffc0ca70: 7f c3 f3 78 mr r3,r30 ffc0ca74: 38 80 00 00 li r4,0 ffc0ca78: 48 00 04 85 bl ffc0cefc <_RBTree_Next_unprotected> /* 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]) { RBTree_Node *previous; previous = _RBTree_Predecessor_unprotected(the_node); the_rbtree->first[RBT_RIGHT] = previous; ffc0ca7c: 90 7c 00 0c stw r3,12(r28) ffc0ca80: 4b ff fe 80 b ffc0c900 <_RBTree_Extract_unprotected+0x40> leaf = target->child[RBT_LEFT]; if(leaf) { leaf->parent = target->parent; } else { /* fix the tree here if the child is a null leaf. */ _RBTree_Extract_validate_unprotected(target); ffc0ca84: 7f e3 fb 78 mr r3,r31 ffc0ca88: 4b ff fb 2d bl ffc0c5b4 <_RBTree_Extract_validate_unprotected> ffc0ca8c: 4b ff fe b4 b ffc0c940 <_RBTree_Extract_unprotected+0x80> * the_node's location in the tree. This may cause the coloring to be * 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]; ffc0ca90: 83 be 00 08 lwz r29,8(r30) if( leaf ) { ffc0ca94: 2f 9d 00 00 cmpwi cr7,r29,0 ffc0ca98: 40 9e ff 90 bne+ cr7,ffc0ca28 <_RBTree_Extract_unprotected+0x168> leaf->parent = the_node->parent; } else { /* fix the tree here if the child is a null leaf. */ _RBTree_Extract_validate_unprotected(the_node); ffc0ca9c: 7f c3 f3 78 mr r3,r30 ffc0caa0: 4b ff fb 15 bl ffc0c5b4 <_RBTree_Extract_validate_unprotected> ffc0caa4: 4b ff ff 8c b ffc0ca30 <_RBTree_Extract_unprotected+0x170> =============================================================================== ffc0c5b4 <_RBTree_Extract_validate_unprotected>: ) { RBTree_Node *parent, *sibling; RBTree_Direction dir; parent = the_node->parent; ffc0c5b4: 81 23 00 00 lwz r9,0(r3) if(!parent->parent) return; ffc0c5b8: 81 49 00 00 lwz r10,0(r9) ffc0c5bc: 2f 8a 00 00 cmpwi cr7,r10,0 ffc0c5c0: 4d 9e 00 20 beqlr cr7 { 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]) ffc0c5c4: 81 49 00 04 lwz r10,4(r9) ffc0c5c8: 7f 83 50 00 cmpw cr7,r3,r10 ffc0c5cc: 41 9e 02 d0 beq- cr7,ffc0c89c <_RBTree_Extract_validate_unprotected+0x2e8> * Now the_node has a black sibling and red parent. After rotation, * update sibling pointer. */ if (_RBTree_Is_red(sibling)) { parent->color = RBT_RED; sibling->color = RBT_BLACK; ffc0c5d0: 38 80 00 00 li r4,0 } /* sibling is black, see if both of its children are also black. */ if (!_RBTree_Is_red(sibling->child[RBT_RIGHT]) && !_RBTree_Is_red(sibling->child[RBT_LEFT])) { sibling->color = RBT_RED; ffc0c5d4: 38 c0 00 01 li r6,1 ffc0c5d8: 48 00 00 90 b ffc0c668 <_RBTree_Extract_validate_unprotected+0xb4> if(!parent->parent) return; sibling = _RBTree_Sibling(the_node); /* continue to correct tree as long as the_node is black and not the root */ while (!_RBTree_Is_red(the_node) && parent->parent) { ffc0c5dc: 81 09 00 00 lwz r8,0(r9) ffc0c5e0: 2f 88 00 00 cmpwi cr7,r8,0 ffc0c5e4: 41 9e 00 90 beq- cr7,ffc0c674 <_RBTree_Extract_validate_unprotected+0xc0> */ RTEMS_INLINE_ROUTINE bool _RBTree_Is_red( const RBTree_Node *the_node ) { return (the_node && the_node->color == RBT_RED); ffc0c5e8: 2f 8a 00 00 cmpwi cr7,r10,0 ffc0c5ec: 41 9e 00 10 beq- cr7,ffc0c5fc <_RBTree_Extract_validate_unprotected+0x48><== NEVER TAKEN ffc0c5f0: 80 ea 00 0c lwz r7,12(r10) ffc0c5f4: 2f 87 00 01 cmpwi cr7,r7,1 ffc0c5f8: 41 9e 01 68 beq- cr7,ffc0c760 <_RBTree_Extract_validate_unprotected+0x1ac> _RBTree_Rotate(parent, dir); sibling = parent->child[_RBTree_Opposite_direction(dir)]; } /* sibling is black, see if both of its children are also black. */ if (!_RBTree_Is_red(sibling->child[RBT_RIGHT]) && ffc0c5fc: 81 0a 00 08 lwz r8,8(r10) ffc0c600: 2f 88 00 00 cmpwi cr7,r8,0 ffc0c604: 41 9e 00 10 beq- cr7,ffc0c614 <_RBTree_Extract_validate_unprotected+0x60> ffc0c608: 81 08 00 0c lwz r8,12(r8) ffc0c60c: 2f 88 00 01 cmpwi cr7,r8,1 ffc0c610: 41 9e 00 7c beq- cr7,ffc0c68c <_RBTree_Extract_validate_unprotected+0xd8> !_RBTree_Is_red(sibling->child[RBT_LEFT])) { ffc0c614: 81 0a 00 04 lwz r8,4(r10) ffc0c618: 2f 88 00 00 cmpwi cr7,r8,0 ffc0c61c: 41 9e 00 10 beq- cr7,ffc0c62c <_RBTree_Extract_validate_unprotected+0x78> ffc0c620: 81 08 00 0c lwz r8,12(r8) ffc0c624: 2f 88 00 01 cmpwi cr7,r8,1 ffc0c628: 41 9e 00 64 beq- cr7,ffc0c68c <_RBTree_Extract_validate_unprotected+0xd8> sibling->color = RBT_RED; ffc0c62c: 90 ca 00 0c stw r6,12(r10) ffc0c630: 81 49 00 0c lwz r10,12(r9) ffc0c634: 2f 8a 00 01 cmpwi cr7,r10,1 ffc0c638: 41 9e 02 6c beq- cr7,ffc0c8a4 <_RBTree_Extract_validate_unprotected+0x2f0> if (_RBTree_Is_red(parent)) { parent->color = RBT_BLACK; break; } the_node = parent; /* done if parent is red */ parent = the_node->parent; ffc0c63c: 81 09 00 00 lwz r8,0(r9) RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_Sibling( const RBTree_Node *the_node ) { if(!the_node) return NULL; if(!(the_node->parent)) return NULL; ffc0c640: 2f 88 00 00 cmpwi cr7,r8,0 ffc0c644: 41 9e 01 b0 beq- cr7,ffc0c7f4 <_RBTree_Extract_validate_unprotected+0x240><== NEVER TAKEN if(!(the_node->parent->parent)) return NULL; ffc0c648: 81 48 00 00 lwz r10,0(r8) ffc0c64c: 2f 8a 00 00 cmpwi cr7,r10,0 ffc0c650: 41 9e 01 a4 beq- cr7,ffc0c7f4 <_RBTree_Extract_validate_unprotected+0x240> if(the_node == the_node->parent->child[RBT_LEFT]) ffc0c654: 81 48 00 04 lwz r10,4(r8) ffc0c658: 7f 89 50 00 cmpw cr7,r9,r10 ffc0c65c: 41 9e 01 a0 beq- cr7,ffc0c7fc <_RBTree_Extract_validate_unprotected+0x248> ffc0c660: 7d 23 4b 78 mr r3,r9 RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_Sibling( const RBTree_Node *the_node ) { if(!the_node) return NULL; if(!(the_node->parent)) return NULL; ffc0c664: 7d 09 43 78 mr r9,r8 */ RTEMS_INLINE_ROUTINE bool _RBTree_Is_red( const RBTree_Node *the_node ) { return (the_node && the_node->color == RBT_RED); ffc0c668: 81 03 00 0c lwz r8,12(r3) ffc0c66c: 2f 88 00 01 cmpwi cr7,r8,1 ffc0c670: 40 9e ff 6c bne+ cr7,ffc0c5dc <_RBTree_Extract_validate_unprotected+0x28> sibling->child[_RBTree_Opposite_direction(dir)]->color = RBT_BLACK; _RBTree_Rotate(parent, dir); break; /* done */ } } /* while */ if(!the_node->parent->parent) the_node->color = RBT_BLACK; ffc0c674: 81 23 00 00 lwz r9,0(r3) ffc0c678: 81 29 00 00 lwz r9,0(r9) ffc0c67c: 2f 89 00 00 cmpwi cr7,r9,0 ffc0c680: 4c be 00 20 bnelr+ cr7 ffc0c684: 91 23 00 0c stw r9,12(r3) ffc0c688: 4e 80 00 20 blr * cases, either the_node is to the left or the right of the parent. * In both cases, first check if one of sibling's children is black, * and if so rotate in the proper direction and update sibling pointer. * Then switch the sibling and parent colors, and rotate through parent. */ dir = the_node != parent->child[0]; ffc0c68c: 81 09 00 04 lwz r8,4(r9) ffc0c690: 7c 68 42 78 xor r8,r3,r8 ffc0c694: 7d 08 00 34 cntlzw r8,r8 ffc0c698: 55 08 d9 7e rlwinm r8,r8,27,5,31 ffc0c69c: 69 08 00 01 xori r8,r8,1 */ RTEMS_INLINE_ROUTINE RBTree_Direction _RBTree_Opposite_direction( RBTree_Direction the_dir ) { return (RBTree_Direction) !((int) the_dir); ffc0c6a0: 69 07 00 01 xori r7,r8,1 if (!_RBTree_Is_red(sibling->child[_RBTree_Opposite_direction(dir)])) { ffc0c6a4: 54 e7 10 3a rlwinm r7,r7,2,0,29 ffc0c6a8: 7c ca 3a 14 add r6,r10,r7 ffc0c6ac: 80 c6 00 04 lwz r6,4(r6) */ RTEMS_INLINE_ROUTINE bool _RBTree_Is_red( const RBTree_Node *the_node ) { return (the_node && the_node->color == RBT_RED); ffc0c6b0: 2f 86 00 00 cmpwi cr7,r6,0 ffc0c6b4: 41 9e 00 10 beq- cr7,ffc0c6c4 <_RBTree_Extract_validate_unprotected+0x110> ffc0c6b8: 80 a6 00 0c lwz r5,12(r6) ffc0c6bc: 2f 85 00 01 cmpwi cr7,r5,1 ffc0c6c0: 41 9e 01 4c beq- cr7,ffc0c80c <_RBTree_Extract_validate_unprotected+0x258> sibling->color = RBT_RED; sibling->child[dir]->color = RBT_BLACK; ffc0c6c4: 55 08 10 3a rlwinm r8,r8,2,0,29 ffc0c6c8: 7c aa 42 14 add r5,r10,r8 ffc0c6cc: 80 c5 00 04 lwz r6,4(r5) * and if so rotate in the proper direction and update sibling pointer. * Then switch the sibling and parent colors, and rotate through parent. */ dir = the_node != parent->child[0]; if (!_RBTree_Is_red(sibling->child[_RBTree_Opposite_direction(dir)])) { sibling->color = RBT_RED; ffc0c6d0: 38 80 00 01 li r4,1 ffc0c6d4: 90 8a 00 0c stw r4,12(r10) sibling->child[dir]->color = RBT_BLACK; ffc0c6d8: 38 80 00 00 li r4,0 RBTree_Direction dir ) { RBTree_Node *c; if (the_node == NULL) return; if (the_node->child[_RBTree_Opposite_direction(dir)] == NULL) return; ffc0c6dc: 2f 86 00 00 cmpwi cr7,r6,0 ffc0c6e0: 90 86 00 0c stw r4,12(r6) ffc0c6e4: 41 9e 00 54 beq- cr7,ffc0c738 <_RBTree_Extract_validate_unprotected+0x184><== NEVER TAKEN c = the_node->child[_RBTree_Opposite_direction(dir)]; the_node->child[_RBTree_Opposite_direction(dir)] = c->child[dir]; ffc0c6e8: 7c 86 3a 14 add r4,r6,r7 ffc0c6ec: 81 64 00 04 lwz r11,4(r4) ffc0c6f0: 91 65 00 04 stw r11,4(r5) if (c->child[dir]) ffc0c6f4: 80 a4 00 04 lwz r5,4(r4) ffc0c6f8: 2f 85 00 00 cmpwi cr7,r5,0 ffc0c6fc: 41 9e 00 08 beq- cr7,ffc0c704 <_RBTree_Extract_validate_unprotected+0x150> c->child[dir]->parent = the_node; ffc0c700: 91 45 00 00 stw r10,0(r5) c->child[dir] = the_node; ffc0c704: 7c a6 3a 14 add r5,r6,r7 the_node->parent->child[the_node != the_node->parent->child[0]] = c; ffc0c708: 80 8a 00 00 lwz r4,0(r10) 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; ffc0c70c: 91 45 00 04 stw r10,4(r5) the_node->parent->child[the_node != the_node->parent->child[0]] = c; ffc0c710: 80 a4 00 04 lwz r5,4(r4) c->parent = the_node->parent; ffc0c714: 90 86 00 00 stw r4,0(r6) 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; ffc0c718: 7d 45 2a 78 xor r5,r10,r5 ffc0c71c: 7c a5 00 34 cntlzw r5,r5 c->parent = the_node->parent; the_node->parent = c; ffc0c720: 90 ca 00 00 stw r6,0(r10) 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; ffc0c724: 54 a5 d9 7e rlwinm r5,r5,27,5,31 ffc0c728: 68 a5 00 01 xori r5,r5,1 ffc0c72c: 54 a5 10 3a rlwinm r5,r5,2,0,29 ffc0c730: 7c 84 2a 14 add r4,r4,r5 ffc0c734: 90 c4 00 04 stw r6,4(r4) _RBTree_Rotate(sibling, _RBTree_Opposite_direction(dir)); sibling = parent->child[_RBTree_Opposite_direction(dir)]; ffc0c738: 7d 49 3a 14 add r10,r9,r7 } sibling->color = parent->color; ffc0c73c: 80 c9 00 0c lwz r6,12(r9) dir = the_node != parent->child[0]; if (!_RBTree_Is_red(sibling->child[_RBTree_Opposite_direction(dir)])) { sibling->color = RBT_RED; sibling->child[dir]->color = RBT_BLACK; _RBTree_Rotate(sibling, _RBTree_Opposite_direction(dir)); sibling = parent->child[_RBTree_Opposite_direction(dir)]; ffc0c740: 80 aa 00 04 lwz r5,4(r10) ffc0c744: 7d 45 3a 14 add r10,r5,r7 } sibling->color = parent->color; ffc0c748: 90 c5 00 0c stw r6,12(r5) ffc0c74c: 80 8a 00 04 lwz r4,4(r10) parent->color = RBT_BLACK; ffc0c750: 39 40 00 00 li r10,0 ffc0c754: 91 49 00 0c stw r10,12(r9) sibling->child[_RBTree_Opposite_direction(dir)]->color = RBT_BLACK; ffc0c758: 91 44 00 0c stw r10,12(r4) ffc0c75c: 48 00 00 d8 b ffc0c834 <_RBTree_Extract_validate_unprotected+0x280> * update sibling pointer. */ if (_RBTree_Is_red(sibling)) { parent->color = RBT_RED; sibling->color = RBT_BLACK; dir = the_node != parent->child[0]; ffc0c760: 80 a9 00 04 lwz r5,4(r9) * then rotate parent left, making the sibling be the_node's grandparent. * Now the_node has a black sibling and red parent. After rotation, * update sibling pointer. */ if (_RBTree_Is_red(sibling)) { parent->color = RBT_RED; ffc0c764: 90 e9 00 0c stw r7,12(r9) sibling->color = RBT_BLACK; dir = the_node != parent->child[0]; ffc0c768: 7c 67 2a 78 xor r7,r3,r5 ffc0c76c: 7c e7 00 34 cntlzw r7,r7 * Now the_node has a black sibling and red parent. After rotation, * update sibling pointer. */ if (_RBTree_Is_red(sibling)) { parent->color = RBT_RED; sibling->color = RBT_BLACK; ffc0c770: 90 8a 00 0c stw r4,12(r10) dir = the_node != parent->child[0]; ffc0c774: 54 e7 d9 7e rlwinm r7,r7,27,5,31 ffc0c778: 68 e0 00 01 xori r0,r7,1 */ RTEMS_INLINE_ROUTINE RBTree_Direction _RBTree_Opposite_direction( RBTree_Direction the_dir ) { return (RBTree_Direction) !((int) the_dir); ffc0c77c: 68 0b 00 01 xori r11,r0,1 RBTree_Direction dir ) { RBTree_Node *c; if (the_node == NULL) return; if (the_node->child[_RBTree_Opposite_direction(dir)] == NULL) return; ffc0c780: 55 6b 10 3a rlwinm r11,r11,2,0,29 ffc0c784: 7c a9 5a 14 add r5,r9,r11 ffc0c788: 80 e5 00 04 lwz r7,4(r5) ffc0c78c: 2f 87 00 00 cmpwi cr7,r7,0 ffc0c790: 41 9e 00 74 beq- cr7,ffc0c804 <_RBTree_Extract_validate_unprotected+0x250><== NEVER TAKEN c = the_node->child[_RBTree_Opposite_direction(dir)]; the_node->child[_RBTree_Opposite_direction(dir)] = c->child[dir]; ffc0c794: 54 00 10 3a rlwinm r0,r0,2,0,29 ffc0c798: 7d 47 02 14 add r10,r7,r0 ffc0c79c: 81 8a 00 04 lwz r12,4(r10) ffc0c7a0: 91 85 00 04 stw r12,4(r5) if (c->child[dir]) ffc0c7a4: 81 4a 00 04 lwz r10,4(r10) ffc0c7a8: 2f 8a 00 00 cmpwi cr7,r10,0 ffc0c7ac: 41 9e 00 0c beq- cr7,ffc0c7b8 <_RBTree_Extract_validate_unprotected+0x204><== NEVER TAKEN c->child[dir]->parent = the_node; ffc0c7b0: 91 2a 00 00 stw r9,0(r10) ffc0c7b4: 81 09 00 00 lwz r8,0(r9) c->child[dir] = the_node; ffc0c7b8: 7d 47 02 14 add r10,r7,r0 the_node->parent->child[the_node != the_node->parent->child[0]] = c; c->parent = the_node->parent; ffc0c7bc: 91 07 00 00 stw r8,0(r7) ffc0c7c0: 7d 69 5a 14 add r11,r9,r11 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; ffc0c7c4: 91 2a 00 04 stw r9,4(r10) the_node->parent->child[the_node != the_node->parent->child[0]] = c; ffc0c7c8: 81 48 00 04 lwz r10,4(r8) c->parent = the_node->parent; the_node->parent = c; ffc0c7cc: 90 e9 00 00 stw r7,0(r9) 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; ffc0c7d0: 7d 2a 52 78 xor r10,r9,r10 ffc0c7d4: 7d 4a 00 34 cntlzw r10,r10 ffc0c7d8: 55 4a d9 7e rlwinm r10,r10,27,5,31 ffc0c7dc: 69 4a 00 01 xori r10,r10,1 ffc0c7e0: 55 4a 10 3a rlwinm r10,r10,2,0,29 ffc0c7e4: 7d 08 52 14 add r8,r8,r10 ffc0c7e8: 90 e8 00 04 stw r7,4(r8) ffc0c7ec: 81 4b 00 04 lwz r10,4(r11) ffc0c7f0: 4b ff fe 0c b ffc0c5fc <_RBTree_Extract_validate_unprotected+0x48> RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_Sibling( const RBTree_Node *the_node ) { if(!the_node) return NULL; if(!(the_node->parent)) return NULL; ffc0c7f4: 39 40 00 00 li r10,0 ffc0c7f8: 4b ff fe 68 b ffc0c660 <_RBTree_Extract_validate_unprotected+0xac> if(!(the_node->parent->parent)) return NULL; if(the_node == the_node->parent->child[RBT_LEFT]) return the_node->parent->child[RBT_RIGHT]; ffc0c7fc: 81 48 00 08 lwz r10,8(r8) ffc0c800: 4b ff fe 60 b ffc0c660 <_RBTree_Extract_validate_unprotected+0xac> RBTree_Direction dir ) { RBTree_Node *c; if (the_node == NULL) return; if (the_node->child[_RBTree_Opposite_direction(dir)] == NULL) return; ffc0c804: 39 40 00 00 li r10,0 <== NOT EXECUTED ffc0c808: 4b ff fd f4 b ffc0c5fc <_RBTree_Extract_validate_unprotected+0x48><== NOT EXECUTED ffc0c80c: 7c a9 3a 14 add r5,r9,r7 sibling->color = RBT_RED; sibling->child[dir]->color = RBT_BLACK; _RBTree_Rotate(sibling, _RBTree_Opposite_direction(dir)); sibling = parent->child[_RBTree_Opposite_direction(dir)]; } sibling->color = parent->color; ffc0c810: 81 69 00 0c lwz r11,12(r9) ffc0c814: 80 a5 00 04 lwz r5,4(r5) parent->color = RBT_BLACK; ffc0c818: 38 80 00 00 li r4,0 sibling->color = RBT_RED; sibling->child[dir]->color = RBT_BLACK; _RBTree_Rotate(sibling, _RBTree_Opposite_direction(dir)); sibling = parent->child[_RBTree_Opposite_direction(dir)]; } sibling->color = parent->color; ffc0c81c: 91 6a 00 0c stw r11,12(r10) ffc0c820: 2f 85 00 00 cmpwi cr7,r5,0 parent->color = RBT_BLACK; ffc0c824: 90 89 00 0c stw r4,12(r9) sibling->child[_RBTree_Opposite_direction(dir)]->color = RBT_BLACK; ffc0c828: 90 86 00 0c stw r4,12(r6) ffc0c82c: 41 be fe 48 beq- cr7,ffc0c674 <_RBTree_Extract_validate_unprotected+0xc0><== NEVER TAKEN ffc0c830: 55 08 10 3a rlwinm r8,r8,2,0,29 c = the_node->child[_RBTree_Opposite_direction(dir)]; the_node->child[_RBTree_Opposite_direction(dir)] = c->child[dir]; ffc0c834: 7d 45 42 14 add r10,r5,r8 ffc0c838: 80 ca 00 04 lwz r6,4(r10) ffc0c83c: 7c e9 3a 14 add r7,r9,r7 ffc0c840: 90 c7 00 04 stw r6,4(r7) if (c->child[dir]) ffc0c844: 81 4a 00 04 lwz r10,4(r10) ffc0c848: 2f 8a 00 00 cmpwi cr7,r10,0 ffc0c84c: 41 9e 00 08 beq- cr7,ffc0c854 <_RBTree_Extract_validate_unprotected+0x2a0> c->child[dir]->parent = the_node; ffc0c850: 91 2a 00 00 stw r9,0(r10) c->child[dir] = the_node; ffc0c854: 7d 05 42 14 add r8,r5,r8 the_node->parent->child[the_node != the_node->parent->child[0]] = c; ffc0c858: 80 e9 00 00 lwz r7,0(r9) 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; ffc0c85c: 91 28 00 04 stw r9,4(r8) the_node->parent->child[the_node != the_node->parent->child[0]] = c; c->parent = the_node->parent; ffc0c860: 90 e5 00 00 stw r7,0(r5) 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; ffc0c864: 81 47 00 04 lwz r10,4(r7) c->parent = the_node->parent; the_node->parent = c; ffc0c868: 90 a9 00 00 stw r5,0(r9) 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; ffc0c86c: 7d 2a 52 78 xor r10,r9,r10 _RBTree_Rotate(parent, dir); break; /* done */ } } /* while */ if(!the_node->parent->parent) the_node->color = RBT_BLACK; ffc0c870: 81 23 00 00 lwz r9,0(r3) ffc0c874: 7d 4a 00 34 cntlzw r10,r10 ffc0c878: 55 4a d9 7e rlwinm r10,r10,27,5,31 ffc0c87c: 81 29 00 00 lwz r9,0(r9) ffc0c880: 69 4a 00 01 xori r10,r10,1 ffc0c884: 55 4a 10 3a rlwinm r10,r10,2,0,29 ffc0c888: 2f 89 00 00 cmpwi cr7,r9,0 ffc0c88c: 7c e7 52 14 add r7,r7,r10 ffc0c890: 90 a7 00 04 stw r5,4(r7) ffc0c894: 4c be 00 20 bnelr+ cr7 ffc0c898: 4b ff fd ec b ffc0c684 <_RBTree_Extract_validate_unprotected+0xd0><== NOT EXECUTED 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]) return the_node->parent->child[RBT_RIGHT]; ffc0c89c: 81 49 00 08 lwz r10,8(r9) ffc0c8a0: 4b ff fd 30 b ffc0c5d0 <_RBTree_Extract_validate_unprotected+0x1c> /* sibling is black, see if both of its children are also black. */ if (!_RBTree_Is_red(sibling->child[RBT_RIGHT]) && !_RBTree_Is_red(sibling->child[RBT_LEFT])) { sibling->color = RBT_RED; if (_RBTree_Is_red(parent)) { parent->color = RBT_BLACK; ffc0c8a4: 39 40 00 00 li r10,0 ffc0c8a8: 91 49 00 0c stw r10,12(r9) sibling->child[_RBTree_Opposite_direction(dir)]->color = RBT_BLACK; _RBTree_Rotate(parent, dir); break; /* done */ } } /* while */ if(!the_node->parent->parent) the_node->color = RBT_BLACK; ffc0c8ac: 81 23 00 00 lwz r9,0(r3) ffc0c8b0: 81 29 00 00 lwz r9,0(r9) ffc0c8b4: 2f 89 00 00 cmpwi cr7,r9,0 ffc0c8b8: 4c be 00 20 bnelr+ cr7 ffc0c8bc: 4b ff fd c8 b ffc0c684 <_RBTree_Extract_validate_unprotected+0xd0><== NOT EXECUTED =============================================================================== ffc0cc64 <_RBTree_Find>: RBTree_Node *_RBTree_Find( RBTree_Control *the_rbtree, RBTree_Node *search_node ) { ffc0cc64: 94 21 ff e0 stwu r1,-32(r1) ffc0cc68: 7c 08 02 a6 mflr r0 ffc0cc6c: 90 01 00 24 stw r0,36(r1) ffc0cc70: 93 c1 00 18 stw r30,24(r1) ffc0cc74: 7c 7e 1b 78 mr r30,r3 ffc0cc78: 93 61 00 0c stw r27,12(r1) ffc0cc7c: 93 81 00 10 stw r28,16(r1) ffc0cc80: 93 a1 00 14 stw r29,20(r1) ffc0cc84: 93 e1 00 1c stw r31,28(r1) static inline uint32_t ppc_interrupt_disable( void ) { uint32_t level; uint32_t mask; __asm__ volatile ( ffc0cc88: 7f 60 00 a6 mfmsr r27 ffc0cc8c: 7d 30 42 a6 mfsprg r9,0 ffc0cc90: 7f 69 48 78 andc r9,r27,r9 ffc0cc94: 7d 20 01 24 mtmsr r9 RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_Find_unprotected( RBTree_Control *the_rbtree, RBTree_Node *the_node ) { RBTree_Node* iter_node = the_rbtree->root; ffc0cc98: 83 e3 00 04 lwz r31,4(r3) RBTree_Node* found = NULL; int compare_result; while (iter_node) { ffc0cc9c: 2f 9f 00 00 cmpwi cr7,r31,0 ffc0cca0: 41 9e 00 b0 beq- cr7,ffc0cd50 <_RBTree_Find+0xec> <== NEVER TAKEN ffc0cca4: 7c 9d 23 78 mr r29,r4 ffc0cca8: 3b 80 00 00 li r28,0 compare_result = the_rbtree->compare_function(the_node, iter_node); ffc0ccac: 81 3e 00 10 lwz r9,16(r30) ffc0ccb0: 7f e4 fb 78 mr r4,r31 ffc0ccb4: 7f a3 eb 78 mr r3,r29 ffc0ccb8: 7d 29 03 a6 mtctr r9 ffc0ccbc: 4e 80 04 21 bctrl if ( _RBTree_Is_equal( compare_result ) ) { ffc0ccc0: 2c 03 00 00 cmpwi r3,0 RTEMS_INLINE_ROUTINE bool _RBTree_Is_greater( int compare_result ) { return compare_result > 0; ffc0ccc4: 7c 6a fe 70 srawi r10,r3,31 ffc0ccc8: 7d 23 50 50 subf r9,r3,r10 break; } RBTree_Direction dir = (RBTree_Direction) _RBTree_Is_greater( compare_result ); iter_node = iter_node->child[dir]; ffc0cccc: 55 29 1f 7a rlwinm r9,r9,3,29,29 ffc0ccd0: 7d 3f 4a 14 add r9,r31,r9 RBTree_Node* iter_node = the_rbtree->root; RBTree_Node* found = NULL; int compare_result; while (iter_node) { compare_result = the_rbtree->compare_function(the_node, iter_node); if ( _RBTree_Is_equal( compare_result ) ) { ffc0ccd4: 40 82 00 14 bne- ffc0cce8 <_RBTree_Find+0x84> found = iter_node; if ( the_rbtree->is_unique ) ffc0ccd8: 89 5e 00 14 lbz r10,20(r30) ffc0ccdc: 7f fc fb 78 mr r28,r31 ffc0cce0: 2f 8a 00 00 cmpwi cr7,r10,0 ffc0cce4: 40 9e 00 3c bne- cr7,ffc0cd20 <_RBTree_Find+0xbc> break; } RBTree_Direction dir = (RBTree_Direction) _RBTree_Is_greater( compare_result ); iter_node = iter_node->child[dir]; ffc0cce8: 83 e9 00 04 lwz r31,4(r9) ) { RBTree_Node* iter_node = the_rbtree->root; RBTree_Node* found = NULL; int compare_result; while (iter_node) { ffc0ccec: 2f 9f 00 00 cmpwi cr7,r31,0 ffc0ccf0: 40 9e ff bc bne+ cr7,ffc0ccac <_RBTree_Find+0x48> return level; } static inline void ppc_interrupt_enable( uint32_t level ) { __asm__ volatile ( ffc0ccf4: 7f 60 01 24 mtmsr r27 return_node = NULL; _ISR_Disable( level ); return_node = _RBTree_Find_unprotected( the_rbtree, search_node ); _ISR_Enable( level ); return return_node; } ffc0ccf8: 80 01 00 24 lwz r0,36(r1) ffc0ccfc: 7f 83 e3 78 mr r3,r28 ffc0cd00: 83 61 00 0c lwz r27,12(r1) ffc0cd04: 7c 08 03 a6 mtlr r0 ffc0cd08: 83 81 00 10 lwz r28,16(r1) ffc0cd0c: 83 a1 00 14 lwz r29,20(r1) ffc0cd10: 83 c1 00 18 lwz r30,24(r1) ffc0cd14: 83 e1 00 1c lwz r31,28(r1) ffc0cd18: 38 21 00 20 addi r1,r1,32 ffc0cd1c: 4e 80 00 20 blr compare_result = the_rbtree->compare_function(the_node, iter_node); if ( _RBTree_Is_equal( compare_result ) ) { found = iter_node; if ( the_rbtree->is_unique ) ffc0cd20: 7f fc fb 78 mr r28,r31 ffc0cd24: 7f 60 01 24 mtmsr r27 ffc0cd28: 80 01 00 24 lwz r0,36(r1) ffc0cd2c: 7f 83 e3 78 mr r3,r28 ffc0cd30: 83 61 00 0c lwz r27,12(r1) ffc0cd34: 7c 08 03 a6 mtlr r0 ffc0cd38: 83 81 00 10 lwz r28,16(r1) ffc0cd3c: 83 a1 00 14 lwz r29,20(r1) ffc0cd40: 83 c1 00 18 lwz r30,24(r1) ffc0cd44: 83 e1 00 1c lwz r31,28(r1) ffc0cd48: 38 21 00 20 addi r1,r1,32 ffc0cd4c: 4e 80 00 20 blr RBTree_Control *the_rbtree, RBTree_Node *the_node ) { RBTree_Node* iter_node = the_rbtree->root; RBTree_Node* found = NULL; ffc0cd50: 3b 80 00 00 li r28,0 <== NOT EXECUTED ffc0cd54: 4b ff ff a0 b ffc0ccf4 <_RBTree_Find+0x90> <== NOT EXECUTED =============================================================================== ffc0d200 <_RBTree_Initialize>: void *starting_address, size_t number_nodes, size_t node_size, bool is_unique ) { ffc0d200: 94 21 ff e8 stwu r1,-24(r1) ffc0d204: 7c 08 02 a6 mflr r0 ffc0d208: 93 a1 00 0c stw r29,12(r1) size_t count; RBTree_Node *next; /* TODO: Error message? */ if (!the_rbtree) return; ffc0d20c: 7c 7d 1b 79 mr. r29,r3 void *starting_address, size_t number_nodes, size_t node_size, bool is_unique ) { ffc0d210: 90 01 00 1c stw r0,28(r1) ffc0d214: 93 81 00 08 stw r28,8(r1) ffc0d218: 93 c1 00 10 stw r30,16(r1) ffc0d21c: 93 e1 00 14 stw r31,20(r1) size_t count; RBTree_Node *next; /* TODO: Error message? */ if (!the_rbtree) return; ffc0d220: 41 82 00 4c beq- ffc0d26c <_RBTree_Initialize+0x6c> <== NEVER TAKEN /* could do sanity checks here */ _RBTree_Initialize_empty(the_rbtree, compare_function, is_unique); count = number_nodes; next = starting_address; while ( count-- ) { ffc0d224: 2f 86 00 00 cmpwi cr7,r6,0 { the_rbtree->permanent_null = NULL; the_rbtree->root = NULL; the_rbtree->first[0] = NULL; the_rbtree->first[1] = NULL; the_rbtree->compare_function = compare_function; ffc0d228: 90 9d 00 10 stw r4,16(r29) RBTree_Control *the_rbtree, RBTree_Compare_function compare_function, bool is_unique ) { the_rbtree->permanent_null = NULL; ffc0d22c: 39 20 00 00 li r9,0 ffc0d230: 7c df 33 78 mr r31,r6 ffc0d234: 91 3d 00 00 stw r9,0(r29) the_rbtree->root = NULL; ffc0d238: 91 3d 00 04 stw r9,4(r29) the_rbtree->first[0] = NULL; ffc0d23c: 91 3d 00 08 stw r9,8(r29) the_rbtree->first[1] = NULL; ffc0d240: 91 3d 00 0c stw r9,12(r29) the_rbtree->compare_function = compare_function; the_rbtree->is_unique = is_unique; ffc0d244: 99 1d 00 14 stb r8,20(r29) ffc0d248: 41 9e 00 24 beq- cr7,ffc0d26c <_RBTree_Initialize+0x6c> <== NEVER TAKEN ffc0d24c: 7c fc 3b 78 mr r28,r7 ffc0d250: 7c be 2b 78 mr r30,r5 _RBTree_Insert_unprotected(the_rbtree, next); ffc0d254: 7f c4 f3 78 mr r4,r30 ffc0d258: 7f a3 eb 78 mr r3,r29 ffc0d25c: 4b ff fb 55 bl ffc0cdb0 <_RBTree_Insert_unprotected> /* could do sanity checks here */ _RBTree_Initialize_empty(the_rbtree, compare_function, is_unique); count = number_nodes; next = starting_address; while ( count-- ) { ffc0d260: 37 ff ff ff addic. r31,r31,-1 #include #include #include #include void _RBTree_Initialize( ffc0d264: 7f de e2 14 add r30,r30,r28 /* could do sanity checks here */ _RBTree_Initialize_empty(the_rbtree, compare_function, is_unique); count = number_nodes; next = starting_address; while ( count-- ) { ffc0d268: 40 82 ff ec bne+ ffc0d254 <_RBTree_Initialize+0x54> _RBTree_Insert_unprotected(the_rbtree, next); next = (RBTree_Node *) _Addresses_Add_offset( (void *) next, node_size ); } } ffc0d26c: 80 01 00 1c lwz r0,28(r1) ffc0d270: 83 81 00 08 lwz r28,8(r1) ffc0d274: 7c 08 03 a6 mtlr r0 ffc0d278: 83 a1 00 0c lwz r29,12(r1) ffc0d27c: 83 c1 00 10 lwz r30,16(r1) ffc0d280: 83 e1 00 14 lwz r31,20(r1) ffc0d284: 38 21 00 18 addi r1,r1,24 ffc0d288: 4e 80 00 20 blr =============================================================================== ffc0cae4 <_RBTree_Insert_unprotected>: */ RBTree_Node *_RBTree_Insert_unprotected( RBTree_Control *the_rbtree, RBTree_Node *the_node ) { ffc0cae4: 94 21 ff e0 stwu r1,-32(r1) ffc0cae8: 7c 08 02 a6 mflr r0 ffc0caec: 93 e1 00 1c stw r31,28(r1) if(!the_node) return (RBTree_Node*)-1; ffc0caf0: 7c 9f 23 79 mr. r31,r4 */ RBTree_Node *_RBTree_Insert_unprotected( RBTree_Control *the_rbtree, RBTree_Node *the_node ) { ffc0caf4: 90 01 00 24 stw r0,36(r1) ffc0caf8: 93 41 00 08 stw r26,8(r1) ffc0cafc: 93 61 00 0c stw r27,12(r1) ffc0cb00: 93 81 00 10 stw r28,16(r1) ffc0cb04: 93 a1 00 14 stw r29,20(r1) ffc0cb08: 93 c1 00 18 stw r30,24(r1) if(!the_node) return (RBTree_Node*)-1; ffc0cb0c: 41 82 02 b8 beq- ffc0cdc4 <_RBTree_Insert_unprotected+0x2e0> RBTree_Node *iter_node = the_rbtree->root; ffc0cb10: 83 a3 00 04 lwz r29,4(r3) ffc0cb14: 7c 7c 1b 78 mr r28,r3 int compare_result; if (!iter_node) { /* special case: first node inserted */ ffc0cb18: 2f 9d 00 00 cmpwi cr7,r29,0 ffc0cb1c: 40 be 00 0c bne+ cr7,ffc0cb28 <_RBTree_Insert_unprotected+0x44> ffc0cb20: 48 00 02 dc b ffc0cdfc <_RBTree_Insert_unprotected+0x318> (dir && _RBTree_Is_greater(compare_result)) ) { the_rbtree->first[dir] = the_node; } break; } else { iter_node = iter_node->child[dir]; ffc0cb24: 7f dd f3 78 mr r29,r30 the_node->parent = (RBTree_Node *) the_rbtree; the_node->child[RBT_LEFT] = the_node->child[RBT_RIGHT] = NULL; } else { /* typical binary search tree insert, descend tree to leaf and insert */ while (iter_node) { compare_result = the_rbtree->compare_function(the_node, iter_node); ffc0cb28: 81 3c 00 10 lwz r9,16(r28) ffc0cb2c: 7f a4 eb 78 mr r4,r29 ffc0cb30: 7f e3 fb 78 mr r3,r31 ffc0cb34: 7d 29 03 a6 mtctr r9 ffc0cb38: 4e 80 04 21 bctrl if ( the_rbtree->is_unique && _RBTree_Is_equal( compare_result ) ) ffc0cb3c: 89 5c 00 14 lbz r10,20(r28) return iter_node; RBTree_Direction dir = !_RBTree_Is_lesser( compare_result ); ffc0cb40: 7c 7a 18 f8 not r26,r3 the_node->child[RBT_LEFT] = the_node->child[RBT_RIGHT] = NULL; } else { /* typical binary search tree insert, descend tree to leaf and insert */ while (iter_node) { compare_result = the_rbtree->compare_function(the_node, iter_node); if ( the_rbtree->is_unique && _RBTree_Is_equal( compare_result ) ) ffc0cb44: 2f 0a 00 00 cmpwi cr6,r10,0 return iter_node; RBTree_Direction dir = !_RBTree_Is_lesser( compare_result ); ffc0cb48: 57 5a 0f fe rlwinm r26,r26,1,31,31 if (!iter_node->child[dir]) { ffc0cb4c: 57 5b 10 3a rlwinm r27,r26,2,0,29 ffc0cb50: 7d 3d da 14 add r9,r29,r27 the_node->child[RBT_LEFT] = the_node->child[RBT_RIGHT] = NULL; } else { /* typical binary search tree insert, descend tree to leaf and insert */ while (iter_node) { compare_result = the_rbtree->compare_function(the_node, iter_node); if ( the_rbtree->is_unique && _RBTree_Is_equal( compare_result ) ) ffc0cb54: 2f 83 00 00 cmpwi cr7,r3,0 return iter_node; RBTree_Direction dir = !_RBTree_Is_lesser( compare_result ); if (!iter_node->child[dir]) { ffc0cb58: 39 09 00 04 addi r8,r9,4 the_node->child[RBT_LEFT] = the_node->child[RBT_RIGHT] = NULL; } else { /* typical binary search tree insert, descend tree to leaf and insert */ while (iter_node) { compare_result = the_rbtree->compare_function(the_node, iter_node); if ( the_rbtree->is_unique && _RBTree_Is_equal( compare_result ) ) ffc0cb5c: 41 9a 00 08 beq- cr6,ffc0cb64 <_RBTree_Insert_unprotected+0x80> ffc0cb60: 41 9e 02 94 beq- cr7,ffc0cdf4 <_RBTree_Insert_unprotected+0x310> return iter_node; RBTree_Direction dir = !_RBTree_Is_lesser( compare_result ); if (!iter_node->child[dir]) { ffc0cb64: 83 c9 00 04 lwz r30,4(r9) ffc0cb68: 2f 9e 00 00 cmpwi cr7,r30,0 ffc0cb6c: 40 9e ff b8 bne+ cr7,ffc0cb24 <_RBTree_Insert_unprotected+0x40> the_node->child[RBT_LEFT] = the_node->child[RBT_RIGHT] = NULL; the_node->color = RBT_RED; ffc0cb70: 39 20 00 01 li r9,1 compare_result = the_rbtree->compare_function(the_node, iter_node); 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; ffc0cb74: 93 df 00 08 stw r30,8(r31) RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_First( const RBTree_Control *the_rbtree, RBTree_Direction dir ) { return the_rbtree->first[dir]; ffc0cb78: 7d 5c da 14 add r10,r28,r27 the_node->color = RBT_RED; ffc0cb7c: 91 3f 00 0c stw r9,12(r31) iter_node->child[dir] = the_node; the_node->parent = iter_node; /* update min/max */ compare_result = the_rbtree->compare_function( ffc0cb80: 7f e3 fb 78 mr r3,r31 ffc0cb84: 81 3c 00 10 lwz r9,16(r28) compare_result = the_rbtree->compare_function(the_node, iter_node); 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; ffc0cb88: 93 df 00 04 stw r30,4(r31) the_node->color = RBT_RED; iter_node->child[dir] = the_node; the_node->parent = iter_node; /* update min/max */ compare_result = the_rbtree->compare_function( ffc0cb8c: 7d 29 03 a6 mtctr r9 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; iter_node->child[dir] = the_node; ffc0cb90: 93 e8 00 00 stw r31,0(r8) the_node->parent = iter_node; ffc0cb94: 93 bf 00 00 stw r29,0(r31) /* update min/max */ compare_result = the_rbtree->compare_function( ffc0cb98: 80 8a 00 08 lwz r4,8(r10) ffc0cb9c: 4e 80 04 21 bctrl the_node, _RBTree_First(the_rbtree, dir) ); if ( (!dir && _RBTree_Is_lesser(compare_result)) || ffc0cba0: 2f 9a 00 00 cmpwi cr7,r26,0 ffc0cba4: 40 9e 00 60 bne- cr7,ffc0cc04 <_RBTree_Insert_unprotected+0x120> ffc0cba8: 2f 83 00 00 cmpwi cr7,r3,0 ffc0cbac: 41 9c 00 60 blt- cr7,ffc0cc0c <_RBTree_Insert_unprotected+0x128> /* 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; ffc0cbb0: 38 80 00 00 li r4,0 g->color = RBT_RED; ffc0cbb4: 38 60 00 01 li r3,1 _ISR_Disable( level ); return_node = _RBTree_Insert_unprotected( tree, node ); _ISR_Enable( level ); return return_node; } ffc0cbb8: 81 3f 00 00 lwz r9,0(r31) */ RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_Parent( const RBTree_Node *the_node ) { if (!the_node->parent->parent) return NULL; ffc0cbbc: 81 49 00 00 lwz r10,0(r9) ffc0cbc0: 2f 8a 00 00 cmpwi cr7,r10,0 ffc0cbc4: 7d 46 53 78 mr r6,r10 ffc0cbc8: 41 9e 01 b0 beq- cr7,ffc0cd78 <_RBTree_Insert_unprotected+0x294> */ RTEMS_INLINE_ROUTINE bool _RBTree_Is_red( const RBTree_Node *the_node ) { return (the_node && the_node->color == RBT_RED); ffc0cbcc: 81 09 00 0c lwz r8,12(r9) ffc0cbd0: 2f 88 00 01 cmpwi cr7,r8,1 ffc0cbd4: 41 9e 00 44 beq- cr7,ffc0cc18 <_RBTree_Insert_unprotected+0x134> /* verify red-black properties */ _RBTree_Validate_insert_unprotected(the_node); } return (RBTree_Node*)0; } ffc0cbd8: 80 01 00 24 lwz r0,36(r1) ffc0cbdc: 7f c3 f3 78 mr r3,r30 ffc0cbe0: 83 41 00 08 lwz r26,8(r1) ffc0cbe4: 7c 08 03 a6 mtlr r0 ffc0cbe8: 83 61 00 0c lwz r27,12(r1) ffc0cbec: 83 81 00 10 lwz r28,16(r1) ffc0cbf0: 83 a1 00 14 lwz r29,20(r1) ffc0cbf4: 83 c1 00 18 lwz r30,24(r1) ffc0cbf8: 83 e1 00 1c lwz r31,28(r1) ffc0cbfc: 38 21 00 20 addi r1,r1,32 ffc0cc00: 4e 80 00 20 blr 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)) ) { ffc0cc04: 2f 83 00 00 cmpwi cr7,r3,0 ffc0cc08: 40 bd ff a8 ble- cr7,ffc0cbb0 <_RBTree_Insert_unprotected+0xcc> the_rbtree->first[dir] = the_node; ffc0cc0c: 7f 9c da 14 add r28,r28,r27 ffc0cc10: 93 fc 00 08 stw r31,8(r28) ffc0cc14: 4b ff ff 9c b ffc0cbb0 <_RBTree_Insert_unprotected+0xcc> ) { if(!the_node) return NULL; if(!(the_node->parent)) return NULL; if(!(the_node->parent->parent)) return NULL; if(!(the_node->parent->parent->parent)) return NULL; ffc0cc18: 81 0a 00 00 lwz r8,0(r10) ffc0cc1c: 80 ea 00 04 lwz r7,4(r10) ffc0cc20: 2f 88 00 00 cmpwi cr7,r8,0 ffc0cc24: 41 9e 00 24 beq- cr7,ffc0cc48 <_RBTree_Insert_unprotected+0x164><== NEVER TAKEN { 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]) ffc0cc28: 7f 89 38 00 cmpw cr7,r9,r7 ffc0cc2c: 7c e8 3b 78 mr r8,r7 ffc0cc30: 41 9e 01 8c beq- cr7,ffc0cdbc <_RBTree_Insert_unprotected+0x2d8> */ RTEMS_INLINE_ROUTINE bool _RBTree_Is_red( const RBTree_Node *the_node ) { return (the_node && the_node->color == RBT_RED); ffc0cc34: 2f 88 00 00 cmpwi cr7,r8,0 ffc0cc38: 41 9e 00 10 beq- cr7,ffc0cc48 <_RBTree_Insert_unprotected+0x164> ffc0cc3c: 80 a8 00 0c lwz r5,12(r8) ffc0cc40: 2f 85 00 01 cmpwi cr7,r5,1 ffc0cc44: 41 9e 01 64 beq- cr7,ffc0cda8 <_RBTree_Insert_unprotected+0x2c4> 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]; ffc0cc48: 81 09 00 04 lwz r8,4(r9) RBTree_Direction pdir = the_node->parent != g->child[0]; ffc0cc4c: 7d 27 3a 78 xor r7,r9,r7 ffc0cc50: 7c e7 00 34 cntlzw r7,r7 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]; ffc0cc54: 7f e8 42 78 xor r8,r31,r8 ffc0cc58: 7d 08 00 34 cntlzw r8,r8 RBTree_Direction pdir = the_node->parent != g->child[0]; ffc0cc5c: 54 e7 d9 7e rlwinm r7,r7,27,5,31 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]; ffc0cc60: 55 08 d9 7e rlwinm r8,r8,27,5,31 RBTree_Direction pdir = the_node->parent != g->child[0]; ffc0cc64: 68 e7 00 01 xori r7,r7,1 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]; ffc0cc68: 69 08 00 01 xori r8,r8,1 RBTree_Direction pdir = the_node->parent != g->child[0]; /* ensure node is on the same branch direction as parent */ if (dir != pdir) { ffc0cc6c: 7f 88 38 00 cmpw cr7,r8,r7 ffc0cc70: 41 9e 00 7c beq- cr7,ffc0ccec <_RBTree_Insert_unprotected+0x208> */ RTEMS_INLINE_ROUTINE RBTree_Direction _RBTree_Opposite_direction( RBTree_Direction the_dir ) { return (RBTree_Direction) !((int) the_dir); ffc0cc74: 68 e5 00 01 xori r5,r7,1 RBTree_Direction dir ) { RBTree_Node *c; if (the_node == NULL) return; if (the_node->child[_RBTree_Opposite_direction(dir)] == NULL) return; ffc0cc78: 54 a5 10 3a rlwinm r5,r5,2,0,29 ffc0cc7c: 7c a9 2a 14 add r5,r9,r5 ffc0cc80: 81 05 00 04 lwz r8,4(r5) ffc0cc84: 54 eb 10 3a rlwinm r11,r7,2,0,29 ffc0cc88: 2f 88 00 00 cmpwi cr7,r8,0 ffc0cc8c: 41 9e 00 54 beq- cr7,ffc0cce0 <_RBTree_Insert_unprotected+0x1fc><== NEVER TAKEN c = the_node->child[_RBTree_Opposite_direction(dir)]; the_node->child[_RBTree_Opposite_direction(dir)] = c->child[dir]; ffc0cc90: 7f a8 5a 14 add r29,r8,r11 ffc0cc94: 80 1d 00 04 lwz r0,4(r29) ffc0cc98: 90 05 00 04 stw r0,4(r5) if (c->child[dir]) ffc0cc9c: 80 bd 00 04 lwz r5,4(r29) ffc0cca0: 2f 85 00 00 cmpwi cr7,r5,0 ffc0cca4: 41 9e 00 0c beq- cr7,ffc0ccb0 <_RBTree_Insert_unprotected+0x1cc> c->child[dir]->parent = the_node; ffc0cca8: 91 25 00 00 stw r9,0(r5) ffc0ccac: 81 49 00 00 lwz r10,0(r9) c->child[dir] = the_node; ffc0ccb0: 7c a8 5a 14 add r5,r8,r11 the_node->parent->child[the_node != the_node->parent->child[0]] = c; c->parent = the_node->parent; ffc0ccb4: 91 48 00 00 stw r10,0(r8) 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; ffc0ccb8: 91 25 00 04 stw r9,4(r5) the_node->parent->child[the_node != the_node->parent->child[0]] = c; ffc0ccbc: 80 aa 00 04 lwz r5,4(r10) c->parent = the_node->parent; the_node->parent = c; ffc0ccc0: 91 09 00 00 stw r8,0(r9) 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; ffc0ccc4: 7d 25 2a 78 xor r5,r9,r5 ffc0ccc8: 7c a5 00 34 cntlzw r5,r5 ffc0cccc: 54 a5 d9 7e rlwinm r5,r5,27,5,31 ffc0ccd0: 68 a5 00 01 xori r5,r5,1 ffc0ccd4: 54 a5 10 3a rlwinm r5,r5,2,0,29 ffc0ccd8: 7d 4a 2a 14 add r10,r10,r5 ffc0ccdc: 91 0a 00 04 stw r8,4(r10) _RBTree_Rotate(the_node->parent, pdir); the_node = the_node->child[pdir]; ffc0cce0: 7f ff 5a 14 add r31,r31,r11 ffc0cce4: 83 ff 00 04 lwz r31,4(r31) ffc0cce8: 81 3f 00 00 lwz r9,0(r31) } the_node->parent->color = RBT_BLACK; g->color = RBT_RED; /* now rotate grandparent in the other branch direction (toward uncle) */ _RBTree_Rotate(g, (1-pdir)); ffc0ccec: 20 e7 00 01 subfic r7,r7,1 /* 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; ffc0ccf0: 90 89 00 0c stw r4,12(r9) ffc0ccf4: 68 e8 00 01 xori r8,r7,1 RBTree_Direction dir ) { RBTree_Node *c; if (the_node == NULL) return; if (the_node->child[_RBTree_Opposite_direction(dir)] == NULL) return; ffc0ccf8: 55 08 10 3a rlwinm r8,r8,2,0,29 g->color = RBT_RED; ffc0ccfc: 90 66 00 0c stw r3,12(r6) ffc0cd00: 7d 06 42 14 add r8,r6,r8 ffc0cd04: 81 48 00 04 lwz r10,4(r8) ffc0cd08: 2f 8a 00 00 cmpwi cr7,r10,0 ffc0cd0c: 41 be fe ac beq- cr7,ffc0cbb8 <_RBTree_Insert_unprotected+0xd4><== NEVER TAKEN c = the_node->child[_RBTree_Opposite_direction(dir)]; the_node->child[_RBTree_Opposite_direction(dir)] = c->child[dir]; ffc0cd10: 54 e7 10 3a rlwinm r7,r7,2,0,29 ffc0cd14: 7d 2a 3a 14 add r9,r10,r7 ffc0cd18: 80 a9 00 04 lwz r5,4(r9) ffc0cd1c: 90 a8 00 04 stw r5,4(r8) if (c->child[dir]) ffc0cd20: 81 29 00 04 lwz r9,4(r9) ffc0cd24: 2f 89 00 00 cmpwi cr7,r9,0 ffc0cd28: 41 9e 00 08 beq- cr7,ffc0cd30 <_RBTree_Insert_unprotected+0x24c> c->child[dir]->parent = the_node; ffc0cd2c: 90 c9 00 00 stw r6,0(r9) c->child[dir] = the_node; ffc0cd30: 7c ea 3a 14 add r7,r10,r7 the_node->parent->child[the_node != the_node->parent->child[0]] = c; ffc0cd34: 81 06 00 00 lwz r8,0(r6) 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; ffc0cd38: 90 c7 00 04 stw r6,4(r7) the_node->parent->child[the_node != the_node->parent->child[0]] = c; ffc0cd3c: 81 28 00 04 lwz r9,4(r8) c->parent = the_node->parent; ffc0cd40: 91 0a 00 00 stw r8,0(r10) 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; ffc0cd44: 7c c9 4a 78 xor r9,r6,r9 ffc0cd48: 7d 29 00 34 cntlzw r9,r9 c->parent = the_node->parent; the_node->parent = c; ffc0cd4c: 91 46 00 00 stw r10,0(r6) 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; ffc0cd50: 55 29 d9 7e rlwinm r9,r9,27,5,31 ffc0cd54: 69 29 00 01 xori r9,r9,1 ffc0cd58: 55 29 10 3a rlwinm r9,r9,2,0,29 ffc0cd5c: 7d 08 4a 14 add r8,r8,r9 ffc0cd60: 91 48 00 04 stw r10,4(r8) _ISR_Disable( level ); return_node = _RBTree_Insert_unprotected( tree, node ); _ISR_Enable( level ); return return_node; } ffc0cd64: 81 3f 00 00 lwz r9,0(r31) */ RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_Parent( const RBTree_Node *the_node ) { if (!the_node->parent->parent) return NULL; ffc0cd68: 81 49 00 00 lwz r10,0(r9) ffc0cd6c: 2f 8a 00 00 cmpwi cr7,r10,0 ffc0cd70: 7d 46 53 78 mr r6,r10 ffc0cd74: 40 9e fe 58 bne+ cr7,ffc0cbcc <_RBTree_Insert_unprotected+0xe8><== ALWAYS TAKEN /* verify red-black properties */ _RBTree_Validate_insert_unprotected(the_node); } return (RBTree_Node*)0; } ffc0cd78: 80 01 00 24 lwz r0,36(r1) ffc0cd7c: 7f c3 f3 78 mr r3,r30 /* 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; ffc0cd80: 91 5f 00 0c stw r10,12(r31) /* verify red-black properties */ _RBTree_Validate_insert_unprotected(the_node); } return (RBTree_Node*)0; } ffc0cd84: 7c 08 03 a6 mtlr r0 ffc0cd88: 83 41 00 08 lwz r26,8(r1) ffc0cd8c: 83 61 00 0c lwz r27,12(r1) ffc0cd90: 83 81 00 10 lwz r28,16(r1) ffc0cd94: 83 a1 00 14 lwz r29,20(r1) ffc0cd98: 83 c1 00 18 lwz r30,24(r1) ffc0cd9c: 83 e1 00 1c lwz r31,28(r1) ffc0cda0: 38 21 00 20 addi r1,r1,32 ffc0cda4: 4e 80 00 20 blr 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)) { the_node->parent->color = RBT_BLACK; ffc0cda8: 90 89 00 0c stw r4,12(r9) u->color = RBT_BLACK; g->color = RBT_RED; ffc0cdac: 7d 5f 53 78 mr r31,r10 g = the_node->parent->parent; /* if uncle is red, repaint uncle/parent black and grandparent red */ if(_RBTree_Is_red(u)) { the_node->parent->color = RBT_BLACK; u->color = RBT_BLACK; ffc0cdb0: 90 88 00 0c stw r4,12(r8) g->color = RBT_RED; ffc0cdb4: 90 aa 00 0c stw r5,12(r10) ffc0cdb8: 4b ff fe 00 b ffc0cbb8 <_RBTree_Insert_unprotected+0xd4> 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]) return the_node->parent->child[RBT_RIGHT]; ffc0cdbc: 81 0a 00 08 lwz r8,8(r10) ffc0cdc0: 4b ff fe 74 b ffc0cc34 <_RBTree_Insert_unprotected+0x150> /* verify red-black properties */ _RBTree_Validate_insert_unprotected(the_node); } return (RBTree_Node*)0; } ffc0cdc4: 80 01 00 24 lwz r0,36(r1) RBTree_Node *_RBTree_Insert_unprotected( RBTree_Control *the_rbtree, RBTree_Node *the_node ) { if(!the_node) return (RBTree_Node*)-1; ffc0cdc8: 3b c0 ff ff li r30,-1 /* verify red-black properties */ _RBTree_Validate_insert_unprotected(the_node); } return (RBTree_Node*)0; } ffc0cdcc: 7f c3 f3 78 mr r3,r30 ffc0cdd0: 83 41 00 08 lwz r26,8(r1) ffc0cdd4: 7c 08 03 a6 mtlr r0 ffc0cdd8: 83 61 00 0c lwz r27,12(r1) ffc0cddc: 83 81 00 10 lwz r28,16(r1) ffc0cde0: 83 a1 00 14 lwz r29,20(r1) ffc0cde4: 83 c1 00 18 lwz r30,24(r1) ffc0cde8: 83 e1 00 1c lwz r31,28(r1) ffc0cdec: 38 21 00 20 addi r1,r1,32 ffc0cdf0: 4e 80 00 20 blr the_node->child[RBT_LEFT] = the_node->child[RBT_RIGHT] = NULL; } else { /* typical binary search tree insert, descend tree to leaf and insert */ while (iter_node) { compare_result = the_rbtree->compare_function(the_node, iter_node); if ( the_rbtree->is_unique && _RBTree_Is_equal( compare_result ) ) ffc0cdf4: 7f be eb 78 mr r30,r29 ffc0cdf8: 4b ff fd e0 b ffc0cbd8 <_RBTree_Insert_unprotected+0xf4> RBTree_Node *iter_node = the_rbtree->root; int compare_result; if (!iter_node) { /* special case: first node inserted */ the_node->color = RBT_BLACK; ffc0cdfc: 93 bf 00 0c stw r29,12(r31) } /* while(iter_node) */ /* verify red-black properties */ _RBTree_Validate_insert_unprotected(the_node); } return (RBTree_Node*)0; ffc0ce00: 3b c0 00 00 li r30,0 RBTree_Node *iter_node = the_rbtree->root; int compare_result; if (!iter_node) { /* special case: first node inserted */ the_node->color = RBT_BLACK; the_rbtree->root = the_node; ffc0ce04: 93 e3 00 04 stw r31,4(r3) the_rbtree->first[0] = the_rbtree->first[1] = the_node; ffc0ce08: 93 e3 00 0c stw r31,12(r3) ffc0ce0c: 93 e3 00 08 stw r31,8(r3) the_node->parent = (RBTree_Node *) the_rbtree; ffc0ce10: 90 7f 00 00 stw r3,0(r31) the_node->child[RBT_LEFT] = the_node->child[RBT_RIGHT] = NULL; ffc0ce14: 93 bf 00 08 stw r29,8(r31) ffc0ce18: 93 bf 00 04 stw r29,4(r31) ffc0ce1c: 4b ff fd bc b ffc0cbd8 <_RBTree_Insert_unprotected+0xf4> =============================================================================== ffc0ce5c <_RBTree_Iterate_unprotected>: const RBTree_Control *rbtree, RBTree_Direction dir, RBTree_Visitor visitor, void *visitor_arg ) { ffc0ce5c: 94 21 ff e0 stwu r1,-32(r1) ffc0ce60: 7c 08 02 a6 mflr r0 */ RTEMS_INLINE_ROUTINE RBTree_Direction _RBTree_Opposite_direction( RBTree_Direction the_dir ) { return (RBTree_Direction) !((int) the_dir); ffc0ce64: 7c 89 00 34 cntlzw r9,r4 ffc0ce68: 55 29 d9 7e rlwinm r9,r9,27,5,31 ffc0ce6c: 90 01 00 24 stw r0,36(r1) RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_First( const RBTree_Control *the_rbtree, RBTree_Direction dir ) { return the_rbtree->first[dir]; ffc0ce70: 55 29 10 3a rlwinm r9,r9,2,0,29 ffc0ce74: 7c 63 4a 14 add r3,r3,r9 ffc0ce78: 93 e1 00 1c stw r31,28(r1) ffc0ce7c: 83 e3 00 08 lwz r31,8(r3) ffc0ce80: 93 a1 00 14 stw r29,20(r1) RBTree_Direction opp_dir = _RBTree_Opposite_direction( dir ); const RBTree_Node *current = _RBTree_First( rbtree, opp_dir ); bool stop = false; while ( !stop && current != NULL ) { ffc0ce84: 2f 9f 00 00 cmpwi cr7,r31,0 const RBTree_Control *rbtree, RBTree_Direction dir, RBTree_Visitor visitor, void *visitor_arg ) { ffc0ce88: 93 61 00 0c stw r27,12(r1) ffc0ce8c: 7c bb 2b 78 mr r27,r5 ffc0ce90: 93 81 00 10 stw r28,16(r1) ffc0ce94: 7c dc 33 78 mr r28,r6 ffc0ce98: 93 c1 00 18 stw r30,24(r1) */ RTEMS_INLINE_ROUTINE RBTree_Direction _RBTree_Opposite_direction( RBTree_Direction the_dir ) { return (RBTree_Direction) !((int) the_dir); ffc0ce9c: 7c 9e 23 78 mr r30,r4 RBTree_Direction opp_dir = _RBTree_Opposite_direction( dir ); const RBTree_Node *current = _RBTree_First( rbtree, opp_dir ); bool stop = false; while ( !stop && current != NULL ) { ffc0cea0: 41 9e 00 38 beq- cr7,ffc0ced8 <_RBTree_Iterate_unprotected+0x7c> stop = (*visitor)( current, dir, visitor_arg ); ffc0cea4: 7f e3 fb 78 mr r3,r31 ffc0cea8: 7f 69 03 a6 mtctr r27 ffc0ceac: 7f 85 e3 78 mr r5,r28 ffc0ceb0: 7f c4 f3 78 mr r4,r30 ffc0ceb4: 4e 80 04 21 bctrl current = _RBTree_Next_unprotected( current, dir ); ffc0ceb8: 7f c4 f3 78 mr r4,r30 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 ); ffc0cebc: 7c 7d 1b 78 mr r29,r3 current = _RBTree_Next_unprotected( current, dir ); ffc0cec0: 7f e3 fb 78 mr r3,r31 ffc0cec4: 48 00 00 39 bl ffc0cefc <_RBTree_Next_unprotected> { RBTree_Direction opp_dir = _RBTree_Opposite_direction( dir ); const RBTree_Node *current = _RBTree_First( rbtree, opp_dir ); bool stop = false; while ( !stop && current != NULL ) { ffc0cec8: 2f 1d 00 00 cmpwi cr6,r29,0 stop = (*visitor)( current, dir, visitor_arg ); current = _RBTree_Next_unprotected( current, dir ); ffc0cecc: 7c 7f 1b 78 mr r31,r3 { RBTree_Direction opp_dir = _RBTree_Opposite_direction( dir ); const RBTree_Node *current = _RBTree_First( rbtree, opp_dir ); bool stop = false; while ( !stop && current != NULL ) { ffc0ced0: 2f 83 00 00 cmpwi cr7,r3,0 ffc0ced4: 41 9a ff cc beq+ cr6,ffc0cea0 <_RBTree_Iterate_unprotected+0x44><== ALWAYS TAKEN stop = (*visitor)( current, dir, visitor_arg ); current = _RBTree_Next_unprotected( current, dir ); } } ffc0ced8: 80 01 00 24 lwz r0,36(r1) ffc0cedc: 83 61 00 0c lwz r27,12(r1) ffc0cee0: 7c 08 03 a6 mtlr r0 ffc0cee4: 83 81 00 10 lwz r28,16(r1) ffc0cee8: 83 a1 00 14 lwz r29,20(r1) ffc0ceec: 83 c1 00 18 lwz r30,24(r1) ffc0cef0: 83 e1 00 1c lwz r31,28(r1) ffc0cef4: 38 21 00 20 addi r1,r1,32 ffc0cef8: 4e 80 00 20 blr =============================================================================== ffc0ae30 <_RTEMS_signal_Post_switch_hook>: #include #include #include static void _RTEMS_signal_Post_switch_hook( Thread_Control *executing ) { ffc0ae30: 94 21 ff e0 stwu r1,-32(r1) ffc0ae34: 7c 08 02 a6 mflr r0 ffc0ae38: 90 01 00 24 stw r0,36(r1) ffc0ae3c: 93 e1 00 1c stw r31,28(r1) RTEMS_API_Control *api; ASR_Information *asr; rtems_signal_set signal_set; Modes_Control prev_mode; api = executing->API_Extensions[ THREAD_API_RTEMS ]; ffc0ae40: 83 e3 01 48 lwz r31,328(r3) #include #include #include static void _RTEMS_signal_Post_switch_hook( Thread_Control *executing ) { ffc0ae44: 93 c1 00 18 stw r30,24(r1) ASR_Information *asr; rtems_signal_set signal_set; Modes_Control prev_mode; api = executing->API_Extensions[ THREAD_API_RTEMS ]; if ( !api ) ffc0ae48: 2f 9f 00 00 cmpwi cr7,r31,0 ffc0ae4c: 41 9e 00 2c beq- cr7,ffc0ae78 <_RTEMS_signal_Post_switch_hook+0x48><== NEVER TAKEN static inline uint32_t ppc_interrupt_disable( void ) { uint32_t level; uint32_t mask; __asm__ volatile ( ffc0ae50: 7d 20 00 a6 mfmsr r9 ffc0ae54: 7d 50 42 a6 mfsprg r10,0 ffc0ae58: 7d 2a 50 78 andc r10,r9,r10 ffc0ae5c: 7d 40 01 24 mtmsr r10 asr = &api->Signal; _ISR_Disable( level ); signal_set = asr->signals_posted; asr->signals_posted = 0; ffc0ae60: 39 40 00 00 li r10,0 */ asr = &api->Signal; _ISR_Disable( level ); signal_set = asr->signals_posted; ffc0ae64: 83 df 00 14 lwz r30,20(r31) asr->signals_posted = 0; ffc0ae68: 91 5f 00 14 stw r10,20(r31) return level; } static inline void ppc_interrupt_enable( uint32_t level ) { __asm__ volatile ( ffc0ae6c: 7d 20 01 24 mtmsr r9 _ISR_Enable( level ); if ( !signal_set ) /* similar to _ASR_Are_signals_pending( asr ) */ ffc0ae70: 2f 9e 00 00 cmpwi cr7,r30,0 ffc0ae74: 40 9e 00 1c bne- cr7,ffc0ae90 <_RTEMS_signal_Post_switch_hook+0x60> (*asr->handler)( signal_set ); asr->nest_level -= 1; rtems_task_mode( prev_mode, RTEMS_ALL_MODE_MASKS, &prev_mode ); } ffc0ae78: 80 01 00 24 lwz r0,36(r1) ffc0ae7c: 83 c1 00 18 lwz r30,24(r1) ffc0ae80: 7c 08 03 a6 mtlr r0 ffc0ae84: 83 e1 00 1c lwz r31,28(r1) ffc0ae88: 38 21 00 20 addi r1,r1,32 ffc0ae8c: 4e 80 00 20 blr if ( !signal_set ) /* similar to _ASR_Are_signals_pending( asr ) */ return; asr->nest_level += 1; ffc0ae90: 81 3f 00 1c lwz r9,28(r31) rtems_task_mode( asr->mode_set, RTEMS_ALL_MODE_MASKS, &prev_mode ); ffc0ae94: 38 80 00 00 li r4,0 ffc0ae98: 80 7f 00 10 lwz r3,16(r31) ffc0ae9c: 38 a1 00 08 addi r5,r1,8 if ( !signal_set ) /* similar to _ASR_Are_signals_pending( asr ) */ return; asr->nest_level += 1; ffc0aea0: 39 29 00 01 addi r9,r9,1 ffc0aea4: 91 3f 00 1c stw r9,28(r31) rtems_task_mode( asr->mode_set, RTEMS_ALL_MODE_MASKS, &prev_mode ); ffc0aea8: 60 84 ff ff ori r4,r4,65535 ffc0aeac: 48 00 05 69 bl ffc0b414 (*asr->handler)( signal_set ); ffc0aeb0: 81 3f 00 0c lwz r9,12(r31) ffc0aeb4: 7f c3 f3 78 mr r3,r30 ffc0aeb8: 7d 29 03 a6 mtctr r9 ffc0aebc: 4e 80 04 21 bctrl asr->nest_level -= 1; ffc0aec0: 81 3f 00 1c lwz r9,28(r31) rtems_task_mode( prev_mode, RTEMS_ALL_MODE_MASKS, &prev_mode ); ffc0aec4: 80 61 00 08 lwz r3,8(r1) ffc0aec8: 38 80 00 00 li r4,0 asr->nest_level += 1; rtems_task_mode( asr->mode_set, RTEMS_ALL_MODE_MASKS, &prev_mode ); (*asr->handler)( signal_set ); asr->nest_level -= 1; ffc0aecc: 39 29 ff ff addi r9,r9,-1 ffc0aed0: 91 3f 00 1c stw r9,28(r31) rtems_task_mode( prev_mode, RTEMS_ALL_MODE_MASKS, &prev_mode ); ffc0aed4: 38 a1 00 08 addi r5,r1,8 ffc0aed8: 60 84 ff ff ori r4,r4,65535 ffc0aedc: 48 00 05 39 bl ffc0b414 } ffc0aee0: 80 01 00 24 lwz r0,36(r1) ffc0aee4: 83 c1 00 18 lwz r30,24(r1) ffc0aee8: 7c 08 03 a6 mtlr r0 ffc0aeec: 83 e1 00 1c lwz r31,28(r1) ffc0aef0: 38 21 00 20 addi r1,r1,32 ffc0aef4: 4e 80 00 20 blr =============================================================================== ffc09fd8 <_RTEMS_tasks_Initialize_user_tasks_body>: * * Output parameters: NONE */ void _RTEMS_tasks_Initialize_user_tasks_body( void ) { ffc09fd8: 94 21 ff d8 stwu r1,-40(r1) ffc09fdc: 7c 08 02 a6 mflr r0 rtems_initialization_tasks_table *user_tasks; /* * Move information into local variables */ user_tasks = Configuration_RTEMS_API.User_initialization_tasks_table; ffc09fe0: 3d 20 00 00 lis r9,0 * * Output parameters: NONE */ void _RTEMS_tasks_Initialize_user_tasks_body( void ) { ffc09fe4: 90 01 00 2c stw r0,44(r1) rtems_initialization_tasks_table *user_tasks; /* * Move information into local variables */ user_tasks = Configuration_RTEMS_API.User_initialization_tasks_table; ffc09fe8: 39 29 20 04 addi r9,r9,8196 * * Output parameters: NONE */ void _RTEMS_tasks_Initialize_user_tasks_body( void ) { ffc09fec: 93 e1 00 24 stw r31,36(r1) rtems_initialization_tasks_table *user_tasks; /* * Move information into local variables */ user_tasks = Configuration_RTEMS_API.User_initialization_tasks_table; ffc09ff0: 83 e9 00 2c lwz r31,44(r9) * * Output parameters: NONE */ void _RTEMS_tasks_Initialize_user_tasks_body( void ) { ffc09ff4: 93 a1 00 1c stw r29,28(r1) maximum = Configuration_RTEMS_API.number_of_initialization_tasks; /* * Verify that we have a set of user tasks to iterate */ if ( !user_tasks ) ffc09ff8: 2f 9f 00 00 cmpwi cr7,r31,0 * * Output parameters: NONE */ void _RTEMS_tasks_Initialize_user_tasks_body( void ) { ffc09ffc: 93 c1 00 20 stw r30,32(r1) /* * Move information into local variables */ user_tasks = Configuration_RTEMS_API.User_initialization_tasks_table; maximum = Configuration_RTEMS_API.number_of_initialization_tasks; ffc0a000: 83 a9 00 28 lwz r29,40(r9) /* * Verify that we have a set of user tasks to iterate */ if ( !user_tasks ) ffc0a004: 41 9e 00 5c beq- cr7,ffc0a060 <_RTEMS_tasks_Initialize_user_tasks_body+0x88> return; /* * Now iterate over the initialization tasks and create/start them. */ for ( index=0 ; index < maximum ; index++ ) { ffc0a008: 2f 9d 00 00 cmpwi cr7,r29,0 ffc0a00c: 3b c0 00 00 li r30,0 ffc0a010: 41 9e 00 50 beq- cr7,ffc0a060 <_RTEMS_tasks_Initialize_user_tasks_body+0x88><== NEVER TAKEN return_value = rtems_task_create( ffc0a014: 80 bf 00 04 lwz r5,4(r31) ffc0a018: 39 01 00 08 addi r8,r1,8 ffc0a01c: 80 7f 00 00 lwz r3,0(r31) ffc0a020: 80 9f 00 08 lwz r4,8(r31) ffc0a024: 80 df 00 14 lwz r6,20(r31) ffc0a028: 80 ff 00 0c lwz r7,12(r31) ffc0a02c: 4b ff fc ed bl ffc09d18 user_tasks[ index ].stack_size, user_tasks[ index ].mode_set, user_tasks[ index ].attribute_set, &id ); if ( !rtems_is_status_successful( return_value ) ) ffc0a030: 7c 65 1b 79 mr. r5,r3 ffc0a034: 40 82 00 48 bne- ffc0a07c <_RTEMS_tasks_Initialize_user_tasks_body+0xa4> _Internal_error_Occurred( INTERNAL_ERROR_RTEMS_API, true, return_value ); return_value = rtems_task_start( ffc0a038: 80 bf 00 18 lwz r5,24(r31) ffc0a03c: 80 61 00 08 lwz r3,8(r1) ffc0a040: 80 9f 00 10 lwz r4,16(r31) ffc0a044: 48 00 00 45 bl ffc0a088 id, user_tasks[ index ].entry_point, user_tasks[ index ].argument ); if ( !rtems_is_status_successful( return_value ) ) ffc0a048: 7c 65 1b 79 mr. r5,r3 ffc0a04c: 40 82 00 30 bne- ffc0a07c <_RTEMS_tasks_Initialize_user_tasks_body+0xa4> return; /* * Now iterate over the initialization tasks and create/start them. */ for ( index=0 ; index < maximum ; index++ ) { ffc0a050: 3b de 00 01 addi r30,r30,1 ffc0a054: 7f 9e e8 00 cmpw cr7,r30,r29 ffc0a058: 3b ff 00 1c addi r31,r31,28 ffc0a05c: 40 9e ff b8 bne+ cr7,ffc0a014 <_RTEMS_tasks_Initialize_user_tasks_body+0x3c><== NEVER TAKEN user_tasks[ index ].argument ); if ( !rtems_is_status_successful( return_value ) ) _Internal_error_Occurred( INTERNAL_ERROR_RTEMS_API, true, return_value ); } } ffc0a060: 80 01 00 2c lwz r0,44(r1) ffc0a064: 83 a1 00 1c lwz r29,28(r1) ffc0a068: 7c 08 03 a6 mtlr r0 ffc0a06c: 83 c1 00 20 lwz r30,32(r1) ffc0a070: 83 e1 00 24 lwz r31,36(r1) ffc0a074: 38 21 00 28 addi r1,r1,40 ffc0a078: 4e 80 00 20 blr id, user_tasks[ index ].entry_point, user_tasks[ index ].argument ); if ( !rtems_is_status_successful( return_value ) ) _Internal_error_Occurred( INTERNAL_ERROR_RTEMS_API, true, return_value ); ffc0a07c: 38 60 00 01 li r3,1 ffc0a080: 38 80 00 01 li r4,1 ffc0a084: 48 00 12 95 bl ffc0b318 <_Internal_error_Occurred> =============================================================================== ffc0f948 <_RTEMS_tasks_Switch_extension>: /* * Per Task Variables */ tvp = executing->task_variables; ffc0f948: 81 23 01 54 lwz r9,340(r3) while (tvp) { ffc0f94c: 2f 89 00 00 cmpwi cr7,r9,0 ffc0f950: 41 9e 00 24 beq- cr7,ffc0f974 <_RTEMS_tasks_Switch_extension+0x2c> tvp->tval = *tvp->ptr; ffc0f954: 81 49 00 04 lwz r10,4(r9) *tvp->ptr = tvp->gval; ffc0f958: 81 09 00 08 lwz r8,8(r9) * Per Task Variables */ tvp = executing->task_variables; while (tvp) { tvp->tval = *tvp->ptr; ffc0f95c: 80 ea 00 00 lwz r7,0(r10) ffc0f960: 90 e9 00 0c stw r7,12(r9) *tvp->ptr = tvp->gval; ffc0f964: 91 0a 00 00 stw r8,0(r10) tvp = (rtems_task_variable_t *)tvp->next; ffc0f968: 81 29 00 00 lwz r9,0(r9) /* * Per Task Variables */ tvp = executing->task_variables; while (tvp) { ffc0f96c: 2f 89 00 00 cmpwi cr7,r9,0 ffc0f970: 40 9e ff e4 bne+ cr7,ffc0f954 <_RTEMS_tasks_Switch_extension+0xc><== NEVER TAKEN tvp->tval = *tvp->ptr; *tvp->ptr = tvp->gval; tvp = (rtems_task_variable_t *)tvp->next; } tvp = heir->task_variables; ffc0f974: 81 24 01 54 lwz r9,340(r4) while (tvp) { ffc0f978: 2f 89 00 00 cmpwi cr7,r9,0 ffc0f97c: 4d 9e 00 20 beqlr cr7 tvp->gval = *tvp->ptr; ffc0f980: 81 49 00 04 lwz r10,4(r9) *tvp->ptr = tvp->tval; ffc0f984: 81 09 00 0c lwz r8,12(r9) tvp = (rtems_task_variable_t *)tvp->next; } tvp = heir->task_variables; while (tvp) { tvp->gval = *tvp->ptr; ffc0f988: 80 ea 00 00 lwz r7,0(r10) ffc0f98c: 90 e9 00 08 stw r7,8(r9) *tvp->ptr = tvp->tval; ffc0f990: 91 0a 00 00 stw r8,0(r10) tvp = (rtems_task_variable_t *)tvp->next; ffc0f994: 81 29 00 00 lwz r9,0(r9) *tvp->ptr = tvp->gval; tvp = (rtems_task_variable_t *)tvp->next; } tvp = heir->task_variables; while (tvp) { ffc0f998: 2f 89 00 00 cmpwi cr7,r9,0 ffc0f99c: 40 9e ff e4 bne+ cr7,ffc0f980 <_RTEMS_tasks_Switch_extension+0x38><== NEVER TAKEN ffc0f9a0: 4e 80 00 20 blr =============================================================================== ffc3e0e8 <_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 ) { ffc3e0e8: 94 21 ff d8 stwu r1,-40(r1) ffc3e0ec: 7c 08 02 a6 mflr r0 ffc3e0f0: 93 81 00 18 stw r28,24(r1) ffc3e0f4: 7c 9c 23 78 mr r28,r4 */ static inline void _TOD_Get_uptime( Timestamp_Control *time ) { _TOD_Get_with_nanoseconds( time, &_TOD.uptime ); ffc3e0f8: 3c 80 00 00 lis r4,0 ffc3e0fc: 90 01 00 2c stw r0,44(r1) ffc3e100: 38 84 63 48 addi r4,r4,25416 ffc3e104: 93 c1 00 20 stw r30,32(r1) ffc3e108: 7c 7e 1b 78 mr r30,r3 ffc3e10c: 38 61 00 08 addi r3,r1,8 ffc3e110: 93 a1 00 1c stw r29,28(r1) ffc3e114: 93 e1 00 24 stw r31,36(r1) ffc3e118: 7c bf 2b 78 mr r31,r5 #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ Timestamp_Control uptime; #endif Thread_Control *owning_thread = the_period->owner; ffc3e11c: 83 be 00 40 lwz r29,64(r30) ffc3e120: 4b fc c4 d9 bl ffc0a5f8 <_TOD_Get_with_nanoseconds> * Determine cpu usage since period initiated. */ used = owning_thread->cpu_time_used; #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ if (owning_thread == _Thread_Executing) { ffc3e124: 3c e0 00 00 lis r7,0 const Timestamp64_Control *_start, const Timestamp64_Control *_end, Timestamp64_Control *_result ) { *_result = *_end - *_start; ffc3e128: 81 1e 00 50 lwz r8,80(r30) ffc3e12c: 38 e7 65 60 addi r7,r7,25952 ffc3e130: 81 3e 00 54 lwz r9,84(r30) ffc3e134: 81 47 00 10 lwz r10,16(r7) /* * Determine elapsed wall time since period initiated. */ #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ _TOD_Get_uptime( &uptime ); _Timestamp_Subtract( ffc3e138: 81 61 00 0c lwz r11,12(r1) * Determine cpu usage since period initiated. */ used = owning_thread->cpu_time_used; #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ if (owning_thread == _Thread_Executing) { ffc3e13c: 7f 8a e8 00 cmpw cr7,r10,r29 /* * Determine elapsed wall time since period initiated. */ #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ _TOD_Get_uptime( &uptime ); _Timestamp_Subtract( ffc3e140: 81 41 00 08 lwz r10,8(r1) ffc3e144: 7d 29 58 10 subfc r9,r9,r11 ffc3e148: 7d 08 51 10 subfe r8,r8,r10 ffc3e14c: 91 1c 00 00 stw r8,0(r28) ffc3e150: 91 3c 00 04 stw r9,4(r28) #endif /* * Determine cpu usage since period initiated. */ used = owning_thread->cpu_time_used; ffc3e154: 81 1d 00 80 lwz r8,128(r29) ffc3e158: 81 3d 00 84 lwz r9,132(r29) #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ if (owning_thread == _Thread_Executing) { ffc3e15c: 41 9e 00 28 beq- cr7,ffc3e184 <_Rate_monotonic_Get_status+0x9c> if (used < the_period->cpu_usage_period_initiated) return false; *cpu_since_last_period = used - the_period->cpu_usage_period_initiated; #endif return true; ffc3e160: 38 60 00 01 li r3,1 } ffc3e164: 80 01 00 2c lwz r0,44(r1) ffc3e168: 83 81 00 18 lwz r28,24(r1) ffc3e16c: 7c 08 03 a6 mtlr r0 ffc3e170: 83 a1 00 1c lwz r29,28(r1) ffc3e174: 83 c1 00 20 lwz r30,32(r1) ffc3e178: 83 e1 00 24 lwz r31,36(r1) ffc3e17c: 38 21 00 28 addi r1,r1,40 ffc3e180: 4e 80 00 20 blr ffc3e184: 80 87 00 20 lwz r4,32(r7) ffc3e188: 80 a7 00 24 lwz r5,36(r7) case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } ffc3e18c: 80 de 00 48 lwz r6,72(r30) ffc3e190: 7d 65 58 10 subfc r11,r5,r11 ffc3e194: 7d 44 51 10 subfe r10,r4,r10 ffc3e198: 80 fe 00 4c lwz r7,76(r30) static inline void _Timestamp64_implementation_Add_to( Timestamp64_Control *_time, const Timestamp64_Control *_add ) { *_time += *_add; ffc3e19c: 7d 29 58 14 addc r9,r9,r11 ffc3e1a0: 7d 08 51 14 adde r8,r8,r10 /* * The cpu usage info was reset while executing. Can't * determine a status. */ if (_Timestamp_Less_than(&used, &the_period->cpu_usage_period_initiated)) ffc3e1a4: 7f 86 40 00 cmpw cr7,r6,r8 ffc3e1a8: 41 9d 00 44 bgt- cr7,ffc3e1ec <_Rate_monotonic_Get_status+0x104><== NEVER TAKEN ffc3e1ac: 41 9e 00 38 beq- cr7,ffc3e1e4 <_Rate_monotonic_Get_status+0xfc> return false; *cpu_since_last_period = used - the_period->cpu_usage_period_initiated; #endif return true; } ffc3e1b0: 80 01 00 2c lwz r0,44(r1) const Timestamp64_Control *_start, const Timestamp64_Control *_end, Timestamp64_Control *_result ) { *_result = *_end - *_start; ffc3e1b4: 7d 27 48 10 subfc r9,r7,r9 ffc3e1b8: 7d 06 41 10 subfe r8,r6,r8 ffc3e1bc: 91 1f 00 00 stw r8,0(r31) ffc3e1c0: 7c 08 03 a6 mtlr r0 if (used < the_period->cpu_usage_period_initiated) return false; *cpu_since_last_period = used - the_period->cpu_usage_period_initiated; #endif return true; ffc3e1c4: 38 60 00 01 li r3,1 ffc3e1c8: 91 3f 00 04 stw r9,4(r31) } ffc3e1cc: 83 81 00 18 lwz r28,24(r1) ffc3e1d0: 83 a1 00 1c lwz r29,28(r1) ffc3e1d4: 83 c1 00 20 lwz r30,32(r1) ffc3e1d8: 83 e1 00 24 lwz r31,36(r1) ffc3e1dc: 38 21 00 28 addi r1,r1,40 ffc3e1e0: 4e 80 00 20 blr /* * The cpu usage info was reset while executing. Can't * determine a status. */ if (_Timestamp_Less_than(&used, &the_period->cpu_usage_period_initiated)) ffc3e1e4: 7f 87 48 40 cmplw cr7,r7,r9 ffc3e1e8: 40 9d ff c8 ble+ cr7,ffc3e1b0 <_Rate_monotonic_Get_status+0xc8> return false; ffc3e1ec: 38 60 00 00 li r3,0 ffc3e1f0: 4b ff ff 74 b ffc3e164 <_Rate_monotonic_Get_status+0x7c> =============================================================================== ffc3e650 <_Rate_monotonic_Timeout>: void _Rate_monotonic_Timeout( Objects_Id id, void *ignored ) { ffc3e650: 94 21 ff e0 stwu r1,-32(r1) ffc3e654: 7c 08 02 a6 mflr r0 ffc3e658: 7c 64 1b 78 mr r4,r3 ffc3e65c: 3c 60 00 00 lis r3,0 ffc3e660: 90 01 00 24 stw r0,36(r1) ffc3e664: 38 63 67 e0 addi r3,r3,26592 ffc3e668: 38 a1 00 08 addi r5,r1,8 ffc3e66c: 93 e1 00 1c stw r31,28(r1) ffc3e670: 4b fc cb cd bl ffc0b23c <_Objects_Get> /* * 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 ) { ffc3e674: 81 21 00 08 lwz r9,8(r1) ffc3e678: 2f 89 00 00 cmpwi cr7,r9,0 ffc3e67c: 40 9e 00 4c bne- cr7,ffc3e6c8 <_Rate_monotonic_Timeout+0x78><== NEVER TAKEN ffc3e680: 7c 7f 1b 78 mr r31,r3 case OBJECTS_LOCAL: the_thread = the_period->owner; ffc3e684: 80 63 00 40 lwz r3,64(r3) */ RTEMS_INLINE_ROUTINE bool _States_Is_waiting_for_period ( States_Control the_states ) { return (the_states & STATES_WAITING_FOR_PERIOD); ffc3e688: 81 23 00 10 lwz r9,16(r3) if ( _States_Is_waiting_for_period( the_thread->current_state ) && ffc3e68c: 71 2a 40 00 andi. r10,r9,16384 ffc3e690: 41 82 00 14 beq- ffc3e6a4 <_Rate_monotonic_Timeout+0x54> ffc3e694: 81 43 00 20 lwz r10,32(r3) ffc3e698: 81 3f 00 08 lwz r9,8(r31) ffc3e69c: 7f 8a 48 00 cmpw cr7,r10,r9 ffc3e6a0: 41 9e 00 68 beq- cr7,ffc3e708 <_Rate_monotonic_Timeout+0xb8> _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 ) { ffc3e6a4: 81 3f 00 38 lwz r9,56(r31) ffc3e6a8: 2f 89 00 01 cmpwi cr7,r9,1 ffc3e6ac: 41 9e 00 30 beq- cr7,ffc3e6dc <_Rate_monotonic_Timeout+0x8c> _Rate_monotonic_Initiate_statistics( the_period ); _Watchdog_Insert_ticks( &the_period->Timer, the_period->next_length ); } else the_period->state = RATE_MONOTONIC_EXPIRED; ffc3e6b0: 39 20 00 04 li r9,4 ffc3e6b4: 91 3f 00 38 stw r9,56(r31) * * 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; ffc3e6b8: 3d 20 00 00 lis r9,0 ffc3e6bc: 81 49 34 80 lwz r10,13440(r9) --level; ffc3e6c0: 39 4a ff ff addi r10,r10,-1 _Thread_Dispatch_disable_level = level; ffc3e6c4: 91 49 34 80 stw r10,13440(r9) case OBJECTS_REMOTE: /* impossible */ #endif case OBJECTS_ERROR: break; } } ffc3e6c8: 80 01 00 24 lwz r0,36(r1) ffc3e6cc: 83 e1 00 1c lwz r31,28(r1) ffc3e6d0: 7c 08 03 a6 mtlr r0 ffc3e6d4: 38 21 00 20 addi r1,r1,32 ffc3e6d8: 4e 80 00 20 blr _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 ) { the_period->state = RATE_MONOTONIC_EXPIRED_WHILE_BLOCKING; ffc3e6dc: 39 20 00 03 li r9,3 ffc3e6e0: 91 3f 00 38 stw r9,56(r31) _Rate_monotonic_Initiate_statistics( the_period ); ffc3e6e4: 7f e3 fb 78 mr r3,r31 ffc3e6e8: 4b ff fc 5d bl ffc3e344 <_Rate_monotonic_Initiate_statistics> Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; ffc3e6ec: 81 3f 00 3c lwz r9,60(r31) _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); ffc3e6f0: 3c 60 00 00 lis r3,0 Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; ffc3e6f4: 91 3f 00 1c stw r9,28(r31) _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); ffc3e6f8: 38 63 64 88 addi r3,r3,25736 ffc3e6fc: 38 9f 00 10 addi r4,r31,16 ffc3e700: 4b fc ea d5 bl ffc0d1d4 <_Watchdog_Insert> ffc3e704: 4b ff ff b4 b ffc3e6b8 <_Rate_monotonic_Timeout+0x68> RTEMS_INLINE_ROUTINE void _Thread_Unblock ( Thread_Control *the_thread ) { _Thread_Clear_state( the_thread, STATES_BLOCKED ); ffc3e708: 3c 80 10 07 lis r4,4103 ffc3e70c: 60 84 ff f8 ori r4,r4,65528 ffc3e710: 4b fc d6 31 bl ffc0bd40 <_Thread_Clear_state> ffc3e714: 4b ff ff d0 b ffc3e6e4 <_Rate_monotonic_Timeout+0x94> =============================================================================== ffc3e1f4 <_Rate_monotonic_Update_statistics>: } static void _Rate_monotonic_Update_statistics( Rate_monotonic_Control *the_period ) { ffc3e1f4: 94 21 ff e0 stwu r1,-32(r1) ffc3e1f8: 7c 08 02 a6 mflr r0 ffc3e1fc: 90 01 00 24 stw r0,36(r1) * Update the counts. */ stats = &the_period->Statistics; stats->count++; if ( the_period->state == RATE_MONOTONIC_EXPIRED ) ffc3e200: 81 43 00 38 lwz r10,56(r3) /* * Update the counts. */ stats = &the_period->Statistics; stats->count++; ffc3e204: 81 23 00 58 lwz r9,88(r3) if ( the_period->state == RATE_MONOTONIC_EXPIRED ) ffc3e208: 2f 8a 00 04 cmpwi cr7,r10,4 } static void _Rate_monotonic_Update_statistics( Rate_monotonic_Control *the_period ) { ffc3e20c: 93 e1 00 1c stw r31,28(r1) /* * Update the counts. */ stats = &the_period->Statistics; stats->count++; ffc3e210: 39 29 00 01 addi r9,r9,1 } static void _Rate_monotonic_Update_statistics( Rate_monotonic_Control *the_period ) { ffc3e214: 7c 7f 1b 78 mr r31,r3 /* * Update the counts. */ stats = &the_period->Statistics; stats->count++; ffc3e218: 91 23 00 58 stw r9,88(r3) if ( the_period->state == RATE_MONOTONIC_EXPIRED ) ffc3e21c: 41 9e 00 cc beq- cr7,ffc3e2e8 <_Rate_monotonic_Update_statistics+0xf4> stats->missed_count++; /* * Grab status for time statistics. */ valid_status = ffc3e220: 7f e3 fb 78 mr r3,r31 ffc3e224: 38 81 00 08 addi r4,r1,8 ffc3e228: 38 a1 00 10 addi r5,r1,16 ffc3e22c: 4b ff fe bd bl ffc3e0e8 <_Rate_monotonic_Get_status> _Rate_monotonic_Get_status( the_period, &since_last_period, &executed ); if (!valid_status) ffc3e230: 2f 83 00 00 cmpwi cr7,r3,0 ffc3e234: 41 9e 00 8c beq- cr7,ffc3e2c0 <_Rate_monotonic_Update_statistics+0xcc> /* * Update CPU time */ #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ _Timestamp_Add_to( &stats->total_cpu_time, &executed ); ffc3e238: 81 41 00 10 lwz r10,16(r1) if ( _Timestamp_Less_than( &executed, &stats->min_cpu_time ) ) ffc3e23c: 80 ff 00 60 lwz r7,96(r31) static inline void _Timestamp64_implementation_Add_to( Timestamp64_Control *_time, const Timestamp64_Control *_add ) { *_time += *_add; ffc3e240: 81 1f 00 70 lwz r8,112(r31) ffc3e244: 7f 87 50 00 cmpw cr7,r7,r10 ffc3e248: 81 3f 00 74 lwz r9,116(r31) /* * Update CPU time */ #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ _Timestamp_Add_to( &stats->total_cpu_time, &executed ); ffc3e24c: 81 61 00 14 lwz r11,20(r1) ffc3e250: 7d 29 58 14 addc r9,r9,r11 ffc3e254: 7d 08 51 14 adde r8,r8,r10 ffc3e258: 91 1f 00 70 stw r8,112(r31) ffc3e25c: 91 3f 00 74 stw r9,116(r31) if ( _Timestamp_Less_than( &executed, &stats->min_cpu_time ) ) ffc3e260: 40 9d 00 74 ble- cr7,ffc3e2d4 <_Rate_monotonic_Update_statistics+0xe0> stats->min_cpu_time = executed; ffc3e264: 91 5f 00 60 stw r10,96(r31) ffc3e268: 91 7f 00 64 stw r11,100(r31) if ( _Timestamp_Greater_than( &executed, &stats->max_cpu_time ) ) ffc3e26c: 81 3f 00 68 lwz r9,104(r31) ffc3e270: 7f 89 50 00 cmpw cr7,r9,r10 ffc3e274: 41 9c 00 c4 blt- cr7,ffc3e338 <_Rate_monotonic_Update_statistics+0x144><== NEVER TAKEN ffc3e278: 41 9e 00 b4 beq- cr7,ffc3e32c <_Rate_monotonic_Update_statistics+0x138><== ALWAYS TAKEN /* * Update Wall time */ #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ _Timestamp_Add_to( &stats->total_wall_time, &since_last_period ); ffc3e27c: 81 41 00 08 lwz r10,8(r1) if ( _Timestamp_Less_than( &since_last_period, &stats->min_wall_time ) ) ffc3e280: 80 ff 00 78 lwz r7,120(r31) ffc3e284: 81 1f 00 88 lwz r8,136(r31) ffc3e288: 7f 87 50 00 cmpw cr7,r7,r10 ffc3e28c: 81 3f 00 8c lwz r9,140(r31) /* * Update Wall time */ #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ _Timestamp_Add_to( &stats->total_wall_time, &since_last_period ); ffc3e290: 81 61 00 0c lwz r11,12(r1) ffc3e294: 7d 29 58 14 addc r9,r9,r11 ffc3e298: 7d 08 51 14 adde r8,r8,r10 ffc3e29c: 91 1f 00 88 stw r8,136(r31) ffc3e2a0: 91 3f 00 8c stw r9,140(r31) if ( _Timestamp_Less_than( &since_last_period, &stats->min_wall_time ) ) ffc3e2a4: 41 9d 00 60 bgt- cr7,ffc3e304 <_Rate_monotonic_Update_statistics+0x110> ffc3e2a8: 41 9e 00 50 beq- cr7,ffc3e2f8 <_Rate_monotonic_Update_statistics+0x104><== ALWAYS TAKEN stats->min_wall_time = since_last_period; if ( _Timestamp_Greater_than( &since_last_period, &stats->max_wall_time ) ) ffc3e2ac: 81 3f 00 80 lwz r9,128(r31) ffc3e2b0: 7f 89 50 00 cmpw cr7,r9,r10 ffc3e2b4: 40 9c 00 64 bge- cr7,ffc3e318 <_Rate_monotonic_Update_statistics+0x124><== ALWAYS TAKEN stats->max_wall_time = since_last_period; ffc3e2b8: 91 5f 00 80 stw r10,128(r31) ffc3e2bc: 91 7f 00 84 stw r11,132(r31) stats->min_wall_time = since_last_period; if ( since_last_period > stats->max_wall_time ) stats->max_wall_time = since_last_period; #endif } ffc3e2c0: 80 01 00 24 lwz r0,36(r1) ffc3e2c4: 83 e1 00 1c lwz r31,28(r1) ffc3e2c8: 7c 08 03 a6 mtlr r0 ffc3e2cc: 38 21 00 20 addi r1,r1,32 ffc3e2d0: 4e 80 00 20 blr * 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 ) ) ffc3e2d4: 40 be ff 98 bne- cr7,ffc3e26c <_Rate_monotonic_Update_statistics+0x78><== NEVER TAKEN ffc3e2d8: 81 3f 00 64 lwz r9,100(r31) ffc3e2dc: 7f 89 58 40 cmplw cr7,r9,r11 ffc3e2e0: 40 bd ff 8c ble- cr7,ffc3e26c <_Rate_monotonic_Update_statistics+0x78> ffc3e2e4: 4b ff ff 80 b ffc3e264 <_Rate_monotonic_Update_statistics+0x70> */ stats = &the_period->Statistics; stats->count++; if ( the_period->state == RATE_MONOTONIC_EXPIRED ) stats->missed_count++; ffc3e2e8: 81 23 00 5c lwz r9,92(r3) ffc3e2ec: 39 29 00 01 addi r9,r9,1 ffc3e2f0: 91 23 00 5c stw r9,92(r3) ffc3e2f4: 4b ff ff 2c b ffc3e220 <_Rate_monotonic_Update_statistics+0x2c> * Update Wall time */ #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ _Timestamp_Add_to( &stats->total_wall_time, &since_last_period ); if ( _Timestamp_Less_than( &since_last_period, &stats->min_wall_time ) ) ffc3e2f8: 81 3f 00 7c lwz r9,124(r31) ffc3e2fc: 7f 89 58 40 cmplw cr7,r9,r11 ffc3e300: 40 bd ff ac ble- cr7,ffc3e2ac <_Rate_monotonic_Update_statistics+0xb8> stats->min_wall_time = since_last_period; if ( _Timestamp_Greater_than( &since_last_period, &stats->max_wall_time ) ) ffc3e304: 81 3f 00 80 lwz r9,128(r31) */ #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ _Timestamp_Add_to( &stats->total_wall_time, &since_last_period ); if ( _Timestamp_Less_than( &since_last_period, &stats->min_wall_time ) ) stats->min_wall_time = since_last_period; ffc3e308: 91 5f 00 78 stw r10,120(r31) if ( _Timestamp_Greater_than( &since_last_period, &stats->max_wall_time ) ) ffc3e30c: 7f 89 50 00 cmpw cr7,r9,r10 */ #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ _Timestamp_Add_to( &stats->total_wall_time, &since_last_period ); if ( _Timestamp_Less_than( &since_last_period, &stats->min_wall_time ) ) stats->min_wall_time = since_last_period; ffc3e310: 91 7f 00 7c stw r11,124(r31) if ( _Timestamp_Greater_than( &since_last_period, &stats->max_wall_time ) ) ffc3e314: 41 9c ff a4 blt+ cr7,ffc3e2b8 <_Rate_monotonic_Update_statistics+0xc4><== NEVER TAKEN ffc3e318: 40 be ff a8 bne- cr7,ffc3e2c0 <_Rate_monotonic_Update_statistics+0xcc> ffc3e31c: 81 3f 00 84 lwz r9,132(r31) ffc3e320: 7f 89 58 40 cmplw cr7,r9,r11 ffc3e324: 41 9c ff 94 blt+ cr7,ffc3e2b8 <_Rate_monotonic_Update_statistics+0xc4> ffc3e328: 4b ff ff 98 b ffc3e2c0 <_Rate_monotonic_Update_statistics+0xcc> _Timestamp_Add_to( &stats->total_cpu_time, &executed ); if ( _Timestamp_Less_than( &executed, &stats->min_cpu_time ) ) stats->min_cpu_time = executed; if ( _Timestamp_Greater_than( &executed, &stats->max_cpu_time ) ) ffc3e32c: 81 3f 00 6c lwz r9,108(r31) ffc3e330: 7f 89 58 40 cmplw cr7,r9,r11 ffc3e334: 40 bc ff 48 bge- cr7,ffc3e27c <_Rate_monotonic_Update_statistics+0x88> stats->max_cpu_time = executed; ffc3e338: 91 5f 00 68 stw r10,104(r31) ffc3e33c: 91 7f 00 6c stw r11,108(r31) ffc3e340: 4b ff ff 3c b ffc3e27c <_Rate_monotonic_Update_statistics+0x88> =============================================================================== ffc0c8d8 <_Scheduler_CBS_Allocate>: #include void *_Scheduler_CBS_Allocate( Thread_Control *the_thread ) { ffc0c8d8: 94 21 ff f0 stwu r1,-16(r1) ffc0c8dc: 7c 08 02 a6 mflr r0 ffc0c8e0: 93 e1 00 0c stw r31,12(r1) ffc0c8e4: 7c 7f 1b 78 mr r31,r3 void *sched; Scheduler_CBS_Per_thread *schinfo; sched = _Workspace_Allocate(sizeof(Scheduler_CBS_Per_thread)); ffc0c8e8: 38 60 00 1c li r3,28 #include void *_Scheduler_CBS_Allocate( Thread_Control *the_thread ) { ffc0c8ec: 90 01 00 14 stw r0,20(r1) void *sched; Scheduler_CBS_Per_thread *schinfo; sched = _Workspace_Allocate(sizeof(Scheduler_CBS_Per_thread)); ffc0c8f0: 48 00 22 3d bl ffc0eb2c <_Workspace_Allocate> if ( sched ) { ffc0c8f4: 2c 03 00 00 cmpwi r3,0 ffc0c8f8: 41 82 00 1c beq- ffc0c914 <_Scheduler_CBS_Allocate+0x3c><== NEVER TAKEN the_thread->scheduler_info = sched; schinfo = (Scheduler_CBS_Per_thread *)(the_thread->scheduler_info); schinfo->edf_per_thread.thread = the_thread; schinfo->edf_per_thread.queue_state = SCHEDULER_EDF_QUEUE_STATE_NEVER_HAS_BEEN; ffc0c8fc: 39 40 00 02 li r10,2 void *sched; Scheduler_CBS_Per_thread *schinfo; sched = _Workspace_Allocate(sizeof(Scheduler_CBS_Per_thread)); if ( sched ) { the_thread->scheduler_info = sched; ffc0c900: 90 7f 00 88 stw r3,136(r31) schinfo = (Scheduler_CBS_Per_thread *)(the_thread->scheduler_info); schinfo->edf_per_thread.thread = the_thread; schinfo->edf_per_thread.queue_state = SCHEDULER_EDF_QUEUE_STATE_NEVER_HAS_BEEN; ffc0c904: 91 43 00 14 stw r10,20(r3) schinfo->cbs_server = NULL; ffc0c908: 39 40 00 00 li r10,0 sched = _Workspace_Allocate(sizeof(Scheduler_CBS_Per_thread)); if ( sched ) { the_thread->scheduler_info = sched; schinfo = (Scheduler_CBS_Per_thread *)(the_thread->scheduler_info); schinfo->edf_per_thread.thread = the_thread; ffc0c90c: 93 e3 00 00 stw r31,0(r3) schinfo->edf_per_thread.queue_state = SCHEDULER_EDF_QUEUE_STATE_NEVER_HAS_BEEN; schinfo->cbs_server = NULL; ffc0c910: 91 43 00 18 stw r10,24(r3) } return sched; } ffc0c914: 80 01 00 14 lwz r0,20(r1) ffc0c918: 83 e1 00 0c lwz r31,12(r1) ffc0c91c: 7c 08 03 a6 mtlr r0 ffc0c920: 38 21 00 10 addi r1,r1,16 ffc0c924: 4e 80 00 20 blr =============================================================================== ffc0e340 <_Scheduler_CBS_Budget_callout>: Scheduler_CBS_Server **_Scheduler_CBS_Server_list; void _Scheduler_CBS_Budget_callout( Thread_Control *the_thread ) { ffc0e340: 94 21 ff e0 stwu r1,-32(r1) ffc0e344: 7c 08 02 a6 mflr r0 ffc0e348: 90 01 00 24 stw r0,36(r1) 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; ffc0e34c: 80 83 00 ac lwz r4,172(r3) if ( the_thread->real_priority != new_priority ) ffc0e350: 81 23 00 18 lwz r9,24(r3) Scheduler_CBS_Server **_Scheduler_CBS_Server_list; void _Scheduler_CBS_Budget_callout( Thread_Control *the_thread ) { ffc0e354: 93 e1 00 1c stw r31,28(r1) ffc0e358: 7c 7f 1b 78 mr r31,r3 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; if ( the_thread->real_priority != new_priority ) ffc0e35c: 7f 89 20 00 cmpw cr7,r9,r4 ffc0e360: 41 9e 00 08 beq- cr7,ffc0e368 <_Scheduler_CBS_Budget_callout+0x28><== NEVER TAKEN the_thread->real_priority = new_priority; ffc0e364: 90 83 00 18 stw r4,24(r3) if ( the_thread->current_priority != new_priority ) ffc0e368: 81 3f 00 14 lwz r9,20(r31) ffc0e36c: 7f 89 20 00 cmpw cr7,r9,r4 ffc0e370: 41 9e 00 10 beq- cr7,ffc0e380 <_Scheduler_CBS_Budget_callout+0x40><== NEVER TAKEN _Thread_Change_priority(the_thread, new_priority, true); ffc0e374: 7f e3 fb 78 mr r3,r31 ffc0e378: 38 a0 00 01 li r5,1 ffc0e37c: 48 00 06 fd bl ffc0ea78 <_Thread_Change_priority> /* Invoke callback function if any. */ sched_info = (Scheduler_CBS_Per_thread *) the_thread->scheduler_info; ffc0e380: 83 ff 00 88 lwz r31,136(r31) if ( sched_info->cbs_server->cbs_budget_overrun ) { ffc0e384: 81 3f 00 18 lwz r9,24(r31) ffc0e388: 81 49 00 0c lwz r10,12(r9) ffc0e38c: 2f 8a 00 00 cmpwi cr7,r10,0 ffc0e390: 41 9e 00 24 beq- cr7,ffc0e3b4 <_Scheduler_CBS_Budget_callout+0x74><== NEVER TAKEN _Scheduler_CBS_Get_server_id( ffc0e394: 80 69 00 00 lwz r3,0(r9) ffc0e398: 38 81 00 08 addi r4,r1,8 ffc0e39c: 4b ff ff 4d bl ffc0e2e8 <_Scheduler_CBS_Get_server_id> sched_info->cbs_server->task_id, &server_id ); sched_info->cbs_server->cbs_budget_overrun( server_id ); ffc0e3a0: 81 3f 00 18 lwz r9,24(r31) ffc0e3a4: 80 61 00 08 lwz r3,8(r1) ffc0e3a8: 81 29 00 0c lwz r9,12(r9) ffc0e3ac: 7d 29 03 a6 mtctr r9 ffc0e3b0: 4e 80 04 21 bctrl } } ffc0e3b4: 80 01 00 24 lwz r0,36(r1) ffc0e3b8: 83 e1 00 1c lwz r31,28(r1) ffc0e3bc: 7c 08 03 a6 mtlr r0 ffc0e3c0: 38 21 00 20 addi r1,r1,32 ffc0e3c4: 4e 80 00 20 blr =============================================================================== ffc0dcfc <_Scheduler_CBS_Cleanup>: #include #include #include int _Scheduler_CBS_Cleanup (void) { ffc0dcfc: 94 21 ff e8 stwu r1,-24(r1) ffc0dd00: 7c 08 02 a6 mflr r0 ffc0dd04: 93 c1 00 10 stw r30,16(r1) unsigned int i; for ( i = 0; i<_Scheduler_CBS_Maximum_servers; i++ ) { ffc0dd08: 3f c0 00 00 lis r30,0 ffc0dd0c: 81 3e 27 94 lwz r9,10132(r30) #include #include #include int _Scheduler_CBS_Cleanup (void) { ffc0dd10: 90 01 00 1c stw r0,28(r1) unsigned int i; for ( i = 0; i<_Scheduler_CBS_Maximum_servers; i++ ) { ffc0dd14: 2f 89 00 00 cmpwi cr7,r9,0 #include #include #include int _Scheduler_CBS_Cleanup (void) { ffc0dd18: 93 a1 00 0c stw r29,12(r1) ffc0dd1c: 93 e1 00 14 stw r31,20(r1) unsigned int i; for ( i = 0; i<_Scheduler_CBS_Maximum_servers; i++ ) { ffc0dd20: 41 9e 00 68 beq- cr7,ffc0dd88 <_Scheduler_CBS_Cleanup+0x8c><== NEVER TAKEN ffc0dd24: 3f a0 00 00 lis r29,0 ffc0dd28: 81 5d 28 b0 lwz r10,10416(r29) ffc0dd2c: 3b e0 00 00 li r31,0 ffc0dd30: 3b de 27 94 addi r30,r30,10132 if ( _Scheduler_CBS_Server_list[ i ] ) ffc0dd34: 57 e9 10 3a rlwinm r9,r31,2,0,29 ffc0dd38: 7d 2a 48 2e lwzx r9,r10,r9 _Scheduler_CBS_Destroy_server( i ); ffc0dd3c: 7f e3 fb 78 mr r3,r31 int _Scheduler_CBS_Cleanup (void) { unsigned int i; for ( i = 0; i<_Scheduler_CBS_Maximum_servers; i++ ) { ffc0dd40: 3b ff 00 01 addi r31,r31,1 if ( _Scheduler_CBS_Server_list[ i ] ) ffc0dd44: 2f 89 00 00 cmpwi cr7,r9,0 ffc0dd48: 41 9e 00 0c beq- cr7,ffc0dd54 <_Scheduler_CBS_Cleanup+0x58> _Scheduler_CBS_Destroy_server( i ); ffc0dd4c: 48 00 01 95 bl ffc0dee0 <_Scheduler_CBS_Destroy_server> ffc0dd50: 81 5d 28 b0 lwz r10,10416(r29) int _Scheduler_CBS_Cleanup (void) { unsigned int i; for ( i = 0; i<_Scheduler_CBS_Maximum_servers; i++ ) { ffc0dd54: 81 3e 00 00 lwz r9,0(r30) ffc0dd58: 7f 89 f8 40 cmplw cr7,r9,r31 ffc0dd5c: 41 9d ff d8 bgt+ cr7,ffc0dd34 <_Scheduler_CBS_Cleanup+0x38> if ( _Scheduler_CBS_Server_list[ i ] ) _Scheduler_CBS_Destroy_server( i ); } _Workspace_Free( _Scheduler_CBS_Server_list ); ffc0dd60: 7d 43 53 78 mr r3,r10 ffc0dd64: 48 00 28 55 bl ffc105b8 <_Workspace_Free> return SCHEDULER_CBS_OK; } ffc0dd68: 80 01 00 1c lwz r0,28(r1) ffc0dd6c: 83 a1 00 0c lwz r29,12(r1) ffc0dd70: 38 60 00 00 li r3,0 ffc0dd74: 7c 08 03 a6 mtlr r0 ffc0dd78: 83 c1 00 10 lwz r30,16(r1) ffc0dd7c: 83 e1 00 14 lwz r31,20(r1) ffc0dd80: 38 21 00 18 addi r1,r1,24 ffc0dd84: 4e 80 00 20 blr ffc0dd88: 3d 20 00 00 lis r9,0 <== NOT EXECUTED ffc0dd8c: 81 49 28 b0 lwz r10,10416(r9) <== NOT EXECUTED ffc0dd90: 4b ff ff d0 b ffc0dd60 <_Scheduler_CBS_Cleanup+0x64> <== NOT EXECUTED =============================================================================== ffc0dd94 <_Scheduler_CBS_Create_server>: int _Scheduler_CBS_Create_server ( Scheduler_CBS_Parameters *params, Scheduler_CBS_Budget_overrun budget_overrun_callback, rtems_id *server_id ) { ffc0dd94: 94 21 ff e0 stwu r1,-32(r1) ffc0dd98: 7c 08 02 a6 mflr r0 ffc0dd9c: 90 01 00 24 stw r0,36(r1) unsigned int i; Scheduler_CBS_Server *the_server; if ( params->budget <= 0 || ffc0dda0: 81 23 00 04 lwz r9,4(r3) int _Scheduler_CBS_Create_server ( Scheduler_CBS_Parameters *params, Scheduler_CBS_Budget_overrun budget_overrun_callback, rtems_id *server_id ) { ffc0dda4: 93 e1 00 1c stw r31,28(r1) ffc0dda8: 7c 7f 1b 78 mr r31,r3 unsigned int i; Scheduler_CBS_Server *the_server; if ( params->budget <= 0 || ffc0ddac: 2f 89 00 00 cmpwi cr7,r9,0 int _Scheduler_CBS_Create_server ( Scheduler_CBS_Parameters *params, Scheduler_CBS_Budget_overrun budget_overrun_callback, rtems_id *server_id ) { ffc0ddb0: 93 41 00 08 stw r26,8(r1) ffc0ddb4: 93 61 00 0c stw r27,12(r1) ffc0ddb8: 93 81 00 10 stw r28,16(r1) ffc0ddbc: 93 a1 00 14 stw r29,20(r1) ffc0ddc0: 93 c1 00 18 stw r30,24(r1) unsigned int i; Scheduler_CBS_Server *the_server; if ( params->budget <= 0 || ffc0ddc4: 40 9d 01 0c ble- cr7,ffc0ded0 <_Scheduler_CBS_Create_server+0x13c> ffc0ddc8: 81 23 00 00 lwz r9,0(r3) ffc0ddcc: 2f 89 00 00 cmpwi cr7,r9,0 ffc0ddd0: 40 9d 01 00 ble- cr7,ffc0ded0 <_Scheduler_CBS_Create_server+0x13c> 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++ ) { ffc0ddd4: 3d 20 00 00 lis r9,0 ffc0ddd8: 81 09 27 94 lwz r8,10132(r9) ffc0dddc: 2f 88 00 00 cmpwi cr7,r8,0 ffc0dde0: 41 9e 00 44 beq- cr7,ffc0de24 <_Scheduler_CBS_Create_server+0x90><== NEVER TAKEN if ( !_Scheduler_CBS_Server_list[i] ) ffc0dde4: 3f 80 00 00 lis r28,0 ffc0dde8: 83 dc 28 b0 lwz r30,10416(r28) ffc0ddec: 7c 9b 23 78 mr r27,r4 ffc0ddf0: 7c bd 2b 78 mr r29,r5 ffc0ddf4: 81 3e 00 00 lwz r9,0(r30) ffc0ddf8: 2f 89 00 00 cmpwi cr7,r9,0 ffc0ddfc: 41 9e 00 c8 beq- cr7,ffc0dec4 <_Scheduler_CBS_Create_server+0x130> ffc0de00: 7f ca f3 78 mr r10,r30 ffc0de04: 7d 09 03 a6 mtctr r8 ffc0de08: 39 20 00 00 li r9,0 ffc0de0c: 48 00 00 10 b ffc0de1c <_Scheduler_CBS_Create_server+0x88> ffc0de10: 85 0a 00 04 lwzu r8,4(r10) ffc0de14: 2f 88 00 00 cmpwi cr7,r8,0 ffc0de18: 41 9e 00 38 beq- cr7,ffc0de50 <_Scheduler_CBS_Create_server+0xbc> 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++ ) { ffc0de1c: 39 29 00 01 addi r9,r9,1 ffc0de20: 42 00 ff f0 bdnz+ ffc0de10 <_Scheduler_CBS_Create_server+0x7c> if ( !_Scheduler_CBS_Server_list[i] ) break; } if ( i == _Scheduler_CBS_Maximum_servers ) return SCHEDULER_CBS_ERROR_FULL; ffc0de24: 38 60 ff e6 li r3,-26 the_server->parameters = *params; the_server->task_id = -1; the_server->cbs_budget_overrun = budget_overrun_callback; return SCHEDULER_CBS_OK; } ffc0de28: 80 01 00 24 lwz r0,36(r1) ffc0de2c: 83 41 00 08 lwz r26,8(r1) ffc0de30: 7c 08 03 a6 mtlr r0 ffc0de34: 83 61 00 0c lwz r27,12(r1) ffc0de38: 83 81 00 10 lwz r28,16(r1) ffc0de3c: 83 a1 00 14 lwz r29,20(r1) ffc0de40: 83 c1 00 18 lwz r30,24(r1) ffc0de44: 83 e1 00 1c lwz r31,28(r1) ffc0de48: 38 21 00 20 addi r1,r1,32 ffc0de4c: 4e 80 00 20 blr ffc0de50: 55 3a 10 3a rlwinm r26,r9,2,0,29 } if ( i == _Scheduler_CBS_Maximum_servers ) return SCHEDULER_CBS_ERROR_FULL; *server_id = i; ffc0de54: 91 3d 00 00 stw r9,0(r29) _Scheduler_CBS_Server_list[*server_id] = (Scheduler_CBS_Server *) _Workspace_Allocate( sizeof(Scheduler_CBS_Server) ); ffc0de58: 38 60 00 10 li r3,16 ffc0de5c: 48 00 27 45 bl ffc105a0 <_Workspace_Allocate> the_server = _Scheduler_CBS_Server_list[*server_id]; ffc0de60: 81 3d 00 00 lwz r9,0(r29) if ( i == _Scheduler_CBS_Maximum_servers ) return SCHEDULER_CBS_ERROR_FULL; *server_id = i; _Scheduler_CBS_Server_list[*server_id] = (Scheduler_CBS_Server *) ffc0de64: 7c 7e d1 2e stwx r3,r30,r26 _Workspace_Allocate( sizeof(Scheduler_CBS_Server) ); the_server = _Scheduler_CBS_Server_list[*server_id]; ffc0de68: 55 29 10 3a rlwinm r9,r9,2,0,29 ffc0de6c: 81 5c 28 b0 lwz r10,10416(r28) ffc0de70: 7d 2a 48 2e lwzx r9,r10,r9 if ( !the_server ) ffc0de74: 2f 89 00 00 cmpwi cr7,r9,0 ffc0de78: 41 9e 00 60 beq- cr7,ffc0ded8 <_Scheduler_CBS_Create_server+0x144><== NEVER TAKEN the_server->parameters = *params; the_server->task_id = -1; the_server->cbs_budget_overrun = budget_overrun_callback; return SCHEDULER_CBS_OK; } ffc0de7c: 80 01 00 24 lwz r0,36(r1) return SCHEDULER_CBS_ERROR_NO_MEMORY; the_server->parameters = *params; the_server->task_id = -1; the_server->cbs_budget_overrun = budget_overrun_callback; return SCHEDULER_CBS_OK; ffc0de80: 38 60 00 00 li r3,0 _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; ffc0de84: 81 5f 00 00 lwz r10,0(r31) the_server->task_id = -1; the_server->cbs_budget_overrun = budget_overrun_callback; return SCHEDULER_CBS_OK; } ffc0de88: 7c 08 03 a6 mtlr r0 _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; ffc0de8c: 81 7f 00 04 lwz r11,4(r31) ffc0de90: 91 49 00 04 stw r10,4(r9) the_server->task_id = -1; ffc0de94: 39 40 ff ff li r10,-1 the_server->cbs_budget_overrun = budget_overrun_callback; ffc0de98: 93 69 00 0c stw r27,12(r9) return SCHEDULER_CBS_OK; } ffc0de9c: 83 41 00 08 lwz r26,8(r1) ffc0dea0: 83 61 00 0c lwz r27,12(r1) ffc0dea4: 83 81 00 10 lwz r28,16(r1) ffc0dea8: 83 a1 00 14 lwz r29,20(r1) ffc0deac: 83 c1 00 18 lwz r30,24(r1) ffc0deb0: 83 e1 00 1c lwz r31,28(r1) _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; ffc0deb4: 91 69 00 08 stw r11,8(r9) the_server->task_id = -1; ffc0deb8: 91 49 00 00 stw r10,0(r9) the_server->cbs_budget_overrun = budget_overrun_callback; return SCHEDULER_CBS_OK; } ffc0debc: 38 21 00 20 addi r1,r1,32 ffc0dec0: 4e 80 00 20 blr 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++ ) { if ( !_Scheduler_CBS_Server_list[i] ) ffc0dec4: 3b 40 00 00 li r26,0 ffc0dec8: 39 20 00 00 li r9,0 ffc0decc: 4b ff ff 88 b ffc0de54 <_Scheduler_CBS_Create_server+0xc0> 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; ffc0ded0: 38 60 ff ee li r3,-18 ffc0ded4: 4b ff ff 54 b ffc0de28 <_Scheduler_CBS_Create_server+0x94> *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; ffc0ded8: 38 60 ff ef li r3,-17 <== NOT EXECUTED ffc0dedc: 4b ff ff 4c b ffc0de28 <_Scheduler_CBS_Create_server+0x94><== NOT EXECUTED =============================================================================== ffc0df84 <_Scheduler_CBS_Detach_thread>: int _Scheduler_CBS_Detach_thread ( Scheduler_CBS_Server_id server_id, rtems_id task_id ) { ffc0df84: 94 21 ff d8 stwu r1,-40(r1) ffc0df88: 7c 08 02 a6 mflr r0 ffc0df8c: 93 c1 00 20 stw r30,32(r1) ffc0df90: 7c 9e 23 78 mr r30,r4 Objects_Locations location; Thread_Control *the_thread; Scheduler_CBS_Per_thread *sched_info; the_thread = _Thread_Get(task_id, &location); ffc0df94: 38 81 00 08 addi r4,r1,8 int _Scheduler_CBS_Detach_thread ( Scheduler_CBS_Server_id server_id, rtems_id task_id ) { ffc0df98: 93 a1 00 1c stw r29,28(r1) ffc0df9c: 7c 7d 1b 78 mr r29,r3 Objects_Locations location; Thread_Control *the_thread; Scheduler_CBS_Per_thread *sched_info; the_thread = _Thread_Get(task_id, &location); ffc0dfa0: 7f c3 f3 78 mr r3,r30 int _Scheduler_CBS_Detach_thread ( Scheduler_CBS_Server_id server_id, rtems_id task_id ) { ffc0dfa4: 93 e1 00 24 stw r31,36(r1) ffc0dfa8: 90 01 00 2c stw r0,44(r1) Objects_Locations location; Thread_Control *the_thread; Scheduler_CBS_Per_thread *sched_info; the_thread = _Thread_Get(task_id, &location); ffc0dfac: 48 00 11 75 bl ffc0f120 <_Thread_Get> /* The routine _Thread_Get may disable dispatch and not enable again. */ if ( the_thread ) { ffc0dfb0: 7c 7f 1b 79 mr. r31,r3 ffc0dfb4: 41 82 00 88 beq- ffc0e03c <_Scheduler_CBS_Detach_thread+0xb8> _Thread_Enable_dispatch(); ffc0dfb8: 48 00 11 4d bl ffc0f104 <_Thread_Enable_dispatch> } if ( server_id >= _Scheduler_CBS_Maximum_servers ) ffc0dfbc: 3d 20 00 00 lis r9,0 ffc0dfc0: 81 29 27 94 lwz r9,10132(r9) ffc0dfc4: 7f 9d 48 40 cmplw cr7,r29,r9 ffc0dfc8: 40 9c 00 74 bge- cr7,ffc0e03c <_Scheduler_CBS_Detach_thread+0xb8> 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] ) ffc0dfcc: 3d 20 00 00 lis r9,0 ffc0dfd0: 81 29 28 b0 lwz r9,10416(r9) ffc0dfd4: 57 bd 10 3a rlwinm r29,r29,2,0,29 ffc0dfd8: 7d 29 e8 2e lwzx r9,r9,r29 ffc0dfdc: 2f 89 00 00 cmpwi cr7,r9,0 ffc0dfe0: 41 9e 00 7c beq- cr7,ffc0e05c <_Scheduler_CBS_Detach_thread+0xd8> return SCHEDULER_CBS_ERROR_NOSERVER; /* Thread and server are not attached. */ if ( _Scheduler_CBS_Server_list[server_id]->task_id != task_id ) ffc0dfe4: 81 49 00 00 lwz r10,0(r9) ffc0dfe8: 7f 8a f0 00 cmpw cr7,r10,r30 ffc0dfec: 40 9e 00 50 bne- cr7,ffc0e03c <_Scheduler_CBS_Detach_thread+0xb8><== NEVER TAKEN _Scheduler_CBS_Server_list[server_id]->task_id = -1; sched_info = (Scheduler_CBS_Per_thread *) the_thread->scheduler_info; sched_info->cbs_server = NULL; the_thread->budget_algorithm = the_thread->Start.budget_algorithm; ffc0dff0: 80 df 00 a0 lwz r6,160(r31) return SCHEDULER_CBS_ERROR_NOSERVER; /* Thread and server are not attached. */ if ( _Scheduler_CBS_Server_list[server_id]->task_id != task_id ) return SCHEDULER_CBS_ERROR_INVALID_PARAMETER; _Scheduler_CBS_Server_list[server_id]->task_id = -1; ffc0dff4: 38 a0 ff ff li r5,-1 sched_info = (Scheduler_CBS_Per_thread *) the_thread->scheduler_info; sched_info->cbs_server = NULL; the_thread->budget_algorithm = the_thread->Start.budget_algorithm; the_thread->budget_callout = the_thread->Start.budget_callout; ffc0dff8: 80 ff 00 a4 lwz r7,164(r31) the_thread->is_preemptible = the_thread->Start.is_preemptible; return SCHEDULER_CBS_OK; ffc0dffc: 38 60 00 00 li r3,0 sched_info = (Scheduler_CBS_Per_thread *) the_thread->scheduler_info; sched_info->cbs_server = NULL; 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; ffc0e000: 89 1f 00 9c lbz r8,156(r31) if ( _Scheduler_CBS_Server_list[server_id]->task_id != task_id ) return SCHEDULER_CBS_ERROR_INVALID_PARAMETER; _Scheduler_CBS_Server_list[server_id]->task_id = -1; sched_info = (Scheduler_CBS_Per_thread *) the_thread->scheduler_info; sched_info->cbs_server = NULL; ffc0e004: 81 5f 00 88 lwz r10,136(r31) return SCHEDULER_CBS_ERROR_NOSERVER; /* Thread and server are not attached. */ if ( _Scheduler_CBS_Server_list[server_id]->task_id != task_id ) return SCHEDULER_CBS_ERROR_INVALID_PARAMETER; _Scheduler_CBS_Server_list[server_id]->task_id = -1; ffc0e008: 90 a9 00 00 stw r5,0(r9) sched_info = (Scheduler_CBS_Per_thread *) the_thread->scheduler_info; sched_info->cbs_server = NULL; ffc0e00c: 39 20 00 00 li r9,0 ffc0e010: 91 2a 00 18 stw r9,24(r10) the_thread->budget_algorithm = the_thread->Start.budget_algorithm; ffc0e014: 90 df 00 78 stw r6,120(r31) the_thread->budget_callout = the_thread->Start.budget_callout; ffc0e018: 90 ff 00 7c stw r7,124(r31) the_thread->is_preemptible = the_thread->Start.is_preemptible; ffc0e01c: 99 1f 00 70 stb r8,112(r31) return SCHEDULER_CBS_OK; } ffc0e020: 80 01 00 2c lwz r0,44(r1) ffc0e024: 83 a1 00 1c lwz r29,28(r1) ffc0e028: 7c 08 03 a6 mtlr r0 ffc0e02c: 83 c1 00 20 lwz r30,32(r1) ffc0e030: 83 e1 00 24 lwz r31,36(r1) ffc0e034: 38 21 00 28 addi r1,r1,40 ffc0e038: 4e 80 00 20 blr ffc0e03c: 80 01 00 2c lwz r0,44(r1) if ( the_thread ) { _Thread_Enable_dispatch(); } if ( server_id >= _Scheduler_CBS_Maximum_servers ) return SCHEDULER_CBS_ERROR_INVALID_PARAMETER; ffc0e040: 38 60 ff ee li r3,-18 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; } ffc0e044: 83 a1 00 1c lwz r29,28(r1) ffc0e048: 7c 08 03 a6 mtlr r0 ffc0e04c: 83 c1 00 20 lwz r30,32(r1) ffc0e050: 83 e1 00 24 lwz r31,36(r1) ffc0e054: 38 21 00 28 addi r1,r1,40 ffc0e058: 4e 80 00 20 blr 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; ffc0e05c: 38 60 ff e7 li r3,-25 ffc0e060: 4b ff ff c0 b ffc0e020 <_Scheduler_CBS_Detach_thread+0x9c> =============================================================================== ffc0e2e8 <_Scheduler_CBS_Get_server_id>: rtems_id task_id, Scheduler_CBS_Server_id *server_id ) { unsigned int i; for ( i = 0; i<_Scheduler_CBS_Maximum_servers; i++ ) { ffc0e2e8: 3d 20 00 00 lis r9,0 ffc0e2ec: 81 29 27 94 lwz r9,10132(r9) ffc0e2f0: 2f 89 00 00 cmpwi cr7,r9,0 ffc0e2f4: 41 9e 00 38 beq- cr7,ffc0e32c <_Scheduler_CBS_Get_server_id+0x44><== NEVER TAKEN #include #include #include #include int _Scheduler_CBS_Get_server_id ( ffc0e2f8: 3d 40 00 00 lis r10,0 rtems_id task_id, Scheduler_CBS_Server_id *server_id ) { unsigned int i; for ( i = 0; i<_Scheduler_CBS_Maximum_servers; i++ ) { ffc0e2fc: 7d 29 03 a6 mtctr r9 #include #include #include #include int _Scheduler_CBS_Get_server_id ( ffc0e300: 81 4a 28 b0 lwz r10,10416(r10) rtems_id task_id, Scheduler_CBS_Server_id *server_id ) { unsigned int i; for ( i = 0; i<_Scheduler_CBS_Maximum_servers; i++ ) { ffc0e304: 39 00 00 00 li r8,0 #include #include #include #include int _Scheduler_CBS_Get_server_id ( ffc0e308: 39 4a ff fc addi r10,r10,-4 Scheduler_CBS_Server_id *server_id ) { unsigned int i; for ( i = 0; i<_Scheduler_CBS_Maximum_servers; i++ ) { if ( _Scheduler_CBS_Server_list[i] && ffc0e30c: 85 2a 00 04 lwzu r9,4(r10) ffc0e310: 2f 89 00 00 cmpwi cr7,r9,0 ffc0e314: 41 9e 00 10 beq- cr7,ffc0e324 <_Scheduler_CBS_Get_server_id+0x3c> ffc0e318: 81 29 00 00 lwz r9,0(r9) ffc0e31c: 7f 89 18 00 cmpw cr7,r9,r3 ffc0e320: 41 9e 00 14 beq- cr7,ffc0e334 <_Scheduler_CBS_Get_server_id+0x4c> rtems_id task_id, Scheduler_CBS_Server_id *server_id ) { unsigned int i; for ( i = 0; i<_Scheduler_CBS_Maximum_servers; i++ ) { ffc0e324: 39 08 00 01 addi r8,r8,1 ffc0e328: 42 00 ff e4 bdnz+ ffc0e30c <_Scheduler_CBS_Get_server_id+0x24> _Scheduler_CBS_Server_list[i]->task_id == task_id ) { *server_id = i; return SCHEDULER_CBS_OK; } } return SCHEDULER_CBS_ERROR_NOSERVER; ffc0e32c: 38 60 ff e7 li r3,-25 } ffc0e330: 4e 80 00 20 blr { unsigned int i; for ( i = 0; i<_Scheduler_CBS_Maximum_servers; i++ ) { if ( _Scheduler_CBS_Server_list[i] && _Scheduler_CBS_Server_list[i]->task_id == task_id ) { *server_id = i; ffc0e334: 91 04 00 00 stw r8,0(r4) return SCHEDULER_CBS_OK; ffc0e338: 38 60 00 00 li r3,0 ffc0e33c: 4e 80 00 20 blr =============================================================================== ffc0e3c8 <_Scheduler_CBS_Initialize>: int _Scheduler_CBS_Initialize(void) { ffc0e3c8: 94 21 ff f0 stwu r1,-16(r1) ffc0e3cc: 7c 08 02 a6 mflr r0 ffc0e3d0: 93 e1 00 0c stw r31,12(r1) unsigned int i; _Scheduler_CBS_Server_list = (Scheduler_CBS_Server **) _Workspace_Allocate( _Scheduler_CBS_Maximum_servers * sizeof(Scheduler_CBS_Server*) ); ffc0e3d4: 3f e0 00 00 lis r31,0 ffc0e3d8: 80 7f 27 94 lwz r3,10132(r31) sched_info->cbs_server->cbs_budget_overrun( server_id ); } } int _Scheduler_CBS_Initialize(void) { ffc0e3dc: 90 01 00 14 stw r0,20(r1) unsigned int i; _Scheduler_CBS_Server_list = (Scheduler_CBS_Server **) _Workspace_Allocate( ffc0e3e0: 54 63 10 3a rlwinm r3,r3,2,0,29 ffc0e3e4: 48 00 21 bd bl ffc105a0 <_Workspace_Allocate> ffc0e3e8: 3d 00 00 00 lis r8,0 _Scheduler_CBS_Maximum_servers * sizeof(Scheduler_CBS_Server*) ); if ( !_Scheduler_CBS_Server_list ) ffc0e3ec: 2f 83 00 00 cmpwi cr7,r3,0 } int _Scheduler_CBS_Initialize(void) { unsigned int i; _Scheduler_CBS_Server_list = (Scheduler_CBS_Server **) _Workspace_Allocate( ffc0e3f0: 90 68 28 b0 stw r3,10416(r8) _Scheduler_CBS_Maximum_servers * sizeof(Scheduler_CBS_Server*) ); if ( !_Scheduler_CBS_Server_list ) ffc0e3f4: 41 9e 00 4c beq- cr7,ffc0e440 <_Scheduler_CBS_Initialize+0x78><== NEVER TAKEN return SCHEDULER_CBS_ERROR_NO_MEMORY; for (i = 0; i<_Scheduler_CBS_Maximum_servers; i++) { ffc0e3f8: 81 5f 27 94 lwz r10,10132(r31) ffc0e3fc: 39 20 00 00 li r9,0 _Scheduler_CBS_Server_list[i] = NULL; ffc0e400: 38 e0 00 00 li r7,0 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++) { ffc0e404: 2f 8a 00 00 cmpwi cr7,r10,0 _Scheduler_CBS_Server_list[i] = NULL; ffc0e408: 7d 49 03 a6 mtctr r10 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++) { ffc0e40c: 40 be 00 0c bne+ cr7,ffc0e418 <_Scheduler_CBS_Initialize+0x50><== ALWAYS TAKEN ffc0e410: 48 00 00 18 b ffc0e428 <_Scheduler_CBS_Initialize+0x60><== NOT EXECUTED ffc0e414: 80 68 28 b0 lwz r3,10416(r8) _Scheduler_CBS_Server_list[i] = NULL; ffc0e418: 55 2a 10 3a rlwinm r10,r9,2,0,29 ffc0e41c: 7c e3 51 2e stwx r7,r3,r10 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++) { ffc0e420: 39 29 00 01 addi r9,r9,1 ffc0e424: 42 00 ff f0 bdnz+ ffc0e414 <_Scheduler_CBS_Initialize+0x4c> _Scheduler_CBS_Server_list[i] = NULL; } return SCHEDULER_CBS_OK; ffc0e428: 38 60 00 00 li r3,0 } ffc0e42c: 80 01 00 14 lwz r0,20(r1) ffc0e430: 83 e1 00 0c lwz r31,12(r1) ffc0e434: 7c 08 03 a6 mtlr r0 ffc0e438: 38 21 00 10 addi r1,r1,16 ffc0e43c: 4e 80 00 20 blr { 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; ffc0e440: 38 60 ff ef li r3,-17 <== NOT EXECUTED ffc0e444: 4b ff ff e8 b ffc0e42c <_Scheduler_CBS_Initialize+0x64><== NOT EXECUTED =============================================================================== ffc0c928 <_Scheduler_CBS_Release_job>: 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; if (deadline) { ffc0c928: 2c 04 00 00 cmpwi r4,0 { 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; ffc0c92c: 81 23 00 88 lwz r9,136(r3) ) { Priority_Control new_priority; Scheduler_CBS_Per_thread *sched_info = (Scheduler_CBS_Per_thread *) the_thread->scheduler_info; Scheduler_CBS_Server *serv_info = ffc0c930: 81 29 00 18 lwz r9,24(r9) (Scheduler_CBS_Server *) sched_info->cbs_server; if (deadline) { /* Initializing or shifting deadline. */ if (serv_info) ffc0c934: 2f 89 00 00 cmpwi cr7,r9,0 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; if (deadline) { ffc0c938: 41 82 00 30 beq- ffc0c968 <_Scheduler_CBS_Release_job+0x40> /* Initializing or shifting deadline. */ if (serv_info) ffc0c93c: 41 9e 00 38 beq- cr7,ffc0c974 <_Scheduler_CBS_Release_job+0x4c> new_priority = (_Watchdog_Ticks_since_boot + serv_info->parameters.deadline) ffc0c940: 3d 40 00 00 lis r10,0 ffc0c944: 80 8a 28 a4 lwz r4,10404(r10) ffc0c948: 81 49 00 04 lwz r10,4(r9) ffc0c94c: 7c 84 52 14 add r4,r4,r10 ffc0c950: 54 84 00 7e clrlwi r4,r4,1 new_priority = the_thread->Start.initial_priority; } /* Budget replenishment for the next job. */ if (serv_info) the_thread->cpu_time_budget = serv_info->parameters.budget; ffc0c954: 81 29 00 08 lwz r9,8(r9) ffc0c958: 91 23 00 74 stw r9,116(r3) the_thread->real_priority = new_priority; ffc0c95c: 90 83 00 18 stw r4,24(r3) _Thread_Change_priority(the_thread, new_priority, true); ffc0c960: 38 a0 00 01 li r5,1 ffc0c964: 48 00 05 8c b ffc0cef0 <_Thread_Change_priority> new_priority = (_Watchdog_Ticks_since_boot + deadline) & ~SCHEDULER_EDF_PRIO_MSB; } else { /* Switch back to background priority. */ new_priority = the_thread->Start.initial_priority; ffc0c968: 80 83 00 ac lwz r4,172(r3) } /* Budget replenishment for the next job. */ if (serv_info) ffc0c96c: 40 9e ff e8 bne+ cr7,ffc0c954 <_Scheduler_CBS_Release_job+0x2c><== ALWAYS TAKEN ffc0c970: 4b ff ff ec b ffc0c95c <_Scheduler_CBS_Release_job+0x34><== NOT EXECUTED /* Initializing or shifting deadline. */ if (serv_info) new_priority = (_Watchdog_Ticks_since_boot + serv_info->parameters.deadline) & ~SCHEDULER_EDF_PRIO_MSB; else new_priority = (_Watchdog_Ticks_since_boot + deadline) ffc0c974: 3d 20 00 00 lis r9,0 ffc0c978: 81 29 28 a4 lwz r9,10404(r9) ffc0c97c: 7c 84 4a 14 add r4,r4,r9 ffc0c980: 54 84 00 7e clrlwi r4,r4,1 ffc0c984: 4b ff ff d8 b ffc0c95c <_Scheduler_CBS_Release_job+0x34> =============================================================================== ffc0c988 <_Scheduler_CBS_Unblock>: #include void _Scheduler_CBS_Unblock( Thread_Control *the_thread ) { ffc0c988: 94 21 ff f0 stwu r1,-16(r1) ffc0c98c: 7c 08 02 a6 mflr r0 ffc0c990: 93 e1 00 0c stw r31,12(r1) ffc0c994: 7c 7f 1b 78 mr r31,r3 ffc0c998: 90 01 00 14 stw r0,20(r1) ffc0c99c: 93 c1 00 08 stw r30,8(r1) Scheduler_CBS_Per_thread *sched_info; Scheduler_CBS_Server *serv_info; Priority_Control new_priority; _Scheduler_EDF_Enqueue(the_thread); ffc0c9a0: 48 00 01 6d bl ffc0cb0c <_Scheduler_EDF_Enqueue> /* TODO: flash critical section? */ sched_info = (Scheduler_CBS_Per_thread *) the_thread->scheduler_info; serv_info = (Scheduler_CBS_Server *) sched_info->cbs_server; ffc0c9a4: 81 3f 00 88 lwz r9,136(r31) ffc0c9a8: 81 29 00 18 lwz r9,24(r9) * 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) { ffc0c9ac: 2f 89 00 00 cmpwi cr7,r9,0 ffc0c9b0: 41 9e 00 58 beq- cr7,ffc0ca08 <_Scheduler_CBS_Unblock+0x80> 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 - ffc0c9b4: 3d 00 00 00 lis r8,0 ffc0c9b8: 81 5f 00 18 lwz r10,24(r31) ffc0c9bc: 81 08 28 a4 lwz r8,10404(r8) _Watchdog_Ticks_since_boot; if ( deadline*budget_left > budget*deadline_left ) { ffc0c9c0: 80 c9 00 04 lwz r6,4(r9) ffc0c9c4: 80 e9 00 08 lwz r7,8(r9) */ 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 - ffc0c9c8: 7d 08 50 50 subf r8,r8,r10 _Watchdog_Ticks_since_boot; if ( deadline*budget_left > budget*deadline_left ) { ffc0c9cc: 81 3f 00 74 lwz r9,116(r31) ffc0c9d0: 7d 08 31 d6 mullw r8,r8,r6 ffc0c9d4: 7d 27 49 d6 mullw r9,r7,r9 ffc0c9d8: 7f 88 48 00 cmpw cr7,r8,r9 ffc0c9dc: 40 9d 00 2c ble- cr7,ffc0ca08 <_Scheduler_CBS_Unblock+0x80> /* Put late unblocked task to background until the end of period. */ new_priority = the_thread->Start.initial_priority; ffc0c9e0: 80 9f 00 ac lwz r4,172(r31) if ( the_thread->real_priority != new_priority ) ffc0c9e4: 7f 8a 20 00 cmpw cr7,r10,r4 ffc0c9e8: 41 9e 00 08 beq- cr7,ffc0c9f0 <_Scheduler_CBS_Unblock+0x68> the_thread->real_priority = new_priority; ffc0c9ec: 90 9f 00 18 stw r4,24(r31) if ( the_thread->current_priority != new_priority ) ffc0c9f0: 80 7f 00 14 lwz r3,20(r31) ffc0c9f4: 7f 83 20 00 cmpw cr7,r3,r4 ffc0c9f8: 41 9e 00 14 beq- cr7,ffc0ca0c <_Scheduler_CBS_Unblock+0x84> _Thread_Change_priority(the_thread, new_priority, true); ffc0c9fc: 7f e3 fb 78 mr r3,r31 ffc0ca00: 38 a0 00 01 li r5,1 ffc0ca04: 48 00 04 ed bl ffc0cef0 <_Thread_Change_priority> ffc0ca08: 80 7f 00 14 lwz r3,20(r31) * 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, ffc0ca0c: 3f c0 00 00 lis r30,0 ffc0ca10: 3b de 2e 80 addi r30,r30,11904 ffc0ca14: 3d 40 00 00 lis r10,0 ffc0ca18: 81 3e 00 14 lwz r9,20(r30) ffc0ca1c: 81 4a 20 b0 lwz r10,8368(r10) ffc0ca20: 80 89 00 14 lwz r4,20(r9) ffc0ca24: 7d 49 03 a6 mtctr r10 ffc0ca28: 4e 80 04 21 bctrl ffc0ca2c: 2f 83 00 00 cmpwi cr7,r3,0 ffc0ca30: 40 9d 00 20 ble- cr7,ffc0ca50 <_Scheduler_CBS_Unblock+0xc8> _Thread_Heir->current_priority)) { _Thread_Heir = the_thread; if ( _Thread_Executing->is_preemptible || ffc0ca34: 81 3e 00 10 lwz r9,16(r30) * 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; ffc0ca38: 93 fe 00 14 stw r31,20(r30) if ( _Thread_Executing->is_preemptible || ffc0ca3c: 89 29 00 70 lbz r9,112(r9) ffc0ca40: 2f 89 00 00 cmpwi cr7,r9,0 ffc0ca44: 41 9e 00 24 beq- cr7,ffc0ca68 <_Scheduler_CBS_Unblock+0xe0> the_thread->current_priority == 0 ) _Thread_Dispatch_necessary = true; ffc0ca48: 39 20 00 01 li r9,1 ffc0ca4c: 99 3e 00 0c stb r9,12(r30) } } ffc0ca50: 80 01 00 14 lwz r0,20(r1) ffc0ca54: 83 c1 00 08 lwz r30,8(r1) ffc0ca58: 7c 08 03 a6 mtlr r0 ffc0ca5c: 83 e1 00 0c lwz r31,12(r1) ffc0ca60: 38 21 00 10 addi r1,r1,16 ffc0ca64: 4e 80 00 20 blr * 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; if ( _Thread_Executing->is_preemptible || ffc0ca68: 81 3f 00 14 lwz r9,20(r31) ffc0ca6c: 2f 89 00 00 cmpwi cr7,r9,0 ffc0ca70: 41 9e ff d8 beq+ cr7,ffc0ca48 <_Scheduler_CBS_Unblock+0xc0><== NEVER TAKEN the_thread->current_priority == 0 ) _Thread_Dispatch_necessary = true; } } ffc0ca74: 80 01 00 14 lwz r0,20(r1) ffc0ca78: 83 c1 00 08 lwz r30,8(r1) ffc0ca7c: 7c 08 03 a6 mtlr r0 ffc0ca80: 83 e1 00 0c lwz r31,12(r1) ffc0ca84: 38 21 00 10 addi r1,r1,16 ffc0ca88: 4e 80 00 20 blr =============================================================================== ffc0c8d8 <_Scheduler_EDF_Allocate>: #include void *_Scheduler_EDF_Allocate( Thread_Control *the_thread ) { ffc0c8d8: 94 21 ff f0 stwu r1,-16(r1) ffc0c8dc: 7c 08 02 a6 mflr r0 ffc0c8e0: 93 e1 00 0c stw r31,12(r1) ffc0c8e4: 7c 7f 1b 78 mr r31,r3 void *sched; Scheduler_EDF_Per_thread *schinfo; sched = _Workspace_Allocate( sizeof(Scheduler_EDF_Per_thread) ); ffc0c8e8: 38 60 00 18 li r3,24 #include void *_Scheduler_EDF_Allocate( Thread_Control *the_thread ) { ffc0c8ec: 90 01 00 14 stw r0,20(r1) void *sched; Scheduler_EDF_Per_thread *schinfo; sched = _Workspace_Allocate( sizeof(Scheduler_EDF_Per_thread) ); ffc0c8f0: 48 00 21 b1 bl ffc0eaa0 <_Workspace_Allocate> if ( sched ) { ffc0c8f4: 2c 03 00 00 cmpwi r3,0 ffc0c8f8: 41 82 00 14 beq- ffc0c90c <_Scheduler_EDF_Allocate+0x34><== NEVER TAKEN the_thread->scheduler_info = sched; schinfo = (Scheduler_EDF_Per_thread *)(the_thread->scheduler_info); schinfo->thread = the_thread; schinfo->queue_state = SCHEDULER_EDF_QUEUE_STATE_NEVER_HAS_BEEN; ffc0c8fc: 39 40 00 02 li r10,2 Scheduler_EDF_Per_thread *schinfo; sched = _Workspace_Allocate( sizeof(Scheduler_EDF_Per_thread) ); if ( sched ) { the_thread->scheduler_info = sched; ffc0c900: 90 7f 00 88 stw r3,136(r31) schinfo = (Scheduler_EDF_Per_thread *)(the_thread->scheduler_info); schinfo->thread = the_thread; ffc0c904: 93 e3 00 00 stw r31,0(r3) schinfo->queue_state = SCHEDULER_EDF_QUEUE_STATE_NEVER_HAS_BEEN; ffc0c908: 91 43 00 14 stw r10,20(r3) } return sched; } ffc0c90c: 80 01 00 14 lwz r0,20(r1) ffc0c910: 83 e1 00 0c lwz r31,12(r1) ffc0c914: 7c 08 03 a6 mtlr r0 ffc0c918: 38 21 00 10 addi r1,r1,16 ffc0c91c: 4e 80 00 20 blr =============================================================================== ffc0cb28 <_Scheduler_EDF_Unblock>: #include void _Scheduler_EDF_Unblock( Thread_Control *the_thread ) { ffc0cb28: 94 21 ff f0 stwu r1,-16(r1) ffc0cb2c: 7c 08 02 a6 mflr r0 ffc0cb30: 93 e1 00 0c stw r31,12(r1) * 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( ffc0cb34: 3f e0 00 00 lis r31,0 ffc0cb38: 3b ff 2e 80 addi r31,r31,11904 #include void _Scheduler_EDF_Unblock( Thread_Control *the_thread ) { ffc0cb3c: 90 01 00 14 stw r0,20(r1) ffc0cb40: 93 c1 00 08 stw r30,8(r1) ffc0cb44: 7c 7e 1b 78 mr r30,r3 _Scheduler_EDF_Enqueue(the_thread); ffc0cb48: 4b ff fe 59 bl ffc0c9a0 <_Scheduler_EDF_Enqueue> ffc0cb4c: 3d 20 00 00 lis r9,0 * 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( ffc0cb50: 81 5f 00 14 lwz r10,20(r31) ffc0cb54: 81 29 20 b0 lwz r9,8368(r9) ffc0cb58: 80 6a 00 14 lwz r3,20(r10) ffc0cb5c: 80 9e 00 14 lwz r4,20(r30) ffc0cb60: 7d 29 03 a6 mtctr r9 ffc0cb64: 4e 80 04 21 bctrl ffc0cb68: 2f 83 00 00 cmpwi cr7,r3,0 ffc0cb6c: 41 9c 00 1c blt- cr7,ffc0cb88 <_Scheduler_EDF_Unblock+0x60> _Thread_Heir = the_thread; if ( _Thread_Executing->is_preemptible || the_thread->current_priority == 0 ) _Thread_Dispatch_necessary = true; } } ffc0cb70: 80 01 00 14 lwz r0,20(r1) ffc0cb74: 83 c1 00 08 lwz r30,8(r1) ffc0cb78: 7c 08 03 a6 mtlr r0 ffc0cb7c: 83 e1 00 0c lwz r31,12(r1) ffc0cb80: 38 21 00 10 addi r1,r1,16 ffc0cb84: 4e 80 00 20 blr */ if ( _Scheduler_Is_priority_lower_than( _Thread_Heir->current_priority, the_thread->current_priority )) { _Thread_Heir = the_thread; if ( _Thread_Executing->is_preemptible || ffc0cb88: 81 3f 00 10 lwz r9,16(r31) * 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; ffc0cb8c: 93 df 00 14 stw r30,20(r31) if ( _Thread_Executing->is_preemptible || ffc0cb90: 89 29 00 70 lbz r9,112(r9) ffc0cb94: 2f 89 00 00 cmpwi cr7,r9,0 ffc0cb98: 41 9e 00 24 beq- cr7,ffc0cbbc <_Scheduler_EDF_Unblock+0x94> the_thread->current_priority == 0 ) _Thread_Dispatch_necessary = true; ffc0cb9c: 39 20 00 01 li r9,1 ffc0cba0: 99 3f 00 0c stb r9,12(r31) } } ffc0cba4: 80 01 00 14 lwz r0,20(r1) ffc0cba8: 83 c1 00 08 lwz r30,8(r1) ffc0cbac: 7c 08 03 a6 mtlr r0 ffc0cbb0: 83 e1 00 0c lwz r31,12(r1) ffc0cbb4: 38 21 00 10 addi r1,r1,16 ffc0cbb8: 4e 80 00 20 blr */ if ( _Scheduler_Is_priority_lower_than( _Thread_Heir->current_priority, the_thread->current_priority )) { _Thread_Heir = the_thread; if ( _Thread_Executing->is_preemptible || ffc0cbbc: 81 3e 00 14 lwz r9,20(r30) ffc0cbc0: 2f 89 00 00 cmpwi cr7,r9,0 ffc0cbc4: 40 be ff ac bne- cr7,ffc0cb70 <_Scheduler_EDF_Unblock+0x48><== ALWAYS TAKEN the_thread->current_priority == 0 ) _Thread_Dispatch_necessary = true; ffc0cbc8: 39 20 00 01 li r9,1 <== NOT EXECUTED ffc0cbcc: 99 3f 00 0c stb r9,12(r31) <== NOT EXECUTED ffc0cbd0: 4b ff ff d4 b ffc0cba4 <_Scheduler_EDF_Unblock+0x7c> <== NOT EXECUTED =============================================================================== ffc0bdbc <_Scheduler_priority_Block>: ) { Scheduler_priority_Per_thread *sched_info; Chain_Control *ready; sched_info = (Scheduler_priority_Per_thread *) the_thread->scheduler_info; ffc0bdbc: 81 43 00 88 lwz r10,136(r3) ready = sched_info->ready_chain; ffc0bdc0: 81 2a 00 00 lwz r9,0(r10) if ( _Chain_Has_only_one_node( ready ) ) { ffc0bdc4: 80 e9 00 00 lwz r7,0(r9) ffc0bdc8: 81 09 00 08 lwz r8,8(r9) ffc0bdcc: 7f 87 40 00 cmpw cr7,r7,r8 ffc0bdd0: 41 9e 00 40 beq- cr7,ffc0be10 <_Scheduler_priority_Block+0x54> ) { Chain_Node *next; Chain_Node *previous; next = the_node->next; ffc0bdd4: 81 23 00 00 lwz r9,0(r3) previous = the_node->previous; ffc0bdd8: 81 43 00 04 lwz r10,4(r3) next->previous = previous; ffc0bddc: 91 49 00 04 stw r10,4(r9) previous->next = next; ffc0bde0: 91 2a 00 00 stw r9,0(r10) RTEMS_INLINE_ROUTINE bool _Thread_Is_heir ( const Thread_Control *the_thread ) { return ( the_thread == _Thread_Heir ); ffc0bde4: 3d 20 00 00 lis r9,0 ffc0bde8: 39 29 2e 00 addi r9,r9,11776 { _Scheduler_priority_Ready_queue_extract( the_thread ); /* TODO: flash critical section? */ if ( _Thread_Is_heir( the_thread ) ) ffc0bdec: 81 49 00 14 lwz r10,20(r9) ffc0bdf0: 7f 83 50 00 cmpw cr7,r3,r10 ffc0bdf4: 41 9e 00 64 beq- cr7,ffc0be58 <_Scheduler_priority_Block+0x9c> _Scheduler_priority_Schedule_body(); if ( _Thread_Is_executing( the_thread ) ) ffc0bdf8: 81 49 00 10 lwz r10,16(r9) ffc0bdfc: 7f 83 50 00 cmpw cr7,r3,r10 ffc0be00: 4c be 00 20 bnelr+ cr7 _Thread_Dispatch_necessary = true; ffc0be04: 39 40 00 01 li r10,1 ffc0be08: 99 49 00 0c stb r10,12(r9) ffc0be0c: 4e 80 00 20 blr RTEMS_INLINE_ROUTINE void _Priority_bit_map_Remove ( Priority_bit_map_Information *the_priority_map ) { *the_priority_map->minor &= the_priority_map->block_minor; ffc0be10: 81 0a 00 04 lwz r8,4(r10) 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 ); ffc0be14: 38 a9 00 04 addi r5,r9,4 ffc0be18: 80 ea 00 14 lwz r7,20(r10) ffc0be1c: 80 c8 00 00 lwz r6,0(r8) head->next = tail; ffc0be20: 90 a9 00 00 stw r5,0(r9) ffc0be24: 7c c7 38 38 and r7,r6,r7 if ( *the_priority_map->minor == 0 ) ffc0be28: 2f 87 00 00 cmpwi cr7,r7,0 head->previous = NULL; tail->previous = head; ffc0be2c: 91 29 00 08 stw r9,8(r9) { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); head->next = tail; head->previous = NULL; ffc0be30: 38 c0 00 00 li r6,0 ffc0be34: 90 c9 00 04 stw r6,4(r9) RTEMS_INLINE_ROUTINE void _Priority_bit_map_Remove ( Priority_bit_map_Information *the_priority_map ) { *the_priority_map->minor &= the_priority_map->block_minor; ffc0be38: 90 e8 00 00 stw r7,0(r8) if ( *the_priority_map->minor == 0 ) ffc0be3c: 40 be ff a8 bne- cr7,ffc0bde4 <_Scheduler_priority_Block+0x28> _Priority_Major_bit_map &= the_priority_map->block_major; ffc0be40: 3d 20 00 00 lis r9,0 ffc0be44: 81 4a 00 10 lwz r10,16(r10) ffc0be48: 81 09 28 50 lwz r8,10320(r9) ffc0be4c: 7d 0a 50 38 and r10,r8,r10 ffc0be50: 91 49 28 50 stw r10,10320(r9) ffc0be54: 4b ff ff 90 b ffc0bde4 <_Scheduler_priority_Block+0x28> RTEMS_INLINE_ROUTINE Priority_Control _Priority_bit_map_Get_highest( void ) { Priority_bit_map_Control minor; Priority_bit_map_Control major; _Bitfield_Find_first_bit( _Priority_Major_bit_map, major ); ffc0be58: 3d 60 00 00 lis r11,0 * @param[in] the_thread - pointer to thread */ RTEMS_INLINE_ROUTINE void _Scheduler_priority_Schedule_body(void) { _Thread_Heir = _Scheduler_priority_Ready_queue_first( (Chain_Control *) _Scheduler.information ffc0be5c: 3d 40 00 00 lis r10,0 ffc0be60: 81 0b 28 50 lwz r8,10320(r11) ffc0be64: 80 ea 20 80 lwz r7,8320(r10) ffc0be68: 7d 04 00 34 cntlzw r4,r8 _Bitfield_Find_first_bit( _Priority_Bit_map[major], minor ); ffc0be6c: 3c a0 00 00 lis r5,0 RTEMS_INLINE_ROUTINE Priority_Control _Priority_bit_map_Get_highest( void ) { Priority_bit_map_Control minor; Priority_bit_map_Control major; _Bitfield_Find_first_bit( _Priority_Major_bit_map, major ); ffc0be70: 91 0b 28 50 stw r8,10320(r11) _Bitfield_Find_first_bit( _Priority_Bit_map[major], minor ); ffc0be74: 38 a5 2e 40 addi r5,r5,11840 ffc0be78: 54 86 10 3a rlwinm r6,r4,2,0,29 ffc0be7c: 7d 45 30 2e lwzx r10,r5,r6 ffc0be80: 7d 48 00 34 cntlzw r8,r10 return (_Priority_Bits_index( major ) << 4) + ffc0be84: 54 84 20 36 rlwinm r4,r4,4,0,27 { Priority_bit_map_Control minor; Priority_bit_map_Control major; _Bitfield_Find_first_bit( _Priority_Major_bit_map, major ); _Bitfield_Find_first_bit( _Priority_Bit_map[major], minor ); ffc0be88: 7d 45 31 2e stwx r10,r5,r6 return (_Priority_Bits_index( major ) << 4) + ffc0be8c: 7d 04 42 14 add r8,r4,r8 Chain_Control *the_ready_queue ) { Priority_Control index = _Priority_bit_map_Get_highest(); if ( !_Chain_Is_empty( &the_ready_queue[ index ] ) ) ffc0be90: 1d 08 00 0c mulli r8,r8,12 */ RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_first( const Chain_Control *the_chain ) { return _Chain_Immutable_head( the_chain )->next; ffc0be94: 7d 47 40 2e lwzx r10,r7,r8 ffc0be98: 7c c7 42 14 add r6,r7,r8 RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( const Chain_Control *the_chain ) { return _Chain_Immutable_first( the_chain ) == _Chain_Immutable_tail( the_chain ); ffc0be9c: 39 06 00 04 addi r8,r6,4 ffc0bea0: 7f 8a 40 00 cmpw cr7,r10,r8 ffc0bea4: 41 9e 00 0c beq- cr7,ffc0beb0 <_Scheduler_priority_Block+0xf4><== NEVER TAKEN * * @param[in] the_thread - pointer to thread */ RTEMS_INLINE_ROUTINE void _Scheduler_priority_Schedule_body(void) { _Thread_Heir = _Scheduler_priority_Ready_queue_first( ffc0bea8: 91 49 00 14 stw r10,20(r9) ffc0beac: 4b ff ff 4c b ffc0bdf8 <_Scheduler_priority_Block+0x3c> Priority_Control index = _Priority_bit_map_Get_highest(); if ( !_Chain_Is_empty( &the_ready_queue[ index ] ) ) return (Thread_Control *) _Chain_First( &the_ready_queue[ index ] ); return NULL; ffc0beb0: 39 40 00 00 li r10,0 <== NOT EXECUTED * * @param[in] the_thread - pointer to thread */ RTEMS_INLINE_ROUTINE void _Scheduler_priority_Schedule_body(void) { _Thread_Heir = _Scheduler_priority_Ready_queue_first( ffc0beb4: 91 49 00 14 stw r10,20(r9) <== NOT EXECUTED ffc0beb8: 4b ff ff 40 b ffc0bdf8 <_Scheduler_priority_Block+0x3c><== NOT EXECUTED =============================================================================== ffc0c078 <_Scheduler_priority_Schedule>: RTEMS_INLINE_ROUTINE Priority_Control _Priority_bit_map_Get_highest( void ) { Priority_bit_map_Control minor; Priority_bit_map_Control major; _Bitfield_Find_first_bit( _Priority_Major_bit_map, major ); ffc0c078: 3c 80 00 00 lis r4,0 * @param[in] the_thread - pointer to thread */ RTEMS_INLINE_ROUTINE void _Scheduler_priority_Schedule_body(void) { _Thread_Heir = _Scheduler_priority_Ready_queue_first( (Chain_Control *) _Scheduler.information ffc0c07c: 3d 20 00 00 lis r9,0 ffc0c080: 81 44 28 50 lwz r10,10320(r4) ffc0c084: 81 09 20 80 lwz r8,8320(r9) ffc0c088: 7d 45 00 34 cntlzw r5,r10 _Bitfield_Find_first_bit( _Priority_Bit_map[major], minor ); ffc0c08c: 3c c0 00 00 lis r6,0 RTEMS_INLINE_ROUTINE Priority_Control _Priority_bit_map_Get_highest( void ) { Priority_bit_map_Control minor; Priority_bit_map_Control major; _Bitfield_Find_first_bit( _Priority_Major_bit_map, major ); ffc0c090: 91 44 28 50 stw r10,10320(r4) _Bitfield_Find_first_bit( _Priority_Bit_map[major], minor ); ffc0c094: 38 c6 2e 40 addi r6,r6,11840 ffc0c098: 54 a7 10 3a rlwinm r7,r5,2,0,29 ffc0c09c: 7d 26 38 2e lwzx r9,r6,r7 ffc0c0a0: 7d 24 00 34 cntlzw r4,r9 return (_Priority_Bits_index( major ) << 4) + ffc0c0a4: 54 aa 20 36 rlwinm r10,r5,4,0,27 { Priority_bit_map_Control minor; Priority_bit_map_Control major; _Bitfield_Find_first_bit( _Priority_Major_bit_map, major ); _Bitfield_Find_first_bit( _Priority_Bit_map[major], minor ); ffc0c0a8: 7d 26 39 2e stwx r9,r6,r7 return (_Priority_Bits_index( major ) << 4) + ffc0c0ac: 7d 4a 22 14 add r10,r10,r4 Chain_Control *the_ready_queue ) { Priority_Control index = _Priority_bit_map_Get_highest(); if ( !_Chain_Is_empty( &the_ready_queue[ index ] ) ) ffc0c0b0: 1d 4a 00 0c mulli r10,r10,12 */ RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_first( const Chain_Control *the_chain ) { return _Chain_Immutable_head( the_chain )->next; ffc0c0b4: 7d 28 50 2e lwzx r9,r8,r10 ffc0c0b8: 7c e8 52 14 add r7,r8,r10 RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( const Chain_Control *the_chain ) { return _Chain_Immutable_first( the_chain ) == _Chain_Immutable_tail( the_chain ); ffc0c0bc: 39 47 00 04 addi r10,r7,4 ffc0c0c0: 7f 89 50 00 cmpw cr7,r9,r10 ffc0c0c4: 41 9e 00 10 beq- cr7,ffc0c0d4 <_Scheduler_priority_Schedule+0x5c><== NEVER TAKEN * * @param[in] the_thread - pointer to thread */ RTEMS_INLINE_ROUTINE void _Scheduler_priority_Schedule_body(void) { _Thread_Heir = _Scheduler_priority_Ready_queue_first( ffc0c0c8: 3d 40 00 00 lis r10,0 ffc0c0cc: 91 2a 2e 14 stw r9,11796(r10) ffc0c0d0: 4e 80 00 20 blr Priority_Control index = _Priority_bit_map_Get_highest(); if ( !_Chain_Is_empty( &the_ready_queue[ index ] ) ) return (Thread_Control *) _Chain_First( &the_ready_queue[ index ] ); return NULL; ffc0c0d4: 39 20 00 00 li r9,0 <== NOT EXECUTED * * @param[in] the_thread - pointer to thread */ RTEMS_INLINE_ROUTINE void _Scheduler_priority_Schedule_body(void) { _Thread_Heir = _Scheduler_priority_Ready_queue_first( ffc0c0d8: 3d 40 00 00 lis r10,0 <== NOT EXECUTED ffc0c0dc: 91 2a 2e 14 stw r9,11796(r10) <== NOT EXECUTED ffc0c0e0: 4e 80 00 20 blr <== NOT EXECUTED =============================================================================== ffc0ca68 <_Scheduler_simple_Ready_queue_enqueue_first>: { Chain_Control *ready; Chain_Node *the_node; Thread_Control *current; ready = (Chain_Control *)_Scheduler.information; ffc0ca68: 3d 20 00 00 lis r9,0 */ for ( the_node = _Chain_First(ready) ; ; the_node = the_node->next ) { current = (Thread_Control *) the_node; /* break when AT HEAD OF (or PAST) our priority */ if ( the_thread->current_priority <= current->current_priority ) { ffc0ca6c: 81 03 00 14 lwz r8,20(r3) */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_First( Chain_Control *the_chain ) { return _Chain_Head( the_chain )->next; ffc0ca70: 81 29 20 80 lwz r9,8320(r9) ffc0ca74: 81 29 00 00 lwz r9,0(r9) ffc0ca78: 81 49 00 14 lwz r10,20(r9) ffc0ca7c: 7f 8a 40 40 cmplw cr7,r10,r8 ffc0ca80: 40 9c 00 14 bge- cr7,ffc0ca94 <_Scheduler_simple_Ready_queue_enqueue_first+0x2c> * Do NOT need to check for end of chain because there is always * at least one task on the ready chain -- the IDLE task. It can * never block, should never attempt to obtain a semaphore or mutex, * and thus will always be there. */ for ( the_node = _Chain_First(ready) ; ; the_node = the_node->next ) { ffc0ca84: 81 29 00 00 lwz r9,0(r9) current = (Thread_Control *) the_node; /* break when AT HEAD OF (or PAST) our priority */ if ( the_thread->current_priority <= current->current_priority ) { ffc0ca88: 81 49 00 14 lwz r10,20(r9) ffc0ca8c: 7f 8a 40 40 cmplw cr7,r10,r8 ffc0ca90: 41 9c ff f4 blt+ cr7,ffc0ca84 <_Scheduler_simple_Ready_queue_enqueue_first+0x1c><== NEVER TAKEN current = (Thread_Control *)current->Object.Node.previous; ffc0ca94: 81 29 00 04 lwz r9,4(r9) ) { Chain_Node *before_node; the_node->previous = after_node; before_node = after_node->next; ffc0ca98: 81 49 00 00 lwz r10,0(r9) Chain_Node *the_node ) { Chain_Node *before_node; the_node->previous = after_node; ffc0ca9c: 91 23 00 04 stw r9,4(r3) before_node = after_node->next; after_node->next = the_node; ffc0caa0: 90 69 00 00 stw r3,0(r9) the_node->next = before_node; before_node->previous = the_node; ffc0caa4: 90 6a 00 04 stw r3,4(r10) Chain_Node *before_node; the_node->previous = after_node; before_node = after_node->next; after_node->next = the_node; the_node->next = before_node; ffc0caa8: 91 43 00 00 stw r10,0(r3) ffc0caac: 4e 80 00 20 blr =============================================================================== ffc0a960 <_TOD_Validate>: uint32_t days_in_month; uint32_t ticks_per_second; ticks_per_second = TOD_MICROSECONDS_PER_SECOND / rtems_configuration_get_microseconds_per_tick(); if ((!the_tod) || ffc0a960: 7c 69 1b 79 mr. r9,r3 { uint32_t days_in_month; uint32_t ticks_per_second; ticks_per_second = TOD_MICROSECONDS_PER_SECOND / rtems_configuration_get_microseconds_per_tick(); ffc0a964: 3d 40 ff c2 lis r10,-62 ) { uint32_t days_in_month; uint32_t ticks_per_second; ticks_per_second = TOD_MICROSECONDS_PER_SECOND / ffc0a968: 81 4a fd 64 lwz r10,-668(r10) ffc0a96c: 3d 00 00 0f lis r8,15 ffc0a970: 61 08 42 40 ori r8,r8,16960 ffc0a974: 7c e8 53 96 divwu r7,r8,r10 rtems_configuration_get_microseconds_per_tick(); if ((!the_tod) || ffc0a978: 41 82 00 90 beq- ffc0aa08 <_TOD_Validate+0xa8> <== NEVER TAKEN ffc0a97c: 81 49 00 18 lwz r10,24(r9) (the_tod->hour >= TOD_HOURS_PER_DAY) || (the_tod->month == 0) || (the_tod->month > TOD_MONTHS_PER_YEAR) || (the_tod->year < TOD_BASE_YEAR) || (the_tod->day == 0) ) return false; ffc0a980: 38 60 00 00 li r3,0 uint32_t days_in_month; uint32_t ticks_per_second; ticks_per_second = TOD_MICROSECONDS_PER_SECOND / rtems_configuration_get_microseconds_per_tick(); if ((!the_tod) || ffc0a984: 7f 87 50 40 cmplw cr7,r7,r10 ffc0a988: 4c 9d 00 20 blelr cr7 (the_tod->ticks >= ticks_per_second) || ffc0a98c: 81 49 00 14 lwz r10,20(r9) ffc0a990: 2b 8a 00 3b cmplwi cr7,r10,59 ffc0a994: 4d 9d 00 20 bgtlr cr7 (the_tod->second >= TOD_SECONDS_PER_MINUTE) || ffc0a998: 81 49 00 10 lwz r10,16(r9) ffc0a99c: 2b 8a 00 3b cmplwi cr7,r10,59 ffc0a9a0: 4d 9d 00 20 bgtlr cr7 (the_tod->minute >= TOD_MINUTES_PER_HOUR) || ffc0a9a4: 81 49 00 0c lwz r10,12(r9) ffc0a9a8: 2b 8a 00 17 cmplwi cr7,r10,23 ffc0a9ac: 4d 9d 00 20 bgtlr cr7 (the_tod->hour >= TOD_HOURS_PER_DAY) || (the_tod->month == 0) || ffc0a9b0: 81 49 00 04 lwz r10,4(r9) 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) || ffc0a9b4: 2f 8a 00 00 cmpwi cr7,r10,0 ffc0a9b8: 4d 9e 00 20 beqlr cr7 (the_tod->month == 0) || ffc0a9bc: 2b 8a 00 0c cmplwi cr7,r10,12 ffc0a9c0: 4d 9d 00 20 bgtlr cr7 (the_tod->month > TOD_MONTHS_PER_YEAR) || (the_tod->year < TOD_BASE_YEAR) || ffc0a9c4: 81 09 00 00 lwz r8,0(r9) (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) || ffc0a9c8: 2b 88 07 c3 cmplwi cr7,r8,1987 ffc0a9cc: 4c 9d 00 20 blelr cr7 (the_tod->year < TOD_BASE_YEAR) || (the_tod->day == 0) ) ffc0a9d0: 81 29 00 08 lwz r9,8(r9) (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) || ffc0a9d4: 2f 89 00 00 cmpwi cr7,r9,0 ffc0a9d8: 4d 9e 00 20 beqlr cr7 (the_tod->day == 0) ) return false; if ( (the_tod->year % 4) == 0 ) ffc0a9dc: 71 07 00 03 andi. r7,r8,3 ffc0a9e0: 40 82 00 30 bne- ffc0aa10 <_TOD_Validate+0xb0> days_in_month = _TOD_Days_per_month[ 1 ][ the_tod->month ]; ffc0a9e4: 39 4a 00 0d addi r10,r10,13 ffc0a9e8: 3d 00 ff c2 lis r8,-62 ffc0a9ec: 55 4a 10 3a rlwinm r10,r10,2,0,29 ffc0a9f0: 39 08 15 b0 addi r8,r8,5552 ffc0a9f4: 7c 68 50 2e lwzx r3,r8,r10 else days_in_month = _TOD_Days_per_month[ 0 ][ the_tod->month ]; if ( the_tod->day > days_in_month ) ffc0a9f8: 7c 69 18 10 subfc r3,r9,r3 ffc0a9fc: 38 60 00 00 li r3,0 ffc0aa00: 7c 63 19 14 adde r3,r3,r3 ffc0aa04: 4e 80 00 20 blr (the_tod->hour >= TOD_HOURS_PER_DAY) || (the_tod->month == 0) || (the_tod->month > TOD_MONTHS_PER_YEAR) || (the_tod->year < TOD_BASE_YEAR) || (the_tod->day == 0) ) return false; ffc0aa08: 38 60 00 00 li r3,0 <== NOT EXECUTED if ( the_tod->day > days_in_month ) return false; return true; } ffc0aa0c: 4e 80 00 20 blr <== NOT EXECUTED return false; if ( (the_tod->year % 4) == 0 ) days_in_month = _TOD_Days_per_month[ 1 ][ the_tod->month ]; else days_in_month = _TOD_Days_per_month[ 0 ][ the_tod->month ]; ffc0aa10: 3d 00 ff c2 lis r8,-62 ffc0aa14: 55 4a 10 3a rlwinm r10,r10,2,0,29 ffc0aa18: 39 08 15 b0 addi r8,r8,5552 ffc0aa1c: 7c 68 50 2e lwzx r3,r8,r10 ffc0aa20: 4b ff ff d8 b ffc0a9f8 <_TOD_Validate+0x98> =============================================================================== ffc0c390 <_Thread_Change_priority>: void _Thread_Change_priority( Thread_Control *the_thread, Priority_Control new_priority, bool prepend_it ) { ffc0c390: 94 21 ff e8 stwu r1,-24(r1) ffc0c394: 7c 08 02 a6 mflr r0 ffc0c398: 90 01 00 1c stw r0,28(r1) ffc0c39c: 93 e1 00 14 stw r31,20(r1) ffc0c3a0: 7c 7f 1b 78 mr r31,r3 ffc0c3a4: 93 81 00 08 stw r28,8(r1) ffc0c3a8: 7c bc 2b 78 mr r28,r5 ffc0c3ac: 93 a1 00 0c stw r29,12(r1) ffc0c3b0: 93 c1 00 10 stw r30,16(r1) ffc0c3b4: 7c 9e 23 78 mr r30,r4 States_Control state, original_state; /* * Save original state */ original_state = the_thread->current_state; ffc0c3b8: 83 a3 00 10 lwz r29,16(r3) /* * 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 ); ffc0c3bc: 48 00 11 bd bl ffc0d578 <_Thread_Set_transient> /* * Do not bother recomputing all the priority related information if * we are not REALLY changing priority. */ if ( the_thread->current_priority != new_priority ) ffc0c3c0: 81 3f 00 14 lwz r9,20(r31) ffc0c3c4: 7f 89 f0 00 cmpw cr7,r9,r30 ffc0c3c8: 41 9e 00 10 beq- cr7,ffc0c3d8 <_Thread_Change_priority+0x48> _Thread_Set_priority( the_thread, new_priority ); ffc0c3cc: 7f e3 fb 78 mr r3,r31 ffc0c3d0: 7f c4 f3 78 mr r4,r30 ffc0c3d4: 48 00 11 19 bl ffc0d4ec <_Thread_Set_priority> static inline uint32_t ppc_interrupt_disable( void ) { uint32_t level; uint32_t mask; __asm__ volatile ( ffc0c3d8: 7f c0 00 a6 mfmsr r30 ffc0c3dc: 7d 30 42 a6 mfsprg r9,0 ffc0c3e0: 7f c9 48 78 andc r9,r30,r9 ffc0c3e4: 7d 20 01 24 mtmsr r9 /* * 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; ffc0c3e8: 81 3f 00 10 lwz r9,16(r31) if ( state != STATES_TRANSIENT ) { ffc0c3ec: 2f 89 00 04 cmpwi cr7,r9,4 ffc0c3f0: 41 9e 00 84 beq- cr7,ffc0c474 <_Thread_Change_priority+0xe4> /* Only clear the transient state if it wasn't set already */ if ( ! _States_Is_transient( original_state ) ) ffc0c3f4: 73 a8 00 04 andi. r8,r29,4 ffc0c3f8: 41 82 00 38 beq- ffc0c430 <_Thread_Change_priority+0xa0><== ALWAYS TAKEN return level; } static inline void ppc_interrupt_enable( uint32_t level ) { __asm__ volatile ( ffc0c3fc: 7f c0 01 24 mtmsr r30 <== NOT EXECUTED */ RTEMS_INLINE_ROUTINE bool _States_Is_waiting_on_thread_queue ( States_Control the_states ) { return (the_states & STATES_WAITING_ON_THREAD_QUEUE); ffc0c400: 3d 40 00 03 lis r10,3 <== NOT EXECUTED ffc0c404: 61 4a be e0 ori r10,r10,48864 <== NOT EXECUTED the_thread->current_state = _States_Clear( STATES_TRANSIENT, state ); _ISR_Enable( level ); if ( _States_Is_waiting_on_thread_queue( state ) ) { ffc0c408: 7d 28 50 39 and. r8,r9,r10 <== NOT EXECUTED ffc0c40c: 40 82 00 40 bne- ffc0c44c <_Thread_Change_priority+0xbc><== NOT EXECUTED if ( !_Thread_Is_executing_also_the_heir() && _Thread_Executing->is_preemptible ) _Thread_Dispatch_necessary = true; _ISR_Enable( level ); } ffc0c410: 80 01 00 1c lwz r0,28(r1) ffc0c414: 83 81 00 08 lwz r28,8(r1) ffc0c418: 7c 08 03 a6 mtlr r0 ffc0c41c: 83 a1 00 0c lwz r29,12(r1) ffc0c420: 83 c1 00 10 lwz r30,16(r1) ffc0c424: 83 e1 00 14 lwz r31,20(r1) ffc0c428: 38 21 00 18 addi r1,r1,24 ffc0c42c: 4e 80 00 20 blr RTEMS_INLINE_ROUTINE States_Control _States_Clear ( States_Control states_to_clear, States_Control current_state ) { return (current_state & ~states_to_clear); ffc0c430: 55 2a 07 b8 rlwinm r10,r9,0,30,28 */ state = the_thread->current_state; if ( state != STATES_TRANSIENT ) { /* Only clear the transient state if it wasn't set already */ if ( ! _States_Is_transient( original_state ) ) the_thread->current_state = _States_Clear( STATES_TRANSIENT, state ); ffc0c434: 91 5f 00 10 stw r10,16(r31) ffc0c438: 7f c0 01 24 mtmsr r30 */ RTEMS_INLINE_ROUTINE bool _States_Is_waiting_on_thread_queue ( States_Control the_states ) { return (the_states & STATES_WAITING_ON_THREAD_QUEUE); ffc0c43c: 3d 40 00 03 lis r10,3 ffc0c440: 61 4a be e0 ori r10,r10,48864 _ISR_Enable( level ); if ( _States_Is_waiting_on_thread_queue( state ) ) { ffc0c444: 7d 28 50 39 and. r8,r9,r10 ffc0c448: 41 82 ff c8 beq+ ffc0c410 <_Thread_Change_priority+0x80> if ( !_Thread_Is_executing_also_the_heir() && _Thread_Executing->is_preemptible ) _Thread_Dispatch_necessary = true; _ISR_Enable( level ); } ffc0c44c: 80 01 00 1c lwz r0,28(r1) /* Only clear the transient state if it wasn't set already */ if ( ! _States_Is_transient( original_state ) ) the_thread->current_state = _States_Clear( STATES_TRANSIENT, state ); _ISR_Enable( level ); if ( _States_Is_waiting_on_thread_queue( state ) ) { _Thread_queue_Requeue( the_thread->Wait.queue, the_thread ); ffc0c450: 7f e4 fb 78 mr r4,r31 ffc0c454: 80 7f 00 44 lwz r3,68(r31) if ( !_Thread_Is_executing_also_the_heir() && _Thread_Executing->is_preemptible ) _Thread_Dispatch_necessary = true; _ISR_Enable( level ); } ffc0c458: 7c 08 03 a6 mtlr r0 ffc0c45c: 83 81 00 08 lwz r28,8(r1) ffc0c460: 83 a1 00 0c lwz r29,12(r1) ffc0c464: 83 c1 00 10 lwz r30,16(r1) ffc0c468: 83 e1 00 14 lwz r31,20(r1) ffc0c46c: 38 21 00 18 addi r1,r1,24 /* Only clear the transient state if it wasn't set already */ if ( ! _States_Is_transient( original_state ) ) the_thread->current_state = _States_Clear( STATES_TRANSIENT, state ); _ISR_Enable( level ); if ( _States_Is_waiting_on_thread_queue( state ) ) { _Thread_queue_Requeue( the_thread->Wait.queue, the_thread ); ffc0c470: 48 00 0f 84 b ffc0d3f4 <_Thread_queue_Requeue> } return; } /* Only clear the transient state if it wasn't set already */ if ( ! _States_Is_transient( original_state ) ) { ffc0c474: 73 a9 00 04 andi. r9,r29,4 */ RTEMS_INLINE_ROUTINE void _Scheduler_Enqueue_first( Thread_Control *the_thread ) { _Scheduler.Operations.enqueue_first( the_thread ); ffc0c478: 3f a0 00 00 lis r29,0 ffc0c47c: 3b bd 20 80 addi r29,r29,8320 ffc0c480: 40 82 00 20 bne- ffc0c4a0 <_Thread_Change_priority+0x110><== NEVER TAKEN * 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 ); if ( prepend_it ) ffc0c484: 2f 9c 00 00 cmpwi cr7,r28,0 * 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 ); ffc0c488: 91 3f 00 10 stw r9,16(r31) if ( prepend_it ) ffc0c48c: 41 9e 00 7c beq- cr7,ffc0c508 <_Thread_Change_priority+0x178> ffc0c490: 81 3d 00 28 lwz r9,40(r29) ffc0c494: 7f e3 fb 78 mr r3,r31 ffc0c498: 7d 29 03 a6 mtctr r9 ffc0c49c: 4e 80 04 21 bctrl static inline void ppc_interrupt_flash( uint32_t level ) { uint32_t current_level; __asm__ volatile ( ffc0c4a0: 7d 20 00 a6 mfmsr r9 ffc0c4a4: 7f c0 01 24 mtmsr r30 ffc0c4a8: 7d 20 01 24 mtmsr r9 * 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(); ffc0c4ac: 81 3d 00 08 lwz r9,8(r29) ffc0c4b0: 7d 29 03 a6 mtctr r9 ffc0c4b4: 4e 80 04 21 bctrl * is also the heir thread, and false otherwise. */ RTEMS_INLINE_ROUTINE bool _Thread_Is_executing_also_the_heir( void ) { return ( _Thread_Executing == _Thread_Heir ); ffc0c4b8: 3d 20 00 00 lis r9,0 ffc0c4bc: 39 29 2e 00 addi r9,r9,11776 ffc0c4c0: 81 49 00 10 lwz r10,16(r9) * 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() && ffc0c4c4: 81 09 00 14 lwz r8,20(r9) ffc0c4c8: 7f 8a 40 00 cmpw cr7,r10,r8 ffc0c4cc: 41 9e 00 18 beq- cr7,ffc0c4e4 <_Thread_Change_priority+0x154> ffc0c4d0: 89 4a 00 70 lbz r10,112(r10) ffc0c4d4: 2f 8a 00 00 cmpwi cr7,r10,0 ffc0c4d8: 41 9e 00 0c beq- cr7,ffc0c4e4 <_Thread_Change_priority+0x154> _Thread_Executing->is_preemptible ) _Thread_Dispatch_necessary = true; ffc0c4dc: 39 40 00 01 li r10,1 ffc0c4e0: 99 49 00 0c stb r10,12(r9) return level; } static inline void ppc_interrupt_enable( uint32_t level ) { __asm__ volatile ( ffc0c4e4: 7f c0 01 24 mtmsr r30 _ISR_Enable( level ); } ffc0c4e8: 80 01 00 1c lwz r0,28(r1) ffc0c4ec: 83 81 00 08 lwz r28,8(r1) ffc0c4f0: 7c 08 03 a6 mtlr r0 ffc0c4f4: 83 a1 00 0c lwz r29,12(r1) ffc0c4f8: 83 c1 00 10 lwz r30,16(r1) ffc0c4fc: 83 e1 00 14 lwz r31,20(r1) ffc0c500: 38 21 00 18 addi r1,r1,24 ffc0c504: 4e 80 00 20 blr */ RTEMS_INLINE_ROUTINE void _Scheduler_Enqueue( Thread_Control *the_thread ) { _Scheduler.Operations.enqueue( the_thread ); ffc0c508: 81 3d 00 24 lwz r9,36(r29) ffc0c50c: 7f e3 fb 78 mr r3,r31 ffc0c510: 7d 29 03 a6 mtctr r9 ffc0c514: 4e 80 04 21 bctrl ffc0c518: 4b ff ff 88 b ffc0c4a0 <_Thread_Change_priority+0x110> =============================================================================== ffc0c788 <_Thread_Delay_ended>: void _Thread_Delay_ended( Objects_Id id, void *ignored __attribute__((unused)) ) { ffc0c788: 94 21 ff e8 stwu r1,-24(r1) ffc0c78c: 7c 08 02 a6 mflr r0 Thread_Control *the_thread; Objects_Locations location; the_thread = _Thread_Get( id, &location ); ffc0c790: 38 81 00 08 addi r4,r1,8 void _Thread_Delay_ended( Objects_Id id, void *ignored __attribute__((unused)) ) { ffc0c794: 90 01 00 1c stw r0,28(r1) Thread_Control *the_thread; Objects_Locations location; the_thread = _Thread_Get( id, &location ); ffc0c798: 48 00 02 a1 bl ffc0ca38 <_Thread_Get> switch ( location ) { ffc0c79c: 81 21 00 08 lwz r9,8(r1) ffc0c7a0: 2f 89 00 00 cmpwi cr7,r9,0 ffc0c7a4: 40 9e 00 20 bne- cr7,ffc0c7c4 <_Thread_Delay_ended+0x3c><== NEVER TAKEN #if defined(RTEMS_MULTIPROCESSING) case OBJECTS_REMOTE: /* impossible */ #endif break; case OBJECTS_LOCAL: _Thread_Clear_state( ffc0c7a8: 3c 80 10 00 lis r4,4096 ffc0c7ac: 60 84 00 18 ori r4,r4,24 ffc0c7b0: 4b ff fd 6d bl ffc0c51c <_Thread_Clear_state> * * 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; ffc0c7b4: 3d 20 00 00 lis r9,0 ffc0c7b8: 81 49 28 24 lwz r10,10276(r9) --level; ffc0c7bc: 39 4a ff ff addi r10,r10,-1 _Thread_Dispatch_disable_level = level; ffc0c7c0: 91 49 28 24 stw r10,10276(r9) | STATES_INTERRUPTIBLE_BY_SIGNAL ); _Thread_Unnest_dispatch(); break; } } ffc0c7c4: 80 01 00 1c lwz r0,28(r1) ffc0c7c8: 38 21 00 18 addi r1,r1,24 ffc0c7cc: 7c 08 03 a6 mtlr r0 ffc0c7d0: 4e 80 00 20 blr =============================================================================== ffc0c7d4 <_Thread_Dispatch>: #if defined(RTEMS_SMP) #include #endif void _Thread_Dispatch( void ) { ffc0c7d4: 94 21 ff b8 stwu r1,-72(r1) ffc0c7d8: 7c 08 02 a6 mflr r0 ffc0c7dc: 93 81 00 38 stw r28,56(r1) #endif /* * Now determine if we need to perform a dispatch on the current CPU. */ executing = _Thread_Executing; ffc0c7e0: 3f 80 00 00 lis r28,0 ffc0c7e4: 3b 9c 2e 00 addi r28,r28,11776 #if defined(RTEMS_SMP) #include #endif void _Thread_Dispatch( void ) { ffc0c7e8: 93 e1 00 44 stw r31,68(r1) ffc0c7ec: 90 01 00 4c stw r0,76(r1) ffc0c7f0: 92 81 00 18 stw r20,24(r1) ffc0c7f4: 92 a1 00 1c stw r21,28(r1) ffc0c7f8: 92 c1 00 20 stw r22,32(r1) ffc0c7fc: 92 e1 00 24 stw r23,36(r1) ffc0c800: 93 01 00 28 stw r24,40(r1) ffc0c804: 93 21 00 2c stw r25,44(r1) ffc0c808: 93 41 00 30 stw r26,48(r1) ffc0c80c: 93 61 00 34 stw r27,52(r1) ffc0c810: 93 a1 00 3c stw r29,60(r1) ffc0c814: 93 c1 00 40 stw r30,64(r1) #endif /* * Now determine if we need to perform a dispatch on the current CPU. */ executing = _Thread_Executing; ffc0c818: 83 fc 00 10 lwz r31,16(r28) static inline uint32_t ppc_interrupt_disable( void ) { uint32_t level; uint32_t mask; __asm__ volatile ( ffc0c81c: 7d 20 00 a6 mfmsr r9 ffc0c820: 7d 50 42 a6 mfsprg r10,0 ffc0c824: 7d 2a 50 78 andc r10,r9,r10 ffc0c828: 7d 40 01 24 mtmsr r10 _ISR_Disable( level ); while ( _Thread_Dispatch_necessary == true ) { ffc0c82c: 89 5c 00 0c lbz r10,12(r28) ffc0c830: 3f 60 00 00 lis r27,0 ffc0c834: 2f 8a 00 00 cmpwi cr7,r10,0 ffc0c838: 41 9e 01 58 beq- cr7,ffc0c990 <_Thread_Dispatch+0x1bc> heir = _Thread_Heir; ffc0c83c: 83 dc 00 14 lwz r30,20(r28) * 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; ffc0c840: 39 40 00 01 li r10,1 ffc0c844: 3f 60 00 00 lis r27,0 /* * 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 ) ffc0c848: 7f 9f f0 00 cmpw cr7,r31,r30 ffc0c84c: 91 5b 28 24 stw r10,10276(r27) while ( _Thread_Dispatch_necessary == true ) { heir = _Thread_Heir; #ifndef RTEMS_SMP _Thread_Dispatch_set_disable_level( 1 ); #endif _Thread_Dispatch_necessary = false; ffc0c850: 39 40 00 00 li r10,0 _Thread_Executing = heir; ffc0c854: 93 dc 00 10 stw r30,16(r28) while ( _Thread_Dispatch_necessary == true ) { heir = _Thread_Heir; #ifndef RTEMS_SMP _Thread_Dispatch_set_disable_level( 1 ); #endif _Thread_Dispatch_necessary = false; ffc0c858: 99 5c 00 0c stb r10,12(r28) /* * 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 ) ffc0c85c: 41 9e 01 34 beq- cr7,ffc0c990 <_Thread_Dispatch+0x1bc> ffc0c860: 3f 40 00 00 lis r26,0 ffc0c864: 3b 5a 22 08 addi r26,r26,8712 ffc0c868: 3f 00 00 00 lis r24,0 ffc0c86c: 3f 20 00 00 lis r25,0 ffc0c870: 3b 18 2b e8 addi r24,r24,11240 ffc0c874: 3b 39 28 2c addi r25,r25,10284 ffc0c878: 3b ba 00 04 addi r29,r26,4 #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; ffc0c87c: 3e a0 00 00 lis r21,0 ffc0c880: 3a c0 00 01 li r22,1 while ( _Thread_Dispatch_necessary == true ) { heir = _Thread_Heir; #ifndef RTEMS_SMP _Thread_Dispatch_set_disable_level( 1 ); #endif _Thread_Dispatch_necessary = false; ffc0c884: 3a e0 00 00 li r23,0 */ #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 ) ffc0c888: 81 5e 00 78 lwz r10,120(r30) ffc0c88c: 2f 8a 00 01 cmpwi cr7,r10,1 ffc0c890: 41 9e 01 80 beq- cr7,ffc0ca10 <_Thread_Dispatch+0x23c> return level; } static inline void ppc_interrupt_enable( uint32_t level ) { __asm__ volatile ( ffc0c894: 7d 20 01 24 mtmsr r9 */ static inline void _TOD_Get_uptime( Timestamp_Control *time ) { _TOD_Get_with_nanoseconds( time, &_TOD.uptime ); ffc0c898: 38 61 00 08 addi r3,r1,8 ffc0c89c: 7f 04 c3 78 mr r4,r24 ffc0c8a0: 4b ff e4 9d bl ffc0ad3c <_TOD_Get_with_nanoseconds> #endif /* * Switch libc's task specific data. */ if ( _Thread_libc_reent ) { ffc0c8a4: 80 b9 00 00 lwz r5,0(r25) const Timestamp64_Control *_start, const Timestamp64_Control *_end, Timestamp64_Control *_result ) { *_result = *_end - *_start; ffc0c8a8: 80 dc 00 20 lwz r6,32(r28) ffc0c8ac: 2f 85 00 00 cmpwi cr7,r5,0 ffc0c8b0: 80 fc 00 24 lwz r7,36(r28) #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ { Timestamp_Control uptime, ran; _TOD_Get_uptime( &uptime ); _Timestamp_Subtract( ffc0c8b4: 81 41 00 08 lwz r10,8(r1) ffc0c8b8: 81 61 00 0c lwz r11,12(r1) static inline void _Timestamp64_implementation_Add_to( Timestamp64_Control *_time, const Timestamp64_Control *_add ) { *_time += *_add; ffc0c8bc: 81 1f 00 80 lwz r8,128(r31) ffc0c8c0: 81 3f 00 84 lwz r9,132(r31) const Timestamp64_Control *_start, const Timestamp64_Control *_end, Timestamp64_Control *_result ) { *_result = *_end - *_start; ffc0c8c4: 7c e7 58 10 subfc r7,r7,r11 ffc0c8c8: 7c c6 51 10 subfe r6,r6,r10 static inline void _Timestamp64_implementation_Add_to( Timestamp64_Control *_time, const Timestamp64_Control *_add ) { *_time += *_add; ffc0c8cc: 7d 29 38 14 addc r9,r9,r7 ffc0c8d0: 7d 08 31 14 adde r8,r8,r6 ffc0c8d4: 91 1f 00 80 stw r8,128(r31) ffc0c8d8: 91 3f 00 84 stw r9,132(r31) &_Thread_Time_of_last_context_switch, &uptime, &ran ); _Timestamp_Add_to( &executing->cpu_time_used, &ran ); _Thread_Time_of_last_context_switch = uptime; ffc0c8dc: 91 5c 00 20 stw r10,32(r28) ffc0c8e0: 91 7c 00 24 stw r11,36(r28) #endif /* * Switch libc's task specific data. */ if ( _Thread_libc_reent ) { ffc0c8e4: 41 9e 00 14 beq- cr7,ffc0c8f8 <_Thread_Dispatch+0x124> <== NEVER TAKEN executing->libc_reent = *_Thread_libc_reent; ffc0c8e8: 81 25 00 00 lwz r9,0(r5) ffc0c8ec: 91 3f 01 44 stw r9,324(r31) *_Thread_libc_reent = heir->libc_reent; ffc0c8f0: 81 3e 01 44 lwz r9,324(r30) ffc0c8f4: 91 25 00 00 stw r9,0(r5) */ RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_first( const Chain_Control *the_chain ) { return _Chain_Immutable_head( the_chain )->next; ffc0c8f8: 82 9a 00 00 lwz r20,0(r26) { 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 ) { ffc0c8fc: 7f 94 e8 00 cmpw cr7,r20,r29 ffc0c900: 41 9e 00 24 beq- cr7,ffc0c924 <_Thread_Dispatch+0x150> <== NEVER TAKEN const User_extensions_Switch_control *extension = (const User_extensions_Switch_control *) node; (*extension->thread_switch)( executing, heir ); ffc0c904: 81 34 00 08 lwz r9,8(r20) ffc0c908: 7f e3 fb 78 mr r3,r31 ffc0c90c: 7f c4 f3 78 mr r4,r30 ffc0c910: 7d 29 03 a6 mtctr r9 ffc0c914: 4e 80 04 21 bctrl #ifdef RTEMS_SMP _Thread_Unnest_dispatch(); #endif _API_extensions_Run_post_switch( executing ); } ffc0c918: 82 94 00 00 lwz r20,0(r20) { 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 ) { ffc0c91c: 7f 94 e8 00 cmpw cr7,r20,r29 ffc0c920: 40 9e ff e4 bne+ cr7,ffc0c904 <_Thread_Dispatch+0x130> * operations. */ #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) #if ( CPU_USE_DEFERRED_FP_SWITCH != TRUE ) if ( executing->fp_context != NULL ) ffc0c924: 81 3f 01 40 lwz r9,320(r31) ffc0c928: 2f 89 00 00 cmpwi cr7,r9,0 ffc0c92c: 41 9e 00 0c beq- cr7,ffc0c938 <_Thread_Dispatch+0x164> _Context_Save_fp( &executing->fp_context ); ffc0c930: 38 7f 01 40 addi r3,r31,320 ffc0c934: 48 00 ff 6d bl ffc1c8a0 <_CPU_Context_save_fp> #endif #endif _Context_Switch( &executing->Registers, &heir->Registers ); ffc0c938: 38 7f 00 c0 addi r3,r31,192 ffc0c93c: 38 9e 00 c0 addi r4,r30,192 ffc0c940: 48 01 00 e1 bl ffc1ca20 <_CPU_Context_switch> _Context_Save_fp( &_Thread_Allocated_fp->fp_context ); _Context_Restore_fp( &executing->fp_context ); _Thread_Allocated_fp = executing; } #else if ( executing->fp_context != NULL ) ffc0c944: 81 3f 01 40 lwz r9,320(r31) ffc0c948: 2f 89 00 00 cmpwi cr7,r9,0 ffc0c94c: 41 9e 00 0c beq- cr7,ffc0c958 <_Thread_Dispatch+0x184> _Context_Restore_fp( &executing->fp_context ); ffc0c950: 38 7f 01 40 addi r3,r31,320 ffc0c954: 48 01 00 0d bl ffc1c960 <_CPU_Context_restore_fp> #endif #endif executing = _Thread_Executing; ffc0c958: 83 fc 00 10 lwz r31,16(r28) static inline uint32_t ppc_interrupt_disable( void ) { uint32_t level; uint32_t mask; __asm__ volatile ( ffc0c95c: 7d 20 00 a6 mfmsr r9 ffc0c960: 7d 50 42 a6 mfsprg r10,0 ffc0c964: 7d 2a 50 78 andc r10,r9,r10 ffc0c968: 7d 40 01 24 mtmsr r10 /* * Now determine if we need to perform a dispatch on the current CPU. */ executing = _Thread_Executing; _ISR_Disable( level ); while ( _Thread_Dispatch_necessary == true ) { ffc0c96c: 89 5c 00 0c lbz r10,12(r28) ffc0c970: 2f 8a 00 00 cmpwi cr7,r10,0 ffc0c974: 41 9e 00 1c beq- cr7,ffc0c990 <_Thread_Dispatch+0x1bc> heir = _Thread_Heir; ffc0c978: 83 dc 00 14 lwz r30,20(r28) ffc0c97c: 92 db 28 24 stw r22,10276(r27) /* * 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 ) ffc0c980: 7f 9e f8 00 cmpw cr7,r30,r31 while ( _Thread_Dispatch_necessary == true ) { heir = _Thread_Heir; #ifndef RTEMS_SMP _Thread_Dispatch_set_disable_level( 1 ); #endif _Thread_Dispatch_necessary = false; ffc0c984: 9a fc 00 0c stb r23,12(r28) _Thread_Executing = heir; ffc0c988: 93 dc 00 10 stw r30,16(r28) /* * 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 ) ffc0c98c: 40 9e fe fc bne+ cr7,ffc0c888 <_Thread_Dispatch+0xb4> <== ALWAYS TAKEN ffc0c990: 39 40 00 00 li r10,0 ffc0c994: 91 5b 28 24 stw r10,10276(r27) return level; } static inline void ppc_interrupt_enable( uint32_t level ) { __asm__ volatile ( ffc0c998: 7d 20 01 24 mtmsr r9 ffc0c99c: 3d 20 00 00 lis r9,0 ffc0c9a0: 3b a9 2d 10 addi r29,r9,11536 ffc0c9a4: 83 c9 2d 10 lwz r30,11536(r9) { 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 ) { ffc0c9a8: 3b bd 00 04 addi r29,r29,4 ffc0c9ac: 7f 9e e8 00 cmpw cr7,r30,r29 ffc0c9b0: 41 9e 00 20 beq- cr7,ffc0c9d0 <_Thread_Dispatch+0x1fc> const API_extensions_Post_switch_control *post_switch = (const API_extensions_Post_switch_control *) node; (*post_switch->hook)( executing ); ffc0c9b4: 81 3e 00 08 lwz r9,8(r30) ffc0c9b8: 7f e3 fb 78 mr r3,r31 ffc0c9bc: 7d 29 03 a6 mtctr r9 ffc0c9c0: 4e 80 04 21 bctrl #ifdef RTEMS_SMP _Thread_Unnest_dispatch(); #endif _API_extensions_Run_post_switch( executing ); } ffc0c9c4: 83 de 00 00 lwz r30,0(r30) { 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 ) { ffc0c9c8: 7f 9e e8 00 cmpw cr7,r30,r29 ffc0c9cc: 40 9e ff e8 bne+ cr7,ffc0c9b4 <_Thread_Dispatch+0x1e0> <== NEVER TAKEN ffc0c9d0: 80 01 00 4c lwz r0,76(r1) ffc0c9d4: 82 81 00 18 lwz r20,24(r1) ffc0c9d8: 7c 08 03 a6 mtlr r0 ffc0c9dc: 82 a1 00 1c lwz r21,28(r1) ffc0c9e0: 82 c1 00 20 lwz r22,32(r1) ffc0c9e4: 82 e1 00 24 lwz r23,36(r1) ffc0c9e8: 83 01 00 28 lwz r24,40(r1) ffc0c9ec: 83 21 00 2c lwz r25,44(r1) ffc0c9f0: 83 41 00 30 lwz r26,48(r1) ffc0c9f4: 83 61 00 34 lwz r27,52(r1) ffc0c9f8: 83 81 00 38 lwz r28,56(r1) ffc0c9fc: 83 a1 00 3c lwz r29,60(r1) ffc0ca00: 83 c1 00 40 lwz r30,64(r1) ffc0ca04: 83 e1 00 44 lwz r31,68(r1) ffc0ca08: 38 21 00 48 addi r1,r1,72 ffc0ca0c: 4e 80 00 20 blr #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; ffc0ca10: 81 55 28 20 lwz r10,10272(r21) ffc0ca14: 91 5e 00 74 stw r10,116(r30) ffc0ca18: 4b ff fe 7c b ffc0c894 <_Thread_Dispatch+0xc0> =============================================================================== ffc11e9c <_Thread_Handler>: #define INIT_NAME __main #define EXECUTE_GLOBAL_CONSTRUCTORS #endif void _Thread_Handler( void ) { ffc11e9c: 94 21 ff f0 stwu r1,-16(r1) ffc11ea0: 7c 08 02 a6 mflr r0 #if defined(EXECUTE_GLOBAL_CONSTRUCTORS) static bool doneConstructors; bool doCons; #endif executing = _Thread_Executing; ffc11ea4: 3d 20 00 00 lis r9,0 #define INIT_NAME __main #define EXECUTE_GLOBAL_CONSTRUCTORS #endif void _Thread_Handler( void ) { ffc11ea8: 90 01 00 14 stw r0,20(r1) ffc11eac: 93 e1 00 0c stw r31,12(r1) #if defined(EXECUTE_GLOBAL_CONSTRUCTORS) static bool doneConstructors; bool doCons; #endif executing = _Thread_Executing; ffc11eb0: 83 e9 2e 10 lwz r31,11792(r9) #define INIT_NAME __main #define EXECUTE_GLOBAL_CONSTRUCTORS #endif void _Thread_Handler( void ) { ffc11eb4: 93 c1 00 08 stw r30,8(r1) /* * have to put level into a register for those cpu's that use * inline asm here */ level = executing->Start.isr_level; ffc11eb8: 81 5f 00 a8 lwz r10,168(r31) } static inline void _CPU_ISR_Set_level( uint32_t level ) { register unsigned int msr; _CPU_MSR_GET(msr); ffc11ebc: 39 20 00 00 li r9,0 ffc11ec0: 7d 20 00 a6 mfmsr r9 if (!(level & CPU_MODES_INTERRUPT_MASK)) { ffc11ec4: 71 48 00 01 andi. r8,r10,1 static inline uint32_t ppc_interrupt_get_disable_mask( void ) { uint32_t mask; __asm__ volatile ( ffc11ec8: 7d 50 42 a6 mfsprg r10,0 ffc11ecc: 40 82 00 64 bne- ffc11f30 <_Thread_Handler+0x94> msr |= ppc_interrupt_get_disable_mask(); ffc11ed0: 7d 49 4b 78 or r9,r10,r9 } else { msr &= ~ppc_interrupt_get_disable_mask(); } _CPU_MSR_SET(msr); ffc11ed4: 7d 20 01 24 mtmsr r9 doCons = !doneConstructors && _Objects_Get_API( executing->Object.id ) != OBJECTS_INTERNAL_API; if (doCons) doneConstructors = true; #else doCons = !doneConstructors; ffc11ed8: 3d 20 00 00 lis r9,0 ffc11edc: 8b c9 29 c8 lbz r30,10696(r9) ); } static inline void _User_extensions_Thread_begin( Thread_Control *executing ) { _User_extensions_Iterate( ffc11ee0: 3c 80 ff c1 lis r4,-63 doneConstructors = true; ffc11ee4: 39 40 00 01 li r10,1 ffc11ee8: 7f e3 fb 78 mr r3,r31 ffc11eec: 99 49 29 c8 stb r10,10696(r9) ffc11ef0: 38 84 d8 0c addi r4,r4,-10228 ffc11ef4: 4b ff b9 65 bl ffc0d858 <_User_extensions_Iterate> _User_extensions_Thread_begin( executing ); /* * At this point, the dispatch disable level BETTER be 1. */ _Thread_Enable_dispatch(); ffc11ef8: 4b ff ab 25 bl ffc0ca1c <_Thread_Enable_dispatch> /* * _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) */ { ffc11efc: 2f 9e 00 00 cmpwi cr7,r30,0 ffc11f00: 41 9e 00 38 beq- cr7,ffc11f38 <_Thread_Handler+0x9c> _Thread_Enable_dispatch(); #endif } #endif if ( executing->Start.prototype == THREAD_START_NUMERIC ) { ffc11f04: 81 3f 00 90 lwz r9,144(r31) ffc11f08: 2f 89 00 00 cmpwi cr7,r9,0 ffc11f0c: 41 9e 00 34 beq- cr7,ffc11f40 <_Thread_Handler+0xa4> <== ALWAYS TAKEN } } static inline void _User_extensions_Thread_exitted( Thread_Control *executing ) { _User_extensions_Iterate( ffc11f10: 3c 80 ff c1 lis r4,-63 ffc11f14: 7f e3 fb 78 mr r3,r31 ffc11f18: 38 84 d8 20 addi r4,r4,-10208 ffc11f1c: 4b ff b9 3d bl ffc0d858 <_User_extensions_Iterate> * able to fit in a (void *). */ _User_extensions_Thread_exitted( executing ); _Internal_error_Occurred( ffc11f20: 38 60 00 00 li r3,0 ffc11f24: 38 80 00 01 li r4,1 ffc11f28: 38 a0 00 05 li r5,5 ffc11f2c: 4b ff 93 ed bl ffc0b318 <_Internal_error_Occurred> _CPU_MSR_GET(msr); if (!(level & CPU_MODES_INTERRUPT_MASK)) { msr |= ppc_interrupt_get_disable_mask(); } else { msr &= ~ppc_interrupt_get_disable_mask(); ffc11f30: 7d 29 50 78 andc r9,r9,r10 ffc11f34: 4b ff ff a0 b ffc11ed4 <_Thread_Handler+0x38> * _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) */ { INIT_NAME (); ffc11f38: 48 00 b5 a5 bl ffc1d4dc <_init> ffc11f3c: 4b ff ff c8 b ffc11f04 <_Thread_Handler+0x68> } #endif if ( executing->Start.prototype == THREAD_START_NUMERIC ) { executing->Wait.return_argument = (*(Thread_Entry_numeric) executing->Start.entry_point)( ffc11f40: 81 3f 00 8c lwz r9,140(r31) ffc11f44: 80 7f 00 98 lwz r3,152(r31) ffc11f48: 7d 29 03 a6 mtctr r9 ffc11f4c: 4e 80 04 21 bctrl #endif } #endif if ( executing->Start.prototype == THREAD_START_NUMERIC ) { executing->Wait.return_argument = ffc11f50: 90 7f 00 28 stw r3,40(r31) ffc11f54: 4b ff ff bc b ffc11f10 <_Thread_Handler+0x74> =============================================================================== ffc0cd64 <_Thread_Handler_initialization>: #include #endif void _Thread_Handler_initialization(void) { uint32_t ticks_per_timeslice = ffc0cd64: 3d 20 ff c2 lis r9,-62 #if defined(RTEMS_SMP) #include #endif void _Thread_Handler_initialization(void) { ffc0cd68: 94 21 ff f0 stwu r1,-16(r1) uint32_t ticks_per_timeslice = ffc0cd6c: 39 29 d5 38 addi r9,r9,-10952 #if defined(RTEMS_SMP) #include #endif void _Thread_Handler_initialization(void) { ffc0cd70: 7c 08 02 a6 mflr r0 #if defined(RTEMS_MULTIPROCESSING) uint32_t maximum_proxies = _Configuration_MP_table->maximum_proxies; #endif if ( rtems_configuration_get_stack_allocate_hook() == NULL || ffc0cd74: 81 49 00 28 lwz r10,40(r9) #if defined(RTEMS_SMP) #include #endif void _Thread_Handler_initialization(void) { ffc0cd78: 93 c1 00 08 stw r30,8(r1) #if defined(RTEMS_MULTIPROCESSING) uint32_t maximum_proxies = _Configuration_MP_table->maximum_proxies; #endif if ( rtems_configuration_get_stack_allocate_hook() == NULL || ffc0cd7c: 2f 8a 00 00 cmpwi cr7,r10,0 #if defined(RTEMS_SMP) #include #endif void _Thread_Handler_initialization(void) { ffc0cd80: 93 e1 00 0c stw r31,12(r1) ffc0cd84: 90 01 00 14 stw r0,20(r1) uint32_t ticks_per_timeslice = ffc0cd88: 83 e9 00 14 lwz r31,20(r9) rtems_configuration_get_ticks_per_timeslice(); uint32_t maximum_extensions = ffc0cd8c: 83 c9 00 08 lwz r30,8(r9) rtems_configuration_get_maximum_extensions(); rtems_stack_allocate_init_hook stack_allocate_init_hook = ffc0cd90: 81 49 00 24 lwz r10,36(r9) #if defined(RTEMS_MULTIPROCESSING) uint32_t maximum_proxies = _Configuration_MP_table->maximum_proxies; #endif if ( rtems_configuration_get_stack_allocate_hook() == NULL || ffc0cd94: 41 9e 00 90 beq- cr7,ffc0ce24 <_Thread_Handler_initialization+0xc0><== NEVER TAKEN ffc0cd98: 81 09 00 2c lwz r8,44(r9) ffc0cd9c: 2f 88 00 00 cmpwi cr7,r8,0 ffc0cda0: 41 9e 00 84 beq- cr7,ffc0ce24 <_Thread_Handler_initialization+0xc0> INTERNAL_ERROR_CORE, true, INTERNAL_ERROR_BAD_STACK_HOOK ); if ( stack_allocate_init_hook != NULL ) ffc0cda4: 2f 8a 00 00 cmpwi cr7,r10,0 ffc0cda8: 41 9e 00 10 beq- cr7,ffc0cdb8 <_Thread_Handler_initialization+0x54> (*stack_allocate_init_hook)( rtems_configuration_get_stack_space_size() ); ffc0cdac: 80 69 00 04 lwz r3,4(r9) ffc0cdb0: 7d 49 03 a6 mtctr r10 ffc0cdb4: 4e 80 04 21 bctrl _Thread_Dispatch_necessary = false; ffc0cdb8: 3d 60 00 00 lis r11,0 ffc0cdbc: 39 6b 2e 00 addi r11,r11,11776 ffc0cdc0: 38 00 00 00 li r0,0 ffc0cdc4: 98 0b 00 0c stb r0,12(r11) _Thread_Executing = NULL; ffc0cdc8: 39 40 00 00 li r10,0 #if defined(RTEMS_MULTIPROCESSING) if ( _System_state_Is_multiprocessing ) maximum_internal_threads += 1; #endif _Objects_Initialize_information( ffc0cdcc: 3c 60 00 00 lis r3,0 false, /* true if this is a global object class */ NULL /* Proxy extraction support callout */ #endif ); } ffc0cdd0: 80 01 00 14 lwz r0,20(r1) #if defined(RTEMS_MULTIPROCESSING) if ( _System_state_Is_multiprocessing ) maximum_internal_threads += 1; #endif _Objects_Initialize_information( ffc0cdd4: 38 63 2d 74 addi r3,r3,11636 if ( stack_allocate_init_hook != NULL ) (*stack_allocate_init_hook)( rtems_configuration_get_stack_space_size() ); _Thread_Dispatch_necessary = false; _Thread_Executing = NULL; ffc0cdd8: 91 4b 00 10 stw r10,16(r11) #if defined(RTEMS_MULTIPROCESSING) if ( _System_state_Is_multiprocessing ) maximum_internal_threads += 1; #endif _Objects_Initialize_information( ffc0cddc: 38 80 00 01 li r4,1 false, /* true if this is a global object class */ NULL /* Proxy extraction support callout */ #endif ); } ffc0cde0: 7c 08 03 a6 mtlr r0 #if defined(RTEMS_MULTIPROCESSING) if ( _System_state_Is_multiprocessing ) maximum_internal_threads += 1; #endif _Objects_Initialize_information( ffc0cde4: 38 a0 00 01 li r5,1 if ( stack_allocate_init_hook != NULL ) (*stack_allocate_init_hook)( rtems_configuration_get_stack_space_size() ); _Thread_Dispatch_necessary = false; _Thread_Executing = NULL; _Thread_Heir = NULL; ffc0cde8: 91 4b 00 14 stw r10,20(r11) #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) _Thread_Allocated_fp = NULL; ffc0cdec: 3d 60 00 00 lis r11,0 #if defined(RTEMS_MULTIPROCESSING) if ( _System_state_Is_multiprocessing ) maximum_internal_threads += 1; #endif _Objects_Initialize_information( ffc0cdf0: 38 c0 00 01 li r6,1 _Thread_Dispatch_necessary = false; _Thread_Executing = NULL; _Thread_Heir = NULL; #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) _Thread_Allocated_fp = NULL; ffc0cdf4: 91 4b 28 28 stw r10,10280(r11) #endif _Thread_Maximum_extensions = maximum_extensions; ffc0cdf8: 3d 40 00 00 lis r10,0 #if defined(RTEMS_MULTIPROCESSING) if ( _System_state_Is_multiprocessing ) maximum_internal_threads += 1; #endif _Objects_Initialize_information( ffc0cdfc: 38 e0 01 58 li r7,344 _Thread_Heir = NULL; #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) _Thread_Allocated_fp = NULL; #endif _Thread_Maximum_extensions = maximum_extensions; ffc0ce00: 93 ca 28 30 stw r30,10288(r10) _Thread_Ticks_per_timeslice = ticks_per_timeslice; ffc0ce04: 3d 40 00 00 lis r10,0 #if defined(RTEMS_MULTIPROCESSING) if ( _System_state_Is_multiprocessing ) maximum_internal_threads += 1; #endif _Objects_Initialize_information( ffc0ce08: 39 00 00 00 li r8,0 false, /* true if this is a global object class */ NULL /* Proxy extraction support callout */ #endif ); } ffc0ce0c: 83 c1 00 08 lwz r30,8(r1) #if defined(RTEMS_MULTIPROCESSING) if ( _System_state_Is_multiprocessing ) maximum_internal_threads += 1; #endif _Objects_Initialize_information( ffc0ce10: 39 20 00 08 li r9,8 _Thread_Allocated_fp = NULL; #endif _Thread_Maximum_extensions = maximum_extensions; _Thread_Ticks_per_timeslice = ticks_per_timeslice; ffc0ce14: 93 ea 28 20 stw r31,10272(r10) false, /* true if this is a global object class */ NULL /* Proxy extraction support callout */ #endif ); } ffc0ce18: 83 e1 00 0c lwz r31,12(r1) ffc0ce1c: 38 21 00 10 addi r1,r1,16 #if defined(RTEMS_MULTIPROCESSING) if ( _System_state_Is_multiprocessing ) maximum_internal_threads += 1; #endif _Objects_Initialize_information( ffc0ce20: 4b ff eb f0 b ffc0ba10 <_Objects_Initialize_information> _Configuration_MP_table->maximum_proxies; #endif if ( rtems_configuration_get_stack_allocate_hook() == NULL || rtems_configuration_get_stack_free_hook() == NULL) _Internal_error_Occurred( ffc0ce24: 38 60 00 00 li r3,0 ffc0ce28: 38 80 00 01 li r4,1 ffc0ce2c: 38 a0 00 0e li r5,14 ffc0ce30: 4b ff e4 e9 bl ffc0b318 <_Internal_error_Occurred> =============================================================================== ffc0cad0 <_Thread_Initialize>: Thread_CPU_budget_algorithms budget_algorithm, Thread_CPU_budget_algorithm_callout budget_callout, uint32_t isr_level, Objects_Name name ) { ffc0cad0: 94 21 ff c0 stwu r1,-64(r1) ffc0cad4: 7c 08 02 a6 mflr r0 /* * Zero out all the allocated memory fields */ for ( i=0 ; i <= THREAD_API_LAST ; i++ ) the_thread->API_Extensions[i] = NULL; ffc0cad8: 38 a0 00 00 li r5,0 Thread_CPU_budget_algorithms budget_algorithm, Thread_CPU_budget_algorithm_callout budget_callout, uint32_t isr_level, Objects_Name name ) { ffc0cadc: 90 01 00 44 stw r0,68(r1) ffc0cae0: 93 01 00 20 stw r24,32(r1) ffc0cae4: 7c f8 3b 78 mr r24,r7 ffc0cae8: 93 21 00 24 stw r25,36(r1) ffc0caec: 7d 59 53 78 mr r25,r10 ffc0caf0: 93 41 00 28 stw r26,40(r1) ffc0caf4: 93 61 00 2c stw r27,44(r1) ffc0caf8: 7c 7b 1b 78 mr r27,r3 /* * Allocate and Initialize the stack for this thread. */ #if !defined(RTEMS_SCORE_THREAD_ENABLE_USER_PROVIDED_STACK_VIA_API) actual_stack_size = _Thread_Stack_Allocate( the_thread, stack_size ); ffc0cafc: 7c 83 23 78 mr r3,r4 Thread_CPU_budget_algorithms budget_algorithm, Thread_CPU_budget_algorithm_callout budget_callout, uint32_t isr_level, Objects_Name name ) { ffc0cb00: 93 81 00 30 stw r28,48(r1) ffc0cb04: 7d 3c 4b 78 mr r28,r9 ffc0cb08: 93 a1 00 34 stw r29,52(r1) ffc0cb0c: 7d 1d 43 78 mr r29,r8 ffc0cb10: 93 c1 00 38 stw r30,56(r1) ffc0cb14: 7c de 33 78 mr r30,r6 ffc0cb18: 93 e1 00 3c stw r31,60(r1) ffc0cb1c: 7c 9f 23 78 mr r31,r4 ffc0cb20: 80 c1 00 50 lwz r6,80(r1) ffc0cb24: 92 e1 00 1c stw r23,28(r1) /* * Zero out all the allocated memory fields */ for ( i=0 ; i <= THREAD_API_LAST ; i++ ) the_thread->API_Extensions[i] = NULL; ffc0cb28: 90 a4 01 48 stw r5,328(r4) ffc0cb2c: 90 a4 01 4c stw r5,332(r4) extensions_area = NULL; the_thread->libc_reent = NULL; ffc0cb30: 90 a4 01 44 stw r5,324(r4) /* * Allocate and Initialize the stack for this thread. */ #if !defined(RTEMS_SCORE_THREAD_ENABLE_USER_PROVIDED_STACK_VIA_API) actual_stack_size = _Thread_Stack_Allocate( the_thread, stack_size ); ffc0cb34: 7f c4 f3 78 mr r4,r30 Thread_CPU_budget_algorithms budget_algorithm, Thread_CPU_budget_algorithm_callout budget_callout, uint32_t isr_level, Objects_Name name ) { ffc0cb38: 83 46 00 00 lwz r26,0(r6) /* * Allocate and Initialize the stack for this thread. */ #if !defined(RTEMS_SCORE_THREAD_ENABLE_USER_PROVIDED_STACK_VIA_API) actual_stack_size = _Thread_Stack_Allocate( the_thread, stack_size ); ffc0cb3c: 48 00 0a 99 bl ffc0d5d4 <_Thread_Stack_Allocate> if ( !actual_stack_size || actual_stack_size < stack_size ) ffc0cb40: 7c 66 1b 79 mr. r6,r3 ffc0cb44: 41 82 01 74 beq- ffc0ccb8 <_Thread_Initialize+0x1e8> ffc0cb48: 7f 9e 30 40 cmplw cr7,r30,r6 return false; /* stack allocation failed */ ffc0cb4c: 38 60 00 00 li r3,0 /* * Allocate and Initialize the stack for this thread. */ #if !defined(RTEMS_SCORE_THREAD_ENABLE_USER_PROVIDED_STACK_VIA_API) actual_stack_size = _Thread_Stack_Allocate( the_thread, stack_size ); if ( !actual_stack_size || actual_stack_size < stack_size ) ffc0cb50: 41 9d 01 34 bgt- cr7,ffc0cc84 <_Thread_Initialize+0x1b4><== NEVER TAKEN /* * Allocate the floating point area for this thread */ #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) if ( is_fp ) { ffc0cb54: 2f 98 00 00 cmpwi cr7,r24,0 Stack_Control *the_stack, void *starting_address, size_t size ) { the_stack->area = starting_address; ffc0cb58: 81 3f 00 bc lwz r9,188(r31) the_stack->size = size; ffc0cb5c: 90 df 00 b0 stw r6,176(r31) extensions_area = NULL; the_thread->libc_reent = NULL; #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) fp_area = NULL; ffc0cb60: 3b c0 00 00 li r30,0 Stack_Control *the_stack, void *starting_address, size_t size ) { the_stack->area = starting_address; ffc0cb64: 91 3f 00 b4 stw r9,180(r31) /* * Allocate the floating point area for this thread */ #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) if ( is_fp ) { ffc0cb68: 40 9e 01 88 bne- cr7,ffc0ccf0 <_Thread_Initialize+0x220> #endif /* * Allocate the extensions area for this thread */ if ( _Thread_Maximum_extensions ) { ffc0cb6c: 3e e0 00 00 lis r23,0 fp_area = _Workspace_Allocate( CONTEXT_FP_SIZE ); if ( !fp_area ) goto failed; fp_area = _Context_Fp_start( fp_area, 0 ); } the_thread->fp_context = fp_area; ffc0cb70: 93 df 01 40 stw r30,320(r31) Watchdog_Service_routine_entry routine, Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; ffc0cb74: 39 20 00 00 li r9,0 #endif /* * Allocate the extensions area for this thread */ if ( _Thread_Maximum_extensions ) { ffc0cb78: 81 57 28 30 lwz r10,10288(r23) if ( !fp_area ) goto failed; fp_area = _Context_Fp_start( fp_area, 0 ); } the_thread->fp_context = fp_area; the_thread->Start.fp_context = fp_area; ffc0cb7c: 93 df 00 b8 stw r30,184(r31) #endif /* * Allocate the extensions area for this thread */ if ( _Thread_Maximum_extensions ) { ffc0cb80: 2f 8a 00 00 cmpwi cr7,r10,0 ffc0cb84: 91 3f 00 50 stw r9,80(r31) the_watchdog->routine = routine; ffc0cb88: 91 3f 00 64 stw r9,100(r31) the_watchdog->id = id; ffc0cb8c: 91 3f 00 68 stw r9,104(r31) the_watchdog->user_data = user_data; ffc0cb90: 91 3f 00 6c stw r9,108(r31) ffc0cb94: 40 9e 01 78 bne- cr7,ffc0cd0c <_Thread_Initialize+0x23c> (_Thread_Maximum_extensions + 1) * sizeof( void * ) ); if ( !extensions_area ) goto failed; } the_thread->extensions = (void **) extensions_area; ffc0cb98: 91 5f 01 50 stw r10,336(r31) * Zero out all the allocated memory fields */ for ( i=0 ; i <= THREAD_API_LAST ; i++ ) the_thread->API_Extensions[i] = NULL; extensions_area = NULL; ffc0cb9c: 3b 00 00 00 li r24,0 } the_thread->Start.isr_level = isr_level; the_thread->current_state = STATES_DORMANT; the_thread->Wait.queue = NULL; ffc0cba0: 39 20 00 00 li r9,0 * General initialization */ the_thread->Start.is_preemptible = is_preemptible; the_thread->Start.budget_algorithm = budget_algorithm; the_thread->Start.budget_callout = budget_callout; ffc0cba4: 81 41 00 48 lwz r10,72(r1) } the_thread->Start.isr_level = isr_level; the_thread->current_state = STATES_DORMANT; the_thread->Wait.queue = NULL; ffc0cba8: 91 3f 00 44 stw r9,68(r31) #endif } the_thread->Start.isr_level = isr_level; the_thread->current_state = STATES_DORMANT; ffc0cbac: 3a e0 00 01 li r23,1 */ RTEMS_INLINE_ROUTINE void* _Scheduler_Allocate( Thread_Control *the_thread ) { return _Scheduler.Operations.allocate( the_thread ); ffc0cbb0: 7f e3 fb 78 mr r3,r31 the_thread->Wait.queue = NULL; the_thread->resource_count = 0; ffc0cbb4: 91 3f 00 1c stw r9,28(r31) ffc0cbb8: 3d 20 00 00 lis r9,0 * General initialization */ the_thread->Start.is_preemptible = is_preemptible; the_thread->Start.budget_algorithm = budget_algorithm; the_thread->Start.budget_callout = budget_callout; ffc0cbbc: 91 5f 00 a4 stw r10,164(r31) ffc0cbc0: 81 29 20 98 lwz r9,8344(r9) case THREAD_CPU_BUDGET_ALGORITHM_CALLOUT: break; #endif } the_thread->Start.isr_level = isr_level; ffc0cbc4: 81 41 00 4c lwz r10,76(r1) /* * General initialization */ the_thread->Start.is_preemptible = is_preemptible; ffc0cbc8: 9b 9f 00 9c stb r28,156(r31) ffc0cbcc: 7d 29 03 a6 mtctr r9 the_thread->Start.budget_algorithm = budget_algorithm; ffc0cbd0: 93 3f 00 a0 stw r25,160(r31) case THREAD_CPU_BUDGET_ALGORITHM_CALLOUT: break; #endif } the_thread->Start.isr_level = isr_level; ffc0cbd4: 91 5f 00 a8 stw r10,168(r31) the_thread->current_state = STATES_DORMANT; ffc0cbd8: 92 ff 00 10 stw r23,16(r31) the_thread->Wait.queue = NULL; the_thread->resource_count = 0; the_thread->real_priority = priority; ffc0cbdc: 93 bf 00 18 stw r29,24(r31) the_thread->Start.initial_priority = priority; ffc0cbe0: 93 bf 00 ac stw r29,172(r31) ffc0cbe4: 4e 80 04 21 bctrl sched =_Scheduler_Allocate( the_thread ); if ( !sched ) ffc0cbe8: 7c 7c 1b 79 mr. r28,r3 ffc0cbec: 41 82 00 5c beq- ffc0cc48 <_Thread_Initialize+0x178> goto failed; _Thread_Set_priority( the_thread, priority ); ffc0cbf0: 7f e3 fb 78 mr r3,r31 ffc0cbf4: 7f a4 eb 78 mr r4,r29 ffc0cbf8: 48 00 08 f5 bl ffc0d4ec <_Thread_Set_priority> Objects_Information *information, Objects_Control *the_object, Objects_Name name ) { _Objects_Set_local_object( ffc0cbfc: a1 3f 00 0a lhz r9,10(r31) #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; ffc0cc00: 81 1b 00 1c lwz r8,28(r27) static inline void _Timestamp64_implementation_Set_to_zero( Timestamp64_Control *_time ) { *_time = 0; ffc0cc04: 39 40 00 00 li r10,0 ffc0cc08: 55 29 10 3a rlwinm r9,r9,2,0,29 ffc0cc0c: 91 5f 00 80 stw r10,128(r31) ffc0cc10: 39 60 00 00 li r11,0 ffc0cc14: 91 7f 00 84 stw r11,132(r31) static inline bool _User_extensions_Thread_create( Thread_Control *created ) { User_extensions_Thread_create_context ctx = { created, true }; _User_extensions_Iterate( &ctx, _User_extensions_Thread_create_visitor ); ffc0cc18: 3c 80 ff c1 lis r4,-63 ffc0cc1c: 38 61 00 08 addi r3,r1,8 ffc0cc20: 7f e8 49 2e stwx r31,r8,r9 ffc0cc24: 38 84 d7 60 addi r4,r4,-10400 information, _Objects_Get_index( the_object->id ), the_object ); the_object->name = name; ffc0cc28: 93 5f 00 0c stw r26,12(r31) * @{ */ static inline bool _User_extensions_Thread_create( Thread_Control *created ) { User_extensions_Thread_create_context ctx = { created, true }; ffc0cc2c: 93 e1 00 08 stw r31,8(r1) ffc0cc30: 9a e1 00 0c stb r23,12(r1) _User_extensions_Iterate( &ctx, _User_extensions_Thread_create_visitor ); ffc0cc34: 48 00 0c 25 bl ffc0d858 <_User_extensions_Iterate> * Mutex provides sufficient protection to let the user extensions * run safely. */ extension_status = _User_extensions_Thread_create( the_thread ); if ( extension_status ) return true; ffc0cc38: 38 60 00 01 li r3,1 return ctx.ok; ffc0cc3c: 89 21 00 0c lbz r9,12(r1) * 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 ) ffc0cc40: 2f 89 00 00 cmpwi cr7,r9,0 ffc0cc44: 40 9e 00 40 bne- cr7,ffc0cc84 <_Thread_Initialize+0x1b4> return true; failed: _Workspace_Free( the_thread->libc_reent ); ffc0cc48: 80 7f 01 44 lwz r3,324(r31) ffc0cc4c: 48 00 12 85 bl ffc0ded0 <_Workspace_Free> for ( i=0 ; i <= THREAD_API_LAST ; i++ ) _Workspace_Free( the_thread->API_Extensions[i] ); ffc0cc50: 80 7f 01 48 lwz r3,328(r31) ffc0cc54: 48 00 12 7d bl ffc0ded0 <_Workspace_Free> ffc0cc58: 80 7f 01 4c lwz r3,332(r31) ffc0cc5c: 48 00 12 75 bl ffc0ded0 <_Workspace_Free> _Workspace_Free( extensions_area ); ffc0cc60: 7f 03 c3 78 mr r3,r24 ffc0cc64: 48 00 12 6d bl ffc0ded0 <_Workspace_Free> #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) _Workspace_Free( fp_area ); ffc0cc68: 7f c3 f3 78 mr r3,r30 ffc0cc6c: 48 00 12 65 bl ffc0ded0 <_Workspace_Free> #endif _Workspace_Free( sched ); ffc0cc70: 7f 83 e3 78 mr r3,r28 ffc0cc74: 48 00 12 5d bl ffc0ded0 <_Workspace_Free> _Thread_Stack_Free( the_thread ); ffc0cc78: 7f e3 fb 78 mr r3,r31 ffc0cc7c: 48 00 09 e9 bl ffc0d664 <_Thread_Stack_Free> return false; ffc0cc80: 38 60 00 00 li r3,0 } ffc0cc84: 80 01 00 44 lwz r0,68(r1) ffc0cc88: 82 e1 00 1c lwz r23,28(r1) ffc0cc8c: 7c 08 03 a6 mtlr r0 ffc0cc90: 83 01 00 20 lwz r24,32(r1) ffc0cc94: 83 21 00 24 lwz r25,36(r1) ffc0cc98: 83 41 00 28 lwz r26,40(r1) ffc0cc9c: 83 61 00 2c lwz r27,44(r1) ffc0cca0: 83 81 00 30 lwz r28,48(r1) ffc0cca4: 83 a1 00 34 lwz r29,52(r1) ffc0cca8: 83 c1 00 38 lwz r30,56(r1) ffc0ccac: 83 e1 00 3c lwz r31,60(r1) ffc0ccb0: 38 21 00 40 addi r1,r1,64 ffc0ccb4: 4e 80 00 20 blr ffc0ccb8: 80 01 00 44 lwz r0,68(r1) * Allocate and Initialize the stack for this thread. */ #if !defined(RTEMS_SCORE_THREAD_ENABLE_USER_PROVIDED_STACK_VIA_API) actual_stack_size = _Thread_Stack_Allocate( the_thread, stack_size ); if ( !actual_stack_size || actual_stack_size < stack_size ) return false; /* stack allocation failed */ ffc0ccbc: 38 60 00 00 li r3,0 _Workspace_Free( sched ); _Thread_Stack_Free( the_thread ); return false; } ffc0ccc0: 82 e1 00 1c lwz r23,28(r1) ffc0ccc4: 7c 08 03 a6 mtlr r0 ffc0ccc8: 83 01 00 20 lwz r24,32(r1) ffc0cccc: 83 21 00 24 lwz r25,36(r1) ffc0ccd0: 83 41 00 28 lwz r26,40(r1) ffc0ccd4: 83 61 00 2c lwz r27,44(r1) ffc0ccd8: 83 81 00 30 lwz r28,48(r1) ffc0ccdc: 83 a1 00 34 lwz r29,52(r1) ffc0cce0: 83 c1 00 38 lwz r30,56(r1) ffc0cce4: 83 e1 00 3c lwz r31,60(r1) ffc0cce8: 38 21 00 40 addi r1,r1,64 ffc0ccec: 4e 80 00 20 blr /* * Allocate the floating point area for this thread */ #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) if ( is_fp ) { fp_area = _Workspace_Allocate( CONTEXT_FP_SIZE ); ffc0ccf0: 38 60 01 08 li r3,264 ffc0ccf4: 48 00 11 c5 bl ffc0deb8 <_Workspace_Allocate> if ( !fp_area ) ffc0ccf8: 7c 7e 1b 79 mr. r30,r3 ffc0ccfc: 40 82 fe 70 bne+ ffc0cb6c <_Thread_Initialize+0x9c> * Zero out all the allocated memory fields */ for ( i=0 ; i <= THREAD_API_LAST ; i++ ) the_thread->API_Extensions[i] = NULL; extensions_area = NULL; ffc0cd00: 3b 00 00 00 li r24,0 size_t actual_stack_size = 0; void *stack = NULL; #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) void *fp_area; #endif void *sched = NULL; ffc0cd04: 3b 80 00 00 li r28,0 ffc0cd08: 4b ff ff 40 b ffc0cc48 <_Thread_Initialize+0x178> /* * Allocate the extensions area for this thread */ if ( _Thread_Maximum_extensions ) { extensions_area = _Workspace_Allocate( ffc0cd0c: 38 6a 00 01 addi r3,r10,1 ffc0cd10: 54 63 10 3a rlwinm r3,r3,2,0,29 ffc0cd14: 48 00 11 a5 bl ffc0deb8 <_Workspace_Allocate> (_Thread_Maximum_extensions + 1) * sizeof( void * ) ); if ( !extensions_area ) ffc0cd18: 7c 78 1b 79 mr. r24,r3 ffc0cd1c: 41 82 00 40 beq- ffc0cd5c <_Thread_Initialize+0x28c> goto failed; } the_thread->extensions = (void **) extensions_area; ffc0cd20: 93 1f 01 50 stw r24,336(r31) ffc0cd24: 7f 05 c3 78 mr r5,r24 * 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++ ) ffc0cd28: 38 c0 00 00 li r6,0 ffc0cd2c: 80 17 28 30 lwz r0,10288(r23) (_Thread_Maximum_extensions + 1) * sizeof( void * ) ); if ( !extensions_area ) goto failed; } the_thread->extensions = (void **) extensions_area; ffc0cd30: 38 e0 00 00 li r7,0 * so they cannot rely on the thread create user extension * call. */ if ( the_thread->extensions ) { for ( i = 0; i <= _Thread_Maximum_extensions ; i++ ) the_thread->extensions[i] = NULL; ffc0cd34: 39 60 00 00 li r11,0 ffc0cd38: 48 00 00 08 b ffc0cd40 <_Thread_Initialize+0x270> ffc0cd3c: 80 bf 01 50 lwz r5,336(r31) * 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++ ) ffc0cd40: 38 e7 00 01 addi r7,r7,1 ffc0cd44: 7f 87 00 40 cmplw cr7,r7,r0 the_thread->extensions[i] = NULL; ffc0cd48: 54 c6 10 3a rlwinm r6,r6,2,0,29 ffc0cd4c: 7d 65 31 2e stwx r11,r5,r6 * 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++ ) ffc0cd50: 7c e6 3b 78 mr r6,r7 ffc0cd54: 40 9d ff e8 ble+ cr7,ffc0cd3c <_Thread_Initialize+0x26c> ffc0cd58: 4b ff fe 48 b ffc0cba0 <_Thread_Initialize+0xd0> size_t actual_stack_size = 0; void *stack = NULL; #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) void *fp_area; #endif void *sched = NULL; ffc0cd5c: 3b 80 00 00 li r28,0 ffc0cd60: 4b ff fe e8 b ffc0cc48 <_Thread_Initialize+0x178> =============================================================================== ffc0deb0 <_Thread_Restart>: bool _Thread_Restart( Thread_Control *the_thread, void *pointer_argument, Thread_Entry_numeric_type numeric_argument ) { ffc0deb0: 94 21 ff e8 stwu r1,-24(r1) ffc0deb4: 7c 08 02 a6 mflr r0 ffc0deb8: 90 01 00 1c stw r0,28(r1) */ RTEMS_INLINE_ROUTINE bool _States_Is_dormant ( States_Control the_states ) { return (the_states & STATES_DORMANT); ffc0debc: 81 23 00 10 lwz r9,16(r3) ffc0dec0: 93 e1 00 14 stw r31,20(r1) ffc0dec4: 7c 7f 1b 78 mr r31,r3 if ( !_States_Is_dormant( the_thread->current_state ) ) { ffc0dec8: 71 2a 00 01 andi. r10,r9,1 bool _Thread_Restart( Thread_Control *the_thread, void *pointer_argument, Thread_Entry_numeric_type numeric_argument ) { ffc0decc: 93 c1 00 10 stw r30,16(r1) if ( !_States_Is_dormant( the_thread->current_state ) ) { ffc0ded0: 41 82 00 20 beq- ffc0def0 <_Thread_Restart+0x40> _Thread_Restart_self(); return true; } return false; ffc0ded4: 38 60 00 00 li r3,0 } ffc0ded8: 80 01 00 1c lwz r0,28(r1) ffc0dedc: 83 c1 00 10 lwz r30,16(r1) ffc0dee0: 7c 08 03 a6 mtlr r0 ffc0dee4: 83 e1 00 14 lwz r31,20(r1) ffc0dee8: 38 21 00 18 addi r1,r1,24 ffc0deec: 4e 80 00 20 blr Thread_Entry_numeric_type numeric_argument ) { if ( !_States_Is_dormant( the_thread->current_state ) ) { _Thread_Set_transient( the_thread ); ffc0def0: 90 81 00 08 stw r4,8(r1) RTEMS_INLINE_ROUTINE bool _Thread_Is_executing ( const Thread_Control *the_thread ) { return ( the_thread == _Thread_Executing ); ffc0def4: 3f c0 00 00 lis r30,0 ffc0def8: 3b de 2e 20 addi r30,r30,11808 ffc0defc: 90 a1 00 0c stw r5,12(r1) ffc0df00: 48 00 00 f1 bl ffc0dff0 <_Thread_Set_transient> _Thread_Reset( the_thread, pointer_argument, numeric_argument ); ffc0df04: 7f e3 fb 78 mr r3,r31 ffc0df08: 80 81 00 08 lwz r4,8(r1) ffc0df0c: 80 a1 00 0c lwz r5,12(r1) ffc0df10: 48 00 30 9d bl ffc10fac <_Thread_Reset> _Thread_Load_environment( the_thread ); ffc0df14: 7f e3 fb 78 mr r3,r31 ffc0df18: 48 00 2d 51 bl ffc10c68 <_Thread_Load_environment> _Thread_Ready( the_thread ); ffc0df1c: 7f e3 fb 78 mr r3,r31 ffc0df20: 48 00 30 3d bl ffc10f5c <_Thread_Ready> ); } static inline void _User_extensions_Thread_restart( Thread_Control *restarted ) { _User_extensions_Iterate( ffc0df24: 3c 80 ff c1 lis r4,-63 ffc0df28: 7f e3 fb 78 mr r3,r31 ffc0df2c: 38 84 e2 70 addi r4,r4,-7568 ffc0df30: 48 00 03 a1 bl ffc0e2d0 <_User_extensions_Iterate> _User_extensions_Thread_restart( the_thread ); if ( _Thread_Is_executing ( the_thread ) ) ffc0df34: 81 3e 00 10 lwz r9,16(r30) _Thread_Restart_self(); return true; ffc0df38: 38 60 00 01 li r3,1 _Thread_Ready( the_thread ); _User_extensions_Thread_restart( the_thread ); if ( _Thread_Is_executing ( the_thread ) ) ffc0df3c: 7f 9f 48 00 cmpw cr7,r31,r9 ffc0df40: 40 9e ff 98 bne+ cr7,ffc0ded8 <_Thread_Restart+0x28> */ RTEMS_INLINE_ROUTINE void _Thread_Restart_self( void ) { #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) if ( _Thread_Executing->fp_context != NULL ) ffc0df44: 81 3f 01 40 lwz r9,320(r31) ffc0df48: 2f 89 00 00 cmpwi cr7,r9,0 ffc0df4c: 41 9e 00 0c beq- cr7,ffc0df58 <_Thread_Restart+0xa8> <== NEVER TAKEN _Context_Restore_fp( &_Thread_Executing->fp_context ); ffc0df50: 38 7f 01 40 addi r3,r31,320 ffc0df54: 48 00 f5 2d bl ffc1d480 <_CPU_Context_restore_fp> #endif _CPU_Context_Restart_self( &_Thread_Executing->Registers ); ffc0df58: 80 7e 00 10 lwz r3,16(r30) ffc0df5c: 38 63 00 c0 addi r3,r3,192 ffc0df60: 48 00 f6 b5 bl ffc1d614 <_CPU_Context_restore> =============================================================================== ffc0d3f4 <_Thread_queue_Requeue>: void _Thread_queue_Requeue( Thread_queue_Control *the_thread_queue, Thread_Control *the_thread ) { ffc0d3f4: 94 21 ff d8 stwu r1,-40(r1) ffc0d3f8: 7c 08 02 a6 mflr r0 ffc0d3fc: 93 e1 00 24 stw r31,36(r1) /* * Just in case the thread really wasn't blocked on a thread queue * when we get here. */ if ( !the_thread_queue ) ffc0d400: 7c 7f 1b 79 mr. r31,r3 void _Thread_queue_Requeue( Thread_queue_Control *the_thread_queue, Thread_Control *the_thread ) { ffc0d404: 90 01 00 2c stw r0,44(r1) ffc0d408: 93 a1 00 1c stw r29,28(r1) ffc0d40c: 93 c1 00 20 stw r30,32(r1) /* * Just in case the thread really wasn't blocked on a thread queue * when we get here. */ if ( !the_thread_queue ) ffc0d410: 41 82 00 10 beq- ffc0d420 <_Thread_queue_Requeue+0x2c> <== NEVER TAKEN /* * 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 ) { ffc0d414: 81 3f 00 34 lwz r9,52(r31) ffc0d418: 2f 89 00 01 cmpwi cr7,r9,1 ffc0d41c: 41 9e 00 20 beq- cr7,ffc0d43c <_Thread_queue_Requeue+0x48><== ALWAYS TAKEN _Thread_queue_Extract_priority_helper( tq, the_thread, true ); (void) _Thread_queue_Enqueue_priority( tq, the_thread, &level_ignored ); } _ISR_Enable( level ); } } ffc0d420: 80 01 00 2c lwz r0,44(r1) <== NOT EXECUTED ffc0d424: 83 a1 00 1c lwz r29,28(r1) <== NOT EXECUTED ffc0d428: 7c 08 03 a6 mtlr r0 <== NOT EXECUTED ffc0d42c: 83 c1 00 20 lwz r30,32(r1) <== NOT EXECUTED ffc0d430: 83 e1 00 24 lwz r31,36(r1) <== NOT EXECUTED ffc0d434: 38 21 00 28 addi r1,r1,40 <== NOT EXECUTED ffc0d438: 4e 80 00 20 blr <== NOT EXECUTED ffc0d43c: 7c 9e 23 78 mr r30,r4 static inline uint32_t ppc_interrupt_disable( void ) { uint32_t level; uint32_t mask; __asm__ volatile ( ffc0d440: 7f a0 00 a6 mfmsr r29 ffc0d444: 7d 50 42 a6 mfsprg r10,0 ffc0d448: 7f aa 50 78 andc r10,r29,r10 ffc0d44c: 7d 40 01 24 mtmsr r10 ffc0d450: 3d 00 00 03 lis r8,3 ffc0d454: 81 44 00 10 lwz r10,16(r4) ffc0d458: 61 08 be e0 ori r8,r8,48864 Thread_queue_Control *tq = the_thread_queue; ISR_Level level; ISR_Level level_ignored; _ISR_Disable( level ); if ( _States_Is_waiting_on_thread_queue( the_thread->current_state ) ) { ffc0d45c: 7d 07 50 39 and. r7,r8,r10 ffc0d460: 40 82 00 24 bne- ffc0d484 <_Thread_queue_Requeue+0x90> <== ALWAYS TAKEN return level; } static inline void ppc_interrupt_enable( uint32_t level ) { __asm__ volatile ( ffc0d464: 7f a0 01 24 mtmsr r29 <== NOT EXECUTED _Thread_queue_Extract_priority_helper( tq, the_thread, true ); (void) _Thread_queue_Enqueue_priority( tq, the_thread, &level_ignored ); } _ISR_Enable( level ); } } ffc0d468: 80 01 00 2c lwz r0,44(r1) ffc0d46c: 83 a1 00 1c lwz r29,28(r1) ffc0d470: 7c 08 03 a6 mtlr r0 ffc0d474: 83 c1 00 20 lwz r30,32(r1) ffc0d478: 83 e1 00 24 lwz r31,36(r1) ffc0d47c: 38 21 00 28 addi r1,r1,40 ffc0d480: 4e 80 00 20 blr RTEMS_INLINE_ROUTINE void _Thread_queue_Enter_critical_section ( Thread_queue_Control *the_thread_queue ) { the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; ffc0d484: 91 3f 00 30 stw r9,48(r31) ISR_Level level_ignored; _ISR_Disable( level ); if ( _States_Is_waiting_on_thread_queue( the_thread->current_state ) ) { _Thread_queue_Enter_critical_section( tq ); _Thread_queue_Extract_priority_helper( tq, the_thread, true ); ffc0d488: 38 a0 00 01 li r5,1 ffc0d48c: 48 00 2f 11 bl ffc1039c <_Thread_queue_Extract_priority_helper> (void) _Thread_queue_Enqueue_priority( tq, the_thread, &level_ignored ); ffc0d490: 7f e3 fb 78 mr r3,r31 ffc0d494: 7f c4 f3 78 mr r4,r30 ffc0d498: 38 a1 00 08 addi r5,r1,8 ffc0d49c: 4b ff fc 69 bl ffc0d104 <_Thread_queue_Enqueue_priority> ffc0d4a0: 7f a0 01 24 mtmsr r29 ffc0d4a4: 4b ff ff c4 b ffc0d468 <_Thread_queue_Requeue+0x74> =============================================================================== ffc0d4a8 <_Thread_queue_Timeout>: void _Thread_queue_Timeout( Objects_Id id, void *ignored __attribute__((unused)) ) { ffc0d4a8: 94 21 ff e8 stwu r1,-24(r1) ffc0d4ac: 7c 08 02 a6 mflr r0 Thread_Control *the_thread; Objects_Locations location; the_thread = _Thread_Get( id, &location ); ffc0d4b0: 38 81 00 08 addi r4,r1,8 void _Thread_queue_Timeout( Objects_Id id, void *ignored __attribute__((unused)) ) { ffc0d4b4: 90 01 00 1c stw r0,28(r1) Thread_Control *the_thread; Objects_Locations location; the_thread = _Thread_Get( id, &location ); ffc0d4b8: 4b ff f5 81 bl ffc0ca38 <_Thread_Get> switch ( location ) { ffc0d4bc: 81 21 00 08 lwz r9,8(r1) ffc0d4c0: 2f 89 00 00 cmpwi cr7,r9,0 ffc0d4c4: 40 9e 00 18 bne- cr7,ffc0d4dc <_Thread_queue_Timeout+0x34><== NEVER TAKEN #if defined(RTEMS_MULTIPROCESSING) case OBJECTS_REMOTE: /* impossible */ #endif break; case OBJECTS_LOCAL: _Thread_queue_Process_timeout( the_thread ); ffc0d4c8: 48 00 2f d1 bl ffc10498 <_Thread_queue_Process_timeout> * * 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; ffc0d4cc: 3d 20 00 00 lis r9,0 ffc0d4d0: 81 49 28 24 lwz r10,10276(r9) --level; ffc0d4d4: 39 4a ff ff addi r10,r10,-1 _Thread_Dispatch_disable_level = level; ffc0d4d8: 91 49 28 24 stw r10,10276(r9) _Thread_Unnest_dispatch(); break; } } ffc0d4dc: 80 01 00 1c lwz r0,28(r1) ffc0d4e0: 38 21 00 18 addi r1,r1,24 ffc0d4e4: 7c 08 03 a6 mtlr r0 ffc0d4e8: 4e 80 00 20 blr =============================================================================== ffc1d878 <_Timer_server_Body>: * @a arg points to the corresponding timer server control block. */ static rtems_task _Timer_server_Body( rtems_task_argument arg ) { ffc1d878: 94 21 ff 98 stwu r1,-104(r1) ffc1d87c: 7c 08 02 a6 mflr r0 { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); head->next = tail; head->previous = NULL; ffc1d880: 39 20 00 00 li r9,0 ffc1d884: 92 c1 00 40 stw r22,64(r1) ) { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); head->next = tail; ffc1d888: 3a c1 00 14 addi r22,r1,20 ffc1d88c: 93 01 00 48 stw r24,72(r1) ffc1d890: 3b 01 00 0c addi r24,r1,12 ffc1d894: 93 61 00 54 stw r27,84(r1) ffc1d898: 3b 61 00 18 addi r27,r1,24 ffc1d89c: 93 a1 00 5c stw r29,92(r1) head->previous = NULL; tail->previous = head; ffc1d8a0: 3b a1 00 08 addi r29,r1,8 ffc1d8a4: 92 a1 00 3c stw r21,60(r1) ffc1d8a8: 3e a0 00 00 lis r21,0 ffc1d8ac: 3a b5 28 f8 addi r21,r21,10488 ffc1d8b0: 93 21 00 4c stw r25,76(r1) ffc1d8b4: 3f 20 00 00 lis r25,0 ffc1d8b8: 3b 39 29 18 addi r25,r25,10520 ffc1d8bc: 93 41 00 50 stw r26,80(r1) ffc1d8c0: 3f 40 00 00 lis r26,0 ffc1d8c4: 3b 5a 70 00 addi r26,r26,28672 ffc1d8c8: 90 01 00 6c stw r0,108(r1) ffc1d8cc: 92 01 00 28 stw r16,40(r1) ) { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); head->next = tail; ffc1d8d0: 93 61 00 14 stw r27,20(r1) head->previous = NULL; ffc1d8d4: 91 21 00 18 stw r9,24(r1) tail->previous = head; ffc1d8d8: 92 c1 00 1c stw r22,28(r1) ) { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); head->next = tail; ffc1d8dc: 93 01 00 08 stw r24,8(r1) head->previous = NULL; ffc1d8e0: 91 21 00 0c stw r9,12(r1) tail->previous = head; ffc1d8e4: 93 a1 00 10 stw r29,16(r1) ffc1d8e8: 92 21 00 2c stw r17,44(r1) ffc1d8ec: 3a 23 00 08 addi r17,r3,8 ffc1d8f0: 92 41 00 30 stw r18,48(r1) ffc1d8f4: 3a 43 00 40 addi r18,r3,64 ffc1d8f8: 92 61 00 34 stw r19,52(r1) * the active flag of the timer server is true. */ (*watchdog->routine)( watchdog->id, watchdog->user_data ); } } else { ts->active = false; ffc1d8fc: 3a 60 00 00 li r19,0 * @a arg points to the corresponding timer server control block. */ static rtems_task _Timer_server_Body( rtems_task_argument arg ) { ffc1d900: 92 81 00 38 stw r20,56(r1) _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; ffc1d904: 3a 80 00 01 li r20,1 * @a arg points to the corresponding timer server control block. */ static rtems_task _Timer_server_Body( rtems_task_argument arg ) { ffc1d908: 92 e1 00 44 stw r23,68(r1) * service routine may remove a watchdog from the chain. */ _ISR_Disable( level ); watchdog = (Watchdog_Control *) _Chain_Get_unprotected( &fire_chain ); if ( watchdog != NULL ) { watchdog->state = WATCHDOG_INACTIVE; ffc1d90c: 3a e0 00 00 li r23,0 * @a arg points to the corresponding timer server control block. */ static rtems_task _Timer_server_Body( rtems_task_argument arg ) { ffc1d910: 93 81 00 58 stw r28,88(r1) ffc1d914: 3b 83 00 30 addi r28,r3,48 ffc1d918: 93 c1 00 60 stw r30,96(r1) ffc1d91c: 3b c3 00 68 addi r30,r3,104 ffc1d920: 93 e1 00 64 stw r31,100(r1) ffc1d924: 7c 7f 1b 78 mr r31,r3 { /* * 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; ffc1d928: 92 df 00 78 stw r22,120(r31) static void _Timer_server_Process_interval_watchdogs( Timer_server_Watchdogs *watchdogs, Chain_Control *fire_chain ) { Watchdog_Interval snapshot = _Watchdog_Ticks_since_boot; ffc1d92c: 81 39 00 00 lwz r9,0(r25) */ Watchdog_Interval delta = snapshot - watchdogs->last_snapshot; watchdogs->last_snapshot = snapshot; _Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain ); ffc1d930: 7f 83 e3 78 mr r3,r28 Watchdog_Interval snapshot = _Watchdog_Ticks_since_boot; /* * We assume adequate unsigned arithmetic here. */ Watchdog_Interval delta = snapshot - watchdogs->last_snapshot; ffc1d934: 80 9f 00 3c lwz r4,60(r31) watchdogs->last_snapshot = snapshot; _Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain ); ffc1d938: 7f a5 eb 78 mr r5,r29 /* * We assume adequate unsigned arithmetic here. */ Watchdog_Interval delta = snapshot - watchdogs->last_snapshot; watchdogs->last_snapshot = snapshot; ffc1d93c: 91 3f 00 3c stw r9,60(r31) _Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain ); ffc1d940: 7c 84 48 50 subf r4,r4,r9 ffc1d944: 48 00 50 e5 bl ffc22a28 <_Watchdog_Adjust_to_chain> ffc1d948: 80 7a 00 00 lwz r3,0(r26) ffc1d94c: 80 9a 00 04 lwz r4,4(r26) ffc1d950: 3c c0 3b 9a lis r6,15258 ffc1d954: 38 a0 00 00 li r5,0 ffc1d958: 60 c6 ca 00 ori r6,r6,51712 ffc1d95c: 48 01 4e 69 bl ffc327c4 <__divdi3> Timer_server_Watchdogs *watchdogs, Chain_Control *fire_chain ) { Watchdog_Interval snapshot = (Watchdog_Interval) _TOD_Seconds_since_epoch(); Watchdog_Interval last_snapshot = watchdogs->last_snapshot; ffc1d960: 80 bf 00 74 lwz r5,116(r31) ffc1d964: 7c 90 23 78 mr r16,r4 /* * 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 ) { ffc1d968: 7f 84 28 40 cmplw cr7,r4,r5 ffc1d96c: 41 9d 00 94 bgt- cr7,ffc1da00 <_Timer_server_Body+0x188> * TOD has been set forward. */ delta = snapshot - last_snapshot; _Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain ); } else if ( snapshot < last_snapshot ) { ffc1d970: 41 9c 00 6c blt- cr7,ffc1d9dc <_Timer_server_Body+0x164> */ delta = last_snapshot - snapshot; _Watchdog_Adjust( &watchdogs->Chain, WATCHDOG_BACKWARD, delta ); } watchdogs->last_snapshot = snapshot; ffc1d974: 92 1f 00 74 stw r16,116(r31) } static void _Timer_server_Process_insertions( Timer_server_Control *ts ) { while ( true ) { Timer_Control *timer = (Timer_Control *) _Chain_Get( ts->insert_chain ); ffc1d978: 80 7f 00 78 lwz r3,120(r31) ffc1d97c: 48 00 0a d9 bl ffc1e454 <_Chain_Get> if ( timer == NULL ) { ffc1d980: 7c 64 1b 79 mr. r4,r3 ffc1d984: 41 82 00 34 beq- ffc1d9b8 <_Timer_server_Body+0x140> static void _Timer_server_Insert_timer( Timer_server_Control *ts, Timer_Control *timer ) { if ( timer->the_class == TIMER_INTERVAL_ON_TASK ) { ffc1d988: 81 24 00 38 lwz r9,56(r4) ffc1d98c: 2f 89 00 01 cmpwi cr7,r9,1 _Watchdog_Insert( &ts->Interval_watchdogs.Chain, &timer->Ticker ); } else if ( timer->the_class == TIMER_TIME_OF_DAY_ON_TASK ) { ffc1d990: 2f 09 00 03 cmpwi cr6,r9,3 static void _Timer_server_Insert_timer( Timer_server_Control *ts, Timer_Control *timer ) { if ( timer->the_class == TIMER_INTERVAL_ON_TASK ) { ffc1d994: 41 9e 00 5c beq- cr7,ffc1d9f0 <_Timer_server_Body+0x178> _Watchdog_Insert( &ts->Interval_watchdogs.Chain, &timer->Ticker ); } else if ( timer->the_class == TIMER_TIME_OF_DAY_ON_TASK ) { ffc1d998: 40 9a ff e0 bne+ cr6,ffc1d978 <_Timer_server_Body+0x100><== NEVER TAKEN _Watchdog_Insert( &ts->TOD_watchdogs.Chain, &timer->Ticker ); ffc1d99c: 38 84 00 10 addi r4,r4,16 ffc1d9a0: 7f c3 f3 78 mr r3,r30 ffc1d9a4: 48 00 51 29 bl ffc22acc <_Watchdog_Insert> } static void _Timer_server_Process_insertions( Timer_server_Control *ts ) { while ( true ) { Timer_Control *timer = (Timer_Control *) _Chain_Get( ts->insert_chain ); ffc1d9a8: 80 7f 00 78 lwz r3,120(r31) ffc1d9ac: 48 00 0a a9 bl ffc1e454 <_Chain_Get> if ( timer == NULL ) { ffc1d9b0: 7c 64 1b 79 mr. r4,r3 ffc1d9b4: 40 82 ff d4 bne+ ffc1d988 <_Timer_server_Body+0x110> <== NEVER TAKEN static inline uint32_t ppc_interrupt_disable( void ) { uint32_t level; uint32_t mask; __asm__ volatile ( ffc1d9b8: 7d 40 00 a6 mfmsr r10 ffc1d9bc: 7d 30 42 a6 mfsprg r9,0 ffc1d9c0: 7d 49 48 78 andc r9,r10,r9 ffc1d9c4: 7d 20 01 24 mtmsr r9 * body loop. */ _Timer_server_Process_insertions( ts ); _ISR_Disable( level ); if ( _Chain_Is_empty( insert_chain ) ) { ffc1d9c8: 81 21 00 14 lwz r9,20(r1) ffc1d9cc: 7f 89 d8 00 cmpw cr7,r9,r27 ffc1d9d0: 41 9e 00 44 beq- cr7,ffc1da14 <_Timer_server_Body+0x19c><== ALWAYS TAKEN return level; } static inline void ppc_interrupt_enable( uint32_t level ) { __asm__ volatile ( ffc1d9d4: 7d 40 01 24 mtmsr r10 <== NOT EXECUTED ffc1d9d8: 4b ff ff 54 b ffc1d92c <_Timer_server_Body+0xb4> <== NOT EXECUTED /* * 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 ); ffc1d9dc: 7f c3 f3 78 mr r3,r30 ffc1d9e0: 38 80 00 01 li r4,1 ffc1d9e4: 7c b0 28 50 subf r5,r16,r5 ffc1d9e8: 48 00 4f 2d bl ffc22914 <_Watchdog_Adjust> ffc1d9ec: 4b ff ff 88 b ffc1d974 <_Timer_server_Body+0xfc> Timer_server_Control *ts, Timer_Control *timer ) { if ( timer->the_class == TIMER_INTERVAL_ON_TASK ) { _Watchdog_Insert( &ts->Interval_watchdogs.Chain, &timer->Ticker ); ffc1d9f0: 7f 83 e3 78 mr r3,r28 ffc1d9f4: 38 84 00 10 addi r4,r4,16 ffc1d9f8: 48 00 50 d5 bl ffc22acc <_Watchdog_Insert> ffc1d9fc: 4b ff ff 7c b ffc1d978 <_Timer_server_Body+0x100> /* * 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 ); ffc1da00: 7c 85 20 50 subf r4,r5,r4 ffc1da04: 7f c3 f3 78 mr r3,r30 ffc1da08: 7f a5 eb 78 mr r5,r29 ffc1da0c: 48 00 50 1d bl ffc22a28 <_Watchdog_Adjust_to_chain> ffc1da10: 4b ff ff 64 b ffc1d974 <_Timer_server_Body+0xfc> */ _Timer_server_Process_insertions( ts ); _ISR_Disable( level ); if ( _Chain_Is_empty( insert_chain ) ) { ts->insert_chain = NULL; ffc1da14: 90 9f 00 78 stw r4,120(r31) ffc1da18: 7d 40 01 24 mtmsr r10 _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 ) ) { ffc1da1c: 81 21 00 08 lwz r9,8(r1) ffc1da20: 7f 89 c0 00 cmpw cr7,r9,r24 ffc1da24: 40 be 00 30 bne+ cr7,ffc1da54 <_Timer_server_Body+0x1dc> ffc1da28: 48 00 00 50 b ffc1da78 <_Timer_server_Body+0x200> Chain_Control *the_chain ) { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *old_first = head->next; Chain_Node *new_first = old_first->next; ffc1da2c: 81 49 00 00 lwz r10,0(r9) head->next = new_first; new_first->previous = head; ffc1da30: 93 aa 00 04 stw r29,4(r10) { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *old_first = head->next; Chain_Node *new_first = old_first->next; head->next = new_first; ffc1da34: 91 41 00 08 stw r10,8(r1) * service routine may remove a watchdog from the chain. */ _ISR_Disable( level ); watchdog = (Watchdog_Control *) _Chain_Get_unprotected( &fire_chain ); if ( watchdog != NULL ) { watchdog->state = WATCHDOG_INACTIVE; ffc1da38: 92 e9 00 08 stw r23,8(r9) ffc1da3c: 7d 00 01 24 mtmsr r8 /* * 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 ); ffc1da40: 81 49 00 1c lwz r10,28(r9) ffc1da44: 80 69 00 20 lwz r3,32(r9) ffc1da48: 80 89 00 24 lwz r4,36(r9) ffc1da4c: 7d 49 03 a6 mtctr r10 ffc1da50: 4e 80 04 21 bctrl static inline uint32_t ppc_interrupt_disable( void ) { uint32_t level; uint32_t mask; __asm__ volatile ( ffc1da54: 7d 00 00 a6 mfmsr r8 ffc1da58: 7d 30 42 a6 mfsprg r9,0 ffc1da5c: 7d 09 48 78 andc r9,r8,r9 ffc1da60: 7d 20 01 24 mtmsr r9 */ RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_first( const Chain_Control *the_chain ) { return _Chain_Immutable_head( the_chain )->next; ffc1da64: 81 21 00 08 lwz r9,8(r1) */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Get_unprotected( Chain_Control *the_chain ) { if ( !_Chain_Is_empty(the_chain)) ffc1da68: 7f 89 c0 00 cmpw cr7,r9,r24 ffc1da6c: 40 9e ff c0 bne+ cr7,ffc1da2c <_Timer_server_Body+0x1b4> return level; } static inline void ppc_interrupt_enable( uint32_t level ) { __asm__ volatile ( ffc1da70: 7d 00 01 24 mtmsr r8 ffc1da74: 4b ff fe b4 b ffc1d928 <_Timer_server_Body+0xb0> } } else { ts->active = false; ffc1da78: 9a 7f 00 7c stb r19,124(r31) * * 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; ffc1da7c: 81 35 00 00 lwz r9,0(r21) ++level; ffc1da80: 39 29 00 01 addi r9,r9,1 _Thread_Dispatch_disable_level = level; ffc1da84: 91 35 00 00 stw r9,0(r21) /* * Block until there is something to do. */ _Thread_Disable_dispatch(); _Thread_Set_state( ts->thread, STATES_DELAYING ); ffc1da88: 80 7f 00 00 lwz r3,0(r31) ffc1da8c: 38 80 00 08 li r4,8 ffc1da90: 48 00 49 d5 bl ffc22464 <_Thread_Set_state> _Timer_server_Reset_interval_system_watchdog( ts ); ffc1da94: 7f e3 fb 78 mr r3,r31 ffc1da98: 4b ff fb 21 bl ffc1d5b8 <_Timer_server_Reset_interval_system_watchdog> _Timer_server_Reset_tod_system_watchdog( ts ); ffc1da9c: 7f e3 fb 78 mr r3,r31 ffc1daa0: 4b ff fb a9 bl ffc1d648 <_Timer_server_Reset_tod_system_watchdog> _Thread_Enable_dispatch(); ffc1daa4: 48 00 3e 29 bl ffc218cc <_Thread_Enable_dispatch> ts->active = true; ffc1daa8: 9a 9f 00 7c stb r20,124(r31) static void _Timer_server_Stop_interval_system_watchdog( Timer_server_Control *ts ) { _Watchdog_Remove( &ts->Interval_watchdogs.System_watchdog ); ffc1daac: 7e 23 8b 78 mr r3,r17 ffc1dab0: 48 00 51 e5 bl ffc22c94 <_Watchdog_Remove> static void _Timer_server_Stop_tod_system_watchdog( Timer_server_Control *ts ) { _Watchdog_Remove( &ts->TOD_watchdogs.System_watchdog ); ffc1dab4: 7e 43 93 78 mr r3,r18 ffc1dab8: 48 00 51 dd bl ffc22c94 <_Watchdog_Remove> ffc1dabc: 4b ff fe 6c b ffc1d928 <_Timer_server_Body+0xb0> =============================================================================== ffc1d6d8 <_Timer_server_Schedule_operation_method>: static void _Timer_server_Schedule_operation_method( Timer_server_Control *ts, Timer_Control *timer ) { ffc1d6d8: 94 21 ff e8 stwu r1,-24(r1) ffc1d6dc: 7c 08 02 a6 mflr r0 ffc1d6e0: 90 01 00 1c stw r0,28(r1) if ( ts->insert_chain == NULL ) { ffc1d6e4: 81 23 00 78 lwz r9,120(r3) static void _Timer_server_Schedule_operation_method( Timer_server_Control *ts, Timer_Control *timer ) { ffc1d6e8: 93 e1 00 14 stw r31,20(r1) ffc1d6ec: 7c 7f 1b 78 mr r31,r3 if ( ts->insert_chain == NULL ) { ffc1d6f0: 2f 89 00 00 cmpwi cr7,r9,0 static void _Timer_server_Schedule_operation_method( Timer_server_Control *ts, Timer_Control *timer ) { ffc1d6f4: 93 a1 00 0c stw r29,12(r1) ffc1d6f8: 93 c1 00 10 stw r30,16(r1) if ( ts->insert_chain == NULL ) { ffc1d6fc: 41 9e 00 24 beq- cr7,ffc1d720 <_Timer_server_Schedule_operation_method+0x48> * 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 ); } } ffc1d700: 80 01 00 1c lwz r0,28(r1) ffc1d704: 83 a1 00 0c lwz r29,12(r1) ffc1d708: 7c 08 03 a6 mtlr r0 ffc1d70c: 83 c1 00 10 lwz r30,16(r1) ffc1d710: 83 e1 00 14 lwz r31,20(r1) * 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 ); ffc1d714: 80 63 00 78 lwz r3,120(r3) } } ffc1d718: 38 21 00 18 addi r1,r1,24 * 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 ); ffc1d71c: 48 00 0d 08 b ffc1e424 <_Chain_Append> * * 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; ffc1d720: 3d 20 00 00 lis r9,0 ffc1d724: 81 49 28 f8 lwz r10,10488(r9) ffc1d728: 7c 9e 23 78 mr r30,r4 ++level; ffc1d72c: 39 4a 00 01 addi r10,r10,1 _Thread_Dispatch_disable_level = level; ffc1d730: 91 49 28 f8 stw r10,10488(r9) * being inserted. This could result in an integer overflow. */ _Thread_Disable_dispatch(); if ( timer->the_class == TIMER_INTERVAL_ON_TASK ) { ffc1d734: 81 24 00 38 lwz r9,56(r4) ffc1d738: 2f 89 00 01 cmpwi cr7,r9,1 ffc1d73c: 41 9e 00 bc beq- cr7,ffc1d7f8 <_Timer_server_Schedule_operation_method+0x120> _Watchdog_Insert( &ts->Interval_watchdogs.Chain, &timer->Ticker ); if ( !ts->active ) { _Timer_server_Reset_interval_system_watchdog( ts ); } } else if ( timer->the_class == TIMER_TIME_OF_DAY_ON_TASK ) { ffc1d740: 2f 89 00 03 cmpwi cr7,r9,3 ffc1d744: 41 9e 00 20 beq- cr7,ffc1d764 <_Timer_server_Schedule_operation_method+0x8c> * 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 ); } } ffc1d748: 80 01 00 1c lwz r0,28(r1) ffc1d74c: 83 a1 00 0c lwz r29,12(r1) ffc1d750: 7c 08 03 a6 mtlr r0 ffc1d754: 83 c1 00 10 lwz r30,16(r1) ffc1d758: 83 e1 00 14 lwz r31,20(r1) ffc1d75c: 38 21 00 18 addi r1,r1,24 if ( !ts->active ) { _Timer_server_Reset_tod_system_watchdog( ts ); } } _Thread_Enable_dispatch(); ffc1d760: 48 00 41 6c b ffc218cc <_Thread_Enable_dispatch> static inline uint32_t ppc_interrupt_disable( void ) { uint32_t level; uint32_t mask; __asm__ volatile ( ffc1d764: 7f a0 00 a6 mfmsr r29 ffc1d768: 7d 30 42 a6 mfsprg r9,0 ffc1d76c: 7f a9 48 78 andc r9,r29,r9 ffc1d770: 7d 20 01 24 mtmsr r9 /* * We have to advance the last known seconds value of the server and update * the watchdog chain accordingly. */ _ISR_Disable( level ); snapshot = (Watchdog_Interval) _TOD_Seconds_since_epoch(); ffc1d774: 3d 20 00 00 lis r9,0 ffc1d778: 39 29 70 00 addi r9,r9,28672 ffc1d77c: 80 69 00 00 lwz r3,0(r9) ffc1d780: 3c c0 3b 9a lis r6,15258 ffc1d784: 80 89 00 04 lwz r4,4(r9) ffc1d788: 38 a0 00 00 li r5,0 ffc1d78c: 60 c6 ca 00 ori r6,r6,51712 ffc1d790: 48 01 50 35 bl ffc327c4 <__divdi3> */ RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_first( const Chain_Control *the_chain ) { return _Chain_Immutable_head( the_chain )->next; ffc1d794: 81 3f 00 68 lwz r9,104(r31) RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( const Chain_Control *the_chain ) { return _Chain_Immutable_first( the_chain ) == _Chain_Immutable_tail( the_chain ); ffc1d798: 39 5f 00 6c addi r10,r31,108 last_snapshot = ts->TOD_watchdogs.last_snapshot; if ( !_Chain_Is_empty( &ts->TOD_watchdogs.Chain ) ) { ffc1d79c: 7f 89 50 00 cmpw cr7,r9,r10 * We have to advance the last known seconds value of the server and update * the watchdog chain accordingly. */ _ISR_Disable( level ); snapshot = (Watchdog_Interval) _TOD_Seconds_since_epoch(); last_snapshot = ts->TOD_watchdogs.last_snapshot; ffc1d7a0: 81 5f 00 74 lwz r10,116(r31) if ( !_Chain_Is_empty( &ts->TOD_watchdogs.Chain ) ) { ffc1d7a4: 41 9e 00 28 beq- cr7,ffc1d7cc <_Timer_server_Schedule_operation_method+0xf4> first_watchdog = _Watchdog_First( &ts->TOD_watchdogs.Chain ); delta_interval = first_watchdog->delta_interval; if ( snapshot > last_snapshot ) { ffc1d7a8: 7f 84 50 40 cmplw cr7,r4,r10 _ISR_Disable( level ); snapshot = (Watchdog_Interval) _TOD_Seconds_since_epoch(); last_snapshot = ts->TOD_watchdogs.last_snapshot; if ( !_Chain_Is_empty( &ts->TOD_watchdogs.Chain ) ) { first_watchdog = _Watchdog_First( &ts->TOD_watchdogs.Chain ); delta_interval = first_watchdog->delta_interval; ffc1d7ac: 80 e9 00 10 lwz r7,16(r9) if ( snapshot > last_snapshot ) { ffc1d7b0: 40 9d 00 bc ble- cr7,ffc1d86c <_Timer_server_Schedule_operation_method+0x194> /* * We advanced in time. */ delta = snapshot - last_snapshot; ffc1d7b4: 7d 4a 20 50 subf r10,r10,r4 if (delta_interval > delta) { ffc1d7b8: 7f 87 50 40 cmplw cr7,r7,r10 delta_interval -= delta; } else { delta_interval = 0; ffc1d7bc: 39 00 00 00 li r8,0 if ( snapshot > last_snapshot ) { /* * We advanced in time. */ delta = snapshot - last_snapshot; if (delta_interval > delta) { ffc1d7c0: 40 9d 00 08 ble- cr7,ffc1d7c8 <_Timer_server_Schedule_operation_method+0xf0><== NEVER TAKEN delta_interval -= delta; ffc1d7c4: 7d 0a 38 50 subf r8,r10,r7 * Someone put us in the past. */ delta = last_snapshot - snapshot; delta_interval += delta; } first_watchdog->delta_interval = delta_interval; ffc1d7c8: 91 09 00 10 stw r8,16(r9) } ts->TOD_watchdogs.last_snapshot = snapshot; ffc1d7cc: 90 9f 00 74 stw r4,116(r31) return level; } static inline void ppc_interrupt_enable( uint32_t level ) { __asm__ volatile ( ffc1d7d0: 7f a0 01 24 mtmsr r29 _ISR_Enable( level ); _Watchdog_Insert( &ts->TOD_watchdogs.Chain, &timer->Ticker ); ffc1d7d4: 38 7f 00 68 addi r3,r31,104 ffc1d7d8: 38 9e 00 10 addi r4,r30,16 ffc1d7dc: 48 00 52 f1 bl ffc22acc <_Watchdog_Insert> if ( !ts->active ) { ffc1d7e0: 89 3f 00 7c lbz r9,124(r31) ffc1d7e4: 2f 89 00 00 cmpwi cr7,r9,0 ffc1d7e8: 40 9e ff 60 bne+ cr7,ffc1d748 <_Timer_server_Schedule_operation_method+0x70> _Timer_server_Reset_tod_system_watchdog( ts ); ffc1d7ec: 7f e3 fb 78 mr r3,r31 ffc1d7f0: 4b ff fe 59 bl ffc1d648 <_Timer_server_Reset_tod_system_watchdog> ffc1d7f4: 4b ff ff 54 b ffc1d748 <_Timer_server_Schedule_operation_method+0x70> static inline uint32_t ppc_interrupt_disable( void ) { uint32_t level; uint32_t mask; __asm__ volatile ( ffc1d7f8: 7c a0 00 a6 mfmsr r5 ffc1d7fc: 7d 30 42 a6 mfsprg r9,0 ffc1d800: 7c a9 48 78 andc r9,r5,r9 ffc1d804: 7d 20 01 24 mtmsr r9 */ RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_first( const Chain_Control *the_chain ) { return _Chain_Immutable_head( the_chain )->next; ffc1d808: 81 23 00 30 lwz r9,48(r3) RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( const Chain_Control *the_chain ) { return _Chain_Immutable_first( the_chain ) == _Chain_Immutable_tail( the_chain ); ffc1d80c: 39 43 00 34 addi r10,r3,52 * the watchdog chain accordingly. */ _ISR_Disable( level ); snapshot = _Watchdog_Ticks_since_boot; last_snapshot = ts->Interval_watchdogs.last_snapshot; if ( !_Chain_Is_empty( &ts->Interval_watchdogs.Chain ) ) { ffc1d810: 7f 89 50 00 cmpw cr7,r9,r10 /* * We have to advance the last known ticks value of the server and update * the watchdog chain accordingly. */ _ISR_Disable( level ); snapshot = _Watchdog_Ticks_since_boot; ffc1d814: 3d 40 00 00 lis r10,0 ffc1d818: 81 4a 29 18 lwz r10,10520(r10) last_snapshot = ts->Interval_watchdogs.last_snapshot; ffc1d81c: 80 e3 00 3c lwz r7,60(r3) if ( !_Chain_Is_empty( &ts->Interval_watchdogs.Chain ) ) { ffc1d820: 41 9e 00 20 beq- cr7,ffc1d840 <_Timer_server_Schedule_operation_method+0x168> /* * We assume adequate unsigned arithmetic here. */ delta = snapshot - last_snapshot; delta_interval = first_watchdog->delta_interval; ffc1d824: 80 c9 00 10 lwz r6,16(r9) first_watchdog = _Watchdog_First( &ts->Interval_watchdogs.Chain ); /* * We assume adequate unsigned arithmetic here. */ delta = snapshot - last_snapshot; ffc1d828: 7c e7 50 50 subf r7,r7,r10 delta_interval = first_watchdog->delta_interval; if (delta_interval > delta) { delta_interval -= delta; } else { delta_interval = 0; ffc1d82c: 39 00 00 00 li r8,0 * We assume adequate unsigned arithmetic here. */ delta = snapshot - last_snapshot; delta_interval = first_watchdog->delta_interval; if (delta_interval > delta) { ffc1d830: 7f 87 30 40 cmplw cr7,r7,r6 ffc1d834: 40 9c 00 08 bge- cr7,ffc1d83c <_Timer_server_Schedule_operation_method+0x164> delta_interval -= delta; ffc1d838: 7d 07 30 50 subf r8,r7,r6 } else { delta_interval = 0; } first_watchdog->delta_interval = delta_interval; ffc1d83c: 91 09 00 10 stw r8,16(r9) } ts->Interval_watchdogs.last_snapshot = snapshot; ffc1d840: 91 5f 00 3c stw r10,60(r31) return level; } static inline void ppc_interrupt_enable( uint32_t level ) { __asm__ volatile ( ffc1d844: 7c a0 01 24 mtmsr r5 _ISR_Enable( level ); _Watchdog_Insert( &ts->Interval_watchdogs.Chain, &timer->Ticker ); ffc1d848: 38 7f 00 30 addi r3,r31,48 ffc1d84c: 38 9e 00 10 addi r4,r30,16 ffc1d850: 48 00 52 7d bl ffc22acc <_Watchdog_Insert> if ( !ts->active ) { ffc1d854: 89 3f 00 7c lbz r9,124(r31) ffc1d858: 2f 89 00 00 cmpwi cr7,r9,0 ffc1d85c: 40 9e fe ec bne+ cr7,ffc1d748 <_Timer_server_Schedule_operation_method+0x70> _Timer_server_Reset_interval_system_watchdog( ts ); ffc1d860: 7f e3 fb 78 mr r3,r31 ffc1d864: 4b ff fd 55 bl ffc1d5b8 <_Timer_server_Reset_interval_system_watchdog> ffc1d868: 4b ff fe e0 b ffc1d748 <_Timer_server_Schedule_operation_method+0x70> } } else { /* * Someone put us in the past. */ delta = last_snapshot - snapshot; ffc1d86c: 7d 47 52 14 add r10,r7,r10 delta_interval += delta; ffc1d870: 7d 04 50 50 subf r8,r4,r10 ffc1d874: 4b ff ff 54 b ffc1d7c8 <_Timer_server_Schedule_operation_method+0xf0> =============================================================================== ffc0da64 <_Timespec_Add_to>: { uint32_t seconds = add->tv_sec; /* Add the basics */ time->tv_sec += add->tv_sec; time->tv_nsec += add->tv_nsec; ffc0da64: 81 24 00 04 lwz r9,4(r4) /* Now adjust it so nanoseconds is in range */ while ( time->tv_nsec >= TOD_NANOSECONDS_PER_SECOND ) { ffc0da68: 3c e0 3b 9a lis r7,15258 { uint32_t seconds = add->tv_sec; /* Add the basics */ time->tv_sec += add->tv_sec; time->tv_nsec += add->tv_nsec; ffc0da6c: 81 03 00 04 lwz r8,4(r3) /* Now adjust it so nanoseconds is in range */ while ( time->tv_nsec >= TOD_NANOSECONDS_PER_SECOND ) { ffc0da70: 60 e7 c9 ff ori r7,r7,51711 uint32_t _Timespec_Add_to( struct timespec *time, const struct timespec *add ) { uint32_t seconds = add->tv_sec; ffc0da74: 81 44 00 00 lwz r10,0(r4) /* Add the basics */ time->tv_sec += add->tv_sec; time->tv_nsec += add->tv_nsec; ffc0da78: 7d 08 4a 14 add r8,r8,r9 ) { uint32_t seconds = add->tv_sec; /* Add the basics */ time->tv_sec += add->tv_sec; ffc0da7c: 80 c3 00 00 lwz r6,0(r3) time->tv_nsec += add->tv_nsec; /* Now adjust it so nanoseconds is in range */ while ( time->tv_nsec >= TOD_NANOSECONDS_PER_SECOND ) { ffc0da80: 7f 88 38 40 cmplw cr7,r8,r7 { uint32_t seconds = add->tv_sec; /* Add the basics */ time->tv_sec += add->tv_sec; time->tv_nsec += add->tv_nsec; ffc0da84: 91 03 00 04 stw r8,4(r3) ) { uint32_t seconds = add->tv_sec; /* Add the basics */ time->tv_sec += add->tv_sec; ffc0da88: 7c c6 52 14 add r6,r6,r10 time->tv_nsec += add->tv_nsec; /* Now adjust it so nanoseconds is in range */ while ( time->tv_nsec >= TOD_NANOSECONDS_PER_SECOND ) { ffc0da8c: 7d 09 43 78 mr r9,r8 ) { uint32_t seconds = add->tv_sec; /* Add the basics */ time->tv_sec += add->tv_sec; ffc0da90: 90 c3 00 00 stw r6,0(r3) time->tv_nsec += add->tv_nsec; /* Now adjust it so nanoseconds is in range */ while ( time->tv_nsec >= TOD_NANOSECONDS_PER_SECOND ) { ffc0da94: 40 9d 00 2c ble- cr7,ffc0dac0 <_Timespec_Add_to+0x5c> ffc0da98: 38 c6 00 01 addi r6,r6,1 #include #include #include #include uint32_t _Timespec_Add_to( ffc0da9c: 7c ca 30 50 subf r6,r10,r6 time->tv_sec += add->tv_sec; time->tv_nsec += add->tv_nsec; /* Now adjust it so nanoseconds is in range */ while ( time->tv_nsec >= TOD_NANOSECONDS_PER_SECOND ) { time->tv_nsec -= TOD_NANOSECONDS_PER_SECOND; ffc0daa0: 3d 29 c4 65 addis r9,r9,-15259 ffc0daa4: 39 29 36 00 addi r9,r9,13824 /* Add the basics */ time->tv_sec += add->tv_sec; time->tv_nsec += add->tv_nsec; /* Now adjust it so nanoseconds is in range */ while ( time->tv_nsec >= TOD_NANOSECONDS_PER_SECOND ) { ffc0daa8: 7f 89 38 40 cmplw cr7,r9,r7 #include #include #include #include uint32_t _Timespec_Add_to( ffc0daac: 7d 06 52 14 add r8,r6,r10 /* Now adjust it so nanoseconds is in range */ while ( time->tv_nsec >= TOD_NANOSECONDS_PER_SECOND ) { time->tv_nsec -= TOD_NANOSECONDS_PER_SECOND; time->tv_sec++; seconds++; ffc0dab0: 39 4a 00 01 addi r10,r10,1 /* Add the basics */ time->tv_sec += add->tv_sec; time->tv_nsec += add->tv_nsec; /* Now adjust it so nanoseconds is in range */ while ( time->tv_nsec >= TOD_NANOSECONDS_PER_SECOND ) { ffc0dab4: 41 9d ff ec bgt+ cr7,ffc0daa0 <_Timespec_Add_to+0x3c> <== NEVER TAKEN ffc0dab8: 91 23 00 04 stw r9,4(r3) ffc0dabc: 91 03 00 00 stw r8,0(r3) time->tv_sec++; seconds++; } return seconds; } ffc0dac0: 7d 43 53 78 mr r3,r10 ffc0dac4: 4e 80 00 20 blr =============================================================================== ffc0f504 <_Timestamp64_Divide>: const Timestamp64_Control *_lhs, const Timestamp64_Control *_rhs, uint32_t *_ival_percentage, uint32_t *_fval_percentage ) { ffc0f504: 94 21 ff e8 stwu r1,-24(r1) ffc0f508: 7c 08 02 a6 mflr r0 ffc0f50c: 90 01 00 1c stw r0,28(r1) Timestamp64_Control answer; if ( *_rhs == 0 ) { ffc0f510: 81 44 00 00 lwz r10,0(r4) ffc0f514: 81 24 00 04 lwz r9,4(r4) const Timestamp64_Control *_lhs, const Timestamp64_Control *_rhs, uint32_t *_ival_percentage, uint32_t *_fval_percentage ) { ffc0f518: 93 c1 00 10 stw r30,16(r1) ffc0f51c: 7c be 2b 78 mr r30,r5 Timestamp64_Control answer; if ( *_rhs == 0 ) { ffc0f520: 7d 48 4b 79 or. r8,r10,r9 const Timestamp64_Control *_lhs, const Timestamp64_Control *_rhs, uint32_t *_ival_percentage, uint32_t *_fval_percentage ) { ffc0f524: 93 e1 00 14 stw r31,20(r1) ffc0f528: 7c df 33 78 mr r31,r6 ffc0f52c: 93 81 00 08 stw r28,8(r1) ffc0f530: 93 a1 00 0c stw r29,12(r1) Timestamp64_Control answer; if ( *_rhs == 0 ) { ffc0f534: 41 82 00 80 beq- ffc0f5b4 <_Timestamp64_Divide+0xb0> <== NEVER TAKEN * This looks odd but gives the results the proper precision. * * TODO: Rounding on the last digit of the fval. */ answer = (*_lhs * 100000) / *_rhs; ffc0f538: 80 c3 00 04 lwz r6,4(r3) ffc0f53c: 3d 00 00 01 lis r8,1 ffc0f540: 80 e3 00 00 lwz r7,0(r3) ffc0f544: 61 08 86 a0 ori r8,r8,34464 ffc0f548: 7c 68 30 16 mulhwu r3,r8,r6 ffc0f54c: 7c e8 39 d6 mullw r7,r8,r7 ffc0f550: 7c 88 31 d6 mullw r4,r8,r6 ffc0f554: 7d 45 53 78 mr r5,r10 ffc0f558: 7d 26 4b 78 mr r6,r9 ffc0f55c: 7c 67 1a 14 add r3,r7,r3 ffc0f560: 48 00 eb 41 bl ffc1e0a0 <__divdi3> *_ival_percentage = answer / 1000; ffc0f564: 38 a0 00 00 li r5,0 ffc0f568: 38 c0 03 e8 li r6,1000 * This looks odd but gives the results the proper precision. * * TODO: Rounding on the last digit of the fval. */ answer = (*_lhs * 100000) / *_rhs; ffc0f56c: 7c 7c 1b 78 mr r28,r3 ffc0f570: 7c 9d 23 78 mr r29,r4 *_ival_percentage = answer / 1000; ffc0f574: 48 00 eb 2d bl ffc1e0a0 <__divdi3> ffc0f578: 90 9e 00 00 stw r4,0(r30) *_fval_percentage = answer % 1000; ffc0f57c: 7f 83 e3 78 mr r3,r28 ffc0f580: 7f a4 eb 78 mr r4,r29 ffc0f584: 38 a0 00 00 li r5,0 ffc0f588: 38 c0 03 e8 li r6,1000 ffc0f58c: 48 00 ef 39 bl ffc1e4c4 <__moddi3> } ffc0f590: 80 01 00 1c lwz r0,28(r1) */ answer = (*_lhs * 100000) / *_rhs; *_ival_percentage = answer / 1000; *_fval_percentage = answer % 1000; ffc0f594: 90 9f 00 00 stw r4,0(r31) } ffc0f598: 7c 08 03 a6 mtlr r0 ffc0f59c: 83 81 00 08 lwz r28,8(r1) ffc0f5a0: 83 a1 00 0c lwz r29,12(r1) ffc0f5a4: 83 c1 00 10 lwz r30,16(r1) ffc0f5a8: 83 e1 00 14 lwz r31,20(r1) ffc0f5ac: 38 21 00 18 addi r1,r1,24 ffc0f5b0: 4e 80 00 20 blr ffc0f5b4: 80 01 00 1c lwz r0,28(r1) <== NOT EXECUTED ) { Timestamp64_Control answer; if ( *_rhs == 0 ) { *_ival_percentage = 0; ffc0f5b8: 91 05 00 00 stw r8,0(r5) <== NOT EXECUTED answer = (*_lhs * 100000) / *_rhs; *_ival_percentage = answer / 1000; *_fval_percentage = answer % 1000; } ffc0f5bc: 7c 08 03 a6 mtlr r0 <== NOT EXECUTED ffc0f5c0: 83 81 00 08 lwz r28,8(r1) <== NOT EXECUTED ffc0f5c4: 83 a1 00 0c lwz r29,12(r1) <== NOT EXECUTED ffc0f5c8: 83 c1 00 10 lwz r30,16(r1) <== NOT EXECUTED ffc0f5cc: 83 e1 00 14 lwz r31,20(r1) <== NOT EXECUTED { Timestamp64_Control answer; if ( *_rhs == 0 ) { *_ival_percentage = 0; *_fval_percentage = 0; ffc0f5d0: 91 06 00 00 stw r8,0(r6) <== NOT EXECUTED answer = (*_lhs * 100000) / *_rhs; *_ival_percentage = answer / 1000; *_fval_percentage = answer % 1000; } ffc0f5d4: 38 21 00 18 addi r1,r1,24 <== NOT EXECUTED ffc0f5d8: 4e 80 00 20 blr <== NOT EXECUTED =============================================================================== ffc0d858 <_User_extensions_Iterate>: void _User_extensions_Iterate( void *arg, User_extensions_Visitor visitor ) { ffc0d858: 94 21 ff e0 stwu r1,-32(r1) Thread_Control *executing = _Thread_Executing; const User_extensions_Table *callouts_current = ffc0d85c: 3d 20 ff c2 lis r9,-62 ffc0d860: 39 29 d5 38 addi r9,r9,-10952 void _User_extensions_Iterate( void *arg, User_extensions_Visitor visitor ) { ffc0d864: 7c 08 02 a6 mflr r0 ffc0d868: 93 61 00 0c stw r27,12(r1) Thread_Control *executing = _Thread_Executing; const User_extensions_Table *callouts_current = rtems_configuration_get_user_extension_table(); const User_extensions_Table *callouts_end = callouts_current + rtems_configuration_get_number_of_initial_extensions(); ffc0d86c: 83 69 00 40 lwz r27,64(r9) void _User_extensions_Iterate( void *arg, User_extensions_Visitor visitor ) { ffc0d870: 93 e1 00 1c stw r31,28(r1) Thread_Control *executing = _Thread_Executing; const User_extensions_Table *callouts_current = rtems_configuration_get_user_extension_table(); const User_extensions_Table *callouts_end = callouts_current + rtems_configuration_get_number_of_initial_extensions(); ffc0d874: 57 7b 28 34 rlwinm r27,r27,5,0,26 void *arg, User_extensions_Visitor visitor ) { Thread_Control *executing = _Thread_Executing; const User_extensions_Table *callouts_current = ffc0d878: 83 e9 00 44 lwz r31,68(r9) void _User_extensions_Iterate( void *arg, User_extensions_Visitor visitor ) { Thread_Control *executing = _Thread_Executing; ffc0d87c: 3d 20 00 00 lis r9,0 void _User_extensions_Iterate( void *arg, User_extensions_Visitor visitor ) { ffc0d880: 93 81 00 10 stw r28,16(r1) ffc0d884: 7c 9c 23 78 mr r28,r4 Thread_Control *executing = _Thread_Executing; const User_extensions_Table *callouts_current = rtems_configuration_get_user_extension_table(); const User_extensions_Table *callouts_end = ffc0d888: 7f 7f da 14 add r27,r31,r27 callouts_current + rtems_configuration_get_number_of_initial_extensions(); const Chain_Node *node; const Chain_Node *tail; while ( callouts_current != callouts_end ) { ffc0d88c: 7f 9f d8 00 cmpw cr7,r31,r27 void _User_extensions_Iterate( void *arg, User_extensions_Visitor visitor ) { ffc0d890: 93 a1 00 14 stw r29,20(r1) ffc0d894: 7c 7d 1b 78 mr r29,r3 ffc0d898: 93 c1 00 18 stw r30,24(r1) ffc0d89c: 90 01 00 24 stw r0,36(r1) Thread_Control *executing = _Thread_Executing; ffc0d8a0: 83 c9 2e 10 lwz r30,11792(r9) const User_extensions_Table *callouts_end = callouts_current + rtems_configuration_get_number_of_initial_extensions(); const Chain_Node *node; const Chain_Node *tail; while ( callouts_current != callouts_end ) { ffc0d8a4: 41 9e 00 24 beq- cr7,ffc0d8c8 <_User_extensions_Iterate+0x70><== NEVER TAKEN (*visitor)( executing, arg, callouts_current ); ffc0d8a8: 7f e5 fb 78 mr r5,r31 ffc0d8ac: 7f 89 03 a6 mtctr r28 ffc0d8b0: 7f c3 f3 78 mr r3,r30 ffc0d8b4: 7f a4 eb 78 mr r4,r29 ++callouts_current; ffc0d8b8: 3b ff 00 20 addi r31,r31,32 callouts_current + rtems_configuration_get_number_of_initial_extensions(); const Chain_Node *node; const Chain_Node *tail; while ( callouts_current != callouts_end ) { (*visitor)( executing, arg, callouts_current ); ffc0d8bc: 4e 80 04 21 bctrl const User_extensions_Table *callouts_end = callouts_current + rtems_configuration_get_number_of_initial_extensions(); const Chain_Node *node; const Chain_Node *tail; while ( callouts_current != callouts_end ) { ffc0d8c0: 7f 9b f8 00 cmpw cr7,r27,r31 ffc0d8c4: 40 9e ff e4 bne+ cr7,ffc0d8a8 <_User_extensions_Iterate+0x50> */ RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_first( const Chain_Control *the_chain ) { return _Chain_Immutable_head( the_chain )->next; ffc0d8c8: 3d 20 00 00 lis r9,0 ffc0d8cc: 3b 69 21 fc addi r27,r9,8700 ffc0d8d0: 83 e9 21 fc lwz r31,8700(r9) */ RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_tail( const Chain_Control *the_chain ) { return &the_chain->Tail.Node; ffc0d8d4: 3b 7b 00 04 addi r27,r27,4 ++callouts_current; } node = _Chain_Immutable_first( &_User_extensions_List ); tail = _Chain_Immutable_tail( &_User_extensions_List ); while ( node != tail ) { ffc0d8d8: 7f 9f d8 00 cmpw cr7,r31,r27 ffc0d8dc: 41 9e 00 24 beq- cr7,ffc0d900 <_User_extensions_Iterate+0xa8> const User_extensions_Control *extension = (const User_extensions_Control *) node; (*visitor)( executing, arg, &extension->Callouts ); ffc0d8e0: 38 bf 00 14 addi r5,r31,20 ffc0d8e4: 7f 89 03 a6 mtctr r28 ffc0d8e8: 7f c3 f3 78 mr r3,r30 ffc0d8ec: 7f a4 eb 78 mr r4,r29 ffc0d8f0: 4e 80 04 21 bctrl node = _Chain_Immutable_next( node ); } } ffc0d8f4: 83 ff 00 00 lwz r31,0(r31) ++callouts_current; } node = _Chain_Immutable_first( &_User_extensions_List ); tail = _Chain_Immutable_tail( &_User_extensions_List ); while ( node != tail ) { ffc0d8f8: 7f 9f d8 00 cmpw cr7,r31,r27 ffc0d8fc: 40 9e ff e4 bne+ cr7,ffc0d8e0 <_User_extensions_Iterate+0x88> (*visitor)( executing, arg, &extension->Callouts ); node = _Chain_Immutable_next( node ); } } ffc0d900: 80 01 00 24 lwz r0,36(r1) ffc0d904: 83 61 00 0c lwz r27,12(r1) ffc0d908: 7c 08 03 a6 mtlr r0 ffc0d90c: 83 81 00 10 lwz r28,16(r1) ffc0d910: 83 a1 00 14 lwz r29,20(r1) ffc0d914: 83 c1 00 18 lwz r30,24(r1) ffc0d918: 83 e1 00 1c lwz r31,28(r1) ffc0d91c: 38 21 00 20 addi r1,r1,32 ffc0d920: 4e 80 00 20 blr =============================================================================== ffc0f894 <_Watchdog_Adjust>: void _Watchdog_Adjust( Chain_Control *header, Watchdog_Adjust_directions direction, Watchdog_Interval units ) { ffc0f894: 94 21 ff e8 stwu r1,-24(r1) ffc0f898: 7c 08 02 a6 mflr r0 ffc0f89c: 90 01 00 1c stw r0,28(r1) ffc0f8a0: 93 c1 00 10 stw r30,16(r1) ffc0f8a4: 7c 7e 1b 78 mr r30,r3 ffc0f8a8: 93 81 00 08 stw r28,8(r1) ffc0f8ac: 93 a1 00 0c stw r29,12(r1) ffc0f8b0: 93 e1 00 14 stw r31,20(r1) static inline uint32_t ppc_interrupt_disable( void ) { uint32_t level; uint32_t mask; __asm__ volatile ( ffc0f8b4: 7d 40 00 a6 mfmsr r10 ffc0f8b8: 7d 30 42 a6 mfsprg r9,0 ffc0f8bc: 7d 49 48 78 andc r9,r10,r9 ffc0f8c0: 7d 20 01 24 mtmsr r9 */ RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_first( const Chain_Control *the_chain ) { return _Chain_Immutable_head( the_chain )->next; ffc0f8c4: 81 23 00 00 lwz r9,0(r3) RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( const Chain_Control *the_chain ) { return _Chain_Immutable_first( the_chain ) == _Chain_Immutable_tail( the_chain ); ffc0f8c8: 3b a3 00 04 addi r29,r3,4 * hence the compiler must not assume *header to remain * unmodified across that call. * * Till Straumann, 7/2003 */ if ( !_Chain_Is_empty( header ) ) { ffc0f8cc: 7f 89 e8 00 cmpw cr7,r9,r29 ffc0f8d0: 41 9e 00 70 beq- cr7,ffc0f940 <_Watchdog_Adjust+0xac> switch ( direction ) { ffc0f8d4: 2f 84 00 00 cmpwi cr7,r4,0 ffc0f8d8: 7c bf 2b 78 mr r31,r5 ffc0f8dc: 40 9e 00 88 bne- cr7,ffc0f964 <_Watchdog_Adjust+0xd0> case WATCHDOG_BACKWARD: _Watchdog_First( header )->delta_interval += units; break; case WATCHDOG_FORWARD: while ( units ) { ffc0f8e0: 2f 85 00 00 cmpwi cr7,r5,0 ffc0f8e4: 41 9e 00 5c beq- cr7,ffc0f940 <_Watchdog_Adjust+0xac> <== NEVER TAKEN if ( units < _Watchdog_First( header )->delta_interval ) { ffc0f8e8: 81 09 00 10 lwz r8,16(r9) _Watchdog_First( header )->delta_interval -= units; break; } else { units -= _Watchdog_First( header )->delta_interval; _Watchdog_First( header )->delta_interval = 1; ffc0f8ec: 3b 80 00 01 li r28,1 case WATCHDOG_BACKWARD: _Watchdog_First( header )->delta_interval += units; break; case WATCHDOG_FORWARD: while ( units ) { if ( units < _Watchdog_First( header )->delta_interval ) { ffc0f8f0: 7f 85 40 40 cmplw cr7,r5,r8 ffc0f8f4: 40 bc 00 18 bge+ cr7,ffc0f90c <_Watchdog_Adjust+0x78> <== ALWAYS TAKEN ffc0f8f8: 48 00 00 a4 b ffc0f99c <_Watchdog_Adjust+0x108> <== NOT EXECUTED switch ( direction ) { case WATCHDOG_BACKWARD: _Watchdog_First( header )->delta_interval += units; break; case WATCHDOG_FORWARD: while ( units ) { ffc0f8fc: 41 9a 00 44 beq- cr6,ffc0f940 <_Watchdog_Adjust+0xac> <== NEVER TAKEN if ( units < _Watchdog_First( header )->delta_interval ) { ffc0f900: 81 09 00 10 lwz r8,16(r9) ffc0f904: 7f 88 f8 40 cmplw cr7,r8,r31 ffc0f908: 41 9d 00 94 bgt- cr7,ffc0f99c <_Watchdog_Adjust+0x108> _Watchdog_First( header )->delta_interval -= units; break; } else { units -= _Watchdog_First( header )->delta_interval; _Watchdog_First( header )->delta_interval = 1; ffc0f90c: 93 89 00 10 stw r28,16(r9) while ( units ) { if ( units < _Watchdog_First( header )->delta_interval ) { _Watchdog_First( header )->delta_interval -= units; break; } else { units -= _Watchdog_First( header )->delta_interval; ffc0f910: 7f e8 f8 50 subf r31,r8,r31 return level; } static inline void ppc_interrupt_enable( uint32_t level ) { __asm__ volatile ( ffc0f914: 7d 40 01 24 mtmsr r10 _Watchdog_First( header )->delta_interval = 1; _ISR_Enable( level ); _Watchdog_Tickle( header ); ffc0f918: 7f c3 f3 78 mr r3,r30 ffc0f91c: 48 00 03 25 bl ffc0fc40 <_Watchdog_Tickle> static inline uint32_t ppc_interrupt_disable( void ) { uint32_t level; uint32_t mask; __asm__ volatile ( ffc0f920: 7d 40 00 a6 mfmsr r10 ffc0f924: 7d 30 42 a6 mfsprg r9,0 ffc0f928: 7d 49 48 78 andc r9,r10,r9 ffc0f92c: 7d 20 01 24 mtmsr r9 */ RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_first( const Chain_Control *the_chain ) { return _Chain_Immutable_head( the_chain )->next; ffc0f930: 81 3e 00 00 lwz r9,0(r30) switch ( direction ) { case WATCHDOG_BACKWARD: _Watchdog_First( header )->delta_interval += units; break; case WATCHDOG_FORWARD: while ( units ) { ffc0f934: 2f 1f 00 00 cmpwi cr6,r31,0 _Watchdog_Tickle( header ); _ISR_Disable( level ); if ( _Chain_Is_empty( header ) ) ffc0f938: 7f 9d 48 00 cmpw cr7,r29,r9 ffc0f93c: 40 9e ff c0 bne+ cr7,ffc0f8fc <_Watchdog_Adjust+0x68> return level; } static inline void ppc_interrupt_enable( uint32_t level ) { __asm__ volatile ( ffc0f940: 7d 40 01 24 mtmsr r10 } } _ISR_Enable( level ); } ffc0f944: 80 01 00 1c lwz r0,28(r1) ffc0f948: 83 81 00 08 lwz r28,8(r1) ffc0f94c: 7c 08 03 a6 mtlr r0 ffc0f950: 83 a1 00 0c lwz r29,12(r1) ffc0f954: 83 c1 00 10 lwz r30,16(r1) ffc0f958: 83 e1 00 14 lwz r31,20(r1) ffc0f95c: 38 21 00 18 addi r1,r1,24 ffc0f960: 4e 80 00 20 blr * unmodified across that call. * * Till Straumann, 7/2003 */ if ( !_Chain_Is_empty( header ) ) { switch ( direction ) { ffc0f964: 2f 84 00 01 cmpwi cr7,r4,1 ffc0f968: 40 9e ff d8 bne+ cr7,ffc0f940 <_Watchdog_Adjust+0xac> <== NEVER TAKEN case WATCHDOG_BACKWARD: _Watchdog_First( header )->delta_interval += units; ffc0f96c: 81 09 00 10 lwz r8,16(r9) ffc0f970: 7f e8 2a 14 add r31,r8,r5 ffc0f974: 93 e9 00 10 stw r31,16(r9) ffc0f978: 7d 40 01 24 mtmsr r10 } } _ISR_Enable( level ); } ffc0f97c: 80 01 00 1c lwz r0,28(r1) ffc0f980: 83 81 00 08 lwz r28,8(r1) ffc0f984: 7c 08 03 a6 mtlr r0 ffc0f988: 83 a1 00 0c lwz r29,12(r1) ffc0f98c: 83 c1 00 10 lwz r30,16(r1) ffc0f990: 83 e1 00 14 lwz r31,20(r1) ffc0f994: 38 21 00 18 addi r1,r1,24 ffc0f998: 4e 80 00 20 blr _Watchdog_First( header )->delta_interval += units; break; case WATCHDOG_FORWARD: while ( units ) { if ( units < _Watchdog_First( header )->delta_interval ) { _Watchdog_First( header )->delta_interval -= units; ffc0f99c: 7d 1f 40 50 subf r8,r31,r8 ffc0f9a0: 91 09 00 10 stw r8,16(r9) break; ffc0f9a4: 4b ff ff 9c b ffc0f940 <_Watchdog_Adjust+0xac> =============================================================================== ffc22a28 <_Watchdog_Adjust_to_chain>: static inline uint32_t ppc_interrupt_disable( void ) { uint32_t level; uint32_t mask; __asm__ volatile ( ffc22a28: 7d 60 00 a6 mfmsr r11 ffc22a2c: 7d 30 42 a6 mfsprg r9,0 ffc22a30: 7d 69 48 78 andc r9,r11,r9 ffc22a34: 7d 20 01 24 mtmsr r9 { Watchdog_Interval units = units_arg; ISR_Level level; Watchdog_Control *first; _ISR_Disable( level ); ffc22a38: 81 23 00 00 lwz r9,0(r3) ffc22a3c: 38 c3 00 04 addi r6,r3,4 /* * The first set happens in less than units, so take all of them * off the chain and adjust units to reflect this. */ units -= first->delta_interval; first->delta_interval = 0; ffc22a40: 39 80 00 00 li r12,0 ffc22a44: 38 05 00 04 addi r0,r5,4 Watchdog_Control *first; _ISR_Disable( level ); while ( 1 ) { if ( _Chain_Is_empty( header ) ) { ffc22a48: 7f 86 48 00 cmpw cr7,r6,r9 ffc22a4c: 41 9e 00 68 beq- cr7,ffc22ab4 <_Watchdog_Adjust_to_chain+0x8c> /* * If it is longer than "units" until the first element on the chain * fires, then bump it and quit. */ if ( units < first->delta_interval ) { ffc22a50: 81 49 00 10 lwz r10,16(r9) ffc22a54: 7f 84 50 40 cmplw cr7,r4,r10 ffc22a58: 41 9c 00 64 blt- cr7,ffc22abc <_Watchdog_Adjust_to_chain+0x94> /* * The first set happens in less than units, so take all of them * off the chain and adjust units to reflect this. */ units -= first->delta_interval; first->delta_interval = 0; ffc22a5c: 91 89 00 10 stw r12,16(r9) /* * The first set happens in less than units, so take all of them * off the chain and adjust units to reflect this. */ units -= first->delta_interval; ffc22a60: 7c 8a 20 50 subf r4,r10,r4 ) { Chain_Node *next; Chain_Node *previous; next = the_node->next; ffc22a64: 81 49 00 00 lwz r10,0(r9) previous = the_node->previous; ffc22a68: 80 e9 00 04 lwz r7,4(r9) next->previous = previous; ffc22a6c: 90 ea 00 04 stw r7,4(r10) Chain_Control *the_chain, Chain_Node *the_node ) { Chain_Node *tail = _Chain_Tail( the_chain ); Chain_Node *old_last = tail->previous; ffc22a70: 81 05 00 08 lwz r8,8(r5) Chain_Node *previous; next = the_node->next; previous = the_node->previous; next->previous = previous; previous->next = next; ffc22a74: 91 47 00 00 stw r10,0(r7) ) { Chain_Node *tail = _Chain_Tail( the_chain ); Chain_Node *old_last = tail->previous; the_node->next = tail; ffc22a78: 90 09 00 00 stw r0,0(r9) tail->previous = the_node; old_last->next = the_node; ffc22a7c: 91 28 00 00 stw r9,0(r8) { Chain_Node *tail = _Chain_Tail( the_chain ); Chain_Node *old_last = tail->previous; the_node->next = tail; tail->previous = the_node; ffc22a80: 91 25 00 08 stw r9,8(r5) old_last->next = the_node; the_node->previous = old_last; ffc22a84: 91 09 00 04 stw r8,4(r9) static inline void ppc_interrupt_flash( uint32_t level ) { uint32_t current_level; __asm__ volatile ( ffc22a88: 7d 20 00 a6 mfmsr r9 ffc22a8c: 7d 60 01 24 mtmsr r11 ffc22a90: 7d 20 01 24 mtmsr r9 */ RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_first( const Chain_Control *the_chain ) { return _Chain_Immutable_head( the_chain )->next; ffc22a94: 81 23 00 00 lwz r9,0(r3) _Chain_Extract_unprotected( &first->Node ); _Chain_Append_unprotected( to_fire, &first->Node ); _ISR_Flash( level ); if ( _Chain_Is_empty( header ) ) ffc22a98: 7f 86 48 00 cmpw cr7,r6,r9 ffc22a9c: 41 be ff ac beq- cr7,ffc22a48 <_Watchdog_Adjust_to_chain+0x20> break; first = _Watchdog_First( header ); if ( first->delta_interval != 0 ) ffc22aa0: 81 49 00 10 lwz r10,16(r9) ffc22aa4: 2f 8a 00 00 cmpwi cr7,r10,0 ffc22aa8: 41 9e ff bc beq+ cr7,ffc22a64 <_Watchdog_Adjust_to_chain+0x3c> Watchdog_Control *first; _ISR_Disable( level ); while ( 1 ) { if ( _Chain_Is_empty( header ) ) { ffc22aac: 7f 86 48 00 cmpw cr7,r6,r9 ffc22ab0: 40 9e ff a0 bne+ cr7,ffc22a50 <_Watchdog_Adjust_to_chain+0x28><== ALWAYS TAKEN return level; } static inline void ppc_interrupt_enable( uint32_t level ) { __asm__ volatile ( ffc22ab4: 7d 60 01 24 mtmsr r11 ffc22ab8: 4e 80 00 20 blr /* * If it is longer than "units" until the first element on the chain * fires, then bump it and quit. */ if ( units < first->delta_interval ) { first->delta_interval -= units; ffc22abc: 7d 44 50 50 subf r10,r4,r10 ffc22ac0: 91 49 00 10 stw r10,16(r9) ffc22ac4: 7d 60 01 24 mtmsr r11 ffc22ac8: 4e 80 00 20 blr =============================================================================== ffc0d9b0 <_Watchdog_Insert>: Watchdog_Control *after; uint32_t insert_isr_nest_level; Watchdog_Interval delta_interval; insert_isr_nest_level = _ISR_Nest_level; ffc0d9b0: 3d 20 00 00 lis r9,0 ffc0d9b4: 80 c9 2e 08 lwz r6,11784(r9) static inline uint32_t ppc_interrupt_disable( void ) { uint32_t level; uint32_t mask; __asm__ volatile ( ffc0d9b8: 7c e0 00 a6 mfmsr r7 ffc0d9bc: 7d 30 42 a6 mfsprg r9,0 ffc0d9c0: 7c e9 48 78 andc r9,r7,r9 ffc0d9c4: 7d 20 01 24 mtmsr r9 /* * Check to see if the watchdog has just been inserted by a * higher priority interrupt. If so, abandon this insert. */ if ( the_watchdog->state != WATCHDOG_INACTIVE ) { ffc0d9c8: 81 24 00 08 lwz r9,8(r4) ffc0d9cc: 2f 89 00 00 cmpwi cr7,r9,0 ffc0d9d0: 40 9e 01 04 bne- cr7,ffc0dad4 <_Watchdog_Insert+0x124> _ISR_Enable( level ); return; } the_watchdog->state = WATCHDOG_BEING_INSERTED; _Watchdog_Sync_count++; ffc0d9d4: 3d 60 00 00 lis r11,0 ffc0d9d8: 81 2b 28 40 lwz r9,10304(r11) if ( the_watchdog->state != WATCHDOG_INACTIVE ) { _ISR_Enable( level ); return; } the_watchdog->state = WATCHDOG_BEING_INSERTED; ffc0d9dc: 39 40 00 01 li r10,1 ffc0d9e0: 91 44 00 08 stw r10,8(r4) ffc0d9e4: 3d 80 00 00 lis r12,0 _Watchdog_Sync_count++; ffc0d9e8: 39 29 00 01 addi r9,r9,1 ffc0d9ec: 91 2b 28 40 stw r9,10304(r11) restart: delta_interval = the_watchdog->initial; ffc0d9f0: 81 24 00 0c lwz r9,12(r4) */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_First( Chain_Control *the_chain ) { return _Chain_Head( the_chain )->next; ffc0d9f4: 81 43 00 00 lwz r10,0(r3) for ( after = _Watchdog_First( header ) ; ; after = _Watchdog_Next( after ) ) { if ( delta_interval == 0 || !_Watchdog_Next( after ) ) ffc0d9f8: 2f 89 00 00 cmpwi cr7,r9,0 ffc0d9fc: 41 9e 00 98 beq- cr7,ffc0da94 <_Watchdog_Insert+0xe4> ffc0da00: 81 0a 00 00 lwz r8,0(r10) ffc0da04: 2f 88 00 00 cmpwi cr7,r8,0 ffc0da08: 41 9e 00 8c beq- cr7,ffc0da94 <_Watchdog_Insert+0xe4> break; if ( delta_interval < after->delta_interval ) { ffc0da0c: 81 0a 00 10 lwz r8,16(r10) ffc0da10: 7f 89 40 40 cmplw cr7,r9,r8 ffc0da14: 41 9c 00 c8 blt- cr7,ffc0dadc <_Watchdog_Insert+0x12c> after->delta_interval -= delta_interval; break; } delta_interval -= after->delta_interval; ffc0da18: 7d 28 48 50 subf r9,r8,r9 static inline void ppc_interrupt_flash( uint32_t level ) { uint32_t current_level; __asm__ volatile ( ffc0da1c: 7d 00 00 a6 mfmsr r8 ffc0da20: 7c e0 01 24 mtmsr r7 ffc0da24: 7d 00 01 24 mtmsr r8 _ISR_Flash( level ); if ( the_watchdog->state != WATCHDOG_BEING_INSERTED ) { ffc0da28: 81 04 00 08 lwz r8,8(r4) ffc0da2c: 2f 88 00 01 cmpwi cr7,r8,1 ffc0da30: 40 9e 00 94 bne- cr7,ffc0dac4 <_Watchdog_Insert+0x114> goto exit_insert; } if ( _Watchdog_Sync_level > insert_isr_nest_level ) { ffc0da34: 81 0c 28 38 lwz r8,10296(r12) ffc0da38: 38 ac 28 38 addi r5,r12,10296 ffc0da3c: 7f 86 40 40 cmplw cr7,r6,r8 ffc0da40: 40 bc 00 48 bge+ cr7,ffc0da88 <_Watchdog_Insert+0xd8> ffc0da44: 48 00 00 d4 b ffc0db18 <_Watchdog_Insert+0x168> for ( after = _Watchdog_First( header ) ; ; after = _Watchdog_Next( after ) ) { if ( delta_interval == 0 || !_Watchdog_Next( after ) ) ffc0da48: 81 0a 00 00 lwz r8,0(r10) ffc0da4c: 2f 88 00 00 cmpwi cr7,r8,0 ffc0da50: 41 9e 00 44 beq- cr7,ffc0da94 <_Watchdog_Insert+0xe4> break; if ( delta_interval < after->delta_interval ) { ffc0da54: 81 0a 00 10 lwz r8,16(r10) ffc0da58: 7f 88 48 40 cmplw cr7,r8,r9 ffc0da5c: 41 9d 00 80 bgt- cr7,ffc0dadc <_Watchdog_Insert+0x12c> after->delta_interval -= delta_interval; break; } delta_interval -= after->delta_interval; ffc0da60: 7d 28 48 50 subf r9,r8,r9 ffc0da64: 7d 00 00 a6 mfmsr r8 ffc0da68: 7c e0 01 24 mtmsr r7 ffc0da6c: 7d 00 01 24 mtmsr r8 _ISR_Flash( level ); if ( the_watchdog->state != WATCHDOG_BEING_INSERTED ) { ffc0da70: 81 04 00 08 lwz r8,8(r4) ffc0da74: 2f 88 00 01 cmpwi cr7,r8,1 ffc0da78: 40 9e 00 4c bne- cr7,ffc0dac4 <_Watchdog_Insert+0x114> <== NEVER TAKEN goto exit_insert; } if ( _Watchdog_Sync_level > insert_isr_nest_level ) { ffc0da7c: 81 05 00 00 lwz r8,0(r5) ffc0da80: 7f 86 40 40 cmplw cr7,r6,r8 ffc0da84: 41 9c 00 94 blt- cr7,ffc0db18 <_Watchdog_Insert+0x168> <== NEVER TAKEN for ( after = _Watchdog_First( header ) ; ; after = _Watchdog_Next( after ) ) { if ( delta_interval == 0 || !_Watchdog_Next( after ) ) ffc0da88: 2f 89 00 00 cmpwi cr7,r9,0 exit_insert: _Watchdog_Sync_level = insert_isr_nest_level; _Watchdog_Sync_count--; _ISR_Enable( level ); } ffc0da8c: 81 4a 00 00 lwz r10,0(r10) for ( after = _Watchdog_First( header ) ; ; after = _Watchdog_Next( after ) ) { if ( delta_interval == 0 || !_Watchdog_Next( after ) ) ffc0da90: 40 9e ff b8 bne+ cr7,ffc0da48 <_Watchdog_Insert+0x98> _Watchdog_Activate( the_watchdog ); the_watchdog->delta_interval = delta_interval; _Chain_Insert_unprotected( after->Node.previous, &the_watchdog->Node ); ffc0da94: 81 4a 00 04 lwz r10,4(r10) the_watchdog->start_time = _Watchdog_Ticks_since_boot; ffc0da98: 3c a0 00 00 lis r5,0 ffc0da9c: 80 a5 28 44 lwz r5,10308(r5) RTEMS_INLINE_ROUTINE void _Watchdog_Activate( Watchdog_Control *the_watchdog ) { the_watchdog->state = WATCHDOG_ACTIVE; ffc0daa0: 38 60 00 02 li r3,2 ) { Chain_Node *before_node; the_node->previous = after_node; before_node = after_node->next; ffc0daa4: 81 0a 00 00 lwz r8,0(r10) Chain_Node *the_node ) { Chain_Node *before_node; the_node->previous = after_node; ffc0daa8: 91 44 00 04 stw r10,4(r4) ffc0daac: 90 64 00 08 stw r3,8(r4) } } _Watchdog_Activate( the_watchdog ); the_watchdog->delta_interval = delta_interval; ffc0dab0: 91 24 00 10 stw r9,16(r4) before_node = after_node->next; after_node->next = the_node; ffc0dab4: 90 8a 00 00 stw r4,0(r10) the_node->next = before_node; before_node->previous = the_node; ffc0dab8: 90 88 00 04 stw r4,4(r8) Chain_Node *before_node; the_node->previous = after_node; before_node = after_node->next; after_node->next = the_node; the_node->next = before_node; ffc0dabc: 91 04 00 00 stw r8,0(r4) _Chain_Insert_unprotected( after->Node.previous, &the_watchdog->Node ); the_watchdog->start_time = _Watchdog_Ticks_since_boot; ffc0dac0: 90 a4 00 14 stw r5,20(r4) exit_insert: _Watchdog_Sync_level = insert_isr_nest_level; ffc0dac4: 90 cc 28 38 stw r6,10296(r12) _Watchdog_Sync_count--; ffc0dac8: 81 2b 28 40 lwz r9,10304(r11) ffc0dacc: 39 29 ff ff addi r9,r9,-1 ffc0dad0: 91 2b 28 40 stw r9,10304(r11) return level; } static inline void ppc_interrupt_enable( uint32_t level ) { __asm__ volatile ( ffc0dad4: 7c e0 01 24 mtmsr r7 ffc0dad8: 4e 80 00 20 blr if ( delta_interval == 0 || !_Watchdog_Next( after ) ) break; if ( delta_interval < after->delta_interval ) { after->delta_interval -= delta_interval; ffc0dadc: 7d 09 40 50 subf r8,r9,r8 ffc0dae0: 91 0a 00 10 stw r8,16(r10) the_watchdog->delta_interval = delta_interval; _Chain_Insert_unprotected( after->Node.previous, &the_watchdog->Node ); the_watchdog->start_time = _Watchdog_Ticks_since_boot; ffc0dae4: 3c a0 00 00 lis r5,0 ffc0dae8: 38 60 00 02 li r3,2 _Watchdog_Activate( the_watchdog ); the_watchdog->delta_interval = delta_interval; _Chain_Insert_unprotected( after->Node.previous, &the_watchdog->Node ); ffc0daec: 81 4a 00 04 lwz r10,4(r10) the_watchdog->start_time = _Watchdog_Ticks_since_boot; ffc0daf0: 80 a5 28 44 lwz r5,10308(r5) ) { Chain_Node *before_node; the_node->previous = after_node; before_node = after_node->next; ffc0daf4: 81 0a 00 00 lwz r8,0(r10) Chain_Node *the_node ) { Chain_Node *before_node; the_node->previous = after_node; ffc0daf8: 91 44 00 04 stw r10,4(r4) ffc0dafc: 90 64 00 08 stw r3,8(r4) } } _Watchdog_Activate( the_watchdog ); the_watchdog->delta_interval = delta_interval; ffc0db00: 91 24 00 10 stw r9,16(r4) before_node = after_node->next; after_node->next = the_node; ffc0db04: 90 8a 00 00 stw r4,0(r10) the_node->next = before_node; before_node->previous = the_node; ffc0db08: 90 88 00 04 stw r4,4(r8) Chain_Node *before_node; the_node->previous = after_node; before_node = after_node->next; after_node->next = the_node; the_node->next = before_node; ffc0db0c: 91 04 00 00 stw r8,0(r4) _Chain_Insert_unprotected( after->Node.previous, &the_watchdog->Node ); the_watchdog->start_time = _Watchdog_Ticks_since_boot; ffc0db10: 90 a4 00 14 stw r5,20(r4) ffc0db14: 4b ff ff b0 b ffc0dac4 <_Watchdog_Insert+0x114> if ( the_watchdog->state != WATCHDOG_BEING_INSERTED ) { goto exit_insert; } if ( _Watchdog_Sync_level > insert_isr_nest_level ) { _Watchdog_Sync_level = insert_isr_nest_level; ffc0db18: 90 cc 28 38 stw r6,10296(r12) goto restart; ffc0db1c: 4b ff fe d4 b ffc0d9f0 <_Watchdog_Insert+0x40> =============================================================================== ffc0db78 <_Watchdog_Remove>: static inline uint32_t ppc_interrupt_disable( void ) { uint32_t level; uint32_t mask; __asm__ volatile ( ffc0db78: 7d 40 00 a6 mfmsr r10 ffc0db7c: 7d 30 42 a6 mfsprg r9,0 ffc0db80: 7d 49 48 78 andc r9,r10,r9 ffc0db84: 7d 20 01 24 mtmsr r9 ISR_Level level; Watchdog_States previous_state; Watchdog_Control *next_watchdog; _ISR_Disable( level ); previous_state = the_watchdog->state; ffc0db88: 81 23 00 08 lwz r9,8(r3) switch ( previous_state ) { ffc0db8c: 2f 89 00 01 cmpwi cr7,r9,1 ffc0db90: 41 9e 00 98 beq- cr7,ffc0dc28 <_Watchdog_Remove+0xb0> ffc0db94: 2b 89 00 01 cmplwi cr7,r9,1 ffc0db98: 40 9c 00 1c bge- cr7,ffc0dbb4 <_Watchdog_Remove+0x3c> _Watchdog_Sync_level = _ISR_Nest_level; _Chain_Extract_unprotected( &the_watchdog->Node ); break; } the_watchdog->stop_time = _Watchdog_Ticks_since_boot; ffc0db9c: 3d 00 00 00 lis r8,0 ffc0dba0: 81 08 28 44 lwz r8,10308(r8) ffc0dba4: 91 03 00 18 stw r8,24(r3) return level; } static inline void ppc_interrupt_enable( uint32_t level ) { __asm__ volatile ( ffc0dba8: 7d 40 01 24 mtmsr r10 _ISR_Enable( level ); return( previous_state ); } ffc0dbac: 7d 23 4b 78 mr r3,r9 ffc0dbb0: 4e 80 00 20 blr Watchdog_States previous_state; Watchdog_Control *next_watchdog; _ISR_Disable( level ); previous_state = the_watchdog->state; switch ( previous_state ) { ffc0dbb4: 2b 89 00 03 cmplwi cr7,r9,3 ffc0dbb8: 41 bd ff e4 bgt- cr7,ffc0db9c <_Watchdog_Remove+0x24> <== NEVER TAKEN break; case WATCHDOG_ACTIVE: case WATCHDOG_REMOVE_IT: the_watchdog->state = WATCHDOG_INACTIVE; ffc0dbbc: 39 00 00 00 li r8,0 ffc0dbc0: 91 03 00 08 stw r8,8(r3) } the_watchdog->stop_time = _Watchdog_Ticks_since_boot; _ISR_Enable( level ); return( previous_state ); } ffc0dbc4: 81 03 00 00 lwz r8,0(r3) case WATCHDOG_REMOVE_IT: the_watchdog->state = WATCHDOG_INACTIVE; next_watchdog = _Watchdog_Next( the_watchdog ); if ( _Watchdog_Next(next_watchdog) ) ffc0dbc8: 80 e8 00 00 lwz r7,0(r8) ffc0dbcc: 2f 87 00 00 cmpwi cr7,r7,0 ffc0dbd0: 41 9e 00 14 beq- cr7,ffc0dbe4 <_Watchdog_Remove+0x6c> next_watchdog->delta_interval += the_watchdog->delta_interval; ffc0dbd4: 80 c8 00 10 lwz r6,16(r8) ffc0dbd8: 80 e3 00 10 lwz r7,16(r3) ffc0dbdc: 7c e6 3a 14 add r7,r6,r7 ffc0dbe0: 90 e8 00 10 stw r7,16(r8) if ( _Watchdog_Sync_count ) ffc0dbe4: 3c e0 00 00 lis r7,0 ffc0dbe8: 80 e7 28 40 lwz r7,10304(r7) ffc0dbec: 2f 87 00 00 cmpwi cr7,r7,0 ffc0dbf0: 41 9e 00 14 beq- cr7,ffc0dc04 <_Watchdog_Remove+0x8c> _Watchdog_Sync_level = _ISR_Nest_level; ffc0dbf4: 3c e0 00 00 lis r7,0 ffc0dbf8: 80 c7 2e 08 lwz r6,11784(r7) ffc0dbfc: 3c e0 00 00 lis r7,0 ffc0dc00: 90 c7 28 38 stw r6,10296(r7) { Chain_Node *next; Chain_Node *previous; next = the_node->next; previous = the_node->previous; ffc0dc04: 80 e3 00 04 lwz r7,4(r3) next->previous = previous; ffc0dc08: 90 e8 00 04 stw r7,4(r8) previous->next = next; ffc0dc0c: 91 07 00 00 stw r8,0(r7) _Chain_Extract_unprotected( &the_watchdog->Node ); break; } the_watchdog->stop_time = _Watchdog_Ticks_since_boot; ffc0dc10: 3d 00 00 00 lis r8,0 ffc0dc14: 81 08 28 44 lwz r8,10308(r8) ffc0dc18: 91 03 00 18 stw r8,24(r3) ffc0dc1c: 7d 40 01 24 mtmsr r10 _ISR_Enable( level ); return( previous_state ); } ffc0dc20: 7d 23 4b 78 mr r3,r9 ffc0dc24: 4e 80 00 20 blr /* * It is not actually on the chain so just change the state and * the Insert operation we interrupted will be aborted. */ the_watchdog->state = WATCHDOG_INACTIVE; ffc0dc28: 39 00 00 00 li r8,0 ffc0dc2c: 91 03 00 08 stw r8,8(r3) _Watchdog_Sync_level = _ISR_Nest_level; _Chain_Extract_unprotected( &the_watchdog->Node ); break; } the_watchdog->stop_time = _Watchdog_Ticks_since_boot; ffc0dc30: 3d 00 00 00 lis r8,0 ffc0dc34: 81 08 28 44 lwz r8,10308(r8) ffc0dc38: 91 03 00 18 stw r8,24(r3) ffc0dc3c: 7d 40 01 24 mtmsr r10 _ISR_Enable( level ); return( previous_state ); } ffc0dc40: 7d 23 4b 78 mr r3,r9 ffc0dc44: 4e 80 00 20 blr =============================================================================== ffc0f0f0 <_Watchdog_Report_chain>: void _Watchdog_Report_chain( const char *name, Chain_Control *header ) { ffc0f0f0: 94 21 ff e8 stwu r1,-24(r1) ffc0f0f4: 7c 08 02 a6 mflr r0 ffc0f0f8: 93 a1 00 0c stw r29,12(r1) ffc0f0fc: 7c 7d 1b 78 mr r29,r3 ffc0f100: 93 c1 00 10 stw r30,16(r1) ffc0f104: 7c 9e 23 78 mr r30,r4 ffc0f108: 90 01 00 1c stw r0,28(r1) ffc0f10c: 93 81 00 08 stw r28,8(r1) ffc0f110: 93 e1 00 14 stw r31,20(r1) static inline uint32_t ppc_interrupt_disable( void ) { uint32_t level; uint32_t mask; __asm__ volatile ( ffc0f114: 7f 80 00 a6 mfmsr r28 ffc0f118: 7d 30 42 a6 mfsprg r9,0 ffc0f11c: 7f 89 48 78 andc r9,r28,r9 ffc0f120: 7d 20 01 24 mtmsr r9 ISR_Level level; Chain_Node *node; _ISR_Disable( level ); printk( "Watchdog Chain: %s %p\n", name, header ); ffc0f124: 3c 60 ff c2 lis r3,-62 ffc0f128: 7f c5 f3 78 mr r5,r30 ffc0f12c: 38 63 0b 60 addi r3,r3,2912 ffc0f130: 7f a4 eb 78 mr r4,r29 ffc0f134: 4c c6 31 82 crclr 4*cr1+eq ffc0f138: 4b ff 76 6d bl ffc067a4 */ RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_first( const Chain_Control *the_chain ) { return _Chain_Immutable_head( the_chain )->next; ffc0f13c: 83 fe 00 00 lwz r31,0(r30) RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( const Chain_Control *the_chain ) { return _Chain_Immutable_first( the_chain ) == _Chain_Immutable_tail( the_chain ); ffc0f140: 3b de 00 04 addi r30,r30,4 if ( !_Chain_Is_empty( header ) ) { ffc0f144: 7f 9f f0 00 cmpw cr7,r31,r30 ffc0f148: 41 9e 00 54 beq- cr7,ffc0f19c <_Watchdog_Report_chain+0xac> node != _Chain_Tail(header) ; node = node->next ) { Watchdog_Control *watch = (Watchdog_Control *) node; _Watchdog_Report( NULL, watch ); ffc0f14c: 7f e4 fb 78 mr r4,r31 ffc0f150: 38 60 00 00 li r3,0 ffc0f154: 48 00 00 5d bl ffc0f1b0 <_Watchdog_Report> _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 ) ffc0f158: 83 ff 00 00 lwz r31,0(r31) Chain_Node *node; _ISR_Disable( level ); printk( "Watchdog Chain: %s %p\n", name, header ); if ( !_Chain_Is_empty( header ) ) { for ( node = _Chain_First( header ) ; ffc0f15c: 7f 9f f0 00 cmpw cr7,r31,r30 ffc0f160: 40 9e ff ec bne+ cr7,ffc0f14c <_Watchdog_Report_chain+0x5c><== NEVER TAKEN { Watchdog_Control *watch = (Watchdog_Control *) node; _Watchdog_Report( NULL, watch ); } printk( "== end of %s \n", name ); ffc0f164: 3c 60 ff c2 lis r3,-62 ffc0f168: 38 63 0b 78 addi r3,r3,2936 ffc0f16c: 7f a4 eb 78 mr r4,r29 ffc0f170: 4c c6 31 82 crclr 4*cr1+eq ffc0f174: 4b ff 76 31 bl ffc067a4 return level; } static inline void ppc_interrupt_enable( uint32_t level ) { __asm__ volatile ( ffc0f178: 7f 80 01 24 mtmsr r28 } else { printk( "Chain is empty\n" ); } _ISR_Enable( level ); } ffc0f17c: 80 01 00 1c lwz r0,28(r1) ffc0f180: 83 81 00 08 lwz r28,8(r1) ffc0f184: 7c 08 03 a6 mtlr r0 ffc0f188: 83 a1 00 0c lwz r29,12(r1) ffc0f18c: 83 c1 00 10 lwz r30,16(r1) ffc0f190: 83 e1 00 14 lwz r31,20(r1) ffc0f194: 38 21 00 18 addi r1,r1,24 ffc0f198: 4e 80 00 20 blr _Watchdog_Report( NULL, watch ); } printk( "== end of %s \n", name ); } else { printk( "Chain is empty\n" ); ffc0f19c: 3c 60 ff c2 lis r3,-62 ffc0f1a0: 38 63 0b 88 addi r3,r3,2952 ffc0f1a4: 4c c6 31 82 crclr 4*cr1+eq ffc0f1a8: 4b ff 75 fd bl ffc067a4 ffc0f1ac: 4b ff ff cc b ffc0f178 <_Watchdog_Report_chain+0x88> =============================================================================== ffc0dc48 <_Watchdog_Tickle>: #include void _Watchdog_Tickle( Chain_Control *header ) { ffc0dc48: 94 21 ff e8 stwu r1,-24(r1) ffc0dc4c: 7c 08 02 a6 mflr r0 ffc0dc50: 90 01 00 1c stw r0,28(r1) ffc0dc54: 93 a1 00 0c stw r29,12(r1) ffc0dc58: 7c 7d 1b 78 mr r29,r3 ffc0dc5c: 93 81 00 08 stw r28,8(r1) ffc0dc60: 93 c1 00 10 stw r30,16(r1) ffc0dc64: 93 e1 00 14 stw r31,20(r1) static inline uint32_t ppc_interrupt_disable( void ) { uint32_t level; uint32_t mask; __asm__ volatile ( ffc0dc68: 7f c0 00 a6 mfmsr r30 ffc0dc6c: 7d 30 42 a6 mfsprg r9,0 ffc0dc70: 7f c9 48 78 andc r9,r30,r9 ffc0dc74: 7d 20 01 24 mtmsr r9 */ RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_first( const Chain_Control *the_chain ) { return _Chain_Immutable_head( the_chain )->next; ffc0dc78: 83 e3 00 00 lwz r31,0(r3) RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( const Chain_Control *the_chain ) { return _Chain_Immutable_first( the_chain ) == _Chain_Immutable_tail( the_chain ); ffc0dc7c: 3b 83 00 04 addi r28,r3,4 * volatile data - till, 2003/7 */ _ISR_Disable( level ); if ( _Chain_Is_empty( header ) ) ffc0dc80: 7f 9f e0 00 cmpw cr7,r31,r28 ffc0dc84: 41 9e 00 20 beq- cr7,ffc0dca4 <_Watchdog_Tickle+0x5c> * 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) { ffc0dc88: 81 3f 00 10 lwz r9,16(r31) ffc0dc8c: 2f 89 00 00 cmpwi cr7,r9,0 ffc0dc90: 41 9e 00 74 beq- cr7,ffc0dd04 <_Watchdog_Tickle+0xbc> <== NEVER TAKEN the_watchdog->delta_interval--; ffc0dc94: 39 29 ff ff addi r9,r9,-1 if ( the_watchdog->delta_interval != 0 ) ffc0dc98: 2f 89 00 00 cmpwi cr7,r9,0 * 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) { the_watchdog->delta_interval--; ffc0dc9c: 91 3f 00 10 stw r9,16(r31) if ( the_watchdog->delta_interval != 0 ) ffc0dca0: 41 be 00 64 beq+ cr7,ffc0dd04 <_Watchdog_Tickle+0xbc> return level; } static inline void ppc_interrupt_enable( uint32_t level ) { __asm__ volatile ( ffc0dca4: 7f c0 01 24 mtmsr r30 } while ( !_Chain_Is_empty( header ) && (the_watchdog->delta_interval == 0) ); leave: _ISR_Enable(level); } ffc0dca8: 80 01 00 1c lwz r0,28(r1) ffc0dcac: 83 81 00 08 lwz r28,8(r1) ffc0dcb0: 7c 08 03 a6 mtlr r0 ffc0dcb4: 83 a1 00 0c lwz r29,12(r1) ffc0dcb8: 83 c1 00 10 lwz r30,16(r1) ffc0dcbc: 83 e1 00 14 lwz r31,20(r1) ffc0dcc0: 38 21 00 18 addi r1,r1,24 ffc0dcc4: 4e 80 00 20 blr _ISR_Enable( level ); switch( watchdog_state ) { case WATCHDOG_ACTIVE: (*the_watchdog->routine)( ffc0dcc8: 81 3f 00 1c lwz r9,28(r31) ffc0dccc: 80 7f 00 20 lwz r3,32(r31) ffc0dcd0: 80 9f 00 24 lwz r4,36(r31) ffc0dcd4: 7d 29 03 a6 mtctr r9 ffc0dcd8: 4e 80 04 21 bctrl static inline uint32_t ppc_interrupt_disable( void ) { uint32_t level; uint32_t mask; __asm__ volatile ( ffc0dcdc: 7f c0 00 a6 mfmsr r30 ffc0dce0: 7d 30 42 a6 mfsprg r9,0 ffc0dce4: 7f c9 48 78 andc r9,r30,r9 ffc0dce8: 7d 20 01 24 mtmsr r9 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_First( Chain_Control *the_chain ) { return _Chain_Head( the_chain )->next; ffc0dcec: 83 fd 00 00 lwz r31,0(r29) _ISR_Disable( level ); the_watchdog = _Watchdog_First( header ); } while ( !_Chain_Is_empty( header ) && (the_watchdog->delta_interval == 0) ); ffc0dcf0: 7f 9c f8 00 cmpw cr7,r28,r31 ffc0dcf4: 41 be ff b0 beq- cr7,ffc0dca4 <_Watchdog_Tickle+0x5c> } _ISR_Disable( level ); the_watchdog = _Watchdog_First( header ); } while ( !_Chain_Is_empty( header ) && ffc0dcf8: 81 3f 00 10 lwz r9,16(r31) ffc0dcfc: 2f 89 00 00 cmpwi cr7,r9,0 ffc0dd00: 40 be ff a4 bne- cr7,ffc0dca4 <_Watchdog_Tickle+0x5c> if ( the_watchdog->delta_interval != 0 ) goto leave; } do { watchdog_state = _Watchdog_Remove( the_watchdog ); ffc0dd04: 7f e3 fb 78 mr r3,r31 ffc0dd08: 4b ff fe 71 bl ffc0db78 <_Watchdog_Remove> return level; } static inline void ppc_interrupt_enable( uint32_t level ) { __asm__ volatile ( ffc0dd0c: 7f c0 01 24 mtmsr r30 _ISR_Enable( level ); switch( watchdog_state ) { ffc0dd10: 2f 83 00 02 cmpwi cr7,r3,2 ffc0dd14: 40 9e ff c8 bne+ cr7,ffc0dcdc <_Watchdog_Tickle+0x94> ffc0dd18: 4b ff ff b0 b ffc0dcc8 <_Watchdog_Tickle+0x80> =============================================================================== ffc0dd1c <_Workspace_Handler_initialization>: 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(); ffc0dd1c: 3d 40 ff c2 lis r10,-62 void _Workspace_Handler_initialization( Heap_Area *areas, size_t area_count, Heap_Initialization_or_extend_handler extend ) { ffc0dd20: 7d 80 00 26 mfcr r12 Heap_Initialization_or_extend_handler init_or_extend = _Heap_Initialize; uintptr_t remaining = rtems_configuration_get_work_space_size(); ffc0dd24: 39 2a d5 38 addi r9,r10,-10952 void _Workspace_Handler_initialization( Heap_Area *areas, size_t area_count, Heap_Initialization_or_extend_handler extend ) { ffc0dd28: 94 21 ff d0 stwu r1,-48(r1) ffc0dd2c: 7c 08 02 a6 mflr r0 Heap_Initialization_or_extend_handler init_or_extend = _Heap_Initialize; uintptr_t remaining = rtems_configuration_get_work_space_size(); ffc0dd30: 89 09 00 32 lbz r8,50(r9) void _Workspace_Handler_initialization( Heap_Area *areas, size_t area_count, Heap_Initialization_or_extend_handler extend ) { ffc0dd34: 93 21 00 14 stw r25,20(r1) ffc0dd38: 7c b9 2b 78 mr r25,r5 Heap_Initialization_or_extend_handler init_or_extend = _Heap_Initialize; uintptr_t remaining = rtems_configuration_get_work_space_size(); ffc0dd3c: 2f 88 00 00 cmpwi cr7,r8,0 void _Workspace_Handler_initialization( Heap_Area *areas, size_t area_count, Heap_Initialization_or_extend_handler extend ) { ffc0dd40: 93 61 00 1c stw r27,28(r1) ffc0dd44: 7c 9b 23 78 mr r27,r4 ffc0dd48: 93 81 00 20 stw r28,32(r1) ffc0dd4c: 90 01 00 34 stw r0,52(r1) Heap_Initialization_or_extend_handler init_or_extend = _Heap_Initialize; uintptr_t remaining = rtems_configuration_get_work_space_size(); ffc0dd50: 83 8a d5 38 lwz r28,-10952(r10) ffc0dd54: 39 40 00 00 li r10,0 void _Workspace_Handler_initialization( Heap_Area *areas, size_t area_count, Heap_Initialization_or_extend_handler extend ) { ffc0dd58: 93 01 00 10 stw r24,16(r1) ffc0dd5c: 93 41 00 18 stw r26,24(r1) ffc0dd60: 93 a1 00 24 stw r29,36(r1) ffc0dd64: 93 c1 00 28 stw r30,40(r1) ffc0dd68: 93 e1 00 2c stw r31,44(r1) ffc0dd6c: 91 81 00 0c stw r12,12(r1) Heap_Initialization_or_extend_handler init_or_extend = _Heap_Initialize; uintptr_t remaining = rtems_configuration_get_work_space_size(); ffc0dd70: 40 9e 00 08 bne- cr7,ffc0dd78 <_Workspace_Handler_initialization+0x5c> ffc0dd74: 81 49 00 04 lwz r10,4(r9) 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) { ffc0dd78: 2f 9b 00 00 cmpwi cr7,r27,0 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(); ffc0dd7c: 7f 8a e2 14 add r28,r10,r28 bool do_zero = rtems_configuration_get_do_zero_of_workspace(); ffc0dd80: 89 49 00 30 lbz r10,48(r9) bool unified = rtems_configuration_get_unified_work_area(); ffc0dd84: 89 29 00 31 lbz r9,49(r9) 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) { ffc0dd88: 41 9e 00 a0 beq- cr7,ffc0de28 <_Workspace_Handler_initialization+0x10c><== NEVER TAKEN ffc0dd8c: 2e 0a 00 00 cmpwi cr4,r10,0 if ( area->size > overhead ) { uintptr_t space_available; uintptr_t size; if ( unified ) { ffc0dd90: 2d 89 00 00 cmpwi cr3,r9,0 Heap_Area *areas, size_t area_count, Heap_Initialization_or_extend_handler extend ) { Heap_Initialization_or_extend_handler init_or_extend = _Heap_Initialize; ffc0dd94: 3f 40 ff c1 lis r26,-63 } else { size = 0; } } space_available = (*init_or_extend)( ffc0dd98: 3f 00 00 00 lis r24,0 ffc0dd9c: 7c 7f 1b 78 mr r31,r3 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) { ffc0dda0: 3b a0 00 00 li r29,0 Heap_Area *areas, size_t area_count, Heap_Initialization_or_extend_handler extend ) { Heap_Initialization_or_extend_handler init_or_extend = _Heap_Initialize; ffc0dda4: 3b 5a b0 08 addi r26,r26,-20472 } else { size = 0; } } space_available = (*init_or_extend)( ffc0dda8: 3b 18 2c 94 addi r24,r24,11412 size_t i; for (i = 0; i < area_count; ++i) { Heap_Area *area = &areas [i]; if ( do_zero ) { ffc0ddac: 40 92 00 bc bne- cr4,ffc0de68 <_Workspace_Handler_initialization+0x14c> memset( area->begin, 0, area->size ); } if ( area->size > overhead ) { ffc0ddb0: 83 df 00 04 lwz r30,4(r31) ffc0ddb4: 2b 9e 00 16 cmplwi cr7,r30,22 ffc0ddb8: 40 9d 00 60 ble- cr7,ffc0de18 <_Workspace_Handler_initialization+0xfc> uintptr_t space_available; uintptr_t size; if ( unified ) { ffc0ddbc: 40 8e 00 1c bne- cr3,ffc0ddd8 <_Workspace_Handler_initialization+0xbc> size = area->size; } else { if ( remaining > 0 ) { ffc0ddc0: 2f 9c 00 00 cmpwi cr7,r28,0 ffc0ddc4: 41 9e 00 b8 beq- cr7,ffc0de7c <_Workspace_Handler_initialization+0x160><== NEVER TAKEN size = remaining < area->size - overhead ? ffc0ddc8: 39 3e ff ea addi r9,r30,-22 remaining + overhead : area->size; ffc0ddcc: 7f 89 e0 40 cmplw cr7,r9,r28 ffc0ddd0: 40 9d 00 08 ble- cr7,ffc0ddd8 <_Workspace_Handler_initialization+0xbc><== NEVER TAKEN ffc0ddd4: 3b dc 00 16 addi r30,r28,22 } else { size = 0; } } space_available = (*init_or_extend)( ffc0ddd8: 7f c5 f3 78 mr r5,r30 ffc0dddc: 80 9f 00 00 lwz r4,0(r31) ffc0dde0: 7f 03 c3 78 mr r3,r24 ffc0dde4: 7f 49 03 a6 mtctr r26 ffc0dde8: 38 c0 00 08 li r6,8 ffc0ddec: 4e 80 04 21 bctrl area->begin, size, page_size ); area->begin = (char *) area->begin + size; ffc0ddf0: 81 5f 00 00 lwz r10,0(r31) area->size -= size; if ( space_available < remaining ) { ffc0ddf4: 7f 83 e0 40 cmplw cr7,r3,r28 size, page_size ); area->begin = (char *) area->begin + size; area->size -= size; ffc0ddf8: 81 3f 00 04 lwz r9,4(r31) area->begin, size, page_size ); area->begin = (char *) area->begin + size; ffc0ddfc: 7d 4a f2 14 add r10,r10,r30 area->size -= size; ffc0de00: 7f de 48 50 subf r30,r30,r9 area->begin, size, page_size ); area->begin = (char *) area->begin + size; ffc0de04: 91 5f 00 00 stw r10,0(r31) area->size -= size; ffc0de08: 93 df 00 04 stw r30,4(r31) if ( space_available < remaining ) { ffc0de0c: 40 9c 00 90 bge- cr7,ffc0de9c <_Workspace_Handler_initialization+0x180><== ALWAYS TAKEN remaining -= space_available; ffc0de10: 7f 83 e0 50 subf r28,r3,r28 <== NOT EXECUTED } else { remaining = 0; } init_or_extend = extend; ffc0de14: 7f 3a cb 78 mr r26,r25 <== NOT EXECUTED 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) { ffc0de18: 3b bd 00 01 addi r29,r29,1 ffc0de1c: 7f 9d d8 00 cmpw cr7,r29,r27 ffc0de20: 3b ff 00 08 addi r31,r31,8 ffc0de24: 40 9e ff 88 bne+ cr7,ffc0ddac <_Workspace_Handler_initialization+0x90><== NEVER TAKEN init_or_extend = extend; } } if ( remaining > 0 ) { ffc0de28: 2f 9c 00 00 cmpwi cr7,r28,0 ffc0de2c: 40 9e 00 7c bne- cr7,ffc0dea8 <_Workspace_Handler_initialization+0x18c> INTERNAL_ERROR_CORE, true, INTERNAL_ERROR_TOO_LITTLE_WORKSPACE ); } } ffc0de30: 80 01 00 34 lwz r0,52(r1) ffc0de34: 81 81 00 0c lwz r12,12(r1) ffc0de38: 7c 08 03 a6 mtlr r0 ffc0de3c: 83 01 00 10 lwz r24,16(r1) ffc0de40: 83 21 00 14 lwz r25,20(r1) ffc0de44: 7d 81 81 20 mtcrf 24,r12 ffc0de48: 83 41 00 18 lwz r26,24(r1) ffc0de4c: 83 61 00 1c lwz r27,28(r1) ffc0de50: 83 81 00 20 lwz r28,32(r1) ffc0de54: 83 a1 00 24 lwz r29,36(r1) ffc0de58: 83 c1 00 28 lwz r30,40(r1) ffc0de5c: 83 e1 00 2c lwz r31,44(r1) ffc0de60: 38 21 00 30 addi r1,r1,48 ffc0de64: 4e 80 00 20 blr for (i = 0; i < area_count; ++i) { Heap_Area *area = &areas [i]; if ( do_zero ) { memset( area->begin, 0, area->size ); ffc0de68: 80 7f 00 00 lwz r3,0(r31) ffc0de6c: 38 80 00 00 li r4,0 ffc0de70: 80 bf 00 04 lwz r5,4(r31) ffc0de74: 48 00 4f fd bl ffc12e70 ffc0de78: 4b ff ff 38 b ffc0ddb0 <_Workspace_Handler_initialization+0x94> } else { size = 0; } } space_available = (*init_or_extend)( ffc0de7c: 7f 49 03 a6 mtctr r26 <== NOT EXECUTED ffc0de80: 7f 03 c3 78 mr r3,r24 <== NOT EXECUTED ffc0de84: 80 9f 00 00 lwz r4,0(r31) <== NOT EXECUTED ffc0de88: 38 a0 00 00 li r5,0 <== NOT EXECUTED ffc0de8c: 38 c0 00 08 li r6,8 <== NOT EXECUTED remaining -= space_available; } else { remaining = 0; } init_or_extend = extend; ffc0de90: 7f 3a cb 78 mr r26,r25 <== NOT EXECUTED } else { size = 0; } } space_available = (*init_or_extend)( ffc0de94: 4e 80 04 21 bctrl <== NOT EXECUTED ffc0de98: 4b ff ff 80 b ffc0de18 <_Workspace_Handler_initialization+0xfc><== NOT EXECUTED remaining -= space_available; } else { remaining = 0; } init_or_extend = extend; ffc0de9c: 7f 3a cb 78 mr r26,r25 area->size -= size; if ( space_available < remaining ) { remaining -= space_available; } else { remaining = 0; ffc0dea0: 3b 80 00 00 li r28,0 ffc0dea4: 4b ff ff 74 b ffc0de18 <_Workspace_Handler_initialization+0xfc> init_or_extend = extend; } } if ( remaining > 0 ) { _Internal_error_Occurred( ffc0dea8: 38 60 00 00 li r3,0 ffc0deac: 38 80 00 01 li r4,1 ffc0deb0: 38 a0 00 02 li r5,2 ffc0deb4: 4b ff d4 65 bl ffc0b318 <_Internal_error_Occurred> =============================================================================== ffc0d864 <_Workspace_String_duplicate>: char *_Workspace_String_duplicate( const char *string, size_t len ) { ffc0d864: 94 21 ff e8 stwu r1,-24(r1) ffc0d868: 7c 08 02 a6 mflr r0 ffc0d86c: 93 a1 00 0c stw r29,12(r1) ffc0d870: 7c 7d 1b 78 mr r29,r3 char *dup = _Workspace_Allocate(len + 1); ffc0d874: 38 64 00 01 addi r3,r4,1 char *_Workspace_String_duplicate( const char *string, size_t len ) { ffc0d878: 93 c1 00 10 stw r30,16(r1) ffc0d87c: 93 e1 00 14 stw r31,20(r1) ffc0d880: 7c 9f 23 78 mr r31,r4 ffc0d884: 90 01 00 1c stw r0,28(r1) char *dup = _Workspace_Allocate(len + 1); ffc0d888: 4b ff ff 6d bl ffc0d7f4 <_Workspace_Allocate> if (dup != NULL) { ffc0d88c: 7c 7e 1b 79 mr. r30,r3 ffc0d890: 41 82 00 18 beq- ffc0d8a8 <_Workspace_String_duplicate+0x44><== NEVER TAKEN dup [len] = '\0'; ffc0d894: 39 20 00 00 li r9,0 ffc0d898: 7d 3e f9 ae stbx r9,r30,r31 memcpy(dup, string, len); ffc0d89c: 7f a4 eb 78 mr r4,r29 ffc0d8a0: 7f e5 fb 78 mr r5,r31 ffc0d8a4: 48 00 4d 19 bl ffc125bc } return dup; } ffc0d8a8: 80 01 00 1c lwz r0,28(r1) ffc0d8ac: 7f c3 f3 78 mr r3,r30 ffc0d8b0: 83 a1 00 0c lwz r29,12(r1) ffc0d8b4: 7c 08 03 a6 mtlr r0 ffc0d8b8: 83 c1 00 10 lwz r30,16(r1) ffc0d8bc: 83 e1 00 14 lwz r31,20(r1) ffc0d8c0: 38 21 00 18 addi r1,r1,24 ffc0d8c4: 4e 80 00 20 blr =============================================================================== ffc1cc98 <__kill>: #endif int __kill( pid_t pid, int sig ) { return 0; } ffc1cc98: 38 60 00 00 li r3,0 <== NOT EXECUTED ffc1cc9c: 4e 80 00 20 blr <== NOT EXECUTED =============================================================================== ffc1719c <_fat_block_read>: uint32_t start, uint32_t offset, uint32_t count, void *buff ) { ffc1719c: 94 21 ff c8 stwu r1,-56(r1) ffc171a0: 7c 08 02 a6 mflr r0 ffc171a4: 93 c1 00 30 stw r30,48(r1) uint32_t sec_num = start; uint32_t ofs = offset; uint8_t *sec_buf; uint32_t c = 0; while (count > 0) ffc171a8: 7c de 33 79 mr. r30,r6 uint32_t start, uint32_t offset, uint32_t count, void *buff ) { ffc171ac: 90 01 00 3c stw r0,60(r1) ffc171b0: 93 21 00 1c stw r25,28(r1) ffc171b4: 93 41 00 20 stw r26,32(r1) ffc171b8: 93 61 00 24 stw r27,36(r1) ffc171bc: 93 81 00 28 stw r28,40(r1) ffc171c0: 93 a1 00 2c stw r29,44(r1) ffc171c4: 93 e1 00 34 stw r31,52(r1) uint32_t sec_num = start; uint32_t ofs = offset; uint8_t *sec_buf; uint32_t c = 0; while (count > 0) ffc171c8: 41 82 00 a8 beq- ffc17270 <_fat_block_read+0xd4> <== NEVER TAKEN ffc171cc: 7c 7a 1b 78 mr r26,r3 ffc171d0: 7c f9 3b 78 mr r25,r7 ffc171d4: 7c bb 2b 78 mr r27,r5 ffc171d8: 7c 9c 23 78 mr r28,r4 ffc171dc: 3b a0 00 00 li r29,0 ffc171e0: 48 00 00 38 b ffc17218 <_fat_block_read+0x7c> { rc = fat_buf_access(fs_info, sec_num, FAT_OP_TYPE_READ, &sec_buf); if (rc != RC_OK) return -1; c = MIN(count, (fs_info->vol.bps - ofs)); ffc171e4: a3 fa 00 00 lhz r31,0(r26) memcpy((buff + cmpltd), (sec_buf + ofs), c); ffc171e8: 80 81 00 08 lwz r4,8(r1) { rc = fat_buf_access(fs_info, sec_num, FAT_OP_TYPE_READ, &sec_buf); if (rc != RC_OK) return -1; c = MIN(count, (fs_info->vol.bps - ofs)); ffc171ec: 7f fb f8 50 subf r31,r27,r31 ffc171f0: 7f 9f f0 40 cmplw cr7,r31,r30 memcpy((buff + cmpltd), (sec_buf + ofs), c); ffc171f4: 7c 84 da 14 add r4,r4,r27 { rc = fat_buf_access(fs_info, sec_num, FAT_OP_TYPE_READ, &sec_buf); if (rc != RC_OK) return -1; c = MIN(count, (fs_info->vol.bps - ofs)); ffc171f8: 40 9d 00 08 ble- cr7,ffc17200 <_fat_block_read+0x64> ffc171fc: 7f df f3 78 mr r31,r30 memcpy((buff + cmpltd), (sec_buf + ofs), c); ffc17200: 7f e5 fb 78 mr r5,r31 ffc17204: 48 00 a1 79 bl ffc2137c uint32_t sec_num = start; uint32_t ofs = offset; uint8_t *sec_buf; uint32_t c = 0; while (count > 0) ffc17208: 7f df f0 51 subf. r30,r31,r30 c = MIN(count, (fs_info->vol.bps - ofs)); memcpy((buff + cmpltd), (sec_buf + ofs), c); count -= c; cmpltd += c; ffc1720c: 7f bf ea 14 add r29,r31,r29 sec_num++; ofs = 0; ffc17210: 3b 60 00 00 li r27,0 uint32_t sec_num = start; uint32_t ofs = offset; uint8_t *sec_buf; uint32_t c = 0; while (count > 0) ffc17214: 41 82 00 2c beq- ffc17240 <_fat_block_read+0xa4> { rc = fat_buf_access(fs_info, sec_num, FAT_OP_TYPE_READ, &sec_buf); ffc17218: 7f 84 e3 78 mr r4,r28 ffc1721c: 38 a0 00 01 li r5,1 ffc17220: 38 c1 00 08 addi r6,r1,8 ffc17224: 7f 43 d3 78 mr r3,r26 ffc17228: 4b ff fe 7d bl ffc170a4 c = MIN(count, (fs_info->vol.bps - ofs)); memcpy((buff + cmpltd), (sec_buf + ofs), c); count -= c; cmpltd += c; sec_num++; ffc1722c: 3b 9c 00 01 addi r28,r28,1 uint32_t c = 0; while (count > 0) { rc = fat_buf_access(fs_info, sec_num, FAT_OP_TYPE_READ, &sec_buf); if (rc != RC_OK) ffc17230: 2f 83 00 00 cmpwi cr7,r3,0 return -1; c = MIN(count, (fs_info->vol.bps - ofs)); memcpy((buff + cmpltd), (sec_buf + ofs), c); ffc17234: 7c 79 ea 14 add r3,r25,r29 uint32_t c = 0; while (count > 0) { rc = fat_buf_access(fs_info, sec_num, FAT_OP_TYPE_READ, &sec_buf); if (rc != RC_OK) ffc17238: 41 9e ff ac beq+ cr7,ffc171e4 <_fat_block_read+0x48> <== ALWAYS TAKEN return -1; ffc1723c: 3b a0 ff ff li r29,-1 <== NOT EXECUTED cmpltd += c; sec_num++; ofs = 0; } return cmpltd; } ffc17240: 80 01 00 3c lwz r0,60(r1) ffc17244: 7f a3 eb 78 mr r3,r29 ffc17248: 83 21 00 1c lwz r25,28(r1) ffc1724c: 7c 08 03 a6 mtlr r0 ffc17250: 83 41 00 20 lwz r26,32(r1) ffc17254: 83 61 00 24 lwz r27,36(r1) ffc17258: 83 81 00 28 lwz r28,40(r1) ffc1725c: 83 a1 00 2c lwz r29,44(r1) ffc17260: 83 c1 00 30 lwz r30,48(r1) ffc17264: 83 e1 00 34 lwz r31,52(r1) ffc17268: 38 21 00 38 addi r1,r1,56 ffc1726c: 4e 80 00 20 blr uint32_t count, void *buff ) { int rc = RC_OK; ssize_t cmpltd = 0; ffc17270: 3b a0 00 00 li r29,0 <== NOT EXECUTED ffc17274: 4b ff ff cc b ffc17240 <_fat_block_read+0xa4> <== NOT EXECUTED =============================================================================== ffc04d10 <_gettimeofday>: int _gettimeofday( struct timeval *tp, struct timezone *tzp ) { return gettimeofday( tp, tzp ); ffc04d10: 4b ff ff 44 b ffc04c54 <== NOT EXECUTED =============================================================================== ffc059e4 <_lstat_r>: struct _reent *ptr __attribute__((unused)), const char *path, struct stat *buf ) { return _STAT_NAME( path, buf ); ffc059e4: 7c 83 23 78 mr r3,r4 <== NOT EXECUTED ffc059e8: 7c a4 2b 78 mr r4,r5 <== NOT EXECUTED ffc059ec: 4b ff ff 7c b ffc05968 <== NOT EXECUTED =============================================================================== ffc05dd0 <_stat_r>: struct _reent *ptr __attribute__((unused)), const char *path, struct stat *buf ) { return _STAT_NAME( path, buf ); ffc05dd0: 7c 83 23 78 mr r3,r4 <== NOT EXECUTED ffc05dd4: 7c a4 2b 78 mr r4,r5 <== NOT EXECUTED ffc05dd8: 4b ff ff 7c b ffc05d54 <== NOT EXECUTED =============================================================================== ffc0a900 : rtems_rbtree_control *chunk_tree, rtems_rbheap_chunk *a, rtems_rbheap_chunk *b ) { if (b != NULL_PAGE && rtems_rbheap_is_chunk_free(b)) { ffc0a900: 2f 86 ff f8 cmpwi cr7,r6,-8 rtems_chain_control *free_chain, rtems_rbtree_control *chunk_tree, rtems_rbheap_chunk *a, rtems_rbheap_chunk *b ) { ffc0a904: 7c 6a 1b 78 mr r10,r3 if (b != NULL_PAGE && rtems_rbheap_is_chunk_free(b)) { ffc0a908: 4d 9e 00 20 beqlr cr7 */ RTEMS_INLINE_ROUTINE bool _Chain_Is_node_off_chain( const Chain_Node *node ) { return (node->next == NULL) && (node->previous == NULL); ffc0a90c: 81 26 00 00 lwz r9,0(r6) ffc0a910: 2f 89 00 00 cmpwi cr7,r9,0 ffc0a914: 41 9e 00 60 beq- cr7,ffc0a974 if (b->begin < a->begin) { ffc0a918: 80 e6 00 18 lwz r7,24(r6) ffc0a91c: 81 05 00 18 lwz r8,24(r5) ffc0a920: 7f 87 40 40 cmplw cr7,r7,r8 ffc0a924: 40 9c 00 14 bge- cr7,ffc0a938 ffc0a928: 7c a8 2b 78 mr r8,r5 ffc0a92c: 81 25 00 00 lwz r9,0(r5) ffc0a930: 7c c5 33 78 mr r5,r6 ffc0a934: 7d 06 43 78 mr r6,r8 a = b; b = t; } a->size += b->size; ffc0a938: 80 65 00 1c lwz r3,28(r5) ffc0a93c: 80 e6 00 1c lwz r7,28(r6) { Chain_Node *next; Chain_Node *previous; next = the_node->next; previous = the_node->previous; ffc0a940: 81 06 00 04 lwz r8,4(r6) ffc0a944: 7c e3 3a 14 add r7,r3,r7 ffc0a948: 90 e5 00 1c stw r7,28(r5) rtems_chain_extract_unprotected(&b->chain_node); add_to_chain(free_chain, b); _RBTree_Extract_unprotected(chunk_tree, &b->tree_node); ffc0a94c: 7c 83 23 78 mr r3,r4 ffc0a950: 38 86 00 08 addi r4,r6,8 next->previous = previous; previous->next = next; ffc0a954: 91 28 00 00 stw r9,0(r8) ) { Chain_Node *before_node; the_node->previous = after_node; before_node = after_node->next; ffc0a958: 80 ea 00 00 lwz r7,0(r10) Chain_Node *next; Chain_Node *previous; next = the_node->next; previous = the_node->previous; next->previous = previous; ffc0a95c: 91 09 00 04 stw r8,4(r9) { Chain_Node *before_node; the_node->previous = after_node; before_node = after_node->next; after_node->next = the_node; ffc0a960: 90 ca 00 00 stw r6,0(r10) Chain_Node *the_node ) { Chain_Node *before_node; the_node->previous = after_node; ffc0a964: 91 46 00 04 stw r10,4(r6) before_node = after_node->next; after_node->next = the_node; the_node->next = before_node; ffc0a968: 90 e6 00 00 stw r7,0(r6) before_node->previous = the_node; ffc0a96c: 90 c7 00 04 stw r6,4(r7) ffc0a970: 48 00 1f 50 b ffc0c8c0 <_RBTree_Extract_unprotected> */ RTEMS_INLINE_ROUTINE bool _Chain_Is_node_off_chain( const Chain_Node *node ) { return (node->next == NULL) && (node->previous == NULL); ffc0a974: 81 06 00 04 lwz r8,4(r6) ffc0a978: 2f 88 00 00 cmpwi cr7,r8,0 ffc0a97c: 40 9e ff 9c bne+ cr7,ffc0a918 <== NEVER TAKEN ffc0a980: 4e 80 00 20 blr =============================================================================== ffc05524 : #include #include int chroot( const char *path ) { ffc05524: 94 21 ff 90 stwu r1,-112(r1) /* * 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( ffc05528: 3c c0 00 00 lis r6,0 #include #include int chroot( const char *path ) { ffc0552c: 7c 08 02 a6 mflr r0 /* * 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( ffc05530: 38 c6 21 3c addi r6,r6,8508 #include #include int chroot( const char *path ) { ffc05534: 7c 64 1b 78 mr r4,r3 ffc05538: 93 c1 00 68 stw r30,104(r1) /* * 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( ffc0553c: 38 a0 00 19 li r5,25 ffc05540: 38 e6 ff fc addi r7,r6,-4 #include #include int chroot( const char *path ) { ffc05544: 90 01 00 74 stw r0,116(r1) /* * 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( ffc05548: 38 61 00 08 addi r3,r1,8 #include #include int chroot( const char *path ) { ffc0554c: 93 e1 00 6c stw r31,108(r1) /* * 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( ffc05550: 48 00 19 15 bl ffc06e64 ffc05554: 38 81 00 20 addi r4,r1,32 ffc05558: 38 61 00 40 addi r3,r1,64 ffc0555c: 48 00 1f 2d bl ffc07488 &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 ); ffc05560: 38 61 00 40 addi r3,r1,64 ffc05564: 48 00 21 dd bl ffc07740 if ( !rtems_filesystem_global_location_is_null( new_current_loc ) ) { ffc05568: 3f c0 ff c1 lis r30,-63 ffc0556c: 81 23 00 10 lwz r9,16(r3) ffc05570: 3b de 49 2c addi r30,r30,18732 &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 ); ffc05574: 90 61 00 58 stw r3,88(r1) if ( !rtems_filesystem_global_location_is_null( new_current_loc ) ) { ffc05578: 7f 89 f0 00 cmpw cr7,r9,r30 ffc0557c: 41 9e 00 4c beq- cr7,ffc055c8 rtems_filesystem_global_location_t *new_root_loc = ffc05580: 38 61 00 58 addi r3,r1,88 ffc05584: 48 00 20 a5 bl ffc07628 rtems_filesystem_global_location_obtain( &new_current_loc ); rtems_filesystem_node_types_t type = (*new_root_loc->location.mt_entry->ops->node_type_h)( ffc05588: 81 23 00 14 lwz r9,20(r3) ); 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 = ffc0558c: 7c 7f 1b 78 mr r31,r3 rtems_filesystem_global_location_obtain( &new_current_loc ); rtems_filesystem_node_types_t type = (*new_root_loc->location.mt_entry->ops->node_type_h)( ffc05590: 81 29 00 0c lwz r9,12(r9) 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 = ffc05594: 81 29 00 14 lwz r9,20(r9) ffc05598: 7d 29 03 a6 mtctr r9 ffc0559c: 4e 80 04 21 bctrl (*new_root_loc->location.mt_entry->ops->node_type_h)( &new_root_loc->location ); if ( type == RTEMS_FILESYSTEM_DIRECTORY ) { ffc055a0: 2f 83 00 00 cmpwi cr7,r3,0 ffc055a4: 41 9e 00 50 beq- cr7,ffc055f4 static inline void rtems_filesystem_location_error( const rtems_filesystem_location_info_t *loc, int eno ) { if ( !rtems_filesystem_location_is_null( loc ) ) { ffc055a8: 81 3f 00 10 lwz r9,16(r31) ffc055ac: 7f 89 f0 00 cmpw cr7,r9,r30 ffc055b0: 41 9e 00 10 beq- cr7,ffc055c0 <== NEVER TAKEN errno = eno; ffc055b4: 48 00 88 a9 bl ffc0de5c <__errno> ffc055b8: 39 20 00 14 li r9,20 ffc055bc: 91 23 00 00 stw r9,0(r3) rtems_filesystem_location_error( &new_root_loc->location, ENOTDIR ); rv = -1; } if ( rv != 0 ) { rtems_filesystem_global_location_release( new_root_loc ); ffc055c0: 7f e3 fb 78 mr r3,r31 ffc055c4: 48 00 1f f1 bl ffc075b4 } } else { rv = -1; } rtems_filesystem_eval_path_cleanup( &ctx ); ffc055c8: 38 61 00 08 addi r3,r1,8 ffc055cc: 48 00 1a 51 bl ffc0701c if ( rv != 0 ) { rtems_filesystem_global_location_release( new_current_loc ); ffc055d0: 80 61 00 58 lwz r3,88(r1) ffc055d4: 48 00 1f e1 bl ffc075b4 } return rv; } ffc055d8: 80 01 00 74 lwz r0,116(r1) ffc055dc: 83 c1 00 68 lwz r30,104(r1) } rtems_filesystem_eval_path_cleanup( &ctx ); if ( rv != 0 ) { rtems_filesystem_global_location_release( new_current_loc ); ffc055e0: 38 60 ff ff li r3,-1 } return rv; } ffc055e4: 7c 08 03 a6 mtlr r0 ffc055e8: 83 e1 00 6c lwz r31,108(r1) ffc055ec: 38 21 00 70 addi r1,r1,112 ffc055f0: 4e 80 00 20 blr (*new_root_loc->location.mt_entry->ops->node_type_h)( &new_root_loc->location ); if ( type == RTEMS_FILESYSTEM_DIRECTORY ) { sc = rtems_libio_set_private_env(); ffc055f4: 48 00 0f 61 bl ffc06554 if (sc == RTEMS_SUCCESSFUL) { ffc055f8: 2c 03 00 00 cmpwi r3,0 ffc055fc: 41 82 00 1c beq- ffc05618 rtems_filesystem_global_location_assign( &rtems_filesystem_current, new_current_loc ); } else { if (sc != RTEMS_UNSATISFIED) { ffc05600: 2f 83 00 0d cmpwi cr7,r3,13 ffc05604: 41 be ff bc beq- cr7,ffc055c0 <== NEVER TAKEN errno = ENOMEM; ffc05608: 48 00 88 55 bl ffc0de5c <__errno> ffc0560c: 39 20 00 0c li r9,12 ffc05610: 91 23 00 00 stw r9,0(r3) ffc05614: 4b ff ff ac b ffc055c0 ); if ( type == RTEMS_FILESYSTEM_DIRECTORY ) { sc = rtems_libio_set_private_env(); if (sc == RTEMS_SUCCESSFUL) { rtems_filesystem_global_location_assign( ffc05618: 3f c0 00 00 lis r30,0 ffc0561c: 80 7e 27 08 lwz r3,9992(r30) ffc05620: 7f e4 fb 78 mr r4,r31 ffc05624: 38 63 00 04 addi r3,r3,4 ffc05628: 48 00 1f dd bl ffc07604 &rtems_filesystem_root, new_root_loc ); rtems_filesystem_global_location_assign( ffc0562c: 80 81 00 58 lwz r4,88(r1) ffc05630: 80 7e 27 08 lwz r3,9992(r30) ffc05634: 48 00 1f d1 bl ffc07604 } } else { rv = -1; } rtems_filesystem_eval_path_cleanup( &ctx ); ffc05638: 38 61 00 08 addi r3,r1,8 ffc0563c: 48 00 19 e1 bl ffc0701c if ( rv != 0 ) { rtems_filesystem_global_location_release( new_current_loc ); } return rv; } ffc05640: 80 01 00 74 lwz r0,116(r1) ffc05644: 83 c1 00 68 lwz r30,104(r1) } } else { rv = -1; } rtems_filesystem_eval_path_cleanup( &ctx ); ffc05648: 38 60 00 00 li r3,0 if ( rv != 0 ) { rtems_filesystem_global_location_release( new_current_loc ); } return rv; } ffc0564c: 7c 08 03 a6 mtlr r0 ffc05650: 83 e1 00 6c lwz r31,108(r1) ffc05654: 38 21 00 70 addi r1,r1,112 ffc05658: 4e 80 00 20 blr =============================================================================== ffc04728 : dev_t dev, const char *name, rtems_disk_device **dd_ptr, char **alloc_name_ptr ) { ffc04728: 94 21 ff d0 stwu r1,-48(r1) ffc0472c: 7c 08 02 a6 mflr r0 ffc04730: 93 e1 00 2c stw r31,44(r1) rtems_device_major_number major = 0; rtems_device_minor_number minor = 0; rtems_filesystem_split_dev_t(dev, major, minor); if (major >= disktab_size) { ffc04734: 3f e0 00 00 lis r31,0 dev_t dev, const char *name, rtems_disk_device **dd_ptr, char **alloc_name_ptr ) { ffc04738: 93 81 00 20 stw r28,32(r1) rtems_device_major_number major = 0; rtems_device_minor_number minor = 0; rtems_filesystem_split_dev_t(dev, major, minor); if (major >= disktab_size) { ffc0473c: 83 9f 28 48 lwz r28,10312(r31) dev_t dev, const char *name, rtems_disk_device **dd_ptr, char **alloc_name_ptr ) { ffc04740: 92 c1 00 08 stw r22,8(r1) ffc04744: 7c f6 3b 78 mr r22,r7 rtems_device_major_number major = 0; rtems_device_minor_number minor = 0; rtems_filesystem_split_dev_t(dev, major, minor); if (major >= disktab_size) { ffc04748: 7f 83 e0 40 cmplw cr7,r3,r28 dev_t dev, const char *name, rtems_disk_device **dd_ptr, char **alloc_name_ptr ) { ffc0474c: 92 e1 00 0c stw r23,12(r1) ffc04750: 7c d7 33 78 mr r23,r6 ffc04754: 93 01 00 10 stw r24,16(r1) ffc04758: 7c b8 2b 78 mr r24,r5 ffc0475c: 93 21 00 14 stw r25,20(r1) rtems_device_major_number major = 0; rtems_device_minor_number minor = 0; rtems_filesystem_split_dev_t(dev, major, minor); if (major >= disktab_size) { ffc04760: 3b 3f 28 48 addi r25,r31,10312 dev_t dev, const char *name, rtems_disk_device **dd_ptr, char **alloc_name_ptr ) { ffc04764: 93 61 00 1c stw r27,28(r1) ffc04768: 7c 9b 23 78 mr r27,r4 ffc0476c: 93 a1 00 24 stw r29,36(r1) ffc04770: 7c 7d 1b 78 mr r29,r3 ffc04774: 90 01 00 34 stw r0,52(r1) ffc04778: 93 41 00 18 stw r26,24(r1) ffc0477c: 93 c1 00 28 stw r30,40(r1) rtems_device_major_number major = 0; rtems_device_minor_number minor = 0; rtems_filesystem_split_dev_t(dev, major, minor); if (major >= disktab_size) { ffc04780: 40 9c 01 0c bge- cr7,ffc0488c ffc04784: 83 d9 00 04 lwz r30,4(r25) memset(table + old_size, 0, (new_size - old_size) * sizeof(*table)); disktab = table; disktab_size = new_size; } if (disktab [major].minor == NULL || minor >= disktab[major].size) { ffc04788: 57 a9 18 38 rlwinm r9,r29,3,0,28 ffc0478c: 7f fe 48 2e lwzx r31,r30,r9 ffc04790: 7f de 4a 14 add r30,r30,r9 ffc04794: 83 9e 00 04 lwz r28,4(r30) ffc04798: 2f 9f 00 00 cmpwi cr7,r31,0 ffc0479c: 41 9e 00 60 beq- cr7,ffc047fc ffc047a0: 7f 9b e0 40 cmplw cr7,r27,r28 ffc047a4: 40 9c 00 58 bge- cr7,ffc047fc memset(table + old_size, 0, (new_size - old_size) * sizeof(*table)); disktab [major].minor = table; disktab [major].size = new_size; } return disktab [major].minor + minor; ffc047a8: 57 69 10 3a rlwinm r9,r27,2,0,29 { rtems_disk_device **dd_entry = create_disk_table_entry(dev); rtems_disk_device *dd = NULL; char *alloc_name = NULL; if (dd_entry == NULL) { ffc047ac: 7f df 4a 15 add. r30,r31,r9 ffc047b0: 41 82 00 a0 beq- ffc04850 <== NEVER TAKEN return RTEMS_NO_MEMORY; } if (*dd_entry != NULL) { ffc047b4: 7d 3f 48 2e lwzx r9,r31,r9 return RTEMS_RESOURCE_IN_USE; ffc047b8: 38 60 00 0c li r3,12 if (dd_entry == NULL) { return RTEMS_NO_MEMORY; } if (*dd_entry != NULL) { ffc047bc: 2f 89 00 00 cmpwi cr7,r9,0 ffc047c0: 41 9e 01 2c beq- cr7,ffc048ec *dd_entry = dd; *dd_ptr = dd; *alloc_name_ptr = alloc_name; return RTEMS_SUCCESSFUL; } ffc047c4: 80 01 00 34 lwz r0,52(r1) ffc047c8: 82 c1 00 08 lwz r22,8(r1) ffc047cc: 7c 08 03 a6 mtlr r0 ffc047d0: 82 e1 00 0c lwz r23,12(r1) ffc047d4: 83 01 00 10 lwz r24,16(r1) ffc047d8: 83 21 00 14 lwz r25,20(r1) ffc047dc: 83 41 00 18 lwz r26,24(r1) ffc047e0: 83 61 00 1c lwz r27,28(r1) ffc047e4: 83 81 00 20 lwz r28,32(r1) ffc047e8: 83 a1 00 24 lwz r29,36(r1) ffc047ec: 83 c1 00 28 lwz r30,40(r1) ffc047f0: 83 e1 00 2c lwz r31,44(r1) ffc047f4: 38 21 00 30 addi r1,r1,48 ffc047f8: 4e 80 00 20 blr if (disktab [major].minor == NULL || minor >= disktab[major].size) { 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) { ffc047fc: 2f 9c 00 00 cmpwi cr7,r28,0 new_size = DISKTAB_INITIAL_SIZE; ffc04800: 3b 40 00 08 li r26,8 if (disktab [major].minor == NULL || minor >= disktab[major].size) { 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) { ffc04804: 40 9e 00 d8 bne- cr7,ffc048dc new_size = DISKTAB_INITIAL_SIZE; } else { new_size = 2 * old_size; } if (minor >= new_size) { ffc04808: 7f 9b d0 40 cmplw cr7,r27,r26 ffc0480c: 40 9c 00 c8 bge- cr7,ffc048d4 new_size = minor + 1; } table = realloc(table, new_size * sizeof(*table)); ffc04810: 7f e3 fb 78 mr r3,r31 ffc04814: 57 44 10 3a rlwinm r4,r26,2,0,29 ffc04818: 48 00 28 6d bl ffc07084 if (table == NULL) { ffc0481c: 7c 7f 1b 79 mr. r31,r3 ffc04820: 41 82 00 30 beq- ffc04850 return NULL; } memset(table + old_size, 0, (new_size - old_size) * sizeof(*table)); ffc04824: 7c bc d0 50 subf r5,r28,r26 ffc04828: 57 83 10 3a rlwinm r3,r28,2,0,29 ffc0482c: 7c 7f 1a 14 add r3,r31,r3 ffc04830: 38 80 00 00 li r4,0 ffc04834: 54 a5 10 3a rlwinm r5,r5,2,0,29 ffc04838: 48 01 38 19 bl ffc18050 disktab [major].minor = table; disktab [major].size = new_size; } return disktab [major].minor + minor; ffc0483c: 57 69 10 3a rlwinm r9,r27,2,0,29 if (table == NULL) { return NULL; } memset(table + old_size, 0, (new_size - old_size) * sizeof(*table)); disktab [major].minor = table; ffc04840: 93 fe 00 00 stw r31,0(r30) disktab [major].size = new_size; ffc04844: 93 5e 00 04 stw r26,4(r30) { rtems_disk_device **dd_entry = create_disk_table_entry(dev); rtems_disk_device *dd = NULL; char *alloc_name = NULL; if (dd_entry == NULL) { ffc04848: 7f df 4a 15 add. r30,r31,r9 ffc0484c: 40 82 ff 68 bne+ ffc047b4 <== ALWAYS TAKEN alloc_name = strdup(name); if (alloc_name == NULL) { free(dd); return RTEMS_NO_MEMORY; ffc04850: 38 60 00 1a li r3,26 *dd_entry = dd; *dd_ptr = dd; *alloc_name_ptr = alloc_name; return RTEMS_SUCCESSFUL; } ffc04854: 80 01 00 34 lwz r0,52(r1) ffc04858: 82 c1 00 08 lwz r22,8(r1) ffc0485c: 7c 08 03 a6 mtlr r0 ffc04860: 82 e1 00 0c lwz r23,12(r1) ffc04864: 83 01 00 10 lwz r24,16(r1) ffc04868: 83 21 00 14 lwz r25,20(r1) ffc0486c: 83 41 00 18 lwz r26,24(r1) ffc04870: 83 61 00 1c lwz r27,28(r1) ffc04874: 83 81 00 20 lwz r28,32(r1) ffc04878: 83 a1 00 24 lwz r29,36(r1) ffc0487c: 83 c1 00 28 lwz r30,40(r1) ffc04880: 83 e1 00 2c lwz r31,44(r1) ffc04884: 38 21 00 30 addi r1,r1,48 ffc04888: 4e 80 00 20 blr rtems_filesystem_split_dev_t(dev, major, minor); if (major >= disktab_size) { rtems_disk_device_table *table = disktab; rtems_device_major_number old_size = disktab_size; rtems_device_major_number new_size = 2 * old_size; ffc0488c: 57 9a 08 3c rlwinm r26,r28,1,0,30 if (major >= new_size) { ffc04890: 7f 83 d0 40 cmplw cr7,r3,r26 rtems_device_minor_number minor = 0; rtems_filesystem_split_dev_t(dev, major, minor); if (major >= disktab_size) { rtems_disk_device_table *table = disktab; ffc04894: 80 79 00 04 lwz r3,4(r25) rtems_device_major_number old_size = disktab_size; rtems_device_major_number new_size = 2 * old_size; if (major >= new_size) { ffc04898: 41 9c 00 08 blt- cr7,ffc048a0 <== NEVER TAKEN new_size = major + 1; ffc0489c: 3b 5d 00 01 addi r26,r29,1 } table = realloc(table, new_size * sizeof(*table)); ffc048a0: 57 44 18 38 rlwinm r4,r26,3,0,28 ffc048a4: 48 00 27 e1 bl ffc07084 if (table == NULL) { ffc048a8: 7c 7e 1b 79 mr. r30,r3 ffc048ac: 41 a2 ff a4 beq- ffc04850 <== ALWAYS TAKEN return NULL; } memset(table + old_size, 0, (new_size - old_size) * sizeof(*table)); ffc048b0: 7c bc d0 50 subf r5,r28,r26 <== NOT EXECUTED ffc048b4: 57 83 18 38 rlwinm r3,r28,3,0,28 <== NOT EXECUTED ffc048b8: 7c 7e 1a 14 add r3,r30,r3 <== NOT EXECUTED ffc048bc: 38 80 00 00 li r4,0 <== NOT EXECUTED ffc048c0: 54 a5 18 38 rlwinm r5,r5,3,0,28 <== NOT EXECUTED ffc048c4: 48 01 37 8d bl ffc18050 <== NOT EXECUTED disktab = table; ffc048c8: 93 d9 00 04 stw r30,4(r25) <== NOT EXECUTED disktab_size = new_size; ffc048cc: 93 5f 28 48 stw r26,10312(r31) <== NOT EXECUTED ffc048d0: 4b ff fe b8 b ffc04788 <== NOT EXECUTED new_size = DISKTAB_INITIAL_SIZE; } else { new_size = 2 * old_size; } if (minor >= new_size) { new_size = minor + 1; ffc048d4: 3b 5b 00 01 addi r26,r27,1 ffc048d8: 4b ff ff 38 b ffc04810 rtems_device_minor_number new_size = 0; if (old_size == 0) { new_size = DISKTAB_INITIAL_SIZE; } else { new_size = 2 * old_size; ffc048dc: 57 9a 08 3c rlwinm r26,r28,1,0,30 } if (minor >= new_size) { ffc048e0: 7f 9b d0 40 cmplw cr7,r27,r26 ffc048e4: 41 bc ff 2c blt- cr7,ffc04810 <== ALWAYS TAKEN ffc048e8: 4b ff ff ec b ffc048d4 <== NOT EXECUTED if (*dd_entry != NULL) { return RTEMS_RESOURCE_IN_USE; } dd = malloc(sizeof(*dd)); ffc048ec: 38 60 00 78 li r3,120 ffc048f0: 48 00 1a 79 bl ffc06368 if (dd == NULL) { ffc048f4: 7c 7f 1b 79 mr. r31,r3 ffc048f8: 41 a2 ff 58 beq- ffc04850 <== NEVER TAKEN return RTEMS_NO_MEMORY; } if (name != NULL) { ffc048fc: 2f 98 00 00 cmpwi cr7,r24,0 ffc04900: 41 9e 00 48 beq- cr7,ffc04948 alloc_name = strdup(name); ffc04904: 7f 03 c3 78 mr r3,r24 ffc04908: 48 01 3a 75 bl ffc1837c if (alloc_name == NULL) { ffc0490c: 2f 83 00 00 cmpwi cr7,r3,0 if (dd == NULL) { return RTEMS_NO_MEMORY; } if (name != NULL) { alloc_name = strdup(name); ffc04910: 7c 7c 1b 78 mr r28,r3 ffc04914: 7c 7a 1b 78 mr r26,r3 if (alloc_name == NULL) { ffc04918: 41 9e 00 50 beq- cr7,ffc04968 <== NEVER TAKEN return RTEMS_NO_MEMORY; } } if (name != NULL) { if (mknod(alloc_name, 0777 | S_IFBLK, dev) < 0) { ffc0491c: 38 80 61 ff li r4,25087 ffc04920: 7f a5 eb 78 mr r5,r29 ffc04924: 7f 66 db 78 mr r6,r27 ffc04928: 48 00 1c 11 bl ffc06538 ffc0492c: 2f 83 00 00 cmpwi cr7,r3,0 ffc04930: 41 9c 00 20 blt- cr7,ffc04950 <== NEVER TAKEN free(dd); return RTEMS_UNSATISFIED; } } *dd_entry = dd; ffc04934: 93 fe 00 00 stw r31,0(r30) *dd_ptr = dd; *alloc_name_ptr = alloc_name; return RTEMS_SUCCESSFUL; ffc04938: 38 60 00 00 li r3,0 return RTEMS_UNSATISFIED; } } *dd_entry = dd; *dd_ptr = dd; ffc0493c: 93 f7 00 00 stw r31,0(r23) *alloc_name_ptr = alloc_name; ffc04940: 93 56 00 00 stw r26,0(r22) return RTEMS_SUCCESSFUL; ffc04944: 4b ff fe 80 b ffc047c4 char **alloc_name_ptr ) { rtems_disk_device **dd_entry = create_disk_table_entry(dev); rtems_disk_device *dd = NULL; char *alloc_name = NULL; ffc04948: 3b 40 00 00 li r26,0 ffc0494c: 4b ff ff e8 b ffc04934 } } if (name != NULL) { if (mknod(alloc_name, 0777 | S_IFBLK, dev) < 0) { free(alloc_name); ffc04950: 7f 83 e3 78 mr r3,r28 <== NOT EXECUTED ffc04954: 48 00 13 c5 bl ffc05d18 <== NOT EXECUTED free(dd); ffc04958: 7f e3 fb 78 mr r3,r31 <== NOT EXECUTED ffc0495c: 48 00 13 bd bl ffc05d18 <== NOT EXECUTED return RTEMS_UNSATISFIED; ffc04960: 38 60 00 0d li r3,13 <== NOT EXECUTED ffc04964: 4b ff fe 60 b ffc047c4 <== NOT EXECUTED if (name != NULL) { alloc_name = strdup(name); if (alloc_name == NULL) { free(dd); ffc04968: 7f e3 fb 78 mr r3,r31 <== NOT EXECUTED ffc0496c: 48 00 13 ad bl ffc05d18 <== NOT EXECUTED return RTEMS_NO_MEMORY; ffc04970: 38 60 00 1a li r3,26 <== NOT EXECUTED ffc04974: 4b ff fe e0 b ffc04854 <== NOT EXECUTED =============================================================================== ffc06890 : * 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) ffc06890: 94 21 ff e8 stwu r1,-24(r1) ffc06894: 7c 08 02 a6 mflr r0 if (new_part_desc == NULL) { return RTEMS_INTERNAL_ERROR; } *new_part_desc = NULL; ffc06898: 39 20 00 00 li r9,0 * 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) ffc0689c: 93 a1 00 0c stw r29,12(r1) ffc068a0: 7c 9d 23 78 mr r29,r4 ffc068a4: 93 c1 00 10 stw r30,16(r1) ffc068a8: 7c 7e 1b 78 mr r30,r3 return RTEMS_INTERNAL_ERROR; } *new_part_desc = NULL; if ((part_desc = calloc(1, sizeof(rtems_part_desc_t))) == NULL) ffc068ac: 38 60 00 01 li r3,1 * 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) ffc068b0: 93 e1 00 14 stw r31,20(r1) ffc068b4: 90 01 00 1c stw r0,28(r1) if (new_part_desc == NULL) { return RTEMS_INTERNAL_ERROR; } *new_part_desc = NULL; ffc068b8: 91 24 00 00 stw r9,0(r4) if ((part_desc = calloc(1, sizeof(rtems_part_desc_t))) == NULL) ffc068bc: 38 80 00 28 li r4,40 ffc068c0: 48 00 10 05 bl ffc078c4 ffc068c4: 7c 7f 1b 79 mr. r31,r3 ffc068c8: 41 82 00 c0 beq- ffc06988 <== NEVER TAKEN { return RTEMS_NO_MEMORY; } part_desc->bootable = *(data + RTEMS_IDE_PARTITION_BOOTABLE_OFFSET); ffc068cc: 89 3e 00 00 lbz r9,0(r30) ffc068d0: 99 3f 00 00 stb r9,0(r31) part_desc->sys_type = *(data + RTEMS_IDE_PARTITION_SYS_TYPE_OFFSET); ffc068d4: 88 9e 00 04 lbz r4,4(r30) ffc068d8: 98 9f 00 01 stb r4,1(r31) uint32_t value ) { uint32_t swapped; __asm__ volatile("rlwimi %0,%1,8,24,31;" ffc068dc: 81 5e 00 08 lwz r10,8(r30) ffc068e0: 51 48 46 3e rlwimi r8,r10,8,24,31 ffc068e4: 51 48 c4 2e rlwimi r8,r10,24,16,23 ffc068e8: 51 48 42 1e rlwimi r8,r10,8,8,15 ffc068ec: 51 48 c0 0e rlwimi r8,r10,24,0,7 /* 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); ffc068f0: 91 1f 00 04 stw r8,4(r31) ffc068f4: 81 5e 00 0c lwz r10,12(r30) ffc068f8: 51 5e 46 3e rlwimi r30,r10,8,24,31 ffc068fc: 51 5e c4 2e rlwimi r30,r10,24,16,23 ffc06900: 51 5e 42 1e rlwimi r30,r10,8,8,15 ffc06904: 51 5e c0 0e rlwimi r30,r10,24,0,7 * true if partition type is extended, false otherwise */ static bool is_extended(uint8_t type) { return ((type == EXTENDED_PARTITION) || (type == LINUX_EXTENDED)); ffc06908: 2f 84 00 05 cmpwi cr7,r4,5 /* 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); memcpy(&temp, data + RTEMS_IDE_PARTITION_SIZE_OFFSET, sizeof(uint32_t)); part_desc->size = LE_TO_CPU_U32(temp); ffc0690c: 93 df 00 08 stw r30,8(r31) * true if partition type is extended, false otherwise */ static bool is_extended(uint8_t type) { return ((type == EXTENDED_PARTITION) || (type == LINUX_EXTENDED)); ffc06910: 41 9e 00 54 beq- cr7,ffc06964 ffc06914: 2f 84 00 85 cmpwi cr7,r4,133 ffc06918: 41 9e 00 4c beq- cr7,ffc06964 <== NEVER TAKEN DOS_P32MB_PARTITION, FAT32_PARTITION ,FAT32_LBA_PARTITION, FAT16_LBA_PARTITION }; return (NULL != memchr(fat_part_types,type,sizeof(fat_part_types))); ffc0691c: 3c 60 ff c3 lis r3,-61 ffc06920: 38 63 8f c0 addi r3,r3,-28736 ffc06924: 38 a0 00 06 li r5,6 ffc06928: 48 01 33 29 bl ffc19c50 * use partitions that are * - extended * or * - FAT type and non-zero */ if (is_extended(part_desc->sys_type) || ffc0692c: 2f 83 00 00 cmpwi cr7,r3,0 ffc06930: 41 9e 00 0c beq- cr7,ffc0693c ((is_fat_partition(part_desc->sys_type)) && (part_desc->size != 0))) { ffc06934: 2f 9e 00 00 cmpwi cr7,r30,0 ffc06938: 40 9e 00 2c bne- cr7,ffc06964 <== ALWAYS TAKEN *new_part_desc = part_desc; } else { /* empty partition */ free(part_desc); ffc0693c: 7f e3 fb 78 mr r3,r31 ffc06940: 48 00 10 95 bl ffc079d4 } return RTEMS_SUCCESSFUL; } ffc06944: 80 01 00 1c lwz r0,28(r1) ffc06948: 83 a1 00 0c lwz r29,12(r1) } else { /* empty partition */ free(part_desc); } return RTEMS_SUCCESSFUL; ffc0694c: 38 60 00 00 li r3,0 } ffc06950: 7c 08 03 a6 mtlr r0 ffc06954: 83 c1 00 10 lwz r30,16(r1) ffc06958: 83 e1 00 14 lwz r31,20(r1) ffc0695c: 38 21 00 18 addi r1,r1,24 ffc06960: 4e 80 00 20 blr ffc06964: 80 01 00 1c lwz r0,28(r1) } else { /* empty partition */ free(part_desc); } return RTEMS_SUCCESSFUL; ffc06968: 38 60 00 00 li r3,0 * or * - FAT type and non-zero */ if (is_extended(part_desc->sys_type) || ((is_fat_partition(part_desc->sys_type)) && (part_desc->size != 0))) { *new_part_desc = part_desc; ffc0696c: 93 fd 00 00 stw r31,0(r29) else { /* empty partition */ free(part_desc); } return RTEMS_SUCCESSFUL; } ffc06970: 7c 08 03 a6 mtlr r0 ffc06974: 83 a1 00 0c lwz r29,12(r1) ffc06978: 83 c1 00 10 lwz r30,16(r1) ffc0697c: 83 e1 00 14 lwz r31,20(r1) ffc06980: 38 21 00 18 addi r1,r1,24 ffc06984: 4e 80 00 20 blr ffc06988: 80 01 00 1c lwz r0,28(r1) <== NOT EXECUTED *new_part_desc = NULL; if ((part_desc = calloc(1, sizeof(rtems_part_desc_t))) == NULL) { return RTEMS_NO_MEMORY; ffc0698c: 38 60 00 1a li r3,26 <== NOT EXECUTED else { /* empty partition */ free(part_desc); } return RTEMS_SUCCESSFUL; } ffc06990: 83 a1 00 0c lwz r29,12(r1) <== NOT EXECUTED ffc06994: 7c 08 03 a6 mtlr r0 <== NOT EXECUTED ffc06998: 83 c1 00 10 lwz r30,16(r1) <== NOT EXECUTED ffc0699c: 83 e1 00 14 lwz r31,20(r1) <== NOT EXECUTED ffc069a0: 38 21 00 18 addi r1,r1,24 <== NOT EXECUTED ffc069a4: 4e 80 00 20 blr <== NOT EXECUTED =============================================================================== ffc03d38 : #include "devfs.h" void devFS_Show(void) { rtems_filesystem_location_info_t *rootloc = &rtems_filesystem_root->location; ffc03d38: 3d 20 00 00 lis r9,0 ffc03d3c: 81 29 27 54 lwz r9,10068(r9) if (rootloc->mt_entry->ops == &devFS_ops) { ffc03d40: 3d 00 ff c1 lis r8,-63 ffc03d44: 39 08 53 90 addi r8,r8,21392 ffc03d48: 81 29 00 04 lwz r9,4(r9) ffc03d4c: 81 29 00 14 lwz r9,20(r9) ffc03d50: 81 49 00 0c lwz r10,12(r9) ffc03d54: 7f 8a 40 00 cmpw cr7,r10,r8 ffc03d58: 4c be 00 20 bnelr+ cr7 #endif #include "devfs.h" void devFS_Show(void) { ffc03d5c: 94 21 ff d8 stwu r1,-40(r1) ffc03d60: 7c 08 02 a6 mflr r0 ffc03d64: 90 01 00 2c stw r0,44(r1) 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; ffc03d68: 81 29 00 10 lwz r9,16(r9) ffc03d6c: 93 41 00 10 stw r26,16(r1) 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; ffc03d70: 83 49 00 04 lwz r26,4(r9) #endif #include "devfs.h" void devFS_Show(void) { ffc03d74: 93 c1 00 20 stw r30,32(r1) 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) { ffc03d78: 2f 9a 00 00 cmpwi cr7,r26,0 #endif #include "devfs.h" void devFS_Show(void) { ffc03d7c: 93 01 00 08 stw r24,8(r1) ffc03d80: 93 21 00 0c stw r25,12(r1) ffc03d84: 93 61 00 14 stw r27,20(r1) ffc03d88: 93 81 00 18 stw r28,24(r1) ffc03d8c: 93 a1 00 1c stw r29,28(r1) ffc03d90: 93 e1 00 24 stw r31,36(r1) if (rootloc->mt_entry->ops == &devFS_ops) { const devFS_data *data = devFS_get_data(rootloc); size_t i = 0; size_t n = data->count; devFS_node *nodes = data->nodes; ffc03d94: 83 c9 00 00 lwz r30,0(r9) for (i = 0; i < n; ++i) { ffc03d98: 41 9e 00 8c beq- cr7,ffc03e24 <== NEVER TAKEN if (current->name != NULL) { size_t j = 0; size_t m = current->namelen; printk("/"); ffc03d9c: 3f 00 ff c1 lis r24,-63 ffc03da0: 3f 80 ff c1 lis r28,-63 for (j = 0; j < m; ++j) { printk("%c", current->name [j]); } printk( ffc03da4: 3f 20 ff c1 lis r25,-63 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) { ffc03da8: 3b 60 00 00 li r27,0 if (current->name != NULL) { size_t j = 0; size_t m = current->namelen; printk("/"); ffc03dac: 3b 18 54 10 addi r24,r24,21520 ffc03db0: 3b 9c 54 20 addi r28,r28,21536 for (j = 0; j < m; ++j) { printk("%c", current->name [j]); } printk( ffc03db4: 3b 39 54 14 addi r25,r25,21524 devFS_node *nodes = data->nodes; for (i = 0; i < n; ++i) { devFS_node *current = nodes + i; if (current->name != NULL) { ffc03db8: 81 3e 00 00 lwz r9,0(r30) ffc03dbc: 2f 89 00 00 cmpwi cr7,r9,0 ffc03dc0: 41 9e 00 54 beq- cr7,ffc03e14 size_t j = 0; size_t m = current->namelen; ffc03dc4: 83 be 00 04 lwz r29,4(r30) printk("/"); ffc03dc8: 7f 03 c3 78 mr r3,r24 ffc03dcc: 4c c6 31 82 crclr 4*cr1+eq ffc03dd0: 48 00 12 8d bl ffc0505c for (j = 0; j < m; ++j) { ffc03dd4: 3b e0 00 00 li r31,0 ffc03dd8: 2f 9d 00 00 cmpwi cr7,r29,0 ffc03ddc: 41 9e 00 24 beq- cr7,ffc03e00 <== NEVER TAKEN printk("%c", current->name [j]); ffc03de0: 81 3e 00 00 lwz r9,0(r30) ffc03de4: 7f 83 e3 78 mr r3,r28 ffc03de8: 7c 89 f8 ae lbzx r4,r9,r31 if (current->name != NULL) { size_t j = 0; size_t m = current->namelen; printk("/"); for (j = 0; j < m; ++j) { ffc03dec: 3b ff 00 01 addi r31,r31,1 printk("%c", current->name [j]); ffc03df0: 4c c6 31 82 crclr 4*cr1+eq ffc03df4: 48 00 12 69 bl ffc0505c if (current->name != NULL) { size_t j = 0; size_t m = current->namelen; printk("/"); for (j = 0; j < m; ++j) { ffc03df8: 7f 9f e8 00 cmpw cr7,r31,r29 ffc03dfc: 40 9e ff e4 bne+ cr7,ffc03de0 printk("%c", current->name [j]); } printk( ffc03e00: 80 9e 00 08 lwz r4,8(r30) ffc03e04: 7f 23 cb 78 mr r3,r25 ffc03e08: 80 be 00 0c lwz r5,12(r30) ffc03e0c: 4c c6 31 82 crclr 4*cr1+eq ffc03e10: 48 00 12 4d bl ffc0505c 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) { ffc03e14: 3b 7b 00 01 addi r27,r27,1 ffc03e18: 7f 9b d0 00 cmpw cr7,r27,r26 ffc03e1c: 3b de 00 14 addi r30,r30,20 ffc03e20: 40 9e ff 98 bne+ cr7,ffc03db8 (unsigned long) current->minor ); } } } } ffc03e24: 80 01 00 2c lwz r0,44(r1) ffc03e28: 83 01 00 08 lwz r24,8(r1) ffc03e2c: 7c 08 03 a6 mtlr r0 ffc03e30: 83 21 00 0c lwz r25,12(r1) ffc03e34: 83 41 00 10 lwz r26,16(r1) ffc03e38: 83 61 00 14 lwz r27,20(r1) ffc03e3c: 83 81 00 18 lwz r28,24(r1) ffc03e40: 83 a1 00 1c lwz r29,28(r1) ffc03e44: 83 c1 00 20 lwz r30,32(r1) ffc03e48: 83 e1 00 24 lwz r31,36(r1) ffc03e4c: 38 21 00 28 addi r1,r1,40 ffc03e50: 4e 80 00 20 blr =============================================================================== ffc0dee0 : } void devFS_eval_path( rtems_filesystem_eval_path_context_t *ctx ) { ffc0dee0: 94 21 ff d8 stwu r1,-40(r1) ffc0dee4: 7c 08 02 a6 mflr r0 ffc0dee8: 90 01 00 2c stw r0,44(r1) 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; ffc0deec: 81 23 00 2c lwz r9,44(r3) ffc0def0: 93 01 00 08 stw r24,8(r1) ffc0def4: 81 29 00 10 lwz r9,16(r9) ffc0def8: 93 21 00 0c stw r25,12(r1) ffc0defc: 7c 79 1b 78 mr r25,r3 ffc0df00: 93 41 00 10 stw r26,16(r1) ffc0df04: 93 61 00 14 stw r27,20(r1) ffc0df08: 93 81 00 18 stw r28,24(r1) ) { size_t i = 0; size_t n = data->count; devFS_node *nodes = data->nodes; devFS_node *node = NULL; ffc0df0c: 3b 80 00 00 li r28,0 } void devFS_eval_path( rtems_filesystem_eval_path_context_t *ctx ) { ffc0df10: 93 a1 00 1c stw r29,28(r1) 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) { ffc0df14: 3b a0 00 00 li r29,0 } void devFS_eval_path( rtems_filesystem_eval_path_context_t *ctx ) { ffc0df18: 93 e1 00 24 stw r31,36(r1) size_t pathlen, devFS_node **free_node_ptr ) { size_t i = 0; size_t n = data->count; ffc0df1c: 83 49 00 04 lwz r26,4(r9) ffc0df20: 83 e9 00 00 lwz r31,0(r9) devFS_node *nodes = data->nodes; devFS_node *node = NULL; devFS_node *free_node = NULL; ffc0df24: 39 20 00 00 li r9,0 } void devFS_eval_path( rtems_filesystem_eval_path_context_t *ctx ) { ffc0df28: 93 c1 00 20 stw r30,32(r1) } } else { rtems_filesystem_eval_path_error(ctx, ENOENT); } } } ffc0df2c: 83 03 00 00 lwz r24,0(r3) ffc0df30: 83 63 00 04 lwz r27,4(r3) ffc0df34: 48 00 00 1c b ffc0df50 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) { ffc0df38: 2f 9e 00 00 cmpwi cr7,r30,0 ffc0df3c: 2f 1c 00 00 cmpwi cr6,r28,0 ffc0df40: 3b ff 00 14 addi r31,r31,20 ffc0df44: 7f c9 f3 78 mr r9,r30 ffc0df48: 41 9e 00 08 beq- cr7,ffc0df50 <== NEVER TAKEN ffc0df4c: 40 9a 00 98 bne- cr6,ffc0dfe4 ffc0df50: 7f 9d d0 00 cmpw cr7,r29,r26 devFS_node *current = nodes + i; ffc0df54: 7f fe fb 78 mr r30,r31 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) { ffc0df58: 3b bd 00 01 addi r29,r29,1 ffc0df5c: 41 9e 00 3c beq- cr7,ffc0df98 devFS_node *current = nodes + i; if (current->name != NULL) { ffc0df60: 80 7f 00 00 lwz r3,0(r31) ffc0df64: 2f 83 00 00 cmpwi cr7,r3,0 ffc0df68: 41 be ff d0 beq- cr7,ffc0df38 if ( ffc0df6c: 81 5f 00 04 lwz r10,4(r31) ffc0df70: 7d 3e 4b 78 mr r30,r9 ffc0df74: 7f 9b 50 00 cmpw cr7,r27,r10 ffc0df78: 40 9e ff c0 bne+ cr7,ffc0df38 current->namelen == pathlen && memcmp(current->name, path, pathlen) == 0 ffc0df7c: 7f 04 c3 78 mr r4,r24 ffc0df80: 7f 65 db 78 mr r5,r27 ffc0df84: 48 00 28 3d bl ffc107c0 ffc0df88: 2f 83 00 00 cmpwi cr7,r3,0 ffc0df8c: 40 be ff ac bne- cr7,ffc0df38 ffc0df90: 7f fc fb 78 mr r28,r31 ffc0df94: 4b ff ff a4 b ffc0df38 rtems_filesystem_eval_path_get_pathlen(ctx), &free_node ); int eval_flags = rtems_filesystem_eval_path_get_flags(ctx); if (node != NULL) { ffc0df98: 2f 9c 00 00 cmpwi cr7,r28,0 } } else { rtems_filesystem_eval_path_error(ctx, ENOENT); } } } ffc0df9c: 81 59 00 10 lwz r10,16(r25) rtems_filesystem_eval_path_get_pathlen(ctx), &free_node ); int eval_flags = rtems_filesystem_eval_path_get_flags(ctx); if (node != NULL) { ffc0dfa0: 41 9e 00 88 beq- cr7,ffc0e028 <== ALWAYS TAKEN if ((eval_flags & RTEMS_FS_EXCLUSIVE) == 0) { ffc0dfa4: 71 49 00 40 andi. r9,r10,64 <== NOT EXECUTED ffc0dfa8: 40 82 00 48 bne- ffc0dff0 <== NOT EXECUTED } } else { rtems_filesystem_eval_path_error(ctx, ENOENT); } } } ffc0dfac: 80 01 00 2c lwz r0,44(r1) ); int eval_flags = rtems_filesystem_eval_path_get_flags(ctx); if (node != NULL) { if ((eval_flags & RTEMS_FS_EXCLUSIVE) == 0) { currentloc->node_access = node; ffc0dfb0: 93 99 00 20 stw r28,32(r25) } } else { rtems_filesystem_eval_path_error(ctx, ENOENT); } } } ffc0dfb4: 7c 08 03 a6 mtlr r0 static inline void rtems_filesystem_eval_path_clear_path( rtems_filesystem_eval_path_context_t *ctx ) { ctx->pathlen = 0; ffc0dfb8: 91 39 00 04 stw r9,4(r25) ffc0dfbc: 83 01 00 08 lwz r24,8(r1) ffc0dfc0: 83 21 00 0c lwz r25,12(r1) ffc0dfc4: 83 41 00 10 lwz r26,16(r1) ffc0dfc8: 83 61 00 14 lwz r27,20(r1) ffc0dfcc: 83 81 00 18 lwz r28,24(r1) ffc0dfd0: 83 a1 00 1c lwz r29,28(r1) ffc0dfd4: 83 c1 00 20 lwz r30,32(r1) ffc0dfd8: 83 e1 00 24 lwz r31,36(r1) ffc0dfdc: 38 21 00 28 addi r1,r1,40 ffc0dfe0: 4e 80 00 20 blr ffc0dfe4: 81 59 00 10 lwz r10,16(r25) &free_node ); int eval_flags = rtems_filesystem_eval_path_get_flags(ctx); if (node != NULL) { if ((eval_flags & RTEMS_FS_EXCLUSIVE) == 0) { ffc0dfe8: 71 49 00 40 andi. r9,r10,64 ffc0dfec: 41 82 ff c0 beq+ ffc0dfac currentloc->node_access = node; rtems_filesystem_eval_path_clear_path(ctx); } else { rtems_filesystem_eval_path_error(ctx, EEXIST); ffc0dff0: 7f 23 cb 78 mr r3,r25 ffc0dff4: 38 80 00 11 li r4,17 } } else { rtems_filesystem_eval_path_error(ctx, ENOENT); } } } ffc0dff8: 80 01 00 2c lwz r0,44(r1) ffc0dffc: 83 01 00 08 lwz r24,8(r1) ffc0e000: 7c 08 03 a6 mtlr r0 ffc0e004: 83 21 00 0c lwz r25,12(r1) ffc0e008: 83 41 00 10 lwz r26,16(r1) ffc0e00c: 83 61 00 14 lwz r27,20(r1) ffc0e010: 83 81 00 18 lwz r28,24(r1) ffc0e014: 83 a1 00 1c lwz r29,28(r1) ffc0e018: 83 c1 00 20 lwz r30,32(r1) ffc0e01c: 83 e1 00 24 lwz r31,36(r1) ffc0e020: 38 21 00 28 addi r1,r1,40 rtems_filesystem_eval_path_clear_path(ctx); } else { rtems_filesystem_eval_path_error(ctx, ENOSPC); } } else { rtems_filesystem_eval_path_error(ctx, ENOENT); ffc0e024: 4b ff 7b ac b ffc05bd0 rtems_filesystem_eval_path_clear_path(ctx); } else { rtems_filesystem_eval_path_error(ctx, EEXIST); } } else { if ((eval_flags & RTEMS_FS_MAKE) != 0) { ffc0e028: 71 48 00 20 andi. r8,r10,32 ffc0e02c: 41 82 00 54 beq- ffc0e080 <== NEVER TAKEN if (free_node != NULL) { ffc0e030: 2f 89 00 00 cmpwi cr7,r9,0 ffc0e034: 41 9e 00 58 beq- cr7,ffc0e08c } } else { rtems_filesystem_eval_path_error(ctx, ENOENT); } } } ffc0e038: 80 01 00 2c lwz r0,44(r1) rtems_filesystem_eval_path_error(ctx, EEXIST); } } else { if ((eval_flags & RTEMS_FS_MAKE) != 0) { if (free_node != NULL) { free_node->mode = S_IRWXU | S_IRWXG | S_IRWXO; ffc0e03c: 39 40 01 ff li r10,511 ffc0e040: 91 49 00 10 stw r10,16(r9) } } else { rtems_filesystem_eval_path_error(ctx, ENOENT); } } } ffc0e044: 7c 08 03 a6 mtlr r0 rtems_filesystem_eval_path_context_t *ctx, const char *token, size_t tokenlen ) { ctx->token = token; ffc0e048: 93 19 00 08 stw r24,8(r25) ctx->tokenlen = tokenlen; ffc0e04c: 93 79 00 0c stw r27,12(r25) static inline void rtems_filesystem_eval_path_clear_path( rtems_filesystem_eval_path_context_t *ctx ) { ctx->pathlen = 0; ffc0e050: 93 99 00 04 stw r28,4(r25) } } else { if ((eval_flags & RTEMS_FS_MAKE) != 0) { if (free_node != NULL) { free_node->mode = S_IRWXU | S_IRWXG | S_IRWXO; currentloc->node_access = free_node; ffc0e054: 91 39 00 20 stw r9,32(r25) } } else { rtems_filesystem_eval_path_error(ctx, ENOENT); } } } ffc0e058: 83 01 00 08 lwz r24,8(r1) ffc0e05c: 83 21 00 0c lwz r25,12(r1) ffc0e060: 83 41 00 10 lwz r26,16(r1) ffc0e064: 83 61 00 14 lwz r27,20(r1) ffc0e068: 83 81 00 18 lwz r28,24(r1) ffc0e06c: 83 a1 00 1c lwz r29,28(r1) ffc0e070: 83 c1 00 20 lwz r30,32(r1) ffc0e074: 83 e1 00 24 lwz r31,36(r1) ffc0e078: 38 21 00 28 addi r1,r1,40 ffc0e07c: 4e 80 00 20 blr rtems_filesystem_eval_path_clear_path(ctx); } else { rtems_filesystem_eval_path_error(ctx, ENOSPC); } } else { rtems_filesystem_eval_path_error(ctx, ENOENT); ffc0e080: 7f 23 cb 78 mr r3,r25 <== NOT EXECUTED ffc0e084: 38 80 00 02 li r4,2 <== NOT EXECUTED ffc0e088: 4b ff ff 70 b ffc0dff8 <== NOT EXECUTED 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); ffc0e08c: 7f 23 cb 78 mr r3,r25 ffc0e090: 38 80 00 1c li r4,28 ffc0e094: 4b ff ff 64 b ffc0dff8 =============================================================================== ffc04514 : dev_t dev ) { int rv = 0; if (namelen != 3 || name [0] != 'd' || name [1] != 'e' || name [2] != 'v') { ffc04514: 2f 85 00 03 cmpwi cr7,r5,3 const char *name, size_t namelen, mode_t mode, dev_t dev ) { ffc04518: 94 21 ff d8 stwu r1,-40(r1) ffc0451c: 7c 08 02 a6 mflr r0 ffc04520: 93 61 00 14 stw r27,20(r1) ffc04524: 7d 1b 43 78 mr r27,r8 ffc04528: 93 81 00 18 stw r28,24(r1) ffc0452c: 7c fc 3b 78 mr r28,r7 ffc04530: 93 a1 00 1c stw r29,28(r1) ffc04534: 7c 7d 1b 78 mr r29,r3 ffc04538: 93 c1 00 20 stw r30,32(r1) ffc0453c: 7c de 33 78 mr r30,r6 ffc04540: 93 e1 00 24 stw r31,36(r1) ffc04544: 7c bf 2b 78 mr r31,r5 ffc04548: 90 01 00 2c stw r0,44(r1) int rv = 0; if (namelen != 3 || name [0] != 'd' || name [1] != 'e' || name [2] != 'v') { ffc0454c: 41 9e 00 78 beq- cr7,ffc045c4 if (S_ISBLK(mode) || S_ISCHR(mode)) { ffc04550: 57 c9 04 26 rlwinm r9,r30,0,16,19 ffc04554: 2f 89 60 00 cmpwi cr7,r9,24576 ffc04558: 41 9e 00 0c beq- cr7,ffc04564 ffc0455c: 2f 89 20 00 cmpwi cr7,r9,8192 ffc04560: 40 9e 00 98 bne- cr7,ffc045f8 char *dupname = malloc(namelen); ffc04564: 7f e3 fb 78 mr r3,r31 ffc04568: 90 81 00 08 stw r4,8(r1) ffc0456c: 48 00 06 2d bl ffc04b98 if (dupname != NULL) { ffc04570: 7c 6a 1b 79 mr. r10,r3 ffc04574: 80 81 00 08 lwz r4,8(r1) ffc04578: 41 82 00 94 beq- ffc0460c devFS_node *node = parentloc->node_access; ffc0457c: 81 3d 00 08 lwz r9,8(r29) node->name = dupname; node->namelen = namelen; node->major = rtems_filesystem_dev_major_t(dev); node->minor = rtems_filesystem_dev_minor_t(dev); node->mode = mode; memcpy(dupname, name, namelen); ffc04580: 7f e5 fb 78 mr r5,r31 char *dupname = malloc(namelen); if (dupname != NULL) { devFS_node *node = parentloc->node_access; node->name = dupname; ffc04584: 91 49 00 00 stw r10,0(r9) node->namelen = namelen; ffc04588: 93 e9 00 04 stw r31,4(r9) node->major = rtems_filesystem_dev_major_t(dev); ffc0458c: 93 89 00 08 stw r28,8(r9) node->minor = rtems_filesystem_dev_minor_t(dev); ffc04590: 93 69 00 0c stw r27,12(r9) node->mode = mode; ffc04594: 93 c9 00 10 stw r30,16(r9) memcpy(dupname, name, namelen); ffc04598: 48 00 c2 ad bl ffc10844 size_t namelen, mode_t mode, dev_t dev ) { int rv = 0; ffc0459c: 38 60 00 00 li r3,0 rv = -1; } } return rv; } ffc045a0: 80 01 00 2c lwz r0,44(r1) ffc045a4: 83 61 00 14 lwz r27,20(r1) ffc045a8: 7c 08 03 a6 mtlr r0 ffc045ac: 83 81 00 18 lwz r28,24(r1) ffc045b0: 83 a1 00 1c lwz r29,28(r1) ffc045b4: 83 c1 00 20 lwz r30,32(r1) ffc045b8: 83 e1 00 24 lwz r31,36(r1) ffc045bc: 38 21 00 28 addi r1,r1,40 ffc045c0: 4e 80 00 20 blr dev_t dev ) { int rv = 0; if (namelen != 3 || name [0] != 'd' || name [1] != 'e' || name [2] != 'v') { ffc045c4: 89 24 00 00 lbz r9,0(r4) ffc045c8: 2f 89 00 64 cmpwi cr7,r9,100 ffc045cc: 40 9e ff 84 bne+ cr7,ffc04550 <== NEVER TAKEN ffc045d0: 89 24 00 01 lbz r9,1(r4) ffc045d4: 2f 89 00 65 cmpwi cr7,r9,101 ffc045d8: 40 9e ff 78 bne+ cr7,ffc04550 <== NEVER TAKEN ffc045dc: 89 24 00 02 lbz r9,2(r4) ffc045e0: 2f 89 00 76 cmpwi cr7,r9,118 ffc045e4: 40 9e ff 6c bne+ cr7,ffc04550 <== NEVER TAKEN } else { errno = ENOTSUP; rv = -1; } } else { if (!S_ISDIR(mode)) { ffc045e8: 54 de 04 26 rlwinm r30,r6,0,16,19 ffc045ec: 2f 9e 40 00 cmpwi cr7,r30,16384 size_t namelen, mode_t mode, dev_t dev ) { int rv = 0; ffc045f0: 38 60 00 00 li r3,0 } else { errno = ENOTSUP; rv = -1; } } else { if (!S_ISDIR(mode)) { ffc045f4: 41 9e ff ac beq+ cr7,ffc045a0 <== ALWAYS TAKEN errno = ENOTSUP; ffc045f8: 48 00 b5 5d bl ffc0fb54 <__errno> ffc045fc: 39 20 00 86 li r9,134 ffc04600: 91 23 00 00 stw r9,0(r3) rv = -1; ffc04604: 38 60 ff ff li r3,-1 ffc04608: 4b ff ff 98 b ffc045a0 node->major = rtems_filesystem_dev_major_t(dev); node->minor = rtems_filesystem_dev_minor_t(dev); node->mode = mode; memcpy(dupname, name, namelen); } else { errno = ENOMEM; ffc0460c: 48 00 b5 49 bl ffc0fb54 <__errno> ffc04610: 39 20 00 0c li r9,12 ffc04614: 91 23 00 00 stw r9,0(r3) rv = -1; ffc04618: 38 60 ff ff li r3,-1 ffc0461c: 4b ff ff 84 b ffc045a0 =============================================================================== ffc04678 : */ static volatile bool diskdevs_protected; static rtems_status_code disk_lock(void) { ffc04678: 94 21 ff f0 stwu r1,-16(r1) ffc0467c: 7c 08 02 a6 mflr r0 rtems_status_code sc = RTEMS_SUCCESSFUL; sc = rtems_semaphore_obtain(diskdevs_mutex, RTEMS_WAIT, RTEMS_NO_TIMEOUT); ffc04680: 38 80 00 00 li r4,0 */ static volatile bool diskdevs_protected; static rtems_status_code disk_lock(void) { ffc04684: 90 01 00 14 stw r0,20(r1) rtems_status_code sc = RTEMS_SUCCESSFUL; sc = rtems_semaphore_obtain(diskdevs_mutex, RTEMS_WAIT, RTEMS_NO_TIMEOUT); ffc04688: 38 a0 00 00 li r5,0 */ static volatile bool diskdevs_protected; static rtems_status_code disk_lock(void) { ffc0468c: 93 e1 00 0c stw r31,12(r1) rtems_status_code sc = RTEMS_SUCCESSFUL; sc = rtems_semaphore_obtain(diskdevs_mutex, RTEMS_WAIT, RTEMS_NO_TIMEOUT); ffc04690: 3f e0 00 00 lis r31,0 ffc04694: 3b ff 28 48 addi r31,r31,10312 ffc04698: 80 7f 00 08 lwz r3,8(r31) ffc0469c: 48 00 68 ad bl ffc0af48 if (sc == RTEMS_SUCCESSFUL) { ffc046a0: 2f 83 00 00 cmpwi cr7,r3,0 diskdevs_protected = true; return RTEMS_SUCCESSFUL; } else { return RTEMS_NOT_CONFIGURED; ffc046a4: 38 60 00 16 li r3,22 disk_lock(void) { rtems_status_code sc = RTEMS_SUCCESSFUL; sc = rtems_semaphore_obtain(diskdevs_mutex, RTEMS_WAIT, RTEMS_NO_TIMEOUT); if (sc == RTEMS_SUCCESSFUL) { ffc046a8: 41 9e 00 18 beq- cr7,ffc046c0 <== ALWAYS TAKEN return RTEMS_SUCCESSFUL; } else { return RTEMS_NOT_CONFIGURED; } } ffc046ac: 80 01 00 14 lwz r0,20(r1) <== NOT EXECUTED ffc046b0: 83 e1 00 0c lwz r31,12(r1) <== NOT EXECUTED ffc046b4: 7c 08 03 a6 mtlr r0 <== NOT EXECUTED ffc046b8: 38 21 00 10 addi r1,r1,16 <== NOT EXECUTED ffc046bc: 4e 80 00 20 blr <== NOT EXECUTED ffc046c0: 80 01 00 14 lwz r0,20(r1) { rtems_status_code sc = RTEMS_SUCCESSFUL; sc = rtems_semaphore_obtain(diskdevs_mutex, RTEMS_WAIT, RTEMS_NO_TIMEOUT); if (sc == RTEMS_SUCCESSFUL) { diskdevs_protected = true; ffc046c4: 39 20 00 01 li r9,1 ffc046c8: 99 3f 00 0c stb r9,12(r31) return RTEMS_SUCCESSFUL; ffc046cc: 38 60 00 00 li r3,0 } else { return RTEMS_NOT_CONFIGURED; } } ffc046d0: 7c 08 03 a6 mtlr r0 ffc046d4: 83 e1 00 0c lwz r31,12(r1) ffc046d8: 38 21 00 10 addi r1,r1,16 ffc046dc: 4e 80 00 20 blr =============================================================================== ffc046e0 : static void disk_unlock(void) { ffc046e0: 94 21 ff f8 stwu r1,-8(r1) ffc046e4: 7c 08 02 a6 mflr r0 rtems_status_code sc = RTEMS_SUCCESSFUL; diskdevs_protected = false; ffc046e8: 3d 20 00 00 lis r9,0 } } static void disk_unlock(void) { ffc046ec: 90 01 00 0c stw r0,12(r1) rtems_status_code sc = RTEMS_SUCCESSFUL; diskdevs_protected = false; ffc046f0: 39 29 28 48 addi r9,r9,10312 ffc046f4: 39 40 00 00 li r10,0 sc = rtems_semaphore_release(diskdevs_mutex); ffc046f8: 80 69 00 08 lwz r3,8(r9) static void disk_unlock(void) { rtems_status_code sc = RTEMS_SUCCESSFUL; diskdevs_protected = false; ffc046fc: 99 49 00 0c stb r10,12(r9) sc = rtems_semaphore_release(diskdevs_mutex); ffc04700: 48 00 69 e9 bl ffc0b0e8 if (sc != RTEMS_SUCCESSFUL) { ffc04704: 2f 83 00 00 cmpwi cr7,r3,0 ffc04708: 40 9e 00 14 bne- cr7,ffc0471c <== NEVER TAKEN /* FIXME: Error number */ rtems_fatal_error_occurred(0xdeadbeef); } } ffc0470c: 80 01 00 0c lwz r0,12(r1) ffc04710: 38 21 00 08 addi r1,r1,8 ffc04714: 7c 08 03 a6 mtlr r0 ffc04718: 4e 80 00 20 blr diskdevs_protected = false; sc = rtems_semaphore_release(diskdevs_mutex); if (sc != RTEMS_SUCCESSFUL) { /* FIXME: Error number */ rtems_fatal_error_occurred(0xdeadbeef); ffc0471c: 3c 60 de ad lis r3,-8531 <== NOT EXECUTED ffc04720: 60 63 be ef ori r3,r3,48879 <== NOT EXECUTED ffc04724: 48 00 70 dd bl ffc0b800 <== NOT EXECUTED =============================================================================== ffc06dec : /* * Drain output queue */ static void drainOutput (struct rtems_termios_tty *tty) ffc06dec: 94 21 ff f0 stwu r1,-16(r1) ffc06df0: 7c 08 02 a6 mflr r0 ffc06df4: 90 01 00 14 stw r0,20(r1) ffc06df8: 93 e1 00 0c stw r31,12(r1) ffc06dfc: 7c 7f 1b 78 mr r31,r3 ffc06e00: 93 c1 00 08 stw r30,8(r1) static inline uint32_t ppc_interrupt_disable( void ) { uint32_t level; uint32_t mask; __asm__ volatile ( ffc06e04: 7d 20 00 a6 mfmsr r9 ffc06e08: 7d 50 42 a6 mfsprg r10,0 ffc06e0c: 7d 2a 50 78 andc r10,r9,r10 ffc06e10: 7d 40 01 24 mtmsr r10 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) { ffc06e14: 81 03 00 84 lwz r8,132(r3) ffc06e18: 81 43 00 80 lwz r10,128(r3) ffc06e1c: 7f 88 50 00 cmpw cr7,r8,r10 ffc06e20: 41 9e 00 48 beq- cr7,ffc06e68 <== ALWAYS TAKEN tty->rawOutBufState = rob_wait; ffc06e24: 3b c0 00 02 li r30,2 <== NOT EXECUTED ffc06e28: 93 df 00 94 stw r30,148(r31) <== NOT EXECUTED return level; } static inline void ppc_interrupt_enable( uint32_t level ) { __asm__ volatile ( ffc06e2c: 7d 20 01 24 mtmsr r9 <== NOT EXECUTED rtems_interrupt_enable (level); sc = rtems_semaphore_obtain( ffc06e30: 80 7f 00 8c lwz r3,140(r31) <== NOT EXECUTED ffc06e34: 38 80 00 00 li r4,0 <== NOT EXECUTED ffc06e38: 38 a0 00 00 li r5,0 <== NOT EXECUTED ffc06e3c: 48 00 2b e5 bl ffc09a20 <== NOT EXECUTED tty->rawOutBuf.Semaphore, RTEMS_WAIT, RTEMS_NO_TIMEOUT); if (sc != RTEMS_SUCCESSFUL) ffc06e40: 2f 83 00 00 cmpwi cr7,r3,0 <== NOT EXECUTED ffc06e44: 40 9e 00 40 bne- cr7,ffc06e84 <== NOT EXECUTED static inline uint32_t ppc_interrupt_disable( void ) { uint32_t level; uint32_t mask; __asm__ volatile ( ffc06e48: 7d 20 00 a6 mfmsr r9 <== NOT EXECUTED ffc06e4c: 7d 50 42 a6 mfsprg r10,0 <== NOT EXECUTED ffc06e50: 7d 2a 50 78 andc r10,r9,r10 <== NOT EXECUTED ffc06e54: 7d 40 01 24 mtmsr r10 <== 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) { ffc06e58: 81 1f 00 84 lwz r8,132(r31) <== NOT EXECUTED ffc06e5c: 81 5f 00 80 lwz r10,128(r31) <== NOT EXECUTED ffc06e60: 7f 88 50 00 cmpw cr7,r8,r10 <== NOT EXECUTED ffc06e64: 40 9e ff c4 bne+ cr7,ffc06e28 <== NOT EXECUTED return level; } static inline void ppc_interrupt_enable( uint32_t level ) { __asm__ volatile ( ffc06e68: 7d 20 01 24 mtmsr r9 rtems_fatal_error_occurred (sc); rtems_interrupt_disable (level); } rtems_interrupt_enable (level); } } ffc06e6c: 80 01 00 14 lwz r0,20(r1) ffc06e70: 83 c1 00 08 lwz r30,8(r1) ffc06e74: 7c 08 03 a6 mtlr r0 ffc06e78: 83 e1 00 0c lwz r31,12(r1) ffc06e7c: 38 21 00 10 addi r1,r1,16 ffc06e80: 4e 80 00 20 blr tty->rawOutBufState = rob_wait; rtems_interrupt_enable (level); sc = rtems_semaphore_obtain( tty->rawOutBuf.Semaphore, RTEMS_WAIT, RTEMS_NO_TIMEOUT); if (sc != RTEMS_SUCCESSFUL) rtems_fatal_error_occurred (sc); ffc06e84: 48 00 35 15 bl ffc0a398 <== NOT EXECUTED =============================================================================== ffc0516c : */ int dup2( int fildes, int fildes2 ) { ffc0516c: 94 21 ff a0 stwu r1,-96(r1) ffc05170: 7c 08 02 a6 mflr r0 ffc05174: 93 e1 00 5c stw r31,92(r1) ffc05178: 7c 9f 23 78 mr r31,r4 /* * If fildes is not valid, then fildes2 should not be closed. */ status = fstat( fildes, &buf ); ffc0517c: 38 81 00 08 addi r4,r1,8 */ int dup2( int fildes, int fildes2 ) { ffc05180: 93 c1 00 58 stw r30,88(r1) ffc05184: 7c 7e 1b 78 mr r30,r3 ffc05188: 90 01 00 64 stw r0,100(r1) /* * If fildes is not valid, then fildes2 should not be closed. */ status = fstat( fildes, &buf ); ffc0518c: 48 00 05 f1 bl ffc0577c if ( status == -1 ) ffc05190: 2f 83 ff ff cmpwi cr7,r3,-1 ffc05194: 41 9e 00 44 beq- cr7,ffc051d8 /* * If fildes2 is not valid, then we should not do anything either. */ status = fstat( fildes2, &buf ); ffc05198: 7f e3 fb 78 mr r3,r31 ffc0519c: 38 81 00 08 addi r4,r1,8 ffc051a0: 48 00 05 dd bl ffc0577c if ( status == -1 ) ffc051a4: 2f 83 ff ff cmpwi cr7,r3,-1 ffc051a8: 41 9e 00 30 beq- cr7,ffc051d8 <== NEVER TAKEN /* * This fcntl handles everything else. */ return fcntl( fildes, F_DUPFD, fildes2 ); ffc051ac: 7f c3 f3 78 mr r3,r30 ffc051b0: 38 80 00 00 li r4,0 ffc051b4: 7f e5 fb 78 mr r5,r31 ffc051b8: 4c c6 31 82 crclr 4*cr1+eq ffc051bc: 48 00 00 35 bl ffc051f0 } ffc051c0: 80 01 00 64 lwz r0,100(r1) ffc051c4: 83 c1 00 58 lwz r30,88(r1) ffc051c8: 7c 08 03 a6 mtlr r0 ffc051cc: 83 e1 00 5c lwz r31,92(r1) ffc051d0: 38 21 00 60 addi r1,r1,96 ffc051d4: 4e 80 00 20 blr * If fildes is not valid, then fildes2 should not be closed. */ status = fstat( fildes, &buf ); if ( status == -1 ) return -1; ffc051d8: 38 60 ff ff li r3,-1 ffc051dc: 4b ff ff e4 b ffc051c0 =============================================================================== ffc07d70 : /* * Echo a typed character */ static void echo (unsigned char c, struct rtems_termios_tty *tty) { ffc07d70: 94 21 ff e0 stwu r1,-32(r1) ffc07d74: 7c 08 02 a6 mflr r0 ffc07d78: 90 01 00 24 stw r0,36(r1) if ((tty->termios.c_lflag & ECHOCTL) && ffc07d7c: 81 24 00 3c lwz r9,60(r4) /* * Echo a typed character */ static void echo (unsigned char c, struct rtems_termios_tty *tty) { ffc07d80: 93 e1 00 1c stw r31,28(r1) ffc07d84: 7c 9f 23 78 mr r31,r4 if ((tty->termios.c_lflag & ECHOCTL) && ffc07d88: 71 2a 02 00 andi. r10,r9,512 ffc07d8c: 41 82 00 30 beq- ffc07dbc <== NEVER TAKEN iscntrl(c) && (c != '\t') && (c != '\n')) { ffc07d90: 3d 20 00 00 lis r9,0 ffc07d94: 81 29 27 a0 lwz r9,10144(r9) ffc07d98: 7d 29 1a 14 add r9,r9,r3 ffc07d9c: 89 29 00 01 lbz r9,1(r9) * Echo a typed character */ static void echo (unsigned char c, struct rtems_termios_tty *tty) { if ((tty->termios.c_lflag & ECHOCTL) && ffc07da0: 55 29 06 b4 rlwinm r9,r9,0,26,26 ffc07da4: 71 2a 00 ff andi. r10,r9,255 ffc07da8: 41 82 00 14 beq- ffc07dbc iscntrl(c) && (c != '\t') && (c != '\n')) { ffc07dac: 2f 83 00 09 cmpwi cr7,r3,9 ffc07db0: 41 9e 00 0c beq- cr7,ffc07dbc ffc07db4: 2f 83 00 0a cmpwi cr7,r3,10 ffc07db8: 40 9e 00 20 bne- cr7,ffc07dd8 echobuf[0] = '^'; echobuf[1] = c ^ 0x40; rtems_termios_puts (echobuf, 2, tty); tty->column += 2; } else { oproc (c, tty); ffc07dbc: 7f e4 fb 78 mr r4,r31 ffc07dc0: 4b ff fe 25 bl ffc07be4 } } ffc07dc4: 80 01 00 24 lwz r0,36(r1) ffc07dc8: 83 e1 00 1c lwz r31,28(r1) ffc07dcc: 7c 08 03 a6 mtlr r0 ffc07dd0: 38 21 00 20 addi r1,r1,32 ffc07dd4: 4e 80 00 20 blr if ((tty->termios.c_lflag & ECHOCTL) && iscntrl(c) && (c != '\t') && (c != '\n')) { char echobuf[2]; echobuf[0] = '^'; echobuf[1] = c ^ 0x40; ffc07dd8: 68 69 00 40 xori r9,r3,64 rtems_termios_puts (echobuf, 2, tty); ffc07ddc: 7f e5 fb 78 mr r5,r31 if ((tty->termios.c_lflag & ECHOCTL) && iscntrl(c) && (c != '\t') && (c != '\n')) { char echobuf[2]; echobuf[0] = '^'; echobuf[1] = c ^ 0x40; ffc07de0: 99 21 00 09 stb r9,9(r1) rtems_termios_puts (echobuf, 2, tty); ffc07de4: 38 61 00 08 addi r3,r1,8 { if ((tty->termios.c_lflag & ECHOCTL) && iscntrl(c) && (c != '\t') && (c != '\n')) { char echobuf[2]; echobuf[0] = '^'; ffc07de8: 39 40 00 5e li r10,94 echobuf[1] = c ^ 0x40; rtems_termios_puts (echobuf, 2, tty); ffc07dec: 38 80 00 02 li r4,2 { if ((tty->termios.c_lflag & ECHOCTL) && iscntrl(c) && (c != '\t') && (c != '\n')) { char echobuf[2]; echobuf[0] = '^'; ffc07df0: 99 41 00 08 stb r10,8(r1) echobuf[1] = c ^ 0x40; rtems_termios_puts (echobuf, 2, tty); ffc07df4: 4b ff fc 45 bl ffc07a38 tty->column += 2; } else { oproc (c, tty); } } ffc07df8: 80 01 00 24 lwz r0,36(r1) char echobuf[2]; echobuf[0] = '^'; echobuf[1] = c ^ 0x40; rtems_termios_puts (echobuf, 2, tty); tty->column += 2; ffc07dfc: 81 3f 00 28 lwz r9,40(r31) } else { oproc (c, tty); } } ffc07e00: 7c 08 03 a6 mtlr r0 char echobuf[2]; echobuf[0] = '^'; echobuf[1] = c ^ 0x40; rtems_termios_puts (echobuf, 2, tty); tty->column += 2; ffc07e04: 39 29 00 02 addi r9,r9,2 ffc07e08: 91 3f 00 28 stw r9,40(r31) } else { oproc (c, tty); } } ffc07e0c: 83 e1 00 1c lwz r31,28(r1) ffc07e10: 38 21 00 20 addi r1,r1,32 ffc07e14: 4e 80 00 20 blr =============================================================================== ffc07e18 : * 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) ffc07e18: 94 21 ff d8 stwu r1,-40(r1) ffc07e1c: 7d 80 00 26 mfcr r12 ffc07e20: 7c 08 02 a6 mflr r0 while (tty->ccount) { unsigned char c = tty->cbuf[--tty->ccount]; if (tty->termios.c_lflag & ECHO) { if (!lineFlag && !(tty->termios.c_lflag & ECHOE)) { ffc07e24: 2e 04 00 00 cmpwi cr4,r4,0 * 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) ffc07e28: 93 61 00 14 stw r27,20(r1) tty->column--; } } else { if (iscntrl (c) && (tty->termios.c_lflag & ECHOCTL)) { rtems_termios_puts ("\b \b", 3, tty); ffc07e2c: 3f 60 ff c2 lis r27,-62 ffc07e30: 3b 7b e7 80 addi r27,r27,-6272 * 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) ffc07e34: 93 a1 00 1c stw r29,28(r1) ffc07e38: 3f a0 ff c2 lis r29,-62 ffc07e3c: 3b bd e7 7c addi r29,r29,-6276 ffc07e40: 90 01 00 2c stw r0,44(r1) ffc07e44: 93 41 00 10 stw r26,16(r1) ffc07e48: 93 c1 00 20 stw r30,32(r1) ffc07e4c: 91 81 00 0c stw r12,12(r1) ffc07e50: 93 81 00 18 stw r28,24(r1) rtems_termios_puts ("\b", 1, tty); tty->column--; } } else { if (iscntrl (c) && (tty->termios.c_lflag & ECHOCTL)) { ffc07e54: 3f 80 00 00 lis r28,0 * 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) ffc07e58: 93 e1 00 24 stw r31,36(r1) ffc07e5c: 7c 7f 1b 78 mr r31,r3 echo ('\n', tty); return; } } while (tty->ccount) { ffc07e60: 81 5f 00 20 lwz r10,32(r31) ffc07e64: 2f 8a 00 00 cmpwi cr7,r10,0 ffc07e68: 41 9e 00 78 beq- cr7,ffc07ee0 unsigned char c = tty->cbuf[--tty->ccount]; if (tty->termios.c_lflag & ECHO) { ffc07e6c: 81 3f 00 3c lwz r9,60(r31) return; } } while (tty->ccount) { unsigned char c = tty->cbuf[--tty->ccount]; ffc07e70: 39 4a ff ff addi r10,r10,-1 ffc07e74: 81 1f 00 1c lwz r8,28(r31) if (tty->termios.c_lflag & ECHO) { ffc07e78: 71 26 00 08 andi. r6,r9,8 return; } } while (tty->ccount) { unsigned char c = tty->cbuf[--tty->ccount]; ffc07e7c: 91 5f 00 20 stw r10,32(r31) ffc07e80: 7c e8 50 ae lbzx r7,r8,r10 if (tty->termios.c_lflag & ECHO) { ffc07e84: 41 82 00 58 beq- ffc07edc <== NEVER TAKEN if (!lineFlag && !(tty->termios.c_lflag & ECHOE)) { ffc07e88: 40 92 00 0c bne- cr4,ffc07e94 ffc07e8c: 71 26 00 10 andi. r6,r9,16 ffc07e90: 41 82 01 74 beq- ffc08004 <== NEVER TAKEN echo (tty->termios.c_cc[VERASE], tty); } else if (c == '\t') { ffc07e94: 2f 87 00 09 cmpwi cr7,r7,9 ffc07e98: 41 9e 00 c8 beq- cr7,ffc07f60 rtems_termios_puts ("\b", 1, tty); tty->column--; } } else { if (iscntrl (c) && (tty->termios.c_lflag & ECHOCTL)) { ffc07e9c: 81 5c 27 a0 lwz r10,10144(r28) ffc07ea0: 3b c7 00 01 addi r30,r7,1 ffc07ea4: 7d 4a f0 ae lbzx r10,r10,r30 ffc07ea8: 55 4a 06 b4 rlwinm r10,r10,0,26,26 ffc07eac: 71 48 00 ff andi. r8,r10,255 ffc07eb0: 40 82 00 60 bne- ffc07f10 <== NEVER TAKEN ffc07eb4: 7f 7a db 78 mr r26,r27 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); ffc07eb8: 7f 43 d3 78 mr r3,r26 ffc07ebc: 38 80 00 03 li r4,3 ffc07ec0: 7f e5 fb 78 mr r5,r31 ffc07ec4: 4b ff fb 75 bl ffc07a38 if (tty->column) ffc07ec8: 81 3f 00 28 lwz r9,40(r31) ffc07ecc: 2f 89 00 00 cmpwi cr7,r9,0 ffc07ed0: 41 9e 00 0c beq- cr7,ffc07edc <== NEVER TAKEN tty->column--; ffc07ed4: 39 29 ff ff addi r9,r9,-1 ffc07ed8: 91 3f 00 28 stw r9,40(r31) } } } if (!lineFlag) ffc07edc: 40 92 ff 84 bne+ cr4,ffc07e60 break; } } ffc07ee0: 80 01 00 2c lwz r0,44(r1) ffc07ee4: 81 81 00 0c lwz r12,12(r1) ffc07ee8: 7c 08 03 a6 mtlr r0 ffc07eec: 83 41 00 10 lwz r26,16(r1) ffc07ef0: 83 61 00 14 lwz r27,20(r1) ffc07ef4: 7d 80 81 20 mtcrf 8,r12 ffc07ef8: 83 81 00 18 lwz r28,24(r1) ffc07efc: 83 a1 00 1c lwz r29,28(r1) ffc07f00: 83 c1 00 20 lwz r30,32(r1) ffc07f04: 83 e1 00 24 lwz r31,36(r1) ffc07f08: 38 21 00 28 addi r1,r1,40 ffc07f0c: 4e 80 00 20 blr rtems_termios_puts ("\b", 1, tty); tty->column--; } } else { if (iscntrl (c) && (tty->termios.c_lflag & ECHOCTL)) { ffc07f10: 71 2a 02 00 andi. r10,r9,512 <== NOT EXECUTED ffc07f14: 41 82 ff c8 beq+ ffc07edc <== NOT EXECUTED rtems_termios_puts ("\b \b", 3, tty); ffc07f18: 7f 63 db 78 mr r3,r27 <== NOT EXECUTED ffc07f1c: 38 80 00 03 li r4,3 <== NOT EXECUTED ffc07f20: 7f e5 fb 78 mr r5,r31 <== NOT EXECUTED ffc07f24: 4b ff fb 15 bl ffc07a38 <== NOT EXECUTED if (tty->column) ffc07f28: 81 3f 00 28 lwz r9,40(r31) <== NOT EXECUTED tty->column--; } } else { if (iscntrl (c) && (tty->termios.c_lflag & ECHOCTL)) { rtems_termios_puts ("\b \b", 3, tty); ffc07f2c: 7f 7a db 78 mr r26,r27 <== NOT EXECUTED if (tty->column) ffc07f30: 2f 89 00 00 cmpwi cr7,r9,0 <== NOT EXECUTED ffc07f34: 40 9e 01 08 bne- cr7,ffc0803c <== NOT EXECUTED tty->column--; } if (!iscntrl (c) || (tty->termios.c_lflag & ECHOCTL)) { ffc07f38: 81 3c 27 a0 lwz r9,10144(r28) <== NOT EXECUTED ffc07f3c: 7d 29 f0 ae lbzx r9,r9,r30 <== NOT EXECUTED ffc07f40: 55 29 06 b4 rlwinm r9,r9,0,26,26 <== NOT EXECUTED ffc07f44: 71 26 00 ff andi. r6,r9,255 <== NOT EXECUTED ffc07f48: 41 a2 ff 70 beq- ffc07eb8 <== NOT EXECUTED ffc07f4c: 81 3f 00 3c lwz r9,60(r31) <== NOT EXECUTED ffc07f50: 71 27 02 00 andi. r7,r9,512 <== NOT EXECUTED ffc07f54: 40 82 ff 64 bne+ ffc07eb8 <== NOT EXECUTED if (tty->column) tty->column--; } } } if (!lineFlag) ffc07f58: 40 92 ff 08 bne+ cr4,ffc07e60 <== NOT EXECUTED ffc07f5c: 4b ff ff 84 b ffc07ee0 <== NOT EXECUTED int i = 0; /* * Find the character before the tab */ while (i != tty->ccount) { ffc07f60: 2f 8a 00 00 cmpwi cr7,r10,0 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; ffc07f64: 83 df 00 2c lwz r30,44(r31) int i = 0; /* * Find the character before the tab */ while (i != tty->ccount) { ffc07f68: 41 9e 00 48 beq- cr7,ffc07fb0 c = tty->cbuf[i++]; if (c == '\t') { col = (col | 7) + 1; } else if (iscntrl (c)) { if (tty->termios.c_lflag & ECHOCTL) ffc07f6c: 7d 49 03 a6 mtctr r10 */ while (i != tty->ccount) { c = tty->cbuf[i++]; if (c == '\t') { col = (col | 7) + 1; } else if (iscntrl (c)) { ffc07f70: 80 dc 27 a0 lwz r6,10144(r28) if (tty->termios.c_lflag & ECHOCTL) ffc07f74: 71 27 02 00 andi. r7,r9,512 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; ffc07f78: 39 20 00 00 li r9,0 /* * Find the character before the tab */ while (i != tty->ccount) { c = tty->cbuf[i++]; ffc07f7c: 7d 48 48 ae lbzx r10,r8,r9 ffc07f80: 39 29 00 01 addi r9,r9,1 if (c == '\t') { ffc07f84: 2f 8a 00 09 cmpwi cr7,r10,9 col = (col | 7) + 1; } else if (iscntrl (c)) { ffc07f88: 7c e6 52 14 add r7,r6,r10 /* * Find the character before the tab */ while (i != tty->ccount) { c = tty->cbuf[i++]; if (c == '\t') { ffc07f8c: 41 9e 00 68 beq- cr7,ffc07ff4 col = (col | 7) + 1; } else if (iscntrl (c)) { ffc07f90: 89 47 00 01 lbz r10,1(r7) ffc07f94: 55 4a 06 b4 rlwinm r10,r10,0,26,26 ffc07f98: 55 47 06 3e clrlwi r7,r10,24 ffc07f9c: 2f 87 00 00 cmpwi cr7,r7,0 ffc07fa0: 41 9e 00 48 beq- cr7,ffc07fe8 <== ALWAYS TAKEN if (tty->termios.c_lflag & ECHOCTL) ffc07fa4: 41 82 00 08 beq- ffc07fac <== NOT EXECUTED col += 2; ffc07fa8: 3b de 00 02 addi r30,r30,2 <== NOT EXECUTED int i = 0; /* * Find the character before the tab */ while (i != tty->ccount) { ffc07fac: 42 00 ff d0 bdnz+ ffc07f7c <== NOT EXECUTED } /* * Back up over the tab */ while (tty->column > col) { ffc07fb0: 81 3f 00 28 lwz r9,40(r31) ffc07fb4: 7f 89 f0 00 cmpw cr7,r9,r30 ffc07fb8: 40 bd ff 24 ble- cr7,ffc07edc <== NEVER TAKEN rtems_termios_puts ("\b", 1, tty); ffc07fbc: 7f a3 eb 78 mr r3,r29 ffc07fc0: 38 80 00 01 li r4,1 ffc07fc4: 7f e5 fb 78 mr r5,r31 ffc07fc8: 4b ff fa 71 bl ffc07a38 tty->column--; ffc07fcc: 81 3f 00 28 lwz r9,40(r31) ffc07fd0: 39 29 ff ff addi r9,r9,-1 } /* * Back up over the tab */ while (tty->column > col) { ffc07fd4: 7f 89 f0 00 cmpw cr7,r9,r30 rtems_termios_puts ("\b", 1, tty); tty->column--; ffc07fd8: 91 3f 00 28 stw r9,40(r31) } /* * Back up over the tab */ while (tty->column > col) { ffc07fdc: 41 9d ff e0 bgt+ cr7,ffc07fbc if (tty->column) tty->column--; } } } if (!lineFlag) ffc07fe0: 40 92 fe 80 bne+ cr4,ffc07e60 <== ALWAYS TAKEN ffc07fe4: 4b ff fe fc b ffc07ee0 <== NOT EXECUTED col = (col | 7) + 1; } else if (iscntrl (c)) { if (tty->termios.c_lflag & ECHOCTL) col += 2; } else { col++; ffc07fe8: 3b de 00 01 addi r30,r30,1 int i = 0; /* * Find the character before the tab */ while (i != tty->ccount) { ffc07fec: 42 00 ff 90 bdnz+ ffc07f7c ffc07ff0: 4b ff ff c0 b ffc07fb0 c = tty->cbuf[i++]; if (c == '\t') { col = (col | 7) + 1; ffc07ff4: 63 de 00 07 ori r30,r30,7 ffc07ff8: 3b de 00 01 addi r30,r30,1 int i = 0; /* * Find the character before the tab */ while (i != tty->ccount) { ffc07ffc: 42 00 ff 80 bdnz+ ffc07f7c ffc08000: 4b ff ff b0 b ffc07fb0 <== NOT EXECUTED } } if (!lineFlag) break; } } ffc08004: 80 01 00 2c lwz r0,44(r1) <== NOT EXECUTED while (tty->ccount) { unsigned char c = tty->cbuf[--tty->ccount]; if (tty->termios.c_lflag & ECHO) { if (!lineFlag && !(tty->termios.c_lflag & ECHOE)) { echo (tty->termios.c_cc[VERASE], tty); ffc08008: 7f e4 fb 78 mr r4,r31 <== NOT EXECUTED } } if (!lineFlag) break; } } ffc0800c: 81 81 00 0c lwz r12,12(r1) <== NOT EXECUTED ffc08010: 7c 08 03 a6 mtlr r0 <== NOT EXECUTED while (tty->ccount) { unsigned char c = tty->cbuf[--tty->ccount]; if (tty->termios.c_lflag & ECHO) { if (!lineFlag && !(tty->termios.c_lflag & ECHOE)) { echo (tty->termios.c_cc[VERASE], tty); ffc08014: 88 7f 00 43 lbz r3,67(r31) <== NOT EXECUTED } } if (!lineFlag) break; } } ffc08018: 83 41 00 10 lwz r26,16(r1) <== NOT EXECUTED ffc0801c: 7d 80 81 20 mtcrf 8,r12 <== NOT EXECUTED ffc08020: 83 61 00 14 lwz r27,20(r1) <== NOT EXECUTED ffc08024: 83 81 00 18 lwz r28,24(r1) <== NOT EXECUTED ffc08028: 83 a1 00 1c lwz r29,28(r1) <== NOT EXECUTED ffc0802c: 83 c1 00 20 lwz r30,32(r1) <== NOT EXECUTED ffc08030: 83 e1 00 24 lwz r31,36(r1) <== NOT EXECUTED ffc08034: 38 21 00 28 addi r1,r1,40 <== NOT EXECUTED while (tty->ccount) { unsigned char c = tty->cbuf[--tty->ccount]; if (tty->termios.c_lflag & ECHO) { if (!lineFlag && !(tty->termios.c_lflag & ECHOE)) { echo (tty->termios.c_cc[VERASE], tty); ffc08038: 4b ff fd 38 b ffc07d70 <== NOT EXECUTED } else { if (iscntrl (c) && (tty->termios.c_lflag & ECHOCTL)) { rtems_termios_puts ("\b \b", 3, tty); if (tty->column) tty->column--; ffc0803c: 39 29 ff ff addi r9,r9,-1 <== NOT EXECUTED ffc08040: 91 3f 00 28 stw r9,40(r31) <== NOT EXECUTED ffc08044: 4b ff fe f4 b ffc07f38 <== NOT EXECUTED =============================================================================== ffc0605c : size_t pathlen, int eval_flags, rtems_filesystem_global_location_t *const *global_root_ptr, rtems_filesystem_global_location_t *const *global_current_ptr ) { ffc0605c: 94 21 ff d0 stwu r1,-48(r1) ffc06060: 7c 08 02 a6 mflr r0 ffc06064: 93 a1 00 24 stw r29,36(r1) ffc06068: 7c 9d 23 78 mr r29,r4 memset(ctx, 0, sizeof(*ctx)); ffc0606c: 38 80 00 00 li r4,0 size_t pathlen, int eval_flags, rtems_filesystem_global_location_t *const *global_root_ptr, rtems_filesystem_global_location_t *const *global_current_ptr ) { ffc06070: 93 c1 00 28 stw r30,40(r1) ffc06074: 7c be 2b 78 mr r30,r5 memset(ctx, 0, sizeof(*ctx)); ffc06078: 38 a0 00 38 li r5,56 size_t pathlen, int eval_flags, rtems_filesystem_global_location_t *const *global_root_ptr, rtems_filesystem_global_location_t *const *global_current_ptr ) { ffc0607c: 93 41 00 18 stw r26,24(r1) ffc06080: 7d 1a 43 78 mr r26,r8 ffc06084: 93 61 00 1c stw r27,28(r1) ffc06088: 7c fb 3b 78 mr r27,r7 ffc0608c: 93 81 00 20 stw r28,32(r1) ffc06090: 7c dc 33 78 mr r28,r6 ffc06094: 93 e1 00 2c stw r31,44(r1) ffc06098: 7c 7f 1b 78 mr r31,r3 ffc0609c: 90 01 00 34 stw r0,52(r1) memset(ctx, 0, sizeof(*ctx)); ffc060a0: 48 00 cd d1 bl ffc12e70 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) { ffc060a4: 2f 9e 00 00 cmpwi cr7,r30,0 rtems_filesystem_global_location_t *const *global_current_ptr ) { memset(ctx, 0, sizeof(*ctx)); ctx->path = path; ffc060a8: 93 bf 00 00 stw r29,0(r31) ctx->pathlen = pathlen; ffc060ac: 93 df 00 04 stw r30,4(r31) ctx->flags = eval_flags; ffc060b0: 93 9f 00 10 stw r28,16(r31) 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) { ffc060b4: 41 9e 00 34 beq- cr7,ffc060e8 char c = ctx->path [0]; ffc060b8: 8b dd 00 00 lbz r30,0(r29) ctx->rootloc = rtems_filesystem_global_location_obtain(global_root_ptr); ffc060bc: 7f 63 db 78 mr r3,r27 ffc060c0: 48 00 08 39 bl ffc068f8 gid_t node_gid ); static inline bool rtems_filesystem_is_delimiter(char c) { return c == '/' || c == '\\'; ffc060c4: 2f 9e 00 2f cmpwi cr7,r30,47 ffc060c8: 90 7f 00 30 stw r3,48(r31) ffc060cc: 41 9e 00 a8 beq- cr7,ffc06174 ffc060d0: 2f 9e 00 5c cmpwi cr7,r30,92 ffc060d4: 41 9e 00 a0 beq- cr7,ffc06174 <== NEVER TAKEN --ctx->pathlen; ctx->startloc = rtems_filesystem_global_location_obtain( &ctx->rootloc ); } else { ctx->startloc = rtems_filesystem_global_location_obtain( ffc060d8: 7f 43 d3 78 mr r3,r26 ffc060dc: 48 00 08 1d bl ffc068f8 ffc060e0: 90 7f 00 34 stw r3,52(r31) ffc060e4: 48 00 00 38 b ffc0611c ); static inline rtems_filesystem_global_location_t * rtems_filesystem_global_location_obtain_null(void) { rtems_filesystem_global_location_t *global_loc = NULL; ffc060e8: 7c 3d 0b 78 mr r29,r1 ffc060ec: 97 dd 00 08 stwu r30,8(r29) return rtems_filesystem_global_location_obtain( &global_loc ); ffc060f0: 7f a3 eb 78 mr r3,r29 ffc060f4: 48 00 08 05 bl ffc068f8 ); static inline rtems_filesystem_global_location_t * rtems_filesystem_global_location_obtain_null(void) { rtems_filesystem_global_location_t *global_loc = NULL; ffc060f8: 93 c1 00 08 stw r30,8(r1) global_current_ptr ); } } else { ctx->rootloc = rtems_filesystem_global_location_obtain_null(); ffc060fc: 90 7f 00 30 stw r3,48(r31) return rtems_filesystem_global_location_obtain( &global_loc ); ffc06100: 7f a3 eb 78 mr r3,r29 ffc06104: 48 00 07 f5 bl ffc068f8 ctx->startloc = rtems_filesystem_global_location_obtain_null(); ffc06108: 90 7f 00 34 stw r3,52(r31) errno = ENOENT; ffc0610c: 48 00 bf 6d bl ffc12078 <__errno> ffc06110: 39 20 00 02 li r9,2 ffc06114: 91 23 00 00 stw r9,0(r3) ffc06118: 80 7f 00 34 lwz r3,52(r31) &ctx->startloc, rtems_filesystem_global_location_obtain(newstartloc_ptr) ); rtems_filesystem_instance_lock(&ctx->startloc->location); rtems_filesystem_location_clone(&ctx->currentloc, &ctx->startloc->location); } ffc0611c: 80 63 00 14 lwz r3,20(r3) set_startloc(ctx, global_root_ptr, global_current_ptr); rtems_filesystem_instance_lock(&ctx->startloc->location); rtems_filesystem_location_clone( ffc06120: 3b df 00 18 addi r30,r31,24 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 ); ffc06124: 81 23 00 0c lwz r9,12(r3) ffc06128: 81 29 00 00 lwz r9,0(r9) ffc0612c: 7d 29 03 a6 mtctr r9 ffc06130: 4e 80 04 21 bctrl ffc06134: 80 9f 00 34 lwz r4,52(r31) ffc06138: 7f c3 f3 78 mr r3,r30 ffc0613c: 48 00 89 a5 bl ffc0eae0 &ctx->currentloc, &ctx->startloc->location ); rtems_filesystem_eval_path_continue(ctx); ffc06140: 7f e3 fb 78 mr r3,r31 ffc06144: 4b ff fe 7d bl ffc05fc0 return &ctx->currentloc; } ffc06148: 80 01 00 34 lwz r0,52(r1) ffc0614c: 7f c3 f3 78 mr r3,r30 ffc06150: 83 41 00 18 lwz r26,24(r1) ffc06154: 7c 08 03 a6 mtlr r0 ffc06158: 83 61 00 1c lwz r27,28(r1) ffc0615c: 83 81 00 20 lwz r28,32(r1) ffc06160: 83 a1 00 24 lwz r29,36(r1) ffc06164: 83 c1 00 28 lwz r30,40(r1) ffc06168: 83 e1 00 2c lwz r31,44(r1) ffc0616c: 38 21 00 30 addi r1,r1,48 ffc06170: 4e 80 00 20 blr char c = ctx->path [0]; ctx->rootloc = rtems_filesystem_global_location_obtain(global_root_ptr); if (rtems_filesystem_is_delimiter(c)) { ++ctx->path; ffc06174: 81 5f 00 00 lwz r10,0(r31) --ctx->pathlen; ctx->startloc = rtems_filesystem_global_location_obtain( ffc06178: 38 7f 00 30 addi r3,r31,48 ctx->rootloc = rtems_filesystem_global_location_obtain(global_root_ptr); if (rtems_filesystem_is_delimiter(c)) { ++ctx->path; --ctx->pathlen; ffc0617c: 81 3f 00 04 lwz r9,4(r31) char c = ctx->path [0]; ctx->rootloc = rtems_filesystem_global_location_obtain(global_root_ptr); if (rtems_filesystem_is_delimiter(c)) { ++ctx->path; ffc06180: 39 4a 00 01 addi r10,r10,1 --ctx->pathlen; ffc06184: 39 29 ff ff addi r9,r9,-1 char c = ctx->path [0]; ctx->rootloc = rtems_filesystem_global_location_obtain(global_root_ptr); if (rtems_filesystem_is_delimiter(c)) { ++ctx->path; ffc06188: 91 5f 00 00 stw r10,0(r31) --ctx->pathlen; ffc0618c: 91 3f 00 04 stw r9,4(r31) ctx->startloc = rtems_filesystem_global_location_obtain( ffc06190: 48 00 07 69 bl ffc068f8 ffc06194: 90 7f 00 34 stw r3,52(r31) ffc06198: 4b ff ff 84 b ffc0611c =============================================================================== ffc170a4 : int fat_buf_access(fat_fs_info_t *fs_info, const uint32_t sec_num, const int op_type, uint8_t **sec_buf) { ffc170a4: 94 21 ff e0 stwu r1,-32(r1) ffc170a8: 7c 08 02 a6 mflr r0 ffc170ac: 93 41 00 08 stw r26,8(r1) ffc170b0: 7c ba 2b 78 mr r26,r5 ffc170b4: 93 61 00 0c stw r27,12(r1) ffc170b8: 93 81 00 10 stw r28,16(r1) ffc170bc: 7c dc 33 78 mr r28,r6 ffc170c0: 93 a1 00 14 stw r29,20(r1) ffc170c4: 93 c1 00 18 stw r30,24(r1) ffc170c8: 7c 9e 23 78 mr r30,r4 ffc170cc: 93 e1 00 1c stw r31,28(r1) ffc170d0: 7c 7f 1b 78 mr r31,r3 ffc170d4: 90 01 00 24 stw r0,36(r1) 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) ffc170d8: 89 03 00 89 lbz r8,137(r3) 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); ffc170dc: 89 23 00 02 lbz r9,2(r3) ffc170e0: 89 43 00 0c lbz r10,12(r3) ffc170e4: 2f 88 00 00 cmpwi cr7,r8,0 ffc170e8: 7d 49 50 50 subf r10,r9,r10 ffc170ec: 7c 9d 54 30 srw r29,r4,r10 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); ffc170f0: 7f aa 50 30 slw r10,r29,r10 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 - ffc170f4: 7d 4a 20 50 subf r10,r10,r4 fat_block_num_to_sector_num (fs_info, fat_sector_num_to_block_num (fs_info, sector))) << fs_info->vol.sec_log2); ffc170f8: 7d 5b 48 30 slw r27,r10,r9 ffc170fc: 41 9e 00 10 beq- cr7,ffc1710c ffc17100: 81 23 00 84 lwz r9,132(r3) ffc17104: 7f 89 20 00 cmpw cr7,r9,r4 ffc17108: 41 9e 00 3c beq- cr7,ffc17144 { fat_buf_release(fs_info); ffc1710c: 7f e3 fb 78 mr r3,r31 ffc17110: 4b ff fd b1 bl ffc16ec0 if (op_type == FAT_OP_TYPE_READ) ffc17114: 2f 9a 00 01 cmpwi cr7,r26,1 sc = rtems_bdbuf_read(fs_info->vol.dd, blk, &fs_info->c.buf); ffc17118: 80 7f 00 64 lwz r3,100(r31) ffc1711c: 7f a4 eb 78 mr r4,r29 ffc17120: 38 bf 00 8c addi r5,r31,140 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) ffc17124: 41 9e 00 5c beq- cr7,ffc17180 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); ffc17128: 4b ff d1 b5 bl ffc142dc if (sc != RTEMS_SUCCESSFUL) ffc1712c: 2f 83 00 00 cmpwi cr7,r3,0 ffc17130: 40 9e 00 58 bne- cr7,ffc17188 <== NEVER TAKEN rtems_set_errno_and_return_minus_one(EIO); fs_info->c.blk_num = sec_num; fs_info->c.modified = 0; fs_info->c.state = FAT_CACHE_ACTUAL; ffc17134: 39 20 00 01 li r9,1 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); if (sc != RTEMS_SUCCESSFUL) rtems_set_errno_and_return_minus_one(EIO); fs_info->c.blk_num = sec_num; ffc17138: 93 df 00 84 stw r30,132(r31) fs_info->c.modified = 0; ffc1713c: 98 7f 00 88 stb r3,136(r31) fs_info->c.state = FAT_CACHE_ACTUAL; ffc17140: 99 3f 00 89 stb r9,137(r31) } *sec_buf = &fs_info->c.buf->buffer[blk_ofs]; ffc17144: 81 3f 00 8c lwz r9,140(r31) return RC_OK; ffc17148: 38 60 00 00 li r3,0 rtems_set_errno_and_return_minus_one(EIO); fs_info->c.blk_num = sec_num; fs_info->c.modified = 0; fs_info->c.state = FAT_CACHE_ACTUAL; } *sec_buf = &fs_info->c.buf->buffer[blk_ofs]; ffc1714c: 81 29 00 1c lwz r9,28(r9) ffc17150: 7f 69 da 14 add r27,r9,r27 ffc17154: 93 7c 00 00 stw r27,0(r28) return RC_OK; } ffc17158: 80 01 00 24 lwz r0,36(r1) ffc1715c: 83 41 00 08 lwz r26,8(r1) ffc17160: 7c 08 03 a6 mtlr r0 ffc17164: 83 61 00 0c lwz r27,12(r1) ffc17168: 83 81 00 10 lwz r28,16(r1) ffc1716c: 83 a1 00 14 lwz r29,20(r1) ffc17170: 83 c1 00 18 lwz r30,24(r1) ffc17174: 83 e1 00 1c lwz r31,28(r1) ffc17178: 38 21 00 20 addi r1,r1,32 ffc1717c: 4e 80 00 20 blr 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) sc = rtems_bdbuf_read(fs_info->vol.dd, blk, &fs_info->c.buf); ffc17180: 4b ff d2 c9 bl ffc14448 ffc17184: 4b ff ff a8 b ffc1712c else sc = rtems_bdbuf_get(fs_info->vol.dd, blk, &fs_info->c.buf); if (sc != RTEMS_SUCCESSFUL) rtems_set_errno_and_return_minus_one(EIO); ffc17188: 48 00 95 15 bl ffc2069c <__errno> <== NOT EXECUTED ffc1718c: 39 20 00 05 li r9,5 <== NOT EXECUTED ffc17190: 91 23 00 00 stw r9,0(r3) <== NOT EXECUTED ffc17194: 38 60 ff ff li r3,-1 <== NOT EXECUTED ffc17198: 4b ff ff c0 b ffc17158 <== NOT EXECUTED =============================================================================== ffc16ec0 : return RC_OK; } int fat_buf_release(fat_fs_info_t *fs_info) { ffc16ec0: 94 21 ff d8 stwu r1,-40(r1) ffc16ec4: 7c 08 02 a6 mflr r0 ffc16ec8: 93 e1 00 24 stw r31,36(r1) ffc16ecc: 7c 7f 1b 78 mr r31,r3 ffc16ed0: 90 01 00 2c stw r0,44(r1) ffc16ed4: 93 a1 00 1c stw r29,28(r1) ffc16ed8: 93 c1 00 20 stw r30,32(r1) rtems_status_code sc = RTEMS_SUCCESSFUL; if (fs_info->c.state == FAT_CACHE_EMPTY) ffc16edc: 89 23 00 89 lbz r9,137(r3) return RC_OK; ffc16ee0: 38 60 00 00 li r3,0 int fat_buf_release(fat_fs_info_t *fs_info) { rtems_status_code sc = RTEMS_SUCCESSFUL; if (fs_info->c.state == FAT_CACHE_EMPTY) ffc16ee4: 2f 89 00 00 cmpwi cr7,r9,0 ffc16ee8: 41 9e 01 28 beq- cr7,ffc17010 return RC_OK; if (fs_info->c.modified) ffc16eec: 89 3f 00 88 lbz r9,136(r31) ffc16ef0: 2f 89 00 00 cmpwi cr7,r9,0 ffc16ef4: 41 9e 01 00 beq- cr7,ffc16ff4 { uint32_t sec_num = fs_info->c.blk_num; ffc16ef8: 81 3f 00 84 lwz r9,132(r31) bool sec_of_fat = ((sec_num >= fs_info->vol.fat_loc) && ffc16efc: 3b c0 00 00 li r30,0 ffc16f00: a1 5f 00 18 lhz r10,24(r31) ffc16f04: 7f 89 50 40 cmplw cr7,r9,r10 ffc16f08: 41 9c 00 10 blt- cr7,ffc16f18 ffc16f0c: 81 5f 00 20 lwz r10,32(r31) ffc16f10: 7f 89 50 40 cmplw cr7,r9,r10 ffc16f14: 41 9c 01 18 blt- cr7,ffc1702c if (sec_of_fat && !fs_info->vol.mirror) memcpy(fs_info->sec_buf, fs_info->c.buf->buffer + blk_ofs, fs_info->vol.bps); sc = rtems_bdbuf_release_modified(fs_info->c.buf); ffc16f18: 80 7f 00 8c lwz r3,140(r31) ffc16f1c: 4b ff d8 59 bl ffc14774 if (sc != RTEMS_SUCCESSFUL) ffc16f20: 2c 03 00 00 cmpwi r3,0 ffc16f24: 40 82 01 6c bne- ffc17090 <== NEVER TAKEN rtems_set_errno_and_return_minus_one(EIO); fs_info->c.modified = 0; if (sec_of_fat && !fs_info->vol.mirror) ffc16f28: 2f 9e 00 00 cmpwi cr7,r30,0 fs_info->vol.bps); sc = rtems_bdbuf_release_modified(fs_info->c.buf); if (sc != RTEMS_SUCCESSFUL) rtems_set_errno_and_return_minus_one(EIO); fs_info->c.modified = 0; ffc16f2c: 98 7f 00 88 stb r3,136(r31) if (sec_of_fat && !fs_info->vol.mirror) ffc16f30: 41 9e 00 d4 beq- cr7,ffc17004 ffc16f34: 89 3f 00 54 lbz r9,84(r31) ffc16f38: 2f 89 00 00 cmpwi cr7,r9,0 ffc16f3c: 40 9e 00 c8 bne- cr7,ffc17004 <== NEVER TAKEN { uint8_t i; for (i = 1; i < fs_info->vol.fats; i++) ffc16f40: 89 3f 00 0d lbz r9,13(r31) ffc16f44: 2b 89 00 01 cmplwi cr7,r9,1 ffc16f48: 40 9d 00 bc ble- cr7,ffc17004 <== NEVER TAKEN ffc16f4c: 3b c0 00 01 li r30,1 ffc16f50: 48 00 00 50 b ffc16fa0 { sc = rtems_bdbuf_get(fs_info->vol.dd, blk, &bd); } else { sc = rtems_bdbuf_read(fs_info->vol.dd, blk, &bd); ffc16f54: 80 7f 00 64 lwz r3,100(r31) ffc16f58: 4b ff d4 f1 bl ffc14448 } if ( sc != RTEMS_SUCCESSFUL) ffc16f5c: 2f 83 00 00 cmpwi cr7,r3,0 ffc16f60: 40 9e 01 1c bne- cr7,ffc1707c <== NEVER TAKEN rtems_set_errno_and_return_minus_one(ENOMEM); memcpy(bd->buffer + blk_ofs, fs_info->sec_buf, fs_info->vol.bps); ffc16f64: 81 21 00 08 lwz r9,8(r1) if (sec_of_fat && !fs_info->vol.mirror) { uint8_t i; for (i = 1; i < fs_info->vol.fats; i++) ffc16f68: 3b de 00 01 addi r30,r30,1 { sc = rtems_bdbuf_read(fs_info->vol.dd, blk, &bd); } if ( sc != RTEMS_SUCCESSFUL) rtems_set_errno_and_return_minus_one(ENOMEM); memcpy(bd->buffer + blk_ofs, fs_info->sec_buf, fs_info->vol.bps); ffc16f6c: 80 9f 00 90 lwz r4,144(r31) if (sec_of_fat && !fs_info->vol.mirror) { uint8_t i; for (i = 1; i < fs_info->vol.fats; i++) ffc16f70: 57 de 06 3e clrlwi r30,r30,24 { sc = rtems_bdbuf_read(fs_info->vol.dd, blk, &bd); } if ( sc != RTEMS_SUCCESSFUL) rtems_set_errno_and_return_minus_one(ENOMEM); memcpy(bd->buffer + blk_ofs, fs_info->sec_buf, fs_info->vol.bps); ffc16f74: 80 69 00 1c lwz r3,28(r9) ffc16f78: a0 bf 00 00 lhz r5,0(r31) ffc16f7c: 7c 63 ea 14 add r3,r3,r29 ffc16f80: 48 00 a3 fd bl ffc2137c sc = rtems_bdbuf_release_modified(bd); ffc16f84: 80 61 00 08 lwz r3,8(r1) ffc16f88: 4b ff d7 ed bl ffc14774 if ( sc != RTEMS_SUCCESSFUL) ffc16f8c: 2f 83 00 00 cmpwi cr7,r3,0 ffc16f90: 40 9e 00 ec bne- cr7,ffc1707c <== NEVER TAKEN if (sec_of_fat && !fs_info->vol.mirror) { uint8_t i; for (i = 1; i < fs_info->vol.fats; i++) ffc16f94: 89 3f 00 0d lbz r9,13(r31) ffc16f98: 7f 89 f0 40 cmplw cr7,r9,r30 ffc16f9c: 40 9d 00 68 ble- cr7,ffc17004 <== ALWAYS TAKEN { rtems_bdbuf_buffer *bd; sec_num = fs_info->c.blk_num + fs_info->vol.fat_length * i, ffc16fa0: 81 1f 00 1c lwz r8,28(r31) { sc = rtems_bdbuf_get(fs_info->vol.dd, blk, &bd); } else { sc = rtems_bdbuf_read(fs_info->vol.dd, blk, &bd); ffc16fa4: 38 a1 00 08 addi r5,r1,8 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, ffc16fa8: 81 5f 00 84 lwz r10,132(r31) ffc16fac: 7d 1e 41 d6 mullw r8,r30,r8 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); ffc16fb0: 89 3f 00 02 lbz r9,2(r31) ffc16fb4: 88 7f 00 0c lbz r3,12(r31) ffc16fb8: 7d 08 52 14 add r8,r8,r10 ffc16fbc: 7c 69 18 50 subf r3,r9,r3 ffc16fc0: 7d 0a 1c 30 srw r10,r8,r3 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); ffc16fc4: 7d 43 18 30 slw r3,r10,r3 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 - ffc16fc8: 7c 63 40 50 subf r3,r3,r8 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 ffc16fcc: 7c 7d 48 31 slw. r29,r3,r9 { sc = rtems_bdbuf_get(fs_info->vol.dd, blk, &bd); } else { sc = rtems_bdbuf_read(fs_info->vol.dd, blk, &bd); ffc16fd0: 7d 44 53 78 mr r4,r10 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 ffc16fd4: 40 a2 ff 80 bne- ffc16f54 && fs_info->vol.bps == fs_info->vol.bytes_per_block) ffc16fd8: a1 1f 00 00 lhz r8,0(r31) ffc16fdc: a1 3f 00 0a lhz r9,10(r31) ffc16fe0: 7f 88 48 00 cmpw cr7,r8,r9 ffc16fe4: 40 9e ff 70 bne+ cr7,ffc16f54 { sc = rtems_bdbuf_get(fs_info->vol.dd, blk, &bd); ffc16fe8: 80 7f 00 64 lwz r3,100(r31) ffc16fec: 4b ff d2 f1 bl ffc142dc ffc16ff0: 4b ff ff 6c b ffc16f5c } } } else { sc = rtems_bdbuf_release(fs_info->c.buf); ffc16ff4: 80 7f 00 8c lwz r3,140(r31) ffc16ff8: 4b ff d6 91 bl ffc14688 if (sc != RTEMS_SUCCESSFUL) ffc16ffc: 2f 83 00 00 cmpwi cr7,r3,0 ffc17000: 40 9e 00 90 bne- cr7,ffc17090 <== NEVER TAKEN rtems_set_errno_and_return_minus_one(EIO); } fs_info->c.state = FAT_CACHE_EMPTY; ffc17004: 39 20 00 00 li r9,0 ffc17008: 99 3f 00 89 stb r9,137(r31) return RC_OK; ffc1700c: 38 60 00 00 li r3,0 } ffc17010: 80 01 00 2c lwz r0,44(r1) ffc17014: 83 a1 00 1c lwz r29,28(r1) ffc17018: 7c 08 03 a6 mtlr r0 ffc1701c: 83 c1 00 20 lwz r30,32(r1) ffc17020: 83 e1 00 24 lwz r31,36(r1) ffc17024: 38 21 00 28 addi r1,r1,40 ffc17028: 4e 80 00 20 blr 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) ffc1702c: 89 1f 00 54 lbz r8,84(r31) uint32_t ino ) { return (ino >= fs_info->uino_base); } ffc17030: 89 5f 00 02 lbz r10,2(r31) 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) ffc17034: 2f 88 00 00 cmpwi cr7,r8,0 uint32_t ino ) { return (ino >= fs_info->uino_base); } ffc17038: 88 ff 00 0c lbz r7,12(r31) 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) ffc1703c: 41 9e 00 0c beq- cr7,ffc17048 <== ALWAYS TAKEN return RC_OK; if (fs_info->c.modified) { uint32_t sec_num = fs_info->c.blk_num; bool sec_of_fat = ((sec_num >= fs_info->vol.fat_loc) && ffc17040: 3b c0 00 01 li r30,1 <== NOT EXECUTED ffc17044: 4b ff fe d4 b ffc16f18 <== 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); ffc17048: 7d 0a 38 50 subf r8,r10,r7 sec_num, 0); if (sec_of_fat && !fs_info->vol.mirror) memcpy(fs_info->sec_buf, fs_info->c.buf->buffer + blk_ofs, ffc1704c: 80 ff 00 8c lwz r7,140(r31) ffc17050: 7d 26 44 30 srw r6,r9,r8 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, ffc17054: 80 7f 00 90 lwz r3,144(r31) 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); ffc17058: 7c c8 40 30 slw r8,r6,r8 ffc1705c: 80 87 00 1c lwz r4,28(r7) 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 - ffc17060: 7d 28 48 50 subf r9,r8,r9 ffc17064: a0 bf 00 00 lhz r5,0(r31) fat_block_num_to_sector_num (fs_info, fat_sector_num_to_block_num (fs_info, sector))) << fs_info->vol.sec_log2); ffc17068: 7d 2a 50 30 slw r10,r9,r10 ffc1706c: 7c 84 52 14 add r4,r4,r10 ffc17070: 48 00 a3 0d bl ffc2137c return RC_OK; if (fs_info->c.modified) { uint32_t sec_num = fs_info->c.blk_num; bool sec_of_fat = ((sec_num >= fs_info->vol.fat_loc) && ffc17074: 3b c0 00 01 li r30,1 ffc17078: 4b ff fe a0 b ffc16f18 if ( sc != RTEMS_SUCCESSFUL) rtems_set_errno_and_return_minus_one(ENOMEM); memcpy(bd->buffer + blk_ofs, fs_info->sec_buf, fs_info->vol.bps); sc = rtems_bdbuf_release_modified(bd); if ( sc != RTEMS_SUCCESSFUL) rtems_set_errno_and_return_minus_one(ENOMEM); ffc1707c: 48 00 96 21 bl ffc2069c <__errno> <== NOT EXECUTED ffc17080: 39 20 00 0c li r9,12 <== NOT EXECUTED ffc17084: 91 23 00 00 stw r9,0(r3) <== NOT EXECUTED } else { sc = rtems_bdbuf_release(fs_info->c.buf); if (sc != RTEMS_SUCCESSFUL) rtems_set_errno_and_return_minus_one(EIO); ffc17088: 38 60 ff ff li r3,-1 <== NOT EXECUTED ffc1708c: 4b ff ff 84 b ffc17010 <== NOT EXECUTED ffc17090: 48 00 96 0d bl ffc2069c <__errno> <== NOT EXECUTED ffc17094: 39 20 00 05 li r9,5 <== NOT EXECUTED ffc17098: 91 23 00 00 stw r9,0(r3) <== NOT EXECUTED ffc1709c: 38 60 ff ff li r3,-1 <== NOT EXECUTED ffc170a0: 4b ff ff 70 b ffc17010 <== NOT EXECUTED =============================================================================== ffc1739c : fat_fs_info_t *fs_info, const uint32_t start_cln, const uint32_t offset, const uint32_t count, const uint8_t pattern) { ffc1739c: 94 21 ff c0 stwu r1,-64(r1) ffc173a0: 7c 08 02 a6 mflr r0 ffc173a4: 90 01 00 44 stw r0,68(r1) ssize_t rc = RC_OK; uint32_t bytes_to_write = MIN(count, (fs_info->vol.bpc - offset)); ffc173a8: a1 23 00 06 lhz r9,6(r3) fat_fs_info_t *fs_info, const uint32_t start_cln, const uint32_t offset, const uint32_t count, const uint8_t pattern) { ffc173ac: 93 01 00 20 stw r24,32(r1) ffc173b0: 7c f8 3b 78 mr r24,r7 ssize_t rc = RC_OK; uint32_t bytes_to_write = MIN(count, (fs_info->vol.bpc - offset)); ffc173b4: 7d 25 48 50 subf r9,r5,r9 ffc173b8: 7f 86 48 40 cmplw cr7,r6,r9 fat_fs_info_t *fs_info, const uint32_t start_cln, const uint32_t offset, const uint32_t count, const uint8_t pattern) { ffc173bc: 93 81 00 30 stw r28,48(r1) ssize_t rc = RC_OK; uint32_t bytes_to_write = MIN(count, (fs_info->vol.bpc - offset)); ffc173c0: 7c dc 33 78 mr r28,r6 fat_fs_info_t *fs_info, const uint32_t start_cln, const uint32_t offset, const uint32_t count, const uint8_t pattern) { ffc173c4: 93 a1 00 34 stw r29,52(r1) ffc173c8: 7c 7d 1b 78 mr r29,r3 ffc173cc: 92 e1 00 1c stw r23,28(r1) ffc173d0: 93 21 00 24 stw r25,36(r1) ffc173d4: 93 41 00 28 stw r26,40(r1) ffc173d8: 93 61 00 2c stw r27,44(r1) ffc173dc: 93 c1 00 38 stw r30,56(r1) ffc173e0: 93 e1 00 3c stw r31,60(r1) ssize_t rc = RC_OK; uint32_t bytes_to_write = MIN(count, (fs_info->vol.bpc - offset)); ffc173e4: 40 9d 00 08 ble- cr7,ffc173ec <== ALWAYS TAKEN ffc173e8: 7d 3c 4b 78 mr r28,r9 <== NOT EXECUTED 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)) ) ffc173ec: 2f 84 00 00 cmpwi cr7,r4,0 ffc173f0: 40 9e 00 10 bne- cr7,ffc17400 <== ALWAYS TAKEN ffc173f4: 89 3d 00 0e lbz r9,14(r29) <== NOT EXECUTED ffc173f8: 71 2a 00 03 andi. r10,r9,3 <== NOT EXECUTED ffc173fc: 40 82 01 78 bne- ffc17574 <== 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); ffc17400: 89 1d 00 02 lbz r8,2(r29) blk = fat_sector_num_to_block_num(fs_info, fs_info->vol.rdir_loc); else { cln -= FAT_RSRVD_CLN; ffc17404: 38 84 ff fe addi r4,r4,-2 blk = cln << (fs_info->vol.bpc_log2 - fs_info->vol.bytes_per_block_log2); ffc17408: 88 fd 00 0c lbz r7,12(r29) ffc1740c: 89 5d 00 08 lbz r10,8(r29) ffc17410: 55 1a 06 3e clrlwi r26,r8,24 ffc17414: 81 3d 00 34 lwz r9,52(r29) ffc17418: 7f 5a 38 50 subf r26,r26,r7 ffc1741c: 7d 47 50 50 subf r10,r7,r10 ffc17420: 7d 29 d4 30 srw r9,r9,r26 ffc17424: 7c 84 50 30 slw r4,r4,r10 blk += fat_sector_num_to_block_num(fs_info, fs_info->vol.data_fsec); ffc17428: 7f 49 22 14 add r26,r9,r4 ssize_t ret; cur_blk += blocks_in_offset; while ( (RC_OK == rc) && (0 < bytes_to_write)) ffc1742c: 2f 9c 00 00 cmpwi cr7,r28,0 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; ffc17430: 7c a9 3c 30 srw r9,r5,r7 uint32_t ofs_blk = offset - (blocks_in_offset << fs_info->vol.bytes_per_block_log2); ffc17434: 7d 3b 38 30 slw r27,r9,r7 ssize_t ret; cur_blk += blocks_in_offset; while ( (RC_OK == rc) && (0 < bytes_to_write)) ffc17438: 3b 20 00 00 li r25,0 { 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; uint32_t ofs_blk = offset - (blocks_in_offset << fs_info->vol.bytes_per_block_log2); ffc1743c: 7f 7b 28 50 subf r27,r27,r5 ssize_t bytes_written = 0; ssize_t ret; cur_blk += blocks_in_offset; ffc17440: 7f 49 d2 14 add r26,r9,r26 while ( (RC_OK == rc) && (0 < bytes_to_write)) ffc17444: 41 9e 00 f8 beq- cr7,ffc1753c <== NEVER TAKEN } static inline void fat_buf_mark_modified(fat_fs_info_t *fs_info) { fs_info->c.modified = true; ffc17448: 3a e0 00 01 li r23,1 { uint32_t c = MIN(bytes_to_write, (fs_info->vol.bytes_per_block - ofs_blk)); ffc1744c: a1 5d 00 0a lhz r10,10(r29) ffc17450: 7d 3b 50 50 subf r9,r27,r10 ffc17454: 7f 89 e0 40 cmplw cr7,r9,r28 ffc17458: 7d 3f 4b 78 mr r31,r9 ffc1745c: 40 9d 00 08 ble- cr7,ffc17464 <== ALWAYS TAKEN ffc17460: 7f 9f e3 78 mr r31,r28 <== 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)); ffc17464: 7f 9f 48 40 cmplw cr7,r31,r9 ffc17468: 7f fe fb 78 mr r30,r31 ffc1746c: 40 9d 00 08 ble- cr7,ffc17474 <== ALWAYS TAKEN ffc17470: 7d 3e 4b 78 mr r30,r9 <== NOT EXECUTED uint8_t *blk_buf; uint32_t sec_num = fat_block_num_to_sector_num(fs_info, start_blk); if (0 < bytes_to_write) ffc17474: 2f 9e 00 00 cmpwi cr7,r30,0 uint32_t ino ) { return (ino >= fs_info->uino_base); } ffc17478: 55 09 06 3e clrlwi r9,r8,24 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) ffc1747c: 41 9e 00 84 beq- cr7,ffc17500 <== NEVER TAKEN { if (bytes_to_write == fs_info->vol.bytes_per_block) ffc17480: 7f 8a f0 00 cmpw cr7,r10,r30 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); ffc17484: 7d 29 38 50 subf r9,r9,r7 { rc = fat_buf_access(fs_info, sec_num, FAT_OP_TYPE_GET, &blk_buf); ffc17488: 7f a3 eb 78 mr r3,r29 ffc1748c: 7f 44 48 30 slw r4,r26,r9 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) ffc17490: 41 9e 00 9c beq- cr7,ffc1752c { 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); ffc17494: 38 a0 00 01 li r5,1 ffc17498: 38 c1 00 08 addi r6,r1,8 ffc1749c: 4b ff fc 09 bl ffc170a4 if (RC_OK == rc) ffc174a0: 2f 83 00 00 cmpwi cr7,r3,0 ffc174a4: 41 9e 00 44 beq- cr7,ffc174e8 <== ALWAYS TAKEN fs_info, cur_blk, ofs_blk, c, pattern); if (c != ret) ffc174a8: 7f 83 f8 00 cmpw cr7,r3,r31 <== NOT EXECUTED ffc174ac: 41 9e 00 60 beq- cr7,ffc1750c <== NOT EXECUTED } if (RC_OK != rc) return rc; else return bytes_written; } ffc174b0: 80 01 00 44 lwz r0,68(r1) <== NOT EXECUTED fs_info, cur_blk, ofs_blk, c, pattern); if (c != ret) ffc174b4: 38 60 ff ff li r3,-1 <== NOT EXECUTED } if (RC_OK != rc) return rc; else return bytes_written; } ffc174b8: 82 e1 00 1c lwz r23,28(r1) <== NOT EXECUTED ffc174bc: 7c 08 03 a6 mtlr r0 <== NOT EXECUTED ffc174c0: 83 01 00 20 lwz r24,32(r1) <== NOT EXECUTED ffc174c4: 83 21 00 24 lwz r25,36(r1) <== NOT EXECUTED ffc174c8: 83 41 00 28 lwz r26,40(r1) <== NOT EXECUTED ffc174cc: 83 61 00 2c lwz r27,44(r1) <== NOT EXECUTED ffc174d0: 83 81 00 30 lwz r28,48(r1) <== NOT EXECUTED ffc174d4: 83 a1 00 34 lwz r29,52(r1) <== NOT EXECUTED ffc174d8: 83 c1 00 38 lwz r30,56(r1) <== NOT EXECUTED ffc174dc: 83 e1 00 3c lwz r31,60(r1) <== NOT EXECUTED ffc174e0: 38 21 00 40 addi r1,r1,64 <== NOT EXECUTED ffc174e4: 4e 80 00 20 blr <== NOT EXECUTED else rc = fat_buf_access(fs_info, sec_num, FAT_OP_TYPE_READ, &blk_buf); if (RC_OK == rc) { memset(blk_buf + offset, pattern, bytes_to_write); ffc174e8: 80 61 00 08 lwz r3,8(r1) ffc174ec: 7f 04 c3 78 mr r4,r24 ffc174f0: 7f c5 f3 78 mr r5,r30 ffc174f4: 7c 63 da 14 add r3,r3,r27 ffc174f8: 48 00 9f 79 bl ffc21470 } static inline void fat_buf_mark_modified(fat_fs_info_t *fs_info) { fs_info->c.modified = true; ffc174fc: 9a fd 00 88 stb r23,136(r29) } } if (RC_OK != rc) return rc; else return bytes_to_write; ffc17500: 7f c3 f3 78 mr r3,r30 fs_info, cur_blk, ofs_blk, c, pattern); if (c != ret) ffc17504: 7f 83 f8 00 cmpw cr7,r3,r31 ffc17508: 40 9e ff a8 bne+ cr7,ffc174b0 <== NEVER TAKEN ssize_t ret; cur_blk += blocks_in_offset; while ( (RC_OK == rc) && (0 < bytes_to_write)) ffc1750c: 7f 83 e0 51 subf. r28,r3,r28 if (c != ret) rc = -1; else { bytes_to_write -= ret; bytes_written += ret; ffc17510: 7f 39 1a 14 add r25,r25,r3 ++cur_blk; ffc17514: 3b 5a 00 01 addi r26,r26,1 ssize_t ret; cur_blk += blocks_in_offset; while ( (RC_OK == rc) && (0 < bytes_to_write)) ffc17518: 41 82 00 24 beq- ffc1753c <== ALWAYS TAKEN ffc1751c: 88 fd 00 0c lbz r7,12(r29) <== NOT EXECUTED ffc17520: 3b 60 00 00 li r27,0 <== NOT EXECUTED ffc17524: 89 1d 00 02 lbz r8,2(r29) <== NOT EXECUTED ffc17528: 4b ff ff 24 b ffc1744c <== NOT EXECUTED if (0 < bytes_to_write) { if (bytes_to_write == fs_info->vol.bytes_per_block) { rc = fat_buf_access(fs_info, sec_num, FAT_OP_TYPE_GET, &blk_buf); ffc1752c: 38 a0 00 02 li r5,2 ffc17530: 38 c1 00 08 addi r6,r1,8 ffc17534: 4b ff fb 71 bl ffc170a4 ffc17538: 4b ff ff 68 b ffc174a0 } if (RC_OK != rc) return rc; else return bytes_written; } ffc1753c: 80 01 00 44 lwz r0,68(r1) fs_info, cur_blk, ofs_blk, c, pattern); if (c != ret) ffc17540: 7f 23 cb 78 mr r3,r25 } if (RC_OK != rc) return rc; else return bytes_written; } ffc17544: 82 e1 00 1c lwz r23,28(r1) ffc17548: 7c 08 03 a6 mtlr r0 ffc1754c: 83 01 00 20 lwz r24,32(r1) ffc17550: 83 21 00 24 lwz r25,36(r1) ffc17554: 83 41 00 28 lwz r26,40(r1) ffc17558: 83 61 00 2c lwz r27,44(r1) ffc1755c: 83 81 00 30 lwz r28,48(r1) ffc17560: 83 a1 00 34 lwz r29,52(r1) ffc17564: 83 c1 00 38 lwz r30,56(r1) ffc17568: 83 e1 00 3c lwz r31,60(r1) ffc1756c: 38 21 00 40 addi r1,r1,64 ffc17570: 4e 80 00 20 blr 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); ffc17574: 89 1d 00 02 lbz r8,2(r29) <== NOT EXECUTED uint32_t ino ) { return (ino >= fs_info->uino_base); } ffc17578: 88 fd 00 0c lbz r7,12(r29) <== NOT EXECUTED ffc1757c: 55 1a 06 3e clrlwi r26,r8,24 <== NOT EXECUTED ffc17580: 81 3d 00 20 lwz r9,32(r29) <== NOT EXECUTED ffc17584: 7f 5a 38 50 subf r26,r26,r7 <== NOT EXECUTED ffc17588: 7d 3a d4 30 srw r26,r9,r26 <== NOT EXECUTED ffc1758c: 4b ff fe a0 b ffc1742c <== NOT EXECUTED =============================================================================== ffc17590 : const uint32_t start_cln, const uint32_t offset, const uint32_t count, const void *buff, const bool overwrite_cluster) { ffc17590: 94 21 ff c0 stwu r1,-64(r1) ffc17594: 7c 08 02 a6 mflr r0 ffc17598: 7d 80 00 26 mfcr r12 ffc1759c: 90 01 00 44 stw r0,68(r1) ssize_t rc = RC_OK; uint32_t bytes_to_write = MIN(count, (fs_info->vol.bpc - offset)); ffc175a0: a1 23 00 06 lhz r9,6(r3) const uint32_t start_cln, const uint32_t offset, const uint32_t count, const void *buff, const bool overwrite_cluster) { ffc175a4: 93 01 00 20 stw r24,32(r1) ffc175a8: 7c f8 3b 78 mr r24,r7 ssize_t rc = RC_OK; uint32_t bytes_to_write = MIN(count, (fs_info->vol.bpc - offset)); ffc175ac: 7d 25 48 50 subf r9,r5,r9 ffc175b0: 7f 86 48 40 cmplw cr7,r6,r9 const uint32_t start_cln, const uint32_t offset, const uint32_t count, const void *buff, const bool overwrite_cluster) { ffc175b4: 93 81 00 30 stw r28,48(r1) ssize_t rc = RC_OK; uint32_t bytes_to_write = MIN(count, (fs_info->vol.bpc - offset)); ffc175b8: 7c dc 33 78 mr r28,r6 const uint32_t start_cln, const uint32_t offset, const uint32_t count, const void *buff, const bool overwrite_cluster) { ffc175bc: 93 a1 00 34 stw r29,52(r1) ffc175c0: 7c 7d 1b 78 mr r29,r3 ffc175c4: 92 e1 00 1c stw r23,28(r1) ffc175c8: 93 21 00 24 stw r25,36(r1) ffc175cc: 93 41 00 28 stw r26,40(r1) ffc175d0: 93 61 00 2c stw r27,44(r1) ffc175d4: 93 c1 00 38 stw r30,56(r1) ffc175d8: 93 e1 00 3c stw r31,60(r1) ffc175dc: 91 81 00 18 stw r12,24(r1) ssize_t rc = RC_OK; uint32_t bytes_to_write = MIN(count, (fs_info->vol.bpc - offset)); ffc175e0: 40 9d 00 08 ble- cr7,ffc175e8 <== ALWAYS TAKEN ffc175e4: 7d 3c 4b 78 mr r28,r9 <== NOT EXECUTED 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)) ) ffc175e8: 2f 84 00 00 cmpwi cr7,r4,0 ffc175ec: 40 9e 00 10 bne- cr7,ffc175fc ffc175f0: 89 3d 00 0e lbz r9,14(r29) ffc175f4: 71 2a 00 03 andi. r10,r9,3 ffc175f8: 40 82 01 94 bne- ffc1778c <== ALWAYS TAKEN ffc175fc: 88 dd 00 02 lbz r6,2(r29) blk = fat_sector_num_to_block_num(fs_info, fs_info->vol.rdir_loc); else { cln -= FAT_RSRVD_CLN; ffc17600: 38 84 ff fe addi r4,r4,-2 blk = cln << (fs_info->vol.bpc_log2 - fs_info->vol.bytes_per_block_log2); ffc17604: 88 fd 00 0c lbz r7,12(r29) ffc17608: 89 5d 00 08 lbz r10,8(r29) ffc1760c: 54 da 06 3e clrlwi r26,r6,24 ffc17610: 81 3d 00 34 lwz r9,52(r29) ffc17614: 7f 5a 38 50 subf r26,r26,r7 ffc17618: 7d 47 50 50 subf r10,r7,r10 ffc1761c: 7d 29 d4 30 srw r9,r9,r26 ffc17620: 7c 84 50 30 slw r4,r4,r10 blk += fat_sector_num_to_block_num(fs_info, fs_info->vol.data_fsec); ffc17624: 7f 49 22 14 add r26,r9,r4 uint32_t c; cur_blk += blocks_in_offset; while ( (RC_OK == rc) && (0 < bytes_to_write)) ffc17628: 2f 9c 00 00 cmpwi cr7,r28,0 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); ffc1762c: 7c a9 3c 30 srw r9,r5,r7 uint32_t ofs_blk = offset - (blocks_in_offset << fs_info->vol.bytes_per_block_log2); ffc17630: 7d 3b 38 30 slw r27,r9,r7 ffc17634: 7f 7b 28 50 subf r27,r27,r5 ssize_t bytes_written = 0; uint8_t *buffer = (uint8_t*)buff; ssize_t ret; uint32_t c; cur_blk += blocks_in_offset; ffc17638: 7f 49 d2 14 add r26,r9,r26 while ( (RC_OK == rc) && (0 < bytes_to_write)) ffc1763c: 41 9e 01 0c beq- cr7,ffc17748 <== NEVER TAKEN 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 ffc17640: 2e 08 00 00 cmpwi cr4,r8,0 uint32_t c; cur_blk += blocks_in_offset; while ( (RC_OK == rc) && (0 < bytes_to_write)) ffc17644: 3b 20 00 00 li r25,0 } static inline void fat_buf_mark_modified(fat_fs_info_t *fs_info) { fs_info->c.modified = true; ffc17648: 3a e0 00 01 li r23,1 { c = MIN(bytes_to_write, (fs_info->vol.bytes_per_block - ofs_blk)); ffc1764c: a1 5d 00 0a lhz r10,10(r29) ffc17650: 7d 3b 50 50 subf r9,r27,r10 ffc17654: 7f 89 e0 40 cmplw cr7,r9,r28 ffc17658: 7d 3f 4b 78 mr r31,r9 ffc1765c: 40 9d 00 08 ble- cr7,ffc17664 ffc17660: 7f 9f e3 78 mr r31,r28 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)); ffc17664: 7f 9f 48 40 cmplw cr7,r31,r9 ffc17668: 7f fe fb 78 mr r30,r31 ffc1766c: 40 9d 00 08 ble- cr7,ffc17674 <== ALWAYS TAKEN ffc17670: 7d 3e 4b 78 mr r30,r9 <== NOT EXECUTED uint8_t *blk_buf; uint32_t sec_num = fat_block_num_to_sector_num(fs_info, start_blk); if (0 < bytes_to_write) ffc17674: 2f 9e 00 00 cmpwi cr7,r30,0 uint32_t ino ) { return (ino >= fs_info->uino_base); } ffc17678: 54 c9 06 3e clrlwi r9,r6,24 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) ffc1767c: 41 9e 00 90 beq- cr7,ffc1770c <== NEVER TAKEN 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); ffc17680: 7d 29 38 50 subf r9,r9,r7 ffc17684: 7f 44 48 30 slw r4,r26,r9 { 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); ffc17688: 7f a3 eb 78 mr r3,r29 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 ffc1768c: 40 92 00 ac bne- cr4,ffc17738 || (bytes_to_write == fs_info->vol.bytes_per_block)) ffc17690: 7f 8a f0 00 cmpw cr7,r10,r30 ffc17694: 41 9e 00 a4 beq- cr7,ffc17738 { 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); ffc17698: 38 a0 00 01 li r5,1 ffc1769c: 38 c1 00 08 addi r6,r1,8 ffc176a0: 4b ff fa 05 bl ffc170a4 if (RC_OK == rc) ffc176a4: 2f 83 00 00 cmpwi cr7,r3,0 ffc176a8: 41 9e 00 4c beq- cr7,ffc176f4 <== ALWAYS TAKEN cur_blk, ofs_blk, c, &buffer[bytes_written], overwrite_cluster); if (c != ret) ffc176ac: 7f 83 f8 00 cmpw cr7,r3,r31 <== NOT EXECUTED ffc176b0: 41 9e 00 68 beq- cr7,ffc17718 <== NOT EXECUTED } if (RC_OK != rc) return rc; else return bytes_written; } ffc176b4: 80 01 00 44 lwz r0,68(r1) <== NOT EXECUTED cur_blk, ofs_blk, c, &buffer[bytes_written], overwrite_cluster); if (c != ret) ffc176b8: 38 60 ff ff li r3,-1 <== NOT EXECUTED } if (RC_OK != rc) return rc; else return bytes_written; } ffc176bc: 81 81 00 18 lwz r12,24(r1) <== NOT EXECUTED ffc176c0: 7c 08 03 a6 mtlr r0 <== NOT EXECUTED ffc176c4: 82 e1 00 1c lwz r23,28(r1) <== NOT EXECUTED ffc176c8: 83 01 00 20 lwz r24,32(r1) <== NOT EXECUTED ffc176cc: 7d 80 81 20 mtcrf 8,r12 <== NOT EXECUTED ffc176d0: 83 21 00 24 lwz r25,36(r1) <== NOT EXECUTED ffc176d4: 83 41 00 28 lwz r26,40(r1) <== NOT EXECUTED ffc176d8: 83 61 00 2c lwz r27,44(r1) <== NOT EXECUTED ffc176dc: 83 81 00 30 lwz r28,48(r1) <== NOT EXECUTED ffc176e0: 83 a1 00 34 lwz r29,52(r1) <== NOT EXECUTED ffc176e4: 83 c1 00 38 lwz r30,56(r1) <== NOT EXECUTED ffc176e8: 83 e1 00 3c lwz r31,60(r1) <== NOT EXECUTED ffc176ec: 38 21 00 40 addi r1,r1,64 <== NOT EXECUTED ffc176f0: 4e 80 00 20 blr <== NOT EXECUTED else rc = fat_buf_access(fs_info, sec_num, FAT_OP_TYPE_READ, &blk_buf); if (RC_OK == rc) { memcpy(blk_buf + offset, buf, bytes_to_write); ffc176f4: 80 61 00 08 lwz r3,8(r1) ffc176f8: 7c 98 ca 14 add r4,r24,r25 ffc176fc: 7f c5 f3 78 mr r5,r30 ffc17700: 7c 63 da 14 add r3,r3,r27 ffc17704: 48 00 9c 79 bl ffc2137c } static inline void fat_buf_mark_modified(fat_fs_info_t *fs_info) { fs_info->c.modified = true; ffc17708: 9a fd 00 88 stb r23,136(r29) } } if (RC_OK != rc) return rc; else return bytes_to_write; ffc1770c: 7f c3 f3 78 mr r3,r30 cur_blk, ofs_blk, c, &buffer[bytes_written], overwrite_cluster); if (c != ret) ffc17710: 7f 83 f8 00 cmpw cr7,r3,r31 ffc17714: 40 9e ff a0 bne+ cr7,ffc176b4 <== NEVER TAKEN uint32_t c; cur_blk += blocks_in_offset; while ( (RC_OK == rc) && (0 < bytes_to_write)) ffc17718: 7f 83 e0 51 subf. r28,r3,r28 if (c != ret) rc = -1; else { bytes_to_write -= ret; bytes_written += ret; ffc1771c: 7f 39 1a 14 add r25,r25,r3 ++cur_blk; ffc17720: 3b 5a 00 01 addi r26,r26,1 uint32_t c; cur_blk += blocks_in_offset; while ( (RC_OK == rc) && (0 < bytes_to_write)) ffc17724: 41 82 00 28 beq- ffc1774c <== ALWAYS TAKEN ffc17728: 88 fd 00 0c lbz r7,12(r29) <== NOT EXECUTED ffc1772c: 3b 60 00 00 li r27,0 <== NOT EXECUTED ffc17730: 88 dd 00 02 lbz r6,2(r29) <== NOT EXECUTED ffc17734: 4b ff ff 18 b ffc1764c <== NOT EXECUTED if (0 < bytes_to_write) { 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); ffc17738: 38 a0 00 02 li r5,2 ffc1773c: 38 c1 00 08 addi r6,r1,8 ffc17740: 4b ff f9 65 bl ffc170a4 ffc17744: 4b ff ff 60 b ffc176a4 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); uint32_t ofs_blk = offset - (blocks_in_offset << fs_info->vol.bytes_per_block_log2); ssize_t bytes_written = 0; ffc17748: 3b 20 00 00 li r25,0 <== NOT EXECUTED } if (RC_OK != rc) return rc; else return bytes_written; } ffc1774c: 80 01 00 44 lwz r0,68(r1) cur_blk, ofs_blk, c, &buffer[bytes_written], overwrite_cluster); if (c != ret) ffc17750: 7f 23 cb 78 mr r3,r25 } if (RC_OK != rc) return rc; else return bytes_written; } ffc17754: 81 81 00 18 lwz r12,24(r1) ffc17758: 7c 08 03 a6 mtlr r0 ffc1775c: 82 e1 00 1c lwz r23,28(r1) ffc17760: 83 01 00 20 lwz r24,32(r1) ffc17764: 7d 80 81 20 mtcrf 8,r12 ffc17768: 83 21 00 24 lwz r25,36(r1) ffc1776c: 83 41 00 28 lwz r26,40(r1) ffc17770: 83 61 00 2c lwz r27,44(r1) ffc17774: 83 81 00 30 lwz r28,48(r1) ffc17778: 83 a1 00 34 lwz r29,52(r1) ffc1777c: 83 c1 00 38 lwz r30,56(r1) ffc17780: 83 e1 00 3c lwz r31,60(r1) ffc17784: 38 21 00 40 addi r1,r1,64 ffc17788: 4e 80 00 20 blr 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); ffc1778c: 88 dd 00 02 lbz r6,2(r29) uint32_t ino ) { return (ino >= fs_info->uino_base); } ffc17790: 88 fd 00 0c lbz r7,12(r29) ffc17794: 54 da 06 3e clrlwi r26,r6,24 ffc17798: 81 3d 00 20 lwz r9,32(r29) ffc1779c: 7f 5a 38 50 subf r26,r26,r7 ffc177a0: 7d 3a d4 30 srw r26,r9,r26 ffc177a4: 4b ff fe 84 b ffc17628 =============================================================================== ffc16560 : int fat_file_close( fat_fs_info_t *fs_info, fat_file_fd_t *fat_fd ) { ffc16560: 94 21 ff e8 stwu r1,-24(r1) ffc16564: 7c 08 02 a6 mflr r0 ffc16568: 90 01 00 1c stw r0,28(r1) /* * 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) ffc1656c: 81 24 00 08 lwz r9,8(r4) int fat_file_close( fat_fs_info_t *fs_info, fat_file_fd_t *fat_fd ) { ffc16570: 93 e1 00 14 stw r31,20(r1) ffc16574: 7c 9f 23 78 mr r31,r4 /* * 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) ffc16578: 2b 89 00 01 cmplwi cr7,r9,1 int fat_file_close( fat_fs_info_t *fs_info, fat_file_fd_t *fat_fd ) { ffc1657c: 93 a1 00 0c stw r29,12(r1) ffc16580: 93 c1 00 10 stw r30,16(r1) /* * 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) ffc16584: 40 9d 00 2c ble- cr7,ffc165b0 { fat_fd->links_num--; ffc16588: 39 29 ff ff addi r9,r9,-1 ffc1658c: 91 24 00 08 stw r9,8(r4) return rc; ffc16590: 38 60 00 00 li r3,0 * flush any modified "cached" buffer back to disk */ rc = fat_buf_release(fs_info); return rc; } ffc16594: 80 01 00 1c lwz r0,28(r1) ffc16598: 83 a1 00 0c lwz r29,12(r1) ffc1659c: 7c 08 03 a6 mtlr r0 ffc165a0: 83 c1 00 10 lwz r30,16(r1) ffc165a4: 83 e1 00 14 lwz r31,20(r1) ffc165a8: 38 21 00 18 addi r1,r1,24 ffc165ac: 4e 80 00 20 blr return rc; } key = fat_construct_key(fs_info, &fat_fd->dir_pos.sname); if (fat_fd->flags & FAT_FILE_REMOVED) ffc165b0: 89 24 00 30 lbz r9,48(r4) ffc165b4: 7c 7e 1b 78 mr r30,r3 ffc165b8: 71 3d 00 01 andi. r29,r9,1 ffc165bc: 41 82 00 58 beq- ffc16614 { rc = fat_file_truncate(fs_info, fat_fd, 0); ffc165c0: 38 a0 00 00 li r5,0 ffc165c4: 4b ff fe 69 bl ffc1642c if ( rc != RC_OK ) ffc165c8: 2c 03 00 00 cmpwi r3,0 ffc165cc: 40 82 ff c8 bne+ ffc16594 <== NEVER TAKEN */ RTEMS_INLINE_ROUTINE void rtems_chain_extract( rtems_chain_node *the_node ) { _Chain_Extract( the_node ); ffc165d0: 7f e3 fb 78 mr r3,r31 ffc165d4: 48 00 40 b5 bl ffc1a688 <_Chain_Extract> return rc; _hash_delete(fs_info->rhash, key, fat_fd->ino, fat_fd); if ( fat_ino_is_unique(fs_info, fat_fd->ino) ) ffc165d8: 80 9f 00 0c lwz r4,12(r31) ffc165dc: 7f c3 f3 78 mr r3,r30 ffc165e0: 48 00 1e 59 bl ffc18438 ffc165e4: 2f 83 00 00 cmpwi cr7,r3,0 ffc165e8: 40 9e 00 6c bne- cr7,ffc16654 <== NEVER TAKEN fat_fd->links_num = 0; } else { _hash_delete(fs_info->vhash, key, fat_fd->ino, fat_fd); free(fat_fd); ffc165ec: 7f e3 fb 78 mr r3,r31 ffc165f0: 4b ff 01 21 bl ffc06710 * flush any modified "cached" buffer back to disk */ rc = fat_buf_release(fs_info); return rc; } ffc165f4: 80 01 00 1c lwz r0,28(r1) ffc165f8: 83 a1 00 0c lwz r29,12(r1) } } /* * flush any modified "cached" buffer back to disk */ rc = fat_buf_release(fs_info); ffc165fc: 7f c3 f3 78 mr r3,r30 return rc; } ffc16600: 7c 08 03 a6 mtlr r0 ffc16604: 83 c1 00 10 lwz r30,16(r1) ffc16608: 83 e1 00 14 lwz r31,20(r1) ffc1660c: 38 21 00 18 addi r1,r1,24 } } /* * flush any modified "cached" buffer back to disk */ rc = fat_buf_release(fs_info); ffc16610: 48 00 08 b0 b ffc16ec0 free(fat_fd); } else { if (fat_ino_is_unique(fs_info, fat_fd->ino)) ffc16614: 80 84 00 0c lwz r4,12(r4) ffc16618: 48 00 1e 21 bl ffc18438 ffc1661c: 2f 83 00 00 cmpwi cr7,r3,0 ffc16620: 41 9e 00 28 beq- cr7,ffc16648 * flush any modified "cached" buffer back to disk */ rc = fat_buf_release(fs_info); return rc; } ffc16624: 80 01 00 1c lwz r0,28(r1) } } /* * flush any modified "cached" buffer back to disk */ rc = fat_buf_release(fs_info); ffc16628: 7f c3 f3 78 mr r3,r30 } else { if (fat_ino_is_unique(fs_info, fat_fd->ino)) { fat_fd->links_num = 0; ffc1662c: 93 bf 00 08 stw r29,8(r31) * flush any modified "cached" buffer back to disk */ rc = fat_buf_release(fs_info); return rc; } ffc16630: 7c 08 03 a6 mtlr r0 ffc16634: 83 a1 00 0c lwz r29,12(r1) ffc16638: 83 c1 00 10 lwz r30,16(r1) ffc1663c: 83 e1 00 14 lwz r31,20(r1) ffc16640: 38 21 00 18 addi r1,r1,24 } } /* * flush any modified "cached" buffer back to disk */ rc = fat_buf_release(fs_info); ffc16644: 48 00 08 7c b ffc16ec0 ffc16648: 7f e3 fb 78 mr r3,r31 ffc1664c: 48 00 40 3d bl ffc1a688 <_Chain_Extract> ffc16650: 4b ff ff 9c b ffc165ec return rc; _hash_delete(fs_info->rhash, key, fat_fd->ino, fat_fd); if ( fat_ino_is_unique(fs_info, fat_fd->ino) ) fat_free_unique_ino(fs_info, fat_fd->ino); ffc16654: 80 9f 00 0c lwz r4,12(r31) <== NOT EXECUTED ffc16658: 7f c3 f3 78 mr r3,r30 <== NOT EXECUTED ffc1665c: 48 00 1d b1 bl ffc1840c <== NOT EXECUTED ffc16660: 4b ff ff 8c b ffc165ec <== NOT EXECUTED =============================================================================== ffc16764 : fat_file_fd_t *fat_fd, bool zero_fill, uint32_t new_length, uint32_t *a_length ) { ffc16764: 94 21 ff c0 stwu r1,-64(r1) ffc16768: 7c 08 02 a6 mflr r0 int rc = RC_OK; uint32_t chain = 0; ffc1676c: 39 40 00 00 li r10,0 fat_file_fd_t *fat_fd, bool zero_fill, uint32_t new_length, uint32_t *a_length ) { ffc16770: 93 81 00 30 stw r28,48(r1) ffc16774: 7c fc 3b 78 mr r28,r7 ffc16778: 90 01 00 44 stw r0,68(r1) ffc1677c: 93 c1 00 38 stw r30,56(r1) ffc16780: 7c 9e 23 78 mr r30,r4 ffc16784: 93 e1 00 3c stw r31,60(r1) ffc16788: 7c df 33 78 mr r31,r6 ffc1678c: 92 e1 00 1c stw r23,28(r1) ffc16790: 93 01 00 20 stw r24,32(r1) ffc16794: 93 21 00 24 stw r25,36(r1) ffc16798: 93 41 00 28 stw r26,40(r1) ffc1679c: 93 61 00 2c stw r27,44(r1) ffc167a0: 93 a1 00 34 stw r29,52(r1) uint32_t last_cl = 0; uint32_t bytes_remain = 0; uint32_t cls_added; ssize_t bytes_written; *a_length = new_length; ffc167a4: 90 dc 00 00 stw r6,0(r28) if (new_length <= fat_fd->fat_file_size) ffc167a8: 81 24 00 18 lwz r9,24(r4) uint32_t new_length, uint32_t *a_length ) { int rc = RC_OK; uint32_t chain = 0; ffc167ac: 91 41 00 14 stw r10,20(r1) uint32_t cls_added; ssize_t bytes_written; *a_length = new_length; if (new_length <= fat_fd->fat_file_size) ffc167b0: 7f 86 48 40 cmplw cr7,r6,r9 int rc = RC_OK; uint32_t chain = 0; uint32_t bytes2add = 0; uint32_t cls2add = 0; uint32_t old_last_cl; uint32_t last_cl = 0; ffc167b4: 91 41 00 0c stw r10,12(r1) uint32_t cls_added; ssize_t bytes_written; *a_length = new_length; if (new_length <= fat_fd->fat_file_size) ffc167b8: 40 9d 00 58 ble- cr7,ffc16810 return RC_OK; if ((FAT_FD_OF_ROOT_DIR(fat_fd)) && ffc167bc: 81 44 00 20 lwz r10,32(r4) ffc167c0: 7c 7d 1b 78 mr r29,r3 ffc167c4: 7c b9 2b 78 mr r25,r5 ffc167c8: 2f 8a 00 01 cmpwi cr7,r10,1 ffc167cc: 41 9e 01 48 beq- cr7,ffc16914 (fs_info->vol.type & (FAT_FAT12 | FAT_FAT16))) rtems_set_errno_and_return_minus_one( ENOSPC ); bytes_remain = (fs_info->vol.bpc - ffc167d0: a3 5d 00 06 lhz r26,6(r29) (fat_fd->fat_file_size & (fs_info->vol.bpc - 1))) & (fs_info->vol.bpc - 1); bytes2add = new_length - fat_fd->fat_file_size; ffc167d4: 7d 09 f8 50 subf r8,r9,r31 if (bytes2add > bytes_remain) bytes2add -= bytes_remain; else bytes2add = 0; ffc167d8: 3b 00 00 00 li r24,0 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 - (fat_fd->fat_file_size & (fs_info->vol.bpc - 1))) & ffc167dc: 39 5a ff ff addi r10,r26,-1 ffc167e0: 7d 57 48 38 and r23,r10,r9 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 - ffc167e4: 7f 57 d0 50 subf r26,r23,r26 ffc167e8: 7f 5a 50 38 and r26,r26,r10 (fat_fd->fat_file_size & (fs_info->vol.bpc - 1))) & (fs_info->vol.bpc - 1); bytes2add = new_length - fat_fd->fat_file_size; if (bytes2add > bytes_remain) ffc167ec: 7f 9a 40 40 cmplw cr7,r26,r8 ffc167f0: 40 9c 00 08 bge- cr7,ffc167f8 bytes2add -= bytes_remain; ffc167f4: 7f 1a 40 50 subf r24,r26,r8 else bytes2add = 0; if (zero_fill && bytes_remain > 0) { ffc167f8: 2f 99 00 00 cmpwi cr7,r25,0 ffc167fc: 41 9e 00 0c beq- cr7,ffc16808 ffc16800: 2f 9a 00 00 cmpwi cr7,r26,0 ffc16804: 40 9e 01 3c bne- cr7,ffc16940 /* * 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) ffc16808: 2f 98 00 00 cmpwi cr7,r24,0 ffc1680c: 40 9e 00 40 bne- cr7,ffc1684c ssize_t bytes_written; *a_length = new_length; if (new_length <= fat_fd->fat_file_size) return RC_OK; ffc16810: 3b 60 00 00 li r27,0 *a_length = new_length; fat_fd->fat_file_size = new_length; return RC_OK; } ffc16814: 80 01 00 44 lwz r0,68(r1) ffc16818: 7f 63 db 78 mr r3,r27 ffc1681c: 82 e1 00 1c lwz r23,28(r1) ffc16820: 7c 08 03 a6 mtlr r0 ffc16824: 83 01 00 20 lwz r24,32(r1) ffc16828: 83 21 00 24 lwz r25,36(r1) ffc1682c: 83 41 00 28 lwz r26,40(r1) ffc16830: 83 61 00 2c lwz r27,44(r1) ffc16834: 83 81 00 30 lwz r28,48(r1) ffc16838: 83 a1 00 34 lwz r29,52(r1) ffc1683c: 83 c1 00 38 lwz r30,56(r1) ffc16840: 83 e1 00 3c lwz r31,60(r1) ffc16844: 38 21 00 40 addi r1,r1,64 ffc16848: 4e 80 00 20 blr * file ) - return */ if (bytes2add == 0) return RC_OK; cls2add = ((bytes2add - 1) >> fs_info->vol.bpc_log2) + 1; ffc1684c: 89 3d 00 08 lbz r9,8(r29) ffc16850: 3a f8 ff ff addi r23,r24,-1 rc = fat_scan_fat_for_free_clusters(fs_info, &chain, cls2add, ffc16854: 7f a3 eb 78 mr r3,r29 * file ) - return */ if (bytes2add == 0) return RC_OK; cls2add = ((bytes2add - 1) >> fs_info->vol.bpc_log2) + 1; ffc16858: 7e f7 4c 30 srw r23,r23,r9 ffc1685c: 3a f7 00 01 addi r23,r23,1 rc = fat_scan_fat_for_free_clusters(fs_info, &chain, cls2add, ffc16860: 38 81 00 14 addi r4,r1,20 ffc16864: 7e e5 bb 78 mr r5,r23 ffc16868: 38 c1 00 08 addi r6,r1,8 ffc1686c: 38 e1 00 0c addi r7,r1,12 ffc16870: 7f 28 cb 78 mr r8,r25 ffc16874: 48 00 83 21 bl ffc1eb94 &cls_added, &last_cl, zero_fill); /* this means that low level I/O error occured */ if (rc != RC_OK) ffc16878: 7c 7b 1b 79 mr. r27,r3 ffc1687c: 40 a2 ff 98 bne- ffc16814 <== NEVER TAKEN return rc; /* this means that no space left on device */ if ((cls_added == 0) && (bytes_remain == 0)) ffc16880: 81 21 00 08 lwz r9,8(r1) ffc16884: 7f 4a 4b 79 or. r10,r26,r9 ffc16888: 41 82 00 a4 beq- ffc1692c <== NEVER TAKEN rtems_set_errno_and_return_minus_one(ENOSPC); /* check wether we satisfied request for 'cls2add' clusters */ if (cls2add != cls_added) ffc1688c: 7f 97 48 00 cmpw cr7,r23,r9 ffc16890: 41 9e 00 24 beq- cr7,ffc168b4 <== ALWAYS TAKEN { new_length -= bytes2add & (fs_info->vol.bpc - 1); ffc16894: a1 1d 00 06 lhz r8,6(r29) <== NOT EXECUTED new_length -= (cls2add - cls_added) << fs_info->vol.bpc_log2; ffc16898: 7e e9 b8 50 subf r23,r9,r23 <== NOT EXECUTED ffc1689c: 89 5d 00 08 lbz r10,8(r29) <== 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); ffc168a0: 39 08 ff ff addi r8,r8,-1 <== NOT EXECUTED ffc168a4: 7f 18 40 38 and r24,r24,r8 <== NOT EXECUTED ffc168a8: 7f f8 f8 50 subf r31,r24,r31 <== NOT EXECUTED new_length -= (cls2add - cls_added) << fs_info->vol.bpc_log2; ffc168ac: 7e f7 50 30 slw r23,r23,r10 <== NOT EXECUTED ffc168b0: 7f f7 f8 50 subf r31,r23,r31 <== NOT EXECUTED } /* add new chain to the end of existed */ if ( fat_fd->fat_file_size == 0 ) ffc168b4: 80 de 00 18 lwz r6,24(r30) ffc168b8: 2f 86 00 00 cmpwi cr7,r6,0 ffc168bc: 40 9e 00 d8 bne- cr7,ffc16994 { fat_fd->map.disk_cln = fat_fd->cln = chain; ffc168c0: 81 41 00 14 lwz r10,20(r1) fat_fd->map.file_cln = 0; ffc168c4: 90 de 00 34 stw r6,52(r30) } /* add new chain to the end of existed */ if ( fat_fd->fat_file_size == 0 ) { fat_fd->map.disk_cln = fat_fd->cln = chain; ffc168c8: 91 5e 00 1c stw r10,28(r30) ffc168cc: 91 5e 00 38 stw r10,56(r30) } fat_buf_release(fs_info); } /* update number of the last cluster of the file if it changed */ if (cls_added != 0) ffc168d0: 2f 89 00 00 cmpwi cr7,r9,0 ffc168d4: 41 9e 00 b4 beq- cr7,ffc16988 <== NEVER TAKEN { fat_fd->map.last_cln = last_cl; if (fat_fd->fat_file_type == FAT_DIRECTORY) ffc168d8: 81 3e 00 10 lwz r9,16(r30) ffc168dc: 2f 89 00 00 cmpwi cr7,r9,0 } /* update number of the last cluster of the file if it changed */ if (cls_added != 0) { fat_fd->map.last_cln = last_cl; ffc168e0: 81 21 00 0c lwz r9,12(r1) ffc168e4: 91 3e 00 3c stw r9,60(r30) if (fat_fd->fat_file_type == FAT_DIRECTORY) ffc168e8: 40 be 00 a0 bne+ cr7,ffc16988 { rc = fat_init_clusters_chain(fs_info, chain); ffc168ec: 80 81 00 14 lwz r4,20(r1) ffc168f0: 7f a3 eb 78 mr r3,r29 ffc168f4: 48 00 19 29 bl ffc1821c if ( rc != RC_OK ) ffc168f8: 7c 7a 1b 79 mr. r26,r3 ffc168fc: 41 a2 00 8c beq+ ffc16988 <== ALWAYS TAKEN { fat_free_fat_clusters_chain(fs_info, chain); ffc16900: 80 81 00 14 lwz r4,20(r1) <== NOT EXECUTED ffc16904: 7f a3 eb 78 mr r3,r29 <== NOT EXECUTED ffc16908: 7f 5b d3 78 mr r27,r26 <== NOT EXECUTED ffc1690c: 48 00 81 4d bl ffc1ea58 <== NOT EXECUTED ffc16910: 4b ff ff 04 b ffc16814 <== NOT EXECUTED *a_length = new_length; if (new_length <= fat_fd->fat_file_size) return RC_OK; if ((FAT_FD_OF_ROOT_DIR(fat_fd)) && ffc16914: 81 44 00 24 lwz r10,36(r4) ffc16918: 2f 8a 00 00 cmpwi cr7,r10,0 ffc1691c: 40 be fe b4 bne- cr7,ffc167d0 <== NEVER TAKEN (fs_info->vol.type & (FAT_FAT12 | FAT_FAT16))) ffc16920: 89 43 00 0e lbz r10,14(r3) *a_length = new_length; if (new_length <= fat_fd->fat_file_size) return RC_OK; if ((FAT_FD_OF_ROOT_DIR(fat_fd)) && ffc16924: 71 48 00 03 andi. r8,r10,3 ffc16928: 41 82 fe a8 beq+ ffc167d0 <== NEVER TAKEN if (rc != RC_OK) return rc; /* this means that no space left on device */ if ((cls_added == 0) && (bytes_remain == 0)) rtems_set_errno_and_return_minus_one(ENOSPC); ffc1692c: 48 00 9d 71 bl ffc2069c <__errno> ffc16930: 39 20 00 1c li r9,28 ffc16934: 91 23 00 00 stw r9,0(r3) ffc16938: 3b 60 ff ff li r27,-1 ffc1693c: 4b ff fe d8 b ffc16814 else bytes2add = 0; if (zero_fill && bytes_remain > 0) { uint32_t start = fat_fd->fat_file_size; uint32_t cl_start = start >> fs_info->vol.bpc_log2; ffc16940: 88 bd 00 08 lbz r5,8(r29) 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); ffc16944: 7f a3 eb 78 mr r3,r29 ffc16948: 7f c4 f3 78 mr r4,r30 ffc1694c: 7d 25 2c 30 srw r5,r9,r5 ffc16950: 38 c1 00 08 addi r6,r1,8 ffc16954: 4b ff f3 f1 bl ffc15d44 if (rc != RC_OK) ffc16958: 7c 9b 23 79 mr. r27,r4 ffc1695c: 40 82 fe b8 bne+ ffc16814 <== NEVER TAKEN return rc; bytes_written = fat_cluster_set (fs_info, cur_cln, ofs, bytes_remain, 0); ffc16960: 80 81 00 08 lwz r4,8(r1) ffc16964: 7f a3 eb 78 mr r3,r29 ffc16968: 7e e5 bb 78 mr r5,r23 ffc1696c: 7f 46 d3 78 mr r6,r26 ffc16970: 38 e0 00 00 li r7,0 ffc16974: 48 00 0a 29 bl ffc1739c if (bytes_remain != bytes_written) return -1; ffc16978: 3b 60 ff ff li r27,-1 rc = fat_file_lseek(fs_info, fat_fd, cl_start, &cur_cln); if (rc != RC_OK) return rc; bytes_written = fat_cluster_set (fs_info, cur_cln, ofs, bytes_remain, 0); if (bytes_remain != bytes_written) ffc1697c: 7f 83 d0 00 cmpw cr7,r3,r26 ffc16980: 40 9e fe 94 bne+ cr7,ffc16814 <== NEVER TAKEN ffc16984: 4b ff fe 84 b ffc16808 return rc; } } } *a_length = new_length; ffc16988: 93 fc 00 00 stw r31,0(r28) fat_fd->fat_file_size = new_length; ffc1698c: 93 fe 00 18 stw r31,24(r30) ffc16990: 4b ff fe 84 b ffc16814 fat_fd->map.disk_cln = fat_fd->cln = chain; fat_fd->map.file_cln = 0; } else { if (fat_fd->map.last_cln != FAT_UNDEFINED_VALUE) ffc16994: 80 9e 00 3c lwz r4,60(r30) ffc16998: 2f 84 ff ff cmpwi cr7,r4,-1 ffc1699c: 41 9e 00 2c beq- cr7,ffc169c8 <== NEVER TAKEN { old_last_cl = fat_fd->map.last_cln; ffc169a0: 90 81 00 10 stw r4,16(r1) fat_free_fat_clusters_chain(fs_info, chain); return rc; } } rc = fat_set_fat_cluster(fs_info, old_last_cl, chain); ffc169a4: 80 a1 00 14 lwz r5,20(r1) ffc169a8: 7f a3 eb 78 mr r3,r29 ffc169ac: 48 00 7d 79 bl ffc1e724 if ( rc != RC_OK ) ffc169b0: 7c 7a 1b 79 mr. r26,r3 ffc169b4: 40 a2 ff 4c bne- ffc16900 <== NEVER TAKEN { fat_free_fat_clusters_chain(fs_info, chain); return rc; } fat_buf_release(fs_info); ffc169b8: 7f a3 eb 78 mr r3,r29 ffc169bc: 48 00 05 05 bl ffc16ec0 ffc169c0: 81 21 00 08 lwz r9,8(r1) ffc169c4: 4b ff ff 0c b ffc168d0 { old_last_cl = fat_fd->map.last_cln; } else { rc = fat_file_ioctl(fs_info, fat_fd, F_CLU_NUM, ffc169c8: 7f c4 f3 78 mr r4,r30 <== NOT EXECUTED ffc169cc: 7f a3 eb 78 mr r3,r29 <== NOT EXECUTED ffc169d0: 38 a0 00 01 li r5,1 <== NOT EXECUTED ffc169d4: 38 c6 ff ff addi r6,r6,-1 <== NOT EXECUTED ffc169d8: 38 e1 00 10 addi r7,r1,16 <== NOT EXECUTED ffc169dc: 4c c6 31 82 crclr 4*cr1+eq <== NOT EXECUTED ffc169e0: 4b ff fc 85 bl ffc16664 <== NOT EXECUTED ffc169e4: 80 81 00 10 lwz r4,16(r1) <== NOT EXECUTED (fat_fd->fat_file_size - 1), &old_last_cl); if ( rc != RC_OK ) ffc169e8: 7c 7a 1b 79 mr. r26,r3 <== NOT EXECUTED ffc169ec: 41 82 ff b8 beq+ ffc169a4 <== NOT EXECUTED ffc169f0: 4b ff ff 10 b ffc16900 <== NOT EXECUTED =============================================================================== ffc16664 : uint32_t *ret; va_list ap; va_start(ap, cmd); switch (cmd) ffc16664: 2f 85 00 01 cmpwi cr7,r5,1 fat_file_ioctl( fat_fs_info_t *fs_info, fat_file_fd_t *fat_fd, int cmd, ...) { ffc16668: 94 21 ff d0 stwu r1,-48(r1) int rc = RC_OK; uint32_t cur_cln = 0; ffc1666c: 39 40 00 00 li r10,0 fat_file_ioctl( fat_fs_info_t *fs_info, fat_file_fd_t *fat_fd, int cmd, ...) { ffc16670: 7c 08 02 a6 mflr r0 int rc = RC_OK; uint32_t cur_cln = 0; ffc16674: 91 41 00 14 stw r10,20(r1) uint32_t cl_start = 0; uint32_t pos = 0; uint32_t *ret; va_list ap; va_start(ap, cmd); ffc16678: 39 40 00 03 li r10,3 ffc1667c: 39 21 00 10 addi r9,r1,16 ffc16680: 99 41 00 08 stb r10,8(r1) ffc16684: 39 41 00 38 addi r10,r1,56 fat_file_ioctl( fat_fs_info_t *fs_info, fat_file_fd_t *fat_fd, int cmd, ...) { ffc16688: 90 01 00 34 stw r0,52(r1) ffc1668c: 93 c1 00 28 stw r30,40(r1) ffc16690: 93 e1 00 2c stw r31,44(r1) ffc16694: 90 c1 00 1c stw r6,28(r1) ffc16698: 90 e1 00 20 stw r7,32(r1) uint32_t cl_start = 0; uint32_t pos = 0; uint32_t *ret; va_list ap; va_start(ap, cmd); ffc1669c: 91 41 00 0c stw r10,12(r1) ffc166a0: 91 21 00 10 stw r9,16(r1) switch (cmd) ffc166a4: 41 9e 00 2c beq- cr7,ffc166d0 <== ALWAYS TAKEN *ret = cur_cln; break; default: errno = EINVAL; ffc166a8: 48 00 9f f5 bl ffc2069c <__errno> <== NOT EXECUTED ffc166ac: 39 20 00 16 li r9,22 <== NOT EXECUTED ffc166b0: 91 23 00 00 stw r9,0(r3) <== NOT EXECUTED rc = -1; ffc166b4: 38 60 ff ff li r3,-1 <== NOT EXECUTED break; } va_end(ap); return rc; } ffc166b8: 80 01 00 34 lwz r0,52(r1) ffc166bc: 83 c1 00 28 lwz r30,40(r1) ffc166c0: 7c 08 03 a6 mtlr r0 ffc166c4: 83 e1 00 2c lwz r31,44(r1) ffc166c8: 38 21 00 30 addi r1,r1,48 ffc166cc: 4e 80 00 20 blr case F_CLU_NUM: pos = va_arg(ap, uint32_t); ret = va_arg(ap, uint32_t *); /* sanity check */ if ( pos >= fat_fd->fat_file_size ) { ffc166d0: 81 04 00 18 lwz r8,24(r4) switch (cmd) { case F_CLU_NUM: pos = va_arg(ap, uint32_t); ret = va_arg(ap, uint32_t *); ffc166d4: 3b e0 00 05 li r31,5 va_start(ap, cmd); switch (cmd) { case F_CLU_NUM: pos = va_arg(ap, uint32_t); ffc166d8: 7c ca 33 78 mr r10,r6 ret = va_arg(ap, uint32_t *); ffc166dc: 9b e1 00 08 stb r31,8(r1) /* sanity check */ if ( pos >= fat_fd->fat_file_size ) { ffc166e0: 7f 88 30 40 cmplw cr7,r8,r6 switch (cmd) { case F_CLU_NUM: pos = va_arg(ap, uint32_t); ret = va_arg(ap, uint32_t *); ffc166e4: 7c fe 3b 78 mr r30,r7 /* sanity check */ if ( pos >= fat_fd->fat_file_size ) { ffc166e8: 40 9d 00 6c ble- cr7,ffc16754 <== NEVER TAKEN va_end(ap); rtems_set_errno_and_return_minus_one( EIO ); } if ((FAT_FD_OF_ROOT_DIR(fat_fd)) && ffc166ec: 81 24 00 20 lwz r9,32(r4) ffc166f0: 2f 89 00 01 cmpwi cr7,r9,1 ffc166f4: 41 9e 00 3c beq- cr7,ffc16730 *ret = 0; rc = RC_OK; break; } cl_start = pos >> fs_info->vol.bpc_log2; ffc166f8: 88 a3 00 08 lbz r5,8(r3) rc = fat_file_lseek(fs_info, fat_fd, cl_start, &cur_cln); ffc166fc: 38 c1 00 14 addi r6,r1,20 ffc16700: 7d 45 2c 30 srw r5,r10,r5 ffc16704: 4b ff f6 41 bl ffc15d44 if ( rc != RC_OK ) ffc16708: 7c 83 23 79 mr. r3,r4 ffc1670c: 40 a2 ff ac bne- ffc166b8 <== NEVER TAKEN rc = -1; break; } va_end(ap); return rc; } ffc16710: 80 01 00 34 lwz r0,52(r1) rc = fat_file_lseek(fs_info, fat_fd, cl_start, &cur_cln); if ( rc != RC_OK ) break; *ret = cur_cln; ffc16714: 81 21 00 14 lwz r9,20(r1) rc = -1; break; } va_end(ap); return rc; } ffc16718: 7c 08 03 a6 mtlr r0 ffc1671c: 83 e1 00 2c lwz r31,44(r1) rc = fat_file_lseek(fs_info, fat_fd, cl_start, &cur_cln); if ( rc != RC_OK ) break; *ret = cur_cln; ffc16720: 91 3e 00 00 stw r9,0(r30) rc = -1; break; } va_end(ap); return rc; } ffc16724: 83 c1 00 28 lwz r30,40(r1) ffc16728: 38 21 00 30 addi r1,r1,48 ffc1672c: 4e 80 00 20 blr 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)) && ffc16730: 81 24 00 24 lwz r9,36(r4) ffc16734: 2f 89 00 00 cmpwi cr7,r9,0 ffc16738: 40 be ff c0 bne- cr7,ffc166f8 <== NEVER TAKEN (fs_info->vol.type & (FAT_FAT12 | FAT_FAT16))) ffc1673c: 89 03 00 0e lbz r8,14(r3) 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)) && ffc16740: 71 07 00 03 andi. r7,r8,3 ffc16744: 41 a2 ff b4 beq- ffc166f8 (fs_info->vol.type & (FAT_FAT12 | FAT_FAT16))) { /* cluster 0 (zero) reserved for root dir */ *ret = 0; ffc16748: 91 3e 00 00 stw r9,0(r30) rc = RC_OK; ffc1674c: 38 60 00 00 li r3,0 break; ffc16750: 4b ff ff 68 b ffc166b8 ret = va_arg(ap, uint32_t *); /* sanity check */ if ( pos >= fat_fd->fat_file_size ) { va_end(ap); rtems_set_errno_and_return_minus_one( EIO ); ffc16754: 48 00 9f 49 bl ffc2069c <__errno> <== NOT EXECUTED ffc16758: 93 e3 00 00 stw r31,0(r3) <== NOT EXECUTED ffc1675c: 38 60 ff ff li r3,-1 <== NOT EXECUTED ffc16760: 4b ff ff 58 b ffc166b8 <== NOT EXECUTED =============================================================================== ffc15d44 : fat_fs_info_t *fs_info, fat_file_fd_t *fat_fd, uint32_t file_cln, uint32_t *disk_cln ) { ffc15d44: 94 21 ff d0 stwu r1,-48(r1) ffc15d48: 7c 08 02 a6 mflr r0 ffc15d4c: 90 01 00 34 stw r0,52(r1) ffc15d50: 93 c1 00 28 stw r30,40(r1) int rc = RC_OK; if (file_cln == fat_fd->map.file_cln) ffc15d54: 83 c4 00 34 lwz r30,52(r4) fat_fs_info_t *fs_info, fat_file_fd_t *fat_fd, uint32_t file_cln, uint32_t *disk_cln ) { ffc15d58: 93 41 00 18 stw r26,24(r1) ffc15d5c: 7c da 33 78 mr r26,r6 int rc = RC_OK; if (file_cln == fat_fd->map.file_cln) ffc15d60: 7f 9e 28 00 cmpw cr7,r30,r5 fat_fs_info_t *fs_info, fat_file_fd_t *fat_fd, uint32_t file_cln, uint32_t *disk_cln ) { ffc15d64: 93 61 00 1c stw r27,28(r1) ffc15d68: 7c 9b 23 78 mr r27,r4 ffc15d6c: 93 81 00 20 stw r28,32(r1) ffc15d70: 7c bc 2b 78 mr r28,r5 ffc15d74: 93 a1 00 24 stw r29,36(r1) ffc15d78: 93 e1 00 2c stw r31,44(r1) int rc = RC_OK; if (file_cln == fat_fd->map.file_cln) ffc15d7c: 41 9e 00 d8 beq- cr7,ffc15e54 { uint32_t cur_cln; uint32_t count; uint32_t i; if (file_cln > fat_fd->map.file_cln) ffc15d80: 7f 9e 28 40 cmplw cr7,r30,r5 ffc15d84: 7c 7d 1b 78 mr r29,r3 ffc15d88: 41 9c 00 74 blt- cr7,ffc15dfc cur_cln = fat_fd->map.disk_cln; count = file_cln - fat_fd->map.file_cln; } else { cur_cln = fat_fd->cln; ffc15d8c: 81 24 00 1c lwz r9,28(r4) ffc15d90: 7c be 2b 78 mr r30,r5 ffc15d94: 91 21 00 08 stw r9,8(r1) count = file_cln; } /* skip over the clusters */ for (i = 0; i < count; i++) ffc15d98: 2f 9e 00 00 cmpwi cr7,r30,0 ffc15d9c: 3b e0 00 00 li r31,0 ffc15da0: 41 9e 00 6c beq- cr7,ffc15e0c { rc = fat_get_fat_cluster(fs_info, cur_cln, &cur_cln); ffc15da4: 80 81 00 08 lwz r4,8(r1) ffc15da8: 7f a3 eb 78 mr r3,r29 ffc15dac: 38 a1 00 08 addi r5,r1,8 ffc15db0: 48 00 87 25 bl ffc1e4d4 cur_cln = fat_fd->cln; count = file_cln; } /* skip over the clusters */ for (i = 0; i < count; i++) ffc15db4: 3b ff 00 01 addi r31,r31,1 { rc = fat_get_fat_cluster(fs_info, cur_cln, &cur_cln); if ( rc != RC_OK ) ffc15db8: 2c 03 00 00 cmpwi r3,0 cur_cln = fat_fd->cln; count = file_cln; } /* skip over the clusters */ for (i = 0; i < count; i++) ffc15dbc: 7f 9f f0 00 cmpw cr7,r31,r30 { rc = fat_get_fat_cluster(fs_info, cur_cln, &cur_cln); if ( rc != RC_OK ) ffc15dc0: 41 82 ff e0 beq+ ffc15da0 <== ALWAYS TAKEN fat_fd->map.disk_cln = cur_cln; *disk_cln = cur_cln; } return RC_OK; } ffc15dc4: 80 01 00 34 lwz r0,52(r1) <== NOT EXECUTED /* skip over the clusters */ for (i = 0; i < count; i++) { rc = fat_get_fat_cluster(fs_info, cur_cln, &cur_cln); if ( rc != RC_OK ) return rc; ffc15dc8: 7c 6b 1b 78 mr r11,r3 <== NOT EXECUTED ffc15dcc: 7c 6a fe 70 srawi r10,r3,31 <== NOT EXECUTED fat_fd->map.disk_cln = cur_cln; *disk_cln = cur_cln; } return RC_OK; } ffc15dd0: 83 41 00 18 lwz r26,24(r1) <== NOT EXECUTED ffc15dd4: 7c 08 03 a6 mtlr r0 <== NOT EXECUTED ffc15dd8: 83 61 00 1c lwz r27,28(r1) <== NOT EXECUTED ffc15ddc: 83 81 00 20 lwz r28,32(r1) <== NOT EXECUTED ffc15de0: 7d 43 53 78 mr r3,r10 <== NOT EXECUTED ffc15de4: 83 a1 00 24 lwz r29,36(r1) <== NOT EXECUTED ffc15de8: 7d 64 5b 78 mr r4,r11 <== NOT EXECUTED ffc15dec: 83 c1 00 28 lwz r30,40(r1) <== NOT EXECUTED ffc15df0: 83 e1 00 2c lwz r31,44(r1) <== NOT EXECUTED ffc15df4: 38 21 00 30 addi r1,r1,48 <== NOT EXECUTED ffc15df8: 4e 80 00 20 blr <== NOT EXECUTED uint32_t count; uint32_t i; if (file_cln > fat_fd->map.file_cln) { cur_cln = fat_fd->map.disk_cln; ffc15dfc: 81 24 00 38 lwz r9,56(r4) count = file_cln - fat_fd->map.file_cln; ffc15e00: 7f de 28 50 subf r30,r30,r5 uint32_t count; uint32_t i; if (file_cln > fat_fd->map.file_cln) { cur_cln = fat_fd->map.disk_cln; ffc15e04: 91 21 00 08 stw r9,8(r1) ffc15e08: 4b ff ff 90 b ffc15d98 fat_fd->map.disk_cln = cur_cln; *disk_cln = cur_cln; } return RC_OK; } ffc15e0c: 80 01 00 34 lwz r0,52(r1) fat_fd->map.file_cln = file_cln; fat_fd->map.disk_cln = cur_cln; *disk_cln = cur_cln; } return RC_OK; ffc15e10: 39 40 00 00 li r10,0 return rc; } /* update cache */ fat_fd->map.file_cln = file_cln; fat_fd->map.disk_cln = cur_cln; ffc15e14: 81 21 00 08 lwz r9,8(r1) *disk_cln = cur_cln; } return RC_OK; ffc15e18: 39 60 00 00 li r11,0 } ffc15e1c: 7c 08 03 a6 mtlr r0 if ( rc != RC_OK ) return rc; } /* update cache */ fat_fd->map.file_cln = file_cln; ffc15e20: 93 9b 00 34 stw r28,52(r27) fat_fd->map.disk_cln = cur_cln; *disk_cln = cur_cln; } return RC_OK; } ffc15e24: 7d 43 53 78 mr r3,r10 return rc; } /* update cache */ fat_fd->map.file_cln = file_cln; fat_fd->map.disk_cln = cur_cln; ffc15e28: 91 3b 00 38 stw r9,56(r27) *disk_cln = cur_cln; } return RC_OK; } ffc15e2c: 7d 64 5b 78 mr r4,r11 /* update cache */ fat_fd->map.file_cln = file_cln; fat_fd->map.disk_cln = cur_cln; *disk_cln = cur_cln; ffc15e30: 91 3a 00 00 stw r9,0(r26) } return RC_OK; } ffc15e34: 83 61 00 1c lwz r27,28(r1) ffc15e38: 83 41 00 18 lwz r26,24(r1) ffc15e3c: 83 81 00 20 lwz r28,32(r1) ffc15e40: 83 a1 00 24 lwz r29,36(r1) ffc15e44: 83 c1 00 28 lwz r30,40(r1) ffc15e48: 83 e1 00 2c lwz r31,44(r1) ffc15e4c: 38 21 00 30 addi r1,r1,48 ffc15e50: 4e 80 00 20 blr ffc15e54: 80 01 00 34 lwz r0,52(r1) fat_fd->map.file_cln = file_cln; fat_fd->map.disk_cln = cur_cln; *disk_cln = cur_cln; } return RC_OK; ffc15e58: 39 40 00 00 li r10,0 ) { int rc = RC_OK; if (file_cln == fat_fd->map.file_cln) *disk_cln = fat_fd->map.disk_cln; ffc15e5c: 81 24 00 38 lwz r9,56(r4) fat_fd->map.file_cln = file_cln; fat_fd->map.disk_cln = cur_cln; *disk_cln = cur_cln; } return RC_OK; ffc15e60: 39 60 00 00 li r11,0 } ffc15e64: 7c 08 03 a6 mtlr r0 ffc15e68: 83 41 00 18 lwz r26,24(r1) ffc15e6c: 83 61 00 1c lwz r27,28(r1) ffc15e70: 7d 43 53 78 mr r3,r10 ffc15e74: 83 81 00 20 lwz r28,32(r1) ffc15e78: 7d 64 5b 78 mr r4,r11 ffc15e7c: 83 a1 00 24 lwz r29,36(r1) ffc15e80: 83 c1 00 28 lwz r30,40(r1) ffc15e84: 83 e1 00 2c lwz r31,44(r1) ) { int rc = RC_OK; if (file_cln == fat_fd->map.file_cln) *disk_cln = fat_fd->map.disk_cln; ffc15e88: 91 26 00 00 stw r9,0(r6) fat_fd->map.disk_cln = cur_cln; *disk_cln = cur_cln; } return RC_OK; } ffc15e8c: 38 21 00 30 addi r1,r1,48 ffc15e90: 4e 80 00 20 blr =============================================================================== ffc16cf0 : void fat_file_mark_removed( fat_fs_info_t *fs_info, fat_file_fd_t *fat_fd ) { ffc16cf0: 94 21 ff e8 stwu r1,-24(r1) ffc16cf4: 7c 08 02 a6 mflr r0 ffc16cf8: 90 01 00 1c stw r0,28(r1) ffc16cfc: 81 24 00 20 lwz r9,32(r4) ffc16d00: 93 c1 00 10 stw r30,16(r1) ffc16d04: 7c 7e 1b 78 mr r30,r3 fat_cluster_num_to_sector512_num( const fat_fs_info_t *fs_info, uint32_t cln ) { if (cln == 1) ffc16d08: 2f 89 00 01 cmpwi cr7,r9,1 ffc16d0c: 93 e1 00 14 stw r31,20(r1) ffc16d10: 7c 9f 23 78 mr r31,r4 ffc16d14: 93 a1 00 0c stw r29,12(r1) ffc16d18: 41 9e 00 9c beq- cr7,ffc16db4 <== NEVER TAKEN 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)) ) ffc16d1c: 2f 89 00 00 cmpwi cr7,r9,0 ffc16d20: 41 9e 00 80 beq- cr7,ffc16da0 <== ALWAYS TAKEN return fs_info->vol.rdir_loc; return (((cln - FAT_RSRVD_CLN) << fs_info->vol.spc_log2) + ffc16d24: 89 1e 00 05 lbz r8,5(r30) <== NOT EXECUTED ffc16d28: 3b a9 ff fe addi r29,r9,-2 <== NOT EXECUTED ffc16d2c: 81 5e 00 34 lwz r10,52(r30) <== NOT EXECUTED ffc16d30: 7f bd 40 30 slw r29,r29,r8 <== NOT EXECUTED ffc16d34: 7f bd 52 14 add r29,r29,r10 <== NOT EXECUTED ) { if (cln == 1) return 1; return (fat_cluster_num_to_sector_num(fs_info, cln) << ffc16d38: 89 5e 00 03 lbz r10,3(r30) ffc16d3c: 7f bd 50 30 slw r29,r29,r10 (pos->ofs >> FAT_SECTOR512_BITS)) << 4) + ffc16d40: 81 5f 00 24 lwz r10,36(r31) ffc16d44: 7f e3 fb 78 mr r3,r31 ffc16d48: 55 48 ba 7e rlwinm r8,r10,23,9,31 static inline uint32_t fat_construct_key( const fat_fs_info_t *fs_info, fat_pos_t *pos) { return ( ((fat_cluster_num_to_sector512_num(fs_info, pos->cln) + ffc16d4c: 7f bd 42 14 add r29,r29,r8 (pos->ofs >> FAT_SECTOR512_BITS)) << 4) + ((pos->ofs >> 5) & (FAT_DIRENTRIES_PER_SEC512 - 1)) ); ffc16d50: 55 4a df 3e rlwinm r10,r10,27,28,31 fat_construct_key( const fat_fs_info_t *fs_info, fat_pos_t *pos) { return ( ((fat_cluster_num_to_sector512_num(fs_info, pos->cln) + (pos->ofs >> FAT_SECTOR512_BITS)) << 4) + ffc16d54: 57 bd 20 36 rlwinm r29,r29,4,0,27 static inline uint32_t fat_construct_key( const fat_fs_info_t *fs_info, fat_pos_t *pos) { return ( ((fat_cluster_num_to_sector512_num(fs_info, pos->cln) + ffc16d58: 7f bd 52 14 add r29,r29,r10 ffc16d5c: 48 00 39 2d bl ffc1a688 <_Chain_Extract> */ 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); ffc16d60: 57 bd 07 fe clrlwi r29,r29,31 ffc16d64: 80 7e 00 70 lwz r3,112(r30) ffc16d68: 1f bd 00 0c mulli r29,r29,12 RTEMS_INLINE_ROUTINE void rtems_chain_append( rtems_chain_control *the_chain, rtems_chain_node *the_node ) { _Chain_Append( the_chain, the_node ); ffc16d6c: 7f e4 fb 78 mr r4,r31 ffc16d70: 7c 63 ea 14 add r3,r3,r29 ffc16d74: 4b ff 5b 9d bl ffc0c910 <_Chain_Append> _hash_delete(fs_info->vhash, key, fat_fd->ino, fat_fd); _hash_insert(fs_info->rhash, key, fat_fd->ino, fat_fd); fat_fd->flags |= FAT_FILE_REMOVED; ffc16d78: 89 3f 00 30 lbz r9,48(r31) ffc16d7c: 61 29 00 01 ori r9,r9,1 ffc16d80: 99 3f 00 30 stb r9,48(r31) } ffc16d84: 80 01 00 1c lwz r0,28(r1) ffc16d88: 83 a1 00 0c lwz r29,12(r1) ffc16d8c: 7c 08 03 a6 mtlr r0 ffc16d90: 83 c1 00 10 lwz r30,16(r1) ffc16d94: 83 e1 00 14 lwz r31,20(r1) ffc16d98: 38 21 00 18 addi r1,r1,24 ffc16d9c: 4e 80 00 20 blr 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)) ) ffc16da0: 89 43 00 0e lbz r10,14(r3) ffc16da4: 71 48 00 03 andi. r8,r10,3 ffc16da8: 41 a2 ff 7c beq- ffc16d24 <== NEVER TAKEN return fs_info->vol.rdir_loc; ffc16dac: 83 a3 00 20 lwz r29,32(r3) ffc16db0: 4b ff ff 88 b ffc16d38 const fat_fs_info_t *fs_info, uint32_t cln ) { if (cln == 1) return 1; ffc16db4: 3b a0 00 01 li r29,1 <== NOT EXECUTED ffc16db8: 4b ff ff 88 b ffc16d40 <== NOT EXECUTED =============================================================================== ffc15e94 : fat_file_open( fat_fs_info_t *fs_info, fat_dir_pos_t *dir_pos, fat_file_fd_t **fat_fd ) { ffc15e94: 94 21 ff d8 stwu r1,-40(r1) ffc15e98: 7c 08 02 a6 mflr r0 ffc15e9c: 90 01 00 2c stw r0,44(r1) static inline uint32_t fat_construct_key( const fat_fs_info_t *fs_info, fat_pos_t *pos) { return ( ((fat_cluster_num_to_sector512_num(fs_info, pos->cln) + ffc15ea0: 81 24 00 00 lwz r9,0(r4) ffc15ea4: 93 81 00 18 stw r28,24(r1) ffc15ea8: 7c bc 2b 78 mr r28,r5 fat_cluster_num_to_sector512_num( const fat_fs_info_t *fs_info, uint32_t cln ) { if (cln == 1) ffc15eac: 2f 89 00 01 cmpwi cr7,r9,1 ffc15eb0: 93 a1 00 1c stw r29,28(r1) ffc15eb4: 7c 9d 23 78 mr r29,r4 ffc15eb8: 93 e1 00 24 stw r31,36(r1) ffc15ebc: 7c 7f 1b 78 mr r31,r3 ffc15ec0: 93 21 00 0c stw r25,12(r1) ffc15ec4: 93 41 00 10 stw r26,16(r1) ffc15ec8: 93 61 00 14 stw r27,20(r1) ffc15ecc: 93 c1 00 20 stw r30,32(r1) ffc15ed0: 41 9e 02 8c beq- cr7,ffc1615c 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)) ) ffc15ed4: 2f 89 00 00 cmpwi cr7,r9,0 ffc15ed8: 41 9e 01 a0 beq- cr7,ffc16078 return fs_info->vol.rdir_loc; return (((cln - FAT_RSRVD_CLN) << fs_info->vol.spc_log2) + ffc15edc: 89 1f 00 05 lbz r8,5(r31) ffc15ee0: 3b c9 ff fe addi r30,r9,-2 ffc15ee4: 81 5f 00 34 lwz r10,52(r31) ffc15ee8: 7f de 40 30 slw r30,r30,r8 ffc15eec: 7f de 52 14 add r30,r30,r10 ) { if (cln == 1) return 1; return (fat_cluster_num_to_sector_num(fs_info, cln) << ffc15ef0: 89 5f 00 03 lbz r10,3(r31) ffc15ef4: 7f de 50 30 slw r30,r30,r10 (pos->ofs >> FAT_SECTOR512_BITS)) << 4) + ffc15ef8: 81 5d 00 04 lwz r10,4(r29) 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); ffc15efc: 81 3f 00 6c lwz r9,108(r31) ffc15f00: 55 48 ba 7e rlwinm r8,r10,23,9,31 static inline uint32_t fat_construct_key( const fat_fs_info_t *fs_info, fat_pos_t *pos) { return ( ((fat_cluster_num_to_sector512_num(fs_info, pos->cln) + ffc15f04: 7f de 42 14 add r30,r30,r8 (pos->ofs >> FAT_SECTOR512_BITS)) << 4) + ffc15f08: 57 de 20 36 rlwinm r30,r30,4,0,27 ((pos->ofs >> 5) & (FAT_DIRENTRIES_PER_SEC512 - 1)) ); ffc15f0c: 55 4a df 3e rlwinm r10,r10,27,28,31 static inline uint32_t fat_construct_key( const fat_fs_info_t *fs_info, fat_pos_t *pos) { return ( ((fat_cluster_num_to_sector512_num(fs_info, pos->cln) + ffc15f10: 7f de 52 14 add r30,r30,r10 uint32_t key1, uint32_t key2, fat_file_fd_t **ret ) { uint32_t mod = (key1) % FAT_HASH_MODULE; ffc15f14: 57 db 07 fe clrlwi r27,r30,31 rtems_chain_node *the_node = rtems_chain_first(hash + mod); ffc15f18: 1f 7b 00 0c mulli r27,r27,12 ffc15f1c: 7c c9 da 14 add r6,r9,r27 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_First( Chain_Control *the_chain ) { return _Chain_Head( the_chain )->next; ffc15f20: 7d 29 d8 2e lwzx r9,r9,r27 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 )); ffc15f24: 38 c6 00 04 addi r6,r6,4 for ( ; !rtems_chain_is_tail((hash) + mod, the_node) ; ) ffc15f28: 7f 89 30 00 cmpw cr7,r9,r6 ffc15f2c: 41 9e 00 60 beq- cr7,ffc15f8c ffc15f30: 81 49 00 20 lwz r10,32(r9) fat_cluster_num_to_sector512_num( const fat_fs_info_t *fs_info, uint32_t cln ) { if (cln == 1) ffc15f34: 2f 8a 00 01 cmpwi cr7,r10,1 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)) ) ffc15f38: 2f 0a 00 00 cmpwi cr6,r10,0 return fs_info->vol.rdir_loc; return (((cln - FAT_RSRVD_CLN) << fs_info->vol.spc_log2) + ffc15f3c: 39 4a ff fe addi r10,r10,-2 fat_cluster_num_to_sector512_num( const fat_fs_info_t *fs_info, uint32_t cln ) { if (cln == 1) ffc15f40: 41 9e 01 30 beq- cr7,ffc16070 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)) ) ffc15f44: 40 9a 00 d8 bne- cr6,ffc1601c ffc15f48: 89 1f 00 0e lbz r8,14(r31) ffc15f4c: 71 07 00 03 andi. r7,r8,3 ffc15f50: 41 82 00 cc beq- ffc1601c <== NEVER TAKEN return fs_info->vol.rdir_loc; ffc15f54: 81 5f 00 20 lwz r10,32(r31) ) { if (cln == 1) return 1; return (fat_cluster_num_to_sector_num(fs_info, cln) << ffc15f58: 89 1f 00 03 lbz r8,3(r31) ffc15f5c: 7d 4a 40 30 slw r10,r10,r8 (pos->ofs >> FAT_SECTOR512_BITS)) << 4) + ffc15f60: 81 09 00 24 lwz r8,36(r9) ffc15f64: 55 07 ba 7e rlwinm r7,r8,23,9,31 static inline uint32_t fat_construct_key( const fat_fs_info_t *fs_info, fat_pos_t *pos) { return ( ((fat_cluster_num_to_sector512_num(fs_info, pos->cln) + ffc15f68: 7d 4a 3a 14 add r10,r10,r7 (pos->ofs >> FAT_SECTOR512_BITS)) << 4) + ffc15f6c: 55 4a 20 36 rlwinm r10,r10,4,0,27 ((pos->ofs >> 5) & (FAT_DIRENTRIES_PER_SEC512 - 1)) ); ffc15f70: 55 08 df 3e rlwinm r8,r8,27,28,31 static inline uint32_t fat_construct_key( const fat_fs_info_t *fs_info, fat_pos_t *pos) { return ( ((fat_cluster_num_to_sector512_num(fs_info, pos->cln) + ffc15f74: 7d 0a 42 14 add r8,r10,r8 { fat_file_fd_t *ffd = (fat_file_fd_t *)the_node; uint32_t ck = fat_construct_key(fs_info, &ffd->dir_pos.sname); if ( (key1) == ck) ffc15f78: 7f 9e 40 00 cmpw cr7,r30,r8 ffc15f7c: 41 9e 00 b4 beq- cr7,ffc16030 { *ret = (void *)the_node; return 0; } } the_node = the_node->next; ffc15f80: 81 29 00 00 lwz r9,0(r9) ) { 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) ; ) ffc15f84: 7f 86 48 00 cmpw cr7,r6,r9 ffc15f88: 40 9e ff a8 bne+ cr7,ffc15f30 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); ffc15f8c: 81 3f 00 70 lwz r9,112(r31) fat_file_fd_t *ffd = (fat_file_fd_t *)the_node; uint32_t ck = fat_construct_key(fs_info, &ffd->dir_pos.sname); if ( (key1) == ck) { if ( ((key2) == 0) || ((key2) == ffd->ino) ) ffc15f90: 2f 1e 00 00 cmpwi cr6,r30,0 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); ffc15f94: 7c c9 da 14 add r6,r9,r27 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_First( Chain_Control *the_chain ) { return _Chain_Head( the_chain )->next; ffc15f98: 7d 29 d8 2e lwzx r9,r9,r27 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 )); ffc15f9c: 38 c6 00 04 addi r6,r6,4 for ( ; !rtems_chain_is_tail((hash) + mod, the_node) ; ) ffc15fa0: 7f 89 30 00 cmpw cr7,r9,r6 ffc15fa4: 40 be 00 4c bne+ cr7,ffc15ff0 <== NEVER TAKEN ffc15fa8: 48 00 01 ac b ffc16154 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)) ) ffc15fac: 89 1f 00 0e lbz r8,14(r31) <== NOT EXECUTED ffc15fb0: 71 07 00 03 andi. r7,r8,3 <== NOT EXECUTED ffc15fb4: 41 82 00 50 beq- ffc16004 <== NOT EXECUTED return fs_info->vol.rdir_loc; ffc15fb8: 81 5f 00 20 lwz r10,32(r31) <== NOT EXECUTED ) { if (cln == 1) return 1; return (fat_cluster_num_to_sector_num(fs_info, cln) << ffc15fbc: 89 1f 00 03 lbz r8,3(r31) <== NOT EXECUTED ffc15fc0: 7d 4a 40 30 slw r10,r10,r8 <== NOT EXECUTED (pos->ofs >> FAT_SECTOR512_BITS)) << 4) + ffc15fc4: 81 09 00 24 lwz r8,36(r9) <== NOT EXECUTED ffc15fc8: 55 07 ba 7e rlwinm r7,r8,23,9,31 <== NOT EXECUTED static inline uint32_t fat_construct_key( const fat_fs_info_t *fs_info, fat_pos_t *pos) { return ( ((fat_cluster_num_to_sector512_num(fs_info, pos->cln) + ffc15fcc: 7d 4a 3a 14 add r10,r10,r7 <== NOT EXECUTED (pos->ofs >> FAT_SECTOR512_BITS)) << 4) + ffc15fd0: 55 4a 20 36 rlwinm r10,r10,4,0,27 <== NOT EXECUTED ((pos->ofs >> 5) & (FAT_DIRENTRIES_PER_SEC512 - 1)) ); ffc15fd4: 55 08 df 3e rlwinm r8,r8,27,28,31 <== NOT EXECUTED static inline uint32_t fat_construct_key( const fat_fs_info_t *fs_info, fat_pos_t *pos) { return ( ((fat_cluster_num_to_sector512_num(fs_info, pos->cln) + ffc15fd8: 7d 0a 42 14 add r8,r10,r8 <== NOT EXECUTED { fat_file_fd_t *ffd = (fat_file_fd_t *)the_node; uint32_t ck = fat_construct_key(fs_info, &ffd->dir_pos.sname); if ( (key1) == ck) ffc15fdc: 7f 9e 40 00 cmpw cr7,r30,r8 <== NOT EXECUTED ffc15fe0: 41 9e 00 ac beq- cr7,ffc1608c <== NOT EXECUTED { *ret = (void *)the_node; return 0; } } the_node = the_node->next; ffc15fe4: 81 29 00 00 lwz r9,0(r9) <== 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) ; ) ffc15fe8: 7f 89 30 00 cmpw cr7,r9,r6 <== NOT EXECUTED ffc15fec: 41 9e 01 68 beq- cr7,ffc16154 <== NOT EXECUTED ffc15ff0: 81 49 00 20 lwz r10,32(r9) <== NOT EXECUTED fat_cluster_num_to_sector512_num( const fat_fs_info_t *fs_info, uint32_t cln ) { if (cln == 1) ffc15ff4: 2f 8a 00 01 cmpwi cr7,r10,1 <== NOT EXECUTED ffc15ff8: 41 9e 01 54 beq- cr7,ffc1614c <== NOT EXECUTED 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)) ) ffc15ffc: 2f 8a 00 00 cmpwi cr7,r10,0 <== NOT EXECUTED ffc16000: 41 be ff ac beq- cr7,ffc15fac <== NOT EXECUTED return fs_info->vol.rdir_loc; return (((cln - FAT_RSRVD_CLN) << fs_info->vol.spc_log2) + ffc16004: 88 ff 00 05 lbz r7,5(r31) <== NOT EXECUTED ffc16008: 39 4a ff fe addi r10,r10,-2 <== NOT EXECUTED ffc1600c: 81 1f 00 34 lwz r8,52(r31) <== NOT EXECUTED ffc16010: 7d 4a 38 30 slw r10,r10,r7 <== NOT EXECUTED ffc16014: 7d 4a 42 14 add r10,r10,r8 <== NOT EXECUTED ffc16018: 4b ff ff a4 b ffc15fbc <== NOT EXECUTED ffc1601c: 88 ff 00 05 lbz r7,5(r31) ffc16020: 81 1f 00 34 lwz r8,52(r31) ffc16024: 7d 4a 38 30 slw r10,r10,r7 ffc16028: 7d 4a 42 14 add r10,r10,r8 ffc1602c: 4b ff ff 2c b ffc15f58 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++; ffc16030: 81 49 00 08 lwz r10,8(r9) ffc16034: 38 60 00 00 li r3,0 /* 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; ffc16038: 91 3c 00 00 stw r9,0(r28) lfat_fd->links_num++; ffc1603c: 39 4a 00 01 addi r10,r10,1 ffc16040: 91 49 00 08 stw r10,8(r9) * other fields of fat-file descriptor will be initialized on upper * level */ return RC_OK; } ffc16044: 80 01 00 2c lwz r0,44(r1) ffc16048: 83 21 00 0c lwz r25,12(r1) ffc1604c: 7c 08 03 a6 mtlr r0 ffc16050: 83 41 00 10 lwz r26,16(r1) ffc16054: 83 61 00 14 lwz r27,20(r1) ffc16058: 83 81 00 18 lwz r28,24(r1) ffc1605c: 83 a1 00 1c lwz r29,28(r1) ffc16060: 83 c1 00 20 lwz r30,32(r1) ffc16064: 83 e1 00 24 lwz r31,36(r1) ffc16068: 38 21 00 28 addi r1,r1,40 ffc1606c: 4e 80 00 20 blr const fat_fs_info_t *fs_info, uint32_t cln ) { if (cln == 1) return 1; ffc16070: 39 40 00 01 li r10,1 ffc16074: 4b ff fe ec b ffc15f60 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)) ) ffc16078: 89 43 00 0e lbz r10,14(r3) ffc1607c: 71 47 00 03 andi. r7,r10,3 ffc16080: 41 a2 fe 5c beq- ffc15edc <== NEVER TAKEN return fs_info->vol.rdir_loc; ffc16084: 83 c3 00 20 lwz r30,32(r3) ffc16088: 4b ff fe 68 b ffc15ef0 fat_file_fd_t *ffd = (fat_file_fd_t *)the_node; uint32_t ck = fat_construct_key(fs_info, &ffd->dir_pos.sname); if ( (key1) == ck) { if ( ((key2) == 0) || ((key2) == ffd->ino) ) ffc1608c: 41 9a 00 10 beq- cr6,ffc1609c <== NOT EXECUTED ffc16090: 81 49 00 0c lwz r10,12(r9) <== NOT EXECUTED ffc16094: 7f 9e 50 00 cmpw cr7,r30,r10 <== NOT EXECUTED ffc16098: 40 9e ff 4c bne+ cr7,ffc15fe4 <== NOT EXECUTED { *ret = (void *)the_node; return 0; ffc1609c: 3b 20 00 00 li r25,0 <== NOT EXECUTED } /* 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)); ffc160a0: 38 60 00 44 li r3,68 ffc160a4: 4b ff 0c f9 bl ffc06d9c if ( lfat_fd == NULL ) ffc160a8: 2f 83 00 00 cmpwi cr7,r3,0 } /* 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)); ffc160ac: 90 7c 00 00 stw r3,0(r28) ffc160b0: 7c 7a 1b 78 mr r26,r3 if ( lfat_fd == NULL ) ffc160b4: 41 9e 00 cc beq- cr7,ffc16180 <== NEVER TAKEN rtems_set_errno_and_return_minus_one( ENOMEM ); memset(lfat_fd, 0, sizeof(fat_file_fd_t)); ffc160b8: 38 a0 00 44 li r5,68 ffc160bc: 38 80 00 00 li r4,0 ffc160c0: 48 00 b3 b1 bl ffc21470 lfat_fd->flags &= ~FAT_FILE_REMOVED; lfat_fd->map.last_cln = FAT_UNDEFINED_VALUE; lfat_fd->dir_pos = *dir_pos; if ( rc != RC_OK ) ffc160c4: 2f 99 00 00 cmpwi cr7,r25,0 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; ffc160c8: 89 5a 00 30 lbz r10,48(r26) if ( lfat_fd == NULL ) rtems_set_errno_and_return_minus_one( ENOMEM ); memset(lfat_fd, 0, sizeof(fat_file_fd_t)); lfat_fd->links_num = 1; ffc160cc: 38 a0 00 01 li r5,1 lfat_fd->flags &= ~FAT_FILE_REMOVED; lfat_fd->map.last_cln = FAT_UNDEFINED_VALUE; lfat_fd->dir_pos = *dir_pos; ffc160d0: 80 dd 00 00 lwz r6,0(r29) ffc160d4: 80 fd 00 04 lwz r7,4(r29) 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; ffc160d8: 55 4a 00 3c rlwinm r10,r10,0,0,30 lfat_fd->map.last_cln = FAT_UNDEFINED_VALUE; lfat_fd->dir_pos = *dir_pos; ffc160dc: 81 1d 00 08 lwz r8,8(r29) ffc160e0: 81 3d 00 0c lwz r9,12(r29) 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; ffc160e4: 99 5a 00 30 stb r10,48(r26) lfat_fd->map.last_cln = FAT_UNDEFINED_VALUE; ffc160e8: 39 40 ff ff li r10,-1 if ( lfat_fd == NULL ) rtems_set_errno_and_return_minus_one( ENOMEM ); memset(lfat_fd, 0, sizeof(fat_file_fd_t)); lfat_fd->links_num = 1; ffc160ec: 90 ba 00 08 stw r5,8(r26) lfat_fd->flags &= ~FAT_FILE_REMOVED; lfat_fd->map.last_cln = FAT_UNDEFINED_VALUE; ffc160f0: 91 5a 00 3c stw r10,60(r26) lfat_fd->dir_pos = *dir_pos; ffc160f4: 90 da 00 20 stw r6,32(r26) ffc160f8: 90 fa 00 24 stw r7,36(r26) ffc160fc: 91 1a 00 28 stw r8,40(r26) ffc16100: 91 3a 00 2c stw r9,44(r26) if ( rc != RC_OK ) ffc16104: 41 9e 00 60 beq- cr7,ffc16164 <== NEVER TAKEN lfat_fd->ino = key; ffc16108: 93 da 00 0c stw r30,12(r26) */ 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); ffc1610c: 80 7f 00 6c lwz r3,108(r31) RTEMS_INLINE_ROUTINE void rtems_chain_append( rtems_chain_control *the_chain, rtems_chain_node *the_node ) { _Chain_Append( the_chain, the_node ); ffc16110: 7f 44 d3 78 mr r4,r26 ffc16114: 7c 63 da 14 add r3,r3,r27 ffc16118: 4b ff 67 f9 bl ffc0c910 <_Chain_Append> * other fields of fat-file descriptor will be initialized on upper * level */ return RC_OK; } ffc1611c: 80 01 00 2c lwz r0,44(r1) ffc16120: 83 21 00 0c lwz r25,12(r1) /* * other fields of fat-file descriptor will be initialized on upper * level */ return RC_OK; ffc16124: 38 60 00 00 li r3,0 } ffc16128: 7c 08 03 a6 mtlr r0 ffc1612c: 83 41 00 10 lwz r26,16(r1) ffc16130: 83 61 00 14 lwz r27,20(r1) ffc16134: 83 81 00 18 lwz r28,24(r1) ffc16138: 83 a1 00 1c lwz r29,28(r1) ffc1613c: 83 c1 00 20 lwz r30,32(r1) ffc16140: 83 e1 00 24 lwz r31,36(r1) ffc16144: 38 21 00 28 addi r1,r1,40 ffc16148: 4e 80 00 20 blr const fat_fs_info_t *fs_info, uint32_t cln ) { if (cln == 1) return 1; ffc1614c: 39 40 00 01 li r10,1 <== NOT EXECUTED ffc16150: 4b ff fe 74 b ffc15fc4 <== NOT EXECUTED return 0; } } the_node = the_node->next; } return -1; ffc16154: 3b 20 ff ff li r25,-1 ffc16158: 4b ff ff 48 b ffc160a0 ffc1615c: 3b c0 00 01 li r30,1 ffc16160: 4b ff fd 98 b ffc15ef8 if ( rc != RC_OK ) lfat_fd->ino = key; else { lfat_fd->ino = fat_get_unique_ino(fs_info); ffc16164: 7f e3 fb 78 mr r3,r31 <== NOT EXECUTED ffc16168: 48 00 21 81 bl ffc182e8 <== NOT EXECUTED if ( lfat_fd->ino == 0 ) ffc1616c: 2f 83 00 00 cmpwi cr7,r3,0 <== NOT EXECUTED if ( rc != RC_OK ) lfat_fd->ino = key; else { lfat_fd->ino = fat_get_unique_ino(fs_info); ffc16170: 90 7a 00 0c stw r3,12(r26) <== NOT EXECUTED if ( lfat_fd->ino == 0 ) ffc16174: 40 9e ff 98 bne+ cr7,ffc1610c <== NOT EXECUTED { free((*fat_fd)); ffc16178: 80 7c 00 00 lwz r3,0(r28) <== NOT EXECUTED ffc1617c: 4b ff 05 95 bl ffc06710 <== 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 ); ffc16180: 48 00 a5 1d bl ffc2069c <__errno> <== NOT EXECUTED ffc16184: 39 20 00 0c li r9,12 <== NOT EXECUTED ffc16188: 91 23 00 00 stw r9,0(r3) <== NOT EXECUTED ffc1618c: 38 60 ff ff li r3,-1 <== NOT EXECUTED ffc16190: 4b ff fe b4 b ffc16044 <== NOT EXECUTED =============================================================================== ffc161ac : fat_file_fd_t *fat_fd, uint32_t start, uint32_t count, uint8_t *buf ) { ffc161ac: 94 21 ff c8 stwu r1,-56(r1) ffc161b0: 7c 08 02 a6 mflr r0 int rc = RC_OK; ssize_t ret = 0; uint32_t cmpltd = 0; uint32_t cur_cln = 0; ffc161b4: 39 20 00 00 li r9,0 fat_file_fd_t *fat_fd, uint32_t start, uint32_t count, uint8_t *buf ) { ffc161b8: 93 c1 00 30 stw r30,48(r1) 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) ffc161bc: 7c de 33 79 mr. r30,r6 fat_file_fd_t *fat_fd, uint32_t start, uint32_t count, uint8_t *buf ) { ffc161c0: 90 01 00 3c stw r0,60(r1) ffc161c4: 93 01 00 18 stw r24,24(r1) ffc161c8: 93 21 00 1c stw r25,28(r1) ffc161cc: 93 41 00 20 stw r26,32(r1) ffc161d0: 93 61 00 24 stw r27,36(r1) ffc161d4: 93 81 00 28 stw r28,40(r1) ffc161d8: 93 a1 00 2c stw r29,44(r1) ffc161dc: 93 e1 00 34 stw r31,52(r1) int rc = RC_OK; ssize_t ret = 0; uint32_t cmpltd = 0; uint32_t cur_cln = 0; ffc161e0: 91 21 00 08 stw r9,8(r1) 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) ffc161e4: 41 82 01 6c beq- ffc16350 <== NEVER TAKEN /* * >= because start is offset and computed from 0 and file_size * computed from 1 */ if ( start >= fat_fd->fat_file_size ) ffc161e8: 81 24 00 18 lwz r9,24(r4) ffc161ec: 7c 7f 1b 78 mr r31,r3 ffc161f0: 7c 9b 23 78 mr r27,r4 ffc161f4: 7f 89 28 40 cmplw cr7,r9,r5 ffc161f8: 7c bd 2b 78 mr r29,r5 uint32_t byte = 0; uint32_t c = 0; /* it couldn't be removed - otherwise cache update will be broken */ if (count == 0) return cmpltd; ffc161fc: 38 60 00 00 li r3,0 /* * >= because start is offset and computed from 0 and file_size * computed from 1 */ if ( start >= fat_fd->fat_file_size ) ffc16200: 40 9d 01 20 ble- cr7,ffc16320 return FAT_EOF; if ((count > fat_fd->fat_file_size) || ffc16204: 7f 9e 48 40 cmplw cr7,r30,r9 ffc16208: 7c fa 3b 78 mr r26,r7 ffc1620c: 40 9d 01 78 ble- cr7,ffc16384 <== ALWAYS TAKEN (start > fat_fd->fat_file_size - count)) count = fat_fd->fat_file_size - start; ffc16210: 7f dd 48 50 subf r30,r29,r9 if ((FAT_FD_OF_ROOT_DIR(fat_fd)) && ffc16214: 81 3b 00 20 lwz r9,32(r27) ffc16218: 2f 89 00 01 cmpwi cr7,r9,1 ffc1621c: 41 9e 01 78 beq- cr7,ffc16394 return -1; return ret; } cl_start = start >> fs_info->vol.bpc_log2; ffc16220: 8b 3f 00 08 lbz r25,8(r31) save_ofs = ofs = start & (fs_info->vol.bpc - 1); rc = fat_file_lseek(fs_info, fat_fd, cl_start, &cur_cln); ffc16224: 7f e3 fb 78 mr r3,r31 ffc16228: 7f 64 db 78 mr r4,r27 return ret; } cl_start = start >> fs_info->vol.bpc_log2; save_ofs = ofs = start & (fs_info->vol.bpc - 1); ffc1622c: a3 1f 00 06 lhz r24,6(r31) return -1; return ret; } cl_start = start >> fs_info->vol.bpc_log2; ffc16230: 7f b9 cc 30 srw r25,r29,r25 save_ofs = ofs = start & (fs_info->vol.bpc - 1); rc = fat_file_lseek(fs_info, fat_fd, cl_start, &cur_cln); ffc16234: 7f 25 cb 78 mr r5,r25 ffc16238: 38 c1 00 08 addi r6,r1,8 ffc1623c: 4b ff fb 09 bl ffc15d44 if (rc != RC_OK) ffc16240: 7c 83 23 79 mr. r3,r4 ffc16244: 40 82 00 dc bne- ffc16320 <== NEVER TAKEN return rc; while (count > 0) ffc16248: 2f 9e 00 00 cmpwi cr7,r30,0 return ret; } cl_start = start >> fs_info->vol.bpc_log2; save_ofs = ofs = start & (fs_info->vol.bpc - 1); ffc1624c: 3b 18 ff ff addi r24,r24,-1 ffc16250: 7f b8 c0 38 and r24,r29,r24 rc = fat_file_lseek(fs_info, fat_fd, cl_start, &cur_cln); if (rc != RC_OK) return rc; while (count > 0) ffc16254: 41 9e 01 cc beq- cr7,ffc16420 <== NEVER TAKEN ffc16258: 89 1f 00 02 lbz r8,2(r31) ffc1625c: 7f 05 c3 78 mr r5,r24 ffc16260: a0 ff 00 00 lhz r7,0(r31) ffc16264: 3b 80 00 00 li r28,0 { c = MIN(count, (fs_info->vol.bpc - ofs)); ffc16268: a3 bf 00 06 lhz r29,6(r31) sec = fat_cluster_num_to_sector_num(fs_info, cur_cln); ffc1626c: 81 41 00 08 lwz r10,8(r1) if (rc != RC_OK) return rc; while (count > 0) { c = MIN(count, (fs_info->vol.bpc - ofs)); ffc16270: 7f a5 e8 50 subf r29,r5,r29 ffc16274: 7f 1d f0 40 cmplw cr6,r29,r30 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)) ) ffc16278: 2f 8a 00 00 cmpwi cr7,r10,0 return fs_info->vol.rdir_loc; return (((cln - FAT_RSRVD_CLN) << fs_info->vol.spc_log2) + ffc1627c: 39 4a ff fe addi r10,r10,-2 ffc16280: 40 99 00 08 ble- cr6,ffc16288 ffc16284: 7f dd f3 78 mr r29,r30 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)) ) ffc16288: 40 9e 01 6c bne- cr7,ffc163f4 <== ALWAYS TAKEN ffc1628c: 88 df 00 0e lbz r6,14(r31) <== NOT EXECUTED ffc16290: 70 c9 00 03 andi. r9,r6,3 <== NOT EXECUTED ffc16294: 41 82 01 60 beq- ffc163f4 <== NOT EXECUTED return fs_info->vol.rdir_loc; ffc16298: 80 9f 00 20 lwz r4,32(r31) <== NOT EXECUTED sec = fat_cluster_num_to_sector_num(fs_info, cur_cln); sec += (ofs >> fs_info->vol.sec_log2); ffc1629c: 7c a8 44 30 srw r8,r5,r8 byte = ofs & (fs_info->vol.bps - 1); ffc162a0: 38 e7 ff ff addi r7,r7,-1 ret = _fat_block_read(fs_info, sec, byte, c, buf + cmpltd); ffc162a4: 7c a5 38 38 and r5,r5,r7 ffc162a8: 7c 84 42 14 add r4,r4,r8 ffc162ac: 7c fa e2 14 add r7,r26,r28 ffc162b0: 7f a6 eb 78 mr r6,r29 ffc162b4: 7f e3 fb 78 mr r3,r31 ffc162b8: 48 00 0e e5 bl ffc1719c <_fat_block_read> if ( ret < 0 ) return -1; count -= c; ffc162bc: 7f dd f0 50 subf r30,r29,r30 sec = fat_cluster_num_to_sector_num(fs_info, cur_cln); 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 ) ffc162c0: 2f 83 00 00 cmpwi cr7,r3,0 return -1; count -= c; cmpltd += c; save_cln = cur_cln; rc = fat_get_fat_cluster(fs_info, cur_cln, &cur_cln); ffc162c4: 38 a1 00 08 addi r5,r1,8 ffc162c8: 7f e3 fb 78 mr r3,r31 ret = _fat_block_read(fs_info, sec, byte, c, buf + cmpltd); if ( ret < 0 ) return -1; count -= c; cmpltd += c; ffc162cc: 7f 9c ea 14 add r28,r28,r29 sec = fat_cluster_num_to_sector_num(fs_info, cur_cln); 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 ) ffc162d0: 41 9c 01 1c blt- cr7,ffc163ec <== NEVER TAKEN return -1; count -= c; cmpltd += c; save_cln = cur_cln; ffc162d4: 83 a1 00 08 lwz r29,8(r1) rc = fat_get_fat_cluster(fs_info, cur_cln, &cur_cln); ffc162d8: 7f a4 eb 78 mr r4,r29 ffc162dc: 48 00 81 f9 bl ffc1e4d4 rc = fat_file_lseek(fs_info, fat_fd, cl_start, &cur_cln); if (rc != RC_OK) return rc; while (count > 0) ffc162e0: 2f 9e 00 00 cmpwi cr7,r30,0 count -= c; cmpltd += c; save_cln = cur_cln; rc = fat_get_fat_cluster(fs_info, cur_cln, &cur_cln); if ( rc != RC_OK ) ffc162e4: 2c 03 00 00 cmpwi r3,0 return rc; ofs = 0; ffc162e8: 38 a0 00 00 li r5,0 count -= c; cmpltd += c; save_cln = cur_cln; rc = fat_get_fat_cluster(fs_info, cur_cln, &cur_cln); if ( rc != RC_OK ) ffc162ec: 40 82 00 34 bne- ffc16320 <== NEVER TAKEN rc = fat_file_lseek(fs_info, fat_fd, cl_start, &cur_cln); if (rc != RC_OK) return rc; while (count > 0) ffc162f0: 41 9e 00 10 beq- cr7,ffc16300 ffc162f4: 89 1f 00 02 lbz r8,2(r31) ffc162f8: a0 ff 00 00 lhz r7,0(r31) ffc162fc: 4b ff ff 6c b ffc16268 ffc16300: 7f 83 e3 78 mr r3,r28 } /* 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); ffc16304: 89 3f 00 08 lbz r9,8(r31) ffc16308: 3b 18 ff ff addi r24,r24,-1 ffc1630c: 7f 98 e2 14 add r28,r24,r28 fat_fd->map.disk_cln = save_cln; ffc16310: 93 bb 00 38 stw r29,56(r27) } /* 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); ffc16314: 7f 9c 4c 30 srw r28,r28,r9 ofs = 0; } /* update cache */ /* XXX: check this - I'm not sure :( */ fat_fd->map.file_cln = cl_start + ffc16318: 7f 3c ca 14 add r25,r28,r25 ffc1631c: 93 3b 00 34 stw r25,52(r27) ((save_ofs + cmpltd - 1) >> fs_info->vol.bpc_log2); fat_fd->map.disk_cln = save_cln; return cmpltd; } ffc16320: 80 01 00 3c lwz r0,60(r1) ffc16324: 83 01 00 18 lwz r24,24(r1) ffc16328: 7c 08 03 a6 mtlr r0 ffc1632c: 83 21 00 1c lwz r25,28(r1) ffc16330: 83 41 00 20 lwz r26,32(r1) ffc16334: 83 61 00 24 lwz r27,36(r1) ffc16338: 83 81 00 28 lwz r28,40(r1) ffc1633c: 83 a1 00 2c lwz r29,44(r1) ffc16340: 83 c1 00 30 lwz r30,48(r1) ffc16344: 83 e1 00 34 lwz r31,52(r1) ffc16348: 38 21 00 38 addi r1,r1,56 ffc1634c: 4e 80 00 20 blr ffc16350: 80 01 00 3c lwz r0,60(r1) <== NOT EXECUTED uint32_t byte = 0; uint32_t c = 0; /* it couldn't be removed - otherwise cache update will be broken */ if (count == 0) return cmpltd; ffc16354: 38 60 00 00 li r3,0 <== 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; } ffc16358: 83 01 00 18 lwz r24,24(r1) <== NOT EXECUTED ffc1635c: 7c 08 03 a6 mtlr r0 <== NOT EXECUTED ffc16360: 83 21 00 1c lwz r25,28(r1) <== NOT EXECUTED ffc16364: 83 41 00 20 lwz r26,32(r1) <== NOT EXECUTED ffc16368: 83 61 00 24 lwz r27,36(r1) <== NOT EXECUTED ffc1636c: 83 81 00 28 lwz r28,40(r1) <== NOT EXECUTED ffc16370: 83 a1 00 2c lwz r29,44(r1) <== NOT EXECUTED ffc16374: 83 c1 00 30 lwz r30,48(r1) <== NOT EXECUTED ffc16378: 83 e1 00 34 lwz r31,52(r1) <== NOT EXECUTED ffc1637c: 38 21 00 38 addi r1,r1,56 <== NOT EXECUTED ffc16380: 4e 80 00 20 blr <== NOT EXECUTED */ if ( start >= fat_fd->fat_file_size ) return FAT_EOF; if ((count > fat_fd->fat_file_size) || (start > fat_fd->fat_file_size - count)) ffc16384: 7d 5e 48 50 subf r10,r30,r9 * computed from 1 */ if ( start >= fat_fd->fat_file_size ) return FAT_EOF; if ((count > fat_fd->fat_file_size) || ffc16388: 7f 85 50 40 cmplw cr7,r5,r10 ffc1638c: 40 bd fe 88 ble- cr7,ffc16214 ffc16390: 4b ff fe 80 b ffc16210 (start > fat_fd->fat_file_size - count)) count = fat_fd->fat_file_size - start; if ((FAT_FD_OF_ROOT_DIR(fat_fd)) && ffc16394: 81 3b 00 24 lwz r9,36(r27) ffc16398: 2f 89 00 00 cmpwi cr7,r9,0 ffc1639c: 40 be fe 84 bne- cr7,ffc16220 <== NEVER TAKEN (fs_info->vol.type & (FAT_FAT12 | FAT_FAT16))) ffc163a0: 89 3f 00 0e lbz r9,14(r31) 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)) && ffc163a4: 71 2a 00 03 andi. r10,r9,3 ffc163a8: 41 a2 fe 78 beq- ffc16220 (fs_info->vol.type & (FAT_FAT12 | FAT_FAT16))) { sec = fat_cluster_num_to_sector_num(fs_info, fat_fd->cln); ffc163ac: 81 3b 00 1c lwz r9,28(r27) 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)) ) ffc163b0: 2f 89 00 00 cmpwi cr7,r9,0 ffc163b4: 40 9e 00 54 bne- cr7,ffc16408 <== NEVER TAKEN return fs_info->vol.rdir_loc; ffc163b8: 80 9f 00 20 lwz r4,32(r31) sec += (start >> fs_info->vol.sec_log2); ffc163bc: 89 3f 00 02 lbz r9,2(r31) byte = start & (fs_info->vol.bps - 1); ret = _fat_block_read(fs_info, sec, byte, count, buf); ffc163c0: 7f e3 fb 78 mr r3,r31 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); byte = start & (fs_info->vol.bps - 1); ffc163c4: a0 bf 00 00 lhz r5,0(r31) ret = _fat_block_read(fs_info, sec, byte, count, buf); ffc163c8: 7f c6 f3 78 mr r6,r30 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); ffc163cc: 7f a9 4c 30 srw r9,r29,r9 byte = start & (fs_info->vol.bps - 1); ffc163d0: 38 a5 ff ff addi r5,r5,-1 ret = _fat_block_read(fs_info, sec, byte, count, buf); ffc163d4: 7c 84 4a 14 add r4,r4,r9 ffc163d8: 7f a5 28 38 and r5,r29,r5 ffc163dc: 7f 47 d3 78 mr r7,r26 ffc163e0: 48 00 0d bd bl ffc1719c <_fat_block_read> if ( ret < 0 ) ffc163e4: 2c 03 00 00 cmpwi r3,0 ffc163e8: 40 80 ff 38 bge+ ffc16320 <== ALWAYS TAKEN 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; ffc163ec: 38 60 ff ff li r3,-1 <== NOT EXECUTED ffc163f0: 4b ff ff 30 b ffc16320 <== NOT EXECUTED return (((cln - FAT_RSRVD_CLN) << fs_info->vol.spc_log2) + ffc163f4: 88 9f 00 05 lbz r4,5(r31) ffc163f8: 80 df 00 34 lwz r6,52(r31) ffc163fc: 7d 4a 20 30 slw r10,r10,r4 ffc16400: 7c 8a 32 14 add r4,r10,r6 ffc16404: 4b ff fe 98 b ffc1629c ffc16408: 89 1f 00 05 lbz r8,5(r31) <== NOT EXECUTED ffc1640c: 38 89 ff fe addi r4,r9,-2 <== NOT EXECUTED ffc16410: 81 5f 00 34 lwz r10,52(r31) <== NOT EXECUTED ffc16414: 7c 84 40 30 slw r4,r4,r8 <== NOT EXECUTED ffc16418: 7c 84 52 14 add r4,r4,r10 <== NOT EXECUTED ffc1641c: 4b ff ff a0 b ffc163bc <== NOT EXECUTED rc = fat_file_lseek(fs_info, fat_fd, cl_start, &cur_cln); if (rc != RC_OK) return rc; while (count > 0) ffc16420: 3b a0 00 00 li r29,0 <== NOT EXECUTED ffc16424: 3b 80 00 00 li r28,0 <== NOT EXECUTED ffc16428: 4b ff fe dc b ffc16304 <== NOT EXECUTED =============================================================================== ffc16dbc : int fat_file_size( fat_fs_info_t *fs_info, fat_file_fd_t *fat_fd ) { ffc16dbc: 94 21 ff d8 stwu r1,-40(r1) ffc16dc0: 7c 08 02 a6 mflr r0 ffc16dc4: 90 01 00 2c stw r0,44(r1) 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)) && ffc16dc8: 81 24 00 20 lwz r9,32(r4) int fat_file_size( fat_fs_info_t *fs_info, fat_file_fd_t *fat_fd ) { ffc16dcc: 93 a1 00 1c stw r29,28(r1) 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)) && ffc16dd0: 2f 89 00 01 cmpwi cr7,r9,1 fat_fs_info_t *fs_info, fat_file_fd_t *fat_fd ) { int rc = RC_OK; uint32_t cur_cln = fat_fd->cln; ffc16dd4: 83 a4 00 1c lwz r29,28(r4) int fat_file_size( fat_fs_info_t *fs_info, fat_file_fd_t *fat_fd ) { ffc16dd8: 93 c1 00 20 stw r30,32(r1) ffc16ddc: 7c 9e 23 78 mr r30,r4 ffc16de0: 93 e1 00 24 stw r31,36(r1) ffc16de4: 7c 7f 1b 78 mr r31,r3 int rc = RC_OK; uint32_t cur_cln = fat_fd->cln; ffc16de8: 93 a1 00 08 stw r29,8(r1) uint32_t save_cln = 0; /* Have we requested root dir size for FAT12/16? */ if ((FAT_FD_OF_ROOT_DIR(fat_fd)) && ffc16dec: 41 9e 00 ac beq- cr7,ffc16e98 return rc; } fat_fd->fat_file_size = 0; while ((cur_cln & fs_info->vol.mask) < fs_info->vol.eoc_val) ffc16df0: 81 5f 00 10 lwz r10,16(r31) { fat_fd->fat_file_size = fs_info->vol.rdir_size; return rc; } fat_fd->fat_file_size = 0; ffc16df4: 39 00 00 00 li r8,0 while ((cur_cln & fs_info->vol.mask) < fs_info->vol.eoc_val) ffc16df8: 81 3f 00 14 lwz r9,20(r31) ffc16dfc: 7f aa 50 38 and r10,r29,r10 { fat_fd->fat_file_size = fs_info->vol.rdir_size; return rc; } fat_fd->fat_file_size = 0; ffc16e00: 91 1e 00 18 stw r8,24(r30) while ((cur_cln & fs_info->vol.mask) < fs_info->vol.eoc_val) ffc16e04: 7f 8a 48 40 cmplw cr7,r10,r9 ffc16e08: 41 bc 00 34 blt+ cr7,ffc16e3c <== ALWAYS TAKEN ffc16e0c: 48 00 00 64 b ffc16e70 <== NOT EXECUTED ffc16e10: 81 1f 00 10 lwz r8,16(r31) ffc16e14: 81 21 00 08 lwz r9,8(r1) ffc16e18: 81 5f 00 14 lwz r10,20(r31) ffc16e1c: 7d 28 40 38 and r8,r9,r8 save_cln = cur_cln; rc = fat_get_fat_cluster(fs_info, cur_cln, &cur_cln); if ( rc != RC_OK ) return rc; fat_fd->fat_file_size += fs_info->vol.bpc; ffc16e20: a0 ff 00 06 lhz r7,6(r31) return rc; } fat_fd->fat_file_size = 0; while ((cur_cln & fs_info->vol.mask) < fs_info->vol.eoc_val) ffc16e24: 7f 88 50 40 cmplw cr7,r8,r10 save_cln = cur_cln; rc = fat_get_fat_cluster(fs_info, cur_cln, &cur_cln); if ( rc != RC_OK ) return rc; fat_fd->fat_file_size += fs_info->vol.bpc; ffc16e28: 81 5e 00 18 lwz r10,24(r30) ffc16e2c: 7c ea 3a 14 add r7,r10,r7 ffc16e30: 90 fe 00 18 stw r7,24(r30) return rc; } fat_fd->fat_file_size = 0; while ((cur_cln & fs_info->vol.mask) < fs_info->vol.eoc_val) ffc16e34: 40 9c 00 40 bge- cr7,ffc16e74 <== ALWAYS TAKEN ffc16e38: 7d 3d 4b 78 mr r29,r9 <== NOT EXECUTED { save_cln = cur_cln; rc = fat_get_fat_cluster(fs_info, cur_cln, &cur_cln); ffc16e3c: 7f a4 eb 78 mr r4,r29 ffc16e40: 7f e3 fb 78 mr r3,r31 ffc16e44: 38 a1 00 08 addi r5,r1,8 ffc16e48: 48 00 76 8d bl ffc1e4d4 if ( rc != RC_OK ) ffc16e4c: 2c 03 00 00 cmpwi r3,0 ffc16e50: 41 82 ff c0 beq+ ffc16e10 <== ALWAYS TAKEN fat_fd->fat_file_size += fs_info->vol.bpc; } fat_fd->map.last_cln = save_cln; return rc; } ffc16e54: 80 01 00 2c lwz r0,44(r1) <== NOT EXECUTED ffc16e58: 83 a1 00 1c lwz r29,28(r1) <== NOT EXECUTED ffc16e5c: 7c 08 03 a6 mtlr r0 <== NOT EXECUTED ffc16e60: 83 c1 00 20 lwz r30,32(r1) <== NOT EXECUTED ffc16e64: 83 e1 00 24 lwz r31,36(r1) <== NOT EXECUTED ffc16e68: 38 21 00 28 addi r1,r1,40 <== NOT EXECUTED ffc16e6c: 4e 80 00 20 blr <== NOT EXECUTED fat_file_fd_t *fat_fd ) { int rc = RC_OK; uint32_t cur_cln = fat_fd->cln; uint32_t save_cln = 0; ffc16e70: 3b a0 00 00 li r29,0 <== NOT EXECUTED fat_fd->fat_file_size += fs_info->vol.bpc; } fat_fd->map.last_cln = save_cln; return rc; } ffc16e74: 80 01 00 2c lwz r0,44(r1) if ( rc != RC_OK ) return rc; fat_fd->fat_file_size += fs_info->vol.bpc; } fat_fd->map.last_cln = save_cln; ffc16e78: 38 60 00 00 li r3,0 ffc16e7c: 93 be 00 3c stw r29,60(r30) return rc; } ffc16e80: 7c 08 03 a6 mtlr r0 ffc16e84: 83 a1 00 1c lwz r29,28(r1) ffc16e88: 83 c1 00 20 lwz r30,32(r1) ffc16e8c: 83 e1 00 24 lwz r31,36(r1) ffc16e90: 38 21 00 28 addi r1,r1,40 ffc16e94: 4e 80 00 20 blr 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)) && ffc16e98: 81 24 00 24 lwz r9,36(r4) ffc16e9c: 2f 89 00 00 cmpwi cr7,r9,0 ffc16ea0: 40 be ff 50 bne- cr7,ffc16df0 <== NEVER TAKEN (fs_info->vol.type & (FAT_FAT12 | FAT_FAT16))) ffc16ea4: 89 23 00 0e lbz r9,14(r3) 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)) && ffc16ea8: 71 2a 00 03 andi. r10,r9,3 ffc16eac: 41 82 ff 44 beq+ ffc16df0 <== ALWAYS TAKEN (fs_info->vol.type & (FAT_FAT12 | FAT_FAT16))) { fat_fd->fat_file_size = fs_info->vol.rdir_size; ffc16eb0: 81 23 00 2c lwz r9,44(r3) <== NOT EXECUTED return rc; ffc16eb4: 38 60 00 00 li r3,0 <== NOT EXECUTED /* Have we requested root dir size for FAT12/16? */ if ((FAT_FD_OF_ROOT_DIR(fat_fd)) && (fs_info->vol.type & (FAT_FAT12 | FAT_FAT16))) { fat_fd->fat_file_size = fs_info->vol.rdir_size; ffc16eb8: 91 24 00 18 stw r9,24(r4) <== NOT EXECUTED ffc16ebc: 4b ff ff 98 b ffc16e54 <== NOT EXECUTED =============================================================================== ffc1642c : fat_file_truncate( fat_fs_info_t *fs_info, fat_file_fd_t *fat_fd, uint32_t new_length ) { ffc1642c: 94 21 ff d8 stwu r1,-40(r1) ffc16430: 7c 08 02 a6 mflr r0 ffc16434: 7d 80 00 26 mfcr r12 int rc = RC_OK; uint32_t cur_cln = 0; ffc16438: 39 40 00 00 li r10,0 fat_file_truncate( fat_fs_info_t *fs_info, fat_file_fd_t *fat_fd, uint32_t new_length ) { ffc1643c: 90 01 00 2c stw r0,44(r1) uint32_t cur_cln = 0; uint32_t cl_start = 0; uint32_t new_last_cln = FAT_UNDEFINED_VALUE; if ( new_length >= fat_fd->fat_file_size ) ffc16440: 81 24 00 18 lwz r9,24(r4) fat_file_fd_t *fat_fd, uint32_t new_length ) { int rc = RC_OK; uint32_t cur_cln = 0; ffc16444: 91 41 00 0c stw r10,12(r1) uint32_t cl_start = 0; uint32_t new_last_cln = FAT_UNDEFINED_VALUE; ffc16448: 39 40 ff ff li r10,-1 if ( new_length >= fat_fd->fat_file_size ) ffc1644c: 7f 89 28 40 cmplw cr7,r9,r5 fat_file_truncate( fat_fs_info_t *fs_info, fat_file_fd_t *fat_fd, uint32_t new_length ) { ffc16450: 93 c1 00 20 stw r30,32(r1) ffc16454: 7c 9e 23 78 mr r30,r4 ffc16458: 93 a1 00 1c stw r29,28(r1) ffc1645c: 93 e1 00 24 stw r31,36(r1) ffc16460: 91 81 00 18 stw r12,24(r1) int rc = RC_OK; uint32_t cur_cln = 0; uint32_t cl_start = 0; uint32_t new_last_cln = FAT_UNDEFINED_VALUE; ffc16464: 91 41 00 08 stw r10,8(r1) if ( new_length >= fat_fd->fat_file_size ) ffc16468: 40 9d 00 80 ble- cr7,ffc164e8 return rc; assert(fat_fd->fat_file_size); ffc1646c: 2f 89 00 00 cmpwi cr7,r9,0 ffc16470: 41 9e 00 d0 beq- cr7,ffc16540 <== NEVER TAKEN cl_start = (new_length + fs_info->vol.bpc - 1) >> fs_info->vol.bpc_log2; ffc16474: a3 a3 00 06 lhz r29,6(r3) ffc16478: 7c 7f 1b 78 mr r31,r3 ffc1647c: 89 43 00 08 lbz r10,8(r3) ffc16480: 3b bd ff ff addi r29,r29,-1 ffc16484: 7c bd 2a 14 add r5,r29,r5 ffc16488: 7c bd 54 30 srw r29,r5,r10 if ((cl_start << fs_info->vol.bpc_log2) >= fat_fd->fat_file_size) ffc1648c: 7f aa 50 30 slw r10,r29,r10 ffc16490: 7f 89 50 40 cmplw cr7,r9,r10 ffc16494: 40 9d 00 54 ble- cr7,ffc164e8 return RC_OK; if (cl_start != 0) ffc16498: 2e 1d 00 00 cmpwi cr4,r29,0 ffc1649c: 41 92 00 18 beq- cr4,ffc164b4 { rc = fat_file_lseek(fs_info, fat_fd, cl_start - 1, &new_last_cln); ffc164a0: 38 bd ff ff addi r5,r29,-1 ffc164a4: 38 c1 00 08 addi r6,r1,8 ffc164a8: 4b ff f8 9d bl ffc15d44 if (rc != RC_OK) ffc164ac: 7c 83 23 79 mr. r3,r4 ffc164b0: 40 82 00 3c bne- ffc164ec <== NEVER TAKEN return rc; } rc = fat_file_lseek(fs_info, fat_fd, cl_start, &cur_cln); ffc164b4: 7f e3 fb 78 mr r3,r31 ffc164b8: 7f c4 f3 78 mr r4,r30 ffc164bc: 7f a5 eb 78 mr r5,r29 ffc164c0: 38 c1 00 0c addi r6,r1,12 ffc164c4: 4b ff f8 81 bl ffc15d44 if (rc != RC_OK) ffc164c8: 7c 83 23 79 mr. r3,r4 ffc164cc: 40 a2 00 20 bne+ ffc164ec <== NEVER TAKEN return rc; rc = fat_free_fat_clusters_chain(fs_info, cur_cln); ffc164d0: 80 81 00 0c lwz r4,12(r1) ffc164d4: 7f e3 fb 78 mr r3,r31 ffc164d8: 48 00 85 81 bl ffc1ea58 if (rc != RC_OK) ffc164dc: 2c 03 00 00 cmpwi r3,0 ffc164e0: 40 82 00 0c bne- ffc164ec <== NEVER TAKEN return rc; if (cl_start != 0) ffc164e4: 40 92 00 2c bne- cr4,ffc16510 uint32_t cl_start = 0; uint32_t new_last_cln = FAT_UNDEFINED_VALUE; if ( new_length >= fat_fd->fat_file_size ) return rc; ffc164e8: 38 60 00 00 li r3,0 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; } ffc164ec: 80 01 00 2c lwz r0,44(r1) ffc164f0: 81 81 00 18 lwz r12,24(r1) ffc164f4: 7c 08 03 a6 mtlr r0 ffc164f8: 83 a1 00 1c lwz r29,28(r1) ffc164fc: 83 c1 00 20 lwz r30,32(r1) ffc16500: 7d 80 81 20 mtcrf 8,r12 ffc16504: 83 e1 00 24 lwz r31,36(r1) ffc16508: 38 21 00 28 addi r1,r1,40 ffc1650c: 4e 80 00 20 blr if (rc != RC_OK) return rc; if (cl_start != 0) { rc = fat_set_fat_cluster(fs_info, new_last_cln, FAT_GENFAT_EOC); ffc16510: 80 81 00 08 lwz r4,8(r1) ffc16514: 7f e3 fb 78 mr r3,r31 ffc16518: 38 a0 ff ff li r5,-1 ffc1651c: 48 00 82 09 bl ffc1e724 if ( rc != RC_OK ) ffc16520: 2c 03 00 00 cmpwi r3,0 ffc16524: 40 a2 ff c8 bne- ffc164ec <== NEVER TAKEN return rc; fat_fd->map.file_cln = cl_start - 1; fat_fd->map.disk_cln = new_last_cln; ffc16528: 81 21 00 08 lwz r9,8(r1) 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; ffc1652c: 3b bd ff ff addi r29,r29,-1 ffc16530: 93 be 00 34 stw r29,52(r30) fat_fd->map.disk_cln = new_last_cln; ffc16534: 91 3e 00 38 stw r9,56(r30) fat_fd->map.last_cln = new_last_cln; ffc16538: 91 3e 00 3c stw r9,60(r30) ffc1653c: 4b ff ff b0 b ffc164ec if ( new_length >= fat_fd->fat_file_size ) return rc; assert(fat_fd->fat_file_size); ffc16540: 3c 60 ff c3 lis r3,-61 <== NOT EXECUTED ffc16544: 3c a0 ff c3 lis r5,-61 <== NOT EXECUTED ffc16548: 3c c0 ff c3 lis r6,-61 <== NOT EXECUTED ffc1654c: 38 63 0c d8 addi r3,r3,3288 <== NOT EXECUTED ffc16550: 38 80 02 d1 li r4,721 <== NOT EXECUTED ffc16554: 38 a5 0c c4 addi r5,r5,3268 <== NOT EXECUTED ffc16558: 38 c6 0d 20 addi r6,r6,3360 <== NOT EXECUTED ffc1655c: 4b fe ff d1 bl ffc0652c <__assert_func> <== NOT EXECUTED =============================================================================== ffc169f4 : bool zero_fill = start > fat_fd->fat_file_size; uint32_t file_cln_initial = fat_fd->map.file_cln; uint32_t cln; if ( count == 0 ) ffc169f4: 2c 06 00 00 cmpwi r6,0 fat_file_fd_t *fat_fd, uint32_t start, uint32_t count, const uint8_t *buf ) { ffc169f8: 94 21 ff b8 stwu r1,-72(r1) ffc169fc: 7c 08 02 a6 mflr r0 int rc = RC_OK; ssize_t ret; uint32_t cmpltd = 0; uint32_t byte; uint32_t c = 0; ffc16a00: 39 20 00 00 li r9,0 fat_file_fd_t *fat_fd, uint32_t start, uint32_t count, const uint8_t *buf ) { ffc16a04: 93 01 00 28 stw r24,40(r1) ffc16a08: 90 01 00 4c stw r0,76(r1) ffc16a0c: 93 81 00 38 stw r28,56(r1) ffc16a10: 7c bc 2b 78 mr r28,r5 ffc16a14: 93 c1 00 40 stw r30,64(r1) ffc16a18: 7c 9e 23 78 mr r30,r4 ffc16a1c: 92 81 00 18 stw r20,24(r1) ffc16a20: 92 a1 00 1c stw r21,28(r1) ffc16a24: 92 c1 00 20 stw r22,32(r1) ffc16a28: 92 e1 00 24 stw r23,36(r1) ffc16a2c: 93 21 00 2c stw r25,44(r1) ffc16a30: 93 41 00 30 stw r26,48(r1) ffc16a34: 93 61 00 34 stw r27,52(r1) ffc16a38: 93 a1 00 3c stw r29,60(r1) ffc16a3c: 93 e1 00 44 stw r31,68(r1) int rc = RC_OK; ssize_t ret; uint32_t cmpltd = 0; uint32_t byte; uint32_t c = 0; ffc16a40: 91 21 00 0c stw r9,12(r1) bool zero_fill = start > fat_fd->fat_file_size; ffc16a44: 80 a4 00 18 lwz r5,24(r4) uint32_t file_cln_initial = fat_fd->map.file_cln; ffc16a48: 83 04 00 34 lwz r24,52(r4) uint32_t cln; if ( count == 0 ) ffc16a4c: 41 82 01 bc beq- ffc16c08 <== NEVER TAKEN return cmpltd; if (start >= fat_fd->size_limit) ffc16a50: 83 e4 00 14 lwz r31,20(r4) ffc16a54: 7f 9c f8 40 cmplw cr7,r28,r31 ffc16a58: 40 9c 02 78 bge- cr7,ffc16cd0 <== NEVER TAKEN rtems_set_errno_and_return_minus_one(EFBIG); if (count > fat_fd->size_limit - start) ffc16a5c: 7f fc f8 50 subf r31,r28,r31 ffc16a60: 7f 9f 30 40 cmplw cr7,r31,r6 ffc16a64: 7c 7d 1b 78 mr r29,r3 ffc16a68: 7c f9 3b 78 mr r25,r7 ffc16a6c: 41 9d 01 68 bgt- cr7,ffc16bd4 <== ALWAYS TAKEN count = fat_fd->size_limit - start; rc = fat_file_extend(fs_info, fat_fd, zero_fill, start + count, &c); ffc16a70: 7c bc 28 10 subfc r5,r28,r5 <== NOT EXECUTED ffc16a74: 7c a5 29 10 subfe r5,r5,r5 <== NOT EXECUTED ffc16a78: 7f 7f e2 14 add r27,r31,r28 <== NOT EXECUTED ffc16a7c: 7f a3 eb 78 mr r3,r29 <== NOT EXECUTED ffc16a80: 7f c4 f3 78 mr r4,r30 <== NOT EXECUTED ffc16a84: 7c a5 00 d0 neg r5,r5 <== NOT EXECUTED ffc16a88: 7f 66 db 78 mr r6,r27 <== NOT EXECUTED ffc16a8c: 38 e1 00 0c addi r7,r1,12 <== NOT EXECUTED ffc16a90: 4b ff fc d5 bl ffc16764 <== NOT EXECUTED if (RC_OK == rc) ffc16a94: 2c 03 00 00 cmpwi r3,0 <== NOT EXECUTED ffc16a98: 40 82 00 fc bne- ffc16b94 <== NOT EXECUTED { /* * check whether there was enough room on device to locate * file of 'start + count' bytes */ if (c != (start + count)) ffc16a9c: 81 21 00 0c lwz r9,12(r1) ffc16aa0: 7f 9b 48 00 cmpw cr7,r27,r9 ffc16aa4: 41 9e 00 08 beq- cr7,ffc16aac <== ALWAYS TAKEN count = c - start; ffc16aa8: 7f fc 48 50 subf r31,r28,r9 <== 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)); ffc16aac: 81 3e 00 20 lwz r9,32(r30) */ 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)) ffc16ab0: 89 5d 00 0e lbz r10,14(r29) */ 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)); ffc16ab4: 2f 89 00 01 cmpwi cr7,r9,1 ffc16ab8: 41 9e 01 c4 beq- cr7,ffc16c7c const uint8_t *buf, const uint32_t file_cln_initial) { int rc = RC_OK; uint32_t cmpltd = 0; uint32_t cur_cln = 0; ffc16abc: 7c 36 0b 78 mr r22,r1 uint32_t save_cln = 0; /* FIXME: This might be incorrect, cf. below */ uint32_t start_cln = start >> fs_info->vol.bpc_log2; ffc16ac0: 8b 7d 00 08 lbz r27,8(r29) const uint8_t *buf, const uint32_t file_cln_initial) { int rc = RC_OK; uint32_t cmpltd = 0; uint32_t cur_cln = 0; ffc16ac4: 39 20 00 00 li r9,0 ffc16ac8: 95 36 00 08 stwu r9,8(r22) uint32_t save_cln = 0; /* FIXME: This might be incorrect, cf. below */ uint32_t start_cln = start >> fs_info->vol.bpc_log2; ffc16acc: 7f 94 dc 30 srw r20,r28,r27 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); ffc16ad0: 7f a3 eb 78 mr r3,r29 ffc16ad4: 7f c4 f3 78 mr r4,r30 ffc16ad8: 7e 85 a3 78 mr r5,r20 ffc16adc: 7e c6 b3 78 mr r6,r22 ffc16ae0: 4b ff f2 65 bl ffc15d44 if (RC_OK == rc) ffc16ae4: 7c 83 23 79 mr. r3,r4 ffc16ae8: 40 82 00 a8 bne- ffc16b90 <== NEVER TAKEN { file_cln_cnt = cur_cln - fat_fd->cln; while ( (RC_OK == rc) && (bytes_to_write > 0)) ffc16aec: 2f 9f 00 00 cmpwi cr7,r31,0 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; ffc16af0: 80 81 00 08 lwz r4,8(r1) ffc16af4: 83 5e 00 1c lwz r26,28(r30) 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); ffc16af8: 7e 9b d8 30 slw r27,r20,r27 ffc16afc: 7f 9b e0 50 subf r28,r27,r28 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; ffc16b00: 7f 5a 20 50 subf r26,r26,r4 while ( (RC_OK == rc) && (bytes_to_write > 0)) ffc16b04: 41 9e 01 e0 beq- cr7,ffc16ce4 <== NEVER TAKEN ffc16b08: 7f 89 e3 78 mr r9,r28 ffc16b0c: 3b 60 00 00 li r27,0 ffc16b10: 3a a0 00 00 li r21,0 ffc16b14: 3a e0 00 00 li r23,0 { c = MIN(bytes_to_write, (fs_info->vol.bpc - ofs_cln)); ffc16b18: a1 5d 00 06 lhz r10,6(r29) if (file_cln_initial < file_cln_cnt) ffc16b1c: 7f 98 d0 40 cmplw cr7,r24,r26 overwrite_cluster = true; ret = fat_cluster_write(fs_info, ffc16b20: 7c f9 da 14 add r7,r25,r27 { 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)); ffc16b24: 7c c9 50 50 subf r6,r9,r10 ffc16b28: 7f 06 f8 40 cmplw cr6,r6,r31 if (file_cln_initial < file_cln_cnt) overwrite_cluster = true; ret = fat_cluster_write(fs_info, ffc16b2c: 7f a3 eb 78 mr r3,r29 ffc16b30: 7d 25 4b 78 mr r5,r9 if (0 > ret) rc = -1; if (RC_OK == rc) { ++file_cln_cnt; ffc16b34: 3b 5a 00 01 addi r26,r26,1 { 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)); ffc16b38: 40 99 00 08 ble- cr6,ffc16b40 ffc16b3c: 7f e6 fb 78 mr r6,r31 if (file_cln_initial < file_cln_cnt) ffc16b40: 40 9c 00 08 bge- cr7,ffc16b48 overwrite_cluster = true; ffc16b44: 3a e0 00 01 li r23,1 ret = fat_cluster_write(fs_info, ffc16b48: 7e e8 bb 78 mr r8,r23 ffc16b4c: 48 00 0a 45 bl ffc17590 cur_cln, ofs_cln, c, &buf[cmpltd], overwrite_cluster); if (0 > ret) ffc16b50: 2c 03 00 00 cmpwi r3,0 { ++file_cln_cnt; bytes_to_write -= ret; cmpltd += ret; save_cln = cur_cln; if (0 < bytes_to_write) ffc16b54: 7f e3 f8 50 subf r31,r3,r31 ffc16b58: 2f 9f 00 00 cmpwi cr7,r31,0 cur_cln, ofs_cln, c, &buf[cmpltd], overwrite_cluster); if (0 > ret) ffc16b5c: 41 80 00 f0 blt- ffc16c4c <== NEVER TAKEN if (RC_OK == rc) { ++file_cln_cnt; bytes_to_write -= ret; cmpltd += ret; ffc16b60: 7f 7b 1a 14 add r27,r27,r3 save_cln = cur_cln; ffc16b64: 82 a1 00 08 lwz r21,8(r1) if (0 < bytes_to_write) ffc16b68: 40 9e 00 f0 bne- cr7,ffc16c58 ffc16b6c: 2c 1b 00 00 cmpwi r27,0 ffc16b70: 7f 63 db 78 mr r3,r27 } /* 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); ffc16b74: 89 3d 00 08 lbz r9,8(r29) ffc16b78: 3b 9c ff ff addi r28,r28,-1 ffc16b7c: 7f 7c da 14 add r27,r28,r27 fat_fd->map.disk_cln = save_cln; ffc16b80: 92 be 00 38 stw r21,56(r30) } /* 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); ffc16b84: 7f 7b 4c 30 srw r27,r27,r9 } } /* update cache */ /* XXX: check this - I'm not sure :( */ fat_fd->map.file_cln = start_cln + ffc16b88: 7e 9b a2 14 add r20,r27,r20 ffc16b8c: 92 9e 00 34 stw r20,52(r30) fat_fd, start, count, buf, file_cln_initial); if (0 > ret) ffc16b90: 41 80 01 38 blt- ffc16cc8 <== NEVER TAKEN } if (RC_OK != rc) return rc; else return cmpltd; } ffc16b94: 80 01 00 4c lwz r0,76(r1) ffc16b98: 82 81 00 18 lwz r20,24(r1) ffc16b9c: 7c 08 03 a6 mtlr r0 ffc16ba0: 82 a1 00 1c lwz r21,28(r1) ffc16ba4: 82 c1 00 20 lwz r22,32(r1) ffc16ba8: 82 e1 00 24 lwz r23,36(r1) ffc16bac: 83 01 00 28 lwz r24,40(r1) ffc16bb0: 83 21 00 2c lwz r25,44(r1) ffc16bb4: 83 41 00 30 lwz r26,48(r1) ffc16bb8: 83 61 00 34 lwz r27,52(r1) ffc16bbc: 83 81 00 38 lwz r28,56(r1) ffc16bc0: 83 a1 00 3c lwz r29,60(r1) ffc16bc4: 83 c1 00 40 lwz r30,64(r1) ffc16bc8: 83 e1 00 44 lwz r31,68(r1) ffc16bcc: 38 21 00 48 addi r1,r1,72 ffc16bd0: 4e 80 00 20 blr ffc16bd4: 7c df 33 78 mr r31,r6 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); ffc16bd8: 7c bc 28 10 subfc r5,r28,r5 ffc16bdc: 7c a5 29 10 subfe r5,r5,r5 ffc16be0: 7f 7f e2 14 add r27,r31,r28 ffc16be4: 7f a3 eb 78 mr r3,r29 ffc16be8: 7f c4 f3 78 mr r4,r30 ffc16bec: 7c a5 00 d0 neg r5,r5 ffc16bf0: 7f 66 db 78 mr r6,r27 ffc16bf4: 38 e1 00 0c addi r7,r1,12 ffc16bf8: 4b ff fb 6d bl ffc16764 if (RC_OK == rc) ffc16bfc: 2c 03 00 00 cmpwi r3,0 ffc16c00: 40 a2 ff 94 bne- ffc16b94 ffc16c04: 4b ff fe 98 b ffc16a9c } if (RC_OK != rc) return rc; else return cmpltd; } ffc16c08: 80 01 00 4c lwz r0,76(r1) <== NOT EXECUTED uint32_t file_cln_initial = fat_fd->map.file_cln; uint32_t cln; if ( count == 0 ) return cmpltd; ffc16c0c: 38 60 00 00 li r3,0 <== NOT EXECUTED } if (RC_OK != rc) return rc; else return cmpltd; } ffc16c10: 82 81 00 18 lwz r20,24(r1) <== NOT EXECUTED ffc16c14: 7c 08 03 a6 mtlr r0 <== NOT EXECUTED ffc16c18: 82 a1 00 1c lwz r21,28(r1) <== NOT EXECUTED ffc16c1c: 82 c1 00 20 lwz r22,32(r1) <== NOT EXECUTED ffc16c20: 82 e1 00 24 lwz r23,36(r1) <== NOT EXECUTED ffc16c24: 83 01 00 28 lwz r24,40(r1) <== NOT EXECUTED ffc16c28: 83 21 00 2c lwz r25,44(r1) <== NOT EXECUTED ffc16c2c: 83 41 00 30 lwz r26,48(r1) <== NOT EXECUTED ffc16c30: 83 61 00 34 lwz r27,52(r1) <== NOT EXECUTED ffc16c34: 83 81 00 38 lwz r28,56(r1) <== NOT EXECUTED ffc16c38: 83 a1 00 3c lwz r29,60(r1) <== NOT EXECUTED ffc16c3c: 83 c1 00 40 lwz r30,64(r1) <== NOT EXECUTED ffc16c40: 83 e1 00 44 lwz r31,68(r1) <== NOT EXECUTED ffc16c44: 38 21 00 48 addi r1,r1,72 <== NOT EXECUTED ffc16c48: 4e 80 00 20 blr <== NOT EXECUTED cur_cln, ofs_cln, c, &buf[cmpltd], overwrite_cluster); if (0 > ret) ffc16c4c: 38 60 ff ff li r3,-1 <== NOT EXECUTED ffc16c50: 2c 03 00 00 cmpwi r3,0 <== NOT EXECUTED ffc16c54: 4b ff ff 20 b ffc16b74 <== 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); ffc16c58: 7f a3 eb 78 mr r3,r29 ffc16c5c: 7e a4 ab 78 mr r4,r21 ffc16c60: 7e c5 b3 78 mr r5,r22 ffc16c64: 48 00 78 71 bl ffc1e4d4 ffc16c68: 39 20 00 00 li r9,0 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) ffc16c6c: 2c 03 00 00 cmpwi r3,0 ffc16c70: 40 a2 ff 04 bne- ffc16b74 <== NEVER TAKEN ffc16c74: 80 81 00 08 lwz r4,8(r1) ffc16c78: 4b ff fe a0 b ffc16b18 */ 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)); ffc16c7c: 81 3e 00 24 lwz r9,36(r30) ffc16c80: 2f 89 00 00 cmpwi cr7,r9,0 ffc16c84: 40 be fe 38 bne- cr7,ffc16abc <== NEVER TAKEN ffc16c88: 71 49 00 03 andi. r9,r10,3 ffc16c8c: 41 a2 fe 30 beq- ffc16abc /* 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); ffc16c90: 88 9d 00 08 lbz r4,8(r29) byte = start & (fs_info->vol.bpc -1); ret = fat_cluster_write(fs_info, ffc16c94: 7f a3 eb 78 mr r3,r29 /* 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); byte = start & (fs_info->vol.bpc -1); ffc16c98: a0 bd 00 06 lhz r5,6(r29) ret = fat_cluster_write(fs_info, ffc16c9c: 7f e6 fb 78 mr r6,r31 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)) { cln = fat_fd->cln; ffc16ca0: 81 3e 00 1c lwz r9,28(r30) cln += (start >> fs_info->vol.bpc_log2); ffc16ca4: 7f 84 24 30 srw r4,r28,r4 byte = start & (fs_info->vol.bpc -1); ffc16ca8: 38 a5 ff ff addi r5,r5,-1 ret = fat_cluster_write(fs_info, ffc16cac: 7c 84 4a 14 add r4,r4,r9 ffc16cb0: 7f 85 28 38 and r5,r28,r5 ffc16cb4: 7f 27 cb 78 mr r7,r25 ffc16cb8: 39 00 00 00 li r8,0 ffc16cbc: 48 00 08 d5 bl ffc17590 cln, byte, count, buf, false); if (0 > ret) ffc16cc0: 2c 03 00 00 cmpwi r3,0 ffc16cc4: 40 80 fe d0 bge+ ffc16b94 <== ALWAYS TAKEN start, count, buf, file_cln_initial); if (0 > ret) rc = -1; ffc16cc8: 38 60 ff ff li r3,-1 <== NOT EXECUTED ffc16ccc: 4b ff fe c8 b ffc16b94 <== NOT EXECUTED if ( count == 0 ) return cmpltd; if (start >= fat_fd->size_limit) rtems_set_errno_and_return_minus_one(EFBIG); ffc16cd0: 48 00 99 cd bl ffc2069c <__errno> <== NOT EXECUTED ffc16cd4: 39 20 00 1b li r9,27 <== NOT EXECUTED ffc16cd8: 91 23 00 00 stw r9,0(r3) <== NOT EXECUTED ffc16cdc: 38 60 ff ff li r3,-1 <== NOT EXECUTED ffc16ce0: 4b ff fe b4 b ffc16b94 <== NOT EXECUTED 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 */ ffc16ce4: 3a a0 00 00 li r21,0 <== NOT EXECUTED const uint32_t count, const uint8_t *buf, const uint32_t file_cln_initial) { int rc = RC_OK; uint32_t cmpltd = 0; ffc16ce8: 3b 60 00 00 li r27,0 <== NOT EXECUTED ffc16cec: 4b ff fe 88 b ffc16b74 <== NOT EXECUTED =============================================================================== ffc1ea58 : int fat_free_fat_clusters_chain( fat_fs_info_t *fs_info, uint32_t chain ) { ffc1ea58: 94 21 ff d0 stwu r1,-48(r1) ffc1ea5c: 7c 08 02 a6 mflr r0 int rc = RC_OK, rc1 = RC_OK; uint32_t cur_cln = chain; uint32_t next_cln = 0; ffc1ea60: 39 00 00 00 li r8,0 int fat_free_fat_clusters_chain( fat_fs_info_t *fs_info, uint32_t chain ) { ffc1ea64: 90 01 00 34 stw r0,52(r1) 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) ffc1ea68: 81 23 00 10 lwz r9,16(r3) ffc1ea6c: 81 43 00 14 lwz r10,20(r3) ffc1ea70: 7c 89 48 38 and r9,r4,r9 int fat_free_fat_clusters_chain( fat_fs_info_t *fs_info, uint32_t chain ) { ffc1ea74: 93 61 00 1c stw r27,28(r1) 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) ffc1ea78: 7f 89 50 40 cmplw cr7,r9,r10 int fat_free_fat_clusters_chain( fat_fs_info_t *fs_info, uint32_t chain ) { ffc1ea7c: 93 e1 00 2c stw r31,44(r1) ffc1ea80: 7c 9b 23 78 mr r27,r4 ffc1ea84: 7c 7f 1b 78 mr r31,r3 ffc1ea88: 93 81 00 20 stw r28,32(r1) ffc1ea8c: 93 a1 00 24 stw r29,36(r1) ffc1ea90: 93 c1 00 28 stw r30,40(r1) int rc = RC_OK, rc1 = RC_OK; uint32_t cur_cln = chain; uint32_t next_cln = 0; ffc1ea94: 91 01 00 08 stw r8,8(r1) uint32_t freed_cls_cnt = 0; while ((cur_cln & fs_info->vol.mask) < fs_info->vol.eoc_val) ffc1ea98: 40 9c 00 a8 bge- cr7,ffc1eb40 <== NEVER TAKEN ffc1ea9c: 7c 9e 23 78 mr r30,r4 ffc1eaa0: 3b a0 00 00 li r29,0 ffc1eaa4: 3b 80 00 00 li r28,0 ffc1eaa8: 48 00 00 30 b ffc1ead8 fat_buf_release(fs_info); return rc; } rc = fat_set_fat_cluster(fs_info, cur_cln, FAT_GENFAT_FREE); ffc1eaac: 4b ff fc 79 bl ffc1e724 if ( rc != RC_OK ) rc1 = rc; freed_cls_cnt++; ffc1eab0: 3b bd 00 01 addi r29,r29,1 fat_buf_release(fs_info); return rc; } rc = fat_set_fat_cluster(fs_info, cur_cln, FAT_GENFAT_FREE); if ( rc != RC_OK ) ffc1eab4: 2c 03 00 00 cmpwi r3,0 rc1 = rc; freed_cls_cnt++; cur_cln = next_cln; ffc1eab8: 83 c1 00 08 lwz r30,8(r1) fat_buf_release(fs_info); return rc; } rc = fat_set_fat_cluster(fs_info, cur_cln, FAT_GENFAT_FREE); if ( rc != RC_OK ) ffc1eabc: 41 82 00 08 beq- ffc1eac4 <== ALWAYS TAKEN ffc1eac0: 7c 7c 1b 78 mr r28,r3 <== NOT EXECUTED 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) ffc1eac4: 81 5f 00 10 lwz r10,16(r31) ffc1eac8: 81 3f 00 14 lwz r9,20(r31) ffc1eacc: 7f ca 50 38 and r10,r30,r10 ffc1ead0: 7f 8a 48 40 cmplw cr7,r10,r9 ffc1ead4: 40 9c 00 74 bge- cr7,ffc1eb48 { rc = fat_get_fat_cluster(fs_info, cur_cln, &next_cln); ffc1ead8: 7f c4 f3 78 mr r4,r30 ffc1eadc: 38 a1 00 08 addi r5,r1,8 ffc1eae0: 7f e3 fb 78 mr r3,r31 ffc1eae4: 4b ff f9 f1 bl ffc1e4d4 fat_buf_release(fs_info); return rc; } rc = fat_set_fat_cluster(fs_info, cur_cln, FAT_GENFAT_FREE); ffc1eae8: 7f c4 f3 78 mr r4,r30 uint32_t freed_cls_cnt = 0; while ((cur_cln & fs_info->vol.mask) < fs_info->vol.eoc_val) { rc = fat_get_fat_cluster(fs_info, cur_cln, &next_cln); if ( rc != RC_OK ) ffc1eaec: 7c 7e 1b 79 mr. r30,r3 fat_buf_release(fs_info); return rc; } rc = fat_set_fat_cluster(fs_info, cur_cln, FAT_GENFAT_FREE); ffc1eaf0: 38 a0 00 00 li r5,0 ffc1eaf4: 7f e3 fb 78 mr r3,r31 uint32_t freed_cls_cnt = 0; while ((cur_cln & fs_info->vol.mask) < fs_info->vol.eoc_val) { rc = fat_get_fat_cluster(fs_info, cur_cln, &next_cln); if ( rc != RC_OK ) ffc1eaf8: 41 82 ff b4 beq+ ffc1eaac <== ALWAYS TAKEN { if(fs_info->vol.free_cls != FAT_UNDEFINED_VALUE) ffc1eafc: 81 3f 00 44 lwz r9,68(r31) <== NOT EXECUTED ffc1eb00: 2f 89 ff ff cmpwi cr7,r9,-1 <== NOT EXECUTED ffc1eb04: 41 9e 00 0c beq- cr7,ffc1eb10 <== NOT EXECUTED fs_info->vol.free_cls += freed_cls_cnt; ffc1eb08: 7d 3d 4a 14 add r9,r29,r9 <== NOT EXECUTED ffc1eb0c: 91 3f 00 44 stw r9,68(r31) <== NOT EXECUTED fat_buf_release(fs_info); ffc1eb10: 7f e3 fb 78 mr r3,r31 <== NOT EXECUTED ffc1eb14: 4b ff 83 ad bl ffc16ec0 <== NOT EXECUTED fat_buf_release(fs_info); if (rc1 != RC_OK) return rc1; return RC_OK; } ffc1eb18: 80 01 00 34 lwz r0,52(r1) <== NOT EXECUTED ffc1eb1c: 7f c3 f3 78 mr r3,r30 <== NOT EXECUTED ffc1eb20: 83 61 00 1c lwz r27,28(r1) <== NOT EXECUTED ffc1eb24: 7c 08 03 a6 mtlr r0 <== NOT EXECUTED ffc1eb28: 83 81 00 20 lwz r28,32(r1) <== NOT EXECUTED ffc1eb2c: 83 a1 00 24 lwz r29,36(r1) <== NOT EXECUTED ffc1eb30: 83 c1 00 28 lwz r30,40(r1) <== NOT EXECUTED ffc1eb34: 83 e1 00 2c lwz r31,44(r1) <== NOT EXECUTED ffc1eb38: 38 21 00 30 addi r1,r1,48 <== NOT EXECUTED ffc1eb3c: 4e 80 00 20 blr <== NOT EXECUTED ) { int rc = RC_OK, rc1 = RC_OK; uint32_t cur_cln = chain; uint32_t next_cln = 0; uint32_t freed_cls_cnt = 0; ffc1eb40: 3b a0 00 00 li r29,0 <== NOT EXECUTED fat_free_fat_clusters_chain( fat_fs_info_t *fs_info, uint32_t chain ) { int rc = RC_OK, rc1 = RC_OK; ffc1eb44: 3b 80 00 00 li r28,0 <== NOT EXECUTED freed_cls_cnt++; cur_cln = next_cln; } fs_info->vol.next_cl = chain; if (fs_info->vol.free_cls != FAT_UNDEFINED_VALUE) ffc1eb48: 81 3f 00 44 lwz r9,68(r31) freed_cls_cnt++; cur_cln = next_cln; } fs_info->vol.next_cl = chain; ffc1eb4c: 93 7f 00 4c stw r27,76(r31) if (fs_info->vol.free_cls != FAT_UNDEFINED_VALUE) ffc1eb50: 2f 89 ff ff cmpwi cr7,r9,-1 ffc1eb54: 41 9e 00 0c beq- cr7,ffc1eb60 <== ALWAYS TAKEN fs_info->vol.free_cls += freed_cls_cnt; ffc1eb58: 7d 3d 4a 14 add r9,r29,r9 <== NOT EXECUTED ffc1eb5c: 91 3f 00 44 stw r9,68(r31) <== NOT EXECUTED fat_buf_release(fs_info); ffc1eb60: 7f e3 fb 78 mr r3,r31 ffc1eb64: 4b ff 83 5d bl ffc16ec0 if (rc1 != RC_OK) return rc1; return RC_OK; } ffc1eb68: 80 01 00 34 lwz r0,52(r1) fs_info->vol.next_cl = chain; if (fs_info->vol.free_cls != FAT_UNDEFINED_VALUE) fs_info->vol.free_cls += freed_cls_cnt; fat_buf_release(fs_info); ffc1eb6c: 7f 9e e3 78 mr r30,r28 if (rc1 != RC_OK) return rc1; return RC_OK; } ffc1eb70: 83 61 00 1c lwz r27,28(r1) ffc1eb74: 7c 08 03 a6 mtlr r0 ffc1eb78: 7f c3 f3 78 mr r3,r30 ffc1eb7c: 83 81 00 20 lwz r28,32(r1) ffc1eb80: 83 a1 00 24 lwz r29,36(r1) ffc1eb84: 83 c1 00 28 lwz r30,40(r1) ffc1eb88: 83 e1 00 2c lwz r31,44(r1) ffc1eb8c: 38 21 00 30 addi r1,r1,48 ffc1eb90: 4e 80 00 20 blr =============================================================================== ffc1840c : 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); ffc1840c: 81 43 00 80 lwz r10,128(r3) <== NOT EXECUTED ffc18410: 38 e0 ff fe li r7,-2 <== NOT EXECUTED ffc18414: 81 23 00 74 lwz r9,116(r3) <== NOT EXECUTED ffc18418: 7c 8a 20 50 subf r4,r10,r4 <== NOT EXECUTED ffc1841c: 54 8a e8 fe rlwinm r10,r4,29,3,31 <== NOT EXECUTED ffc18420: 7d 09 50 ae lbzx r8,r9,r10 <== NOT EXECUTED ffc18424: 54 84 07 7e clrlwi r4,r4,29 <== NOT EXECUTED ffc18428: 5c e4 20 3e rotlw r4,r7,r4 <== NOT EXECUTED ffc1842c: 7c 88 40 38 and r8,r4,r8 <== NOT EXECUTED ffc18430: 7d 09 51 ae stbx r8,r9,r10 <== NOT EXECUTED ffc18434: 4e 80 00 20 blr <== NOT EXECUTED =============================================================================== ffc1e4d4 : uint8_t *sec_buf; uint32_t sec = 0; uint32_t ofs = 0; /* sanity check */ if ( (cln < 2) || (cln > (fs_info->vol.data_cls + 1)) ) ffc1e4d4: 2b 84 00 01 cmplwi cr7,r4,1 fat_get_fat_cluster( fat_fs_info_t *fs_info, uint32_t cln, uint32_t *ret_val ) { ffc1e4d8: 94 21 ff c8 stwu r1,-56(r1) ffc1e4dc: 7c 08 02 a6 mflr r0 ffc1e4e0: 93 c1 00 30 stw r30,48(r1) ffc1e4e4: 7c 9e 23 78 mr r30,r4 ffc1e4e8: 90 01 00 3c stw r0,60(r1) ffc1e4ec: 93 21 00 1c stw r25,28(r1) ffc1e4f0: 93 41 00 20 stw r26,32(r1) ffc1e4f4: 93 61 00 24 stw r27,36(r1) ffc1e4f8: 93 81 00 28 stw r28,40(r1) ffc1e4fc: 93 a1 00 2c stw r29,44(r1) ffc1e500: 93 e1 00 34 stw r31,52(r1) uint8_t *sec_buf; uint32_t sec = 0; uint32_t ofs = 0; /* sanity check */ if ( (cln < 2) || (cln > (fs_info->vol.data_cls + 1)) ) ffc1e504: 40 9d 00 8c ble- cr7,ffc1e590 <== NEVER TAKEN ffc1e508: 81 23 00 38 lwz r9,56(r3) ffc1e50c: 7c 7f 1b 78 mr r31,r3 ffc1e510: 39 29 00 01 addi r9,r9,1 ffc1e514: 7f 84 48 40 cmplw cr7,r4,r9 ffc1e518: 41 9d 00 78 bgt- cr7,ffc1e590 <== NEVER TAKEN rtems_set_errno_and_return_minus_one(EIO); sec = (FAT_FAT_OFFSET(fs_info->vol.type, cln) >> fs_info->vol.sec_log2) + ffc1e51c: 89 23 00 0e lbz r9,14(r3) ffc1e520: 7c ba 2b 78 mr r26,r5 ffc1e524: 71 2a 00 01 andi. r10,r9,1 ffc1e528: 40 82 00 a8 bne- ffc1e5d0 ffc1e52c: 55 29 07 bc rlwinm r9,r9,0,30,30 ffc1e530: 8b 63 00 02 lbz r27,2(r3) ffc1e534: 71 2a 00 ff andi. r10,r9,255 ffc1e538: 41 82 00 b4 beq- ffc1e5ec ffc1e53c: 54 9d 08 3c rlwinm r29,r4,1,0,30 ffc1e540: 81 23 00 58 lwz r9,88(r3) ffc1e544: 7f bb dc 30 srw r27,r29,r27 ffc1e548: 7f 7b 4a 14 add r27,r27,r9 fs_info->vol.afat_loc; ofs = FAT_FAT_OFFSET(fs_info->vol.type, cln) & (fs_info->vol.bps - 1); rc = fat_buf_access(fs_info, sec, FAT_OP_TYPE_READ, &sec_buf); ffc1e54c: 7f e3 fb 78 mr r3,r31 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); ffc1e550: a3 3f 00 00 lhz r25,0(r31) rc = fat_buf_access(fs_info, sec, FAT_OP_TYPE_READ, &sec_buf); ffc1e554: 7f 64 db 78 mr r4,r27 ffc1e558: 38 a0 00 01 li r5,1 ffc1e55c: 38 c1 00 08 addi r6,r1,8 ffc1e560: 4b ff 8b 45 bl ffc170a4 if (rc != RC_OK) ffc1e564: 7c 7c 1b 79 mr. r28,r3 ffc1e568: 40 82 00 38 bne- ffc1e5a0 <== NEVER TAKEN return rc; switch ( fs_info->vol.type ) ffc1e56c: 89 3f 00 0e lbz r9,14(r31) 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); ffc1e570: 3b 39 ff ff addi r25,r25,-1 ffc1e574: 7f bd c8 38 and r29,r29,r25 rc = fat_buf_access(fs_info, sec, FAT_OP_TYPE_READ, &sec_buf); if (rc != RC_OK) return rc; switch ( fs_info->vol.type ) ffc1e578: 2f 89 00 02 cmpwi cr7,r9,2 ffc1e57c: 41 9e 00 84 beq- cr7,ffc1e600 ffc1e580: 2f 89 00 04 cmpwi cr7,r9,4 ffc1e584: 41 9e 01 08 beq- cr7,ffc1e68c ffc1e588: 2f 89 00 01 cmpwi cr7,r9,1 ffc1e58c: 41 9e 00 bc beq- cr7,ffc1e648 <== ALWAYS TAKEN *ret_val = *((uint32_t *)(sec_buf + ofs)); *ret_val = CF_LE_L(*ret_val); break; default: rtems_set_errno_and_return_minus_one(EIO); ffc1e590: 48 00 21 0d bl ffc2069c <__errno> <== NOT EXECUTED ffc1e594: 39 20 00 05 li r9,5 <== NOT EXECUTED ffc1e598: 91 23 00 00 stw r9,0(r3) <== NOT EXECUTED ffc1e59c: 3b 80 ff ff li r28,-1 <== NOT EXECUTED break; } return RC_OK; } ffc1e5a0: 80 01 00 3c lwz r0,60(r1) ffc1e5a4: 7f 83 e3 78 mr r3,r28 ffc1e5a8: 83 21 00 1c lwz r25,28(r1) ffc1e5ac: 7c 08 03 a6 mtlr r0 ffc1e5b0: 83 41 00 20 lwz r26,32(r1) ffc1e5b4: 83 61 00 24 lwz r27,36(r1) ffc1e5b8: 83 81 00 28 lwz r28,40(r1) ffc1e5bc: 83 a1 00 2c lwz r29,44(r1) ffc1e5c0: 83 c1 00 30 lwz r30,48(r1) ffc1e5c4: 83 e1 00 34 lwz r31,52(r1) ffc1e5c8: 38 21 00 38 addi r1,r1,56 ffc1e5cc: 4e 80 00 20 blr /* 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) + ffc1e5d0: 54 9d f8 7e rlwinm r29,r4,31,1,31 ffc1e5d4: 8b 63 00 02 lbz r27,2(r3) ffc1e5d8: 7f bd 22 14 add r29,r29,r4 ffc1e5dc: 81 23 00 58 lwz r9,88(r3) ffc1e5e0: 7f bb dc 30 srw r27,r29,r27 ffc1e5e4: 7f 7b 4a 14 add r27,r27,r9 ffc1e5e8: 4b ff ff 64 b ffc1e54c ffc1e5ec: 54 9d 10 3a rlwinm r29,r4,2,0,29 ffc1e5f0: 81 23 00 58 lwz r9,88(r3) ffc1e5f4: 7f bb dc 30 srw r27,r29,r27 ffc1e5f8: 7f 7b 4a 14 add r27,r27,r9 ffc1e5fc: 4b ff ff 50 b ffc1e54c else *ret_val = (*ret_val) & FAT_FAT12_MASK; break; case FAT_FAT16: *ret_val = *((uint16_t *)(sec_buf + ofs)); ffc1e600: 81 21 00 08 lwz r9,8(r1) rtems_set_errno_and_return_minus_one(EIO); break; } return RC_OK; } ffc1e604: 7f 83 e3 78 mr r3,r28 ffc1e608: 80 01 00 3c lwz r0,60(r1) else *ret_val = (*ret_val) & FAT_FAT12_MASK; break; case FAT_FAT16: *ret_val = *((uint16_t *)(sec_buf + ofs)); ffc1e60c: 7d 29 ea 2e lhzx r9,r9,r29 rtems_set_errno_and_return_minus_one(EIO); break; } return RC_OK; } ffc1e610: 7c 08 03 a6 mtlr r0 ffc1e614: 83 21 00 1c lwz r25,28(r1) *ret_val = (*ret_val) & FAT_FAT12_MASK; break; case FAT_FAT16: *ret_val = *((uint16_t *)(sec_buf + ofs)); *ret_val = CF_LE_W(*ret_val); ffc1e618: 55 2a c2 3e rlwinm r10,r9,24,8,31 rtems_set_errno_and_return_minus_one(EIO); break; } return RC_OK; } ffc1e61c: 83 61 00 24 lwz r27,36(r1) *ret_val = (*ret_val) & FAT_FAT12_MASK; break; case FAT_FAT16: *ret_val = *((uint16_t *)(sec_buf + ofs)); *ret_val = CF_LE_W(*ret_val); ffc1e620: 55 29 44 2e rlwinm r9,r9,8,16,23 rtems_set_errno_and_return_minus_one(EIO); break; } return RC_OK; } ffc1e624: 83 81 00 28 lwz r28,40(r1) *ret_val = (*ret_val) & FAT_FAT12_MASK; break; case FAT_FAT16: *ret_val = *((uint16_t *)(sec_buf + ofs)); *ret_val = CF_LE_W(*ret_val); ffc1e628: 7d 49 4b 78 or r9,r10,r9 rtems_set_errno_and_return_minus_one(EIO); break; } return RC_OK; } ffc1e62c: 83 a1 00 2c lwz r29,44(r1) *ret_val = (*ret_val) & FAT_FAT12_MASK; break; case FAT_FAT16: *ret_val = *((uint16_t *)(sec_buf + ofs)); *ret_val = CF_LE_W(*ret_val); ffc1e630: 91 3a 00 00 stw r9,0(r26) rtems_set_errno_and_return_minus_one(EIO); break; } return RC_OK; } ffc1e634: 83 c1 00 30 lwz r30,48(r1) ffc1e638: 83 41 00 20 lwz r26,32(r1) ffc1e63c: 83 e1 00 34 lwz r31,52(r1) ffc1e640: 38 21 00 38 addi r1,r1,56 ffc1e644: 4e 80 00 20 blr /* * 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) ) ffc1e648: a1 3f 00 00 lhz r9,0(r31) case FAT_FAT12: /* * we are enforced in complex computations for FAT12 to escape CPU * align problems for some architectures */ *ret_val = (*(sec_buf + ofs)); ffc1e64c: 81 41 00 08 lwz r10,8(r1) if ( ofs == (fs_info->vol.bps - 1) ) ffc1e650: 39 29 ff ff addi r9,r9,-1 ffc1e654: 7f 89 e8 00 cmpw cr7,r9,r29 case FAT_FAT12: /* * we are enforced in complex computations for FAT12 to escape CPU * align problems for some architectures */ *ret_val = (*(sec_buf + ofs)); ffc1e658: 7d 2a e8 ae lbzx r9,r10,r29 ffc1e65c: 91 3a 00 00 stw r9,0(r26) if ( ofs == (fs_info->vol.bps - 1) ) ffc1e660: 41 9e 00 84 beq- cr7,ffc1e6e4 <== NEVER TAKEN *ret_val |= *sec_buf << 8; } else { *ret_val |= *(sec_buf + ofs + 1) << 8; ffc1e664: 7f aa ea 14 add r29,r10,r29 ffc1e668: 89 5d 00 01 lbz r10,1(r29) ffc1e66c: 55 4a 40 2e rlwinm r10,r10,8,0,23 ffc1e670: 7d 49 4b 78 or r9,r10,r9 ffc1e674: 91 3a 00 00 stw r9,0(r26) } if ( FAT_CLUSTER_IS_ODD(cln) ) ffc1e678: 73 ca 00 01 andi. r10,r30,1 ffc1e67c: 41 82 00 5c beq- ffc1e6d8 *ret_val = (*ret_val) >> FAT12_SHIFT; ffc1e680: 55 29 e1 3e rlwinm r9,r9,28,4,31 ffc1e684: 91 3a 00 00 stw r9,0(r26) ffc1e688: 4b ff ff 18 b ffc1e5a0 *ret_val = *((uint16_t *)(sec_buf + ofs)); *ret_val = CF_LE_W(*ret_val); break; case FAT_FAT32: *ret_val = *((uint32_t *)(sec_buf + ofs)); ffc1e68c: 81 21 00 08 lwz r9,8(r1) ffc1e690: 7d 49 e8 2e lwzx r10,r9,r29 ffc1e694: 51 49 46 3e rlwimi r9,r10,8,24,31 ffc1e698: 51 49 c4 2e rlwimi r9,r10,24,16,23 ffc1e69c: 51 49 42 1e rlwimi r9,r10,8,8,15 ffc1e6a0: 51 49 c0 0e rlwimi r9,r10,24,0,7 rtems_set_errno_and_return_minus_one(EIO); break; } return RC_OK; } ffc1e6a4: 80 01 00 3c lwz r0,60(r1) ffc1e6a8: 7f 83 e3 78 mr r3,r28 *ret_val = CF_LE_W(*ret_val); break; case FAT_FAT32: *ret_val = *((uint32_t *)(sec_buf + ofs)); *ret_val = CF_LE_L(*ret_val); ffc1e6ac: 91 3a 00 00 stw r9,0(r26) rtems_set_errno_and_return_minus_one(EIO); break; } return RC_OK; } ffc1e6b0: 7c 08 03 a6 mtlr r0 ffc1e6b4: 83 21 00 1c lwz r25,28(r1) ffc1e6b8: 83 41 00 20 lwz r26,32(r1) ffc1e6bc: 83 61 00 24 lwz r27,36(r1) ffc1e6c0: 83 81 00 28 lwz r28,40(r1) ffc1e6c4: 83 a1 00 2c lwz r29,44(r1) ffc1e6c8: 83 c1 00 30 lwz r30,48(r1) ffc1e6cc: 83 e1 00 34 lwz r31,52(r1) ffc1e6d0: 38 21 00 38 addi r1,r1,56 ffc1e6d4: 4e 80 00 20 blr } if ( FAT_CLUSTER_IS_ODD(cln) ) *ret_val = (*ret_val) >> FAT12_SHIFT; else *ret_val = (*ret_val) & FAT_FAT12_MASK; ffc1e6d8: 55 29 05 3e clrlwi r9,r9,20 ffc1e6dc: 91 3a 00 00 stw r9,0(r26) ffc1e6e0: 4b ff fe c0 b ffc1e5a0 * align problems for some architectures */ *ret_val = (*(sec_buf + ofs)); if ( ofs == (fs_info->vol.bps - 1) ) { rc = fat_buf_access(fs_info, sec + 1, FAT_OP_TYPE_READ, ffc1e6e4: 7f e3 fb 78 mr r3,r31 <== NOT EXECUTED ffc1e6e8: 38 9b 00 01 addi r4,r27,1 <== NOT EXECUTED ffc1e6ec: 38 a0 00 01 li r5,1 <== NOT EXECUTED ffc1e6f0: 38 c1 00 08 addi r6,r1,8 <== NOT EXECUTED ffc1e6f4: 4b ff 89 b1 bl ffc170a4 <== NOT EXECUTED &sec_buf); if (rc != RC_OK) ffc1e6f8: 2c 03 00 00 cmpwi r3,0 <== NOT EXECUTED ffc1e6fc: 40 82 00 20 bne- ffc1e71c <== NOT EXECUTED return rc; *ret_val |= *sec_buf << 8; ffc1e700: 81 41 00 08 lwz r10,8(r1) <== NOT EXECUTED ffc1e704: 81 3a 00 00 lwz r9,0(r26) <== NOT EXECUTED ffc1e708: 89 4a 00 00 lbz r10,0(r10) <== NOT EXECUTED ffc1e70c: 55 4a 40 2e rlwinm r10,r10,8,0,23 <== NOT EXECUTED ffc1e710: 7d 49 4b 78 or r9,r10,r9 <== NOT EXECUTED ffc1e714: 91 3a 00 00 stw r9,0(r26) <== NOT EXECUTED ffc1e718: 4b ff ff 60 b ffc1e678 <== 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) ffc1e71c: 7c 7c 1b 78 mr r28,r3 <== NOT EXECUTED ffc1e720: 4b ff fe 80 b ffc1e5a0 <== NOT EXECUTED =============================================================================== ffc182e8 : * 0 means FAILED !!! * */ uint32_t fat_get_unique_ino(fat_fs_info_t *fs_info) { ffc182e8: 94 21 ff e8 stwu r1,-24(r1) <== NOT EXECUTED ffc182ec: 7c 08 02 a6 mflr r0 <== NOT EXECUTED ffc182f0: 90 01 00 1c stw r0,28(r1) <== NOT EXECUTED ffc182f4: 93 a1 00 0c stw r29,12(r1) <== 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)) ffc182f8: 3f a0 0f ff lis r29,4095 <== NOT EXECUTED ffc182fc: 63 bd ff ff ori r29,r29,65535 <== NOT EXECUTED ffc18300: 80 83 00 7c lwz r4,124(r3) <== NOT EXECUTED * 0 means FAILED !!! * */ uint32_t fat_get_unique_ino(fat_fs_info_t *fs_info) { ffc18304: 93 c1 00 10 stw r30,16(r1) <== NOT EXECUTED while (!resrc_unsuff) { for (j = 0; j < fs_info->uino_pool_size; j++) { if (!FAT_UNIQ_INO_IS_BUSY(fs_info->index, fs_info->uino)) ffc18308: 3b c0 00 00 li r30,0 <== NOT EXECUTED * 0 means FAILED !!! * */ uint32_t fat_get_unique_ino(fat_fs_info_t *fs_info) { ffc1830c: 93 e1 00 14 stw r31,20(r1) <== NOT EXECUTED ffc18310: 7c 7f 1b 78 mr r31,r3 <== NOT EXECUTED uint32_t j = 0; bool resrc_unsuff = false; while (!resrc_unsuff) { for (j = 0; j < fs_info->uino_pool_size; j++) ffc18314: 2f 84 00 00 cmpwi cr7,r4,0 <== NOT EXECUTED ffc18318: 41 9e 00 9c beq- cr7,ffc183b4 <== NOT EXECUTED { if (!FAT_UNIQ_INO_IS_BUSY(fs_info->index, fs_info->uino)) ffc1831c: 81 3f 00 78 lwz r9,120(r31) <== NOT EXECUTED ffc18320: 81 1f 00 74 lwz r8,116(r31) <== NOT EXECUTED ffc18324: 55 2a e8 fe rlwinm r10,r9,29,3,31 <== NOT EXECUTED ffc18328: 7c e8 50 ae lbzx r7,r8,r10 <== NOT EXECUTED ffc1832c: 55 26 07 7e clrlwi r6,r9,29 <== NOT EXECUTED ffc18330: 7d 48 52 14 add r10,r8,r10 <== NOT EXECUTED ffc18334: 7c e5 36 30 sraw r5,r7,r6 <== NOT EXECUTED ffc18338: 70 a3 00 01 andi. r3,r5,1 <== NOT EXECUTED ffc1833c: 41 82 00 40 beq- ffc1837c <== NOT EXECUTED FAT_SET_UNIQ_INO_BUSY(fs_info->index, fs_info->uino); return (fs_info->uino_base + fs_info->index); } fs_info->index++; if (fs_info->index >= fs_info->uino_pool_size) fs_info->index = 0; ffc18340: 7c 89 03 a6 mtctr r4 <== NOT EXECUTED if (!FAT_UNIQ_INO_IS_BUSY(fs_info->index, fs_info->uino)) { FAT_SET_UNIQ_INO_BUSY(fs_info->index, fs_info->uino); return (fs_info->uino_base + fs_info->index); } fs_info->index++; ffc18344: 39 29 00 01 addi r9,r9,1 <== NOT EXECUTED if (fs_info->index >= fs_info->uino_pool_size) ffc18348: 7f 89 20 40 cmplw cr7,r9,r4 <== NOT EXECUTED if (!FAT_UNIQ_INO_IS_BUSY(fs_info->index, fs_info->uino)) { FAT_SET_UNIQ_INO_BUSY(fs_info->index, fs_info->uino); return (fs_info->uino_base + fs_info->index); } fs_info->index++; ffc1834c: 91 3f 00 78 stw r9,120(r31) <== NOT EXECUTED if (fs_info->index >= fs_info->uino_pool_size) ffc18350: 41 9c 00 08 blt- cr7,ffc18358 <== NOT EXECUTED fs_info->index = 0; ffc18354: 93 df 00 78 stw r30,120(r31) <== NOT EXECUTED uint32_t j = 0; bool resrc_unsuff = false; while (!resrc_unsuff) { for (j = 0; j < fs_info->uino_pool_size; j++) ffc18358: 42 40 00 5c bdz- ffc183b4 <== NOT EXECUTED { if (!FAT_UNIQ_INO_IS_BUSY(fs_info->index, fs_info->uino)) ffc1835c: 81 3f 00 78 lwz r9,120(r31) <== NOT EXECUTED ffc18360: 55 2a e8 fe rlwinm r10,r9,29,3,31 <== NOT EXECUTED ffc18364: 7c e8 50 ae lbzx r7,r8,r10 <== NOT EXECUTED ffc18368: 55 26 07 7e clrlwi r6,r9,29 <== NOT EXECUTED ffc1836c: 7d 48 52 14 add r10,r8,r10 <== NOT EXECUTED ffc18370: 7c e5 36 30 sraw r5,r7,r6 <== NOT EXECUTED ffc18374: 70 a3 00 01 andi. r3,r5,1 <== NOT EXECUTED ffc18378: 40 82 ff cc bne+ ffc18344 <== NOT EXECUTED { FAT_SET_UNIQ_INO_BUSY(fs_info->index, fs_info->uino); ffc1837c: 39 20 00 01 li r9,1 <== NOT EXECUTED ffc18380: 7d 26 30 30 slw r6,r9,r6 <== NOT EXECUTED ffc18384: 7c c7 3b 78 or r7,r6,r7 <== NOT EXECUTED ffc18388: 98 ea 00 00 stb r7,0(r10) <== NOT EXECUTED } else resrc_unsuff = true; } return 0; } ffc1838c: 80 01 00 1c lwz r0,28(r1) <== NOT EXECUTED for (j = 0; j < fs_info->uino_pool_size; j++) { if (!FAT_UNIQ_INO_IS_BUSY(fs_info->index, fs_info->uino)) { FAT_SET_UNIQ_INO_BUSY(fs_info->index, fs_info->uino); return (fs_info->uino_base + fs_info->index); ffc18390: 80 7f 00 78 lwz r3,120(r31) <== NOT EXECUTED } else resrc_unsuff = true; } return 0; } ffc18394: 7c 08 03 a6 mtlr r0 <== NOT EXECUTED for (j = 0; j < fs_info->uino_pool_size; j++) { if (!FAT_UNIQ_INO_IS_BUSY(fs_info->index, fs_info->uino)) { FAT_SET_UNIQ_INO_BUSY(fs_info->index, fs_info->uino); return (fs_info->uino_base + fs_info->index); ffc18398: 81 3f 00 80 lwz r9,128(r31) <== NOT EXECUTED } else resrc_unsuff = true; } return 0; } ffc1839c: 83 a1 00 0c lwz r29,12(r1) <== NOT EXECUTED ffc183a0: 83 c1 00 10 lwz r30,16(r1) <== NOT EXECUTED for (j = 0; j < fs_info->uino_pool_size; j++) { if (!FAT_UNIQ_INO_IS_BUSY(fs_info->index, fs_info->uino)) { FAT_SET_UNIQ_INO_BUSY(fs_info->index, fs_info->uino); return (fs_info->uino_base + fs_info->index); ffc183a4: 7c 63 4a 14 add r3,r3,r9 <== NOT EXECUTED } else resrc_unsuff = true; } return 0; } ffc183a8: 83 e1 00 14 lwz r31,20(r1) <== NOT EXECUTED ffc183ac: 38 21 00 18 addi r1,r1,24 <== NOT EXECUTED ffc183b0: 4e 80 00 20 blr <== 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)) ffc183b4: 81 3f 00 80 lwz r9,128(r31) <== NOT EXECUTED ffc183b8: 54 84 08 3c rlwinm r4,r4,1,0,30 <== NOT EXECUTED ffc183bc: 7d 29 e8 50 subf r9,r9,r29 <== NOT EXECUTED ffc183c0: 7f 84 48 40 cmplw cr7,r4,r9 <== NOT EXECUTED ffc183c4: 41 9c 00 24 blt- cr7,ffc183e8 <== NOT EXECUTED } else resrc_unsuff = true; } return 0; } ffc183c8: 80 01 00 1c lwz r0,28(r1) <== NOT EXECUTED resrc_unsuff = true; } else resrc_unsuff = true; } return 0; ffc183cc: 38 60 00 00 li r3,0 <== NOT EXECUTED } ffc183d0: 83 a1 00 0c lwz r29,12(r1) <== NOT EXECUTED ffc183d4: 7c 08 03 a6 mtlr r0 <== NOT EXECUTED ffc183d8: 83 c1 00 10 lwz r30,16(r1) <== NOT EXECUTED ffc183dc: 83 e1 00 14 lwz r31,20(r1) <== NOT EXECUTED ffc183e0: 38 21 00 18 addi r1,r1,24 <== NOT EXECUTED ffc183e4: 4e 80 00 20 blr <== NOT EXECUTED fs_info->index = 0; } if ((fs_info->uino_pool_size << 1) < (0x0FFFFFFF - fs_info->uino_base)) { fs_info->uino_pool_size <<= 1; ffc183e8: 90 9f 00 7c stw r4,124(r31) <== NOT EXECUTED fs_info->uino = realloc(fs_info->uino, fs_info->uino_pool_size); ffc183ec: 80 7f 00 74 lwz r3,116(r31) <== NOT EXECUTED ffc183f0: 4b fe f6 c9 bl ffc07ab8 <== NOT EXECUTED if (fs_info->uino != NULL) ffc183f4: 2f 83 00 00 cmpwi cr7,r3,0 <== 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); ffc183f8: 90 7f 00 74 stw r3,116(r31) <== NOT EXECUTED if (fs_info->uino != NULL) ffc183fc: 41 9e ff cc beq+ cr7,ffc183c8 <== NOT EXECUTED fs_info->index = fs_info->uino_pool_size; ffc18400: 80 9f 00 7c lwz r4,124(r31) <== NOT EXECUTED ffc18404: 90 9f 00 78 stw r4,120(r31) <== NOT EXECUTED ffc18408: 4b ff ff 0c b ffc18314 <== NOT EXECUTED =============================================================================== ffc1821c : int fat_init_clusters_chain( fat_fs_info_t *fs_info, uint32_t start_cln ) { ffc1821c: 94 21 ff e0 stwu r1,-32(r1) ffc18220: 7c 08 02 a6 mflr r0 ffc18224: 7c 89 23 78 mr r9,r4 ffc18228: 93 c1 00 18 stw r30,24(r1) int rc = RC_OK; ssize_t ret = 0; uint32_t cur_cln = start_cln; ffc1822c: 7c 3e 0b 78 mr r30,r1 int fat_init_clusters_chain( fat_fs_info_t *fs_info, uint32_t start_cln ) { ffc18230: 93 e1 00 1c stw r31,28(r1) ffc18234: 7c 7f 1b 78 mr r31,r3 ffc18238: 90 01 00 24 stw r0,36(r1) int rc = RC_OK; ssize_t ret = 0; uint32_t cur_cln = start_cln; ffc1823c: 94 9e 00 08 stwu r4,8(r30) while ((cur_cln & fs_info->vol.mask) < fs_info->vol.eoc_val) ffc18240: 48 00 00 08 b ffc18248 ffc18244: 81 21 00 08 lwz r9,8(r1) ffc18248: 81 1f 00 10 lwz r8,16(r31) { ret = fat_cluster_set(fs_info, cur_cln, 0, fs_info->vol.bpc, 0); ffc1824c: 7d 24 4b 78 mr r4,r9 { 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) ffc18250: 81 5f 00 14 lwz r10,20(r31) { ret = fat_cluster_set(fs_info, cur_cln, 0, fs_info->vol.bpc, 0); ffc18254: 38 a0 00 00 li r5,0 { 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) ffc18258: 7d 29 40 38 and r9,r9,r8 ffc1825c: 7f 89 50 40 cmplw cr7,r9,r10 { ret = fat_cluster_set(fs_info, cur_cln, 0, fs_info->vol.bpc, 0); ffc18260: 38 e0 00 00 li r7,0 ffc18264: 7f e3 fb 78 mr r3,r31 { 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) ffc18268: 40 9c 00 48 bge- cr7,ffc182b0 { ret = fat_cluster_set(fs_info, cur_cln, 0, fs_info->vol.bpc, 0); ffc1826c: a0 df 00 06 lhz r6,6(r31) ffc18270: 4b ff f1 2d bl ffc1739c if ( ret != fs_info->vol.bpc ) ffc18274: a1 3f 00 06 lhz r9,6(r31) { return -1; } rc = fat_get_fat_cluster(fs_info, cur_cln, &cur_cln); ffc18278: 7f c5 f3 78 mr r5,r30 uint32_t cur_cln = start_cln; 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 ) ffc1827c: 7f 89 18 00 cmpw cr7,r9,r3 { return -1; } rc = fat_get_fat_cluster(fs_info, cur_cln, &cur_cln); ffc18280: 7f e3 fb 78 mr r3,r31 uint32_t cur_cln = start_cln; 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 ) ffc18284: 40 9e 00 48 bne- cr7,ffc182cc <== NEVER TAKEN { return -1; } rc = fat_get_fat_cluster(fs_info, cur_cln, &cur_cln); ffc18288: 80 81 00 08 lwz r4,8(r1) ffc1828c: 48 00 62 49 bl ffc1e4d4 if ( rc != RC_OK ) ffc18290: 2c 03 00 00 cmpwi r3,0 ffc18294: 41 82 ff b0 beq+ ffc18244 <== ALWAYS TAKEN } } return rc; } ffc18298: 80 01 00 24 lwz r0,36(r1) <== NOT EXECUTED ffc1829c: 83 c1 00 18 lwz r30,24(r1) <== NOT EXECUTED ffc182a0: 7c 08 03 a6 mtlr r0 <== NOT EXECUTED ffc182a4: 83 e1 00 1c lwz r31,28(r1) <== NOT EXECUTED ffc182a8: 38 21 00 20 addi r1,r1,32 <== NOT EXECUTED ffc182ac: 4e 80 00 20 blr <== NOT EXECUTED ffc182b0: 80 01 00 24 lwz r0,36(r1) return rc; } } return rc; ffc182b4: 38 60 00 00 li r3,0 } ffc182b8: 83 c1 00 18 lwz r30,24(r1) ffc182bc: 7c 08 03 a6 mtlr r0 ffc182c0: 83 e1 00 1c lwz r31,28(r1) ffc182c4: 38 21 00 20 addi r1,r1,32 ffc182c8: 4e 80 00 20 blr ffc182cc: 80 01 00 24 lwz r0,36(r1) <== NOT EXECUTED 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; ffc182d0: 38 60 ff ff li r3,-1 <== NOT EXECUTED } } return rc; } ffc182d4: 83 c1 00 18 lwz r30,24(r1) <== NOT EXECUTED ffc182d8: 7c 08 03 a6 mtlr r0 <== NOT EXECUTED ffc182dc: 83 e1 00 1c lwz r31,28(r1) <== NOT EXECUTED ffc182e0: 38 21 00 20 addi r1,r1,32 <== NOT EXECUTED ffc182e4: 4e 80 00 20 blr <== NOT EXECUTED =============================================================================== ffc177a8 : * 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) { ffc177a8: 94 21 ff 28 stwu r1,-216(r1) ffc177ac: 7c 08 02 a6 mflr r0 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; ffc177b0: 39 40 00 00 li r10,0 * 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) { ffc177b4: 92 81 00 a8 stw r20,168(r1) ffc177b8: 7c 74 1b 78 mr r20,r3 ssize_t ret = 0; struct stat stat_buf; int i = 0; rtems_bdbuf_buffer *block = NULL; vol->fd = open(device, O_RDWR); ffc177bc: 7c 83 23 78 mr r3,r4 ffc177c0: 38 80 00 02 li r4,2 * 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) { ffc177c4: 90 01 00 dc stw r0,220(r1) ffc177c8: 91 c1 00 90 stw r14,144(r1) ffc177cc: 91 e1 00 94 stw r15,148(r1) ffc177d0: 92 01 00 98 stw r16,152(r1) ffc177d4: 92 21 00 9c stw r17,156(r1) ffc177d8: 92 41 00 a0 stw r18,160(r1) ffc177dc: 92 61 00 a4 stw r19,164(r1) ffc177e0: 92 a1 00 ac stw r21,172(r1) ffc177e4: 92 c1 00 b0 stw r22,176(r1) ffc177e8: 92 e1 00 b4 stw r23,180(r1) ffc177ec: 93 01 00 b8 stw r24,184(r1) ffc177f0: 93 21 00 bc stw r25,188(r1) ffc177f4: 93 41 00 c0 stw r26,192(r1) ffc177f8: 93 61 00 c4 stw r27,196(r1) ffc177fc: 93 81 00 c8 stw r28,200(r1) ffc17800: 93 a1 00 cc stw r29,204(r1) ffc17804: 93 c1 00 d0 stw r30,208(r1) ffc17808: 93 e1 00 d4 stw r31,212(r1) 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; ffc1780c: 91 41 00 5c stw r10,92(r1) vol->fd = open(device, O_RDWR); ffc17810: 4c c6 31 82 crclr 4*cr1+eq ffc17814: 4b fe ff 75 bl ffc07788 if (vol->fd < 0) ffc17818: 2f 83 00 00 cmpwi cr7,r3,0 ssize_t ret = 0; struct stat stat_buf; int i = 0; rtems_bdbuf_buffer *block = NULL; vol->fd = open(device, O_RDWR); ffc1781c: 90 74 00 60 stw r3,96(r20) if (vol->fd < 0) ffc17820: 41 9c 06 e8 blt- cr7,ffc17f08 <== NEVER TAKEN { rtems_set_errno_and_return_minus_one(ENXIO); } rc = fstat(vol->fd, &stat_buf); ffc17824: 38 81 00 08 addi r4,r1,8 ffc17828: 4b fe ef d5 bl ffc067fc if (rc != 0) ffc1782c: 2f 83 00 00 cmpwi cr7,r3,0 ffc17830: 40 9e 06 d0 bne- cr7,ffc17f00 <== NEVER TAKEN close(vol->fd); rtems_set_errno_and_return_minus_one(ENXIO); } /* Must be a block device. */ if (!S_ISBLK(stat_buf.st_mode)) ffc17834: 81 41 00 14 lwz r10,20(r1) { close(vol->fd); ffc17838: 80 74 00 60 lwz r3,96(r20) close(vol->fd); rtems_set_errno_and_return_minus_one(ENXIO); } /* Must be a block device. */ if (!S_ISBLK(stat_buf.st_mode)) ffc1783c: 55 4a 04 26 rlwinm r10,r10,0,16,19 ffc17840: 2f 8a 60 00 cmpwi cr7,r10,24576 ffc17844: 40 9e 06 c0 bne- cr7,ffc17f04 <== NEVER TAKEN static inline int rtems_disk_fd_get_disk_device( int fd, rtems_disk_device **dd_ptr ) { return ioctl(fd, RTEMS_BLKIO_GETDISKDEV, dd_ptr); ffc17848: 3c 80 40 04 lis r4,16388 ffc1784c: 60 84 42 09 ori r4,r4,16905 ffc17850: 38 b4 00 64 addi r5,r20,100 ffc17854: 4c c6 31 82 crclr 4*cr1+eq ffc17858: 48 00 19 d9 bl ffc19230 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) { ffc1785c: 2f 83 00 00 cmpwi cr7,r3,0 ffc17860: 40 9e 06 a0 bne- cr7,ffc17f00 <== NEVER TAKEN rtems_set_errno_and_return_minus_one(ENXIO); } /* Read boot record */ /* FIXME: Asserts FAT_MAX_BPB_SIZE < bdbuf block size */ sc = rtems_bdbuf_read( vol->dd, 0, &block); ffc17864: 80 74 00 64 lwz r3,100(r20) ffc17868: 38 80 00 00 li r4,0 ffc1786c: 38 a1 00 5c addi r5,r1,92 ffc17870: 4b ff cb d9 bl ffc14448 if (sc != RTEMS_SUCCESSFUL) ffc17874: 2f 83 00 00 cmpwi cr7,r3,0 ffc17878: 40 9e 06 bc bne- cr7,ffc17f34 <== NEVER TAKEN { close(vol->fd); rtems_set_errno_and_return_minus_one( EIO); } memcpy( boot_rec, block->buffer, FAT_MAX_BPB_SIZE); ffc1787c: 80 61 00 5c lwz r3,92(r1) ffc17880: 81 43 00 1c lwz r10,28(r3) ffc17884: 89 2a 00 21 lbz r9,33(r10) ffc17888: 8b ea 00 0b lbz r31,11(r10) ffc1788c: 91 21 00 6c stw r9,108(r1) ffc17890: 89 2a 00 24 lbz r9,36(r10) ffc17894: 8b ca 00 0c lbz r30,12(r10) ffc17898: 91 21 00 70 stw r9,112(r1) ffc1789c: 89 2a 00 25 lbz r9,37(r10) ffc178a0: 89 ea 00 0d lbz r15,13(r10) ffc178a4: 91 21 00 68 stw r9,104(r1) ffc178a8: 89 2a 00 28 lbz r9,40(r10) ffc178ac: 8a ea 00 0e lbz r23,14(r10) ffc178b0: 91 21 00 74 stw r9,116(r1) ffc178b4: 89 2a 00 2c lbz r9,44(r10) ffc178b8: 8a ca 00 0f lbz r22,15(r10) ffc178bc: 91 21 00 80 stw r9,128(r1) ffc178c0: 89 2a 00 2d lbz r9,45(r10) ffc178c4: 8a 4a 00 10 lbz r18,16(r10) ffc178c8: 91 21 00 84 stw r9,132(r1) ffc178cc: 89 2a 00 2e lbz r9,46(r10) ffc178d0: 8b aa 00 11 lbz r29,17(r10) ffc178d4: 91 21 00 88 stw r9,136(r1) ffc178d8: 89 2a 00 2f lbz r9,47(r10) ffc178dc: 8b 8a 00 12 lbz r28,18(r10) ffc178e0: 8b 6a 00 13 lbz r27,19(r10) ffc178e4: 8b 4a 00 14 lbz r26,20(r10) ffc178e8: 8b 2a 00 16 lbz r25,22(r10) ffc178ec: 8b 0a 00 17 lbz r24,23(r10) ffc178f0: 89 ca 00 20 lbz r14,32(r10) ffc178f4: 8a 2a 00 22 lbz r17,34(r10) ffc178f8: 8a 0a 00 23 lbz r16,35(r10) ffc178fc: 8a 6a 00 26 lbz r19,38(r10) ffc17900: 8a aa 00 27 lbz r21,39(r10) ffc17904: 91 21 00 8c stw r9,140(r1) ffc17908: 89 2a 00 30 lbz r9,48(r10) ffc1790c: 89 4a 00 31 lbz r10,49(r10) ffc17910: 91 21 00 78 stw r9,120(r1) ffc17914: 91 41 00 7c stw r10,124(r1) sc = rtems_bdbuf_release( block); ffc17918: 4b ff cd 71 bl ffc14688 if (sc != RTEMS_SUCCESSFUL) ffc1791c: 2c 03 00 00 cmpwi r3,0 ffc17920: 40 82 06 14 bne- ffc17f34 <== NEVER TAKEN close(vol->fd); rtems_set_errno_and_return_minus_one( EIO ); } /* Evaluate boot record */ vol->bps = FAT_GET_BR_BYTES_PER_SECTOR(boot_rec); ffc17924: 57 de 40 2e rlwinm r30,r30,8,0,23 ffc17928: 7f df fb 78 or r31,r30,r31 ffc1792c: 7f ff 07 34 extsh r31,r31 ffc17930: 57 e4 04 3e clrlwi r4,r31,16 if ( (vol->bps != 512) && ffc17934: 2f 84 02 00 cmpwi cr7,r4,512 close(vol->fd); rtems_set_errno_and_return_minus_one( EIO ); } /* Evaluate boot record */ vol->bps = FAT_GET_BR_BYTES_PER_SECTOR(boot_rec); ffc17938: b0 94 00 00 sth r4,0(r20) if ( (vol->bps != 512) && ffc1793c: 41 9e 05 74 beq- cr7,ffc17eb0 <== ALWAYS TAKEN ffc17940: 2f 84 04 00 cmpwi cr7,r4,1024 <== NOT EXECUTED ffc17944: 41 9e 00 14 beq- cr7,ffc17958 <== NOT EXECUTED (vol->bps != 1024) && ffc17948: 2f 84 08 00 cmpwi cr7,r4,2048 <== NOT EXECUTED ffc1794c: 41 9e 00 0c beq- cr7,ffc17958 <== NOT EXECUTED (vol->bps != 2048) && ffc17950: 2f 84 10 00 cmpwi cr7,r4,4096 <== NOT EXECUTED ffc17954: 40 9e 05 90 bne- cr7,ffc17ee4 <== 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; ffc17958: 54 8a ba 7e rlwinm r10,r4,23,9,31 <== NOT EXECUTED ffc1795c: 39 00 00 01 li r8,1 <== NOT EXECUTED ffc17960: 48 00 00 08 b ffc17968 <== NOT EXECUTED ffc17964: 7c e8 3b 78 mr r8,r7 <== NOT EXECUTED i >>= 1, vol->sec_mul++); ffc17968: 7d 4a 0e 70 srawi r10,r10,1 <== 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; ffc1796c: 71 49 00 01 andi. r9,r10,1 <== NOT EXECUTED ffc17970: 38 e8 00 01 addi r7,r8,1 <== NOT EXECUTED ffc17974: 54 e7 06 3e clrlwi r7,r7,24 <== NOT EXECUTED ffc17978: 41 82 ff ec beq+ ffc17964 <== NOT EXECUTED ffc1797c: 99 14 00 03 stb r8,3(r20) <== NOT EXECUTED i >>= 1, vol->sec_mul++); for (vol->sec_log2 = 0, i = vol->bps; (i & 1) == 0; ffc17980: 73 e9 00 01 andi. r9,r31,1 ffc17984: 39 40 00 00 li r10,0 ffc17988: 99 54 00 02 stb r10,2(r20) ffc1798c: 40 82 05 98 bne- ffc17f24 <== NEVER TAKEN ffc17990: 7c 8a 23 78 mr r10,r4 ffc17994: 39 00 00 01 li r8,1 ffc17998: 48 00 00 08 b ffc179a0 ffc1799c: 7c e8 3b 78 mr r8,r7 i >>= 1, vol->sec_log2++); ffc179a0: 7d 4a 0e 70 srawi r10,r10,1 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; ffc179a4: 71 49 00 01 andi. r9,r10,1 ffc179a8: 38 e8 00 01 addi r7,r8,1 ffc179ac: 54 e7 06 3e clrlwi r7,r7,24 ffc179b0: 41 82 ff ec beq+ ffc1799c ffc179b4: 99 14 00 02 stb r8,2(r20) vol->spc = FAT_GET_BR_SECTORS_PER_CLUSTER(boot_rec); /* * "sectors per cluster" of zero is invalid * (and would hang the following loop) */ if (vol->spc == 0) ffc179b8: 2f 8f 00 00 cmpwi cr7,r15,0 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; i >>= 1, vol->sec_log2++); vol->bytes_per_block = vol->bps; ffc179bc: b0 94 00 0a sth r4,10(r20) vol->bytes_per_block_log2 = vol->sec_log2; vol->sectors_per_block = 1; ffc179c0: 39 40 00 01 li r10,1 i >>= 1, vol->sec_mul++); for (vol->sec_log2 = 0, i = vol->bps; (i & 1) == 0; i >>= 1, vol->sec_log2++); vol->bytes_per_block = vol->bps; vol->bytes_per_block_log2 = vol->sec_log2; ffc179c4: 99 14 00 0c stb r8,12(r20) vol->sectors_per_block = 1; ffc179c8: 99 54 00 09 stb r10,9(r20) vol->spc = FAT_GET_BR_SECTORS_PER_CLUSTER(boot_rec); ffc179cc: 99 f4 00 04 stb r15,4(r20) /* * "sectors per cluster" of zero is invalid * (and would hang the following loop) */ if (vol->spc == 0) ffc179d0: 41 9e 05 14 beq- cr7,ffc17ee4 <== NEVER TAKEN { close(vol->fd); rtems_set_errno_and_return_minus_one(EINVAL); } for (vol->spc_log2 = 0, i = vol->spc; (i & 1) == 0; ffc179d4: 71 e9 00 01 andi. r9,r15,1 ffc179d8: 39 40 00 00 li r10,0 ffc179dc: 99 54 00 05 stb r10,5(r20) ffc179e0: 7d ea 7b 78 mr r10,r15 ffc179e4: 40 82 05 48 bne- ffc17f2c ffc179e8: 38 e0 00 01 li r7,1 ffc179ec: 48 00 00 08 b ffc179f4 ffc179f0: 7c 67 1b 78 mr r7,r3 i >>= 1, vol->spc_log2++); ffc179f4: 7d 4a 0e 70 srawi r10,r10,1 { close(vol->fd); rtems_set_errno_and_return_minus_one(EINVAL); } for (vol->spc_log2 = 0, i = vol->spc; (i & 1) == 0; ffc179f8: 71 49 00 01 andi. r9,r10,1 ffc179fc: 38 67 00 01 addi r3,r7,1 ffc17a00: 54 63 06 3e clrlwi r3,r3,24 ffc17a04: 41 82 ff ec beq+ ffc179f0 ffc17a08: 98 f4 00 05 stb r7,5(r20) 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) ffc17a0c: 7c 8a 38 30 slw r10,r4,r7 ffc17a10: 55 47 04 3e clrlwi r7,r10,16 ffc17a14: 2b 87 80 00 cmplwi cr7,r7,32768 ffc17a18: b0 f4 00 06 sth r7,6(r20) ffc17a1c: 41 9d 04 c8 bgt- cr7,ffc17ee4 <== NEVER TAKEN { close(vol->fd); rtems_set_errno_and_return_minus_one(EINVAL); } for (vol->bpc_log2 = 0, i = vol->bpc; (i & 1) == 0; ffc17a20: 71 49 00 01 andi. r9,r10,1 ffc17a24: 38 e0 00 00 li r7,0 ffc17a28: 98 f4 00 08 stb r7,8(r20) ffc17a2c: 55 4a 04 3e clrlwi r10,r10,16 ffc17a30: 38 e0 00 01 li r7,1 ffc17a34: 41 a2 00 0c beq+ ffc17a40 <== ALWAYS TAKEN ffc17a38: 48 00 00 20 b ffc17a58 <== NOT EXECUTED ffc17a3c: 7c 67 1b 78 mr r7,r3 i >>= 1, vol->bpc_log2++); ffc17a40: 7d 4a 0e 70 srawi r10,r10,1 { close(vol->fd); rtems_set_errno_and_return_minus_one(EINVAL); } for (vol->bpc_log2 = 0, i = vol->bpc; (i & 1) == 0; ffc17a44: 71 49 00 01 andi. r9,r10,1 ffc17a48: 38 67 00 01 addi r3,r7,1 ffc17a4c: 54 63 06 3e clrlwi r3,r3,24 ffc17a50: 41 82 ff ec beq+ ffc17a3c ffc17a54: 98 f4 00 08 stb r7,8(r20) 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); vol->rdir_entrs = FAT_GET_BR_FILES_PER_ROOT_DIR(boot_rec); ffc17a58: 57 9c 40 2e rlwinm r28,r28,8,0,23 } 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); ffc17a5c: 9a 54 00 0d stb r18,13(r20) vol->fat_loc = FAT_GET_BR_RESERVED_SECTORS_NUM(boot_rec); vol->rdir_entrs = FAT_GET_BR_FILES_PER_ROOT_DIR(boot_rec); ffc17a60: 7f 9d eb 78 or r29,r28,r29 /* calculate the count of sectors occupied by the root directory */ vol->rdir_secs = ((vol->rdir_entrs * FAT_DIRENTRY_SIZE) + (vol->bps - 1)) / ffc17a64: 39 44 ff ff addi r10,r4,-1 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); vol->rdir_entrs = FAT_GET_BR_FILES_PER_ROOT_DIR(boot_rec); ffc17a68: b3 b4 00 24 sth r29,36(r20) /* calculate the count of sectors occupied by the root directory */ vol->rdir_secs = ((vol->rdir_entrs * FAT_DIRENTRY_SIZE) + (vol->bps - 1)) / ffc17a6c: 57 a7 28 34 rlwinm r7,r29,5,0,26 ffc17a70: 7d 47 52 14 add r10,r7,r10 ffc17a74: 7c 8a 23 d6 divw r4,r10,r4 vol->bps; vol->rdir_size = vol->rdir_secs << vol->sec_log2; if ( (FAT_GET_BR_SECTORS_PER_FAT(boot_rec)) != 0) ffc17a78: 57 18 40 2e rlwinm r24,r24,8,0,23 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)) / ffc17a7c: 90 94 00 28 stw r4,40(r20) vol->bps; vol->rdir_size = vol->rdir_secs << vol->sec_log2; if ( (FAT_GET_BR_SECTORS_PER_FAT(boot_rec)) != 0) ffc17a80: 7f 19 cb 78 or r25,r24,r25 ffc17a84: 7f 38 07 35 extsh. r24,r25 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); ffc17a88: 56 d6 40 2e rlwinm r22,r22,8,0,23 ffc17a8c: 7e d7 bb 78 or r23,r22,r23 /* calculate the count of sectors occupied by the root directory */ vol->rdir_secs = ((vol->rdir_entrs * FAT_DIRENTRY_SIZE) + (vol->bps - 1)) / vol->bps; vol->rdir_size = vol->rdir_secs << vol->sec_log2; ffc17a90: 7c 88 40 30 slw r8,r4,r8 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); ffc17a94: b2 f4 00 18 sth r23,24(r20) /* calculate the count of sectors occupied by the root directory */ vol->rdir_secs = ((vol->rdir_entrs * FAT_DIRENTRY_SIZE) + (vol->bps - 1)) / vol->bps; vol->rdir_size = vol->rdir_secs << vol->sec_log2; ffc17a98: 91 14 00 2c stw r8,44(r20) if ( (FAT_GET_BR_SECTORS_PER_FAT(boot_rec)) != 0) ffc17a9c: 40 82 01 f0 bne- ffc17c8c vol->fat_length = FAT_GET_BR_SECTORS_PER_FAT(boot_rec); else vol->fat_length = FAT_GET_BR_SECTORS_PER_FAT32(boot_rec); ffc17aa0: 81 21 00 68 lwz r9,104(r1) ffc17aa4: 56 73 80 1e rlwinm r19,r19,16,0,15 vol->rdir_secs; /* for FAT12/16 root dir starts at(sector) */ vol->rdir_loc = vol->fat_loc + vol->fats * vol->fat_length; if ( (FAT_GET_BR_TOTAL_SECTORS_NUM16(boot_rec)) != 0) ffc17aa8: 57 5a 40 2e rlwinm r26,r26,8,0,23 vol->rdir_size = vol->rdir_secs << vol->sec_log2; if ( (FAT_GET_BR_SECTORS_PER_FAT(boot_rec)) != 0) vol->fat_length = FAT_GET_BR_SECTORS_PER_FAT(boot_rec); else vol->fat_length = FAT_GET_BR_SECTORS_PER_FAT32(boot_rec); ffc17aac: 55 39 40 2e rlwinm r25,r9,8,0,23 ffc17ab0: 81 21 00 70 lwz r9,112(r1) ffc17ab4: 7f 39 9b 78 or r25,r25,r19 ffc17ab8: 7f 39 4b 78 or r25,r25,r9 ffc17abc: 56 b5 c0 0e rlwinm r21,r21,24,0,7 ffc17ac0: 7f 39 ab 78 or r25,r25,r21 vol->rdir_secs; /* for FAT12/16 root dir starts at(sector) */ vol->rdir_loc = vol->fat_loc + vol->fats * vol->fat_length; if ( (FAT_GET_BR_TOTAL_SECTORS_NUM16(boot_rec)) != 0) ffc17ac4: 7f 5b db 78 or r27,r26,r27 vol->rdir_size = vol->rdir_secs << vol->sec_log2; if ( (FAT_GET_BR_SECTORS_PER_FAT(boot_rec)) != 0) vol->fat_length = FAT_GET_BR_SECTORS_PER_FAT(boot_rec); else vol->fat_length = FAT_GET_BR_SECTORS_PER_FAT32(boot_rec); ffc17ac8: 93 34 00 1c stw r25,28(r20) vol->data_fsec = vol->fat_loc + vol->fats * vol->fat_length + ffc17acc: 7c b9 91 d6 mullw r5,r25,r18 vol->rdir_secs; /* for FAT12/16 root dir starts at(sector) */ vol->rdir_loc = vol->fat_loc + vol->fats * vol->fat_length; if ( (FAT_GET_BR_TOTAL_SECTORS_NUM16(boot_rec)) != 0) ffc17ad0: 7f 7a 07 35 extsh. r26,r27 if ( (FAT_GET_BR_SECTORS_PER_FAT(boot_rec)) != 0) vol->fat_length = FAT_GET_BR_SECTORS_PER_FAT(boot_rec); else vol->fat_length = FAT_GET_BR_SECTORS_PER_FAT32(boot_rec); vol->data_fsec = vol->fat_loc + vol->fats * vol->fat_length + ffc17ad4: 7c a5 ba 14 add r5,r5,r23 ffc17ad8: 7c 85 22 14 add r4,r5,r4 vol->rdir_secs; /* for FAT12/16 root dir starts at(sector) */ vol->rdir_loc = vol->fat_loc + vol->fats * vol->fat_length; ffc17adc: 90 b4 00 20 stw r5,32(r20) if ( (FAT_GET_BR_SECTORS_PER_FAT(boot_rec)) != 0) vol->fat_length = FAT_GET_BR_SECTORS_PER_FAT(boot_rec); else vol->fat_length = FAT_GET_BR_SECTORS_PER_FAT32(boot_rec); vol->data_fsec = vol->fat_loc + vol->fats * vol->fat_length + ffc17ae0: 90 94 00 34 stw r4,52(r20) vol->rdir_secs; /* for FAT12/16 root dir starts at(sector) */ vol->rdir_loc = vol->fat_loc + vol->fats * vol->fat_length; if ( (FAT_GET_BR_TOTAL_SECTORS_NUM16(boot_rec)) != 0) ffc17ae4: 41 82 01 d4 beq- ffc17cb8 <== ALWAYS TAKEN vol->tot_secs = FAT_GET_BR_TOTAL_SECTORS_NUM16(boot_rec); ffc17ae8: 57 5b 04 3e clrlwi r27,r26,16 else vol->tot_secs = FAT_GET_BR_TOTAL_SECTORS_NUM32(boot_rec); data_secs = vol->tot_secs - vol->data_fsec; ffc17aec: 7c 84 d8 50 subf r4,r4,r27 /* for FAT12/16 root dir starts at(sector) */ vol->rdir_loc = vol->fat_loc + vol->fats * vol->fat_length; if ( (FAT_GET_BR_TOTAL_SECTORS_NUM16(boot_rec)) != 0) vol->tot_secs = FAT_GET_BR_TOTAL_SECTORS_NUM16(boot_rec); ffc17af0: 93 74 00 30 stw r27,48(r20) else vol->tot_secs = FAT_GET_BR_TOTAL_SECTORS_NUM32(boot_rec); data_secs = vol->tot_secs - vol->data_fsec; vol->data_cls = data_secs / vol->spc; ffc17af4: 7c c4 7b 96 divwu r6,r4,r15 /* determine FAT type at least */ if ( vol->data_cls < FAT_FAT12_MAX_CLN) ffc17af8: 2b 86 0f f4 cmplwi cr7,r6,4084 else vol->tot_secs = FAT_GET_BR_TOTAL_SECTORS_NUM32(boot_rec); data_secs = vol->tot_secs - vol->data_fsec; vol->data_cls = data_secs / vol->spc; ffc17afc: 90 d4 00 38 stw r6,56(r20) /* determine FAT type at least */ if ( vol->data_cls < FAT_FAT12_MAX_CLN) ffc17b00: 41 9d 01 ec bgt- cr7,ffc17cec { vol->type = FAT_FAT12; ffc17b04: 39 40 00 01 li r10,1 ffc17b08: 99 54 00 0e stb r10,14(r20) vol->mask = FAT_FAT12_MASK; ffc17b0c: 39 40 0f ff li r10,4095 ffc17b10: 91 54 00 10 stw r10,16(r20) vol->eoc_val = FAT_FAT12_EOC; ffc17b14: 39 40 0f f8 li r10,4088 ffc17b18: 91 54 00 14 stw r10,20(r20) } } } else { vol->rdir_cl = 0; ffc17b1c: 39 40 00 00 li r10,0 vol->mirror = 0; vol->afat = 0; vol->free_cls = FAT_UNDEFINED_VALUE; ffc17b20: 39 00 ff ff li r8,-1 } } } else { vol->rdir_cl = 0; ffc17b24: 91 54 00 3c stw r10,60(r20) vol->mirror = 0; ffc17b28: 99 54 00 54 stb r10,84(r20) vol->afat = 0; ffc17b2c: 99 54 00 5c stb r10,92(r20) vol->free_cls = FAT_UNDEFINED_VALUE; ffc17b30: 91 14 00 44 stw r8,68(r20) vol->next_cl = FAT_UNDEFINED_VALUE; ffc17b34: 91 14 00 4c stw r8,76(r20) * 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); ffc17b38: 7e 83 a3 78 mr r3,r20 ffc17b3c: 4b ff f3 85 bl ffc16ec0 vol->next_cl = FAT_UNDEFINED_VALUE; } _fat_block_release(fs_info); vol->afat_loc = vol->fat_loc + vol->fat_length * vol->afat; ffc17b40: 88 f4 00 5c lbz r7,92(r20) ffc17b44: 81 54 00 1c lwz r10,28(r20) /* set up collection of fat-files fd */ fs_info->vhash = calloc(FAT_HASH_SIZE, sizeof(rtems_chain_control)); ffc17b48: 38 60 00 02 li r3,2 vol->next_cl = FAT_UNDEFINED_VALUE; } _fat_block_release(fs_info); vol->afat_loc = vol->fat_loc + vol->fat_length * vol->afat; ffc17b4c: a1 14 00 18 lhz r8,24(r20) /* set up collection of fat-files fd */ fs_info->vhash = calloc(FAT_HASH_SIZE, sizeof(rtems_chain_control)); ffc17b50: 38 80 00 0c li r4,12 vol->next_cl = FAT_UNDEFINED_VALUE; } _fat_block_release(fs_info); vol->afat_loc = vol->fat_loc + vol->fat_length * vol->afat; ffc17b54: 7d 47 51 d6 mullw r10,r7,r10 ffc17b58: 7d 4a 42 14 add r10,r10,r8 ffc17b5c: 91 54 00 58 stw r10,88(r20) /* set up collection of fat-files fd */ fs_info->vhash = calloc(FAT_HASH_SIZE, sizeof(rtems_chain_control)); ffc17b60: 4b fe ea a1 bl ffc06600 if ( fs_info->vhash == NULL ) ffc17b64: 2f 83 00 00 cmpwi cr7,r3,0 _fat_block_release(fs_info); vol->afat_loc = vol->fat_loc + vol->fat_length * vol->afat; /* set up collection of fat-files fd */ fs_info->vhash = calloc(FAT_HASH_SIZE, sizeof(rtems_chain_control)); ffc17b68: 90 74 00 6c stw r3,108(r20) ffc17b6c: 7c 6a 1b 78 mr r10,r3 if ( fs_info->vhash == NULL ) ffc17b70: 41 9e 04 0c beq- cr7,ffc17f7c <== NEVER TAKEN 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 ); ffc17b74: 38 c3 00 04 addi r6,r3,4 head->next = tail; head->previous = NULL; tail->previous = head; ffc17b78: 91 4a 00 08 stw r10,8(r10) 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 ); ffc17b7c: 39 03 00 0c addi r8,r3,12 ffc17b80: 38 e3 00 10 addi r7,r3,16 head->next = tail; ffc17b84: 90 ca 00 00 stw r6,0(r10) head->previous = NULL; ffc17b88: 3b e0 00 00 li r31,0 ffc17b8c: 93 ea 00 04 stw r31,4(r10) } 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)); ffc17b90: 38 60 00 02 li r3,2 ffc17b94: 38 80 00 0c li r4,12 ) { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); head->next = tail; ffc17b98: 90 ea 00 0c stw r7,12(r10) head->previous = NULL; ffc17b9c: 93 ea 00 10 stw r31,16(r10) tail->previous = head; ffc17ba0: 91 0a 00 14 stw r8,20(r10) ffc17ba4: 4b fe ea 5d bl ffc06600 if ( fs_info->rhash == NULL ) ffc17ba8: 2f 83 00 00 cmpwi cr7,r3,0 } 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)); ffc17bac: 90 74 00 70 stw r3,112(r20) ffc17bb0: 7c 6a 1b 78 mr r10,r3 if ( fs_info->rhash == NULL ) ffc17bb4: 41 9e 03 fc beq- cr7,ffc17fb0 <== NEVER TAKEN } 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; ffc17bb8: 88 f4 00 03 lbz r7,3(r20) 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 ); ffc17bbc: 38 c3 00 04 addi r6,r3,4 ffc17bc0: 81 14 00 30 lwz r8,48(r20) fs_info->index = 0; fs_info->uino = (char *)calloc(fs_info->uino_pool_size, sizeof(char)); ffc17bc4: 38 80 00 01 li r4,1 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; fs_info->index = 0; ffc17bc8: 93 f4 00 78 stw r31,120(r20) } 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; ffc17bcc: 7d 08 38 30 slw r8,r8,r7 ffc17bd0: 55 08 20 36 rlwinm r8,r8,4,0,27 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; ffc17bd4: 38 e0 01 00 li r7,256 fs_info->uino_base = (vol->tot_secs << vol->sec_mul) << 4; ffc17bd8: 91 14 00 80 stw r8,128(r20) ffc17bdc: 39 03 00 0c addi r8,r3,12 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; ffc17be0: 90 f4 00 7c stw r7,124(r20) ffc17be4: 38 e3 00 10 addi r7,r3,16 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)); ffc17be8: 38 60 01 00 li r3,256 head->next = tail; ffc17bec: 90 ca 00 00 stw r6,0(r10) head->previous = NULL; ffc17bf0: 93 ea 00 04 stw r31,4(r10) tail->previous = head; ffc17bf4: 91 4a 00 08 stw r10,8(r10) ) { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); head->next = tail; ffc17bf8: 90 ea 00 0c stw r7,12(r10) head->previous = NULL; ffc17bfc: 93 ea 00 10 stw r31,16(r10) tail->previous = head; ffc17c00: 91 0a 00 14 stw r8,20(r10) ffc17c04: 4b fe e9 fd bl ffc06600 if ( fs_info->uino == NULL ) ffc17c08: 2f 83 00 00 cmpwi cr7,r3,0 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; fs_info->index = 0; fs_info->uino = (char *)calloc(fs_info->uino_pool_size, sizeof(char)); ffc17c0c: 90 74 00 74 stw r3,116(r20) if ( fs_info->uino == NULL ) ffc17c10: 41 9e 03 40 beq- cr7,ffc17f50 <== NEVER TAKEN close(vol->fd); free(fs_info->vhash); free(fs_info->rhash); rtems_set_errno_and_return_minus_one( ENOMEM ); } fs_info->sec_buf = (uint8_t *)calloc(vol->bps, sizeof(uint8_t)); ffc17c14: a0 74 00 00 lhz r3,0(r20) ffc17c18: 38 80 00 01 li r4,1 ffc17c1c: 4b fe e9 e5 bl ffc06600 if (fs_info->sec_buf == NULL) ffc17c20: 2f 83 00 00 cmpwi cr7,r3,0 close(vol->fd); free(fs_info->vhash); free(fs_info->rhash); rtems_set_errno_and_return_minus_one( ENOMEM ); } fs_info->sec_buf = (uint8_t *)calloc(vol->bps, sizeof(uint8_t)); ffc17c24: 90 74 00 90 stw r3,144(r20) if (fs_info->sec_buf == NULL) ffc17c28: 41 9e 03 98 beq- cr7,ffc17fc0 <== NEVER TAKEN return bytes_written; } static bool is_cluster_aligned(const fat_vol_t *vol, uint32_t sec_num) { return (sec_num & (vol->spc - 1)) == 0; ffc17c2c: 89 54 00 04 lbz r10,4(r20) ffc17c30: 81 14 00 34 lwz r8,52(r20) ffc17c34: 39 4a ff ff addi r10,r10,-1 /* * 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) ffc17c38: 7d 49 40 39 and. r9,r10,r8 ffc17c3c: 40 82 02 18 bne- ffc17e54 <== NEVER TAKEN && (FAT_FAT32 == vol->type || is_cluster_aligned(vol, vol->rdir_loc))) ffc17c40: 89 14 00 0e lbz r8,14(r20) ffc17c44: 2f 88 00 04 cmpwi cr7,r8,4 ffc17c48: 41 9e 00 10 beq- cr7,ffc17c58 return bytes_written; } static bool is_cluster_aligned(const fat_vol_t *vol, uint32_t sec_num) { return (sec_num & (vol->spc - 1)) == 0; ffc17c4c: 81 14 00 20 lwz r8,32(r20) * 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))) ffc17c50: 7d 49 40 39 and. r9,r10,r8 ffc17c54: 40 82 02 00 bne- ffc17e54 <== NEVER TAKEN { sc = rtems_bdbuf_set_block_size (vol->dd, vol->bpc, true); ffc17c58: 80 74 00 64 lwz r3,100(r20) ffc17c5c: 38 a0 00 01 li r5,1 ffc17c60: a0 94 00 06 lhz r4,6(r20) ffc17c64: 4b ff cf c5 bl ffc14c28 if (sc == RTEMS_SUCCESSFUL) ffc17c68: 2f 83 00 00 cmpwi cr7,r3,0 ffc17c6c: 40 9e 01 e8 bne- cr7,ffc17e54 <== NEVER TAKEN { vol->bytes_per_block = vol->bpc; ffc17c70: a0 f4 00 06 lhz r7,6(r20) vol->bytes_per_block_log2 = vol->bpc_log2; ffc17c74: 89 14 00 08 lbz r8,8(r20) vol->sectors_per_block = vol->spc; ffc17c78: 89 54 00 04 lbz r10,4(r20) && (FAT_FAT32 == vol->type || is_cluster_aligned(vol, vol->rdir_loc))) { sc = rtems_bdbuf_set_block_size (vol->dd, vol->bpc, true); if (sc == RTEMS_SUCCESSFUL) { vol->bytes_per_block = vol->bpc; ffc17c7c: b0 f4 00 0a sth r7,10(r20) vol->bytes_per_block_log2 = vol->bpc_log2; ffc17c80: 99 14 00 0c stb r8,12(r20) vol->sectors_per_block = vol->spc; ffc17c84: 99 54 00 09 stb r10,9(r20) ffc17c88: 48 00 01 d0 b ffc17e58 vol->rdir_secs; /* for FAT12/16 root dir starts at(sector) */ vol->rdir_loc = vol->fat_loc + vol->fats * vol->fat_length; if ( (FAT_GET_BR_TOTAL_SECTORS_NUM16(boot_rec)) != 0) ffc17c8c: 57 5a 40 2e rlwinm r26,r26,8,0,23 vol->bps; vol->rdir_size = vol->rdir_secs << vol->sec_log2; if ( (FAT_GET_BR_SECTORS_PER_FAT(boot_rec)) != 0) vol->fat_length = FAT_GET_BR_SECTORS_PER_FAT(boot_rec); ffc17c90: 57 19 04 3e clrlwi r25,r24,16 vol->rdir_secs; /* for FAT12/16 root dir starts at(sector) */ vol->rdir_loc = vol->fat_loc + vol->fats * vol->fat_length; if ( (FAT_GET_BR_TOTAL_SECTORS_NUM16(boot_rec)) != 0) ffc17c94: 7f 5b db 78 or r27,r26,r27 vol->bps; vol->rdir_size = vol->rdir_secs << vol->sec_log2; if ( (FAT_GET_BR_SECTORS_PER_FAT(boot_rec)) != 0) vol->fat_length = FAT_GET_BR_SECTORS_PER_FAT(boot_rec); ffc17c98: 93 34 00 1c stw r25,28(r20) else vol->fat_length = FAT_GET_BR_SECTORS_PER_FAT32(boot_rec); vol->data_fsec = vol->fat_loc + vol->fats * vol->fat_length + ffc17c9c: 7c b9 91 d6 mullw r5,r25,r18 vol->rdir_secs; /* for FAT12/16 root dir starts at(sector) */ vol->rdir_loc = vol->fat_loc + vol->fats * vol->fat_length; if ( (FAT_GET_BR_TOTAL_SECTORS_NUM16(boot_rec)) != 0) ffc17ca0: 7f 7a 07 35 extsh. r26,r27 if ( (FAT_GET_BR_SECTORS_PER_FAT(boot_rec)) != 0) vol->fat_length = FAT_GET_BR_SECTORS_PER_FAT(boot_rec); else vol->fat_length = FAT_GET_BR_SECTORS_PER_FAT32(boot_rec); vol->data_fsec = vol->fat_loc + vol->fats * vol->fat_length + ffc17ca4: 7c a5 ba 14 add r5,r5,r23 ffc17ca8: 7c 85 22 14 add r4,r5,r4 vol->rdir_secs; /* for FAT12/16 root dir starts at(sector) */ vol->rdir_loc = vol->fat_loc + vol->fats * vol->fat_length; ffc17cac: 90 b4 00 20 stw r5,32(r20) if ( (FAT_GET_BR_SECTORS_PER_FAT(boot_rec)) != 0) vol->fat_length = FAT_GET_BR_SECTORS_PER_FAT(boot_rec); else vol->fat_length = FAT_GET_BR_SECTORS_PER_FAT32(boot_rec); vol->data_fsec = vol->fat_loc + vol->fats * vol->fat_length + ffc17cb0: 90 94 00 34 stw r4,52(r20) vol->rdir_secs; /* for FAT12/16 root dir starts at(sector) */ vol->rdir_loc = vol->fat_loc + vol->fats * vol->fat_length; if ( (FAT_GET_BR_TOTAL_SECTORS_NUM16(boot_rec)) != 0) ffc17cb4: 40 a2 fe 34 bne- ffc17ae8 vol->tot_secs = FAT_GET_BR_TOTAL_SECTORS_NUM16(boot_rec); else vol->tot_secs = FAT_GET_BR_TOTAL_SECTORS_NUM32(boot_rec); ffc17cb8: 81 21 00 6c lwz r9,108(r1) ffc17cbc: 56 31 80 1e rlwinm r17,r17,16,0,15 ffc17cc0: 56 10 c0 0e rlwinm r16,r16,24,0,7 ffc17cc4: 55 3b 40 2e rlwinm r27,r9,8,0,23 ffc17cc8: 7f 7b 8b 78 or r27,r27,r17 ffc17ccc: 7f 7b 73 78 or r27,r27,r14 ffc17cd0: 7f 7b 83 78 or r27,r27,r16 data_secs = vol->tot_secs - vol->data_fsec; ffc17cd4: 7c 84 d8 50 subf r4,r4,r27 vol->rdir_loc = vol->fat_loc + vol->fats * vol->fat_length; if ( (FAT_GET_BR_TOTAL_SECTORS_NUM16(boot_rec)) != 0) vol->tot_secs = FAT_GET_BR_TOTAL_SECTORS_NUM16(boot_rec); else vol->tot_secs = FAT_GET_BR_TOTAL_SECTORS_NUM32(boot_rec); ffc17cd8: 93 74 00 30 stw r27,48(r20) data_secs = vol->tot_secs - vol->data_fsec; vol->data_cls = data_secs / vol->spc; ffc17cdc: 7c c4 7b 96 divwu r6,r4,r15 /* determine FAT type at least */ if ( vol->data_cls < FAT_FAT12_MAX_CLN) ffc17ce0: 2b 86 0f f4 cmplwi cr7,r6,4084 else vol->tot_secs = FAT_GET_BR_TOTAL_SECTORS_NUM32(boot_rec); data_secs = vol->tot_secs - vol->data_fsec; vol->data_cls = data_secs / vol->spc; ffc17ce4: 90 d4 00 38 stw r6,56(r20) /* determine FAT type at least */ if ( vol->data_cls < FAT_FAT12_MAX_CLN) ffc17ce8: 40 bd fe 1c ble- cr7,ffc17b04 vol->mask = FAT_FAT12_MASK; vol->eoc_val = FAT_FAT12_EOC; } else { if ( vol->data_cls < FAT_FAT16_MAX_CLN) ffc17cec: 2b 86 ff f4 cmplwi cr7,r6,65524 ffc17cf0: 40 9d 01 c8 ble- cr7,ffc17eb8 if (vol->type == FAT_FAT32) { vol->rdir_cl = FAT_GET_BR_FAT32_ROOT_CLUSTER(boot_rec); vol->mirror = FAT_GET_BR_EXT_FLAGS(boot_rec) & FAT_BR_EXT_FLAGS_MIRROR; ffc17cf4: 81 21 00 74 lwz r9,116(r1) ffc17cf8: 55 2a 00 30 rlwinm r10,r9,0,0,24 } } if (vol->type == FAT_FAT32) { vol->rdir_cl = FAT_GET_BR_FAT32_ROOT_CLUSTER(boot_rec); ffc17cfc: 81 21 00 84 lwz r9,132(r1) vol->mirror = FAT_GET_BR_EXT_FLAGS(boot_rec) & FAT_BR_EXT_FLAGS_MIRROR; ffc17d00: 55 4a 06 3e clrlwi r10,r10,24 } } if (vol->type == FAT_FAT32) { vol->rdir_cl = FAT_GET_BR_FAT32_ROOT_CLUSTER(boot_rec); ffc17d04: 55 27 40 2e rlwinm r7,r9,8,0,23 ffc17d08: 81 21 00 88 lwz r9,136(r1) vol->mirror = FAT_GET_BR_EXT_FLAGS(boot_rec) & FAT_BR_EXT_FLAGS_MIRROR; if (vol->mirror) ffc17d0c: 2f 8a 00 00 cmpwi cr7,r10,0 if (vol->type == FAT_FAT32) { vol->rdir_cl = FAT_GET_BR_FAT32_ROOT_CLUSTER(boot_rec); vol->mirror = FAT_GET_BR_EXT_FLAGS(boot_rec) & FAT_BR_EXT_FLAGS_MIRROR; ffc17d10: 99 54 00 54 stb r10,84(r20) } } if (vol->type == FAT_FAT32) { vol->rdir_cl = FAT_GET_BR_FAT32_ROOT_CLUSTER(boot_rec); ffc17d14: 55 28 80 1e rlwinm r8,r9,16,0,15 ffc17d18: 81 21 00 80 lwz r9,128(r1) ffc17d1c: 7c e7 43 78 or r7,r7,r8 ffc17d20: 7c e7 4b 78 or r7,r7,r9 ffc17d24: 81 21 00 8c lwz r9,140(r1) ffc17d28: 55 28 c0 0e rlwinm r8,r9,24,0,7 ffc17d2c: 7c e8 43 78 or r8,r7,r8 vol->mask = FAT_FAT16_MASK; vol->eoc_val = FAT_FAT16_EOC; } else { vol->type = FAT_FAT32; ffc17d30: 38 e0 00 04 li r7,4 } } if (vol->type == FAT_FAT32) { vol->rdir_cl = FAT_GET_BR_FAT32_ROOT_CLUSTER(boot_rec); ffc17d34: 91 14 00 3c stw r8,60(r20) vol->mask = FAT_FAT16_MASK; vol->eoc_val = FAT_FAT16_EOC; } else { vol->type = FAT_FAT32; ffc17d38: 98 f4 00 0e stb r7,14(r20) vol->mask = FAT_FAT32_MASK; ffc17d3c: 3c e0 0f ff lis r7,4095 ffc17d40: 60 e7 ff ff ori r7,r7,65535 ffc17d44: 90 f4 00 10 stw r7,16(r20) vol->eoc_val = FAT_FAT32_EOC; ffc17d48: 3c e0 0f ff lis r7,4095 ffc17d4c: 60 e7 ff f8 ori r7,r7,65528 ffc17d50: 90 f4 00 14 stw r7,20(r20) if (vol->type == FAT_FAT32) { vol->rdir_cl = FAT_GET_BR_FAT32_ROOT_CLUSTER(boot_rec); vol->mirror = FAT_GET_BR_EXT_FLAGS(boot_rec) & FAT_BR_EXT_FLAGS_MIRROR; if (vol->mirror) ffc17d54: 41 9e 01 c8 beq- cr7,ffc17f1c <== ALWAYS TAKEN vol->afat = FAT_GET_BR_EXT_FLAGS(boot_rec) & FAT_BR_EXT_FLAGS_FAT_NUM; ffc17d58: 81 21 00 74 lwz r9,116(r1) <== NOT EXECUTED ffc17d5c: 55 2a 07 3e clrlwi r10,r9,28 <== NOT EXECUTED ffc17d60: 99 54 00 5c stb r10,92(r20) <== NOT EXECUTED else vol->afat = 0; vol->info_sec = FAT_GET_BR_FAT32_FS_INFO_SECTOR(boot_rec); ffc17d64: 81 21 00 7c lwz r9,124(r1) ffc17d68: 55 24 40 2e rlwinm r4,r9,8,0,23 ffc17d6c: 81 21 00 78 lwz r9,120(r1) ffc17d70: 7c 84 4b 78 or r4,r4,r9 if( vol->info_sec == 0 ) ffc17d74: 2f 84 00 00 cmpwi cr7,r4,0 if (vol->mirror) vol->afat = FAT_GET_BR_EXT_FLAGS(boot_rec) & FAT_BR_EXT_FLAGS_FAT_NUM; else vol->afat = 0; vol->info_sec = FAT_GET_BR_FAT32_FS_INFO_SECTOR(boot_rec); ffc17d78: b0 94 00 40 sth r4,64(r20) if( vol->info_sec == 0 ) ffc17d7c: 41 9e 01 68 beq- cr7,ffc17ee4 <== NEVER TAKEN close(vol->fd); rtems_set_errno_and_return_minus_one( EINVAL ); } else { ret = _fat_block_read(fs_info, vol->info_sec , 0, ffc17d80: 7e 83 a3 78 mr r3,r20 ffc17d84: 38 a0 00 00 li r5,0 ffc17d88: 38 c0 00 04 li r6,4 ffc17d8c: 38 e1 00 50 addi r7,r1,80 ffc17d90: 4b ff f4 0d bl ffc1719c <_fat_block_read> FAT_FSI_LEADSIG_SIZE, fs_info_sector); if ( ret < 0 ) ffc17d94: 2f 83 00 00 cmpwi cr7,r3,0 ffc17d98: 41 9c 02 08 blt- cr7,ffc17fa0 <== NEVER TAKEN { close(vol->fd); return -1; } if (FAT_GET_FSINFO_LEAD_SIGNATURE(fs_info_sector) != ffc17d9c: 88 c1 00 51 lbz r6,81(r1) ffc17da0: 89 01 00 52 lbz r8,82(r1) ffc17da4: 54 c6 40 2e rlwinm r6,r6,8,0,23 ffc17da8: 88 e1 00 50 lbz r7,80(r1) ffc17dac: 55 08 80 1e rlwinm r8,r8,16,0,15 ffc17db0: 89 41 00 53 lbz r10,83(r1) ffc17db4: 7c c8 43 78 or r8,r6,r8 ffc17db8: 55 4a c0 0e rlwinm r10,r10,24,0,7 ffc17dbc: 7d 08 3b 78 or r8,r8,r7 ffc17dc0: 7d 08 53 78 or r8,r8,r10 ffc17dc4: 6d 0a 41 61 xoris r10,r8,16737 ffc17dc8: 2f 8a 52 52 cmpwi cr7,r10,21074 ffc17dcc: 40 9e 01 10 bne- cr7,ffc17edc <== NEVER TAKEN close(vol->fd); rtems_set_errno_and_return_minus_one( EINVAL ); } else { ret = _fat_block_read(fs_info, vol->info_sec , FAT_FSI_INFO, ffc17dd0: a0 94 00 40 lhz r4,64(r20) ffc17dd4: 7e 83 a3 78 mr r3,r20 ffc17dd8: 38 a0 01 e4 li r5,484 ffc17ddc: 38 c0 00 0c li r6,12 ffc17de0: 38 e1 00 50 addi r7,r1,80 ffc17de4: 4b ff f3 b9 bl ffc1719c <_fat_block_read> FAT_USEFUL_INFO_SIZE, fs_info_sector); if ( ret < 0 ) ffc17de8: 2f 83 00 00 cmpwi cr7,r3,0 ffc17dec: 41 9c 01 ac blt- cr7,ffc17f98 <== NEVER TAKEN close(vol->fd); return -1; } vol->free_cls_in_fs_info = FAT_GET_FSINFO_FREE_CLUSTER_COUNT(fs_info_sector); ffc17df0: 89 61 00 55 lbz r11,85(r1) ffc17df4: 88 c1 00 56 lbz r6,86(r1) vol->free_cls = vol->free_cls_in_fs_info; vol->next_cl_in_fs_info = FAT_GET_FSINFO_NEXT_FREE_CLUSTER(fs_info_sector); ffc17df8: 88 61 00 59 lbz r3,89(r1) close(vol->fd); return -1; } vol->free_cls_in_fs_info = FAT_GET_FSINFO_FREE_CLUSTER_COUNT(fs_info_sector); ffc17dfc: 55 6b 40 2e rlwinm r11,r11,8,0,23 vol->free_cls = vol->free_cls_in_fs_info; vol->next_cl_in_fs_info = FAT_GET_FSINFO_NEXT_FREE_CLUSTER(fs_info_sector); ffc17e00: 88 e1 00 5a lbz r7,90(r1) close(vol->fd); return -1; } vol->free_cls_in_fs_info = FAT_GET_FSINFO_FREE_CLUSTER_COUNT(fs_info_sector); ffc17e04: 54 c6 80 1e rlwinm r6,r6,16,0,15 ffc17e08: 88 81 00 54 lbz r4,84(r1) vol->free_cls = vol->free_cls_in_fs_info; vol->next_cl_in_fs_info = FAT_GET_FSINFO_NEXT_FREE_CLUSTER(fs_info_sector); ffc17e0c: 54 63 40 2e rlwinm r3,r3,8,0,23 close(vol->fd); return -1; } vol->free_cls_in_fs_info = FAT_GET_FSINFO_FREE_CLUSTER_COUNT(fs_info_sector); ffc17e10: 89 01 00 57 lbz r8,87(r1) vol->free_cls = vol->free_cls_in_fs_info; vol->next_cl_in_fs_info = FAT_GET_FSINFO_NEXT_FREE_CLUSTER(fs_info_sector); ffc17e14: 54 e7 80 1e rlwinm r7,r7,16,0,15 ffc17e18: 88 a1 00 58 lbz r5,88(r1) close(vol->fd); return -1; } vol->free_cls_in_fs_info = FAT_GET_FSINFO_FREE_CLUSTER_COUNT(fs_info_sector); ffc17e1c: 7d 66 33 78 or r6,r11,r6 vol->free_cls = vol->free_cls_in_fs_info; vol->next_cl_in_fs_info = FAT_GET_FSINFO_NEXT_FREE_CLUSTER(fs_info_sector); ffc17e20: 89 41 00 5b lbz r10,91(r1) ffc17e24: 7c 67 3b 78 or r7,r3,r7 close(vol->fd); return -1; } vol->free_cls_in_fs_info = FAT_GET_FSINFO_FREE_CLUSTER_COUNT(fs_info_sector); ffc17e28: 7c c6 23 78 or r6,r6,r4 ffc17e2c: 55 08 c0 0e rlwinm r8,r8,24,0,7 vol->free_cls = vol->free_cls_in_fs_info; vol->next_cl_in_fs_info = FAT_GET_FSINFO_NEXT_FREE_CLUSTER(fs_info_sector); ffc17e30: 7c e7 2b 78 or r7,r7,r5 ffc17e34: 55 4a c0 0e rlwinm r10,r10,24,0,7 close(vol->fd); return -1; } vol->free_cls_in_fs_info = FAT_GET_FSINFO_FREE_CLUSTER_COUNT(fs_info_sector); ffc17e38: 7c c8 43 78 or r8,r6,r8 vol->free_cls = vol->free_cls_in_fs_info; vol->next_cl_in_fs_info = FAT_GET_FSINFO_NEXT_FREE_CLUSTER(fs_info_sector); ffc17e3c: 7c ea 53 78 or r10,r7,r10 _fat_block_release(fs_info); close(vol->fd); return -1; } vol->free_cls_in_fs_info = ffc17e40: 91 14 00 48 stw r8,72(r20) FAT_GET_FSINFO_FREE_CLUSTER_COUNT(fs_info_sector); vol->free_cls = vol->free_cls_in_fs_info; ffc17e44: 91 14 00 44 stw r8,68(r20) vol->next_cl_in_fs_info = ffc17e48: 91 54 00 50 stw r10,80(r20) FAT_GET_FSINFO_NEXT_FREE_CLUSTER(fs_info_sector); vol->next_cl = vol->next_cl_in_fs_info; ffc17e4c: 91 54 00 4c stw r10,76(r20) ffc17e50: 4b ff fc e8 b ffc17b38 vol->bytes_per_block_log2 = vol->bpc_log2; vol->sectors_per_block = vol->spc; } } return RC_OK; ffc17e54: 38 60 00 00 li r3,0 <== NOT EXECUTED } ffc17e58: 80 01 00 dc lwz r0,220(r1) ffc17e5c: 81 c1 00 90 lwz r14,144(r1) ffc17e60: 7c 08 03 a6 mtlr r0 ffc17e64: 81 e1 00 94 lwz r15,148(r1) ffc17e68: 82 01 00 98 lwz r16,152(r1) ffc17e6c: 82 21 00 9c lwz r17,156(r1) ffc17e70: 82 41 00 a0 lwz r18,160(r1) ffc17e74: 82 61 00 a4 lwz r19,164(r1) ffc17e78: 82 81 00 a8 lwz r20,168(r1) ffc17e7c: 82 a1 00 ac lwz r21,172(r1) ffc17e80: 82 c1 00 b0 lwz r22,176(r1) ffc17e84: 82 e1 00 b4 lwz r23,180(r1) ffc17e88: 83 01 00 b8 lwz r24,184(r1) ffc17e8c: 83 21 00 bc lwz r25,188(r1) ffc17e90: 83 41 00 c0 lwz r26,192(r1) ffc17e94: 83 61 00 c4 lwz r27,196(r1) ffc17e98: 83 81 00 c8 lwz r28,200(r1) ffc17e9c: 83 a1 00 cc lwz r29,204(r1) ffc17ea0: 83 c1 00 d0 lwz r30,208(r1) ffc17ea4: 83 e1 00 d4 lwz r31,212(r1) ffc17ea8: 38 21 00 d8 addi r1,r1,216 ffc17eac: 4e 80 00 20 blr (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; ffc17eb0: 98 74 00 03 stb r3,3(r20) ffc17eb4: 4b ff fa cc b ffc17980 } else { if ( vol->data_cls < FAT_FAT16_MAX_CLN) { vol->type = FAT_FAT16; ffc17eb8: 39 40 00 02 li r10,2 ffc17ebc: 99 54 00 0e stb r10,14(r20) vol->mask = FAT_FAT16_MASK; ffc17ec0: 39 40 00 00 li r10,0 ffc17ec4: 61 4a ff ff ori r10,r10,65535 ffc17ec8: 91 54 00 10 stw r10,16(r20) vol->eoc_val = FAT_FAT16_EOC; ffc17ecc: 39 40 00 00 li r10,0 ffc17ed0: 61 4a ff f8 ori r10,r10,65528 ffc17ed4: 91 54 00 14 stw r10,20(r20) ffc17ed8: 4b ff fc 44 b ffc17b1c * 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); ffc17edc: 7e 83 a3 78 mr r3,r20 <== NOT EXECUTED ffc17ee0: 4b ff ef e1 bl ffc16ec0 <== NOT EXECUTED if (FAT_GET_FSINFO_LEAD_SIGNATURE(fs_info_sector) != FAT_FSINFO_LEAD_SIGNATURE_VALUE) { _fat_block_release(fs_info); close(vol->fd); ffc17ee4: 80 74 00 60 lwz r3,96(r20) <== NOT EXECUTED ffc17ee8: 4b fe e7 91 bl ffc06678 <== NOT EXECUTED rtems_set_errno_and_return_minus_one( EINVAL ); ffc17eec: 48 00 87 b1 bl ffc2069c <__errno> <== NOT EXECUTED ffc17ef0: 39 20 00 16 li r9,22 <== NOT EXECUTED ffc17ef4: 91 23 00 00 stw r9,0(r3) <== NOT EXECUTED ffc17ef8: 38 60 ff ff li r3,-1 <== NOT EXECUTED ffc17efc: 4b ff ff 5c b ffc17e58 <== NOT EXECUTED } rc = fstat(vol->fd, &stat_buf); if (rc != 0) { close(vol->fd); ffc17f00: 80 74 00 60 lwz r3,96(r20) <== NOT EXECUTED ffc17f04: 4b fe e7 75 bl ffc06678 <== NOT EXECUTED rtems_set_errno_and_return_minus_one(ENXIO); ffc17f08: 48 00 87 95 bl ffc2069c <__errno> <== NOT EXECUTED ffc17f0c: 39 20 00 06 li r9,6 <== NOT EXECUTED ffc17f10: 91 23 00 00 stw r9,0(r3) <== NOT EXECUTED ffc17f14: 38 60 ff ff li r3,-1 <== NOT EXECUTED ffc17f18: 4b ff ff 40 b ffc17e58 <== NOT EXECUTED vol->mirror = FAT_GET_BR_EXT_FLAGS(boot_rec) & FAT_BR_EXT_FLAGS_MIRROR; if (vol->mirror) vol->afat = FAT_GET_BR_EXT_FLAGS(boot_rec) & FAT_BR_EXT_FLAGS_FAT_NUM; else vol->afat = 0; ffc17f1c: 99 54 00 5c stb r10,92(r20) ffc17f20: 4b ff fe 44 b ffc17d64 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; ffc17f24: 39 00 00 00 li r8,0 <== NOT EXECUTED ffc17f28: 4b ff fa 90 b ffc179b8 <== NOT EXECUTED { close(vol->fd); rtems_set_errno_and_return_minus_one(EINVAL); } for (vol->spc_log2 = 0, i = vol->spc; (i & 1) == 0; ffc17f2c: 38 e0 00 00 li r7,0 ffc17f30: 4b ff fa dc b ffc17a0c memcpy( boot_rec, block->buffer, FAT_MAX_BPB_SIZE); sc = rtems_bdbuf_release( block); if (sc != RTEMS_SUCCESSFUL) { close(vol->fd); ffc17f34: 80 74 00 60 lwz r3,96(r20) <== NOT EXECUTED ffc17f38: 4b fe e7 41 bl ffc06678 <== NOT EXECUTED rtems_set_errno_and_return_minus_one( EIO ); ffc17f3c: 48 00 87 61 bl ffc2069c <__errno> <== NOT EXECUTED ffc17f40: 39 20 00 05 li r9,5 <== NOT EXECUTED ffc17f44: 91 23 00 00 stw r9,0(r3) <== NOT EXECUTED ffc17f48: 38 60 ff ff li r3,-1 <== NOT EXECUTED ffc17f4c: 4b ff ff 0c b ffc17e58 <== 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); ffc17f50: 80 74 00 60 lwz r3,96(r20) <== NOT EXECUTED ffc17f54: 4b fe e7 25 bl ffc06678 <== NOT EXECUTED free(fs_info->vhash); ffc17f58: 80 74 00 6c lwz r3,108(r20) <== NOT EXECUTED ffc17f5c: 4b fe e7 b5 bl ffc06710 <== NOT EXECUTED free(fs_info->rhash); ffc17f60: 80 74 00 70 lwz r3,112(r20) <== NOT EXECUTED if (fs_info->sec_buf == NULL) { close(vol->fd); free(fs_info->vhash); free(fs_info->rhash); free(fs_info->uino); ffc17f64: 4b fe e7 ad bl ffc06710 <== NOT EXECUTED rtems_set_errno_and_return_minus_one( ENOMEM ); ffc17f68: 48 00 87 35 bl ffc2069c <__errno> <== NOT EXECUTED ffc17f6c: 39 20 00 0c li r9,12 <== NOT EXECUTED ffc17f70: 91 23 00 00 stw r9,0(r3) <== NOT EXECUTED ffc17f74: 38 60 ff ff li r3,-1 <== NOT EXECUTED ffc17f78: 4b ff fe e0 b ffc17e58 <== 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); ffc17f7c: 80 74 00 60 lwz r3,96(r20) <== NOT EXECUTED ffc17f80: 4b fe e6 f9 bl ffc06678 <== NOT EXECUTED rtems_set_errno_and_return_minus_one( ENOMEM ); ffc17f84: 48 00 87 19 bl ffc2069c <__errno> <== NOT EXECUTED ffc17f88: 39 20 00 0c li r9,12 <== NOT EXECUTED ffc17f8c: 91 23 00 00 stw r9,0(r3) <== NOT EXECUTED ffc17f90: 38 60 ff ff li r3,-1 <== NOT EXECUTED ffc17f94: 4b ff fe c4 b ffc17e58 <== NOT EXECUTED * 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); ffc17f98: 7e 83 a3 78 mr r3,r20 <== NOT EXECUTED ffc17f9c: 4b ff ef 25 bl ffc16ec0 <== 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); ffc17fa0: 80 74 00 60 lwz r3,96(r20) <== NOT EXECUTED ffc17fa4: 4b fe e6 d5 bl ffc06678 <== NOT EXECUTED return -1; ffc17fa8: 38 60 ff ff li r3,-1 <== NOT EXECUTED ffc17fac: 4b ff fe ac b ffc17e58 <== 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); ffc17fb0: 80 74 00 60 lwz r3,96(r20) <== NOT EXECUTED ffc17fb4: 4b fe e6 c5 bl ffc06678 <== NOT EXECUTED free(fs_info->vhash); ffc17fb8: 80 74 00 6c lwz r3,108(r20) <== NOT EXECUTED ffc17fbc: 4b ff ff a8 b ffc17f64 <== NOT EXECUTED rtems_set_errno_and_return_minus_one( ENOMEM ); } fs_info->sec_buf = (uint8_t *)calloc(vol->bps, sizeof(uint8_t)); if (fs_info->sec_buf == NULL) { close(vol->fd); ffc17fc0: 80 74 00 60 lwz r3,96(r20) <== NOT EXECUTED ffc17fc4: 4b fe e6 b5 bl ffc06678 <== NOT EXECUTED free(fs_info->vhash); ffc17fc8: 80 74 00 6c lwz r3,108(r20) <== NOT EXECUTED ffc17fcc: 4b fe e7 45 bl ffc06710 <== NOT EXECUTED free(fs_info->rhash); ffc17fd0: 80 74 00 70 lwz r3,112(r20) <== NOT EXECUTED ffc17fd4: 4b fe e7 3d bl ffc06710 <== NOT EXECUTED free(fs_info->uino); ffc17fd8: 80 74 00 74 lwz r3,116(r20) <== NOT EXECUTED ffc17fdc: 4b ff ff 88 b ffc17f64 <== NOT EXECUTED =============================================================================== ffc1eb94 : uint32_t count, uint32_t *cls_added, uint32_t *last_cl, bool zero_fill ) { ffc1eb94: 94 21 ff b8 stwu r1,-72(r1) ffc1eb98: 7d 80 00 26 mfcr r12 ffc1eb9c: 7c 08 02 a6 mflr r0 int rc = RC_OK; uint32_t cl4find = 2; uint32_t next_cln = 0; ffc1eba0: 39 20 00 00 li r9,0 uint32_t count, uint32_t *cls_added, uint32_t *last_cl, bool zero_fill ) { ffc1eba4: 93 21 00 2c stw r25,44(r1) uint32_t i = 2; ssize_t bytes_written; *cls_added = 0; if (count == 0) ffc1eba8: 7c b9 2b 79 mr. r25,r5 uint32_t count, uint32_t *cls_added, uint32_t *last_cl, bool zero_fill ) { ffc1ebac: 90 01 00 4c stw r0,76(r1) ffc1ebb0: 93 41 00 30 stw r26,48(r1) ssize_t bytes_written; *cls_added = 0; if (count == 0) return rc; ffc1ebb4: 3b 40 00 00 li r26,0 uint32_t count, uint32_t *cls_added, uint32_t *last_cl, bool zero_fill ) { ffc1ebb8: 93 61 00 34 stw r27,52(r1) ffc1ebbc: 7c db 33 78 mr r27,r6 ffc1ebc0: 93 81 00 38 stw r28,56(r1) ffc1ebc4: 93 a1 00 3c stw r29,60(r1) ffc1ebc8: 7c 7d 1b 78 mr r29,r3 ffc1ebcc: 92 a1 00 1c stw r21,28(r1) ffc1ebd0: 92 c1 00 20 stw r22,32(r1) ffc1ebd4: 92 e1 00 24 stw r23,36(r1) ffc1ebd8: 93 01 00 28 stw r24,40(r1) ffc1ebdc: 93 c1 00 40 stw r30,64(r1) ffc1ebe0: 93 e1 00 44 stw r31,68(r1) ffc1ebe4: 91 81 00 18 stw r12,24(r1) 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; ffc1ebe8: 83 83 00 38 lwz r28,56(r3) bool zero_fill ) { int rc = RC_OK; uint32_t cl4find = 2; uint32_t next_cln = 0; ffc1ebec: 91 21 00 08 stw r9,8(r1) 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; ffc1ebf0: 91 26 00 00 stw r9,0(r6) if (count == 0) ffc1ebf4: 41 82 00 e0 beq- ffc1ecd4 <== NEVER TAKEN return rc; if (fs_info->vol.next_cl != FAT_UNDEFINED_VALUE) ffc1ebf8: 83 e3 00 4c lwz r31,76(r3) ffc1ebfc: 7c 98 23 78 mr r24,r4 ffc1ec00: 7c f7 3b 78 mr r23,r7 ffc1ec04: 2f 9f ff ff cmpwi cr7,r31,-1 ffc1ec08: 41 9e 01 9c beq- cr7,ffc1eda4 { 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; ffc1ec0c: 3b 9c 00 02 addi r28,r28,2 /* * 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) ffc1ec10: 2b 9c 00 02 cmplwi cr7,r28,2 ffc1ec14: 40 9d 01 fc ble- cr7,ffc1ee10 <== NEVER TAKEN rc = fat_set_fat_cluster(fs_info, save_cln, cl4find); if ( rc != RC_OK ) goto cleanup; } if (zero_fill) ffc1ec18: 2e 08 00 00 cmpwi cr4,r8,0 /* * 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) ffc1ec1c: 3b c0 00 02 li r30,2 ffc1ec20: 3a c0 00 00 li r22,0 { rc = fat_get_fat_cluster(fs_info, cl4find, &next_cln); ffc1ec24: 7f a3 eb 78 mr r3,r29 ffc1ec28: 7f e4 fb 78 mr r4,r31 ffc1ec2c: 38 a1 00 08 addi r5,r1,8 ffc1ec30: 4b ff f8 a5 bl ffc1e4d4 if ( rc != RC_OK ) ffc1ec34: 7c 7a 1b 79 mr. r26,r3 ffc1ec38: 40 82 01 74 bne- ffc1edac <== NEVER TAKEN if (*cls_added != 0) fat_free_fat_clusters_chain(fs_info, (*chain)); return rc; } if (next_cln == FAT_GENFAT_FREE) ffc1ec3c: 81 21 00 08 lwz r9,8(r1) ffc1ec40: 2f 89 00 00 cmpwi cr7,r9,0 ffc1ec44: 40 9e 00 48 bne- cr7,ffc1ec8c /* * 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) ffc1ec48: 81 3b 00 00 lwz r9,0(r27) ffc1ec4c: 2f 89 00 00 cmpwi cr7,r9,0 ffc1ec50: 40 9e 00 cc bne- cr7,ffc1ed1c { *chain = cl4find; ffc1ec54: 93 f8 00 00 stw r31,0(r24) rc = fat_set_fat_cluster(fs_info, cl4find, FAT_GENFAT_EOC); ffc1ec58: 7f a3 eb 78 mr r3,r29 ffc1ec5c: 7f e4 fb 78 mr r4,r31 ffc1ec60: 38 a0 ff ff li r5,-1 ffc1ec64: 4b ff fa c1 bl ffc1e724 if ( rc != RC_OK ) ffc1ec68: 2c 03 00 00 cmpwi r3,0 ffc1ec6c: 40 82 01 88 bne- ffc1edf4 <== NEVER TAKEN rc = fat_set_fat_cluster(fs_info, save_cln, cl4find); if ( rc != RC_OK ) goto cleanup; } if (zero_fill) ffc1ec70: 40 92 01 08 bne- cr4,ffc1ed78 goto cleanup; } } save_cln = cl4find; (*cls_added)++; ffc1ec74: 81 3b 00 00 lwz r9,0(r27) ffc1ec78: 39 29 00 01 addi r9,r9,1 /* have we satisfied request ? */ if (*cls_added == count) ffc1ec7c: 7f 99 48 00 cmpw cr7,r25,r9 goto cleanup; } } save_cln = cl4find; (*cls_added)++; ffc1ec80: 91 3b 00 00 stw r9,0(r27) /* have we satisfied request ? */ if (*cls_added == count) ffc1ec84: 41 9e 01 44 beq- cr7,ffc1edc8 ffc1ec88: 7f f6 fb 78 mr r22,r31 fat_buf_release(fs_info); return rc; } } i++; cl4find++; ffc1ec8c: 3b ff 00 01 addi r31,r31,1 if (cl4find >= data_cls_val) ffc1ec90: 7f 9c f8 40 cmplw cr7,r28,r31 *last_cl = save_cln; fat_buf_release(fs_info); return rc; } } i++; ffc1ec94: 3b de 00 01 addi r30,r30,1 cl4find++; if (cl4find >= data_cls_val) ffc1ec98: 41 9d 00 08 bgt- cr7,ffc1eca0 <== ALWAYS TAKEN cl4find = 2; ffc1ec9c: 3b e0 00 02 li r31,2 <== 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) ffc1eca0: 7f 9c f0 00 cmpw cr7,r28,r30 ffc1eca4: 40 9e ff 80 bne+ cr7,ffc1ec24 <== ALWAYS TAKEN if (cl4find >= data_cls_val) cl4find = 2; } fs_info->vol.next_cl = save_cln; if (fs_info->vol.free_cls != FAT_UNDEFINED_VALUE) ffc1eca8: 81 3d 00 44 lwz r9,68(r29) <== NOT EXECUTED cl4find++; if (cl4find >= data_cls_val) cl4find = 2; } fs_info->vol.next_cl = save_cln; ffc1ecac: 92 dd 00 4c stw r22,76(r29) <== NOT EXECUTED if (fs_info->vol.free_cls != FAT_UNDEFINED_VALUE) ffc1ecb0: 2f 89 ff ff cmpwi cr7,r9,-1 <== NOT EXECUTED ffc1ecb4: 41 9e 00 10 beq- cr7,ffc1ecc4 <== NOT EXECUTED fs_info->vol.free_cls -= (*cls_added); ffc1ecb8: 81 5b 00 00 lwz r10,0(r27) <== NOT EXECUTED ffc1ecbc: 7d 2a 48 50 subf r9,r10,r9 <== NOT EXECUTED ffc1ecc0: 91 3d 00 44 stw r9,68(r29) <== NOT EXECUTED *last_cl = save_cln; ffc1ecc4: 92 d7 00 00 stw r22,0(r23) <== NOT EXECUTED fat_buf_release(fs_info); ffc1ecc8: 7f a3 eb 78 mr r3,r29 <== NOT EXECUTED return RC_OK; ffc1eccc: 3b 40 00 00 li r26,0 <== NOT EXECUTED fs_info->vol.next_cl = save_cln; if (fs_info->vol.free_cls != FAT_UNDEFINED_VALUE) fs_info->vol.free_cls -= (*cls_added); *last_cl = save_cln; fat_buf_release(fs_info); ffc1ecd0: 4b ff 81 f1 bl ffc16ec0 <== 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; } ffc1ecd4: 80 01 00 4c lwz r0,76(r1) ffc1ecd8: 7f 43 d3 78 mr r3,r26 ffc1ecdc: 81 81 00 18 lwz r12,24(r1) ffc1ece0: 7c 08 03 a6 mtlr r0 ffc1ece4: 82 a1 00 1c lwz r21,28(r1) ffc1ece8: 82 c1 00 20 lwz r22,32(r1) ffc1ecec: 7d 80 81 20 mtcrf 8,r12 ffc1ecf0: 82 e1 00 24 lwz r23,36(r1) ffc1ecf4: 83 01 00 28 lwz r24,40(r1) ffc1ecf8: 83 21 00 2c lwz r25,44(r1) ffc1ecfc: 83 41 00 30 lwz r26,48(r1) ffc1ed00: 83 61 00 34 lwz r27,52(r1) ffc1ed04: 83 81 00 38 lwz r28,56(r1) ffc1ed08: 83 a1 00 3c lwz r29,60(r1) ffc1ed0c: 83 c1 00 40 lwz r30,64(r1) ffc1ed10: 83 e1 00 44 lwz r31,68(r1) ffc1ed14: 38 21 00 48 addi r1,r1,72 ffc1ed18: 4e 80 00 20 blr } } else { /* set EOC value to new allocated cluster */ rc = fat_set_fat_cluster(fs_info, cl4find, FAT_GENFAT_EOC); ffc1ed1c: 7f a3 eb 78 mr r3,r29 ffc1ed20: 7f e4 fb 78 mr r4,r31 ffc1ed24: 38 a0 ff ff li r5,-1 ffc1ed28: 4b ff f9 fd bl ffc1e724 if ( rc != RC_OK ) ffc1ed2c: 7c 75 1b 79 mr. r21,r3 ffc1ed30: 40 82 00 cc bne- ffc1edfc <== NEVER TAKEN /* cleanup activity */ fat_free_fat_clusters_chain(fs_info, (*chain)); return rc; } rc = fat_set_fat_cluster(fs_info, save_cln, cl4find); ffc1ed34: 7e c4 b3 78 mr r4,r22 ffc1ed38: 7f a3 eb 78 mr r3,r29 ffc1ed3c: 7f e5 fb 78 mr r5,r31 ffc1ed40: 4b ff f9 e5 bl ffc1e724 if ( rc != RC_OK ) ffc1ed44: 7c 76 1b 79 mr. r22,r3 ffc1ed48: 41 82 ff 28 beq+ ffc1ec70 <== ALWAYS TAKEN return RC_OK; cleanup: /* cleanup activity */ fat_free_fat_clusters_chain(fs_info, (*chain)); ffc1ed4c: 80 98 00 00 lwz r4,0(r24) <== NOT EXECUTED ffc1ed50: 7f a3 eb 78 mr r3,r29 <== NOT EXECUTED /* 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; ffc1ed54: 7e da b3 78 mr r26,r22 <== NOT EXECUTED return RC_OK; cleanup: /* cleanup activity */ fat_free_fat_clusters_chain(fs_info, (*chain)); ffc1ed58: 4b ff fd 01 bl ffc1ea58 <== NOT EXECUTED /* trying to save last allocated cluster for future use */ fat_set_fat_cluster(fs_info, cl4find, FAT_GENFAT_FREE); ffc1ed5c: 7f e4 fb 78 mr r4,r31 <== NOT EXECUTED ffc1ed60: 38 a0 00 00 li r5,0 <== NOT EXECUTED ffc1ed64: 7f a3 eb 78 mr r3,r29 <== NOT EXECUTED ffc1ed68: 4b ff f9 bd bl ffc1e724 <== NOT EXECUTED fat_buf_release(fs_info); ffc1ed6c: 7f a3 eb 78 mr r3,r29 <== NOT EXECUTED ffc1ed70: 4b ff 81 51 bl ffc16ec0 <== NOT EXECUTED ffc1ed74: 4b ff ff 60 b ffc1ecd4 <== NOT EXECUTED goto cleanup; } if (zero_fill) { bytes_written = fat_cluster_set (fs_info, cl4find, 0, fs_info->vol.bpc, 0); ffc1ed78: a0 dd 00 06 lhz r6,6(r29) ffc1ed7c: 7f a3 eb 78 mr r3,r29 ffc1ed80: 7f e4 fb 78 mr r4,r31 ffc1ed84: 38 a0 00 00 li r5,0 ffc1ed88: 38 e0 00 00 li r7,0 ffc1ed8c: 4b ff 86 11 bl ffc1739c if (fs_info->vol.bpc != bytes_written) ffc1ed90: a1 3d 00 06 lhz r9,6(r29) ffc1ed94: 7f 89 18 00 cmpw cr7,r9,r3 ffc1ed98: 41 9e fe dc beq+ cr7,ffc1ec74 <== ALWAYS TAKEN { rc = -1; ffc1ed9c: 3a c0 ff ff li r22,-1 <== NOT EXECUTED ffc1eda0: 4b ff ff ac b ffc1ed4c <== NOT EXECUTED uint32_t *last_cl, bool zero_fill ) { int rc = RC_OK; uint32_t cl4find = 2; ffc1eda4: 3b e0 00 02 li r31,2 ffc1eda8: 4b ff fe 64 b ffc1ec0c while (i < data_cls_val) { rc = fat_get_fat_cluster(fs_info, cl4find, &next_cln); if ( rc != RC_OK ) { if (*cls_added != 0) ffc1edac: 81 3b 00 00 lwz r9,0(r27) <== NOT EXECUTED ffc1edb0: 2f 89 00 00 cmpwi cr7,r9,0 <== NOT EXECUTED ffc1edb4: 41 9e ff 20 beq+ cr7,ffc1ecd4 <== NOT EXECUTED fat_free_fat_clusters_chain(fs_info, (*chain)); ffc1edb8: 80 98 00 00 lwz r4,0(r24) <== NOT EXECUTED ffc1edbc: 7f a3 eb 78 mr r3,r29 <== NOT EXECUTED ffc1edc0: 4b ff fc 99 bl ffc1ea58 <== NOT EXECUTED ffc1edc4: 4b ff ff 10 b ffc1ecd4 <== 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) ffc1edc8: 81 3d 00 44 lwz r9,68(r29) (*cls_added)++; /* have we satisfied request ? */ if (*cls_added == count) { fs_info->vol.next_cl = save_cln; ffc1edcc: 93 fd 00 4c stw r31,76(r29) if (fs_info->vol.free_cls != FAT_UNDEFINED_VALUE) ffc1edd0: 2f 89 ff ff cmpwi cr7,r9,-1 ffc1edd4: 41 9e 00 10 beq- cr7,ffc1ede4 <== ALWAYS TAKEN fs_info->vol.free_cls -= (*cls_added); ffc1edd8: 81 5b 00 00 lwz r10,0(r27) <== NOT EXECUTED ffc1eddc: 7d 2a 48 50 subf r9,r10,r9 <== NOT EXECUTED ffc1ede0: 91 3d 00 44 stw r9,68(r29) <== NOT EXECUTED *last_cl = save_cln; ffc1ede4: 93 f7 00 00 stw r31,0(r23) fat_buf_release(fs_info); ffc1ede8: 7f a3 eb 78 mr r3,r29 ffc1edec: 4b ff 80 d5 bl ffc16ec0 ffc1edf0: 4b ff fe e4 b ffc1ecd4 * wouldn't work properly */ if (*cls_added == 0) { *chain = cl4find; rc = fat_set_fat_cluster(fs_info, cl4find, FAT_GENFAT_EOC); ffc1edf4: 7c 7a 1b 78 mr r26,r3 <== NOT EXECUTED ffc1edf8: 4b ff fe dc b ffc1ecd4 <== NOT EXECUTED /* set EOC value to new allocated cluster */ rc = fat_set_fat_cluster(fs_info, cl4find, FAT_GENFAT_EOC); if ( rc != RC_OK ) { /* cleanup activity */ fat_free_fat_clusters_chain(fs_info, (*chain)); ffc1edfc: 80 98 00 00 lwz r4,0(r24) <== NOT EXECUTED ffc1ee00: 7f a3 eb 78 mr r3,r29 <== NOT EXECUTED } } else { /* set EOC value to new allocated cluster */ rc = fat_set_fat_cluster(fs_info, cl4find, FAT_GENFAT_EOC); ffc1ee04: 7e ba ab 78 mr r26,r21 <== NOT EXECUTED if ( rc != RC_OK ) { /* cleanup activity */ fat_free_fat_clusters_chain(fs_info, (*chain)); ffc1ee08: 4b ff fc 51 bl ffc1ea58 <== NOT EXECUTED ffc1ee0c: 4b ff fe c8 b ffc1ecd4 <== 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) ffc1ee10: 3a c0 00 00 li r22,0 <== NOT EXECUTED ffc1ee14: 4b ff fe 94 b ffc1eca8 <== NOT EXECUTED =============================================================================== ffc17278 : fat_fs_info_t *fs_info, uint32_t start, uint32_t offset, uint32_t count, const void *buff) { ffc17278: 94 21 ff c8 stwu r1,-56(r1) ffc1727c: 7c 08 02 a6 mflr r0 ffc17280: 93 c1 00 30 stw r30,48(r1) uint32_t sec_num = start; uint32_t ofs = offset; uint8_t *sec_buf; uint32_t c = 0; while(count > 0) ffc17284: 7c de 33 79 mr. r30,r6 fat_fs_info_t *fs_info, uint32_t start, uint32_t offset, uint32_t count, const void *buff) { ffc17288: 90 01 00 3c stw r0,60(r1) ffc1728c: 93 01 00 18 stw r24,24(r1) ffc17290: 93 21 00 1c stw r25,28(r1) ffc17294: 93 41 00 20 stw r26,32(r1) ffc17298: 93 61 00 24 stw r27,36(r1) ffc1729c: 93 81 00 28 stw r28,40(r1) ffc172a0: 93 a1 00 2c stw r29,44(r1) ffc172a4: 93 e1 00 34 stw r31,52(r1) uint32_t sec_num = start; uint32_t ofs = offset; uint8_t *sec_buf; uint32_t c = 0; while(count > 0) ffc172a8: 41 82 00 ec beq- ffc17394 <== NEVER TAKEN ffc172ac: 7c 7d 1b 78 mr r29,r3 ffc172b0: 7c f9 3b 78 mr r25,r7 ffc172b4: 7c ba 2b 78 mr r26,r5 ffc172b8: 7c 9c 23 78 mr r28,r4 ffc172bc: 3b 60 00 00 li r27,0 } static inline void fat_buf_mark_modified(fat_fs_info_t *fs_info) { fs_info->c.modified = true; ffc172c0: 3b 00 00 01 li r24,1 ffc172c4: 48 00 00 3c b ffc17300 c = MIN(count, (fs_info->vol.bps - ofs)); 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); ffc172c8: 4b ff fd dd bl ffc170a4 fat_buf_mark_modified(fs_info); count -= c; cmpltd +=c; sec_num++; ffc172cc: 3b 9c 00 01 addi r28,r28,1 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) ffc172d0: 2f 83 00 00 cmpwi cr7,r3,0 return -1; memcpy((sec_buf + ofs), (buff + cmpltd), c); ffc172d4: 7c 99 da 14 add r4,r25,r27 ffc172d8: 7f e5 fb 78 mr r5,r31 fat_buf_mark_modified(fs_info); count -= c; cmpltd +=c; ffc172dc: 7f 7f da 14 add r27,r31,r27 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) ffc172e0: 40 9e 00 7c bne- cr7,ffc1735c <== NEVER TAKEN return -1; memcpy((sec_buf + ofs), (buff + cmpltd), c); ffc172e4: 80 61 00 08 lwz r3,8(r1) ffc172e8: 7c 63 d2 14 add r3,r3,r26 ffc172ec: 48 00 a0 91 bl ffc2137c uint32_t sec_num = start; uint32_t ofs = offset; uint8_t *sec_buf; uint32_t c = 0; while(count > 0) ffc172f0: 7f df f0 51 subf. r30,r31,r30 ffc172f4: 9b 1d 00 88 stb r24,136(r29) fat_buf_mark_modified(fs_info); count -= c; cmpltd +=c; sec_num++; ofs = 0; ffc172f8: 3b 40 00 00 li r26,0 uint32_t sec_num = start; uint32_t ofs = offset; uint8_t *sec_buf; uint32_t c = 0; while(count > 0) ffc172fc: 41 82 00 64 beq- ffc17360 <== ALWAYS TAKEN { c = MIN(count, (fs_info->vol.bps - ofs)); ffc17300: a3 fd 00 00 lhz r31,0(r29) 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); ffc17304: 7f 84 e3 78 mr r4,r28 ffc17308: 38 a0 00 01 li r5,1 uint8_t *sec_buf; uint32_t c = 0; while(count > 0) { c = MIN(count, (fs_info->vol.bps - ofs)); ffc1730c: 7f fa f8 50 subf r31,r26,r31 ffc17310: 7f 9f f0 40 cmplw cr7,r31,r30 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); ffc17314: 38 c1 00 08 addi r6,r1,8 ffc17318: 7f a3 eb 78 mr r3,r29 uint8_t *sec_buf; uint32_t c = 0; while(count > 0) { c = MIN(count, (fs_info->vol.bps - ofs)); ffc1731c: 40 9d 00 08 ble- cr7,ffc17324 ffc17320: 7f df f3 78 mr r31,r30 if (c == fs_info->vol.bytes_per_block) ffc17324: a1 3d 00 0a lhz r9,10(r29) ffc17328: 7f 89 f8 00 cmpw cr7,r9,r31 ffc1732c: 40 9e ff 9c bne+ cr7,ffc172c8 <== ALWAYS TAKEN rc = fat_buf_access(fs_info, sec_num, FAT_OP_TYPE_GET, &sec_buf); ffc17330: 7f 84 e3 78 mr r4,r28 <== NOT EXECUTED ffc17334: 38 a0 00 02 li r5,2 <== NOT EXECUTED ffc17338: 7f a3 eb 78 mr r3,r29 <== NOT EXECUTED ffc1733c: 38 c1 00 08 addi r6,r1,8 <== NOT EXECUTED ffc17340: 4b ff fd 65 bl ffc170a4 <== NOT EXECUTED fat_buf_mark_modified(fs_info); count -= c; cmpltd +=c; sec_num++; ffc17344: 3b 9c 00 01 addi r28,r28,1 <== NOT EXECUTED 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) ffc17348: 2f 83 00 00 cmpwi cr7,r3,0 <== NOT EXECUTED return -1; memcpy((sec_buf + ofs), (buff + cmpltd), c); ffc1734c: 7c 99 da 14 add r4,r25,r27 <== NOT EXECUTED ffc17350: 7f e5 fb 78 mr r5,r31 <== NOT EXECUTED fat_buf_mark_modified(fs_info); count -= c; cmpltd +=c; ffc17354: 7f 7f da 14 add r27,r31,r27 <== NOT EXECUTED 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) ffc17358: 41 9e ff 8c beq+ cr7,ffc172e4 <== NOT EXECUTED return -1; ffc1735c: 3b 60 ff ff li r27,-1 <== NOT EXECUTED cmpltd +=c; sec_num++; ofs = 0; } return cmpltd; } ffc17360: 80 01 00 3c lwz r0,60(r1) ffc17364: 7f 63 db 78 mr r3,r27 ffc17368: 83 01 00 18 lwz r24,24(r1) ffc1736c: 7c 08 03 a6 mtlr r0 ffc17370: 83 21 00 1c lwz r25,28(r1) ffc17374: 83 41 00 20 lwz r26,32(r1) ffc17378: 83 61 00 24 lwz r27,36(r1) ffc1737c: 83 81 00 28 lwz r28,40(r1) ffc17380: 83 a1 00 2c lwz r29,44(r1) ffc17384: 83 c1 00 30 lwz r30,48(r1) ffc17388: 83 e1 00 34 lwz r31,52(r1) ffc1738c: 38 21 00 38 addi r1,r1,56 ffc17390: 4e 80 00 20 blr uint32_t offset, uint32_t count, const void *buff) { int rc = RC_OK; ssize_t cmpltd = 0; ffc17394: 3b 60 00 00 li r27,0 <== NOT EXECUTED ffc17398: 4b ff ff c8 b ffc17360 <== NOT EXECUTED =============================================================================== ffc1e724 : uint16_t fat16_clv = 0; uint32_t fat32_clv = 0; uint8_t *sec_buf = NULL; /* sanity check */ if ( (cln < 2) || (cln > (fs_info->vol.data_cls + 1)) ) ffc1e724: 2b 84 00 01 cmplwi cr7,r4,1 fat_set_fat_cluster( fat_fs_info_t *fs_info, uint32_t cln, uint32_t in_val ) { ffc1e728: 94 21 ff c8 stwu r1,-56(r1) ffc1e72c: 7c 08 02 a6 mflr r0 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; ffc1e730: 39 20 00 00 li r9,0 fat_set_fat_cluster( fat_fs_info_t *fs_info, uint32_t cln, uint32_t in_val ) { ffc1e734: 93 c1 00 30 stw r30,48(r1) ffc1e738: 7c 9e 23 78 mr r30,r4 ffc1e73c: 90 01 00 3c stw r0,60(r1) ffc1e740: 93 21 00 1c stw r25,28(r1) ffc1e744: 93 41 00 20 stw r26,32(r1) ffc1e748: 93 61 00 24 stw r27,36(r1) ffc1e74c: 93 81 00 28 stw r28,40(r1) ffc1e750: 93 a1 00 2c stw r29,44(r1) ffc1e754: 93 e1 00 34 stw r31,52(r1) 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; ffc1e758: 91 21 00 08 stw r9,8(r1) /* sanity check */ if ( (cln < 2) || (cln > (fs_info->vol.data_cls + 1)) ) ffc1e75c: 40 9d 00 8c ble- cr7,ffc1e7e8 <== NEVER TAKEN ffc1e760: 81 23 00 38 lwz r9,56(r3) ffc1e764: 7c 7f 1b 78 mr r31,r3 ffc1e768: 39 29 00 01 addi r9,r9,1 ffc1e76c: 7f 84 48 40 cmplw cr7,r4,r9 ffc1e770: 41 9d 00 78 bgt- cr7,ffc1e7e8 <== NEVER TAKEN rtems_set_errno_and_return_minus_one(EIO); sec = (FAT_FAT_OFFSET(fs_info->vol.type, cln) >> fs_info->vol.sec_log2) + ffc1e774: 89 23 00 0e lbz r9,14(r3) ffc1e778: 7c ba 2b 78 mr r26,r5 ffc1e77c: 71 2a 00 01 andi. r10,r9,1 ffc1e780: 40 82 00 a4 bne- ffc1e824 ffc1e784: 55 29 07 bc rlwinm r9,r9,0,30,30 ffc1e788: 8b 63 00 02 lbz r27,2(r3) ffc1e78c: 71 2a 00 ff andi. r10,r9,255 ffc1e790: 41 82 00 b0 beq- ffc1e840 ffc1e794: 54 9d 08 3c rlwinm r29,r4,1,0,30 ffc1e798: 81 23 00 58 lwz r9,88(r3) ffc1e79c: 7f bb dc 30 srw r27,r29,r27 ffc1e7a0: 7f 7b 4a 14 add r27,r27,r9 fs_info->vol.afat_loc; ofs = FAT_FAT_OFFSET(fs_info->vol.type, cln) & (fs_info->vol.bps - 1); rc = fat_buf_access(fs_info, sec, FAT_OP_TYPE_READ, &sec_buf); ffc1e7a4: 7f e3 fb 78 mr r3,r31 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); ffc1e7a8: a3 3f 00 00 lhz r25,0(r31) rc = fat_buf_access(fs_info, sec, FAT_OP_TYPE_READ, &sec_buf); ffc1e7ac: 7f 64 db 78 mr r4,r27 ffc1e7b0: 38 a0 00 01 li r5,1 ffc1e7b4: 38 c1 00 08 addi r6,r1,8 ffc1e7b8: 4b ff 88 ed bl ffc170a4 if (rc != RC_OK) ffc1e7bc: 2c 03 00 00 cmpwi r3,0 ffc1e7c0: 40 82 00 38 bne- ffc1e7f8 <== NEVER TAKEN return rc; switch ( fs_info->vol.type ) ffc1e7c4: 8b 9f 00 0e lbz r28,14(r31) 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); ffc1e7c8: 3b 39 ff ff addi r25,r25,-1 ffc1e7cc: 7f bd c8 38 and r29,r29,r25 rc = fat_buf_access(fs_info, sec, FAT_OP_TYPE_READ, &sec_buf); if (rc != RC_OK) return rc; switch ( fs_info->vol.type ) ffc1e7d0: 2f 9c 00 02 cmpwi cr7,r28,2 ffc1e7d4: 41 9e 00 80 beq- cr7,ffc1e854 ffc1e7d8: 2f 9c 00 04 cmpwi cr7,r28,4 ffc1e7dc: 41 9e 01 24 beq- cr7,ffc1e900 ffc1e7e0: 2f 9c 00 01 cmpwi cr7,r28,1 ffc1e7e4: 41 9e 00 b8 beq- cr7,ffc1e89c <== ALWAYS TAKEN fat_buf_mark_modified(fs_info); break; default: rtems_set_errno_and_return_minus_one(EIO); ffc1e7e8: 48 00 1e b5 bl ffc2069c <__errno> <== NOT EXECUTED ffc1e7ec: 39 20 00 05 li r9,5 <== NOT EXECUTED ffc1e7f0: 91 23 00 00 stw r9,0(r3) <== NOT EXECUTED ffc1e7f4: 38 60 ff ff li r3,-1 <== NOT EXECUTED break; } return RC_OK; } ffc1e7f8: 80 01 00 3c lwz r0,60(r1) ffc1e7fc: 83 21 00 1c lwz r25,28(r1) ffc1e800: 7c 08 03 a6 mtlr r0 ffc1e804: 83 41 00 20 lwz r26,32(r1) ffc1e808: 83 61 00 24 lwz r27,36(r1) ffc1e80c: 83 81 00 28 lwz r28,40(r1) ffc1e810: 83 a1 00 2c lwz r29,44(r1) ffc1e814: 83 c1 00 30 lwz r30,48(r1) ffc1e818: 83 e1 00 34 lwz r31,52(r1) ffc1e81c: 38 21 00 38 addi r1,r1,56 ffc1e820: 4e 80 00 20 blr /* 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) + ffc1e824: 54 9d f8 7e rlwinm r29,r4,31,1,31 ffc1e828: 8b 63 00 02 lbz r27,2(r3) ffc1e82c: 7f bd 22 14 add r29,r29,r4 ffc1e830: 81 23 00 58 lwz r9,88(r3) ffc1e834: 7f bb dc 30 srw r27,r29,r27 ffc1e838: 7f 7b 4a 14 add r27,r27,r9 ffc1e83c: 4b ff ff 68 b ffc1e7a4 ffc1e840: 54 9d 10 3a rlwinm r29,r4,2,0,29 ffc1e844: 81 23 00 58 lwz r9,88(r3) ffc1e848: 7f bb dc 30 srw r27,r29,r27 ffc1e84c: 7f 7b 4a 14 add r27,r27,r9 ffc1e850: 4b ff ff 54 b ffc1e7a4 break; } return RC_OK; } ffc1e854: 80 01 00 3c lwz r0,60(r1) } break; case FAT_FAT16: *((uint16_t *)(sec_buf + ofs)) = (uint16_t )(CT_LE_W(in_val)); ffc1e858: 57 49 42 2e rlwinm r9,r26,8,8,23 ffc1e85c: 57 5a c6 3e rlwinm r26,r26,24,24,31 break; } return RC_OK; } ffc1e860: 83 21 00 1c lwz r25,28(r1) ffc1e864: 7c 08 03 a6 mtlr r0 } break; case FAT_FAT16: *((uint16_t *)(sec_buf + ofs)) = (uint16_t )(CT_LE_W(in_val)); ffc1e868: 7d 3a d3 78 or r26,r9,r26 } } break; case FAT_FAT16: *((uint16_t *)(sec_buf + ofs)) = ffc1e86c: 81 21 00 08 lwz r9,8(r1) break; } return RC_OK; } ffc1e870: 83 61 00 24 lwz r27,36(r1) } } break; case FAT_FAT16: *((uint16_t *)(sec_buf + ofs)) = ffc1e874: 7f 49 eb 2e sthx r26,r9,r29 } static inline void fat_buf_mark_modified(fat_fs_info_t *fs_info) { fs_info->c.modified = true; ffc1e878: 39 20 00 01 li r9,1 ffc1e87c: 99 3f 00 88 stb r9,136(r31) break; } return RC_OK; } ffc1e880: 83 41 00 20 lwz r26,32(r1) ffc1e884: 83 81 00 28 lwz r28,40(r1) ffc1e888: 83 a1 00 2c lwz r29,44(r1) ffc1e88c: 83 c1 00 30 lwz r30,48(r1) ffc1e890: 83 e1 00 34 lwz r31,52(r1) ffc1e894: 38 21 00 38 addi r1,r1,56 ffc1e898: 4e 80 00 20 blr return rc; switch ( fs_info->vol.type ) { case FAT_FAT12: if ( FAT_CLUSTER_IS_ODD(cln) ) ffc1e89c: 73 c9 00 01 andi. r9,r30,1 ffc1e8a0: 41 82 00 d0 beq- ffc1e970 { fat16_clv = ((uint16_t )in_val) << FAT_FAT12_SHIFT; *(sec_buf + ofs) &= 0x0F; ffc1e8a4: 81 21 00 08 lwz r9,8(r1) switch ( fs_info->vol.type ) { case FAT_FAT12: if ( FAT_CLUSTER_IS_ODD(cln) ) { fat16_clv = ((uint16_t )in_val) << FAT_FAT12_SHIFT; ffc1e8a8: 57 5a 24 36 rlwinm r26,r26,4,16,27 *(sec_buf + ofs) &= 0x0F; ffc1e8ac: 7d 49 e8 ae lbzx r10,r9,r29 ffc1e8b0: 55 4a 07 3e clrlwi r10,r10,28 ffc1e8b4: 7d 49 e9 ae stbx r10,r9,r29 *(sec_buf + ofs) |= (uint8_t)(fat16_clv & 0x00F0); ffc1e8b8: 81 21 00 08 lwz r9,8(r1) ffc1e8bc: 7d 49 e8 ae lbzx r10,r9,r29 ffc1e8c0: 7f 4a 53 78 or r10,r26,r10 ffc1e8c4: 7d 49 e9 ae stbx r10,r9,r29 fat_buf_mark_modified(fs_info); if ( ofs == (fs_info->vol.bps - 1) ) ffc1e8c8: a1 3f 00 00 lhz r9,0(r31) ffc1e8cc: 9b 9f 00 88 stb r28,136(r31) ffc1e8d0: 39 29 ff ff addi r9,r9,-1 ffc1e8d4: 7f 89 e8 00 cmpw cr7,r9,r29 ffc1e8d8: 41 9e 00 f8 beq- cr7,ffc1e9d0 <== NEVER TAKEN fat_buf_mark_modified(fs_info); } else { *(sec_buf + ofs + 1) &= 0x00; ffc1e8dc: 81 21 00 08 lwz r9,8(r1) ffc1e8e0: 3b bd 00 01 addi r29,r29,1 *(sec_buf + ofs + 1) |= (uint8_t )((fat16_clv & 0xFF00)>>8); ffc1e8e4: 57 5a c2 3e rlwinm r26,r26,24,8,31 fat_buf_mark_modified(fs_info); } else { *(sec_buf + ofs + 1) &= 0x00; ffc1e8e8: 7c 69 e9 ae stbx r3,r9,r29 *(sec_buf + ofs + 1) |= (uint8_t )((fat16_clv & 0xFF00)>>8); ffc1e8ec: 81 21 00 08 lwz r9,8(r1) ffc1e8f0: 7d 49 e8 ae lbzx r10,r9,r29 ffc1e8f4: 7d 4a d3 78 or r10,r10,r26 ffc1e8f8: 7d 49 e9 ae stbx r10,r9,r29 ffc1e8fc: 4b ff fe fc b ffc1e7f8 (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)); ffc1e900: 57 5a 01 3e clrlwi r26,r26,4 ffc1e904: 53 48 46 3e rlwimi r8,r26,8,24,31 ffc1e908: 53 48 c4 2e rlwimi r8,r26,24,16,23 ffc1e90c: 53 48 42 1e rlwimi r8,r26,8,8,15 ffc1e910: 53 48 c0 0e rlwimi r8,r26,24,0,7 ffc1e914: 3d 40 f0 00 lis r10,-4096 *((uint32_t *)(sec_buf + ofs)) &= CT_LE_L(0xF0000000); ffc1e918: 81 21 00 08 lwz r9,8(r1) ffc1e91c: 51 47 46 3e rlwimi r7,r10,8,24,31 ffc1e920: 51 47 c4 2e rlwimi r7,r10,24,16,23 ffc1e924: 51 47 42 1e rlwimi r7,r10,8,8,15 ffc1e928: 51 47 c0 0e rlwimi r7,r10,24,0,7 break; } return RC_OK; } ffc1e92c: 80 01 00 3c lwz r0,60(r1) break; case FAT_FAT32: fat32_clv = CT_LE_L((in_val & FAT_FAT32_MASK)); *((uint32_t *)(sec_buf + ofs)) &= CT_LE_L(0xF0000000); ffc1e930: 7d 49 e8 2e lwzx r10,r9,r29 break; } return RC_OK; } ffc1e934: 7c 08 03 a6 mtlr r0 ffc1e938: 83 21 00 1c lwz r25,28(r1) break; case FAT_FAT32: fat32_clv = CT_LE_L((in_val & FAT_FAT32_MASK)); *((uint32_t *)(sec_buf + ofs)) &= CT_LE_L(0xF0000000); ffc1e93c: 7c ea 50 38 and r10,r7,r10 break; } return RC_OK; } ffc1e940: 83 41 00 20 lwz r26,32(r1) case FAT_FAT32: fat32_clv = CT_LE_L((in_val & FAT_FAT32_MASK)); *((uint32_t *)(sec_buf + ofs)) &= CT_LE_L(0xF0000000); *((uint32_t *)(sec_buf + ofs)) |= fat32_clv; ffc1e944: 7d 4a 43 78 or r10,r10,r8 break; } return RC_OK; } ffc1e948: 83 61 00 24 lwz r27,36(r1) case FAT_FAT32: fat32_clv = CT_LE_L((in_val & FAT_FAT32_MASK)); *((uint32_t *)(sec_buf + ofs)) &= CT_LE_L(0xF0000000); *((uint32_t *)(sec_buf + ofs)) |= fat32_clv; ffc1e94c: 7d 49 e9 2e stwx r10,r9,r29 ffc1e950: 39 20 00 01 li r9,1 ffc1e954: 99 3f 00 88 stb r9,136(r31) break; } return RC_OK; } ffc1e958: 83 81 00 28 lwz r28,40(r1) ffc1e95c: 83 a1 00 2c lwz r29,44(r1) ffc1e960: 83 c1 00 30 lwz r30,48(r1) ffc1e964: 83 e1 00 34 lwz r31,52(r1) ffc1e968: 38 21 00 38 addi r1,r1,56 ffc1e96c: 4e 80 00 20 blr } } else { fat16_clv = ((uint16_t )in_val) & FAT_FAT12_MASK; *(sec_buf + ofs) &= 0x00; ffc1e970: 81 21 00 08 lwz r9,8(r1) *(sec_buf + ofs + 1) |= (uint8_t )((fat16_clv & 0xFF00)>>8); } } else { fat16_clv = ((uint16_t )in_val) & FAT_FAT12_MASK; ffc1e974: 57 5a 05 3e clrlwi r26,r26,20 ffc1e978: 57 5e 04 3e clrlwi r30,r26,16 *(sec_buf + ofs) &= 0x00; ffc1e97c: 7c 69 e9 ae stbx r3,r9,r29 *(sec_buf + ofs) |= (uint8_t)(fat16_clv & 0x00FF); ffc1e980: 81 21 00 08 lwz r9,8(r1) ffc1e984: 7d 49 e8 ae lbzx r10,r9,r29 ffc1e988: 7d 5a d3 78 or r26,r10,r26 ffc1e98c: 7f 49 e9 ae stbx r26,r9,r29 fat_buf_mark_modified(fs_info); if ( ofs == (fs_info->vol.bps - 1) ) ffc1e990: a1 3f 00 00 lhz r9,0(r31) ffc1e994: 9b 9f 00 88 stb r28,136(r31) ffc1e998: 39 29 ff ff addi r9,r9,-1 ffc1e99c: 7f 89 e8 00 cmpw cr7,r9,r29 ffc1e9a0: 41 9e 00 70 beq- cr7,ffc1ea10 <== NEVER TAKEN fat_buf_mark_modified(fs_info); } else { *(sec_buf + ofs + 1) &= 0xF0; ffc1e9a4: 81 21 00 08 lwz r9,8(r1) ffc1e9a8: 3b bd 00 01 addi r29,r29,1 *(sec_buf + ofs+1) |= (uint8_t)((fat16_clv & 0xFF00)>>8); ffc1e9ac: 57 de c2 3e rlwinm r30,r30,24,8,31 fat_buf_mark_modified(fs_info); } else { *(sec_buf + ofs + 1) &= 0xF0; ffc1e9b0: 7d 09 e8 ae lbzx r8,r9,r29 ffc1e9b4: 55 08 00 36 rlwinm r8,r8,0,0,27 ffc1e9b8: 7d 09 e9 ae stbx r8,r9,r29 *(sec_buf + ofs+1) |= (uint8_t)((fat16_clv & 0xFF00)>>8); ffc1e9bc: 81 21 00 08 lwz r9,8(r1) ffc1e9c0: 7d 49 e8 ae lbzx r10,r9,r29 ffc1e9c4: 7d 4a f3 78 or r10,r10,r30 ffc1e9c8: 7d 49 e9 ae stbx r10,r9,r29 ffc1e9cc: 4b ff fe 2c b ffc1e7f8 fat_buf_mark_modified(fs_info); if ( ofs == (fs_info->vol.bps - 1) ) { rc = fat_buf_access(fs_info, sec + 1, FAT_OP_TYPE_READ, ffc1e9d0: 7f e3 fb 78 mr r3,r31 <== NOT EXECUTED ffc1e9d4: 38 9b 00 01 addi r4,r27,1 <== NOT EXECUTED ffc1e9d8: 38 a0 00 01 li r5,1 <== NOT EXECUTED ffc1e9dc: 38 c1 00 08 addi r6,r1,8 <== NOT EXECUTED ffc1e9e0: 4b ff 86 c5 bl ffc170a4 <== NOT EXECUTED &sec_buf); if (rc != RC_OK) ffc1e9e4: 2c 03 00 00 cmpwi r3,0 <== NOT EXECUTED ffc1e9e8: 40 a2 fe 10 bne- ffc1e7f8 <== NOT EXECUTED return rc; *sec_buf &= 0x00; ffc1e9ec: 81 21 00 08 lwz r9,8(r1) <== NOT EXECUTED *sec_buf |= (uint8_t)((fat16_clv & 0xFF00)>>8); ffc1e9f0: 57 5a c2 3e rlwinm r26,r26,24,8,31 <== 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; ffc1e9f4: 98 69 00 00 stb r3,0(r9) <== NOT EXECUTED *sec_buf |= (uint8_t)((fat16_clv & 0xFF00)>>8); ffc1e9f8: 81 21 00 08 lwz r9,8(r1) <== NOT EXECUTED ffc1e9fc: 89 49 00 00 lbz r10,0(r9) <== NOT EXECUTED ffc1ea00: 7f 4a 53 78 or r10,r26,r10 <== NOT EXECUTED ffc1ea04: 99 49 00 00 stb r10,0(r9) <== NOT EXECUTED ffc1ea08: 9b 9f 00 88 stb r28,136(r31) <== NOT EXECUTED ffc1ea0c: 4b ff fd ec b ffc1e7f8 <== NOT EXECUTED fat_buf_mark_modified(fs_info); if ( ofs == (fs_info->vol.bps - 1) ) { rc = fat_buf_access(fs_info, sec + 1, FAT_OP_TYPE_READ, ffc1ea10: 7f e3 fb 78 mr r3,r31 <== NOT EXECUTED ffc1ea14: 38 9b 00 01 addi r4,r27,1 <== NOT EXECUTED ffc1ea18: 38 a0 00 01 li r5,1 <== NOT EXECUTED ffc1ea1c: 38 c1 00 08 addi r6,r1,8 <== NOT EXECUTED ffc1ea20: 4b ff 86 85 bl ffc170a4 <== NOT EXECUTED &sec_buf); if (rc != RC_OK) ffc1ea24: 2c 03 00 00 cmpwi r3,0 <== NOT EXECUTED ffc1ea28: 40 a2 fd d0 bne- ffc1e7f8 <== NOT EXECUTED return rc; *sec_buf &= 0xF0; ffc1ea2c: 81 21 00 08 lwz r9,8(r1) <== NOT EXECUTED *sec_buf |= (uint8_t)((fat16_clv & 0xFF00)>>8); ffc1ea30: 57 de c2 3e rlwinm r30,r30,24,8,31 <== 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; ffc1ea34: 89 49 00 00 lbz r10,0(r9) <== NOT EXECUTED ffc1ea38: 55 4a 00 36 rlwinm r10,r10,0,0,27 <== NOT EXECUTED ffc1ea3c: 99 49 00 00 stb r10,0(r9) <== NOT EXECUTED *sec_buf |= (uint8_t)((fat16_clv & 0xFF00)>>8); ffc1ea40: 81 21 00 08 lwz r9,8(r1) <== NOT EXECUTED ffc1ea44: 89 49 00 00 lbz r10,0(r9) <== NOT EXECUTED ffc1ea48: 7f ca 53 78 or r10,r30,r10 <== NOT EXECUTED ffc1ea4c: 99 49 00 00 stb r10,0(r9) <== NOT EXECUTED ffc1ea50: 9b 9f 00 88 stb r28,136(r31) <== NOT EXECUTED ffc1ea54: 4b ff fd a4 b ffc1e7f8 <== NOT EXECUTED =============================================================================== ffc18114 : * RC_OK on success, or -1 if error occured * and errno set appropriately */ int fat_shutdown_drive(fat_fs_info_t *fs_info) { ffc18114: 94 21 ff e0 stwu r1,-32(r1) ffc18118: 7d 80 00 26 mfcr r12 ffc1811c: 7c 08 02 a6 mflr r0 ffc18120: 93 81 00 10 stw r28,16(r1) ffc18124: 93 c1 00 18 stw r30,24(r1) ffc18128: 7c 7e 1b 78 mr r30,r3 ffc1812c: 90 01 00 24 stw r0,36(r1) ffc18130: 93 a1 00 14 stw r29,20(r1) ffc18134: 93 e1 00 1c stw r31,28(r1) ffc18138: 91 81 00 0c stw r12,12(r1) int rc = RC_OK; int i = 0; rc = fat_sync(fs_info); ffc1813c: 4b ff fe a5 bl ffc17fe0 if ( rc != RC_OK ) ffc18140: 2e 03 00 00 cmpwi cr4,r3,0 ffc18144: 7c 7c 1b 78 mr r28,r3 ffc18148: 40 92 00 c8 bne- cr4,ffc18210 <== NEVER TAKEN rc = -1; ffc1814c: 3b a0 00 00 li r29,0 for (i = 0; i < FAT_HASH_SIZE; i++) { rtems_chain_node *node = NULL; rtems_chain_control *the_chain = fs_info->vhash + i; ffc18150: 83 fe 00 6c lwz r31,108(r30) ffc18154: 7f ff ea 14 add r31,r31,r29 while ( (node = rtems_chain_get(the_chain)) != NULL ) ffc18158: 48 00 00 08 b ffc18160 free(node); ffc1815c: 4b fe e5 b5 bl ffc06710 */ RTEMS_INLINE_ROUTINE rtems_chain_node *rtems_chain_get( rtems_chain_control *the_chain ) { return _Chain_Get( the_chain ); ffc18160: 7f e3 fb 78 mr r3,r31 ffc18164: 4b ff 47 dd bl ffc0c940 <_Chain_Get> 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 ) ffc18168: 2f 83 00 00 cmpwi cr7,r3,0 ffc1816c: 40 9e ff f0 bne+ cr7,ffc1815c rc = fat_sync(fs_info); if ( rc != RC_OK ) rc = -1; for (i = 0; i < FAT_HASH_SIZE; i++) ffc18170: 2f 9d 00 0c cmpwi cr7,r29,12 ffc18174: 3b bd 00 0c addi r29,r29,12 ffc18178: 40 be ff d8 bne- cr7,ffc18150 ffc1817c: 3b a0 00 00 li r29,0 } for (i = 0; i < FAT_HASH_SIZE; i++) { rtems_chain_node *node = NULL; rtems_chain_control *the_chain = fs_info->rhash + i; ffc18180: 83 fe 00 70 lwz r31,112(r30) ffc18184: 7f ff ea 14 add r31,r31,r29 while ( (node = rtems_chain_get(the_chain)) != NULL ) ffc18188: 48 00 00 08 b ffc18190 free(node); ffc1818c: 4b fe e5 85 bl ffc06710 <== NOT EXECUTED ffc18190: 7f e3 fb 78 mr r3,r31 ffc18194: 4b ff 47 ad bl ffc0c940 <_Chain_Get> 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 ) ffc18198: 2f 83 00 00 cmpwi cr7,r3,0 ffc1819c: 40 9e ff f0 bne+ cr7,ffc1818c <== NEVER TAKEN while ( (node = rtems_chain_get(the_chain)) != NULL ) free(node); } for (i = 0; i < FAT_HASH_SIZE; i++) ffc181a0: 2f 9d 00 0c cmpwi cr7,r29,12 ffc181a4: 3b bd 00 0c addi r29,r29,12 ffc181a8: 40 be ff d8 bne- cr7,ffc18180 while ( (node = rtems_chain_get(the_chain)) != NULL ) free(node); } free(fs_info->vhash); ffc181ac: 80 7e 00 6c lwz r3,108(r30) ffc181b0: 4b fe e5 61 bl ffc06710 free(fs_info->rhash); ffc181b4: 80 7e 00 70 lwz r3,112(r30) ffc181b8: 4b fe e5 59 bl ffc06710 free(fs_info->uino); ffc181bc: 80 7e 00 74 lwz r3,116(r30) ffc181c0: 4b fe e5 51 bl ffc06710 free(fs_info->sec_buf); ffc181c4: 80 7e 00 90 lwz r3,144(r30) ffc181c8: 4b fe e5 49 bl ffc06710 close(fs_info->vol.fd); ffc181cc: 80 7e 00 60 lwz r3,96(r30) ffc181d0: 4b fe e4 a9 bl ffc06678 if (rc) ffc181d4: 41 b2 00 10 beq+ cr4,ffc181e4 <== ALWAYS TAKEN errno = EIO; ffc181d8: 48 00 84 c5 bl ffc2069c <__errno> <== NOT EXECUTED ffc181dc: 39 20 00 05 li r9,5 <== NOT EXECUTED ffc181e0: 91 23 00 00 stw r9,0(r3) <== NOT EXECUTED return rc; } ffc181e4: 80 01 00 24 lwz r0,36(r1) ffc181e8: 7f 83 e3 78 mr r3,r28 ffc181ec: 81 81 00 0c lwz r12,12(r1) ffc181f0: 7c 08 03 a6 mtlr r0 ffc181f4: 83 81 00 10 lwz r28,16(r1) ffc181f8: 83 a1 00 14 lwz r29,20(r1) ffc181fc: 7d 80 81 20 mtcrf 8,r12 ffc18200: 83 c1 00 18 lwz r30,24(r1) ffc18204: 83 e1 00 1c lwz r31,28(r1) ffc18208: 38 21 00 20 addi r1,r1,32 ffc1820c: 4e 80 00 20 blr int rc = RC_OK; int i = 0; rc = fat_sync(fs_info); if ( rc != RC_OK ) rc = -1; ffc18210: 3b 80 ff ff li r28,-1 <== NOT EXECUTED ffc18214: 2e 1c 00 00 cmpwi cr4,r28,0 <== NOT EXECUTED ffc18218: 4b ff ff 34 b ffc1814c <== NOT EXECUTED =============================================================================== ffc17fe0 : return RC_OK; } int fat_sync(fat_fs_info_t *fs_info) { ffc17fe0: 94 21 ff d8 stwu r1,-40(r1) ffc17fe4: 7c 08 02 a6 mflr r0 ffc17fe8: 93 e1 00 24 stw r31,36(r1) ffc17fec: 7c 7f 1b 78 mr r31,r3 ffc17ff0: 90 01 00 2c stw r0,44(r1) ffc17ff4: 93 81 00 18 stw r28,24(r1) ffc17ff8: 93 a1 00 1c stw r29,28(r1) ffc17ffc: 93 c1 00 20 stw r30,32(r1) 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) ffc18000: 89 23 00 0e lbz r9,14(r3) ffc18004: 2f 89 00 04 cmpwi cr7,r9,4 ffc18008: 41 9e 00 44 beq- cr7,ffc1804c * 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; ffc1800c: 3b c0 00 00 li r30,0 rc = fat_fat32_update_fsinfo_sector(fs_info); if ( rc != RC_OK ) rc = -1; fat_buf_release(fs_info); ffc18010: 7f e3 fb 78 mr r3,r31 ffc18014: 4b ff ee ad bl ffc16ec0 if (rtems_bdbuf_syncdev(fs_info->vol.dd) != RTEMS_SUCCESSFUL) ffc18018: 80 7f 00 64 lwz r3,100(r31) ffc1801c: 4b ff c9 45 bl ffc14960 ffc18020: 2f 83 00 00 cmpwi cr7,r3,0 ffc18024: 40 9e 00 e8 bne- cr7,ffc1810c <== NEVER TAKEN rc = -1; return rc; } ffc18028: 80 01 00 2c lwz r0,44(r1) ffc1802c: 7f c3 f3 78 mr r3,r30 ffc18030: 83 81 00 18 lwz r28,24(r1) ffc18034: 7c 08 03 a6 mtlr r0 ffc18038: 83 a1 00 1c lwz r29,28(r1) ffc1803c: 83 c1 00 20 lwz r30,32(r1) ffc18040: 83 e1 00 24 lwz r31,36(r1) ffc18044: 38 21 00 28 addi r1,r1,40 ffc18048: 4e 80 00 20 blr { ssize_t ret1 = 0, ret2 = 0; if (fs_info->vol.type == FAT_FAT32) { uint32_t free_count = fs_info->vol.free_cls; ffc1804c: 81 23 00 44 lwz r9,68(r3) uint32_t next_free = fs_info->vol.next_cl; if (free_count != fs_info->vol.free_cls_in_fs_info) ffc18050: 81 43 00 48 lwz r10,72(r3) ssize_t ret1 = 0, ret2 = 0; if (fs_info->vol.type == FAT_FAT32) { uint32_t free_count = fs_info->vol.free_cls; uint32_t next_free = fs_info->vol.next_cl; ffc18054: 83 a3 00 4c lwz r29,76(r3) if (free_count != fs_info->vol.free_cls_in_fs_info) ffc18058: 7f 89 50 00 cmpw cr7,r9,r10 ffc1805c: 41 9e 00 54 beq- cr7,ffc180b0 <== ALWAYS TAKEN uint32_t value ) { uint32_t swapped; __asm__ volatile("rlwimi %0,%1,8,24,31;" ffc18060: 51 2a 46 3e rlwimi r10,r9,8,24,31 <== NOT EXECUTED ffc18064: 51 2a c4 2e rlwimi r10,r9,24,16,23 <== NOT EXECUTED ffc18068: 51 2a 42 1e rlwimi r10,r9,8,8,15 <== NOT EXECUTED ffc1806c: 51 2a c0 0e rlwimi r10,r9,24,0,7 <== NOT EXECUTED { uint32_t le_free_count = CT_LE_L(free_count); ffc18070: 7c 3e 0b 78 mr r30,r1 <== NOT EXECUTED fs_info->vol.free_cls_in_fs_info = free_count; ffc18074: 91 23 00 48 stw r9,72(r3) <== NOT EXECUTED ret1 = fat_sector_write(fs_info, ffc18078: 38 a0 01 e8 li r5,488 <== 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); ffc1807c: 95 5e 00 08 stwu r10,8(r30) <== NOT EXECUTED fs_info->vol.free_cls_in_fs_info = free_count; ret1 = fat_sector_write(fs_info, ffc18080: 38 c0 00 04 li r6,4 <== NOT EXECUTED ffc18084: a0 83 00 40 lhz r4,64(r3) <== NOT EXECUTED ffc18088: 7f c7 f3 78 mr r7,r30 <== NOT EXECUTED ffc1808c: 4b ff f1 ed bl ffc17278 <== 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) ffc18090: 81 3f 00 50 lwz r9,80(r31) <== NOT EXECUTED { uint32_t le_free_count = CT_LE_L(free_count); fs_info->vol.free_cls_in_fs_info = free_count; ret1 = fat_sector_write(fs_info, ffc18094: 7c 7c 1b 78 mr r28,r3 <== 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) ffc18098: 7f 9d 48 00 cmpw cr7,r29,r9 <== NOT EXECUTED ffc1809c: 40 9e 00 28 bne- cr7,ffc180c4 <== NOT EXECUTED sizeof(le_next_free), &le_next_free); } } if ( (ret1 < 0) || (ret2 < 0) ) ffc180a0: 2f 83 00 00 cmpwi cr7,r3,0 <== NOT EXECUTED ffc180a4: 40 9c ff 68 bge+ cr7,ffc1800c <== NOT EXECUTED { int rc = RC_OK; rc = fat_fat32_update_fsinfo_sector(fs_info); if ( rc != RC_OK ) rc = -1; ffc180a8: 3b c0 ff ff li r30,-1 <== NOT EXECUTED ffc180ac: 4b ff ff 64 b ffc18010 <== 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) ffc180b0: 81 23 00 50 lwz r9,80(r3) ffc180b4: 7f 9d 48 00 cmpw cr7,r29,r9 ffc180b8: 41 be ff 54 beq- cr7,ffc1800c <== NEVER TAKEN * 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; ffc180bc: 3b 80 00 00 li r28,0 ffc180c0: 3b c1 00 08 addi r30,r1,8 ffc180c4: 53 a9 46 3e rlwimi r9,r29,8,24,31 ffc180c8: 53 a9 c4 2e rlwimi r9,r29,24,16,23 ffc180cc: 53 a9 42 1e rlwimi r9,r29,8,8,15 ffc180d0: 53 a9 c0 0e rlwimi r9,r29,24,0,7 if (next_free != fs_info->vol.next_cl_in_fs_info) { uint32_t le_next_free = CT_LE_L(next_free); fs_info->vol.next_cl_in_fs_info = next_free; ffc180d4: 93 bf 00 50 stw r29,80(r31) ret2 = fat_sector_write(fs_info, ffc180d8: 7f e3 fb 78 mr r3,r31 ffc180dc: 38 a0 01 ec li r5,492 ffc180e0: a0 9f 00 40 lhz r4,64(r31) ffc180e4: 38 c0 00 04 li r6,4 ffc180e8: 7f c7 f3 78 mr r7,r30 &le_free_count); } if (next_free != fs_info->vol.next_cl_in_fs_info) { uint32_t le_next_free = CT_LE_L(next_free); ffc180ec: 91 21 00 08 stw r9,8(r1) fs_info->vol.next_cl_in_fs_info = next_free; ret2 = fat_sector_write(fs_info, ffc180f0: 4b ff f1 89 bl ffc17278 sizeof(le_next_free), &le_next_free); } } if ( (ret1 < 0) || (ret2 < 0) ) ffc180f4: 2f 9c 00 00 cmpwi cr7,r28,0 ffc180f8: 41 bc ff b0 blt- cr7,ffc180a8 <== NEVER TAKEN ffc180fc: 2f 83 00 00 cmpwi cr7,r3,0 ffc18100: 40 9c ff 0c bge+ cr7,ffc1800c <== ALWAYS TAKEN { int rc = RC_OK; rc = fat_fat32_update_fsinfo_sector(fs_info); if ( rc != RC_OK ) rc = -1; ffc18104: 3b c0 ff ff li r30,-1 <== NOT EXECUTED ffc18108: 4b ff ff 08 b ffc18010 <== NOT EXECUTED fat_buf_release(fs_info); if (rtems_bdbuf_syncdev(fs_info->vol.dd) != RTEMS_SUCCESSFUL) rc = -1; ffc1810c: 3b c0 ff ff li r30,-1 <== NOT EXECUTED ffc18110: 4b ff ff 18 b ffc18028 <== NOT EXECUTED =============================================================================== ffc3d79c : st.st_mode = 0; st.st_uid = 0; st.st_gid = 0; rtems_libio_check_fd( fd ); ffc3d79c: 3d 20 00 00 lis r9,0 /** * compatible with SVr4, 4.4BSD and X/OPEN - Change Directory */ int fchdir( int fd ) { ffc3d7a0: 94 21 ff 88 stwu r1,-120(r1) ffc3d7a4: 7c 08 02 a6 mflr r0 st.st_mode = 0; st.st_uid = 0; st.st_gid = 0; rtems_libio_check_fd( fd ); ffc3d7a8: 81 29 33 78 lwz r9,13176(r9) /** * compatible with SVr4, 4.4BSD and X/OPEN - Change Directory */ int fchdir( int fd ) { ffc3d7ac: 90 01 00 7c stw r0,124(r1) st.st_mode = 0; st.st_uid = 0; st.st_gid = 0; rtems_libio_check_fd( fd ); ffc3d7b0: 7f 83 48 40 cmplw cr7,r3,r9 int rv = 0; rtems_libio_t *iop; struct stat st; rtems_filesystem_location_info_t loc; st.st_mode = 0; ffc3d7b4: 39 20 00 00 li r9,0 /** * compatible with SVr4, 4.4BSD and X/OPEN - Change Directory */ int fchdir( int fd ) { ffc3d7b8: 93 a1 00 6c stw r29,108(r1) ffc3d7bc: 93 c1 00 70 stw r30,112(r1) ffc3d7c0: 93 e1 00 74 stw r31,116(r1) int rv = 0; rtems_libio_t *iop; struct stat st; rtems_filesystem_location_info_t loc; st.st_mode = 0; ffc3d7c4: 91 21 00 14 stw r9,20(r1) st.st_uid = 0; ffc3d7c8: b1 21 00 1a sth r9,26(r1) st.st_gid = 0; ffc3d7cc: b1 21 00 1c sth r9,28(r1) rtems_libio_check_fd( fd ); ffc3d7d0: 40 9c 01 08 bge- cr7,ffc3d8d8 iop = rtems_libio_iop( fd ); ffc3d7d4: 3d 20 00 00 lis r9,0 ffc3d7d8: 83 e9 34 64 lwz r31,13412(r9) ffc3d7dc: 1c 63 00 38 mulli r3,r3,56 ffc3d7e0: 7f ff 1a 14 add r31,r31,r3 rtems_libio_check_is_open( iop ); ffc3d7e4: 81 3f 00 10 lwz r9,16(r31) ffc3d7e8: 71 2a 01 00 andi. r10,r9,256 ffc3d7ec: 41 82 00 ec beq- ffc3d8d8 if ( rv == 0 ) { rv = rtems_filesystem_chdir( &loc ); } return rv; } ffc3d7f0: 80 7f 00 28 lwz r3,40(r31) rtems_libio_check_fd( fd ); iop = rtems_libio_iop( fd ); rtems_libio_check_is_open( iop ); rtems_filesystem_instance_lock( &iop->pathinfo ); rv = (*iop->pathinfo.handlers->fstat_h)( &iop->pathinfo, &st ); ffc3d7f4: 3b bf 00 14 addi r29,r31,20 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 ); ffc3d7f8: 81 23 00 0c lwz r9,12(r3) ffc3d7fc: 81 29 00 00 lwz r9,0(r9) ffc3d800: 7d 29 03 a6 mtctr r9 ffc3d804: 4e 80 04 21 bctrl ffc3d808: 81 3f 00 24 lwz r9,36(r31) ffc3d80c: 7f a3 eb 78 mr r3,r29 ffc3d810: 81 29 00 18 lwz r9,24(r9) ffc3d814: 38 81 00 08 addi r4,r1,8 ffc3d818: 7d 29 03 a6 mtctr r9 ffc3d81c: 4e 80 04 21 bctrl if ( rv == 0 ) { ffc3d820: 7c 7e 1b 79 mr. r30,r3 ffc3d824: 41 82 00 38 beq- ffc3d85c <== ALWAYS TAKEN if ( rv == 0 ) { rv = rtems_filesystem_chdir( &loc ); } return rv; } ffc3d828: 80 7f 00 28 lwz r3,40(r31) const rtems_filesystem_location_info_t *loc ) { const rtems_filesystem_mount_table_entry_t *mt_entry = loc->mt_entry; (*mt_entry->ops->unlock_h)( mt_entry ); ffc3d82c: 81 23 00 0c lwz r9,12(r3) ffc3d830: 81 29 00 04 lwz r9,4(r9) ffc3d834: 7d 29 03 a6 mtctr r9 ffc3d838: 4e 80 04 21 bctrl ffc3d83c: 80 01 00 7c lwz r0,124(r1) ffc3d840: 7f c3 f3 78 mr r3,r30 ffc3d844: 83 a1 00 6c lwz r29,108(r1) ffc3d848: 7c 08 03 a6 mtlr r0 ffc3d84c: 83 c1 00 70 lwz r30,112(r1) ffc3d850: 83 e1 00 74 lwz r31,116(r1) ffc3d854: 38 21 00 78 addi r1,r1,120 ffc3d858: 4e 80 00 20 blr rtems_libio_check_is_open( iop ); rtems_filesystem_instance_lock( &iop->pathinfo ); rv = (*iop->pathinfo.handlers->fstat_h)( &iop->pathinfo, &st ); if ( rv == 0 ) { bool access_ok = rtems_filesystem_check_access( ffc3d85c: 80 81 00 14 lwz r4,20(r1) ffc3d860: 38 60 00 01 li r3,1 ffc3d864: a0 a1 00 1a lhz r5,26(r1) ffc3d868: a0 c1 00 1c lhz r6,28(r1) ffc3d86c: 4b fd 44 bd bl ffc11d28 st.st_mode, st.st_uid, st.st_gid ); if ( access_ok ) { ffc3d870: 2f 83 00 00 cmpwi cr7,r3,0 ffc3d874: 41 9e 00 50 beq- cr7,ffc3d8c4 rtems_filesystem_location_clone( &loc, &iop->pathinfo ); ffc3d878: 7f a4 eb 78 mr r4,r29 ffc3d87c: 38 61 00 50 addi r3,r1,80 ffc3d880: 4b fd 3b e1 bl ffc11460 if ( rv == 0 ) { rv = rtems_filesystem_chdir( &loc ); } return rv; } ffc3d884: 80 7f 00 28 lwz r3,40(r31) ffc3d888: 81 23 00 0c lwz r9,12(r3) ffc3d88c: 81 29 00 04 lwz r9,4(r9) ffc3d890: 7d 29 03 a6 mtctr r9 ffc3d894: 4e 80 04 21 bctrl } } rtems_filesystem_instance_unlock( &iop->pathinfo ); if ( rv == 0 ) { rv = rtems_filesystem_chdir( &loc ); ffc3d898: 38 61 00 50 addi r3,r1,80 ffc3d89c: 4b fe db d1 bl ffc2b46c } return rv; } ffc3d8a0: 80 01 00 7c lwz r0,124(r1) } } rtems_filesystem_instance_unlock( &iop->pathinfo ); if ( rv == 0 ) { rv = rtems_filesystem_chdir( &loc ); ffc3d8a4: 7c 7e 1b 78 mr r30,r3 } return rv; } ffc3d8a8: 83 a1 00 6c lwz r29,108(r1) ffc3d8ac: 7c 08 03 a6 mtlr r0 ffc3d8b0: 7f c3 f3 78 mr r3,r30 ffc3d8b4: 83 e1 00 74 lwz r31,116(r1) ffc3d8b8: 83 c1 00 70 lwz r30,112(r1) ffc3d8bc: 38 21 00 78 addi r1,r1,120 ffc3d8c0: 4e 80 00 20 blr ); if ( access_ok ) { rtems_filesystem_location_clone( &loc, &iop->pathinfo ); } else { errno = EACCES; ffc3d8c4: 48 00 51 a1 bl ffc42a64 <__errno> ffc3d8c8: 39 20 00 0d li r9,13 ffc3d8cc: 91 23 00 00 stw r9,0(r3) rv = -1; ffc3d8d0: 3b c0 ff ff li r30,-1 ffc3d8d4: 4b ff ff 54 b ffc3d828 st.st_uid = 0; st.st_gid = 0; rtems_libio_check_fd( fd ); iop = rtems_libio_iop( fd ); rtems_libio_check_is_open( iop ); ffc3d8d8: 48 00 51 8d bl ffc42a64 <__errno> ffc3d8dc: 39 20 00 09 li r9,9 ffc3d8e0: 91 23 00 00 stw r9,0(r3) ffc3d8e4: 3b c0 ff ff li r30,-1 ffc3d8e8: 4b ff ff 54 b ffc3d83c =============================================================================== ffc2bb20 : int fchmod( int fd, mode_t mode ) { int rv; rtems_libio_t *iop; rtems_libio_check_fd( fd ); ffc2bb20: 3d 20 00 00 lis r9,0 /** * POSIX 1003.1b 5.6.4 - Change File Modes */ int fchmod( int fd, mode_t mode ) { ffc2bb24: 94 21 ff e8 stwu r1,-24(r1) ffc2bb28: 7c 08 02 a6 mflr r0 int rv; rtems_libio_t *iop; rtems_libio_check_fd( fd ); ffc2bb2c: 81 29 33 78 lwz r9,13176(r9) /** * POSIX 1003.1b 5.6.4 - Change File Modes */ int fchmod( int fd, mode_t mode ) { ffc2bb30: 90 01 00 1c stw r0,28(r1) int rv; rtems_libio_t *iop; rtems_libio_check_fd( fd ); ffc2bb34: 7f 83 48 40 cmplw cr7,r3,r9 /** * POSIX 1003.1b 5.6.4 - Change File Modes */ int fchmod( int fd, mode_t mode ) { ffc2bb38: 93 c1 00 10 stw r30,16(r1) ffc2bb3c: 93 e1 00 14 stw r31,20(r1) int rv; rtems_libio_t *iop; rtems_libio_check_fd( fd ); ffc2bb40: 40 9c 00 c0 bge- cr7,ffc2bc00 iop = rtems_libio_iop( fd ); ffc2bb44: 3d 20 00 00 lis r9,0 ffc2bb48: 83 e9 34 64 lwz r31,13412(r9) ffc2bb4c: 1c 63 00 38 mulli r3,r3,56 ffc2bb50: 7f ff 1a 14 add r31,r31,r3 rtems_libio_check_is_open(iop); ffc2bb54: 81 3f 00 10 lwz r9,16(r31) ffc2bb58: 71 2a 01 00 andi. r10,r9,256 ffc2bb5c: 41 82 00 a4 beq- ffc2bc00 if (iop->pathinfo.mt_entry->writeable) { ffc2bb60: 80 7f 00 28 lwz r3,40(r31) ffc2bb64: 89 23 00 29 lbz r9,41(r3) ffc2bb68: 2f 89 00 00 cmpwi cr7,r9,0 ffc2bb6c: 40 9e 00 30 bne- cr7,ffc2bb9c <== ALWAYS TAKEN rtems_filesystem_instance_lock( &iop->pathinfo ); rv = (*iop->pathinfo.mt_entry->ops->fchmod_h)( &iop->pathinfo, mode ); rtems_filesystem_instance_unlock( &iop->pathinfo ); } else { errno = EROFS; ffc2bb70: 48 01 6e f5 bl ffc42a64 <__errno> <== NOT EXECUTED ffc2bb74: 39 20 00 1e li r9,30 <== NOT EXECUTED ffc2bb78: 91 23 00 00 stw r9,0(r3) <== NOT EXECUTED rv = -1; ffc2bb7c: 3b c0 ff ff li r30,-1 <== NOT EXECUTED } return rv; } ffc2bb80: 80 01 00 1c lwz r0,28(r1) ffc2bb84: 7f c3 f3 78 mr r3,r30 ffc2bb88: 83 e1 00 14 lwz r31,20(r1) ffc2bb8c: 7c 08 03 a6 mtlr r0 ffc2bb90: 83 c1 00 10 lwz r30,16(r1) ffc2bb94: 38 21 00 18 addi r1,r1,24 ffc2bb98: 4e 80 00 20 blr 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 ); ffc2bb9c: 81 23 00 0c lwz r9,12(r3) ffc2bba0: 81 29 00 00 lwz r9,0(r9) ffc2bba4: 90 81 00 08 stw r4,8(r1) ffc2bba8: 7d 29 03 a6 mtctr r9 ffc2bbac: 4e 80 04 21 bctrl iop = rtems_libio_iop( fd ); rtems_libio_check_is_open(iop); if (iop->pathinfo.mt_entry->writeable) { rtems_filesystem_instance_lock( &iop->pathinfo ); rv = (*iop->pathinfo.mt_entry->ops->fchmod_h)( &iop->pathinfo, mode ); ffc2bbb0: 81 3f 00 28 lwz r9,40(r31) ffc2bbb4: 80 81 00 08 lwz r4,8(r1) ffc2bbb8: 38 7f 00 14 addi r3,r31,20 ffc2bbbc: 81 29 00 0c lwz r9,12(r9) ffc2bbc0: 81 29 00 20 lwz r9,32(r9) ffc2bbc4: 7d 29 03 a6 mtctr r9 ffc2bbc8: 4e 80 04 21 bctrl ffc2bbcc: 7c 7e 1b 78 mr r30,r3 errno = EROFS; rv = -1; } return rv; } ffc2bbd0: 80 7f 00 28 lwz r3,40(r31) const rtems_filesystem_location_info_t *loc ) { const rtems_filesystem_mount_table_entry_t *mt_entry = loc->mt_entry; (*mt_entry->ops->unlock_h)( mt_entry ); ffc2bbd4: 81 23 00 0c lwz r9,12(r3) ffc2bbd8: 81 29 00 04 lwz r9,4(r9) ffc2bbdc: 7d 29 03 a6 mtctr r9 ffc2bbe0: 4e 80 04 21 bctrl ffc2bbe4: 80 01 00 1c lwz r0,28(r1) ffc2bbe8: 7f c3 f3 78 mr r3,r30 ffc2bbec: 83 e1 00 14 lwz r31,20(r1) ffc2bbf0: 7c 08 03 a6 mtlr r0 ffc2bbf4: 83 c1 00 10 lwz r30,16(r1) ffc2bbf8: 38 21 00 18 addi r1,r1,24 ffc2bbfc: 4e 80 00 20 blr int rv; rtems_libio_t *iop; rtems_libio_check_fd( fd ); iop = rtems_libio_iop( fd ); rtems_libio_check_is_open(iop); ffc2bc00: 48 01 6e 65 bl ffc42a64 <__errno> ffc2bc04: 39 20 00 09 li r9,9 ffc2bc08: 91 23 00 00 stw r9,0(r3) ffc2bc0c: 3b c0 ff ff li r30,-1 ffc2bc10: 4b ff ff 70 b ffc2bb80 =============================================================================== ffc2bc14 : int fchown( int fd, uid_t owner, gid_t group ) { int rv = 0; rtems_libio_t *iop; rtems_libio_check_fd( fd ); ffc2bc14: 3d 20 00 00 lis r9,0 /** * POSIX 1003.1b 5.6.5 - Change Owner and Group of a File */ int fchown( int fd, uid_t owner, gid_t group ) { ffc2bc18: 94 21 ff e8 stwu r1,-24(r1) ffc2bc1c: 7c 08 02 a6 mflr r0 int rv = 0; rtems_libio_t *iop; rtems_libio_check_fd( fd ); ffc2bc20: 81 29 33 78 lwz r9,13176(r9) /** * POSIX 1003.1b 5.6.5 - Change Owner and Group of a File */ int fchown( int fd, uid_t owner, gid_t group ) { ffc2bc24: 90 01 00 1c stw r0,28(r1) int rv = 0; rtems_libio_t *iop; rtems_libio_check_fd( fd ); ffc2bc28: 7f 83 48 40 cmplw cr7,r3,r9 /** * POSIX 1003.1b 5.6.5 - Change Owner and Group of a File */ int fchown( int fd, uid_t owner, gid_t group ) { ffc2bc2c: 93 c1 00 10 stw r30,16(r1) ffc2bc30: 93 e1 00 14 stw r31,20(r1) int rv = 0; rtems_libio_t *iop; rtems_libio_check_fd( fd ); ffc2bc34: 40 9c 00 c8 bge- cr7,ffc2bcfc iop = rtems_libio_iop( fd ); ffc2bc38: 3d 20 00 00 lis r9,0 ffc2bc3c: 83 e9 34 64 lwz r31,13412(r9) ffc2bc40: 1c 63 00 38 mulli r3,r3,56 ffc2bc44: 7f ff 1a 14 add r31,r31,r3 rtems_libio_check_is_open(iop); ffc2bc48: 81 3f 00 10 lwz r9,16(r31) ffc2bc4c: 71 2a 01 00 andi. r10,r9,256 ffc2bc50: 41 82 00 ac beq- ffc2bcfc if (iop->pathinfo.mt_entry->writeable) { ffc2bc54: 80 7f 00 28 lwz r3,40(r31) ffc2bc58: 89 23 00 29 lbz r9,41(r3) ffc2bc5c: 2f 89 00 00 cmpwi cr7,r9,0 ffc2bc60: 40 9e 00 30 bne- cr7,ffc2bc90 <== ALWAYS TAKEN owner, group ); rtems_filesystem_instance_unlock( &iop->pathinfo ); } else { errno = EROFS; ffc2bc64: 48 01 6e 01 bl ffc42a64 <__errno> <== NOT EXECUTED ffc2bc68: 39 20 00 1e li r9,30 <== NOT EXECUTED ffc2bc6c: 91 23 00 00 stw r9,0(r3) <== NOT EXECUTED rv = -1; ffc2bc70: 3b c0 ff ff li r30,-1 <== NOT EXECUTED } return rv; } ffc2bc74: 80 01 00 1c lwz r0,28(r1) ffc2bc78: 7f c3 f3 78 mr r3,r30 ffc2bc7c: 83 e1 00 14 lwz r31,20(r1) ffc2bc80: 7c 08 03 a6 mtlr r0 ffc2bc84: 83 c1 00 10 lwz r30,16(r1) ffc2bc88: 38 21 00 18 addi r1,r1,24 ffc2bc8c: 4e 80 00 20 blr 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 ); ffc2bc90: 81 23 00 0c lwz r9,12(r3) ffc2bc94: 81 29 00 00 lwz r9,0(r9) ffc2bc98: 90 81 00 08 stw r4,8(r1) ffc2bc9c: 7d 29 03 a6 mtctr r9 ffc2bca0: 90 a1 00 0c stw r5,12(r1) ffc2bca4: 4e 80 04 21 bctrl iop = rtems_libio_iop( fd ); rtems_libio_check_is_open(iop); if (iop->pathinfo.mt_entry->writeable) { rtems_filesystem_instance_lock( &iop->pathinfo ); rv = (*iop->pathinfo.mt_entry->ops->chown_h)( ffc2bca8: 81 3f 00 28 lwz r9,40(r31) ffc2bcac: 80 81 00 08 lwz r4,8(r1) ffc2bcb0: 38 7f 00 14 addi r3,r31,20 ffc2bcb4: 81 29 00 0c lwz r9,12(r9) ffc2bcb8: 80 a1 00 0c lwz r5,12(r1) ffc2bcbc: 81 29 00 24 lwz r9,36(r9) ffc2bcc0: 7d 29 03 a6 mtctr r9 ffc2bcc4: 4e 80 04 21 bctrl ffc2bcc8: 7c 7e 1b 78 mr r30,r3 errno = EROFS; rv = -1; } return rv; } ffc2bccc: 80 7f 00 28 lwz r3,40(r31) const rtems_filesystem_location_info_t *loc ) { const rtems_filesystem_mount_table_entry_t *mt_entry = loc->mt_entry; (*mt_entry->ops->unlock_h)( mt_entry ); ffc2bcd0: 81 23 00 0c lwz r9,12(r3) ffc2bcd4: 81 29 00 04 lwz r9,4(r9) ffc2bcd8: 7d 29 03 a6 mtctr r9 ffc2bcdc: 4e 80 04 21 bctrl ffc2bce0: 80 01 00 1c lwz r0,28(r1) ffc2bce4: 7f c3 f3 78 mr r3,r30 ffc2bce8: 83 e1 00 14 lwz r31,20(r1) ffc2bcec: 7c 08 03 a6 mtlr r0 ffc2bcf0: 83 c1 00 10 lwz r30,16(r1) ffc2bcf4: 38 21 00 18 addi r1,r1,24 ffc2bcf8: 4e 80 00 20 blr int rv = 0; rtems_libio_t *iop; rtems_libio_check_fd( fd ); iop = rtems_libio_iop( fd ); rtems_libio_check_is_open(iop); ffc2bcfc: 48 01 6d 69 bl ffc42a64 <__errno> ffc2bd00: 39 20 00 09 li r9,9 ffc2bd04: 91 23 00 00 stw r9,0(r3) ffc2bd08: 3b c0 ff ff li r30,-1 ffc2bd0c: 4b ff ff 68 b ffc2bc74 =============================================================================== ffc37d28 : int fd2; int flags; int mask; int ret = 0; rtems_libio_check_fd( fd ); ffc37d28: 3d 20 00 00 lis r9,0 int fcntl( int fd, int cmd, ... ) { ffc37d2c: 7d 80 00 26 mfcr r12 int fd2; int flags; int mask; int ret = 0; rtems_libio_check_fd( fd ); ffc37d30: 81 29 27 78 lwz r9,10104(r9) ... ) { int ret; va_list ap; va_start( ap, cmd ); ffc37d34: 39 40 00 02 li r10,2 int fcntl( int fd, int cmd, ... ) { ffc37d38: 94 21 ff b8 stwu r1,-72(r1) ffc37d3c: 7c 08 02 a6 mflr r0 int fd2; int flags; int mask; int ret = 0; rtems_libio_check_fd( fd ); ffc37d40: 7f 83 48 40 cmplw cr7,r3,r9 ... ) { int ret; va_list ap; va_start( ap, cmd ); ffc37d44: 99 41 00 08 stb r10,8(r1) ffc37d48: 39 41 00 50 addi r10,r1,80 ffc37d4c: 91 41 00 0c stw r10,12(r1) ffc37d50: 39 41 00 10 addi r10,r1,16 int fcntl( int fd, int cmd, ... ) { ffc37d54: 90 01 00 4c stw r0,76(r1) ffc37d58: 93 41 00 30 stw r26,48(r1) ffc37d5c: 93 61 00 34 stw r27,52(r1) ffc37d60: 93 81 00 38 stw r28,56(r1) ffc37d64: 93 a1 00 3c stw r29,60(r1) ffc37d68: 93 c1 00 40 stw r30,64(r1) ffc37d6c: 93 e1 00 44 stw r31,68(r1) ffc37d70: 91 81 00 2c stw r12,44(r1) ffc37d74: 90 a1 00 18 stw r5,24(r1) ffc37d78: 90 c1 00 1c stw r6,28(r1) ffc37d7c: 90 e1 00 20 stw r7,32(r1) int ret; va_list ap; va_start( ap, cmd ); ffc37d80: 91 41 00 10 stw r10,16(r1) int fd2; int flags; int mask; int ret = 0; rtems_libio_check_fd( fd ); ffc37d84: 40 9c 02 8c bge- cr7,ffc38010 iop = rtems_libio_iop( fd ); ffc37d88: 3f 80 00 00 lis r28,0 ffc37d8c: 1f a3 00 38 mulli r29,r3,56 ffc37d90: 81 3c 28 24 lwz r9,10276(r28) ffc37d94: 7f a9 ea 14 add r29,r9,r29 rtems_libio_check_is_open(iop); ffc37d98: 80 7d 00 10 lwz r3,16(r29) ffc37d9c: 70 69 01 00 andi. r9,r3,256 ffc37da0: 41 82 02 70 beq- ffc38010 /* * This switch should contain all the cases from POSIX. */ switch ( cmd ) { ffc37da4: 2b 84 00 09 cmplwi cr7,r4,9 ffc37da8: 7c 9e 23 78 mr r30,r4 ffc37dac: 40 9d 00 48 ble- cr7,ffc37df4 errno = ENOTSUP; ret = -1; break; default: errno = EINVAL; ffc37db0: 4b ff 01 8d bl ffc27f3c <__errno> ffc37db4: 39 20 00 16 li r9,22 ffc37db8: 91 23 00 00 stw r9,0(r3) int mask; int ret = 0; rtems_libio_check_fd( fd ); iop = rtems_libio_iop( fd ); rtems_libio_check_is_open(iop); ffc37dbc: 3b e0 ff ff li r31,-1 va_list ap; va_start( ap, cmd ); ret = vfcntl(fd,cmd,ap); va_end(ap); return ret; } ffc37dc0: 80 01 00 4c lwz r0,76(r1) ffc37dc4: 7f e3 fb 78 mr r3,r31 ffc37dc8: 81 81 00 2c lwz r12,44(r1) ffc37dcc: 7c 08 03 a6 mtlr r0 ffc37dd0: 83 41 00 30 lwz r26,48(r1) ffc37dd4: 83 61 00 34 lwz r27,52(r1) ffc37dd8: 7d 80 81 20 mtcrf 8,r12 ffc37ddc: 83 81 00 38 lwz r28,56(r1) ffc37de0: 83 a1 00 3c lwz r29,60(r1) ffc37de4: 83 c1 00 40 lwz r30,64(r1) ffc37de8: 83 e1 00 44 lwz r31,68(r1) ffc37dec: 38 21 00 48 addi r1,r1,72 ffc37df0: 4e 80 00 20 blr /* * This switch should contain all the cases from POSIX. */ switch ( cmd ) { ffc37df4: 3d 20 ff c4 lis r9,-60 ffc37df8: 39 29 e0 78 addi r9,r9,-8072 ffc37dfc: 54 8a 10 3a rlwinm r10,r4,2,0,29 ffc37e00: 7d 49 50 2e lwzx r10,r9,r10 ffc37e04: 7d 2a 4a 14 add r9,r10,r9 ffc37e08: 7d 29 03 a6 mtctr r9 ffc37e0c: 4e 80 04 20 bctr errno = ENOTSUP; ret = -1; break; case F_GETOWN: /* for sockets. */ errno = ENOTSUP; ffc37e10: 4b ff 01 2d bl ffc27f3c <__errno> ffc37e14: 39 20 00 86 li r9,134 ffc37e18: 91 23 00 00 stw r9,0(r3) ffc37e1c: 4b ff ff a0 b ffc37dbc case F_GETFL: /* more flags (cloexec) */ ret = rtems_libio_to_fcntl_flags( iop->flags ); break; case F_SETFL: flags = rtems_libio_fcntl_flags( va_arg( ap, int ) ); ffc37e20: 89 21 00 08 lbz r9,8(r1) ffc37e24: 2b 89 00 07 cmplwi cr7,r9,7 ffc37e28: 40 9d 01 d0 ble- cr7,ffc37ff8 <== ALWAYS TAKEN ffc37e2c: 81 41 00 0c lwz r10,12(r1) <== NOT EXECUTED ffc37e30: 39 2a 00 04 addi r9,r10,4 <== NOT EXECUTED ffc37e34: 91 21 00 0c stw r9,12(r1) <== NOT EXECUTED ffc37e38: 80 6a 00 00 lwz r3,0(r10) { rtems_libio_t *iop; int fd2; int flags; int mask; int ret = 0; ffc37e3c: 3b e0 00 00 li r31,0 case F_GETFL: /* more flags (cloexec) */ ret = rtems_libio_to_fcntl_flags( iop->flags ); break; case F_SETFL: flags = rtems_libio_fcntl_flags( va_arg( ap, int ) ); ffc37e40: 4b fd 28 ad bl ffc0a6ec /* * XXX If we are turning on append, should we seek to the end? */ iop->flags = (iop->flags & ~mask) | (flags & mask); ffc37e44: 81 3d 00 10 lwz r9,16(r29) ffc37e48: 70 63 02 01 andi. r3,r3,513 ffc37e4c: 39 40 fd fe li r10,-514 ffc37e50: 7d 49 48 38 and r9,r10,r9 ffc37e54: 7c 69 4b 78 or r9,r3,r9 ffc37e58: 91 3d 00 10 stw r9,16(r29) ffc37e5c: 48 00 00 14 b ffc37e70 else iop->flags &= ~LIBIO_FLAGS_CLOSE_ON_EXEC; break; case F_GETFL: /* more flags (cloexec) */ ret = rtems_libio_to_fcntl_flags( iop->flags ); ffc37e60: 4b fd 28 ed bl ffc0a74c ffc37e64: 2e 03 00 00 cmpwi cr4,r3,0 ffc37e68: 7c 7f 1b 78 mr r31,r3 /* * If we got this far successfully, then we give the optional * filesystem specific handler a chance to process this. */ if (ret >= 0) { ffc37e6c: 41 b0 ff 54 blt- cr4,ffc37dc0 <== NEVER TAKEN int err = (*iop->pathinfo.handlers->fcntl_h)( iop, cmd ); ffc37e70: 81 3d 00 24 lwz r9,36(r29) ffc37e74: 7f c4 f3 78 mr r4,r30 ffc37e78: 7f a3 eb 78 mr r3,r29 ffc37e7c: 81 29 00 28 lwz r9,40(r9) ffc37e80: 7d 29 03 a6 mtctr r9 ffc37e84: 4e 80 04 21 bctrl if (err) { ffc37e88: 7c 7e 1b 79 mr. r30,r3 ffc37e8c: 41 82 ff 34 beq+ ffc37dc0 <== ALWAYS TAKEN errno = err; ffc37e90: 4b ff 00 ad bl ffc27f3c <__errno> <== NOT EXECUTED va_list ap; va_start( ap, cmd ); ret = vfcntl(fd,cmd,ap); va_end(ap); return ret; } ffc37e94: 80 01 00 4c lwz r0,76(r1) <== NOT EXECUTED ffc37e98: 81 81 00 2c lwz r12,44(r1) <== NOT EXECUTED if (ret >= 0) { int err = (*iop->pathinfo.handlers->fcntl_h)( iop, cmd ); if (err) { errno = err; ret = -1; ffc37e9c: 3b e0 ff ff li r31,-1 <== NOT EXECUTED va_list ap; va_start( ap, cmd ); ret = vfcntl(fd,cmd,ap); va_end(ap); return ret; } ffc37ea0: 7c 08 03 a6 mtlr r0 <== NOT EXECUTED */ if (ret >= 0) { int err = (*iop->pathinfo.handlers->fcntl_h)( iop, cmd ); if (err) { errno = err; ffc37ea4: 93 c3 00 00 stw r30,0(r3) <== NOT EXECUTED va_list ap; va_start( ap, cmd ); ret = vfcntl(fd,cmd,ap); va_end(ap); return ret; } ffc37ea8: 7d 80 81 20 mtcrf 8,r12 <== NOT EXECUTED ffc37eac: 7f e3 fb 78 mr r3,r31 <== NOT EXECUTED ffc37eb0: 83 41 00 30 lwz r26,48(r1) <== NOT EXECUTED ffc37eb4: 83 61 00 34 lwz r27,52(r1) <== NOT EXECUTED ffc37eb8: 83 81 00 38 lwz r28,56(r1) <== NOT EXECUTED ffc37ebc: 83 a1 00 3c lwz r29,60(r1) <== NOT EXECUTED ffc37ec0: 83 c1 00 40 lwz r30,64(r1) <== NOT EXECUTED ffc37ec4: 83 e1 00 44 lwz r31,68(r1) <== NOT EXECUTED ffc37ec8: 38 21 00 48 addi r1,r1,72 <== NOT EXECUTED ffc37ecc: 4e 80 00 20 blr <== NOT EXECUTED * 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 ) ) ffc37ed0: 89 21 00 08 lbz r9,8(r1) ffc37ed4: 2b 89 00 07 cmplwi cr7,r9,7 ffc37ed8: 41 9d 01 10 bgt- cr7,ffc37fe8 <== NEVER TAKEN ffc37edc: 55 28 10 3a rlwinm r8,r9,2,0,29 ffc37ee0: 81 41 00 10 lwz r10,16(r1) ffc37ee4: 39 29 00 01 addi r9,r9,1 ffc37ee8: 99 21 00 08 stb r9,8(r1) ffc37eec: 7d 4a 42 14 add r10,r10,r8 ffc37ef0: 81 2a 00 00 lwz r9,0(r10) ffc37ef4: 2f 89 00 00 cmpwi cr7,r9,0 ffc37ef8: 41 9e 01 2c beq- cr7,ffc38024 iop->flags |= LIBIO_FLAGS_CLOSE_ON_EXEC; ffc37efc: 60 63 08 00 ori r3,r3,2048 ffc37f00: 90 7d 00 10 stw r3,16(r29) { rtems_libio_t *iop; int fd2; int flags; int mask; int ret = 0; ffc37f04: 3b e0 00 00 li r31,0 ffc37f08: 4b ff ff 68 b ffc37e70 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); ffc37f0c: 54 7f af fe rlwinm r31,r3,21,31,31 ffc37f10: 4b ff ff 60 b ffc37e70 * This switch should contain all the cases from POSIX. */ switch ( cmd ) { case F_DUPFD: /* dup */ fd2 = va_arg( ap, int ); ffc37f14: 89 21 00 08 lbz r9,8(r1) ffc37f18: 2b 89 00 07 cmplwi cr7,r9,7 ffc37f1c: 41 9d 00 bc bgt- cr7,ffc37fd8 <== NEVER TAKEN ffc37f20: 39 29 00 01 addi r9,r9,1 ffc37f24: 99 21 00 08 stb r9,8(r1) /* * FIXME: We ignore the start value fd2 for the file descriptor search. This * is not POSIX conform. */ rtems_libio_t *diop = rtems_libio_allocate(); ffc37f28: 4b fd 28 75 bl ffc0a79c if (diop != NULL) { ffc37f2c: 7c 7b 1b 79 mr. r27,r3 ffc37f30: 41 a2 fe 8c beq- ffc37dbc int oflag = rtems_libio_to_fcntl_flags( iop->flags ); ffc37f34: 80 7d 00 10 lwz r3,16(r29) ffc37f38: 4b fd 28 15 bl ffc0a74c oflag &= ~O_CREAT; diop->flags |= rtems_libio_fcntl_flags( oflag ); ffc37f3c: 83 5b 00 10 lwz r26,16(r27) rtems_libio_t *diop = rtems_libio_allocate(); if (diop != NULL) { int oflag = rtems_libio_to_fcntl_flags( iop->flags ); oflag &= ~O_CREAT; ffc37f40: 54 7f 05 ea rlwinm r31,r3,0,23,21 diop->flags |= rtems_libio_fcntl_flags( oflag ); ffc37f44: 7f e3 fb 78 mr r3,r31 ffc37f48: 4b fd 27 a5 bl ffc0a6ec int cmd, int arg ) { return fcntl( fd, cmd, arg ); } ffc37f4c: 81 3d 00 28 lwz r9,40(r29) if (diop != NULL) { int oflag = rtems_libio_to_fcntl_flags( iop->flags ); oflag &= ~O_CREAT; diop->flags |= rtems_libio_fcntl_flags( oflag ); ffc37f50: 7c 7a d3 78 or r26,r3,r26 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 ); ffc37f54: 81 49 00 0c lwz r10,12(r9) ffc37f58: 7d 23 4b 78 mr r3,r9 ffc37f5c: 81 2a 00 00 lwz r9,0(r10) ffc37f60: 93 5b 00 10 stw r26,16(r27) ffc37f64: 7d 29 03 a6 mtctr r9 ffc37f68: 4e 80 04 21 bctrl rtems_filesystem_instance_lock( &iop->pathinfo ); rtems_filesystem_location_clone( &diop->pathinfo, &iop->pathinfo ); ffc37f6c: 38 9d 00 14 addi r4,r29,20 ffc37f70: 38 7b 00 14 addi r3,r27,20 ffc37f74: 4b fe 40 31 bl ffc1bfa4 int cmd, int arg ) { return fcntl( fd, cmd, arg ); } ffc37f78: 80 7d 00 28 lwz r3,40(r29) const rtems_filesystem_location_info_t *loc ) { const rtems_filesystem_mount_table_entry_t *mt_entry = loc->mt_entry; (*mt_entry->ops->unlock_h)( mt_entry ); ffc37f7c: 81 23 00 0c lwz r9,12(r3) ffc37f80: 81 29 00 04 lwz r9,4(r9) ffc37f84: 7d 29 03 a6 mtctr r9 ffc37f88: 4e 80 04 21 bctrl /* * 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 ); ffc37f8c: 81 3b 00 24 lwz r9,36(r27) ffc37f90: 7f e5 fb 78 mr r5,r31 ffc37f94: 81 29 00 00 lwz r9,0(r9) ffc37f98: 7f 63 db 78 mr r3,r27 ffc37f9c: 38 80 00 00 li r4,0 ffc37fa0: 38 c0 00 00 li r6,0 ffc37fa4: 7d 29 03 a6 mtctr r9 ffc37fa8: 4e 80 04 21 bctrl if ( rv == 0 ) { ffc37fac: 2e 03 00 00 cmpwi cr4,r3,0 ffc37fb0: 7c 7f 1b 78 mr r31,r3 ffc37fb4: 40 92 00 80 bne- cr4,ffc38034 <== NEVER TAKEN rv = diop - rtems_libio_iops; ffc37fb8: 83 fc 28 24 lwz r31,10276(r28) ffc37fbc: 3d 20 b6 db lis r9,-18725 ffc37fc0: 61 29 6d b7 ori r9,r9,28087 ffc37fc4: 7f ff d8 50 subf r31,r31,r27 ffc37fc8: 7f ff 1e 70 srawi r31,r31,3 ffc37fcc: 7f ff 49 d6 mullw r31,r31,r9 ffc37fd0: 2e 1f 00 00 cmpwi cr4,r31,0 ffc37fd4: 4b ff fe 98 b ffc37e6c * This switch should contain all the cases from POSIX. */ switch ( cmd ) { case F_DUPFD: /* dup */ fd2 = va_arg( ap, int ); ffc37fd8: 81 21 00 0c lwz r9,12(r1) <== NOT EXECUTED ffc37fdc: 39 29 00 04 addi r9,r9,4 <== NOT EXECUTED ffc37fe0: 91 21 00 0c stw r9,12(r1) <== NOT EXECUTED ffc37fe4: 4b ff ff 44 b ffc37f28 <== NOT EXECUTED * 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 ) ) ffc37fe8: 81 41 00 0c lwz r10,12(r1) <== NOT EXECUTED ffc37fec: 39 2a 00 04 addi r9,r10,4 <== NOT EXECUTED ffc37ff0: 91 21 00 0c stw r9,12(r1) <== NOT EXECUTED ffc37ff4: 4b ff fe fc b ffc37ef0 <== NOT EXECUTED case F_GETFL: /* more flags (cloexec) */ ret = rtems_libio_to_fcntl_flags( iop->flags ); break; case F_SETFL: flags = rtems_libio_fcntl_flags( va_arg( ap, int ) ); ffc37ff8: 81 41 00 10 lwz r10,16(r1) ffc37ffc: 55 28 10 3a rlwinm r8,r9,2,0,29 ffc38000: 39 29 00 01 addi r9,r9,1 ffc38004: 7d 4a 42 14 add r10,r10,r8 ffc38008: 99 21 00 08 stb r9,8(r1) ffc3800c: 4b ff fe 2c b ffc37e38 int mask; int ret = 0; rtems_libio_check_fd( fd ); iop = rtems_libio_iop( fd ); rtems_libio_check_is_open(iop); ffc38010: 4b fe ff 2d bl ffc27f3c <__errno> ffc38014: 39 20 00 09 li r9,9 ffc38018: 91 23 00 00 stw r9,0(r3) ffc3801c: 3b e0 ff ff li r31,-1 ffc38020: 4b ff fd a0 b ffc37dc0 */ if ( va_arg( ap, int ) ) iop->flags |= LIBIO_FLAGS_CLOSE_ON_EXEC; else iop->flags &= ~LIBIO_FLAGS_CLOSE_ON_EXEC; ffc38024: 54 63 05 66 rlwinm r3,r3,0,21,19 ffc38028: 90 7d 00 10 stw r3,16(r29) { rtems_libio_t *iop; int fd2; int flags; int mask; int ret = 0; ffc3802c: 3b e0 00 00 li r31,0 ffc38030: 4b ff fe 40 b ffc37e70 */ rv = (*diop->pathinfo.handlers->open_h)( diop, NULL, oflag, 0 ); if ( rv == 0 ) { rv = diop - rtems_libio_iops; } else { rtems_libio_free( diop ); ffc38034: 7f 63 db 78 mr r3,r27 <== NOT EXECUTED ffc38038: 4b fd 27 e1 bl ffc0a818 <== NOT EXECUTED ffc3803c: 4b ff fe 30 b ffc37e6c <== NOT EXECUTED =============================================================================== ffc10eb0 : int fifo_open( pipe_control_t **pipep, rtems_libio_t *iop ) { ffc10eb0: 94 21 ff d0 stwu r1,-48(r1) ffc10eb4: 7c 08 02 a6 mflr r0 ffc10eb8: 93 e1 00 2c stw r31,44(r1) static int pipe_lock(void) { rtems_status_code sc = RTEMS_SUCCESSFUL; if (pipe_semaphore == RTEMS_ID_NONE) { ffc10ebc: 3f e0 00 00 lis r31,0 ffc10ec0: 81 3f 29 a8 lwz r9,10664(r31) int fifo_open( pipe_control_t **pipep, rtems_libio_t *iop ) { ffc10ec4: 93 81 00 20 stw r28,32(r1) ffc10ec8: 7c 9c 23 78 mr r28,r4 static int pipe_lock(void) { rtems_status_code sc = RTEMS_SUCCESSFUL; if (pipe_semaphore == RTEMS_ID_NONE) { ffc10ecc: 2f 89 00 00 cmpwi cr7,r9,0 int fifo_open( pipe_control_t **pipep, rtems_libio_t *iop ) { ffc10ed0: 93 a1 00 24 stw r29,36(r1) ffc10ed4: 7c 7d 1b 78 mr r29,r3 ffc10ed8: 93 c1 00 28 stw r30,40(r1) static int pipe_lock(void) { rtems_status_code sc = RTEMS_SUCCESSFUL; if (pipe_semaphore == RTEMS_ID_NONE) { ffc10edc: 3b df 29 a8 addi r30,r31,10664 int fifo_open( pipe_control_t **pipep, rtems_libio_t *iop ) { ffc10ee0: 90 01 00 34 stw r0,52(r1) ffc10ee4: 93 61 00 1c stw r27,28(r1) static int pipe_lock(void) { rtems_status_code sc = RTEMS_SUCCESSFUL; if (pipe_semaphore == RTEMS_ID_NONE) { ffc10ee8: 41 9e 00 54 beq- cr7,ffc10f3c rtems_libio_unlock(); } if (sc == RTEMS_SUCCESSFUL) { sc = rtems_semaphore_obtain(pipe_semaphore, RTEMS_WAIT, RTEMS_NO_TIMEOUT); ffc10eec: 7d 23 4b 78 mr r3,r9 ffc10ef0: 38 80 00 00 li r4,0 ffc10ef4: 38 a0 00 00 li r5,0 ffc10ef8: 4b ff a5 95 bl ffc0b48c } if (sc == RTEMS_SUCCESSFUL) { ffc10efc: 2f 83 00 00 cmpwi cr7,r3,0 ffc10f00: 40 9e 01 60 bne- cr7,ffc11060 <== NEVER TAKEN err = pipe_lock(); if (err) return err; pipe = *pipep; ffc10f04: 83 dd 00 00 lwz r30,0(r29) if (pipe == NULL) { ffc10f08: 2f 9e 00 00 cmpwi cr7,r30,0 ffc10f0c: 41 9e 00 60 beq- cr7,ffc10f6c err = pipe_alloc(&pipe); if (err) goto out; } if (! PIPE_LOCK(pipe)) ffc10f10: 80 7e 00 28 lwz r3,40(r30) ffc10f14: 38 80 00 00 li r4,0 ffc10f18: 38 a0 00 00 li r5,0 ffc10f1c: 4b ff a5 71 bl ffc0b48c ffc10f20: 2f 83 00 00 cmpwi cr7,r3,0 ffc10f24: 41 9e 01 dc beq- cr7,ffc11100 <== ALWAYS TAKEN err = -EINTR; if (*pipep == NULL) { ffc10f28: 81 3d 00 00 lwz r9,0(r29) <== NOT EXECUTED ffc10f2c: 2f 89 00 00 cmpwi cr7,r9,0 <== NOT EXECUTED ffc10f30: 41 9e 01 5c beq- cr7,ffc1108c <== NOT EXECUTED if (err) goto out; } if (! PIPE_LOCK(pipe)) err = -EINTR; ffc10f34: 3b c0 ff fc li r30,-4 <== NOT EXECUTED ffc10f38: 48 00 01 80 b ffc110b8 <== NOT EXECUTED */ #include static inline void rtems_libio_lock( void ) { rtems_semaphore_obtain( rtems_libio_semaphore, RTEMS_WAIT, RTEMS_NO_TIMEOUT ); ffc10f3c: 3f 60 00 00 lis r27,0 ffc10f40: 80 7b 27 ec lwz r3,10220(r27) ffc10f44: 38 80 00 00 li r4,0 ffc10f48: 38 a0 00 00 li r5,0 ffc10f4c: 4b ff a5 41 bl ffc0b48c rtems_status_code sc = RTEMS_SUCCESSFUL; if (pipe_semaphore == RTEMS_ID_NONE) { rtems_libio_lock(); if (pipe_semaphore == RTEMS_ID_NONE) { ffc10f50: 81 3f 29 a8 lwz r9,10664(r31) ffc10f54: 2f 89 00 00 cmpwi cr7,r9,0 ffc10f58: 41 9e 00 d8 beq- cr7,ffc11030 <== ALWAYS TAKEN } static inline void rtems_libio_unlock( void ) { rtems_semaphore_release( rtems_libio_semaphore ); ffc10f5c: 80 7b 27 ec lwz r3,10220(r27) <== NOT EXECUTED ffc10f60: 4b ff a6 cd bl ffc0b62c <== NOT EXECUTED ffc10f64: 81 3f 29 a8 lwz r9,10664(r31) <== NOT EXECUTED ffc10f68: 4b ff ff 84 b ffc10eec <== NOT EXECUTED { static char c = 'a'; pipe_control_t *pipe; int err = -ENOMEM; pipe = malloc(sizeof(pipe_control_t)); ffc10f6c: 38 60 00 34 li r3,52 ffc10f70: 4b ff 53 39 bl ffc062a8 if (pipe == NULL) ffc10f74: 7c 7e 1b 79 mr. r30,r3 ffc10f78: 41 82 01 78 beq- ffc110f0 <== NEVER TAKEN return err; memset(pipe, 0, sizeof(pipe_control_t)); ffc10f7c: 38 80 00 00 li r4,0 ffc10f80: 38 a0 00 34 li r5,52 ffc10f84: 48 00 43 d1 bl ffc15354 pipe->Size = PIPE_BUF; ffc10f88: 39 20 02 00 li r9,512 ffc10f8c: 91 3e 00 04 stw r9,4(r30) pipe->Buffer = malloc(pipe->Size); ffc10f90: 38 60 02 00 li r3,512 ffc10f94: 4b ff 53 15 bl ffc062a8 if (! pipe->Buffer) ffc10f98: 2f 83 00 00 cmpwi cr7,r3,0 if (pipe == NULL) return err; memset(pipe, 0, sizeof(pipe_control_t)); pipe->Size = PIPE_BUF; pipe->Buffer = malloc(pipe->Size); ffc10f9c: 90 7e 00 00 stw r3,0(r30) if (! pipe->Buffer) ffc10fa0: 41 9e 01 48 beq- cr7,ffc110e8 <== NEVER TAKEN goto err_buf; err = -ENOMEM; if (rtems_barrier_create( rtems_build_name ('P', 'I', 'r', c), ffc10fa4: 3f 60 00 00 lis r27,0 ffc10fa8: 88 7b 22 14 lbz r3,8724(r27) if (! pipe->Buffer) goto err_buf; err = -ENOMEM; if (rtems_barrier_create( ffc10fac: 38 80 00 00 li r4,0 ffc10fb0: 38 a0 00 00 li r5,0 ffc10fb4: 64 63 50 49 oris r3,r3,20553 ffc10fb8: 60 63 72 00 ori r3,r3,29184 ffc10fbc: 38 de 00 2c addi r6,r30,44 ffc10fc0: 48 00 14 fd bl ffc124bc ffc10fc4: 2f 83 00 00 cmpwi cr7,r3,0 ffc10fc8: 40 9e 01 18 bne- cr7,ffc110e0 rtems_build_name ('P', 'I', 'r', c), RTEMS_BARRIER_MANUAL_RELEASE, 0, &pipe->readBarrier) != RTEMS_SUCCESSFUL) goto err_rbar; if (rtems_barrier_create( rtems_build_name ('P', 'I', 'w', c), ffc10fcc: 88 7b 22 14 lbz r3,8724(r27) if (rtems_barrier_create( rtems_build_name ('P', 'I', 'r', c), RTEMS_BARRIER_MANUAL_RELEASE, 0, &pipe->readBarrier) != RTEMS_SUCCESSFUL) goto err_rbar; if (rtems_barrier_create( ffc10fd0: 38 80 00 00 li r4,0 ffc10fd4: 38 a0 00 00 li r5,0 ffc10fd8: 64 63 50 49 oris r3,r3,20553 ffc10fdc: 60 63 77 00 ori r3,r3,30464 ffc10fe0: 38 de 00 30 addi r6,r30,48 ffc10fe4: 48 00 14 d9 bl ffc124bc ffc10fe8: 2f 83 00 00 cmpwi cr7,r3,0 ffc10fec: 40 9e 00 ec bne- cr7,ffc110d8 rtems_build_name ('P', 'I', 'w', c), RTEMS_BARRIER_MANUAL_RELEASE, 0, &pipe->writeBarrier) != RTEMS_SUCCESSFUL) goto err_wbar; if (rtems_semaphore_create( rtems_build_name ('P', 'I', 's', c), 1, ffc10ff0: 88 7b 22 14 lbz r3,8724(r27) if (rtems_barrier_create( rtems_build_name ('P', 'I', 'w', c), RTEMS_BARRIER_MANUAL_RELEASE, 0, &pipe->writeBarrier) != RTEMS_SUCCESSFUL) goto err_wbar; if (rtems_semaphore_create( ffc10ff4: 38 80 00 01 li r4,1 ffc10ff8: 38 a0 00 10 li r5,16 ffc10ffc: 64 63 50 49 oris r3,r3,20553 ffc11000: 60 63 73 00 ori r3,r3,29440 ffc11004: 38 c0 00 00 li r6,0 ffc11008: 38 fe 00 28 addi r7,r30,40 ffc1100c: 4b ff a1 6d bl ffc0b178 ffc11010: 2f 83 00 00 cmpwi cr7,r3,0 ffc11014: 40 9e 00 bc bne- cr7,ffc110d0 #ifdef RTEMS_POSIX_API pipe_interruptible(pipe); #endif *pipep = pipe; if (c ++ == 'z') ffc11018: 89 3b 22 14 lbz r9,8724(r27) ffc1101c: 2f 89 00 7a cmpwi cr7,r9,122 ffc11020: 41 9e 00 a4 beq- cr7,ffc110c4 ffc11024: 39 29 00 01 addi r9,r9,1 ffc11028: 99 3b 22 14 stb r9,8724(r27) ffc1102c: 4b ff fe e4 b ffc10f10 if (pipe_semaphore == RTEMS_ID_NONE) { rtems_libio_lock(); if (pipe_semaphore == RTEMS_ID_NONE) { sc = rtems_semaphore_create( ffc11030: 3c 60 50 49 lis r3,20553 ffc11034: 7f c7 f3 78 mr r7,r30 ffc11038: 38 80 00 01 li r4,1 ffc1103c: 38 a0 00 54 li r5,84 ffc11040: 38 c0 00 00 li r6,0 ffc11044: 60 63 50 45 ori r3,r3,20549 ffc11048: 4b ff a1 31 bl ffc0b178 ffc1104c: 7c 7e 1b 78 mr r30,r3 ffc11050: 80 7b 27 ec lwz r3,10220(r27) ffc11054: 4b ff a5 d9 bl ffc0b62c } rtems_libio_unlock(); } if (sc == RTEMS_SUCCESSFUL) { ffc11058: 2f 9e 00 00 cmpwi cr7,r30,0 ffc1105c: 41 9e 00 9c beq- cr7,ffc110f8 if (pipe->Writers ++ == 0) PIPE_WAKEUPREADERS(pipe); if (pipe->Readers == 0 && LIBIO_NODELAY(iop)) { PIPE_UNLOCK(pipe); err = -ENXIO; ffc11060: 3b c0 ff f4 li r30,-12 return 0; out_error: pipe_release(pipep, iop); return err; } ffc11064: 80 01 00 34 lwz r0,52(r1) ffc11068: 7f c3 f3 78 mr r3,r30 ffc1106c: 83 61 00 1c lwz r27,28(r1) ffc11070: 7c 08 03 a6 mtlr r0 ffc11074: 83 81 00 20 lwz r28,32(r1) ffc11078: 83 a1 00 24 lwz r29,36(r1) ffc1107c: 83 c1 00 28 lwz r30,40(r1) ffc11080: 83 e1 00 2c lwz r31,44(r1) ffc11084: 38 21 00 30 addi r1,r1,48 ffc11088: 4e 80 00 20 blr /* Called with pipe_semaphore held. */ static inline void pipe_free( pipe_control_t *pipe ) { rtems_barrier_delete(pipe->readBarrier); ffc1108c: 80 7e 00 2c lwz r3,44(r30) <== NOT EXECUTED ffc11090: 48 00 15 3d bl ffc125cc <== NOT EXECUTED rtems_barrier_delete(pipe->writeBarrier); ffc11094: 80 7e 00 30 lwz r3,48(r30) <== NOT EXECUTED ffc11098: 48 00 15 35 bl ffc125cc <== NOT EXECUTED rtems_semaphore_delete(pipe->Semaphore); ffc1109c: 80 7e 00 28 lwz r3,40(r30) <== NOT EXECUTED ffc110a0: 4b ff a2 f9 bl ffc0b398 <== NOT EXECUTED free(pipe->Buffer); ffc110a4: 80 7e 00 00 lwz r3,0(r30) <== NOT EXECUTED ffc110a8: 4b ff 4c 91 bl ffc05d38 <== NOT EXECUTED free(pipe); ffc110ac: 7f c3 f3 78 mr r3,r30 <== NOT EXECUTED ffc110b0: 4b ff 4c 89 bl ffc05d38 <== NOT EXECUTED if (err) goto out; } if (! PIPE_LOCK(pipe)) err = -EINTR; ffc110b4: 3b c0 ff fc li r30,-4 <== NOT EXECUTED #ifdef RTEMS_DEBUG rtems_status_code sc = RTEMS_SUCCESSFUL; sc = #endif rtems_semaphore_release(pipe_semaphore); ffc110b8: 80 7f 29 a8 lwz r3,10664(r31) ffc110bc: 4b ff a5 71 bl ffc0b62c ffc110c0: 4b ff ff a4 b ffc11064 pipe_interruptible(pipe); #endif *pipep = pipe; if (c ++ == 'z') c = 'a'; ffc110c4: 39 20 00 61 li r9,97 ffc110c8: 99 3b 22 14 stb r9,8724(r27) ffc110cc: 4b ff fe 44 b ffc10f10 return 0; err_sem: rtems_barrier_delete(pipe->writeBarrier); ffc110d0: 80 7e 00 30 lwz r3,48(r30) ffc110d4: 48 00 14 f9 bl ffc125cc err_wbar: rtems_barrier_delete(pipe->readBarrier); ffc110d8: 80 7e 00 2c lwz r3,44(r30) ffc110dc: 48 00 14 f1 bl ffc125cc err_rbar: free(pipe->Buffer); ffc110e0: 80 7e 00 00 lwz r3,0(r30) ffc110e4: 4b ff 4c 55 bl ffc05d38 err_buf: free(pipe); ffc110e8: 7f c3 f3 78 mr r3,r30 ffc110ec: 4b ff 4c 4d bl ffc05d38 if (err) goto out; } if (! PIPE_LOCK(pipe)) err = -EINTR; ffc110f0: 3b c0 ff f4 li r30,-12 ffc110f4: 4b ff ff c4 b ffc110b8 ffc110f8: 81 3f 29 a8 lwz r9,10664(r31) ffc110fc: 4b ff fd f0 b ffc10eec if (*pipep == NULL) { ffc11100: 81 3d 00 00 lwz r9,0(r29) ffc11104: 2f 89 00 00 cmpwi cr7,r9,0 ffc11108: 40 be 00 08 bne+ cr7,ffc11110 if (err) pipe_free(pipe); else *pipep = pipe; ffc1110c: 93 dd 00 00 stw r30,0(r29) #ifdef RTEMS_DEBUG rtems_status_code sc = RTEMS_SUCCESSFUL; sc = #endif rtems_semaphore_release(pipe_semaphore); ffc11110: 80 7f 29 a8 lwz r3,10664(r31) ffc11114: 4b ff a5 19 bl ffc0b62c err = pipe_new(pipep); if (err) return err; pipe = *pipep; switch (LIBIO_ACCMODE(iop)) { ffc11118: 81 3c 00 10 lwz r9,16(r28) int err; err = pipe_new(pipep); if (err) return err; pipe = *pipep; ffc1111c: 83 fd 00 00 lwz r31,0(r29) switch (LIBIO_ACCMODE(iop)) { ffc11120: 55 29 07 7c rlwinm r9,r9,0,29,30 ffc11124: 2f 89 00 04 cmpwi cr7,r9,4 ffc11128: 41 9e 00 48 beq- cr7,ffc11170 ffc1112c: 2f 89 00 06 cmpwi cr7,r9,6 ffc11130: 41 9e 01 58 beq- cr7,ffc11288 ffc11134: 2f 89 00 02 cmpwi cr7,r9,2 ffc11138: 41 9e 00 cc beq- cr7,ffc11204 <== ALWAYS TAKEN if (pipe->Writers ++ == 0) PIPE_WAKEUPREADERS(pipe); break; } PIPE_UNLOCK(pipe); ffc1113c: 80 7f 00 28 lwz r3,40(r31) return 0; ffc11140: 3b c0 00 00 li r30,0 if (pipe->Writers ++ == 0) PIPE_WAKEUPREADERS(pipe); break; } PIPE_UNLOCK(pipe); ffc11144: 4b ff a4 e9 bl ffc0b62c return 0; out_error: pipe_release(pipep, iop); return err; } ffc11148: 80 01 00 34 lwz r0,52(r1) ffc1114c: 7f c3 f3 78 mr r3,r30 ffc11150: 83 61 00 1c lwz r27,28(r1) ffc11154: 7c 08 03 a6 mtlr r0 ffc11158: 83 81 00 20 lwz r28,32(r1) ffc1115c: 83 a1 00 24 lwz r29,36(r1) ffc11160: 83 c1 00 28 lwz r30,40(r1) ffc11164: 83 e1 00 2c lwz r31,44(r1) ffc11168: 38 21 00 30 addi r1,r1,48 ffc1116c: 4e 80 00 20 blr break; case LIBIO_FLAGS_WRITE: pipe->writerCounter ++; if (pipe->Writers ++ == 0) ffc11170: 81 3f 00 14 lwz r9,20(r31) } while (prevCounter == pipe->writerCounter); } break; case LIBIO_FLAGS_WRITE: pipe->writerCounter ++; ffc11174: 81 5f 00 24 lwz r10,36(r31) if (pipe->Writers ++ == 0) ffc11178: 2f 89 00 00 cmpwi cr7,r9,0 } while (prevCounter == pipe->writerCounter); } break; case LIBIO_FLAGS_WRITE: pipe->writerCounter ++; ffc1117c: 39 4a 00 01 addi r10,r10,1 if (pipe->Writers ++ == 0) ffc11180: 39 29 00 01 addi r9,r9,1 } while (prevCounter == pipe->writerCounter); } break; case LIBIO_FLAGS_WRITE: pipe->writerCounter ++; ffc11184: 91 5f 00 24 stw r10,36(r31) if (pipe->Writers ++ == 0) ffc11188: 91 3f 00 14 stw r9,20(r31) ffc1118c: 41 9e 01 6c beq- cr7,ffc112f8 <== ALWAYS TAKEN PIPE_WAKEUPREADERS(pipe); if (pipe->Readers == 0 && LIBIO_NODELAY(iop)) { ffc11190: 81 3f 00 10 lwz r9,16(r31) ffc11194: 2f 89 00 00 cmpwi cr7,r9,0 ffc11198: 40 be ff a4 bne- cr7,ffc1113c ffc1119c: 81 3c 00 10 lwz r9,16(r28) ffc111a0: 71 2a 00 01 andi. r10,r9,1 ffc111a4: 40 82 01 64 bne- ffc11308 err = -ENXIO; goto out_error; } if (pipe->Readers == 0) { prevCounter = pipe->readerCounter; ffc111a8: 83 df 00 20 lwz r30,32(r31) ffc111ac: 48 00 00 20 b ffc111cc err = -EINTR; do { PIPE_UNLOCK(pipe); if (! PIPE_WRITEWAIT(pipe)) goto out_error; if (! PIPE_LOCK(pipe)) ffc111b0: 80 7f 00 28 lwz r3,40(r31) ffc111b4: 4b ff a2 d9 bl ffc0b48c ffc111b8: 2f 83 00 00 cmpwi cr7,r3,0 ffc111bc: 40 9e 00 34 bne- cr7,ffc111f0 <== NEVER TAKEN goto out_error; } while (prevCounter == pipe->readerCounter); ffc111c0: 81 3f 00 20 lwz r9,32(r31) ffc111c4: 7f 89 f0 00 cmpw cr7,r9,r30 ffc111c8: 40 be ff 74 bne- cr7,ffc1113c <== ALWAYS TAKEN if (pipe->Readers == 0) { prevCounter = pipe->readerCounter; err = -EINTR; do { PIPE_UNLOCK(pipe); ffc111cc: 80 7f 00 28 lwz r3,40(r31) ffc111d0: 4b ff a4 5d bl ffc0b62c if (! PIPE_WRITEWAIT(pipe)) ffc111d4: 80 7f 00 30 lwz r3,48(r31) ffc111d8: 38 80 00 00 li r4,0 ffc111dc: 48 00 15 51 bl ffc1272c goto out_error; if (! PIPE_LOCK(pipe)) ffc111e0: 38 80 00 00 li r4,0 if (pipe->Readers == 0) { prevCounter = pipe->readerCounter; err = -EINTR; do { PIPE_UNLOCK(pipe); if (! PIPE_WRITEWAIT(pipe)) ffc111e4: 2f 83 00 00 cmpwi cr7,r3,0 goto out_error; if (! PIPE_LOCK(pipe)) ffc111e8: 38 a0 00 00 li r5,0 if (pipe->Readers == 0) { prevCounter = pipe->readerCounter; err = -EINTR; do { PIPE_UNLOCK(pipe); if (! PIPE_WRITEWAIT(pipe)) ffc111ec: 41 9e ff c4 beq+ cr7,ffc111b0 <== ALWAYS TAKEN /* Not an error */ if (LIBIO_NODELAY(iop)) break; prevCounter = pipe->writerCounter; err = -EINTR; ffc111f0: 3b c0 ff fc li r30,-4 <== NOT EXECUTED PIPE_UNLOCK(pipe); return 0; out_error: pipe_release(pipep, iop); ffc111f4: 7f a3 eb 78 mr r3,r29 ffc111f8: 7f 84 e3 78 mr r4,r28 ffc111fc: 4b ff fb 5d bl ffc10d58 return err; ffc11200: 4b ff fe 64 b ffc11064 pipe = *pipep; switch (LIBIO_ACCMODE(iop)) { case LIBIO_FLAGS_READ: pipe->readerCounter ++; if (pipe->Readers ++ == 0) ffc11204: 81 3f 00 10 lwz r9,16(r31) return err; pipe = *pipep; switch (LIBIO_ACCMODE(iop)) { case LIBIO_FLAGS_READ: pipe->readerCounter ++; ffc11208: 81 5f 00 20 lwz r10,32(r31) if (pipe->Readers ++ == 0) ffc1120c: 2f 89 00 00 cmpwi cr7,r9,0 return err; pipe = *pipep; switch (LIBIO_ACCMODE(iop)) { case LIBIO_FLAGS_READ: pipe->readerCounter ++; ffc11210: 39 4a 00 01 addi r10,r10,1 if (pipe->Readers ++ == 0) ffc11214: 39 29 00 01 addi r9,r9,1 return err; pipe = *pipep; switch (LIBIO_ACCMODE(iop)) { case LIBIO_FLAGS_READ: pipe->readerCounter ++; ffc11218: 91 5f 00 20 stw r10,32(r31) if (pipe->Readers ++ == 0) ffc1121c: 91 3f 00 10 stw r9,16(r31) ffc11220: 41 9e 00 b8 beq- cr7,ffc112d8 <== ALWAYS TAKEN PIPE_WAKEUPWRITERS(pipe); if (pipe->Writers == 0) { ffc11224: 81 3f 00 14 lwz r9,20(r31) ffc11228: 2f 89 00 00 cmpwi cr7,r9,0 ffc1122c: 40 be ff 10 bne- cr7,ffc1113c /* Not an error */ if (LIBIO_NODELAY(iop)) ffc11230: 81 3c 00 10 lwz r9,16(r28) ffc11234: 71 2a 00 01 andi. r10,r9,1 ffc11238: 40 a2 ff 04 bne- ffc1113c break; prevCounter = pipe->writerCounter; ffc1123c: 83 df 00 24 lwz r30,36(r31) ffc11240: 48 00 00 20 b ffc11260 /* Wait until a writer opens the pipe */ do { PIPE_UNLOCK(pipe); if (! PIPE_READWAIT(pipe)) goto out_error; if (! PIPE_LOCK(pipe)) ffc11244: 80 7f 00 28 lwz r3,40(r31) ffc11248: 4b ff a2 45 bl ffc0b48c ffc1124c: 2f 83 00 00 cmpwi cr7,r3,0 ffc11250: 40 be ff a0 bne- cr7,ffc111f0 <== NEVER TAKEN goto out_error; } while (prevCounter == pipe->writerCounter); ffc11254: 81 3f 00 24 lwz r9,36(r31) ffc11258: 7f 89 f0 00 cmpw cr7,r9,r30 ffc1125c: 40 be fe e0 bne- cr7,ffc1113c <== ALWAYS TAKEN prevCounter = pipe->writerCounter; err = -EINTR; /* Wait until a writer opens the pipe */ do { PIPE_UNLOCK(pipe); ffc11260: 80 7f 00 28 lwz r3,40(r31) ffc11264: 4b ff a3 c9 bl ffc0b62c if (! PIPE_READWAIT(pipe)) ffc11268: 80 7f 00 2c lwz r3,44(r31) ffc1126c: 38 80 00 00 li r4,0 ffc11270: 48 00 14 bd bl ffc1272c goto out_error; if (! PIPE_LOCK(pipe)) ffc11274: 38 80 00 00 li r4,0 prevCounter = pipe->writerCounter; err = -EINTR; /* Wait until a writer opens the pipe */ do { PIPE_UNLOCK(pipe); if (! PIPE_READWAIT(pipe)) ffc11278: 2f 83 00 00 cmpwi cr7,r3,0 goto out_error; if (! PIPE_LOCK(pipe)) ffc1127c: 38 a0 00 00 li r5,0 prevCounter = pipe->writerCounter; err = -EINTR; /* Wait until a writer opens the pipe */ do { PIPE_UNLOCK(pipe); if (! PIPE_READWAIT(pipe)) ffc11280: 41 9e ff c4 beq+ cr7,ffc11244 <== ALWAYS TAKEN ffc11284: 4b ff ff 6c b ffc111f0 <== NOT EXECUTED } break; case LIBIO_FLAGS_READ_WRITE: pipe->readerCounter ++; if (pipe->Readers ++ == 0) ffc11288: 81 3f 00 10 lwz r9,16(r31) } while (prevCounter == pipe->readerCounter); } break; case LIBIO_FLAGS_READ_WRITE: pipe->readerCounter ++; ffc1128c: 81 5f 00 20 lwz r10,32(r31) if (pipe->Readers ++ == 0) ffc11290: 2f 89 00 00 cmpwi cr7,r9,0 } while (prevCounter == pipe->readerCounter); } break; case LIBIO_FLAGS_READ_WRITE: pipe->readerCounter ++; ffc11294: 39 4a 00 01 addi r10,r10,1 if (pipe->Readers ++ == 0) ffc11298: 39 29 00 01 addi r9,r9,1 } while (prevCounter == pipe->readerCounter); } break; case LIBIO_FLAGS_READ_WRITE: pipe->readerCounter ++; ffc1129c: 91 5f 00 20 stw r10,32(r31) if (pipe->Readers ++ == 0) ffc112a0: 91 3f 00 10 stw r9,16(r31) ffc112a4: 41 9e 00 44 beq- cr7,ffc112e8 <== ALWAYS TAKEN PIPE_WAKEUPWRITERS(pipe); pipe->writerCounter ++; if (pipe->Writers ++ == 0) ffc112a8: 81 3f 00 14 lwz r9,20(r31) case LIBIO_FLAGS_READ_WRITE: pipe->readerCounter ++; if (pipe->Readers ++ == 0) PIPE_WAKEUPWRITERS(pipe); pipe->writerCounter ++; ffc112ac: 81 5f 00 24 lwz r10,36(r31) if (pipe->Writers ++ == 0) ffc112b0: 2f 89 00 00 cmpwi cr7,r9,0 case LIBIO_FLAGS_READ_WRITE: pipe->readerCounter ++; if (pipe->Readers ++ == 0) PIPE_WAKEUPWRITERS(pipe); pipe->writerCounter ++; ffc112b4: 39 4a 00 01 addi r10,r10,1 if (pipe->Writers ++ == 0) ffc112b8: 39 29 00 01 addi r9,r9,1 case LIBIO_FLAGS_READ_WRITE: pipe->readerCounter ++; if (pipe->Readers ++ == 0) PIPE_WAKEUPWRITERS(pipe); pipe->writerCounter ++; ffc112bc: 91 5f 00 24 stw r10,36(r31) if (pipe->Writers ++ == 0) ffc112c0: 91 3f 00 14 stw r9,20(r31) ffc112c4: 40 9e fe 78 bne+ cr7,ffc1113c <== NEVER TAKEN PIPE_WAKEUPREADERS(pipe); ffc112c8: 80 7f 00 2c lwz r3,44(r31) ffc112cc: 38 81 00 08 addi r4,r1,8 ffc112d0: 48 00 13 c5 bl ffc12694 ffc112d4: 4b ff fe 68 b ffc1113c switch (LIBIO_ACCMODE(iop)) { case LIBIO_FLAGS_READ: pipe->readerCounter ++; if (pipe->Readers ++ == 0) PIPE_WAKEUPWRITERS(pipe); ffc112d8: 80 7f 00 30 lwz r3,48(r31) ffc112dc: 38 81 00 08 addi r4,r1,8 ffc112e0: 48 00 13 b5 bl ffc12694 ffc112e4: 4b ff ff 40 b ffc11224 break; case LIBIO_FLAGS_READ_WRITE: pipe->readerCounter ++; if (pipe->Readers ++ == 0) PIPE_WAKEUPWRITERS(pipe); ffc112e8: 80 7f 00 30 lwz r3,48(r31) ffc112ec: 38 81 00 08 addi r4,r1,8 ffc112f0: 48 00 13 a5 bl ffc12694 ffc112f4: 4b ff ff b4 b ffc112a8 case LIBIO_FLAGS_WRITE: pipe->writerCounter ++; if (pipe->Writers ++ == 0) PIPE_WAKEUPREADERS(pipe); ffc112f8: 80 7f 00 2c lwz r3,44(r31) ffc112fc: 38 81 00 08 addi r4,r1,8 ffc11300: 48 00 13 95 bl ffc12694 ffc11304: 4b ff fe 8c b ffc11190 if (pipe->Readers == 0 && LIBIO_NODELAY(iop)) { PIPE_UNLOCK(pipe); ffc11308: 80 7f 00 28 lwz r3,40(r31) err = -ENXIO; ffc1130c: 3b c0 ff fa li r30,-6 if (pipe->Writers ++ == 0) PIPE_WAKEUPREADERS(pipe); if (pipe->Readers == 0 && LIBIO_NODELAY(iop)) { PIPE_UNLOCK(pipe); ffc11310: 4b ff a3 1d bl ffc0b62c err = -ENXIO; goto out_error; ffc11314: 4b ff fe e0 b ffc111f4 =============================================================================== ffc0c3e8 : { long return_value; rtems_libio_t *iop; const rtems_filesystem_limits_and_options_t *the_limits; rtems_libio_check_fd(fd); ffc0c3e8: 3d 20 00 00 lis r9,0 */ long fpathconf( int fd, int name ) { ffc0c3ec: 94 21 ff f8 stwu r1,-8(r1) ffc0c3f0: 7c 08 02 a6 mflr r0 long return_value; rtems_libio_t *iop; const rtems_filesystem_limits_and_options_t *the_limits; rtems_libio_check_fd(fd); ffc0c3f4: 81 29 26 dc lwz r9,9948(r9) */ long fpathconf( int fd, int name ) { ffc0c3f8: 90 01 00 0c stw r0,12(r1) long return_value; rtems_libio_t *iop; const rtems_filesystem_limits_and_options_t *the_limits; rtems_libio_check_fd(fd); ffc0c3fc: 7f 83 48 40 cmplw cr7,r3,r9 ffc0c400: 40 9c 00 cc bge- cr7,ffc0c4cc iop = rtems_libio_iop(fd); ffc0c404: 3d 20 00 00 lis r9,0 ffc0c408: 81 29 27 88 lwz r9,10120(r9) ffc0c40c: 1c 63 00 38 mulli r3,r3,56 ffc0c410: 7c 69 1a 14 add r3,r9,r3 rtems_libio_check_is_open(iop); ffc0c414: 81 23 00 10 lwz r9,16(r3) ffc0c418: 71 2a 01 00 andi. r10,r9,256 ffc0c41c: 41 82 00 b0 beq- ffc0c4cc <== NEVER TAKEN * Now process the information request. */ the_limits = iop->pathinfo.mt_entry->pathconf_limits_and_options; switch ( name ) { ffc0c420: 2b 84 00 0b cmplwi cr7,r4,11 /* * Now process the information request. */ the_limits = iop->pathinfo.mt_entry->pathconf_limits_and_options; ffc0c424: 81 23 00 28 lwz r9,40(r3) ffc0c428: 81 29 00 2c lwz r9,44(r9) switch ( name ) { ffc0c42c: 40 9d 00 24 ble- cr7,ffc0c450 break; case _PC_SYNC_IO: return_value = the_limits->posix_sync_io; break; default: rtems_set_errno_and_return_minus_one( EINVAL ); ffc0c430: 48 00 1a 2d bl ffc0de5c <__errno> ffc0c434: 39 20 00 16 li r9,22 ffc0c438: 91 23 00 00 stw r9,0(r3) ffc0c43c: 38 60 ff ff li r3,-1 break; } return return_value; } ffc0c440: 80 01 00 0c lwz r0,12(r1) ffc0c444: 38 21 00 08 addi r1,r1,8 ffc0c448: 7c 08 03 a6 mtlr r0 ffc0c44c: 4e 80 00 20 blr * Now process the information request. */ the_limits = iop->pathinfo.mt_entry->pathconf_limits_and_options; switch ( name ) { ffc0c450: 3d 40 ff c1 lis r10,-63 ffc0c454: 39 4a 4a 38 addi r10,r10,19000 ffc0c458: 54 84 10 3a rlwinm r4,r4,2,0,29 ffc0c45c: 7d 0a 20 2e lwzx r8,r10,r4 ffc0c460: 7d 48 52 14 add r10,r8,r10 ffc0c464: 7d 49 03 a6 mtctr r10 ffc0c468: 4e 80 04 20 bctr break; case _PC_ASYNC_IO: return_value = the_limits->posix_async_io; break; case _PC_PRIO_IO: return_value = the_limits->posix_prio_io; ffc0c46c: 80 69 00 24 lwz r3,36(r9) break; ffc0c470: 4b ff ff d0 b ffc0c440 break; case _PC_VDISABLE: return_value = the_limits->posix_vdisable; break; case _PC_ASYNC_IO: return_value = the_limits->posix_async_io; ffc0c474: 80 69 00 18 lwz r3,24(r9) break; ffc0c478: 4b ff ff c8 b ffc0c440 break; case _PC_NO_TRUNC: return_value = the_limits->posix_no_trunc; break; case _PC_VDISABLE: return_value = the_limits->posix_vdisable; ffc0c47c: 80 69 00 2c lwz r3,44(r9) break; ffc0c480: 4b ff ff c0 b ffc0c440 break; case _PC_CHOWN_RESTRICTED: return_value = the_limits->posix_chown_restrictions; break; case _PC_NO_TRUNC: return_value = the_limits->posix_no_trunc; ffc0c484: 80 69 00 20 lwz r3,32(r9) break; ffc0c488: 4b ff ff b8 b ffc0c440 break; case _PC_PIPE_BUF: return_value = the_limits->pipe_buf; break; case _PC_CHOWN_RESTRICTED: return_value = the_limits->posix_chown_restrictions; ffc0c48c: 80 69 00 1c lwz r3,28(r9) break; ffc0c490: 4b ff ff b0 b ffc0c440 break; case _PC_PATH_MAX: return_value = the_limits->path_max; break; case _PC_PIPE_BUF: return_value = the_limits->pipe_buf; ffc0c494: 80 69 00 14 lwz r3,20(r9) break; ffc0c498: 4b ff ff a8 b ffc0c440 break; case _PC_NAME_MAX: return_value = the_limits->name_max; break; case _PC_PATH_MAX: return_value = the_limits->path_max; ffc0c49c: 80 69 00 10 lwz r3,16(r9) break; ffc0c4a0: 4b ff ff a0 b ffc0c440 break; case _PC_MAX_INPUT: return_value = the_limits->max_input; break; case _PC_NAME_MAX: return_value = the_limits->name_max; ffc0c4a4: 80 69 00 0c lwz r3,12(r9) break; ffc0c4a8: 4b ff ff 98 b ffc0c440 break; case _PC_MAX_CANON: return_value = the_limits->max_canon; break; case _PC_MAX_INPUT: return_value = the_limits->max_input; ffc0c4ac: 80 69 00 08 lwz r3,8(r9) break; ffc0c4b0: 4b ff ff 90 b ffc0c440 switch ( name ) { case _PC_LINK_MAX: return_value = the_limits->link_max; break; case _PC_MAX_CANON: return_value = the_limits->max_canon; ffc0c4b4: 80 69 00 04 lwz r3,4(r9) break; ffc0c4b8: 4b ff ff 88 b ffc0c440 the_limits = iop->pathinfo.mt_entry->pathconf_limits_and_options; switch ( name ) { case _PC_LINK_MAX: return_value = the_limits->link_max; ffc0c4bc: 80 69 00 00 lwz r3,0(r9) break; ffc0c4c0: 4b ff ff 80 b ffc0c440 break; case _PC_PRIO_IO: return_value = the_limits->posix_prio_io; break; case _PC_SYNC_IO: return_value = the_limits->posix_sync_io; ffc0c4c4: 80 69 00 28 lwz r3,40(r9) break; ffc0c4c8: 4b ff ff 78 b ffc0c440 rtems_libio_t *iop; const rtems_filesystem_limits_and_options_t *the_limits; rtems_libio_check_fd(fd); iop = rtems_libio_iop(fd); rtems_libio_check_is_open(iop); ffc0c4cc: 48 00 19 91 bl ffc0de5c <__errno> ffc0c4d0: 39 20 00 09 li r9,9 ffc0c4d4: 91 23 00 00 stw r9,0(r3) ffc0c4d8: 38 60 ff ff li r3,-1 ffc0c4dc: 4b ff ff 64 b ffc0c440 =============================================================================== ffc04b68 : #include void free( void *ptr ) { ffc04b68: 94 21 ff f0 stwu r1,-16(r1) ffc04b6c: 7c 08 02 a6 mflr r0 MSBUMP(free_calls, 1); ffc04b70: 3d 20 00 00 lis r9,0 #include void free( void *ptr ) { ffc04b74: 90 01 00 14 stw r0,20(r1) MSBUMP(free_calls, 1); ffc04b78: 39 29 2b 28 addi r9,r9,11048 #include void free( void *ptr ) { ffc04b7c: 93 e1 00 0c stw r31,12(r1) MSBUMP(free_calls, 1); if ( !ptr ) ffc04b80: 7c 7f 1b 79 mr. r31,r3 void free( void *ptr ) { MSBUMP(free_calls, 1); ffc04b84: 81 49 00 0c lwz r10,12(r9) #include void free( void *ptr ) { ffc04b88: 93 c1 00 08 stw r30,8(r1) MSBUMP(free_calls, 1); ffc04b8c: 39 4a 00 01 addi r10,r10,1 ffc04b90: 91 49 00 0c stw r10,12(r9) if ( !ptr ) ffc04b94: 41 82 00 4c beq- ffc04be0 return; /* * Do not attempt to free memory if in a critical section or ISR. */ if ( _System_state_Is_up(_System_state_Get()) && ffc04b98: 3d 20 00 00 lis r9,0 ffc04b9c: 81 29 28 4c lwz r9,10316(r9) ffc04ba0: 2f 89 00 03 cmpwi cr7,r9,3 ffc04ba4: 41 9e 00 88 beq- cr7,ffc04c2c <== ALWAYS TAKEN } /* * If configured, update the statistics */ if ( rtems_malloc_statistics_helpers ) ffc04ba8: 3d 20 00 00 lis r9,0 ffc04bac: 81 29 27 c4 lwz r9,10180(r9) ffc04bb0: 2f 89 00 00 cmpwi cr7,r9,0 ffc04bb4: 41 9e 00 14 beq- cr7,ffc04bc8 (*rtems_malloc_statistics_helpers->at_free)(ptr); ffc04bb8: 81 29 00 08 lwz r9,8(r9) ffc04bbc: 7f e3 fb 78 mr r3,r31 ffc04bc0: 7d 29 03 a6 mtctr r9 ffc04bc4: 4e 80 04 21 bctrl if ( !_Protected_heap_Free( RTEMS_Malloc_Heap, ptr ) ) { ffc04bc8: 3f c0 00 00 lis r30,0 ffc04bcc: 80 7e 27 50 lwz r3,10064(r30) ffc04bd0: 7f e4 fb 78 mr r4,r31 ffc04bd4: 48 00 71 41 bl ffc0bd14 <_Protected_heap_Free> ffc04bd8: 2f 83 00 00 cmpwi cr7,r3,0 ffc04bdc: 41 9e 00 1c beq- cr7,ffc04bf8 RTEMS_Malloc_Heap->area_begin, RTEMS_Malloc_Heap->area_end ); } } ffc04be0: 80 01 00 14 lwz r0,20(r1) ffc04be4: 83 c1 00 08 lwz r30,8(r1) ffc04be8: 7c 08 03 a6 mtlr r0 ffc04bec: 83 e1 00 0c lwz r31,12(r1) ffc04bf0: 38 21 00 10 addi r1,r1,16 ffc04bf4: 4e 80 00 20 blr ffc04bf8: 80 01 00 14 lwz r0,20(r1) */ if ( rtems_malloc_statistics_helpers ) (*rtems_malloc_statistics_helpers->at_free)(ptr); if ( !_Protected_heap_Free( RTEMS_Malloc_Heap, ptr ) ) { printk( "Program heap: free of bad pointer %p -- range %p - %p \n", ffc04bfc: 3c 60 ff c2 lis r3,-62 ptr, RTEMS_Malloc_Heap->area_begin, ffc04c00: 81 3e 27 50 lwz r9,10064(r30) */ if ( rtems_malloc_statistics_helpers ) (*rtems_malloc_statistics_helpers->at_free)(ptr); if ( !_Protected_heap_Free( RTEMS_Malloc_Heap, ptr ) ) { printk( "Program heap: free of bad pointer %p -- range %p - %p \n", ffc04c04: 7f e4 fb 78 mr r4,r31 RTEMS_Malloc_Heap->area_begin, RTEMS_Malloc_Heap->area_end ); } } ffc04c08: 7c 08 03 a6 mtlr r0 ffc04c0c: 83 c1 00 08 lwz r30,8(r1) ffc04c10: 83 e1 00 0c lwz r31,12(r1) */ if ( rtems_malloc_statistics_helpers ) (*rtems_malloc_statistics_helpers->at_free)(ptr); if ( !_Protected_heap_Free( RTEMS_Malloc_Heap, ptr ) ) { printk( "Program heap: free of bad pointer %p -- range %p - %p \n", ffc04c14: 38 63 e6 f8 addi r3,r3,-6408 ffc04c18: 80 a9 00 18 lwz r5,24(r9) ffc04c1c: 80 c9 00 1c lwz r6,28(r9) RTEMS_Malloc_Heap->area_begin, RTEMS_Malloc_Heap->area_end ); } } ffc04c20: 38 21 00 10 addi r1,r1,16 */ if ( rtems_malloc_statistics_helpers ) (*rtems_malloc_statistics_helpers->at_free)(ptr); if ( !_Protected_heap_Free( RTEMS_Malloc_Heap, ptr ) ) { printk( "Program heap: free of bad pointer %p -- range %p - %p \n", ffc04c24: 4c c6 31 82 crclr 4*cr1+eq ffc04c28: 48 00 10 a0 b ffc05cc8 /* * Do not attempt to free memory if in a critical section or ISR. */ if ( _System_state_Is_up(_System_state_Get()) && !malloc_is_system_state_OK() ) { ffc04c2c: 48 00 01 d9 bl ffc04e04 return; /* * Do not attempt to free memory if in a critical section or ISR. */ if ( _System_state_Is_up(_System_state_Get()) && ffc04c30: 2f 83 00 00 cmpwi cr7,r3,0 ffc04c34: 40 9e ff 74 bne+ cr7,ffc04ba8 RTEMS_Malloc_Heap->area_begin, RTEMS_Malloc_Heap->area_end ); } } ffc04c38: 80 01 00 14 lwz r0,20(r1) /* * Do not attempt to free memory if in a critical section or ISR. */ if ( _System_state_Is_up(_System_state_Get()) && !malloc_is_system_state_OK() ) { malloc_deferred_free(ptr); ffc04c3c: 7f e3 fb 78 mr r3,r31 RTEMS_Malloc_Heap->area_begin, RTEMS_Malloc_Heap->area_end ); } } ffc04c40: 83 c1 00 08 lwz r30,8(r1) ffc04c44: 7c 08 03 a6 mtlr r0 ffc04c48: 83 e1 00 0c lwz r31,12(r1) ffc04c4c: 38 21 00 10 addi r1,r1,16 /* * Do not attempt to free memory if in a critical section or ISR. */ if ( _System_state_Is_up(_System_state_Get()) && !malloc_is_system_state_OK() ) { malloc_deferred_free(ptr); ffc04c50: 48 00 02 24 b ffc04e74 =============================================================================== ffc1cba8 : int fstat( int fd, struct stat *sbuf ) { ffc1cba8: 94 21 ff f0 stwu r1,-16(r1) ffc1cbac: 7c 08 02 a6 mflr r0 ffc1cbb0: 93 e1 00 0c stw r31,12(r1) rtems_libio_t *iop; /* * Check to see if we were passed a valid pointer. */ if ( !sbuf ) ffc1cbb4: 7c 9f 23 79 mr. r31,r4 int fstat( int fd, struct stat *sbuf ) { ffc1cbb8: 90 01 00 14 stw r0,20(r1) ffc1cbbc: 93 c1 00 08 stw r30,8(r1) rtems_libio_t *iop; /* * Check to see if we were passed a valid pointer. */ if ( !sbuf ) ffc1cbc0: 41 82 00 94 beq- ffc1cc54 <== NEVER TAKEN rtems_set_errno_and_return_minus_one( EFAULT ); /* * Now process the stat() request. */ iop = rtems_libio_iop( fd ); ffc1cbc4: 3d 20 00 00 lis r9,0 ffc1cbc8: 81 29 27 58 lwz r9,10072(r9) ffc1cbcc: 7f 83 48 40 cmplw cr7,r3,r9 ffc1cbd0: 40 9c 00 5c bge- cr7,ffc1cc2c ffc1cbd4: 3d 20 00 00 lis r9,0 ffc1cbd8: 83 c9 28 08 lwz r30,10248(r9) ffc1cbdc: 1c 63 00 38 mulli r3,r3,56 ffc1cbe0: 7f de 1a 14 add r30,r30,r3 rtems_libio_check_fd( fd ); rtems_libio_check_is_open(iop); ffc1cbe4: 81 3e 00 10 lwz r9,16(r30) ffc1cbe8: 71 2a 01 00 andi. r10,r9,256 ffc1cbec: 41 82 00 40 beq- ffc1cc2c /* * Zero out the stat structure so the various support * versions of stat don't have to. */ memset( sbuf, 0, sizeof(struct stat) ); ffc1cbf0: 38 80 00 00 li r4,0 ffc1cbf4: 7f e3 fb 78 mr r3,r31 ffc1cbf8: 38 a0 00 48 li r5,72 ffc1cbfc: 4b ff 62 75 bl ffc12e70 return (*iop->pathinfo.handlers->fstat_h)( &iop->pathinfo, sbuf ); ffc1cc00: 81 3e 00 24 lwz r9,36(r30) } ffc1cc04: 80 01 00 14 lwz r0,20(r1) * Zero out the stat structure so the various support * versions of stat don't have to. */ memset( sbuf, 0, sizeof(struct stat) ); return (*iop->pathinfo.handlers->fstat_h)( &iop->pathinfo, sbuf ); ffc1cc08: 38 7e 00 14 addi r3,r30,20 ffc1cc0c: 81 29 00 18 lwz r9,24(r9) ffc1cc10: 7f e4 fb 78 mr r4,r31 } ffc1cc14: 7c 08 03 a6 mtlr r0 ffc1cc18: 83 c1 00 08 lwz r30,8(r1) * Zero out the stat structure so the various support * versions of stat don't have to. */ memset( sbuf, 0, sizeof(struct stat) ); return (*iop->pathinfo.handlers->fstat_h)( &iop->pathinfo, sbuf ); ffc1cc1c: 7d 29 03 a6 mtctr r9 } ffc1cc20: 83 e1 00 0c lwz r31,12(r1) ffc1cc24: 38 21 00 10 addi r1,r1,16 * Zero out the stat structure so the various support * versions of stat don't have to. */ memset( sbuf, 0, sizeof(struct stat) ); return (*iop->pathinfo.handlers->fstat_h)( &iop->pathinfo, sbuf ); ffc1cc28: 4e 80 04 20 bctr /* * Now process the stat() request. */ iop = rtems_libio_iop( fd ); rtems_libio_check_fd( fd ); rtems_libio_check_is_open(iop); ffc1cc2c: 4b ff 54 4d bl ffc12078 <__errno> ffc1cc30: 39 20 00 09 li r9,9 ffc1cc34: 91 23 00 00 stw r9,0(r3) * versions of stat don't have to. */ memset( sbuf, 0, sizeof(struct stat) ); return (*iop->pathinfo.handlers->fstat_h)( &iop->pathinfo, sbuf ); } ffc1cc38: 80 01 00 14 lwz r0,20(r1) ffc1cc3c: 38 60 ff ff li r3,-1 ffc1cc40: 83 c1 00 08 lwz r30,8(r1) ffc1cc44: 7c 08 03 a6 mtlr r0 ffc1cc48: 83 e1 00 0c lwz r31,12(r1) ffc1cc4c: 38 21 00 10 addi r1,r1,16 ffc1cc50: 4e 80 00 20 blr /* * Check to see if we were passed a valid pointer. */ if ( !sbuf ) rtems_set_errno_and_return_minus_one( EFAULT ); ffc1cc54: 4b ff 54 25 bl ffc12078 <__errno> <== NOT EXECUTED ffc1cc58: 39 20 00 0e li r9,14 <== NOT EXECUTED ffc1cc5c: 91 23 00 00 stw r9,0(r3) <== NOT EXECUTED ffc1cc60: 4b ff ff d8 b ffc1cc38 <== NOT EXECUTED =============================================================================== ffc04588 : 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) { ffc04588: 3d 20 00 00 lis r9,0 ffc0458c: 81 49 28 48 lwz r10,10312(r9) ffc04590: 39 29 28 48 addi r9,r9,10312 ffc04594: 7f 8a 18 40 cmplw cr7,r10,r3 ffc04598: 40 9d 00 64 ble- cr7,ffc045fc <== NEVER TAKEN ffc0459c: 81 29 00 04 lwz r9,4(r9) ffc045a0: 2f 89 00 00 cmpwi cr7,r9,0 ffc045a4: 41 9e 00 58 beq- cr7,ffc045fc <== NEVER TAKEN rtems_disk_device_table *dtab = disktab + major; ffc045a8: 54 63 18 38 rlwinm r3,r3,3,0,28 ffc045ac: 7d 49 1a 14 add r10,r9,r3 if (minor < dtab->size && dtab->minor != NULL) { ffc045b0: 81 4a 00 04 lwz r10,4(r10) ffc045b4: 7f 8a 20 40 cmplw cr7,r10,r4 ffc045b8: 40 9d 00 44 ble- cr7,ffc045fc <== NEVER TAKEN ffc045bc: 7d 29 18 2e lwzx r9,r9,r3 ffc045c0: 2f 89 00 00 cmpwi cr7,r9,0 ffc045c4: 41 9e 00 38 beq- cr7,ffc045fc <== NEVER TAKEN rtems_disk_device *dd = dtab->minor [minor]; ffc045c8: 54 84 10 3a rlwinm r4,r4,2,0,29 ffc045cc: 7c 69 20 2e lwzx r3,r9,r4 if (dd != NULL && !lookup_only) { ffc045d0: 2f 83 00 00 cmpwi cr7,r3,0 ffc045d4: 4d 9e 00 20 beqlr cr7 ffc045d8: 2f 85 00 00 cmpwi cr7,r5,0 ffc045dc: 4c 9e 00 20 bnelr cr7 if (!dd->deleted) { ffc045e0: 89 23 00 40 lbz r9,64(r3) ffc045e4: 2f 89 00 00 cmpwi cr7,r9,0 ffc045e8: 40 9e 00 14 bne- cr7,ffc045fc ++dd->uses; ffc045ec: 81 23 00 14 lwz r9,20(r3) ffc045f0: 39 29 00 01 addi r9,r9,1 ffc045f4: 91 23 00 14 stw r9,20(r3) ffc045f8: 4e 80 00 20 blr return dd; } } return NULL; ffc045fc: 38 60 00 00 li r3,0 } ffc04600: 4e 80 00 20 blr =============================================================================== ffc067c4 : * 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, ffc067c4: 94 21 ff e8 stwu r1,-24(r1) ffc067c8: 7c 08 02 a6 mflr r0 ffc067cc: 93 c1 00 10 stw r30,16(r1) ffc067d0: 7c 7e 1b 78 mr r30,r3 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); ffc067d4: 38 60 02 04 li r3,516 * 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, ffc067d8: 93 81 00 08 stw r28,8(r1) ffc067dc: 7c 9c 23 78 mr r28,r4 ffc067e0: 93 a1 00 0c stw r29,12(r1) ffc067e4: 7c bd 2b 78 mr r29,r5 ffc067e8: 93 e1 00 14 stw r31,20(r1) ffc067ec: 90 01 00 1c stw r0,28(r1) 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); ffc067f0: 48 00 19 7d bl ffc0816c if (s == NULL) ffc067f4: 7c 7f 1b 79 mr. r31,r3 ffc067f8: 41 82 00 48 beq- ffc06840 <== NEVER TAKEN { return RTEMS_NO_MEMORY; } n = read(fd, s->data, RTEMS_IDE_SECTOR_SIZE); ffc067fc: 7f c3 f3 78 mr r3,r30 ffc06800: 38 9f 00 04 addi r4,r31,4 ffc06804: 38 a0 02 00 li r5,512 ffc06808: 48 00 26 81 bl ffc08e88 if (n != RTEMS_IDE_SECTOR_SIZE) ffc0680c: 2f 83 02 00 cmpwi cr7,r3,512 ffc06810: 41 9e 00 54 beq- cr7,ffc06864 <== ALWAYS TAKEN { free(s); ffc06814: 7f e3 fb 78 mr r3,r31 <== NOT EXECUTED ffc06818: 48 00 11 bd bl ffc079d4 <== NOT EXECUTED s->sector_num = sector_num; *sector = s; return RTEMS_SUCCESSFUL; } ffc0681c: 80 01 00 1c lwz r0,28(r1) <== NOT EXECUTED ffc06820: 83 81 00 08 lwz r28,8(r1) <== NOT EXECUTED n = read(fd, s->data, RTEMS_IDE_SECTOR_SIZE); if (n != RTEMS_IDE_SECTOR_SIZE) { free(s); return RTEMS_IO_ERROR; ffc06824: 38 60 00 1b li r3,27 <== NOT EXECUTED s->sector_num = sector_num; *sector = s; return RTEMS_SUCCESSFUL; } ffc06828: 7c 08 03 a6 mtlr r0 <== NOT EXECUTED ffc0682c: 83 a1 00 0c lwz r29,12(r1) <== NOT EXECUTED ffc06830: 83 c1 00 10 lwz r30,16(r1) <== NOT EXECUTED ffc06834: 83 e1 00 14 lwz r31,20(r1) <== NOT EXECUTED ffc06838: 38 21 00 18 addi r1,r1,24 <== NOT EXECUTED ffc0683c: 4e 80 00 20 blr <== NOT EXECUTED ffc06840: 80 01 00 1c lwz r0,28(r1) <== NOT EXECUTED } s = (rtems_sector_data_t *) malloc(sizeof(rtems_sector_data_t) + RTEMS_IDE_SECTOR_SIZE); if (s == NULL) { return RTEMS_NO_MEMORY; ffc06844: 38 60 00 1a li r3,26 <== NOT EXECUTED s->sector_num = sector_num; *sector = s; return RTEMS_SUCCESSFUL; } ffc06848: 83 81 00 08 lwz r28,8(r1) <== NOT EXECUTED ffc0684c: 7c 08 03 a6 mtlr r0 <== NOT EXECUTED ffc06850: 83 a1 00 0c lwz r29,12(r1) <== NOT EXECUTED ffc06854: 83 c1 00 10 lwz r30,16(r1) <== NOT EXECUTED ffc06858: 83 e1 00 14 lwz r31,20(r1) <== NOT EXECUTED ffc0685c: 38 21 00 18 addi r1,r1,24 <== NOT EXECUTED ffc06860: 4e 80 00 20 blr <== NOT EXECUTED ffc06864: 80 01 00 1c lwz r0,28(r1) s->sector_num = sector_num; *sector = s; return RTEMS_SUCCESSFUL; ffc06868: 38 60 00 00 li r3,0 { free(s); return RTEMS_IO_ERROR; } s->sector_num = sector_num; ffc0686c: 93 9f 00 00 stw r28,0(r31) *sector = s; return RTEMS_SUCCESSFUL; } ffc06870: 7c 08 03 a6 mtlr r0 return RTEMS_IO_ERROR; } s->sector_num = sector_num; *sector = s; ffc06874: 93 fd 00 00 stw r31,0(r29) return RTEMS_SUCCESSFUL; } ffc06878: 83 81 00 08 lwz r28,8(r1) ffc0687c: 83 a1 00 0c lwz r29,12(r1) ffc06880: 83 c1 00 10 lwz r30,16(r1) ffc06884: 83 e1 00 14 lwz r31,20(r1) ffc06888: 38 21 00 18 addi r1,r1,24 ffc0688c: 4e 80 00 20 blr =============================================================================== ffc3805c : rtems_filesystem_node_types_t type; /* * Get the file control block structure associated with the file descriptor */ iop = rtems_libio_iop( dd_fd ); ffc3805c: 3d 20 00 00 lis r9,0 int getdents( int dd_fd, char *dd_buf, int dd_len ) { ffc38060: 94 21 ff e8 stwu r1,-24(r1) ffc38064: 7c 08 02 a6 mflr r0 rtems_filesystem_node_types_t type; /* * Get the file control block structure associated with the file descriptor */ iop = rtems_libio_iop( dd_fd ); ffc38068: 81 29 27 78 lwz r9,10104(r9) int getdents( int dd_fd, char *dd_buf, int dd_len ) { ffc3806c: 93 a1 00 0c stw r29,12(r1) ffc38070: 7c 9d 23 78 mr r29,r4 rtems_filesystem_node_types_t type; /* * Get the file control block structure associated with the file descriptor */ iop = rtems_libio_iop( dd_fd ); ffc38074: 7f 83 48 40 cmplw cr7,r3,r9 int getdents( int dd_fd, char *dd_buf, int dd_len ) { ffc38078: 93 c1 00 10 stw r30,16(r1) ffc3807c: 7c be 2b 78 mr r30,r5 ffc38080: 93 e1 00 14 stw r31,20(r1) rtems_filesystem_node_types_t type; /* * Get the file control block structure associated with the file descriptor */ iop = rtems_libio_iop( dd_fd ); ffc38084: 3b e0 00 00 li r31,0 int getdents( int dd_fd, char *dd_buf, int dd_len ) { ffc38088: 90 01 00 1c stw r0,28(r1) rtems_filesystem_node_types_t type; /* * Get the file control block structure associated with the file descriptor */ iop = rtems_libio_iop( dd_fd ); ffc3808c: 40 9c 00 14 bge- cr7,ffc380a0 <== NEVER TAKEN ffc38090: 3d 20 00 00 lis r9,0 ffc38094: 1c 63 00 38 mulli r3,r3,56 ffc38098: 83 e9 28 24 lwz r31,10276(r9) ffc3809c: 7f ff 1a 14 add r31,r31,r3 /* * Make sure we are working on a directory */ type = rtems_filesystem_node_type( &iop->pathinfo ); ffc380a0: 38 7f 00 14 addi r3,r31,20 ffc380a4: 4b fd 4a 89 bl ffc0cb2c if ( type != RTEMS_FILESYSTEM_DIRECTORY ) ffc380a8: 2f 83 00 00 cmpwi cr7,r3,0 ffc380ac: 40 9e 00 38 bne- cr7,ffc380e4 /* * 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 ); ffc380b0: 81 3f 00 24 lwz r9,36(r31) ffc380b4: 7f e3 fb 78 mr r3,r31 } ffc380b8: 80 01 00 1c lwz r0,28(r1) /* * 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 ); ffc380bc: 7f a4 eb 78 mr r4,r29 ffc380c0: 81 29 00 08 lwz r9,8(r9) ffc380c4: 7f c5 f3 78 mr r5,r30 } ffc380c8: 7c 08 03 a6 mtlr r0 ffc380cc: 83 a1 00 0c lwz r29,12(r1) /* * 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 ); ffc380d0: 7d 29 03 a6 mtctr r9 } ffc380d4: 83 c1 00 10 lwz r30,16(r1) ffc380d8: 83 e1 00 14 lwz r31,20(r1) ffc380dc: 38 21 00 18 addi r1,r1,24 /* * 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 ); ffc380e0: 4e 80 04 20 bctr /* * Make sure we are working on a directory */ type = rtems_filesystem_node_type( &iop->pathinfo ); if ( type != RTEMS_FILESYSTEM_DIRECTORY ) rtems_set_errno_and_return_minus_one( ENOTDIR ); ffc380e4: 4b fe fe 59 bl ffc27f3c <__errno> /* * 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 ); } ffc380e8: 80 01 00 1c lwz r0,28(r1) /* * Make sure we are working on a directory */ type = rtems_filesystem_node_type( &iop->pathinfo ); if ( type != RTEMS_FILESYSTEM_DIRECTORY ) rtems_set_errno_and_return_minus_one( ENOTDIR ); ffc380ec: 39 20 00 14 li r9,20 /* * 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 ); } ffc380f0: 83 a1 00 0c lwz r29,12(r1) ffc380f4: 7c 08 03 a6 mtlr r0 /* * Make sure we are working on a directory */ type = rtems_filesystem_node_type( &iop->pathinfo ); if ( type != RTEMS_FILESYSTEM_DIRECTORY ) rtems_set_errno_and_return_minus_one( ENOTDIR ); ffc380f8: 91 23 00 00 stw r9,0(r3) /* * 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 ); } ffc380fc: 38 60 ff ff li r3,-1 ffc38100: 83 c1 00 10 lwz r30,16(r1) ffc38104: 83 e1 00 14 lwz r31,20(r1) ffc38108: 38 21 00 18 addi r1,r1,24 ffc3810c: 4e 80 00 20 blr =============================================================================== ffc04c54 : */ int gettimeofday( struct timeval *tp, void * __tz __attribute__((unused)) ) { ffc04c54: 94 21 ff d8 stwu r1,-40(r1) ffc04c58: 7c 08 02 a6 mflr r0 ffc04c5c: 93 a1 00 1c stw r29,28(r1) /* struct timezone* tzp = (struct timezone*) __tz; */ if ( !tp ) ffc04c60: 7c 7d 1b 79 mr. r29,r3 */ int gettimeofday( struct timeval *tp, void * __tz __attribute__((unused)) ) { ffc04c64: 90 01 00 2c stw r0,44(r1) ffc04c68: 93 c1 00 20 stw r30,32(r1) ffc04c6c: 93 e1 00 24 stw r31,36(r1) /* struct timezone* tzp = (struct timezone*) __tz; */ if ( !tp ) ffc04c70: 41 82 00 80 beq- ffc04cf0 <== NEVER TAKEN ) { Timestamp_Control snapshot_as_timestamp; Timestamp_Control *snapshot_as_timestamp_ptr; snapshot_as_timestamp_ptr = ffc04c74: 3c 80 00 00 lis r4,0 ffc04c78: 38 84 2b e0 addi r4,r4,11232 ffc04c7c: 38 61 00 08 addi r3,r1,8 ffc04c80: 48 00 60 bd bl ffc0ad3c <_TOD_Get_with_nanoseconds> static inline void _Timestamp64_implementation_To_timeval( const Timestamp64_Control *_timestamp, struct timeval *_timeval ) { _timeval->tv_sec = (time_t) (*_timestamp / 1000000000U); ffc04c84: 3c c0 3b 9a lis r6,15258 struct timeval *tp, struct timezone *tzp ) { return gettimeofday( tp, tzp ); } ffc04c88: 83 e3 00 04 lwz r31,4(r3) ffc04c8c: 38 a0 00 00 li r5,0 ffc04c90: 83 c3 00 00 lwz r30,0(r3) ffc04c94: 60 c6 ca 00 ori r6,r6,51712 ffc04c98: 7f e4 fb 78 mr r4,r31 ffc04c9c: 7f c3 f3 78 mr r3,r30 ffc04ca0: 48 01 6b f1 bl ffc1b890 <__divdi3> _timeval->tv_usec = (suseconds_t) ((*_timestamp % 1000000000U) / 1000U); ffc04ca4: 3c c0 3b 9a lis r6,15258 static inline void _Timestamp64_implementation_To_timeval( const Timestamp64_Control *_timestamp, struct timeval *_timeval ) { _timeval->tv_sec = (time_t) (*_timestamp / 1000000000U); ffc04ca8: 90 9d 00 00 stw r4,0(r29) _timeval->tv_usec = (suseconds_t) ((*_timestamp % 1000000000U) / 1000U); ffc04cac: 38 a0 00 00 li r5,0 ffc04cb0: 60 c6 ca 00 ori r6,r6,51712 ffc04cb4: 7f c3 f3 78 mr r3,r30 ffc04cb8: 7f e4 fb 78 mr r4,r31 ffc04cbc: 48 01 6f f9 bl ffc1bcb4 <__moddi3> ffc04cc0: 38 a0 00 00 li r5,0 ffc04cc4: 38 c0 03 e8 li r6,1000 ffc04cc8: 48 01 6b c9 bl ffc1b890 <__divdi3> * Timezone information ignored by the OS proper. Per email * with Eric Norum, this is how GNU/Linux, Solaris, and MacOS X * do it. This puts us in good company. */ return 0; ffc04ccc: 38 60 00 00 li r3,0 ffc04cd0: 90 9d 00 04 stw r4,4(r29) } ffc04cd4: 80 01 00 2c lwz r0,44(r1) ffc04cd8: 83 a1 00 1c lwz r29,28(r1) ffc04cdc: 7c 08 03 a6 mtlr r0 ffc04ce0: 83 c1 00 20 lwz r30,32(r1) ffc04ce4: 83 e1 00 24 lwz r31,36(r1) ffc04ce8: 38 21 00 28 addi r1,r1,40 ffc04cec: 4e 80 00 20 blr void * __tz __attribute__((unused)) ) { /* struct timezone* tzp = (struct timezone*) __tz; */ if ( !tp ) rtems_set_errno_and_return_minus_one( EFAULT ); ffc04cf0: 48 00 d3 89 bl ffc12078 <__errno> <== NOT EXECUTED ffc04cf4: 39 20 00 0e li r9,14 <== NOT EXECUTED ffc04cf8: 91 23 00 00 stw r9,0(r3) <== NOT EXECUTED ffc04cfc: 38 60 ff ff li r3,-1 <== NOT EXECUTED ffc04d00: 4b ff ff d4 b ffc04cd4 <== NOT EXECUTED =============================================================================== ffc117bc : ssize_t imfs_dir_read( rtems_libio_t *iop, void *buffer, size_t count ) { ffc117bc: 94 21 fe b0 stwu r1,-336(r1) ffc117c0: 7c 08 02 a6 mflr r0 ffc117c4: 90 01 01 54 stw r0,340(r1) ffc117c8: 93 41 01 38 stw r26,312(r1) ffc117cc: 7c 7a 1b 78 mr r26,r3 } rtems_filesystem_instance_unlock( &iop->pathinfo ); return bytes_transferred; } ffc117d0: 80 63 00 28 lwz r3,40(r3) ssize_t imfs_dir_read( rtems_libio_t *iop, void *buffer, size_t count ) { ffc117d4: 93 61 01 3c stw r27,316(r1) bytes_transferred = 0; first_entry = iop->offset; /* protect against using sizes that are not exact multiples of the */ /* -dirent- size. These could result in unexpected results */ last_entry = first_entry + (count / sizeof( struct dirent )) * sizeof( struct dirent ); ffc117d8: 3f 60 0e a0 lis r27,3744 ffc117dc: 63 7b ea 0f ori r27,r27,59919 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 ); ffc117e0: 81 23 00 0c lwz r9,12(r3) ssize_t imfs_dir_read( rtems_libio_t *iop, void *buffer, size_t count ) { ffc117e4: 93 e1 01 4c stw r31,332(r1) ffc117e8: 7c bf 2b 78 mr r31,r5 bytes_transferred = 0; first_entry = iop->offset; /* protect against using sizes that are not exact multiples of the */ /* -dirent- size. These could result in unexpected results */ last_entry = first_entry + (count / sizeof( struct dirent )) * sizeof( struct dirent ); ffc117ec: 57 ff e8 fe rlwinm r31,r31,29,3,31 ffc117f0: 81 29 00 00 lwz r9,0(r9) ffc117f4: 7f 7f d8 16 mulhwu r27,r31,r27 ssize_t imfs_dir_read( rtems_libio_t *iop, void *buffer, size_t count ) { ffc117f8: 92 e1 01 2c stw r23,300(r1) ffc117fc: 7d 29 03 a6 mtctr r9 ffc11800: 7c 97 23 78 mr r23,r4 ffc11804: 93 81 01 40 stw r28,320(r1) bytes_transferred = 0; first_entry = iop->offset; /* protect against using sizes that are not exact multiples of the */ /* -dirent- size. These could result in unexpected results */ last_entry = first_entry + (count / sizeof( struct dirent )) * sizeof( struct dirent ); ffc11808: 57 7b f8 7e rlwinm r27,r27,31,1,31 ffc1180c: 1f 7b 01 18 mulli r27,r27,280 ssize_t imfs_dir_read( rtems_libio_t *iop, void *buffer, size_t count ) { ffc11810: 93 a1 01 44 stw r29,324(r1) ffc11814: 93 c1 01 48 stw r30,328(r1) ffc11818: 92 c1 01 28 stw r22,296(r1) ffc1181c: 93 01 01 30 stw r24,304(r1) ffc11820: 93 21 01 34 stw r25,308(r1) ffc11824: 4e 80 04 21 bctrl the_chain = &the_jnode->info.directory.Entries; /* Move to the first of the desired directory entries */ bytes_transferred = 0; first_entry = iop->offset; ffc11828: 83 ba 00 0c lwz r29,12(r26) int last_entry; struct dirent tmp_dirent; rtems_filesystem_instance_lock( &iop->pathinfo ); the_jnode = (IMFS_jnode_t *)iop->pathinfo.node_access; ffc1182c: 83 9a 00 1c lwz r28,28(r26) /* -dirent- size. These could result in unexpected results */ last_entry = first_entry + (count / sizeof( struct dirent )) * sizeof( struct dirent ); /* The directory was not empty so try to move to the desired entry in chain*/ for ( ffc11830: 7f 7b ea 15 add. r27,r27,r29 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_First( Chain_Control *the_chain ) { return _Chain_Head( the_chain )->next; ffc11834: 83 dc 00 50 lwz r30,80(r28) ffc11838: 40 81 01 0c ble- ffc11944 <== NEVER TAKEN 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 )); ffc1183c: 3b 9c 00 54 addi r28,r28,84 current_entry = 0, the_node = rtems_chain_first( the_chain ); current_entry < last_entry && !rtems_chain_is_tail( the_chain, the_node ); ffc11840: 7f 9e e0 00 cmpw cr7,r30,r28 ffc11844: 41 9e 01 00 beq- cr7,ffc11944 ffc11848: 3b e0 00 00 li r31,0 ffc1184c: 3b 20 00 00 li r25,0 the_node = rtems_chain_next( the_node ) ) { if( current_entry >= first_entry ) { /* Move the entry to the return buffer */ tmp_dirent.d_off = current_entry; tmp_dirent.d_reclen = sizeof( struct dirent ); ffc11850: 3a c0 01 18 li r22,280 ffc11854: 48 00 00 1c b ffc11870 #include "imfs.h" #include #include ssize_t imfs_dir_read( ffc11858: 3b ff 01 18 addi r31,r31,280 } rtems_filesystem_instance_unlock( &iop->pathinfo ); return bytes_transferred; } ffc1185c: 83 de 00 00 lwz r30,0(r30) /* -dirent- size. These could result in unexpected results */ last_entry = first_entry + (count / sizeof( struct dirent )) * sizeof( struct dirent ); /* The directory was not empty so try to move to the desired entry in chain*/ for ( ffc11860: 7f 9b f8 00 cmpw cr7,r27,r31 current_entry = 0, the_node = rtems_chain_first( the_chain ); current_entry < last_entry && !rtems_chain_is_tail( the_chain, the_node ); ffc11864: 7f 1e e0 00 cmpw cr6,r30,r28 /* -dirent- size. These could result in unexpected results */ last_entry = first_entry + (count / sizeof( struct dirent )) * sizeof( struct dirent ); /* The directory was not empty so try to move to the desired entry in chain*/ for ( ffc11868: 40 9d 00 8c ble- cr7,ffc118f4 <== NEVER TAKEN current_entry = 0, the_node = rtems_chain_first( the_chain ); current_entry < last_entry && !rtems_chain_is_tail( the_chain, the_node ); ffc1186c: 41 9a 00 88 beq- cr6,ffc118f4 current_entry += sizeof( struct dirent ), the_node = rtems_chain_next( the_node ) ) { if( current_entry >= first_entry ) { ffc11870: 7f 9d f8 00 cmpw cr7,r29,r31 ffc11874: 41 9d ff e4 bgt+ cr7,ffc11858 /* Move the entry to the return buffer */ tmp_dirent.d_off = current_entry; tmp_dirent.d_reclen = sizeof( struct dirent ); the_jnode = (IMFS_jnode_t *) the_node; tmp_dirent.d_ino = the_jnode->st_ino; ffc11878: 81 3e 00 38 lwz r9,56(r30) tmp_dirent.d_namlen = strlen( the_jnode->name ); ffc1187c: 3b 1e 00 0c addi r24,r30,12 current_entry += sizeof( struct dirent ), the_node = rtems_chain_next( the_node ) ) { if( current_entry >= first_entry ) { /* Move the entry to the return buffer */ tmp_dirent.d_off = current_entry; ffc11880: 7f ea fe 70 srawi r10,r31,31 ffc11884: 93 e1 00 14 stw r31,20(r1) tmp_dirent.d_reclen = sizeof( struct dirent ); the_jnode = (IMFS_jnode_t *) the_node; tmp_dirent.d_ino = the_jnode->st_ino; tmp_dirent.d_namlen = strlen( the_jnode->name ); ffc11888: 7f 03 c3 78 mr r3,r24 current_entry += sizeof( struct dirent ), the_node = rtems_chain_next( the_node ) ) { if( current_entry >= first_entry ) { /* Move the entry to the return buffer */ tmp_dirent.d_off = current_entry; ffc1188c: 91 41 00 10 stw r10,16(r1) #include "imfs.h" #include #include ssize_t imfs_dir_read( ffc11890: 3b ff 01 18 addi r31,r31,280 if( current_entry >= first_entry ) { /* Move the entry to the return buffer */ tmp_dirent.d_off = current_entry; tmp_dirent.d_reclen = sizeof( struct dirent ); the_jnode = (IMFS_jnode_t *) the_node; tmp_dirent.d_ino = the_jnode->st_ino; ffc11894: 91 21 00 08 stw r9,8(r1) the_node = rtems_chain_next( the_node ) ) { if( current_entry >= first_entry ) { /* Move the entry to the return buffer */ tmp_dirent.d_off = current_entry; tmp_dirent.d_reclen = sizeof( struct dirent ); ffc11898: b2 c1 00 18 sth r22,24(r1) the_jnode = (IMFS_jnode_t *) the_node; tmp_dirent.d_ino = the_jnode->st_ino; tmp_dirent.d_namlen = strlen( the_jnode->name ); ffc1189c: 48 00 20 31 bl ffc138cc ffc118a0: 7c 69 1b 78 mr r9,r3 strcpy( tmp_dirent.d_name, the_jnode->name ); ffc118a4: 38 a3 00 01 addi r5,r3,1 /* Move the entry to the return buffer */ tmp_dirent.d_off = current_entry; tmp_dirent.d_reclen = sizeof( struct dirent ); the_jnode = (IMFS_jnode_t *) the_node; tmp_dirent.d_ino = the_jnode->st_ino; tmp_dirent.d_namlen = strlen( the_jnode->name ); ffc118a8: b1 21 00 1a sth r9,26(r1) strcpy( tmp_dirent.d_name, the_jnode->name ); ffc118ac: 7f 04 c3 78 mr r4,r24 ffc118b0: 38 61 00 1c addi r3,r1,28 ffc118b4: 48 00 14 c9 bl ffc12d7c memcpy( ffc118b8: 7c 77 ca 14 add r3,r23,r25 ffc118bc: 38 81 00 08 addi r4,r1,8 ffc118c0: 38 a0 01 18 li r5,280 ffc118c4: 48 00 14 b9 bl ffc12d7c /* -dirent- size. These could result in unexpected results */ last_entry = first_entry + (count / sizeof( struct dirent )) * sizeof( struct dirent ); /* The directory was not empty so try to move to the desired entry in chain*/ for ( ffc118c8: 7f 9b f8 00 cmpw cr7,r27,r31 memcpy( buffer + bytes_transferred, (void *)&tmp_dirent, sizeof( struct dirent ) ); iop->offset += sizeof( struct dirent ); ffc118cc: 81 5a 00 08 lwz r10,8(r26) bytes_transferred += sizeof( struct dirent ); ffc118d0: 3b 39 01 18 addi r25,r25,280 memcpy( buffer + bytes_transferred, (void *)&tmp_dirent, sizeof( struct dirent ) ); iop->offset += sizeof( struct dirent ); ffc118d4: 81 7a 00 0c lwz r11,12(r26) } rtems_filesystem_instance_unlock( &iop->pathinfo ); return bytes_transferred; } ffc118d8: 83 de 00 00 lwz r30,0(r30) memcpy( buffer + bytes_transferred, (void *)&tmp_dirent, sizeof( struct dirent ) ); iop->offset += sizeof( struct dirent ); ffc118dc: 31 6b 01 18 addic r11,r11,280 ffc118e0: 7d 4a 01 94 addze r10,r10 ffc118e4: 91 5a 00 08 stw r10,8(r26) /* The directory was not empty so try to move to the desired entry in chain*/ for ( current_entry = 0, the_node = rtems_chain_first( the_chain ); current_entry < last_entry && !rtems_chain_is_tail( the_chain, the_node ); ffc118e8: 7f 1e e0 00 cmpw cr6,r30,r28 memcpy( buffer + bytes_transferred, (void *)&tmp_dirent, sizeof( struct dirent ) ); iop->offset += sizeof( struct dirent ); ffc118ec: 91 7a 00 0c stw r11,12(r26) /* -dirent- size. These could result in unexpected results */ last_entry = first_entry + (count / sizeof( struct dirent )) * sizeof( struct dirent ); /* The directory was not empty so try to move to the desired entry in chain*/ for ( ffc118f0: 41 9d ff 7c bgt+ cr7,ffc1186c <== NEVER TAKEN } rtems_filesystem_instance_unlock( &iop->pathinfo ); return bytes_transferred; } ffc118f4: 80 7a 00 28 lwz r3,40(r26) const rtems_filesystem_location_info_t *loc ) { const rtems_filesystem_mount_table_entry_t *mt_entry = loc->mt_entry; (*mt_entry->ops->unlock_h)( mt_entry ); ffc118f8: 81 23 00 0c lwz r9,12(r3) ffc118fc: 81 29 00 04 lwz r9,4(r9) ffc11900: 7d 29 03 a6 mtctr r9 ffc11904: 4e 80 04 21 bctrl ffc11908: 80 01 01 54 lwz r0,340(r1) ffc1190c: 7f 23 cb 78 mr r3,r25 ffc11910: 82 c1 01 28 lwz r22,296(r1) ffc11914: 7c 08 03 a6 mtlr r0 ffc11918: 82 e1 01 2c lwz r23,300(r1) ffc1191c: 83 01 01 30 lwz r24,304(r1) ffc11920: 83 21 01 34 lwz r25,308(r1) ffc11924: 83 41 01 38 lwz r26,312(r1) ffc11928: 83 61 01 3c lwz r27,316(r1) ffc1192c: 83 81 01 40 lwz r28,320(r1) ffc11930: 83 a1 01 44 lwz r29,324(r1) ffc11934: 83 c1 01 48 lwz r30,328(r1) ffc11938: 83 e1 01 4c lwz r31,332(r1) ffc1193c: 38 21 01 50 addi r1,r1,336 ffc11940: 4e 80 00 20 blr the_jnode = (IMFS_jnode_t *)iop->pathinfo.node_access; the_chain = &the_jnode->info.directory.Entries; /* Move to the first of the desired directory entries */ bytes_transferred = 0; ffc11944: 3b 20 00 00 li r25,0 ffc11948: 4b ff ff ac b ffc118f4 =============================================================================== ffc2c444 : void init_etc_passwd_group(void) { FILE *fp; static char etc_passwd_initted = 0; if (etc_passwd_initted) ffc2c444: 3d 20 00 00 lis r9,0 ffc2c448: 89 49 5c cc lbz r10,23756(r9) ffc2c44c: 2f 8a 00 00 cmpwi cr7,r10,0 ffc2c450: 4c be 00 20 bnelr+ cr7 /** * Initialize useable but dummy databases */ void init_etc_passwd_group(void) { ffc2c454: 94 21 ff f0 stwu r1,-16(r1) ffc2c458: 7c 08 02 a6 mflr r0 static char etc_passwd_initted = 0; if (etc_passwd_initted) return; etc_passwd_initted = 1; mkdir("/etc", 0777); ffc2c45c: 3c 60 ff c6 lis r3,-58 /** * Initialize useable but dummy databases */ void init_etc_passwd_group(void) { ffc2c460: 93 c1 00 08 stw r30,8(r1) mkdir("/etc", 0777); /* * Initialize /etc/passwd */ if ((fp = fopen("/etc/passwd", "r")) != NULL) { ffc2c464: 3f c0 ff c6 lis r30,-58 FILE *fp; static char etc_passwd_initted = 0; if (etc_passwd_initted) return; etc_passwd_initted = 1; ffc2c468: 39 40 00 01 li r10,1 /** * Initialize useable but dummy databases */ void init_etc_passwd_group(void) { ffc2c46c: 93 e1 00 0c stw r31,12(r1) mkdir("/etc", 0777); /* * Initialize /etc/passwd */ if ((fp = fopen("/etc/passwd", "r")) != NULL) { ffc2c470: 3f e0 ff c6 lis r31,-58 static char etc_passwd_initted = 0; if (etc_passwd_initted) return; etc_passwd_initted = 1; mkdir("/etc", 0777); ffc2c474: 38 80 01 ff li r4,511 ffc2c478: 38 63 67 54 addi r3,r3,26452 /** * Initialize useable but dummy databases */ void init_etc_passwd_group(void) { ffc2c47c: 90 01 00 14 stw r0,20(r1) mkdir("/etc", 0777); /* * Initialize /etc/passwd */ if ((fp = fopen("/etc/passwd", "r")) != NULL) { ffc2c480: 3b de 67 5c addi r30,r30,26460 ffc2c484: 3b ff 58 20 addi r31,r31,22560 FILE *fp; static char etc_passwd_initted = 0; if (etc_passwd_initted) return; etc_passwd_initted = 1; ffc2c488: 99 49 5c cc stb r10,23756(r9) mkdir("/etc", 0777); ffc2c48c: 4b fd 86 4d bl ffc04ad8 /* * Initialize /etc/passwd */ if ((fp = fopen("/etc/passwd", "r")) != NULL) { ffc2c490: 7f c3 f3 78 mr r3,r30 ffc2c494: 7f e4 fb 78 mr r4,r31 ffc2c498: 48 01 73 71 bl ffc43808 ffc2c49c: 2f 83 00 00 cmpwi cr7,r3,0 ffc2c4a0: 41 9e 00 3c beq- cr7,ffc2c4dc } else if ((fp = fopen("/etc/passwd", "w")) != NULL) { fprintf(fp, "root:*:0:0:root::/:/bin/sh\n" "rtems:*:1:1:RTEMS Application::/:/bin/sh\n" "tty:!:2:2:tty owner::/:/bin/false\n" ); fclose(fp); ffc2c4a4: 48 01 67 4d bl ffc42bf0 } /* * Initialize /etc/group */ if ((fp = fopen("/etc/group", "r")) != NULL) { ffc2c4a8: 3f c0 ff c6 lis r30,-58 ffc2c4ac: 3b de 67 d0 addi r30,r30,26576 ffc2c4b0: 7f c3 f3 78 mr r3,r30 ffc2c4b4: 7f e4 fb 78 mr r4,r31 ffc2c4b8: 48 01 73 51 bl ffc43808 ffc2c4bc: 2f 83 00 00 cmpwi cr7,r3,0 ffc2c4c0: 41 9e 00 54 beq- cr7,ffc2c514 fprintf( fp, "root:x:0:root\n" "rtems:x:1:rtems\n" "tty:x:2:tty\n" ); fclose(fp); } } ffc2c4c4: 80 01 00 14 lwz r0,20(r1) ffc2c4c8: 83 c1 00 08 lwz r30,8(r1) ffc2c4cc: 7c 08 03 a6 mtlr r0 ffc2c4d0: 83 e1 00 0c lwz r31,12(r1) ffc2c4d4: 38 21 00 10 addi r1,r1,16 } else if ((fp = fopen("/etc/group", "w")) != NULL) { fprintf( fp, "root:x:0:root\n" "rtems:x:1:rtems\n" "tty:x:2:tty\n" ); fclose(fp); ffc2c4d8: 48 01 67 18 b ffc42bf0 * Initialize /etc/passwd */ if ((fp = fopen("/etc/passwd", "r")) != NULL) { fclose(fp); } else if ((fp = fopen("/etc/passwd", "w")) != NULL) { ffc2c4dc: 3c 80 ff c6 lis r4,-58 ffc2c4e0: 7f c3 f3 78 mr r3,r30 ffc2c4e4: 38 84 17 e8 addi r4,r4,6120 ffc2c4e8: 48 01 73 21 bl ffc43808 ffc2c4ec: 7c 7e 1b 79 mr. r30,r3 ffc2c4f0: 41 a2 ff b8 beq- ffc2c4a8 <== NEVER TAKEN fprintf(fp, "root:*:0:0:root::/:/bin/sh\n" ffc2c4f4: 3c 60 ff c6 lis r3,-58 ffc2c4f8: 38 63 67 68 addi r3,r3,26472 ffc2c4fc: 38 80 00 01 li r4,1 ffc2c500: 38 a0 00 66 li r5,102 ffc2c504: 7f c6 f3 78 mr r6,r30 ffc2c508: 48 01 8a 55 bl ffc44f5c "rtems:*:1:1:RTEMS Application::/:/bin/sh\n" "tty:!:2:2:tty owner::/:/bin/false\n" ); fclose(fp); ffc2c50c: 7f c3 f3 78 mr r3,r30 ffc2c510: 4b ff ff 94 b ffc2c4a4 * Initialize /etc/group */ if ((fp = fopen("/etc/group", "r")) != NULL) { fclose(fp); } else if ((fp = fopen("/etc/group", "w")) != NULL) { ffc2c514: 3c 80 ff c6 lis r4,-58 ffc2c518: 7f c3 f3 78 mr r3,r30 ffc2c51c: 38 84 17 e8 addi r4,r4,6120 ffc2c520: 48 01 72 e9 bl ffc43808 ffc2c524: 7c 7f 1b 79 mr. r31,r3 ffc2c528: 41 82 00 24 beq- ffc2c54c <== NEVER TAKEN fprintf( fp, "root:x:0:root\n" ffc2c52c: 3c 60 ff c6 lis r3,-58 ffc2c530: 38 63 67 dc addi r3,r3,26588 ffc2c534: 38 80 00 01 li r4,1 ffc2c538: 38 a0 00 2a li r5,42 ffc2c53c: 7f e6 fb 78 mr r6,r31 ffc2c540: 48 01 8a 1d bl ffc44f5c "rtems:x:1:rtems\n" "tty:x:2:tty\n" ); fclose(fp); ffc2c544: 7f e3 fb 78 mr r3,r31 ffc2c548: 4b ff ff 7c b ffc2c4c4 } } ffc2c54c: 80 01 00 14 lwz r0,20(r1) <== NOT EXECUTED ffc2c550: 83 c1 00 08 lwz r30,8(r1) <== NOT EXECUTED ffc2c554: 7c 08 03 a6 mtlr r0 <== NOT EXECUTED ffc2c558: 83 e1 00 0c lwz r31,12(r1) <== NOT EXECUTED ffc2c55c: 38 21 00 10 addi r1,r1,16 <== NOT EXECUTED ffc2c560: 4e 80 00 20 blr <== NOT EXECUTED =============================================================================== ffc08048 : /* * Process a single input character */ static int iproc (unsigned char c, struct rtems_termios_tty *tty) { ffc08048: 94 21 ff f0 stwu r1,-16(r1) ffc0804c: 7c 08 02 a6 mflr r0 ffc08050: 90 01 00 14 stw r0,20(r1) if (tty->termios.c_iflag & ISTRIP) ffc08054: 81 24 00 30 lwz r9,48(r4) /* * Process a single input character */ static int iproc (unsigned char c, struct rtems_termios_tty *tty) { ffc08058: 93 c1 00 08 stw r30,8(r1) ffc0805c: 7c 9e 23 78 mr r30,r4 if (tty->termios.c_iflag & ISTRIP) ffc08060: 71 28 00 20 andi. r8,r9,32 /* * Process a single input character */ static int iproc (unsigned char c, struct rtems_termios_tty *tty) { ffc08064: 93 e1 00 0c stw r31,12(r1) ffc08068: 7c 7f 1b 78 mr r31,r3 if (tty->termios.c_iflag & ISTRIP) ffc0806c: 41 82 00 08 beq- ffc08074 <== ALWAYS TAKEN c &= 0x7f; ffc08070: 54 7f 06 7e clrlwi r31,r3,25 <== NOT EXECUTED if (tty->termios.c_iflag & IUCLC) ffc08074: 71 2a 02 00 andi. r10,r9,512 ffc08078: 41 82 00 28 beq- ffc080a0 c = tolower (c); ffc0807c: 3d 40 00 00 lis r10,0 ffc08080: 81 0a 27 a0 lwz r8,10144(r10) ffc08084: 7f ea fb 78 mr r10,r31 ffc08088: 7f e8 fa 14 add r31,r8,r31 ffc0808c: 89 1f 00 01 lbz r8,1(r31) ffc08090: 55 08 07 be clrlwi r8,r8,30 ffc08094: 2f 88 00 01 cmpwi cr7,r8,1 ffc08098: 41 9e 01 3c beq- cr7,ffc081d4 ffc0809c: 55 5f 06 3e clrlwi r31,r10,24 if (c == '\r') { ffc080a0: 2f 9f 00 0d cmpwi cr7,r31,13 ffc080a4: 41 9e 00 98 beq- cr7,ffc0813c 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)) { ffc080a8: 2f 9f 00 0a cmpwi cr7,r31,10 ffc080ac: 41 9e 01 18 beq- cr7,ffc081c4 c = '\r'; } if ((c != '\0') && (tty->termios.c_lflag & ICANON)) { ffc080b0: 2f 9f 00 00 cmpwi cr7,r31,0 ffc080b4: 40 9e 00 9c bne- cr7,ffc08150 <== ALWAYS TAKEN } /* * FIXME: Should do IMAXBEL handling somehow */ if (tty->ccount < (CBUFSIZE-1)) { ffc080b8: 3d 20 00 00 lis r9,0 ffc080bc: 81 49 21 64 lwz r10,8548(r9) ffc080c0: 81 3e 00 20 lwz r9,32(r30) ffc080c4: 39 4a ff ff addi r10,r10,-1 ffc080c8: 7f 89 50 40 cmplw cr7,r9,r10 ffc080cc: 40 9c 00 54 bge- cr7,ffc08120 <== NEVER TAKEN if (tty->termios.c_lflag & ECHO) ffc080d0: 81 5e 00 3c lwz r10,60(r30) ffc080d4: 71 48 00 08 andi. r8,r10,8 ffc080d8: 40 82 01 04 bne- ffc081dc <== ALWAYS TAKEN echo (c, tty); tty->cbuf[tty->ccount++] = c; ffc080dc: 81 5e 00 1c lwz r10,28(r30) ffc080e0: 39 09 00 01 addi r8,r9,1 } return 0; ffc080e4: 38 60 00 00 li r3,0 * FIXME: Should do IMAXBEL handling somehow */ if (tty->ccount < (CBUFSIZE-1)) { if (tty->termios.c_lflag & ECHO) echo (c, tty); tty->cbuf[tty->ccount++] = c; ffc080e8: 7f ea 49 ae stbx r31,r10,r9 ffc080ec: 91 1e 00 20 stw r8,32(r30) } return 0; } ffc080f0: 80 01 00 14 lwz r0,20(r1) ffc080f4: 83 c1 00 08 lwz r30,8(r1) ffc080f8: 7c 08 03 a6 mtlr r0 ffc080fc: 83 e1 00 0c lwz r31,12(r1) ffc08100: 38 21 00 10 addi r1,r1,16 ffc08104: 4e 80 00 20 blr * FIXME: Some of the tests should check for IEXTEN, too. */ static void erase (struct rtems_termios_tty *tty, int lineFlag) { if (tty->ccount == 0) ffc08108: 81 3e 00 20 lwz r9,32(r30) ffc0810c: 2f 89 00 00 cmpwi cr7,r9,0 ffc08110: 41 9e 00 10 beq- cr7,ffc08120 ffc08114: 7f c3 f3 78 mr r3,r30 ffc08118: 38 80 00 00 li r4,0 ffc0811c: 4b ff fc fd bl ffc07e18 if (tty->termios.c_lflag & ECHO) echo (c, tty); tty->cbuf[tty->ccount++] = c; } return 0; } ffc08120: 80 01 00 14 lwz r0,20(r1) } if ((c != '\0') && (tty->termios.c_lflag & ICANON)) { if (c == tty->termios.c_cc[VERASE]) { erase (tty, 0); return 0; ffc08124: 38 60 00 00 li r3,0 if (tty->termios.c_lflag & ECHO) echo (c, tty); tty->cbuf[tty->ccount++] = c; } return 0; } ffc08128: 83 c1 00 08 lwz r30,8(r1) ffc0812c: 7c 08 03 a6 mtlr r0 ffc08130: 83 e1 00 0c lwz r31,12(r1) ffc08134: 38 21 00 10 addi r1,r1,16 ffc08138: 4e 80 00 20 blr if (tty->termios.c_iflag & IUCLC) c = tolower (c); if (c == '\r') { if (tty->termios.c_iflag & IGNCR) ffc0813c: 71 28 00 80 andi. r8,r9,128 ffc08140: 40 a2 ff e0 bne- ffc08120 <== NEVER TAKEN return 0; if (tty->termios.c_iflag & ICRNL) ffc08144: 71 2a 01 00 andi. r10,r9,256 ffc08148: 41 82 00 08 beq- ffc08150 <== NEVER TAKEN c = '\n'; ffc0814c: 3b e0 00 0a li r31,10 } else if ((c == '\n') && (tty->termios.c_iflag & INLCR)) { c = '\r'; } if ((c != '\0') && (tty->termios.c_lflag & ICANON)) { ffc08150: 81 3e 00 3c lwz r9,60(r30) ffc08154: 71 2a 00 02 andi. r10,r9,2 ffc08158: 41 a2 ff 60 beq- ffc080b8 if (c == tty->termios.c_cc[VERASE]) { ffc0815c: 89 5e 00 43 lbz r10,67(r30) ffc08160: 7f 8a f8 00 cmpw cr7,r10,r31 ffc08164: 41 be ff a4 beq- cr7,ffc08108 erase (tty, 0); return 0; } else if (c == tty->termios.c_cc[VKILL]) { ffc08168: 89 5e 00 44 lbz r10,68(r30) ffc0816c: 7f 8a f8 00 cmpw cr7,r10,r31 ffc08170: 41 9e 00 90 beq- cr7,ffc08200 erase (tty, 1); return 0; } else if (c == tty->termios.c_cc[VEOF]) { ffc08174: 89 5e 00 45 lbz r10,69(r30) ffc08178: 7f 8a f8 00 cmpw cr7,r10,r31 ffc0817c: 41 9e 00 e8 beq- cr7,ffc08264 <== NEVER TAKEN return 1; } else if (c == '\n') { ffc08180: 2f 9f 00 0a cmpwi cr7,r31,10 ffc08184: 41 9e 00 ac beq- cr7,ffc08230 if (tty->termios.c_lflag & (ECHO | ECHONL)) echo (c, tty); tty->cbuf[tty->ccount++] = c; return 1; } else if ((c == tty->termios.c_cc[VEOL]) || ffc08188: 89 5e 00 4c lbz r10,76(r30) ffc0818c: 7f 8a f8 00 cmpw cr7,r10,r31 ffc08190: 41 9e 00 10 beq- cr7,ffc081a0 <== NEVER TAKEN ffc08194: 89 5e 00 51 lbz r10,81(r30) ffc08198: 7f 8a f8 00 cmpw cr7,r10,r31 ffc0819c: 40 9e ff 1c bne+ cr7,ffc080b8 <== ALWAYS TAKEN (c == tty->termios.c_cc[VEOL2])) { if (tty->termios.c_lflag & ECHO) ffc081a0: 71 28 00 08 andi. r8,r9,8 <== NOT EXECUTED ffc081a4: 40 82 00 4c bne- ffc081f0 <== NOT EXECUTED echo (c, tty); tty->cbuf[tty->ccount++] = c; ffc081a8: 81 3e 00 20 lwz r9,32(r30) <== NOT EXECUTED return 1; ffc081ac: 38 60 00 01 li r3,1 <== NOT EXECUTED return 1; } else if ((c == tty->termios.c_cc[VEOL]) || (c == tty->termios.c_cc[VEOL2])) { if (tty->termios.c_lflag & ECHO) echo (c, tty); tty->cbuf[tty->ccount++] = c; ffc081b0: 81 5e 00 1c lwz r10,28(r30) <== NOT EXECUTED ffc081b4: 39 09 00 01 addi r8,r9,1 <== NOT EXECUTED ffc081b8: 7f ea 49 ae stbx r31,r10,r9 <== NOT EXECUTED ffc081bc: 91 1e 00 20 stw r8,32(r30) <== NOT EXECUTED return 1; ffc081c0: 4b ff ff 30 b ffc080f0 <== 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)) { ffc081c4: 71 28 00 40 andi. r8,r9,64 ffc081c8: 41 a2 ff 88 beq- ffc08150 <== ALWAYS TAKEN c = '\r'; ffc081cc: 3b e0 00 0d li r31,13 <== NOT EXECUTED ffc081d0: 4b ff ff 80 b ffc08150 <== NOT EXECUTED { if (tty->termios.c_iflag & ISTRIP) c &= 0x7f; if (tty->termios.c_iflag & IUCLC) c = tolower (c); ffc081d4: 39 4a 00 20 addi r10,r10,32 ffc081d8: 4b ff fe c4 b ffc0809c /* * FIXME: Should do IMAXBEL handling somehow */ if (tty->ccount < (CBUFSIZE-1)) { if (tty->termios.c_lflag & ECHO) echo (c, tty); ffc081dc: 7f e3 fb 78 mr r3,r31 ffc081e0: 7f c4 f3 78 mr r4,r30 ffc081e4: 4b ff fb 8d bl ffc07d70 ffc081e8: 81 3e 00 20 lwz r9,32(r30) ffc081ec: 4b ff fe f0 b ffc080dc tty->cbuf[tty->ccount++] = c; return 1; } else if ((c == tty->termios.c_cc[VEOL]) || (c == tty->termios.c_cc[VEOL2])) { if (tty->termios.c_lflag & ECHO) echo (c, tty); ffc081f0: 7f e3 fb 78 mr r3,r31 <== NOT EXECUTED ffc081f4: 7f c4 f3 78 mr r4,r30 <== NOT EXECUTED ffc081f8: 4b ff fb 79 bl ffc07d70 <== NOT EXECUTED ffc081fc: 4b ff ff ac b ffc081a8 <== NOT EXECUTED * FIXME: Some of the tests should check for IEXTEN, too. */ static void erase (struct rtems_termios_tty *tty, int lineFlag) { if (tty->ccount == 0) ffc08200: 81 5e 00 20 lwz r10,32(r30) ffc08204: 2f 8a 00 00 cmpwi cr7,r10,0 ffc08208: 41 be ff 18 beq- cr7,ffc08120 <== NEVER TAKEN return; if (lineFlag) { if (!(tty->termios.c_lflag & ECHO)) { ffc0820c: 71 2a 00 08 andi. r10,r9,8 ffc08210: 41 82 00 5c beq- ffc0826c <== NEVER TAKEN tty->ccount = 0; return; } if (!(tty->termios.c_lflag & ECHOE)) { ffc08214: 71 2a 00 10 andi. r10,r9,16 ffc08218: 41 82 00 60 beq- ffc08278 <== NEVER TAKEN ffc0821c: 7f c3 f3 78 mr r3,r30 ffc08220: 38 80 00 01 li r4,1 ffc08224: 4b ff fb f5 bl ffc07e18 erase (tty, 0); return 0; } else if (c == tty->termios.c_cc[VKILL]) { erase (tty, 1); return 0; ffc08228: 38 60 00 00 li r3,0 ffc0822c: 4b ff fe c4 b ffc080f0 } else if (c == tty->termios.c_cc[VEOF]) { return 1; } else if (c == '\n') { if (tty->termios.c_lflag & (ECHO | ECHONL)) ffc08230: 71 2a 00 48 andi. r10,r9,72 ffc08234: 41 a2 00 10 beq+ ffc08244 <== NEVER TAKEN echo (c, tty); ffc08238: 38 60 00 0a li r3,10 ffc0823c: 7f c4 f3 78 mr r4,r30 ffc08240: 4b ff fb 31 bl ffc07d70 tty->cbuf[tty->ccount++] = c; ffc08244: 81 3e 00 20 lwz r9,32(r30) ffc08248: 38 e0 00 0a li r7,10 ffc0824c: 81 5e 00 1c lwz r10,28(r30) return 1; ffc08250: 38 60 00 01 li r3,1 else if (c == tty->termios.c_cc[VEOF]) { return 1; } else if (c == '\n') { if (tty->termios.c_lflag & (ECHO | ECHONL)) echo (c, tty); tty->cbuf[tty->ccount++] = c; ffc08254: 39 09 00 01 addi r8,r9,1 ffc08258: 7c ea 49 ae stbx r7,r10,r9 ffc0825c: 91 1e 00 20 stw r8,32(r30) return 1; ffc08260: 4b ff fe 90 b ffc080f0 else if (c == tty->termios.c_cc[VKILL]) { erase (tty, 1); return 0; } else if (c == tty->termios.c_cc[VEOF]) { return 1; ffc08264: 38 60 00 01 li r3,1 <== NOT EXECUTED ffc08268: 4b ff fe 88 b ffc080f0 <== NOT EXECUTED { if (tty->ccount == 0) return; if (lineFlag) { if (!(tty->termios.c_lflag & ECHO)) { tty->ccount = 0; ffc0826c: 91 5e 00 20 stw r10,32(r30) <== NOT EXECUTED erase (tty, 0); return 0; } else if (c == tty->termios.c_cc[VKILL]) { erase (tty, 1); return 0; ffc08270: 38 60 00 00 li r3,0 <== NOT EXECUTED ffc08274: 4b ff fe 7c b ffc080f0 <== NOT EXECUTED if (!(tty->termios.c_lflag & ECHO)) { tty->ccount = 0; return; } if (!(tty->termios.c_lflag & ECHOE)) { tty->ccount = 0; ffc08278: 91 5e 00 20 stw r10,32(r30) <== NOT EXECUTED echo (tty->termios.c_cc[VKILL], tty); ffc0827c: 7f e3 fb 78 mr r3,r31 <== NOT EXECUTED ffc08280: 7f c4 f3 78 mr r4,r30 <== NOT EXECUTED ffc08284: 4b ff fa ed bl ffc07d70 <== NOT EXECUTED if (tty->termios.c_lflag & ECHOK) ffc08288: 81 3e 00 3c lwz r9,60(r30) <== NOT EXECUTED ffc0828c: 71 28 00 20 andi. r8,r9,32 <== NOT EXECUTED ffc08290: 41 82 fe 90 beq+ ffc08120 <== NOT EXECUTED echo ('\n', tty); ffc08294: 38 60 00 0a li r3,10 <== NOT EXECUTED ffc08298: 7f c4 f3 78 mr r4,r30 <== NOT EXECUTED ffc0829c: 4b ff fa d5 bl ffc07d70 <== NOT EXECUTED erase (tty, 0); return 0; } else if (c == tty->termios.c_cc[VKILL]) { erase (tty, 1); return 0; ffc082a0: 38 60 00 00 li r3,0 <== NOT EXECUTED ffc082a4: 4b ff fe 4c b ffc080f0 <== NOT EXECUTED =============================================================================== ffc1cc88 : #if !defined(RTEMS_POSIX_API) int kill( pid_t pid, int sig ) { return 0; } ffc1cc88: 38 60 00 00 li r3,0 <== NOT EXECUTED ffc1cc8c: 4e 80 00 20 blr <== NOT EXECUTED =============================================================================== ffc04f94 : #include "malloc_p.h" void *malloc( size_t size ) { ffc04f94: 94 21 ff e8 stwu r1,-24(r1) ffc04f98: 7c 08 02 a6 mflr r0 void *return_this; MSBUMP(malloc_calls, 1); ffc04f9c: 3d 20 00 00 lis r9,0 #include "malloc_p.h" void *malloc( size_t size ) { ffc04fa0: 90 01 00 1c stw r0,28(r1) void *return_this; MSBUMP(malloc_calls, 1); ffc04fa4: 39 29 2b 28 addi r9,r9,11048 ffc04fa8: 81 49 00 04 lwz r10,4(r9) #include "malloc_p.h" void *malloc( size_t size ) { ffc04fac: 93 e1 00 14 stw r31,20(r1) ffc04fb0: 7c 7f 1b 78 mr r31,r3 void *return_this; MSBUMP(malloc_calls, 1); ffc04fb4: 39 4a 00 01 addi r10,r10,1 #include "malloc_p.h" void *malloc( size_t size ) { ffc04fb8: 93 a1 00 0c stw r29,12(r1) ffc04fbc: 93 c1 00 10 stw r30,16(r1) void *return_this; MSBUMP(malloc_calls, 1); ffc04fc0: 91 49 00 04 stw r10,4(r9) /* * If some free's have been deferred, then do them now. */ malloc_deferred_frees_process(); ffc04fc4: 4b ff fe 6d bl ffc04e30 /* * Validate the parameters */ if ( !size ) ffc04fc8: 2f 9f 00 00 cmpwi cr7,r31,0 ffc04fcc: 41 9e 00 a0 beq- cr7,ffc0506c return (void *) 0; /* * Do not attempt to allocate memory if not in correct system state. */ if ( _System_state_Is_up(_System_state_Get()) && ffc04fd0: 3d 20 00 00 lis r9,0 ffc04fd4: 81 29 28 4c lwz r9,10316(r9) ffc04fd8: 2f 89 00 03 cmpwi cr7,r9,3 ffc04fdc: 41 9e 00 84 beq- cr7,ffc05060 RTEMS_INLINE_ROUTINE void *_Protected_heap_Allocate( Heap_Control *heap, uintptr_t size ) { return _Protected_heap_Allocate_aligned_with_boundary( heap, size, 0, 0 ); ffc04fe0: 3f a0 00 00 lis r29,0 ffc04fe4: 80 7d 27 50 lwz r3,10064(r29) ffc04fe8: 7f e4 fb 78 mr r4,r31 ffc04fec: 38 a0 00 00 li r5,0 ffc04ff0: 38 c0 00 00 li r6,0 ffc04ff4: 48 00 6c b5 bl ffc0bca8 <_Protected_heap_Allocate_aligned_with_boundary> * If this fails then return a NULL pointer. */ return_this = _Protected_heap_Allocate( RTEMS_Malloc_Heap, size ); if ( !return_this ) { ffc04ff8: 7c 7e 1b 79 mr. r30,r3 ffc04ffc: 41 82 00 94 beq- ffc05090 } /* * If the user wants us to dirty the allocated memory, then do it. */ if ( rtems_malloc_dirty_helper ) ffc05000: 3d 20 00 00 lis r9,0 ffc05004: 81 29 27 c0 lwz r9,10176(r9) ffc05008: 2f 89 00 00 cmpwi cr7,r9,0 ffc0500c: 41 9e 00 14 beq- cr7,ffc05020 (*rtems_malloc_dirty_helper)( return_this, size ); ffc05010: 7f c3 f3 78 mr r3,r30 ffc05014: 7d 29 03 a6 mtctr r9 ffc05018: 7f e4 fb 78 mr r4,r31 ffc0501c: 4e 80 04 21 bctrl /* * If configured, update the statistics */ if ( rtems_malloc_statistics_helpers ) ffc05020: 3d 20 00 00 lis r9,0 ffc05024: 81 29 27 c4 lwz r9,10180(r9) ffc05028: 2f 89 00 00 cmpwi cr7,r9,0 ffc0502c: 41 9e 00 14 beq- cr7,ffc05040 (*rtems_malloc_statistics_helpers->at_malloc)(return_this); ffc05030: 81 29 00 04 lwz r9,4(r9) ffc05034: 7f c3 f3 78 mr r3,r30 ffc05038: 7d 29 03 a6 mtctr r9 ffc0503c: 4e 80 04 21 bctrl return return_this; } ffc05040: 80 01 00 1c lwz r0,28(r1) ffc05044: 7f c3 f3 78 mr r3,r30 ffc05048: 83 a1 00 0c lwz r29,12(r1) ffc0504c: 7c 08 03 a6 mtlr r0 ffc05050: 83 c1 00 10 lwz r30,16(r1) ffc05054: 83 e1 00 14 lwz r31,20(r1) ffc05058: 38 21 00 18 addi r1,r1,24 ffc0505c: 4e 80 00 20 blr /* * 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() ) ffc05060: 4b ff fd a5 bl ffc04e04 return (void *) 0; /* * Do not attempt to allocate memory if not in correct system state. */ if ( _System_state_Is_up(_System_state_Get()) && ffc05064: 2f 83 00 00 cmpwi cr7,r3,0 ffc05068: 40 9e ff 78 bne+ cr7,ffc04fe0 <== ALWAYS TAKEN */ if ( rtems_malloc_statistics_helpers ) (*rtems_malloc_statistics_helpers->at_malloc)(return_this); return return_this; } ffc0506c: 80 01 00 1c lwz r0,28(r1) /* * Validate the parameters */ if ( !size ) return (void *) 0; ffc05070: 3b c0 00 00 li r30,0 */ if ( rtems_malloc_statistics_helpers ) (*rtems_malloc_statistics_helpers->at_malloc)(return_this); return return_this; } ffc05074: 7f c3 f3 78 mr r3,r30 ffc05078: 83 a1 00 0c lwz r29,12(r1) ffc0507c: 7c 08 03 a6 mtlr r0 ffc05080: 83 c1 00 10 lwz r30,16(r1) ffc05084: 83 e1 00 14 lwz r31,20(r1) ffc05088: 38 21 00 18 addi r1,r1,24 ffc0508c: 4e 80 00 20 blr */ return_this = _Protected_heap_Allocate( RTEMS_Malloc_Heap, size ); if ( !return_this ) { return_this = (*rtems_malloc_extend_handler)( RTEMS_Malloc_Heap, size ); ffc05090: 3d 20 00 00 lis r9,0 ffc05094: 80 7d 27 50 lwz r3,10064(r29) ffc05098: 81 29 27 4c lwz r9,10060(r9) ffc0509c: 7f e4 fb 78 mr r4,r31 ffc050a0: 7d 29 03 a6 mtctr r9 ffc050a4: 4e 80 04 21 bctrl if ( !return_this ) { ffc050a8: 7c 7e 1b 79 mr. r30,r3 ffc050ac: 40 82 ff 54 bne+ ffc05000 <== NEVER TAKEN errno = ENOMEM; ffc050b0: 48 00 cf c9 bl ffc12078 <__errno> ffc050b4: 39 20 00 0c li r9,12 ffc050b8: 91 23 00 00 stw r9,0(r3) return (void *) 0; ffc050bc: 4b ff ff 84 b ffc05040 =============================================================================== ffc1059c : void *memfile_alloc_block(void) { void *memory; memory = (void *)calloc(1, IMFS_MEMFILE_BYTES_PER_BLOCK); ffc1059c: 3d 20 00 00 lis r9,0 * Allocate a block for an in-memory file. */ int memfile_blocks_allocated = 0; void *memfile_alloc_block(void) { ffc105a0: 94 21 ff f8 stwu r1,-8(r1) ffc105a4: 7c 08 02 a6 mflr r0 void *memory; memory = (void *)calloc(1, IMFS_MEMFILE_BYTES_PER_BLOCK); ffc105a8: 38 60 00 01 li r3,1 ffc105ac: 80 89 28 00 lwz r4,10240(r9) * Allocate a block for an in-memory file. */ int memfile_blocks_allocated = 0; void *memfile_alloc_block(void) { ffc105b0: 90 01 00 0c stw r0,12(r1) void *memory; memory = (void *)calloc(1, IMFS_MEMFILE_BYTES_PER_BLOCK); ffc105b4: 4b ff 42 05 bl ffc047b8 if ( memory ) ffc105b8: 2c 03 00 00 cmpwi r3,0 ffc105bc: 41 82 00 14 beq- ffc105d0 <== NEVER TAKEN memfile_blocks_allocated++; ffc105c0: 3d 20 00 00 lis r9,0 ffc105c4: 81 49 28 64 lwz r10,10340(r9) ffc105c8: 39 4a 00 01 addi r10,r10,1 ffc105cc: 91 49 28 64 stw r10,10340(r9) return memory; } ffc105d0: 80 01 00 0c lwz r0,12(r1) ffc105d4: 38 21 00 08 addi r1,r1,8 ffc105d8: 7c 08 03 a6 mtlr r0 ffc105dc: 4e 80 00 20 blr =============================================================================== ffc10c14 : */ static void memfile_free_blocks_in_table( block_p **block_table, int entries ) { ffc10c14: 94 21 ff e0 stwu r1,-32(r1) ffc10c18: 7c 08 02 a6 mflr r0 ffc10c1c: 93 a1 00 14 stw r29,20(r1) /* * Now go through all the slots in the table and free the memory. */ b = *block_table; for ( i=0 ; i<== NEVER TAKEN * memfile_free_blocks_in_table * * This is a support routine for IMFS_memfile_remove. It frees all the * blocks in one of the indirection tables. */ static void memfile_free_blocks_in_table( ffc10c44: 3b c3 ff fc addi r30,r3,-4 /* * Now go through all the slots in the table and free the memory. */ b = *block_table; for ( i=0 ; i memfile_free_block( b[i] ); ffc10c60: 4b ff ff 85 bl ffc10be4 b[i] = 0; ffc10c64: 93 9e 00 00 stw r28,0(r30) /* * Now go through all the slots in the table and free the memory. */ b = *block_table; for ( i=0 ; i ffc10c70: 80 7b 00 00 lwz r3,0(r27) /* * Now that all the blocks in the block table are free, we can * free the block table itself. */ memfile_free_block( *block_table ); ffc10c74: 4b ff ff 71 bl ffc10be4 *block_table = 0; } ffc10c78: 80 01 00 24 lwz r0,36(r1) /* * Now that all the blocks in the block table are free, we can * free the block table itself. */ memfile_free_block( *block_table ); *block_table = 0; ffc10c7c: 39 20 00 00 li r9,0 } ffc10c80: 83 81 00 10 lwz r28,16(r1) ffc10c84: 7c 08 03 a6 mtlr r0 /* * Now that all the blocks in the block table are free, we can * free the block table itself. */ memfile_free_block( *block_table ); *block_table = 0; ffc10c88: 91 3b 00 00 stw r9,0(r27) } ffc10c8c: 83 a1 00 14 lwz r29,20(r1) ffc10c90: 83 61 00 0c lwz r27,12(r1) ffc10c94: 83 c1 00 18 lwz r30,24(r1) ffc10c98: 83 e1 00 1c lwz r31,28(r1) ffc10c9c: 38 21 00 20 addi r1,r1,32 ffc10ca0: 4e 80 00 20 blr =============================================================================== ffc114dc : int memfile_ftruncate( rtems_libio_t *iop, off_t length ) { ffc114dc: 94 21 ff e0 stwu r1,-32(r1) ffc114e0: 7c 08 02 a6 mflr r0 ffc114e4: 90 01 00 24 stw r0,36(r1) ffc114e8: 93 e1 00 1c stw r31,28(r1) IMFS_jnode_t *the_jnode; the_jnode = iop->pathinfo.node_access; ffc114ec: 83 e3 00 1c lwz r31,28(r3) * 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 ) ffc114f0: 81 3f 00 50 lwz r9,80(r31) ffc114f4: 7f 89 28 00 cmpw cr7,r9,r5 ffc114f8: 41 9c 00 48 blt- cr7,ffc11540 <== NEVER TAKEN ffc114fc: 41 9e 00 38 beq- cr7,ffc11534 <== ALWAYS TAKEN /* * 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; ffc11500: 90 bf 00 50 stw r5,80(r31) IMFS_update_atime( the_jnode ); ffc11504: 38 61 00 08 addi r3,r1,8 ffc11508: 38 80 00 00 li r4,0 /* * 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; ffc1150c: 90 df 00 54 stw r6,84(r31) IMFS_update_atime( the_jnode ); ffc11510: 4b ff 37 45 bl ffc04c54 return 0; } ffc11514: 80 01 00 24 lwz r0,36(r1) * deleted. So we leave the previously allocated blocks in place for * future use and just set the length. */ the_jnode->info.file.size = length; IMFS_update_atime( the_jnode ); ffc11518: 81 21 00 08 lwz r9,8(r1) return 0; ffc1151c: 38 60 00 00 li r3,0 } ffc11520: 7c 08 03 a6 mtlr r0 * deleted. So we leave the previously allocated blocks in place for * future use and just set the length. */ the_jnode->info.file.size = length; IMFS_update_atime( the_jnode ); ffc11524: 91 3f 00 40 stw r9,64(r31) return 0; } ffc11528: 83 e1 00 1c lwz r31,28(r1) ffc1152c: 38 21 00 20 addi r1,r1,32 ffc11530: 4e 80 00 20 blr * 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 ) ffc11534: 81 3f 00 54 lwz r9,84(r31) ffc11538: 7f 89 30 40 cmplw cr7,r9,r6 ffc1153c: 40 9c ff c4 bge+ cr7,ffc11500 return IMFS_memfile_extend( the_jnode, true, length ); ffc11540: 7f e3 fb 78 mr r3,r31 ffc11544: 38 80 00 01 li r4,1 ffc11548: 4b ff f9 45 bl ffc10e8c the_jnode->info.file.size = length; IMFS_update_atime( the_jnode ); return 0; } ffc1154c: 80 01 00 24 lwz r0,36(r1) ffc11550: 83 e1 00 1c lwz r31,28(r1) ffc11554: 7c 08 03 a6 mtlr r0 ffc11558: 38 21 00 20 addi r1,r1,32 ffc1155c: 4e 80 00 20 blr =============================================================================== ffc1143c : the_jnode = iop->pathinfo.node_access; /* * Perform 'copy on write' for linear files */ if ((iop->flags & LIBIO_FLAGS_WRITE) ffc1143c: 81 23 00 10 lwz r9,16(r3) mode_t mode ) { IMFS_jnode_t *the_jnode; the_jnode = iop->pathinfo.node_access; ffc11440: 80 63 00 1c lwz r3,28(r3) /* * Perform 'copy on write' for linear files */ if ((iop->flags & LIBIO_FLAGS_WRITE) ffc11444: 71 2a 00 04 andi. r10,r9,4 ffc11448: 41 82 00 14 beq- ffc1145c ffc1144c: 81 23 00 4c lwz r9,76(r3) && (IMFS_type( the_jnode ) == IMFS_LINEAR_FILE)) { ffc11450: 81 29 00 00 lwz r9,0(r9) ffc11454: 2f 89 00 05 cmpwi cr7,r9,5 ffc11458: 41 9e 00 0c beq- cr7,ffc11464 <== NEVER TAKEN if ((count != 0) && (IMFS_memfile_write(the_jnode, 0, buffer, count) == -1)) return -1; } return 0; ffc1145c: 38 60 00 00 li r3,0 } ffc11460: 4e 80 00 20 blr /* * Perform 'copy on write' for linear files */ if ((iop->flags & LIBIO_FLAGS_WRITE) && (IMFS_type( the_jnode ) == IMFS_LINEAR_FILE)) { uint32_t count = the_jnode->info.linearfile.size; ffc11464: 81 03 00 54 lwz r8,84(r3) <== NOT EXECUTED const unsigned char *buffer = the_jnode->info.linearfile.direct; the_jnode->control = &IMFS_node_control_memfile; ffc11468: 3d 40 ff c2 lis r10,-62 <== NOT EXECUTED ffc1146c: 39 4a e9 dc addi r10,r10,-5668 <== NOT EXECUTED * Perform 'copy on write' for linear files */ 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; ffc11470: 80 e3 00 58 lwz r7,88(r3) <== NOT EXECUTED the_jnode->control = &IMFS_node_control_memfile; the_jnode->info.file.size = 0; the_jnode->info.file.indirect = 0; the_jnode->info.file.doubly_indirect = 0; the_jnode->info.file.triply_indirect = 0; if ((count != 0) ffc11474: 2f 88 00 00 cmpwi cr7,r8,0 <== 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; ffc11478: 91 43 00 4c stw r10,76(r3) <== NOT EXECUTED the_jnode->info.file.size = 0; the_jnode->info.file.indirect = 0; ffc1147c: 39 20 00 00 li r9,0 <== NOT EXECUTED && (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; the_jnode->info.file.size = 0; ffc11480: 39 40 00 00 li r10,0 <== NOT EXECUTED the_jnode->info.file.indirect = 0; ffc11484: 91 23 00 58 stw r9,88(r3) <== NOT EXECUTED && (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; the_jnode->info.file.size = 0; ffc11488: 39 60 00 00 li r11,0 <== NOT EXECUTED ffc1148c: 91 43 00 50 stw r10,80(r3) <== NOT EXECUTED ffc11490: 91 63 00 54 stw r11,84(r3) <== NOT EXECUTED the_jnode->info.file.indirect = 0; the_jnode->info.file.doubly_indirect = 0; ffc11494: 91 23 00 5c stw r9,92(r3) <== NOT EXECUTED the_jnode->info.file.triply_indirect = 0; ffc11498: 91 23 00 60 stw r9,96(r3) <== NOT EXECUTED if ((count != 0) ffc1149c: 41 9e ff c0 beq+ cr7,ffc1145c <== NOT EXECUTED rtems_libio_t *iop, const char *pathname, int oflag, mode_t mode ) { ffc114a0: 94 21 ff f8 stwu r1,-8(r1) <== NOT EXECUTED ffc114a4: 7c 08 02 a6 mflr r0 <== NOT EXECUTED the_jnode->info.file.size = 0; the_jnode->info.file.indirect = 0; the_jnode->info.file.doubly_indirect = 0; the_jnode->info.file.triply_indirect = 0; if ((count != 0) && (IMFS_memfile_write(the_jnode, 0, buffer, count) == -1)) ffc114a8: 38 a0 00 00 li r5,0 <== NOT EXECUTED ffc114ac: 38 c0 00 00 li r6,0 <== NOT EXECUTED rtems_libio_t *iop, const char *pathname, int oflag, mode_t mode ) { ffc114b0: 90 01 00 0c stw r0,12(r1) <== NOT EXECUTED the_jnode->info.file.size = 0; the_jnode->info.file.indirect = 0; the_jnode->info.file.doubly_indirect = 0; the_jnode->info.file.triply_indirect = 0; if ((count != 0) && (IMFS_memfile_write(the_jnode, 0, buffer, count) == -1)) ffc114b4: 4b ff fc 69 bl ffc1111c <== NOT EXECUTED ffc114b8: 2f 83 ff ff cmpwi cr7,r3,-1 <== NOT EXECUTED return -1; } return 0; ffc114bc: 38 60 00 00 li r3,0 <== NOT EXECUTED the_jnode->info.file.size = 0; the_jnode->info.file.indirect = 0; the_jnode->info.file.doubly_indirect = 0; the_jnode->info.file.triply_indirect = 0; if ((count != 0) && (IMFS_memfile_write(the_jnode, 0, buffer, count) == -1)) ffc114c0: 41 9e 00 14 beq- cr7,ffc114d4 <== NOT EXECUTED return -1; } return 0; } ffc114c4: 80 01 00 0c lwz r0,12(r1) <== NOT EXECUTED ffc114c8: 38 21 00 08 addi r1,r1,8 <== NOT EXECUTED ffc114cc: 7c 08 03 a6 mtlr r0 <== NOT EXECUTED ffc114d0: 4e 80 00 20 blr <== NOT EXECUTED the_jnode->info.file.indirect = 0; the_jnode->info.file.doubly_indirect = 0; the_jnode->info.file.triply_indirect = 0; if ((count != 0) && (IMFS_memfile_write(the_jnode, 0, buffer, count) == -1)) return -1; ffc114d4: 38 60 ff ff li r3,-1 <== NOT EXECUTED ffc114d8: 4b ff ff ec b ffc114c4 <== NOT EXECUTED =============================================================================== ffc051f0 : const char *target, const char *filesystemtype, rtems_filesystem_options_t options, const void *data ) { ffc051f0: 7d 80 00 26 mfcr r12 int rv = 0; if ( ffc051f4: 2b 86 00 01 cmplwi cr7,r6,1 const char *target, const char *filesystemtype, rtems_filesystem_options_t options, const void *data ) { ffc051f8: 94 21 ff 70 stwu r1,-144(r1) ffc051fc: 7c 08 02 a6 mflr r0 ffc05200: 93 21 00 74 stw r25,116(r1) ffc05204: 7c d9 33 78 mr r25,r6 ffc05208: 90 01 00 94 stw r0,148(r1) ffc0520c: 92 81 00 60 stw r20,96(r1) ffc05210: 92 a1 00 64 stw r21,100(r1) ffc05214: 92 c1 00 68 stw r22,104(r1) ffc05218: 92 e1 00 6c stw r23,108(r1) ffc0521c: 93 01 00 70 stw r24,112(r1) ffc05220: 93 41 00 78 stw r26,120(r1) ffc05224: 93 61 00 7c stw r27,124(r1) ffc05228: 93 81 00 80 stw r28,128(r1) ffc0522c: 93 a1 00 84 stw r29,132(r1) ffc05230: 93 c1 00 88 stw r30,136(r1) ffc05234: 93 e1 00 8c stw r31,140(r1) ffc05238: 91 81 00 5c stw r12,92(r1) int rv = 0; if ( ffc0523c: 41 9d 02 b0 bgt- cr7,ffc054ec ffc05240: 7c 7b 1b 78 mr r27,r3 options == RTEMS_FILESYSTEM_READ_ONLY || options == RTEMS_FILESYSTEM_READ_WRITE ) { rtems_filesystem_fsmount_me_t fsmount_me_h = ffc05244: 7c a3 2b 78 mr r3,r5 ffc05248: 7c 9d 23 78 mr r29,r4 ffc0524c: 7c bc 2b 78 mr r28,r5 ffc05250: 7c f6 3b 78 mr r22,r7 ffc05254: 48 00 9d 09 bl ffc0ef5c rtems_filesystem_get_mount_handler( filesystemtype ); if ( fsmount_me_h != NULL ) { ffc05258: 7c 75 1b 79 mr. r21,r3 ffc0525c: 41 82 02 90 beq- ffc054ec const char *target_or_null, const char *filesystemtype, size_t *target_length_ptr ) { const char *target = target_or_null != NULL ? target_or_null : "/"; ffc05260: 2d 9d 00 00 cmpwi cr3,r29,0 ffc05264: 41 8e 02 30 beq- cr3,ffc05494 size_t filesystemtype_size = strlen( filesystemtype ) + 1; size_t source_size = source_or_null != NULL ? strlen( source_or_null ) + 1 : 0; ffc05268: 2e 1b 00 00 cmpwi cr4,r27,0 } return rv; } int mount( ffc0526c: 7f a3 eb 78 mr r3,r29 ffc05270: 7f b4 eb 78 mr r20,r29 ffc05274: 48 00 e6 59 bl ffc138cc ffc05278: 3b 03 00 01 addi r24,r3,1 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; ffc0527c: 7f 83 e3 78 mr r3,r28 ffc05280: 48 00 e6 4d bl ffc138cc ffc05284: 7c 7f 1b 78 mr r31,r3 ffc05288: 3a e3 00 01 addi r23,r3,1 size_t source_size = source_or_null != NULL ? strlen( source_or_null ) + 1 : 0; ffc0528c: 41 92 02 2c beq- cr4,ffc054b8 ffc05290: 7f 63 db 78 mr r3,r27 ffc05294: 48 00 e6 39 bl ffc138cc size_t target_size = strlen( target ) + 1; size_t size = sizeof( rtems_filesystem_mount_table_entry_t ) + filesystemtype_size + source_size + target_size ffc05298: 7f ff c2 14 add r31,r31,r24 ) { 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; ffc0529c: 3b 43 00 01 addi r26,r3,1 size_t target_size = strlen( target ) + 1; size_t size = sizeof( rtems_filesystem_mount_table_entry_t ) + filesystemtype_size + source_size + target_size ffc052a0: 38 9f 00 65 addi r4,r31,101 + sizeof( rtems_filesystem_global_location_t ); rtems_filesystem_mount_table_entry_t *mt_entry = calloc( 1, size ); ffc052a4: 38 60 00 01 li r3,1 ffc052a8: 7c 84 d2 14 add r4,r4,r26 ffc052ac: 4b ff f5 0d bl ffc047b8 if ( mt_entry != NULL ) { ffc052b0: 7c 7f 1b 79 mr. r31,r3 ffc052b4: 41 82 02 24 beq- ffc054d8 <== NEVER TAKEN 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 ); ffc052b8: 3b df 00 64 addi r30,r31,100 memcpy( str, filesystemtype, filesystemtype_size ); ffc052bc: 7f c3 f3 78 mr r3,r30 ffc052c0: 7f 84 e3 78 mr r4,r28 ffc052c4: 7e e5 bb 78 mr r5,r23 ffc052c8: 48 00 da b5 bl ffc12d7c + 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 = ffc052cc: 3b 9f 00 40 addi r28,r31,64 (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 ); mt_entry->type = str; ffc052d0: 93 df 00 34 stw r30,52(r31) str += filesystemtype_size; ffc052d4: 7f de ba 14 add r30,r30,r23 if ( source_or_null != NULL ) { ffc052d8: 41 92 00 1c beq- cr4,ffc052f4 memcpy( str, source_or_null, source_size ); ffc052dc: 7f c3 f3 78 mr r3,r30 ffc052e0: 7f 64 db 78 mr r4,r27 ffc052e4: 7f 45 d3 78 mr r5,r26 ffc052e8: 48 00 da 95 bl ffc12d7c mt_entry->dev = str; ffc052ec: 93 df 00 38 stw r30,56(r31) str += source_size; ffc052f0: 7f de d2 14 add r30,r30,r26 } memcpy( str, target, target_size ); ffc052f4: 7e 84 a3 78 mr r4,r20 ffc052f8: 7f 05 c3 78 mr r5,r24 ffc052fc: 7f c3 f3 78 mr r3,r30 ffc05300: 48 00 da 7d bl ffc12d7c mt_entry->target = str; str += target_size; mt_entry->mounted = true; ffc05304: 39 20 00 01 li r9,1 ffc05308: 99 3f 00 28 stb r9,40(r31) mt_entry->mt_fs_root = mt_fs_root; mt_entry->pathconf_limits_and_options = &rtems_filesystem_default_pathconf; ffc0530c: 3d 20 ff c2 lis r9,-62 ffc05310: 39 29 e7 30 addi r9,r9,-6352 ffc05314: 91 3f 00 2c stw r9,44(r31) mt_fs_root->location.mt_entry = mt_entry; mt_fs_root->reference_count = 1; ffc05318: 39 20 00 01 li r9,1 void *starting_address, size_t number_nodes, size_t node_size ) { _Chain_Initialize( the_chain, starting_address, number_nodes, node_size ); ffc0531c: 38 7f 00 14 addi r3,r31,20 mt_entry->dev = str; str += source_size; } memcpy( str, target, target_size ); mt_entry->target = str; ffc05320: 93 df 00 30 stw r30,48(r31) ffc05324: 7f 84 e3 78 mr r4,r28 ffc05328: 38 a0 00 01 li r5,1 mt_entry->mounted = true; mt_entry->mt_fs_root = mt_fs_root; mt_entry->pathconf_limits_and_options = &rtems_filesystem_default_pathconf; mt_fs_root->location.mt_entry = mt_entry; mt_fs_root->reference_count = 1; ffc0532c: 91 3f 00 58 stw r9,88(r31) ffc05330: 38 c0 00 24 li r6,36 filesystemtype, &target_length ); if ( mt_entry != NULL ) { mt_entry->writeable = options == RTEMS_FILESYSTEM_READ_WRITE; ffc05334: 57 39 07 fe clrlwi r25,r25,31 memcpy( str, target, target_size ); mt_entry->target = str; str += target_size; mt_entry->mounted = true; mt_entry->mt_fs_root = mt_fs_root; ffc05338: 93 9f 00 24 stw r28,36(r31) mt_entry->pathconf_limits_and_options = &rtems_filesystem_default_pathconf; mt_fs_root->location.mt_entry = mt_entry; ffc0533c: 93 ff 00 54 stw r31,84(r31) ffc05340: 48 00 54 a5 bl ffc0a7e4 <_Chain_Initialize> filesystemtype, &target_length ); if ( mt_entry != NULL ) { mt_entry->writeable = options == RTEMS_FILESYSTEM_READ_WRITE; ffc05344: 9b 3f 00 29 stb r25,41(r31) rv = (*fsmount_me_h)( mt_entry, data ); ffc05348: 7f e3 fb 78 mr r3,r31 ffc0534c: 7e a9 03 a6 mtctr r21 ffc05350: 7e c4 b3 78 mr r4,r22 ffc05354: 4e 80 04 21 bctrl if ( rv == 0 ) { ffc05358: 2e 03 00 00 cmpwi cr4,r3,0 ffc0535c: 7c 7e 1b 78 mr r30,r3 ffc05360: 40 92 00 a0 bne- cr4,ffc05400 if ( target != NULL ) { ffc05364: 41 8e 01 9c beq- cr3,ffc05500 { 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 = ffc05368: 7f a4 eb 78 mr r4,r29 ffc0536c: 38 a0 00 1f li r5,31 ffc05370: 38 61 00 08 addi r3,r1,8 ffc05374: 48 00 0e 99 bl ffc0620c 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; ffc05378: 81 23 00 14 lwz r9,20(r3) return (*mt_entry->ops->are_nodes_equal_h)( ffc0537c: 81 49 00 0c lwz r10,12(r9) ffc05380: 80 89 00 24 lwz r4,36(r9) ffc05384: 81 2a 00 10 lwz r9,16(r10) ffc05388: 7d 29 03 a6 mtctr r9 ffc0538c: 4e 80 04 21 bctrl rtems_filesystem_eval_path_start( &ctx, target, eval_flags ); if ( !rtems_filesystem_location_is_instance_root( currentloc ) ) { ffc05390: 2f 83 00 00 cmpwi cr7,r3,0 ffc05394: 40 9e 01 f4 bne- cr7,ffc05588 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( ffc05398: 38 81 00 20 addi r4,r1,32 ffc0539c: 38 61 00 40 addi r3,r1,64 ffc053a0: 48 00 13 b9 bl ffc06758 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 ); ffc053a4: 38 61 00 40 addi r3,r1,64 ffc053a8: 48 00 16 69 bl ffc06a10 mt_entry->mt_point_node = mt_point_node; rv = (*mt_point_node->location.mt_entry->ops->mount_h)( mt_entry ); ffc053ac: 81 23 00 14 lwz r9,20(r3) 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 ); ffc053b0: 7c 7d 1b 78 mr r29,r3 mt_entry->mt_point_node = mt_point_node; ffc053b4: 90 7f 00 20 stw r3,32(r31) rv = (*mt_point_node->location.mt_entry->ops->mount_h)( mt_entry ); ffc053b8: 7f e3 fb 78 mr r3,r31 ffc053bc: 81 29 00 0c lwz r9,12(r9) ffc053c0: 81 29 00 30 lwz r9,48(r9) ffc053c4: 7d 29 03 a6 mtctr r9 ffc053c8: 4e 80 04 21 bctrl if ( rv == 0 ) { ffc053cc: 2e 03 00 00 cmpwi cr4,r3,0 ffc053d0: 7c 7e 1b 78 mr r30,r3 ffc053d4: 41 92 00 80 beq- cr4,ffc05454 &rtems_filesystem_mount_table, &mt_entry->mt_node ); rtems_filesystem_mt_unlock(); } else { rtems_filesystem_global_location_release( mt_point_node ); ffc053d8: 7f a3 eb 78 mr r3,r29 ffc053dc: 48 00 14 a9 bl ffc06884 } else { rtems_filesystem_eval_path_error( &ctx, EBUSY ); rv = -1; } rtems_filesystem_eval_path_cleanup( &ctx ); ffc053e0: 38 61 00 08 addi r3,r1,8 ffc053e4: 48 00 0f 71 bl ffc06354 rv = register_subordinate_file_system( mt_entry, target ); } else { rv = register_root_file_system( mt_entry ); } if ( rv != 0 ) { ffc053e8: 41 b2 00 20 beq+ cr4,ffc05408 (*mt_entry->ops->fsunmount_me_h)( mt_entry ); ffc053ec: 81 3f 00 0c lwz r9,12(r31) ffc053f0: 7f e3 fb 78 mr r3,r31 ffc053f4: 81 29 00 3c lwz r9,60(r9) ffc053f8: 7d 29 03 a6 mtctr r9 ffc053fc: 4e 80 04 21 bctrl } } if ( rv != 0 ) { free( mt_entry ); ffc05400: 7f e3 fb 78 mr r3,r31 ffc05404: 4b ff f7 65 bl ffc04b68 errno = EINVAL; rv = -1; } return rv; } ffc05408: 80 01 00 94 lwz r0,148(r1) ffc0540c: 7f c3 f3 78 mr r3,r30 ffc05410: 81 81 00 5c lwz r12,92(r1) ffc05414: 7c 08 03 a6 mtlr r0 ffc05418: 82 81 00 60 lwz r20,96(r1) ffc0541c: 82 a1 00 64 lwz r21,100(r1) ffc05420: 7d 81 81 20 mtcrf 24,r12 ffc05424: 82 c1 00 68 lwz r22,104(r1) ffc05428: 82 e1 00 6c lwz r23,108(r1) ffc0542c: 83 01 00 70 lwz r24,112(r1) ffc05430: 83 21 00 74 lwz r25,116(r1) ffc05434: 83 41 00 78 lwz r26,120(r1) ffc05438: 83 61 00 7c lwz r27,124(r1) ffc0543c: 83 81 00 80 lwz r28,128(r1) ffc05440: 83 a1 00 84 lwz r29,132(r1) ffc05444: 83 c1 00 88 lwz r30,136(r1) ffc05448: 83 e1 00 8c lwz r31,140(r1) ffc0544c: 38 21 00 90 addi r1,r1,144 ffc05450: 4e 80 00 20 blr */ #include static inline void rtems_libio_lock( void ) { rtems_semaphore_obtain( rtems_libio_semaphore, RTEMS_WAIT, RTEMS_NO_TIMEOUT ); ffc05454: 3f a0 00 00 lis r29,0 ffc05458: 80 7d 28 10 lwz r3,10256(r29) ffc0545c: 38 80 00 00 li r4,0 ffc05460: 38 a0 00 00 li r5,0 ffc05464: 48 00 45 bd bl ffc09a20 Chain_Control *the_chain, Chain_Node *the_node ) { Chain_Node *tail = _Chain_Tail( the_chain ); Chain_Node *old_last = tail->previous; ffc05468: 3d 20 00 00 lis r9,0 ffc0546c: 39 29 21 50 addi r9,r9,8528 } static inline void rtems_libio_unlock( void ) { rtems_semaphore_release( rtems_libio_semaphore ); ffc05470: 80 7d 28 10 lwz r3,10256(r29) ffc05474: 81 49 00 08 lwz r10,8(r9) the_node->next = tail; ffc05478: 39 09 00 04 addi r8,r9,4 ffc0547c: 91 1f 00 00 stw r8,0(r31) tail->previous = the_node; old_last->next = the_node; the_node->previous = old_last; ffc05480: 91 5f 00 04 stw r10,4(r31) Chain_Node *tail = _Chain_Tail( the_chain ); Chain_Node *old_last = tail->previous; the_node->next = tail; tail->previous = the_node; old_last->next = the_node; ffc05484: 93 ea 00 00 stw r31,0(r10) { Chain_Node *tail = _Chain_Tail( the_chain ); Chain_Node *old_last = tail->previous; the_node->next = tail; tail->previous = the_node; ffc05488: 93 e9 00 08 stw r31,8(r9) ffc0548c: 48 00 47 35 bl ffc09bc0 ffc05490: 4b ff ff 50 b ffc053e0 ) { 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; ffc05494: 2e 1b 00 00 cmpwi cr4,r27,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; ffc05498: 7f 83 e3 78 mr r3,r28 const char *target_or_null, const char *filesystemtype, size_t *target_length_ptr ) { const char *target = target_or_null != NULL ? target_or_null : "/"; ffc0549c: 3e 80 ff c2 lis r20,-62 size_t filesystemtype_size = strlen( filesystemtype ) + 1; ffc054a0: 48 00 e4 2d bl ffc138cc const char *target_or_null, const char *filesystemtype, size_t *target_length_ptr ) { const char *target = target_or_null != NULL ? target_or_null : "/"; ffc054a4: 3b 00 00 02 li r24,2 ffc054a8: 3a 94 e7 60 addi r20,r20,-6304 size_t filesystemtype_size = strlen( filesystemtype ) + 1; ffc054ac: 7c 7f 1b 78 mr r31,r3 ffc054b0: 3a e3 00 01 addi r23,r3,1 size_t source_size = source_or_null != NULL ? strlen( source_or_null ) + 1 : 0; ffc054b4: 40 92 fd dc bne+ cr4,ffc05290 <== NEVER TAKEN size_t target_size = strlen( target ) + 1; size_t size = sizeof( rtems_filesystem_mount_table_entry_t ) + filesystemtype_size + source_size + target_size ffc054b8: 7f ff c2 14 add r31,r31,r24 ffc054bc: 38 9f 00 65 addi r4,r31,101 ) { 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; ffc054c0: 3b 40 00 00 li r26,0 size_t target_size = strlen( target ) + 1; 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 ); ffc054c4: 38 60 00 01 li r3,1 ffc054c8: 7c 84 d2 14 add r4,r4,r26 ffc054cc: 4b ff f2 ed bl ffc047b8 if ( mt_entry != NULL ) { ffc054d0: 7c 7f 1b 79 mr. r31,r3 ffc054d4: 40 82 fd e4 bne+ ffc052b8 <== ALWAYS TAKEN if ( rv != 0 ) { free( mt_entry ); } } else { errno = ENOMEM; ffc054d8: 48 00 cb a1 bl ffc12078 <__errno> <== NOT EXECUTED ffc054dc: 39 20 00 0c li r9,12 <== NOT EXECUTED ffc054e0: 91 23 00 00 stw r9,0(r3) <== NOT EXECUTED rv = -1; ffc054e4: 3b c0 ff ff li r30,-1 <== NOT EXECUTED ffc054e8: 4b ff ff 20 b ffc05408 <== NOT EXECUTED } else { errno = EINVAL; rv = -1; } } else { errno = EINVAL; ffc054ec: 48 00 cb 8d bl ffc12078 <__errno> ffc054f0: 39 20 00 16 li r9,22 ffc054f4: 91 23 00 00 stw r9,0(r3) rv = -1; ffc054f8: 3b c0 ff ff li r30,-1 ffc054fc: 4b ff ff 0c b ffc05408 */ #include static inline void rtems_libio_lock( void ) { rtems_semaphore_obtain( rtems_libio_semaphore, RTEMS_WAIT, RTEMS_NO_TIMEOUT ); ffc05500: 3f a0 00 00 lis r29,0 ffc05504: 80 7d 28 10 lwz r3,10256(r29) ffc05508: 38 80 00 00 li r4,0 ffc0550c: 38 a0 00 00 li r5,0 ffc05510: 48 00 45 11 bl ffc09a20 */ RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_first( const Chain_Control *the_chain ) { return _Chain_Immutable_head( the_chain )->next; ffc05514: 3d 40 00 00 lis r10,0 ffc05518: 39 2a 21 50 addi r9,r10,8528 ) { int rv = 0; rtems_filesystem_mt_lock(); if ( rtems_chain_is_empty( &rtems_filesystem_mount_table ) ) { ffc0551c: 81 4a 21 50 lwz r10,8528(r10) RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( const Chain_Control *the_chain ) { return _Chain_Immutable_first( the_chain ) == _Chain_Immutable_tail( the_chain ); ffc05520: 39 09 00 04 addi r8,r9,4 ffc05524: 7f 8a 40 00 cmpw cr7,r10,r8 ffc05528: 40 9e 00 78 bne- cr7,ffc055a0 <== NEVER TAKEN Chain_Control *the_chain, Chain_Node *the_node ) { Chain_Node *tail = _Chain_Tail( the_chain ); Chain_Node *old_last = tail->previous; ffc0552c: 81 09 00 08 lwz r8,8(r9) } 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 ); ffc05530: 3b 9f 00 24 addi r28,r31,36 the_node->next = tail; ffc05534: 91 5f 00 00 stw r10,0(r31) rtems_filesystem_global_location_t *new_fs_current = rtems_filesystem_global_location_obtain( &mt_entry->mt_fs_root ); rtems_filesystem_global_location_assign( ffc05538: 3f 60 00 00 lis r27,0 tail->previous = the_node; old_last->next = the_node; ffc0553c: 93 e8 00 00 stw r31,0(r8) the_node->previous = old_last; ffc05540: 91 1f 00 04 stw r8,4(r31) { Chain_Node *tail = _Chain_Tail( the_chain ); Chain_Node *old_last = tail->previous; the_node->next = tail; tail->previous = the_node; ffc05544: 93 e9 00 08 stw r31,8(r9) } static inline void rtems_libio_unlock( void ) { rtems_semaphore_release( rtems_libio_semaphore ); ffc05548: 80 7d 28 10 lwz r3,10256(r29) ffc0554c: 48 00 46 75 bl ffc09bc0 rv = -1; } rtems_filesystem_mt_unlock(); if ( rv == 0 ) { rtems_filesystem_global_location_t *new_fs_root = ffc05550: 7f 83 e3 78 mr r3,r28 ffc05554: 48 00 13 a5 bl ffc068f8 ffc05558: 7c 7d 1b 78 mr r29,r3 rtems_filesystem_global_location_obtain( &mt_entry->mt_fs_root ); rtems_filesystem_global_location_t *new_fs_current = ffc0555c: 7f 83 e3 78 mr r3,r28 ffc05560: 48 00 13 99 bl ffc068f8 rtems_filesystem_global_location_obtain( &mt_entry->mt_fs_root ); rtems_filesystem_global_location_assign( ffc05564: 7f a4 eb 78 mr r4,r29 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 = ffc05568: 7c 7f 1b 78 mr r31,r3 rtems_filesystem_global_location_obtain( &mt_entry->mt_fs_root ); rtems_filesystem_global_location_assign( ffc0556c: 80 7b 27 98 lwz r3,10136(r27) ffc05570: 38 63 00 04 addi r3,r3,4 ffc05574: 48 00 13 61 bl ffc068d4 &rtems_filesystem_root, new_fs_root ); rtems_filesystem_global_location_assign( ffc05578: 80 7b 27 98 lwz r3,10136(r27) ffc0557c: 7f e4 fb 78 mr r4,r31 ffc05580: 48 00 13 55 bl ffc068d4 ffc05584: 4b ff fe 84 b ffc05408 rtems_filesystem_mt_unlock(); } else { rtems_filesystem_global_location_release( mt_point_node ); } } else { rtems_filesystem_eval_path_error( &ctx, EBUSY ); ffc05588: 38 61 00 08 addi r3,r1,8 ffc0558c: 38 80 00 10 li r4,16 rv = -1; ffc05590: 3b c0 ff ff li r30,-1 rtems_filesystem_mt_unlock(); } else { rtems_filesystem_global_location_release( mt_point_node ); } } else { rtems_filesystem_eval_path_error( &ctx, EBUSY ); ffc05594: 48 00 08 a9 bl ffc05e3c ffc05598: 2e 1e 00 00 cmpwi cr4,r30,0 ffc0559c: 4b ff fe 44 b ffc053e0 rtems_chain_append_unprotected( &rtems_filesystem_mount_table, &mt_entry->mt_node ); } else { errno = EINVAL; ffc055a0: 48 00 ca d9 bl ffc12078 <__errno> <== NOT EXECUTED ffc055a4: 39 20 00 16 li r9,22 <== NOT EXECUTED ffc055a8: 91 23 00 00 stw r9,0(r3) <== NOT EXECUTED rv = -1; ffc055ac: 3b c0 ff ff li r30,-1 <== NOT EXECUTED ffc055b0: 80 7d 28 10 lwz r3,10256(r29) <== NOT EXECUTED ffc055b4: 48 00 46 0d bl ffc09bc0 <== NOT EXECUTED ffc055b8: 4b ff fe 34 b ffc053ec <== NOT EXECUTED =============================================================================== ffc0acf0 : const char *target, const char *filesystemtype, rtems_filesystem_options_t options, const void *data ) { ffc0acf0: 94 21 ff e0 stwu r1,-32(r1) ffc0acf4: 7c 08 02 a6 mflr r0 ffc0acf8: 93 e1 00 1c stw r31,28(r1) int rv = -1; if (target != NULL) { ffc0acfc: 7c 9f 23 79 mr. r31,r4 const char *target, const char *filesystemtype, rtems_filesystem_options_t options, const void *data ) { ffc0ad00: 90 01 00 24 stw r0,36(r1) ffc0ad04: 93 61 00 0c stw r27,12(r1) ffc0ad08: 93 81 00 10 stw r28,16(r1) ffc0ad0c: 93 a1 00 14 stw r29,20(r1) ffc0ad10: 93 c1 00 18 stw r30,24(r1) int rv = -1; if (target != NULL) { ffc0ad14: 41 82 00 84 beq- ffc0ad98 ffc0ad18: 7c 7e 1b 78 mr r30,r3 rv = rtems_mkdir(target, S_IRWXU | S_IRWXG | S_IRWXO); ffc0ad1c: 38 80 01 ff li r4,511 ffc0ad20: 7f e3 fb 78 mr r3,r31 ffc0ad24: 7c bb 2b 78 mr r27,r5 ffc0ad28: 7c dc 33 78 mr r28,r6 ffc0ad2c: 7c fd 3b 78 mr r29,r7 ffc0ad30: 48 00 0e 9d bl ffc0bbcc if (rv == 0) { ffc0ad34: 2c 03 00 00 cmpwi r3,0 ffc0ad38: 41 82 00 28 beq- ffc0ad60 <== ALWAYS TAKEN } else { errno = EINVAL; } return rv; } ffc0ad3c: 80 01 00 24 lwz r0,36(r1) ffc0ad40: 83 61 00 0c lwz r27,12(r1) ffc0ad44: 7c 08 03 a6 mtlr r0 ffc0ad48: 83 81 00 10 lwz r28,16(r1) ffc0ad4c: 83 a1 00 14 lwz r29,20(r1) ffc0ad50: 83 c1 00 18 lwz r30,24(r1) ffc0ad54: 83 e1 00 1c lwz r31,28(r1) ffc0ad58: 38 21 00 20 addi r1,r1,32 ffc0ad5c: 4e 80 00 20 blr ffc0ad60: 80 01 00 24 lwz r0,36(r1) int rv = -1; if (target != NULL) { rv = rtems_mkdir(target, S_IRWXU | S_IRWXG | S_IRWXO); if (rv == 0) { rv = mount( ffc0ad64: 7f c3 f3 78 mr r3,r30 ffc0ad68: 7f e4 fb 78 mr r4,r31 } else { errno = EINVAL; } return rv; } ffc0ad6c: 83 c1 00 18 lwz r30,24(r1) ffc0ad70: 7c 08 03 a6 mtlr r0 ffc0ad74: 83 e1 00 1c lwz r31,28(r1) int rv = -1; if (target != NULL) { rv = rtems_mkdir(target, S_IRWXU | S_IRWXG | S_IRWXO); if (rv == 0) { rv = mount( ffc0ad78: 7f 65 db 78 mr r5,r27 } else { errno = EINVAL; } return rv; } ffc0ad7c: 83 61 00 0c lwz r27,12(r1) int rv = -1; if (target != NULL) { rv = rtems_mkdir(target, S_IRWXU | S_IRWXG | S_IRWXO); if (rv == 0) { rv = mount( ffc0ad80: 7f 86 e3 78 mr r6,r28 } else { errno = EINVAL; } return rv; } ffc0ad84: 83 81 00 10 lwz r28,16(r1) int rv = -1; if (target != NULL) { rv = rtems_mkdir(target, S_IRWXU | S_IRWXG | S_IRWXO); if (rv == 0) { rv = mount( ffc0ad88: 7f a7 eb 78 mr r7,r29 } else { errno = EINVAL; } return rv; } ffc0ad8c: 83 a1 00 14 lwz r29,20(r1) ffc0ad90: 38 21 00 20 addi r1,r1,32 int rv = -1; if (target != NULL) { rv = rtems_mkdir(target, S_IRWXU | S_IRWXG | S_IRWXO); if (rv == 0) { rv = mount( ffc0ad94: 48 00 00 18 b ffc0adac options, data ); } } else { errno = EINVAL; ffc0ad98: 48 01 d1 a5 bl ffc27f3c <__errno> ffc0ad9c: 39 20 00 16 li r9,22 ffc0ada0: 91 23 00 00 stw r9,0(r3) const char *filesystemtype, rtems_filesystem_options_t options, const void *data ) { int rv = -1; ffc0ada4: 38 60 ff ff li r3,-1 ffc0ada8: 4b ff ff 94 b ffc0ad3c =============================================================================== ffc1c174 : msdos_node_type_t type, const char *name, int name_len, mode_t mode, const fat_file_fd_t *link_fd) { ffc1c174: 94 21 ff 30 stwu r1,-208(r1) ffc1c178: 7c 08 02 a6 mflr r0 fat_dir_pos_t *dir_pos ) { dir_pos->sname.cln = 0; dir_pos->sname.ofs = 0; dir_pos->lname.cln = FAT_FILE_SHORT_NAME; ffc1c17c: 39 20 ff ff li r9,-1 ffc1c180: 90 01 00 d4 stw r0,212(r1) int rc = RC_OK; ssize_t ret = 0; msdos_fs_info_t *fs_info = parent_loc->mt_entry->fs_info; ffc1c184: 81 43 00 14 lwz r10,20(r3) msdos_node_type_t type, const char *name, int name_len, mode_t mode, const fat_file_fd_t *link_fd) { ffc1c188: 93 41 00 b8 stw r26,184(r1) ffc1c18c: 7c 9a 23 78 mr r26,r4 uint32_t byte = 0; fat_dir_pos_init(&dir_pos); memset(short_node, 0, MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE); memset(dot_dotdot, 0, MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE * 2); ffc1c190: 38 80 00 00 li r4,0 msdos_node_type_t type, const char *name, int name_len, mode_t mode, const fat_file_fd_t *link_fd) { ffc1c194: 93 81 00 c0 stw r28,192(r1) ffc1c198: 7c bc 2b 78 mr r28,r5 uint32_t byte = 0; fat_dir_pos_init(&dir_pos); memset(short_node, 0, MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE); memset(dot_dotdot, 0, MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE * 2); ffc1c19c: 38 a0 00 40 li r5,64 msdos_node_type_t type, const char *name, int name_len, mode_t mode, const fat_file_fd_t *link_fd) { ffc1c1a0: 93 a1 00 c4 stw r29,196(r1) ffc1c1a4: 7c dd 33 78 mr r29,r6 ffc1c1a8: 93 c1 00 c8 stw r30,200(r1) ffc1c1ac: 7c 7e 1b 78 mr r30,r3 uint32_t byte = 0; fat_dir_pos_init(&dir_pos); memset(short_node, 0, MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE); memset(dot_dotdot, 0, MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE * 2); ffc1c1b0: 38 61 00 08 addi r3,r1,8 msdos_node_type_t type, const char *name, int name_len, mode_t mode, const fat_file_fd_t *link_fd) { ffc1c1b4: 93 e1 00 cc stw r31,204(r1) 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; fat_file_fd_t *fat_fd = NULL; ffc1c1b8: 3b e0 00 00 li r31,0 msdos_node_type_t type, const char *name, int name_len, mode_t mode, const fat_file_fd_t *link_fd) { ffc1c1bc: 92 e1 00 ac stw r23,172(r1) ffc1c1c0: 7d 17 43 78 mr r23,r8 ffc1c1c4: 93 01 00 b0 stw r24,176(r1) ffc1c1c8: 93 61 00 bc stw r27,188(r1) ffc1c1cc: 93 21 00 b4 stw r25,180(r1) int rc = RC_OK; ssize_t ret = 0; msdos_fs_info_t *fs_info = parent_loc->mt_entry->fs_info; ffc1c1d0: 83 6a 00 08 lwz r27,8(r10) fat_file_fd_t *parent_fat_fd = parent_loc->node_access; ffc1c1d4: 83 1e 00 08 lwz r24,8(r30) fat_file_fd_t *fat_fd = NULL; ffc1c1d8: 93 e1 00 98 stw r31,152(r1) time_t time_ret = 0; uint16_t time_val = 0; ffc1c1dc: b3 e1 00 9e sth r31,158(r1) uint16_t date = 0; ffc1c1e0: b3 e1 00 9c sth r31,156(r1) static inline void fat_dir_pos_init( fat_dir_pos_t *dir_pos ) { dir_pos->sname.cln = 0; ffc1c1e4: 93 e1 00 88 stw r31,136(r1) dir_pos->sname.ofs = 0; ffc1c1e8: 93 e1 00 8c stw r31,140(r1) dir_pos->lname.cln = FAT_FILE_SHORT_NAME; ffc1c1ec: 91 21 00 90 stw r9,144(r1) dir_pos->lname.ofs = FAT_FILE_SHORT_NAME; ffc1c1f0: 91 21 00 94 stw r9,148(r1) uint32_t sec = 0; uint32_t byte = 0; fat_dir_pos_init(&dir_pos); memset(short_node, 0, MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE); ffc1c1f4: 93 e1 00 68 stw r31,104(r1) ffc1c1f8: 93 e1 00 6c stw r31,108(r1) ffc1c1fc: 93 e1 00 70 stw r31,112(r1) ffc1c200: 93 e1 00 74 stw r31,116(r1) ffc1c204: 93 e1 00 78 stw r31,120(r1) ffc1c208: 93 e1 00 7c stw r31,124(r1) ffc1c20c: 93 e1 00 80 stw r31,128(r1) ffc1c210: 93 e1 00 84 stw r31,132(r1) memset(dot_dotdot, 0, MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE * 2); ffc1c214: 48 00 52 5d bl ffc21470 if (name_len > MSDOS_NAME_MAX_LFN_WITH_DOT) { ffc1c218: 2f 9d 01 04 cmpwi cr7,r29,260 ffc1c21c: 41 9d 03 f8 bgt- cr7,ffc1c614 <== NEVER TAKEN rtems_set_errno_and_return_minus_one(ENAMETOOLONG); } name_type = msdos_long_to_short (name, name_len, ffc1c220: 7f 83 e3 78 mr r3,r28 ffc1c224: 7f a4 eb 78 mr r4,r29 ffc1c228: 38 a1 00 68 addi r5,r1,104 ffc1c22c: 38 c0 00 0b li r6,11 ffc1c230: 48 00 05 79 bl ffc1c7a8 MSDOS_DIR_NAME(short_node), MSDOS_NAME_MAX); if (name_type == MSDOS_NAME_INVALID) { ffc1c234: 7c 79 1b 79 mr. r25,r3 ffc1c238: 41 82 03 f0 beq- ffc1c628 <== NEVER TAKEN rtems_set_errno_and_return_minus_one(EINVAL); } /* fill reserved field */ *MSDOS_DIR_NT_RES(short_node) = MSDOS_RES_NT_VALUE; ffc1c23c: 39 20 00 00 li r9,0 /* set up last write date and time */ time_ret = time(NULL); ffc1c240: 38 60 00 00 li r3,0 if (name_type == MSDOS_NAME_INVALID) { rtems_set_errno_and_return_minus_one(EINVAL); } /* fill reserved field */ *MSDOS_DIR_NT_RES(short_node) = MSDOS_RES_NT_VALUE; ffc1c244: 99 21 00 74 stb r9,116(r1) /* set up last write date and time */ time_ret = time(NULL); ffc1c248: 48 00 90 09 bl ffc25250